The document describes the structure of three database tables - SAILOR, BOAT, and RESERVE - including their attributes and constraints. It then lists 15 tasks related to creating the tables, inserting data, and querying the tables to return specific records or aggregated results.
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 ratings0% found this document useful (0 votes)
68 views
DBMS Assignment Day 6
The document describes the structure of three database tables - SAILOR, BOAT, and RESERVE - including their attributes and constraints. It then lists 15 tasks related to creating the tables, inserting data, and querying the tables to return specific records or aggregated results.
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
ASSIGNMENT:6
TABLE NAME: SAILOR
Attribute Data type Constraints
SID varchar2 (4) primary key and start with small s
SNAME varchar2 (15) initial letter capital MNAME varchar2 (15) SURNAME varchar2 (15) not null RATING number (2) default zero AGE number (3, 1) not null
TABLE NAME: BOAT
Attribute Data type Constraints
BID Varchar2 (5) primary key & start with small b
BNAME varchar2 (10) all upper case COLOR varchar2 (6) red, green, blue
TABLE NAME: RESERVE
Attribute Datatype Constraints
SID varchar2 (4) Foreign key referencing sailor
BID Varchar2 (5) Foreign key referencing boat DAY date <1-JAN-2000 SID, BID composite primary key
1. Create the tables and add the constraints.
2. Insert the values in the table so that it can satisfy the above constraints. 3. Show names under the heading of names_of_sailors and add 2 to age. 4. Select all records from sailors in ascending order by name 5. Show all sailors name. 6. Select all distinct sailors name 7. Show all distinct sailors names, ratings that have rating between 5 and 10. 8. Select all records from sailors in ascending order by rating and descending order by age. 9. Select all records from sailors whose rating>7. 10. Find records for sailor name Horatio and age=35.4. 11. Select records for name beginning with 'B'. 12. Select records for name containing 'B'/'b'. 13. Select names for rating present 14. Select names for rating absent. 15. Find sid of sailor who has reserved boat ‘b14’.