DATA 520 Databases Class Notes (Fall 2024) ============================================================= Thursday, November 21, 2024 --------------------------- Week 12 ------- select cname as cn from customer ; select * from customer where city='Kyoto'; select * from product where city='Dallas' and price>0.50; select aid from agent where percent >= 6; T1 := (R∪S) T2 := (R∩S) T := T1–T2 T = a2 b1 c2 a1 b1 c2 a3 b2 c3 Thursday, November 14, 2024 --------------------------- Week 12 ------- Table = Set superset subset key = sid superkey = {sid, lname} |Domain(City)|: 1000 Duluth GF Fargo Paris London ... |Domain(CID)|: 100 Domain(City) x Domain(CID) : Cartesian Product = 10 x 1000 = 10**4 Domain(US City) x Domain(CID) = 500 x 100 = 5 x 10**4 select cid, title from buy y, book b where y.cid = 10 and y.ISBN = b.ISBN; |domain(buy)| = 1000 |domain(book)| = 10000 |domain(buy) x domain(book)| = 1000 x 10000 = 10**7 for ( i = 1; i < |domain(buy)|; i++) for ( j = 1; j < |domain(book)|; j++ ) if (y.cid = 10 and y.ISBN = b.ISBN) then print cid, title select KEY from dependent;