Question: Consider the following structure sailor (sid, sname, rating, age) boat (bid, bname, color) reserves (sid, bid) create database boats; use boats; create table sailor (

Consider the following structure sailor (sid, sname, rating, age) boat (bid, bname, color) reserves (sid, bid) create database boats; use boats; create table sailor ( sid int auto_increment not null primary key, sname varchar(100), rating int, age int ); create table boat ( bid int auto_increment not null primary key, bname varchar(100), color varchar(100) ); create table reserves ( sid int not null, bid int not null ); insert into boat (bname, color) values ('Super Storm','Blue'); insert into boat (bname, color) values ('Black Pearl','Black'); insert into boat (bname, color) values ('White Thunder','White'); insert into boat (bname, color) values ('Big Thunder','Blue'); insert into sailor (sname,rating, age) values ('Albert Smith',9,30); insert into sailor (sname,rating, age) values ('George Smith',5,20); insert into sailor (sname,rating, age) values ('Henrich Smith',10,8); insert into sailor (sname,rating, age) values ('Alberta Smith',5,50); insert into reserves (sid,bid) values (1,1),(2,2),(3,3),(1,3),(4,1),(3,2),(4,1);
 0) Create the tables above
1) Find the colors of boats reserved by Albert Smith.
2) Find all sailor ids of sailors who have a rating of at least 8 or reserved boat id 2.
3) Find the names of sailors who have reserved a boat whose name contains the string "storm".
4) Find the sailor ids of sailors with age over 20 who have reserved a boat whose name includes the string "thunder" that is blue
5) Find the names and ratings of every person who's name starts with 'Al'
6) Find the color of every boat reserved by George Smith
7) Give a list of people who have reserved 'White Thunder'
8) Give a list of the ratings for people who have reserved 'Super Storm'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!