What is the best way to create this MySQL database?
I have cars , fuels and motor oils . Each car can use any number of fuels and any number of motor oils . What would be the best way to create this database?
So, one car can have one or more fuels and one or more motor oils .
Therefore, I need to have the cars , fuels and motor_oils in my database. Now, since fuels and motor_oils have some similar properties like price, date_produced, etc. Would it be wise to create another table called products ?
When using OOP, I will have a Product entity, Fuel and MotorOils will expand Product , and this method has properties defined in Product .
How do I create this in a Mysql database? Is there such a thing as inheritance in MySQL? I know that a relationship database has no inheritance, and that there is a way to mimic this in MySQL, just need someone to better explain how this is done?
source share