I have PHP/MYSQL car rental site. In the MYSQL table i store
A quick an dirty attempt below. I'd move prices and insurence costs in dedicated tables, each having a
Select brand,type,ac,seats FROM cars LEFT JOIN prices ON cars.id = prices.car_id LEFT JOIN insurence_costs ON cars.id = insurence_costs.car_id WHERE licensePlate = 'HH-OH-234' AND prices.days = 28 AND insurence_costs.days = 28
Update: Added the license plates. I'd just put them in car specs. In general they are car related but may change sometime in future. If they change quite often I'd rather move them in a dedicated table too.
I would actually save the price per renting day depending on the overall renting span to the db. That way, you could do something like
SELECT price FROM prices WHERE car_id = 123 AND days = MAX(days);
That way you could multiply the "last" price with the actual amount of renting days for any rents above 30 days. But thats up to pricing definitions.