Q1: Find the boat which is reserved by ALL the sailor whose rating is 10 [ ] statement = """ ... """ res = cur.execute(statement) relational_schema = [x[0] for x in res.description] print(relational_schema) print('------------') for x in res: print(x)
Added by Carolyn V.
Close
Step 1
This is a division query. Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 74 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Akash M.
Relational Algebra (50 pts): Consider the following database schema that keeps track of Sailors, Boats and the boats reserved by sailors. Sailors(sid, sname, rating, age) Boats(bid, bname, color) Reserves(sid, bid, date) Keys are underlined in each relation. Specify the following queries in Relational Algebra using above database schema. (a) find names of sailors who have reserved at least one boat (b) find sid's of sailors who have reserved a red and a green boat (c) find names of sailors who have reserved boat #103 (d) find sid's of sailors who have not reserved boats (e) find names of sailors who made at least 3 reservations (f) find the name of sailors with the highest rating (g) find the name and age of oldest sailors (h) find the age of youngest sailor for each rating level (i) find the names of sailors who reserved more red boats than green (j) find names of sailors who have reserved all the boats
Kelan H.
Display the order number and the shipment status (using the column "Status") of each order. The current status of those orders that have not been shipped should be "Not Shipped", and the status of those shipped orders should be "Shipped" (Please use SQL language to execute this statement). How many months are between today and 42/14/2012? Please provide the number of months as the nearest integer (whole number) (Please use SQL language to execute this statement). How many months does your query turn? Use one SQL statement with subqueries to display the category name and the average book retail price of the book category that has the lowest average book retail price (Please use SQL language to execute this statement). What is the category value? Use one SQL statement with subqueries to display the title and the publisher name of the book that generates the highest total profit from all orders stored in the database. The book's title is publisher Write an SQL block using a WHILE loop statement to display the result when Y=837+3+4*4+98*98+99*99+100*100 (Please provide your SQL block here).
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD