0% found this document useful (0 votes)
5 views2 pages

SQL Queries for Hotel and Teacher Data

The document outlines SQL test tasks involving the creation and manipulation of two tables: Hotels and Bookings, including adding and removing columns, displaying specific booking details, and performing various queries related to hotel and teacher data. It includes tasks such as updating records, deleting entries, and displaying information based on specific criteria. Additionally, it covers operations related to teacher data, including salary adjustments and filtering based on qualifications and joining dates.

Uploaded by

Sangee
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

SQL Queries for Hotel and Teacher Data

The document outlines SQL test tasks involving the creation and manipulation of two tables: Hotels and Bookings, including adding and removing columns, displaying specific booking details, and performing various queries related to hotel and teacher data. It includes tasks such as updating records, deleting entries, and displaying information based on specific criteria. Additionally, it covers operations related to teacher data, including salary adjustments and filtering based on qualifications and joining dates.

Uploaded by

Sangee
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like