354.3-08.MidtermSolution

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

Info iconThis 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
Background image of page 1

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

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

This note was uploaded on 10/07/2009 for the course CS 12601 taught by Professor Kewang during the Spring '09 term at Simon Fraser.

Page1 / 3

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online