Data Mgmt Lab_Part_12

Data Mgmt Lab_Part_12 - 34 Chapter 4 SQL SELECT C.sid FROM...

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

34 Chapter 4 SQL SELECT C.sid FROM Catalog C WHERE ( NOT EXISTS ( SELECT P.pid FROM Parts P WHERE P.color = ‘red’ AND ( NOT EXISTS ( SELECT C1.sid FROM Catalog C1 WHERE C1.sid = C.sid AND C1.pid = P.pid)))) OR ( NOT EXISTS ( SELECT P1.pid FROM Parts P1 WHERE P1.color = ‘green’ AND ( NOT EXISTS ( SELECT C2.sid FROM Catalog C2 WHERE C2.sid = C.sid AND C2.pid = P1.pid)))) 9. RA ρ ( R 1 , Catalog ) ρ ( R 2 , Catalog ) π R 1 .sid,R 2 .sid ( σ R 1 .pid = R 2 .pid R 1 .sid 6 = R 2 .sid R 1 .cost>R 2 .cost ( R 1 × R 2)) TRC { T |∃ T 1 Catalog ( T 2 Catalog ( T 2 .pid = T 1 .pid T 2 .sid ± = T 1 .sid T 2 .cost < T 1 .cost T.sid 2= T 2 .sid ) T.sid 1= T 1 .sid ) } DRC {h X, P i|h X, Y, Z i∈ Catalog ∧∃ P, Q, R ( h P, Q, R i∈ Catalog Q = Y P ± = X R<Z ) } SQL SELECT C1.sid, C2.sid FROM Catalog C1, Catalog C2 WHERE C1.pid = C2.pid AND C1.sid ± =C2 .s id AND C1.cost

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

View Full Document
Relational Algebra and Calculus 35 10. RA ρ ( R 1 , Catalog
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course EGN 4302 taught by Professor Dr.vishak during the Fall '12 term at University of Central Florida.

Page1 / 3

Data Mgmt Lab_Part_12 - 34 Chapter 4 SQL SELECT C.sid FROM...

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

View Full Document
Ask a homework question - tutors are online