{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

HW1AU06

# HW1AU06 - Question 4/8 Relations R and S have attributes a...

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

CSE 671 – Databases II Homework #1 ( /40) Due: 10/03/06 before class Question 1- ( /6) Suppose we have two relations R(A, B) and S(A , B) with the same schema. The only key of R is {A}; the only key of S is {A} also. Let relation T(A, B) be the set union of R and S, i.e., T = R S. What are the keys of T? Justify your answer. Question 2- ( /12) Suppose that two relations R(A, B) and S(A, B) have exactly the same schema. Which of the following equalities hold in relational algebra? Briefly justify your answer. I. R S = R - (R - S) II. R S = S - (S - R) III. R S = R × S Question 3- ( /8) Provide an example using the two different relational set operators that demonstrates that evaluating relational operators in different orders may produce different resulting tables.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Question 4- ( /8) Relations R and S have attributes a and b . Then, which of the properties below is (are) true for the following relational algebra queries: Q1: π a ( R ) ∩ a ( S ) Q2: a ( R ∩ S ) (1) Q1 and Q2 produce the same answer. (2) The answer to Q1 is always contained in the answer to Q2. (3) The answer to Q2 is always contained in the answer to Q1. (4) There is no such relationship between answers of Q1 and Q2. Briefly explain your answer. Question 5-( /6) Assume the presence of a transaction table shown: Transaction Tno Vno Amount 1001 2 16.00 1002 2 19.00 1003 3 25.00 What does the following SQL queries return? select count(*), sum(amount) from transaction group by vno;...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

HW1AU06 - Question 4/8 Relations R and S have attributes a...

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

View Full Document
Ask a homework question - tutors are online