a) Create a new database as test.db. Create the tables with the following schema using DDL commands. Sailors (sid: PK, sname: must be unique, rating: Between 0 and 5, age) Boats (bid: PK, bname, color (Must be blue or black only) Reserves (rid: PK, sid: FK, bid: FK, date: Default value: current date.) Note: If the record from boats is updated, its value should be set null in Reserves.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter13: Views
Section: Chapter Questions
Problem 7MC
icon
Related questions
Question
a) Create a new database as test.db. Create the tables with the following schema using
DDL commands.
Sailors (sid: PK, sname: must be unique, rating: Between 0 and 5, age)
Boats (bid: PK, bname, color (Must be blue or black only)
Reserves (rid: PK, sid: FK, bid: FK, date: Default value: current date.)
Note: If the record from boats is updated, its value should be set null in Reserves.
b) Apply following queries.
1) A new reservation of boat with id 208 and sailor with id S03 has been done on 2019-12-26. Store thi.
data.
2) Find all the sailors with a rating below 3.
3) Create a view that will display the names of sailors who have reserved boat with id 109.
4) Find the boat ids that are not reserved.
5) Add a new column design to the Boat table.
6) Show the names of sailor and color of boat who have reserved black color boat.
7) Delete the reservations made on date 2019-10-12.
8) Find the average age of all sailors.
Transcribed Image Text:a) Create a new database as test.db. Create the tables with the following schema using DDL commands. Sailors (sid: PK, sname: must be unique, rating: Between 0 and 5, age) Boats (bid: PK, bname, color (Must be blue or black only) Reserves (rid: PK, sid: FK, bid: FK, date: Default value: current date.) Note: If the record from boats is updated, its value should be set null in Reserves. b) Apply following queries. 1) A new reservation of boat with id 208 and sailor with id S03 has been done on 2019-12-26. Store thi. data. 2) Find all the sailors with a rating below 3. 3) Create a view that will display the names of sailors who have reserved boat with id 109. 4) Find the boat ids that are not reserved. 5) Add a new column design to the Boat table. 6) Show the names of sailor and color of boat who have reserved black color boat. 7) Delete the reservations made on date 2019-10-12. 8) Find the average age of all sailors.
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Database Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning