{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# lec06 - Relational Algebra Examples Lecture(Chalkboard We...

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

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

View Full Document

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

View Full Document

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: Relational Algebra Examples Lecture (Chalkboard) We will use the following schema. (primary keys underlined): People(pname, street, pcity) Works(pname, ename, salary) Company(cname, ccity) Manages(pname, managerﬂname) (1) Find the names of all people who work at “First Bank” P (2) Find the names of all people who do not work at “First Bank” U36 Pr aw i (MS Solmt ( on , , ., Whamc ( ngome ZMFIFST Bonk" ( works>> p ( FBEMPWK3€ES ) Wanme (Ofdmumc : ”First— Bank” (WOY‘CSBB) New Endl_eoerx_:one else anome “36096) “ F6 EmpmeVES ...._.....__—.........-.-—.—— AW... "Wu 7-. Whj mot duo WM: {L'Ullowmgj 7, wmoﬂcmﬁc: LWOFKS) "' FBEWPHDthEES ~ ' timid (NUT eveﬂa perSUﬂ ﬂ€€d3 l7) DE 3 m Lao-rm tame) (3) Find the street addresses of all people who do not work at “First Bank” P ( FbEmpimsees) WPMW‘F’ (oﬁmme ; (Worm 1X1 People)3> swee‘r “FM-st Bonk" ‘._ [ngimcs 1. QdClFESSCS O; P(C>p1e. who WOFK @ I'm-(3+ BCXFK) ﬁtted (WP/tome) Street (PCOple) “‘ FL?) EmPlQlj€€S> 3 WWWWA/ well] do :~ ‘ {5.3 we Kee t) OWL Real 3mg“, L'Wﬂjone C pl'leY‘ne I Ackmiﬂvla Lunch lﬁlﬁtmj 2 SH different: . (4) Find the names of all people who work at a company located in “Ann Arbor” Twat M m ogW .. um» \ ___,7 53‘??£_____.. ME} Companies m 91 (5) Find the names of all people who work in the same city where they live. Tl m Ofpcx : (Peeple N Wolf“ M (DW‘PC‘ﬂj3> pm :3 CU (6) Find the name of the employee with the highest salary. (If there are multiple employees with the same salary, return all of their names.) (D Find People whcne salon) (5 lé’SS Th0") SON/‘60“? @1565 /0 (Temp) leq'PthC (Worm H N work; B) geiwt lihtf’hES 9.561101%] 4 W/FEHQMC BISQ‘Wj homn‘an ® Find evewaonc; em: [who has 0k J'obl') 7T (WONG) "‘ Temp mm: Illumn‘ra on Simpm DB (5.6., >) (7) Find the names of all people who earn more than every employee at “Small Bank” —-—._ ® Find Th6 homes Omol swam; O; Peeple Who LVUOYlL CW ﬁmcm Bﬂﬂl’x f3 (Temp ) Tgnamej (0/6YW0YVIC1 worm») (“My “Sn/tail Bent" @ Fmd TYNE hamei ol people whose §QlCATt€S are. é Sort/16 €WMP\O(3€€ CM” Small Bonk )3 (TWP 1) size-c ( Works: - l><l Ten/1p» poor 1L3; qulctr‘j é Temp. solarij Q3). New) 19nd eyet'iaow else. with a job 1T mm (worm) —- Temp 2 —-—~— Intimate on SIMPlC DB (9 "”2 ILLUSWOm on W UJOHCS [Sampka InSJrunce} Enam e Charm 6 ECU cm K, Huge ﬂame 1(2ng 1300 Smalk BOMK 25 K Ccm Rm Bamc 100K mm 5mm 6m: 75 K Eve. ‘ Fatwa 50 K ((0) Term: : Wﬁpﬂame (warts a 04 moms l3) / H-SQlar‘a C [3.8mm \3 ﬂ: EﬂCAmC ‘ .1. - BOD Trpnqme LLOOHCS) ' ﬁmp Don L Pﬂome Eve 7 BHCC _MA£39'"\ H ()anch : WONG) “Small Bank" Temp 2,. :— WwDrKS.Pr\0LW\C ( worts M EMp 5 MYFSV SMMU i Te m rﬁ‘ﬂav L7 Eﬂmmc ~— P 3 Bob Dom EVE. 7T namc, LWOHCS) d Templ L7 £2519 PHI'Ce Car-K Samgm Scheme» 2*ij 3W“ (EL) Shamewamg) 0963 Reserve: (\$9) 9!}. ) 49%) 60m (9):: 3mm, com) SQHOH who hon/t rcSerx/ed (D de names 09 boat Aim?) ﬂammc (CO/gamma Reservcg) M SQHOFS) equﬁva‘xcnf\j , t '\ W3ham¢£ Gag; (Reserves NSOU 0V8») 0% SCMOH Who hen/L reserved a @ ﬁnd mamas red \OOOC’C Tr < Com“: ( BOOK? PG Reserves Dd SGH\OFS}) SW‘ME ‘ﬂcd' equiuqmrwhj -- O’onor: (Boats) 5Q Reserves DQSm'lod) T ‘Red‘ Shﬂmt Maws more, (DPﬂmi’lef‘ (“J/100863 best‘ Ehltx} @ Fmd names 01} 80mm 0» Fed 21% green mar WEWW‘C ( Ogomr : ‘Rai‘ 0Q (BOOTS) M Keserves )Q Saﬂows ) Eqw‘ vcdtvx’r \5 ﬂgﬂawﬂ[(O/‘L0\or: (86am) U OFCo‘xor: (BOQVOB ‘Red’ N Rﬁsew c: M l ‘05an SQHOVS] who have. reserveck (l Pf md‘va Limomacx§ son/W1 on 7T. O/Eomr: ‘qu' CAmC sh AND co)or= ‘Cﬁem' WHAT'S WKUNU Z (8)0036) IX! Rmervu N 5061043) ...
View Full Document

{[ snackBarMessage ]}

### Page1 / 6

lec06 - Relational Algebra Examples Lecture(Chalkboard We...

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

View Full Document
Ask a homework question - tutors are online