Study Guides (400,000)
CA (160,000)
York (10,000)
EECS (300)
All (2)
Midterm

EECS-3421A test2-f2016Exam


Department
Electrical Engineering and Computer Science
Course Code
EECS 3421
Professor
All
Study Guide
Midterm

This preview shows pages 1-3. to view the full 16 pages of the document.
2016 November 9 EECS-3421a: Test #2 1 of 16
EECS-3421a: Test #2
“Queries”
Electrical Engineering & Computer Science
Lassonde School of Engineering
York University
Family Name:
Given Name:
Student#:
EECS Account:
Instructor: Parke Godfrey
Exam Duration: 75 minutes
Term: Fall 2016
Instructions
rules
The test is closed-note, closed-book. Use of a calculator is permitted.
answers
Should you feel a question needs an assumption to be able to answer it, write the
assumptions you need along with your answer.
If you need more room to write an answer, indicate where you are continuing the answer.
For multiple choice questions, choose one best answer for each of the following. There
is no negative penalty for a wrong answer.
notation
For schema, the underlined attributes indicate a table’s primary key (and are, hence,
not nullable). Attributes in italics are not nullable. Foreign keys are indicated by FK.
Assume set semantics for relational-algebra expressions.
points
The number of points a given question is worth is marked.
There are five major parts worth 10 points each, for 50 points in total.
Marking Box
1. /10
2. /10
3. /10
4. /10
5. /10
Total /50

Only pages 1-3 are available for preview. Some parts have been intentionally blurred.

2016 November 9 EECS-3421a: Test #2 2 of 16
1. [10pt] Relational Algebra. Quadratic queries! [Short Answer]
For Questions 1a to 1c, use the Colours schema in Figure 1 on page 15 (as used in examples
in class) to write relational-algebra queries for the English questions posed.
a. [2pt] Show customers by cust# and cname who have bought a pink (colour)Lamborghini
(prod#).
b. [2pt] Show products by prod# and pname that are owned by at least two customers.
c. [2pt] For each available colour (colour), show the most expensive product by prod# and
pname that comes in that colour. (In case of ties for most expensive, list all in the tie.)

Only pages 1-3 are available for preview. Some parts have been intentionally blurred.

2016 November 9 EECS-3421a: Test #2 3 of 16
R
A B
a b
c b
e f
g h
i h
S
B C
f b
b d
h a
h c
b e
T
A C
g a
a b
i c
e d
c e
Consider the three tables R,S, & Tabove for Questions 1d & 1e.
d. [2pt] Show the results of RS.
e. [2pt] Show the results of R(ST).
You're Reading a Preview

Unlock to view full version