Sailors Schema Instance Queries
Sailors Schema Instance Queries
G.JAYA KRISHNA
Create the Relations according to the given schema and insert the following data:
13. Find the sailor ids of sailors whose rating is better than some sailor called Watson.
14. Find the sailor ids of sailor whose rating is better than all sailors who reserved a boat
104.
15. For each rating find the average age of sailors at that level of rating.
16. For each boat which was reserved by at least 2 distinct sailors find the boat id and the
average age of sailors who reserved it.
17. Find the sum, Max, Min, Average age of sailors.
18. Retrieve the youngest sailor details for each rating level?
19. Retrieve the names of Sailors who have reserved either boat number 102 or 104.
20. For each INS boat find the number of reservations for that boat.
21. Display the total number of sailors reserved by each boat.
22. Find the average age of sailors for each rating level that has at least two sailors.
23. Retrieve the number of sailors, total salary of sailors for each rating level which should
have at least 2 such sailors?
24. Print the details of sailors whose name length is more than 3 characters.
25. Increase the rating of Sailors by 20% whose rating is less than 5.
26. Find the name and age of sailors whose names starts with “M” and ends with “A” and
has at least three characters.
27. Display distinct age of sailors whose rating is between 5 and 9.
28. Retrieve the names of 4 sailors who have highest rating.
29. Find age of the youngest sailor with age >=18 for each rating with at least 2 sailors.
30. Change the reserved date of boats by adding three days to current date and boat name
contains “INS” as a substring and reserved by more than or equal to 2 sailors.