0% found this document useful (0 votes)
17 views1 page

Set-3 08/01/2023 (Tuesday) DBMS Lab: Execute SQL Commands For The Following Question Based On The Tables Above

Uploaded by

Pauline Paul
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)
17 views1 page

Set-3 08/01/2023 (Tuesday) DBMS Lab: Execute SQL Commands For The Following Question Based On The Tables Above

Uploaded by

Pauline Paul
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
You are on page 1/ 1

Set-3

08/01/2023 (Tuesday) DBMS Lab


1. Create the table definitions as below:
Sailors (sid: integer, sname: string, rating: integer, age: real)
Boats (bid: integer, bname: string, color: string)
Reserves (sid: integer, bid: integer, day: date)
2. Enter the values as below:

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy