

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Spring 2009 Homework(2): SQL Due on: 03/09/2009, Monday. Hardcopy in the class. Electronic version turned in before 12:00pm No late submission accepted.
Consider the following schema:
Customer (SSN: integer, cname: string, cgender: string, ccity: string) BuyVehicle (SSN: integer, vin: integer, price: real, byear: integer) Vehicle (vin: integer, vmaker: string, vmodel: string, vyear: integer)
Suppose SSN is a 6-digit integer and vin is a 5-digit integer. The key fields are underlined, and the domain of each field is listed after the field name. Consider the following queries.
You should do the following. Write queries (1) through (5) in Relational Algebra and Tuple Relational Calculus. Submit hardcopy of answers in class as given above. Write queries (1) through (10) in SQL. Your answers must be correct for any
valid state of any table. Submit your answers in hardcopy in class. Note: Your answers must be printed. Credits will be deducted if your answers are illegible. You should also test your SQL queries on Oracle. You can find tips on "how to connect to and perform a query on Oracle" on the course webpage: http://www.cs.uic.edu/~i480/oracle.html Write all your SQL queries into a "yourloginname.sql" file. Please remember to substitute the "yourloginname" with your real login name and include the ";" after each query. Credits will be deducted if your SQL queries can not run on Oracle. Turnin your .sql file from bert by using the following command: [bert]-> turnin -c cs480 -p sql yourloginname.sql