



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!




CMSC 424–0201 Fall 2004 Quiz 2 (50 points, 50 minutes) Thu., 18th Nov., 2004 © c Sudarshan S. Chawathe 2004
Name:
This quiz is open book, open notes, but there can be no sharing of any material, and no communication except with me. You can use the Internet, but only as a library. If you are not sure if something is allowed, check with me. Some questions in this quiz use the database schema and sample instance depicted below. [The following details are identical to those in quiz 1 and the midterm exam.] The Boxes table records information about boxes used by a packing store. For each type of box, it stores the box’s name and supplier, the maximum weight of its contents (in pounds), its price in dollars, its dimensions (width, depth, and height) in inches, and the number available (inventory). The Products table records information about products stocked by the packing store for its customers. For each product, it stores the product name, customer name, weight (in pounds), and dimensions (as in Boxes). The type of each attribute appears directly below its name. Primary key attributes are underlined. When asked for queries, you must provide answers that work for all possible database in- stances, not just the example instance depicted below. For brevity, relational algebra expres- sions abbreviate the schemas of the Boxes and Products tables as B(N, S, L, P, W, D, H, I) and P (N, C, L, W, D, H), respectively. The following tables are repeated on the last page of the quiz. You may detach that page and use it for reference. There is no need to reattach it.
Boxes name supplier load price width depth height num varchar(20) varchar(20) float decimal(6,2) float float float integer small cube box-o-rama 10.5 2.99 24 24 24 100 large cube box-o-rama 20.0 4.99 50 50 50 42 small cube box world 1.0 1.99 8 8 8 22 economy pack box world 1.5 0.99 9 12 0.25 9
Products pname customer weight width depth height varchar(20) varchar(20) float float float float PDR Alice Armstrong 5 8 10 6 bookshelf speaker Bob Beeri 15 24 13 16
r^1 (x) r^2 (x) c^2 r^1 (x) r^3 (y) w^1 (y) a^1 r^3 (x) w^3 (x) c^3
Material here will not be graded. You may detach and discard this page.
Boxes name supplier load price width depth height num varchar(20) varchar(20) float decimal(6,2) float float float integer small cube box-o-rama 10.5 2.99 24 24 24 100 large cube box-o-rama 20.0 4.99 50 50 50 42 small cube box world 1.0 1.99 8 8 8 22 economy pack box world 1.5 0.99 9 12 0.25 9
Products pname customer weight width depth height varchar(20) varchar(20) float float float float PDR Alice Armstrong 5 8 10 6 bookshelf speaker Bob Beeri 15 24 13 16