Relational Algebra Tutorial

Relational Algebra Tutorial These exercises are taken from the book “Database Management Systems” by Ramakrishnan/Gehrke, Chapter 4. Consider the following schema: Suppliers(sid: integer, sname : string, address : string) Parts(pid: integer, pname : string, colour : string) Catalog(sid: integer, pid: integer, cost : real) The relation Suppliers stores supplies and the key of that relation is sid. The relation Parts stores parts, and pid is the key of that relation. Finally, Catalog stores which supplier supplies which part at which cost. The key is the combination of the two attributes sid and pid. 1. Write queries in relational algebra Write the following queries in relational algebra and SQL. 1. Find the snames of suppliers who supply some red part. 2. Find the sids of suppliers who supply some red or green part. 3. Find the sids of suppliers who supply some red part or are based at 21 George Street. 4. Find the sids of suppliers who supply some red part and some green part. (Hint: use intersection of relations or join the same relation several times) 5. Find pairs of sids such that the supplier with the first sid charges more for some part than the supplier with the second sid. (Hint: you may want to use renaming to get two copies of Catalog)

Related docs
Relational Algebra
Views: 0  |  Downloads: 0
RELATIONAL-ALGEBRA
Views: 8  |  Downloads: 0
Relational Algebra
Views: 32  |  Downloads: 2
ER to Relational Mapping Tutorial
Views: 87  |  Downloads: 11
relational algebra
Views: 466  |  Downloads: 21
Introduction to Relational Databases
Views: 9  |  Downloads: 1
Other docs by techmaster
test[1]
Views: 191  |  Downloads: 0
Crim Pro Lecture[1]
Views: 406  |  Downloads: 13
regs-x
Views: 275  |  Downloads: 4
Remedies Checklist
Views: 530  |  Downloads: 35
Sample News Release
Views: 876  |  Downloads: 18
Catalogue and price list enclosed
Views: 427  |  Downloads: 20
CALDWELL - Sara Pak Outline Spring[1]
Views: 153  |  Downloads: 1
Subchecking Instructions
Views: 442  |  Downloads: 3
2006 Publ 502 - Medical and Dental Expenses
Views: 175  |  Downloads: 1
Marketing budget plan1[2]
Views: 519  |  Downloads: 126
Employee Acknowledgement Proprietary Rights
Views: 434  |  Downloads: 28
Condolences on death of a colleague
Views: 1500  |  Downloads: 4
Property Outline _Poss. Estate Supplement_
Views: 183  |  Downloads: 6