CSE 444
University of Washington
Winter 2000
Homework 3
Due: Friday February 4
See the web page for some homework guidelines, due dates, and policies.
You will write SQL queries against a DB whose schema and instances are described here in SQL. Assume all relations are in BCNF. This is the same database used in HW2 for the relational algebra queries. You must run your queries on a real system, e.g. SQL Server. You can use the commands in the web page linked above to create and populate your database. SQL Server's Query Analyzer has an option allowing you to open a file in the query window and execute all the commands in the file. Instructions on using the SQL Server installation in the Sieg Hall labs can be found here. You can, of course, use any relational product you like, but you may have to make minor adjustments to the domain names, etc. Finally, beware of one thing: It is possible to write an SQL query that gives the correct answer (for these relation instances) but is not, in general, the right query.
You do not need to remove duplicates in the final result unless explicitly requested to do so. What you should turn in for each question is the SQL query and the result it produced. The query and the result for each question should be together (i.e., don’t give us all the queries then, separately, all the results). All these queries can be posed in SQL, and all return non-empty results from the sample instance provided.
IMPORTANT: This homework must be submitted via email. Your email message
must contain your name (near the top of the message body) and your
SQL queries with their responses, in the proper order. The email must
be received by bart@cs (don't send them to Prof. Vandenberg) before the
beginning of class on the due date. The SQL and results must be included
as text in your message; do not use any attachments. Each query is worth
9 points except the last one, which is worth 10.