Cognizant Handson - Car & owner details based on car type

 

Car & owner details based on car type


Write a query to display car id, car name and owner id of all the cars whose car type is 'Hatchback' or 'SUV'.  Sort the result based on car id.

(Hint: Use  CARS tables to retrieve records. Data is case-sensitive. E.g: Car_type='Hatchback'. Use IN operator)

NOTE: Maintain the same sequence of column order, as specified in the question description

Solution:

select car_id,car_name,owner_id from cars where car_type='Hatchback' or car_type='SUV' order by car_id;

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.