For best viewing experiance please view at https://github.com/dtaivpp/car_company_database
Also, please note these instructions are written from the perspective of the macOS however can still work with small modifications on windows or linux.
This database is designed to handle the everyday operations of a major car company. It provides functionality to view the transactions of dealers, track car inventory, and maintain the models and avaliable options of cars. See the below file to view the Entity Relationship diagram for the database.
The databases uses triggers, primary, and foreign keys to ensure the constraints of the database are maintianted upon insertion. Each entitiy has an autogenerated ID to ensure they are unique and to ensure that the transformations are easier.
*Note this is using the already built database
- First go ahead and download sqlite from here: https://www.sqlite.org/index.html using version 3.24.0
- After installing open a commandline or terminal and clone the repositiory using
git clone https://github.com/dtaivpp/car_company_database.git
- From the terminal then navigate to the directory that you just cloned called car_company_database
- Next run
sqlite3 Car_Database.db
to open the database in the terminal
- Use steps 1 - 3 from the previous section
- Alternatively you can build the database from the source files by running
sqlite3 .open {Name for your database here}.db
to create a new database - Next you would run from your sqlite shell
.read Create_Tables.sql
to create the tables - Run
.read Triggers.sql
from your sqlite shell to create the triggers to ensure inserts do not break any rules of the database such as adding a model with an invalid option set id. - Finally you would run
.read Insert.sql
from your sqlite shell to populate the tables with the data
- If your database is alredy open skip to step 3. Otherwise open up a terminal and navigate to the directory your database is in.
- Next run
sqlite3 Car_Database.db
to open the database in the terminal - Next you would run from your sqlite shell
.read {Query Name Here}.sql
without the curls to run the query from the file