Set-3 08/01/2023 (Tuesday) DBMS Lab: Execute SQL Commands For The Following Question Based On The Tables Above
Set-3 08/01/2023 (Tuesday) DBMS Lab: Execute SQL Commands For The Following Question Based On The Tables Above
Execute SQL commands for the following question based on the tables above
1) Find the names and ages of all sailors
2) Find all sailors with a rating above 7.
3) Find the names of sailors who have reserved boat number 103.
4) Find the names and ages of all sailors.
5) Find the sids of sailors who have reserved a red boat.
6) Find the names of sailors who have not reserved a red boat.
7) Find the colors of boats reserved by Lubber.
8) Find the names of sailors who have reserved at least one boat.
9) Compute increments as rating= rating+1 for the ratings of persons who have sailed
two different boats on the same day.
10) Find the ages of sailors whose name begins and ends with B and has at least three
characters.
11) Find the names of sailors who has reserved a ‘red’ or a ‘green’ boat.
12) Find the names of sailors who has reserved a ‘red’ and a ‘green’ boat.
13) Find the name of sailors who has rating=10 or has reserved boat 104.
14) AGGREGATE OPERATORS: Find the average age of all sailors.
15) Find the average age of sailors with a rating of 10.
16) Find the name and age of the oldest sailor.
17) Count the number of sailors.
18) Count the number of different sailor names.
19) Find the names of sailors who are older than the oldest sailor with a rating of 10.
(nested)
20) NESTED QUERIES: Find the names of sailors who have reserved boat 103
21) Find the names of sailors who have reserved a red boat.
22) Find the names of sailors who have not reserved a red boat.
23) Find the name of sailors who has reserved ‘red’ and a ‘green’ boat.
24) Find the sids of sailors who have reserved ‘red’ but not ‘green’ boats.
25) Find the name of sailors who have reserved boat number 103 using co-related
nested query.