DOC PREVIEW
UW CSE 444 - Study Guide

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Homework 3CSE444This homework will give you practice writing SQL statements and using the query facility of SQL Server. The queries that you'll implement in SQL Server are based on a movies database. The schema for the movie database is as follows:Customers CustID LastName FirstNameInventoryTapeID MovieIDMoviesMovieID MovieNameMovieSupplierSupplierID MovieID PriceOrdersOrderID SupplierID MovieID CopiesRentalsCustomerID TapeID CkoutDate DurationSuppliersSupplierID SupplierNameWrite out SQL statements for the following 10 queries about the movie database. Enter the SQL code in the ISQL_w facility of SQL Server (as talked about in class last Friday). Select the 'cse444sql' database in the DB combo box of the ISQL_w window, (that's the movie database described above despite the undescriptive name). Enter your query in thequery tab and check your results in the result tab.To turn in: Please turn in a print out of your SQL queries and the number of tuples returned in the resulting tables for each one. (The tables themselves may be long, so don't bother printing those out.)Please note that these questions may be interpreted in different ways. Just state your interpretations of them if you feel there is any ambiguity.1. Which movies are supplied by "Joe's House of Video" or "Video Warehouse"?2. Which movie was rented for the longest duration (by any customer)?3. Which suppliers supply all the movies in the inventory? (Hint: first get a list of the movie suppliers and all the movies in the inventory using the cross product. Then find out which of these tuples are invalid.)4. How many movies in the inventory does each movie supplier supply? That is, for each movie supplier, calculate the number of movies it supplies that also happen to bemovies in the inventory.5. For which movies have more than 4 copies been ordered?6. Which customers rented "Fatal Attraction 1987" or rented a movie supplied by "VWSVideo"?7. For which movies are there more than 1 copy in our inventory? (Note that the TapeID in inventory is different for different copies of the same MovieID)8. Which customers rented movies for 5 days or more?9. Which supplier has the cheapest price for the movie "Almost Angels 1962"?10. Which movies aren't in the


View Full Document

UW CSE 444 - Study Guide

Documents in this Course
XML

XML

48 pages

SQL

SQL

25 pages

SQL

SQL

42 pages

Recovery

Recovery

30 pages

SQL

SQL

36 pages

Indexes

Indexes

35 pages

Security

Security

36 pages

Wrap-up

Wrap-up

6 pages

SQL

SQL

37 pages

More SQL

More SQL

48 pages

SQL

SQL

35 pages

XML

XML

46 pages

Triggers

Triggers

26 pages

Load more
Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?