{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

354.3-08.MidtermSolution

354.3-08.MidtermSolution - CMPT-354 D1 Fall 2008 Instructor...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPT-354 D1 Fall 2008 Instructor: Martin Ester TA: Gustavo Frigo Midterm Exam with Solution Time: 50 minutes Total marks: 100 Problem 1 (Queries in relational algebra and SQL) (40 marks) Consider the following schema of a computer database : Product(model: string , maker: string) PC(model: string , speed: float, ram: float, hd: int, price: float) Laptop(model: string , speed: float, ram: float, hd: int, screen: int, price: float) Printer(model: string , color: string, type: string, price: float) A Product is either a PC, a Laptop or a Printer and must have a tuple in the corresponding table. There is a foreign key constraint on the model of PCs, Laptops and Printers referencing the primary key model of Product. You can assume that the maker attribute uniquely identifies the manufacturer of a Product. Assume that all of the non-key attributes allow NULL values. Formulate each of the following queries in relational algebra (RA) and in SQL. Make sure that you do not return duplicate answers. If the query cannot be explained in a language, state this and explain why not. a) Find the manufacturers (i.e. makers of Products) that make Laptops, but not Printers. (20 marks) )) ( ( )) ( ( ker ker Printer Product Laptop Product ma
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern