Giter Site home page Giter Site logo

car-dealership-using-postgresql's Introduction

Car Dealership using PostgreSQL

I created an Entity Relationship Diagram (ERD) and used PostgreSQL to create a database for a fake car dealership.

ERD Thought Process

I created 8 different tables. Here's my understanding of the relationship between each table:

Customer - Purchase_Invoice (and Purchase_History) - one to many

  • A single customer can purchase many cars, but a car can't be purchased by many customers
  • The same logic applies to the Purchase_History.

Customer - Service_Invoice - one to many

  • A customer can purchase several services for their car, but only one service invoice can belong to one customer
  • The same logic applies to the Service_History.

Sales_Staff- Purchase_Invoice - one to many

  • A salesman can sell many cars but each invoice can only be sold by one salesman
  • The same logic applies to the Purchase_History.

Mechanic_Staff- Service_Invoice - many to many

  • Several mechanics can work on several different cars.
  • The same logic applies to the Service_History.

Car_Inventory- Purchase_Invoice - one to one

  • One car can only be purchased once and one invoice can only belong to one car.
  • The same logic applies to the Purchase_History.

Car_Inventory- Service_Invoice - one to one

  • One car can only have a single service invoice, and one invoice only belongs to one car.
  • The same logic applies to the Service_History.

License

Please direct any questions or comments to Andre.

car-dealership-using-postgresql's People

Contributors

alonardo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.