Assignment5
Assignment5
USE BOATING;
sname VARCHAR(50),
rating INT,
age INT
);
-- Output
-- 2. Create the Boats table
bname VARCHAR(50),
color VARCHAR(20)
);
-- Output
sid INT,
bid INT,
day DATE,
);
-- Insert data into Reserves table
-- Output
-- Queries
-- 1. Find all information of sailors who have reserved boat number 101.
-- Output
-- 2. Find the name of boat reserved by Bob.
));
-- Output
-- 3. Find the names of sailors who have reserved a red boat, and list in the order of age.
)) ORDER BY age;
-- Output
-- 4. Find the names of sailors who have reserved at least one boat.
ON s.sid = r.sid;y
-- Output
-- 5. Find the ids and names of sailors who have reserved two different boats on the same day.
FROM Sailors S
-- Output
-- 6. Find the ids of sailors who have reserved a red boat or a green boat.
));
-- Output
FROM Sailors
-- Output
-- 8. Count the number of different sailor names.
-- Output
-- Output
-- 10. Find the average age of sailors for each rating level that has at least two sailors.
-- Output