This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: SQL: Queries, Constraints, Triggers 49 9. Find the sid s of suppliers who supply a red part or a green part. 10. For every supplier that only supplies green parts, print the name of the supplier and the total number of parts that she supplies. 11. For every supplier that supplies a green part and a red part, print the name and price of the most expensive part that she supplies. Answer 5.2 Answer omitted. Exercise 5.3 The following relations keep track of airline ight information: Flights( no: integer , from: string , to: string , distance: integer , departs: time , arrives: time , price: real ) Aircraft( aid: integer , aname: string , cruisingrange: integer ) Certified( eid: integer , aid: integer ) Employees( eid: integer , ename: string , salary: integer ) Note that the Employees relation describes pilots and other kinds of employees as well; every pilot is certified for some aircraft, and only pilots are certified to y. Write each of the following queries in SQL. ( Additional queries using the same schema are listed in the exercises for Chapter 4. ) 1. Find the names of aircraft such that all pilots certified to operate them have1....
View Full Document
- Fall '12