Advertisements
Advertisements
प्रश्न
Pranav is managing a Travel Database and needs to access certain information from the Hotels and Bookings tables for an upcoming tourism survey. Help him extract the required information by writing the appropriate SQL queries as per the tasks mentioned below:


- To display a list of customer names who have bookings in any hotel of 'Delhi' city.
- To display the booking details for customers who have booked hotels in 'Mumbai', 'Chennai', or 'Kolkata'.
- To delete all bookings where the check-in date is before 2024-12-03.
- A. To display the Cartesian Product of the two tables.
OR
B. To display the customer’s name along with their booked hotel’s name.
कोड लेखन
Advertisements
उत्तर
-
SELECT Customer_Name FROM Hotels, Bookings WHERE Hotels.H_ID = Bookings.H_ID AND City = 'Delhi'; -
SELECT Bookings.* FROM Hotels, Bookings WHERE Hotels.H_ID = Bookings.H_ID AND City IN ('Mumbai', 'Chennai', 'Kolkata'); -
DELETE FROM Bookings WHERE Check_In <'2024-12-03'; -
A.
SELECT * FROM Hotels, Bookings;OR
B.SELECT Customer_Name, Hotel_Name FROM Hotels, Bookings WHERE Hotels.H_ID = Bookings.H_ID;
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
