CZ2007 Q1SS5 PDF
CZ2007 Q1SS5 PDF
CZ2007 Q1SS5 PDF
Name: ___________________________________________________
Consider the following schema containing bank account information. Primary Keys are in
m
er as
bold.
co
eH w
CUSTOMERS(customer_name, address)
ACCOUNTS(account_number, balance)
o.
ACCOUNT_OWNERS(customer_name, account_number)
rs e
ou urc
Express the following queries using Relational Algebra (RA). You may use the following
operators:
σ (selection), Π (projection), ∪ (union), ∩ (intersection), − (difference),
o
(i) Find the owner of the account with the highest balance.
R1 := γMAX(balance)MaxBal ACCOUNTS
ed d
CSC206-CPE303/Quiz 1/2013 1
This study source was downloaded by 100000789567793 from CourseHero.com on 02-28-2023 23:12:20 GMT -06:00
https://www.coursehero.com/file/17102913/QUIZ-1-SSP5/
https://www.coursehero.com/file/34456309/CZ2007-Q1SS5pdf/
(ii) Find the customer(s) who does not have any account with balance > 0.
m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
(iii) Find the 100 accounts whose balances are the lowest.
R2 := ACCOUNT ⋈ balance>=bal R1
ar stu
CSC206-CPE303/Quiz 1/2013 2
This study source was downloaded by 100000789567793 from CourseHero.com on 02-28-2023 23:12:20 GMT -06:00
https://www.coursehero.com/file/17102913/QUIZ-1-SSP5/
https://www.coursehero.com/file/34456309/CZ2007-Q1SS5pdf/
Question 2 (26 marks)
Consider a relation R(A,B,C,D,E) and FD’s ABC, BCD, ABD, and EC.
{ABE}
m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
(ii) Is this relation in 3NF? Why or why not? If it's not, decompose the relation into
collections of relations that are in 3NF.
The relation is not in 3NF, since each given FD violates the requirements of 3NF.
ed d
CSC206-CPE303/Quiz 1/2013 3
https://www.coursehero.com/file/17102913/QUIZ-1-SSP5/
This study source was downloaded by 100000789567793 from CourseHero.com on 02-28-2023 23:12:20 GMT -06:00
https://www.coursehero.com/file/34456309/CZ2007-Q1SS5pdf/
Powered by TCPDF (www.tcpdf.org)