Design db schema in correct way for parent child kind of requirement I am creating schema of tables. But not able to understand best way to do it.



Following are the tables:


  
  Car Model - It contains all car models with types.  For eg. Mercedes(brand) - GLA 250(model) - Sedan(type)
  Car Panel - It will contain all car panels. For eg. Fender(panel name)
  Car Panel Price By Type - It will contain car panel price by type. For eg. Sedan(type) - Fender(car panel id) - 2500(price)
  Car Panel Price By Model - It will contain car panel price by Model. For eg. Mecedes GLA 250(car model id) - Fender(car panel id) -
  2700(price)
  Booking Package - It will contain all the order related fields. For eg. Order Id - Mercedes GLA 250 (car model id)
  Booking Package Panels  - It will contain all the panels in order along with their price. For eg. Order id - Car Part Price By Model - Car Part Price By Type
  


Here, It will contain car panel price by model if it exists other wise car panel price by type. Because it can be possible that for some models, we don't add the price and use the type level pricing.

Another way to store Order panels.


  For eg. Order id - Fender (panel id) - 2500(price from model or type)


Please suggest which is better way to design this order panel table.
This is an impressive ERD. Are you sure you want to have every table inherit from CreatedAtAbstractBase?

The tables CarTypePanelPrice and CarModelPanelPrice are almost the same, differing only by car_model identifier. I would have the car_model field be optional (NULLable) and merge both tables. You'll know if one record is one type or the other if that field is NULL or NOT NULL. The orders/bookings seem alright.