PM SHRI KV COIMBATORE
SQL TEST
1. Using the tables Hotels and Bookings, write SQL queries to:
[Link] both tables.
[Link] mobile no. column in hotels column
[Link] mobile no column.
4. Display booking details for customers who booked hotels in Mumbai, Chennai, or Kolkata.
[Link] new record in hotel table.
[Link] structure of Bookings table.
[Link] the CHECK_OUT date to 2025- 02-05 for the booking whose B_ID is 202.
[Link] the names of all hotels whose city starts with the letter 'B'.
[Link] all distinct cities where hotels are located.
[Link] the details of all hotels that have a star rating greater than or equal to 4.
[Link] the CUSTOMER_NAME column size to VARCHAR(150) in the Bookings table.
12. Delete all bookings where check-in date is after 2024-12-03.
13. Display the Cartesian product of the two tables.
[Link] the customer names who booked 5-star hotels.
[Link] hotel IDs that have more than 3 bookings.
[Link] all hotel names and their star ratings sorted by star rating in descending order.
17. Display customer's name with their booked hotel's name.
Q2.
Q3.
(i) Display name and salary of all Teachers in alphabetical order of their names.
(ii) Display details of Teachers who joined on Wednesday.
(iii) Display names of Teachers, their salary and StreamName from both the tables.
(iv) Display the details of all Teachers whose salary is more than 60000 and have joined
before the year 2024.
(v) Display the name of Teachers who is teaching Commerce Stream.
vi) Display maximum Daysperweek for each T_Id from the table Stream.
vii) Display total number of records in the table Teacher.
viii) Increase the salary by 25% of those teachers whose qualification is [Link].
ix) Delete the records from Stream table whose subject is English.