Getting value from a table based on one of the possible foreign keys I have following tables:

car_type (Possible values - hatchback, sedan etc)
car_model (has car_type and name of car model and brand for eg. Toyota Camry)
car_version (has car_model and version of car for eg. ZXI)

car_panel (name of car panel for eg. Front Door (Left))
car_panel_problem (has car_panel and other problem type for eg. Dent) 
car_panel_price (has car_panel_problem and price) - price should be based on one or more of car_type, car_model and car_version


Now, I would like to query and know what is the price for a car_panel knowing it's car_version.

if car panel price is there on car version then output it
else if car panel price is there on car model then output it
else if car panel price there on car type then output it
or null


I am thinking of creating car panel price table with nullable car_type, car_model and car_version columns and a price column. Then get the data using 3 queries.

select * from car_panel_price where car_version = &lt;input version&gt;;
select * from car_panel_price where car_model = &lt;input version.car_model&gt;
select * from car_panel_price where car_type = &lt;input version.car_model.car_type&gt;


Is there a better way to define the schema or query?

Please do not downvote if some information is incomplete. I will add it if you ask.
You're ganging the tables together in a very awkward manner. Say you have a table of all car types, a table of all car models, a table of all car versions, a table of all car parts and finally a table with problems (dent, etc). Then you can have one intersection table that relates all of these together with the price to fix the problem. Using simplified data, a row of this table might look like this:

S, TC, Z, FDP, D, $250


This row shows that the price to repair a dent in the front door panel of a Toyota Camry sedan, ZXI is $250.