Today we will work on the creation of 2 tables with relationship.
This one is not complex but you should be familiar with Database Normalization. You can read a brief about it on Guru99.
More resources will be made available while browsing for the solution of this exercise.
We need to store in a database the following information :
- Car sells
- A car belongs to a brand, has a color and a referring price and a year of creation
- A car can be bought by a person only (no company…) at a specific price on a specific date.
Build 3 tables covering the model we need to implement and make sure to preserve consistency and transitivity in case of update and delete.
Note : try to optimize the size of the fields and add keys and indexes when you think they are relevant.