You are on page 1of 31
UNIT=1L (chapter-4.) Tinbroduct’on to the Relational Model “the Relational model aa paoposed bg Edyar Faomk Codd in the yoo 1990-t0 model dole i Use -fovm of Tablec/Relabions « > after destgotag Ui Goneptuad model of bie dofabase using ER Diaguan , we needto Convert the Concphial model Tote angelohiona model: + Tk com be implemented by RDBMS lomguage the sol, 4594 ete What fs the Relotional Model + he ‘elational model wepsesents how data fs stowed in Relational Databases: A velalfonal database clover data fo the -form of velations (tables). You = Consider oa velation student with atb’bate soll_n0, Pome , addvew, age fo table - —————_——_— Rollno | name adden | age | aed et | lol Rom | Debi | 12 co Name Romesh | Hyd 20 | 103 od | Swapna) vid !9 | oH, Roni | Debi | 1B | | | | athrbute + In the velatfonat mode! the tem velatfon % used ty vefartoa dable , while the team tuple is vefen tp a wow Sirolanly the tearm altsbute wefenc +o a Colwron ofa table . + The relot¥on fnshsuclor bas foun alhSbutec: Ip, name, dept_name ubetber the tuples ofa selation ane listed Sovted owden , or ano unsorted ; does mot matter 10101 Garnfvaxan Comp. Sci - 2121} wa Financ. 15151 lept..narne 2:1 The nckuctor Relabfon > "he Belationship behoen a Specfied Ip amd the Covvee porditu Values for name, dept_ name , Salary Values : > A *elatonshtp betwen ir PD Values jin wepresented N-tupl Of Voluen= g tuple with 1 Values a Cae ——— ee caedits Counse-fd BIO - lol Inky +o Biology Blo~30l | Genelfes Bi0- 399 |Computatvonah bio cs-lol | Inkv to Gompse’ cs- 190 | Gime deaigo cs- 315 Robotica 5-319 | Tmoge prsaming cS- 347 | Database Systeme rou ve &@Ubwweere wort EE-I81 | Inho + Diyitalcys) Elec. Eng: | FIN=201 |inveatment bank Finane | HIS 351 |hlorld bist Hishooy | Mu—199 | Musfe Video Music | phy—l01 |Physteat prfrdiples, physics 2:2 “The Gunse Relation - Counse-d preveq_id Bio-301 Bio-lo! Bio - 399 Blo-lol cs - 190 cs-Iol cs- 315) cs-lol cs-319 cs-lol | cs-347 | cc-10l | Ee -I8! pHy-Io! | 2.3 “The preveq velation > For each athrbute of a velation ; there fs a Set of permitted values, Called domain of Jae ath5bute. ~ The domain of die Saboou, albSbate {po inshucloy yelatfon & the set of all possible Sabooy Values —> The domains of all altsibutes of welations should be atomic - ftomic + Cam not be divided [split fp Smaller parts. > The Nutt Value tc a Specfad Value hak Signiffes that dic Value fs unknown / does not enist % —tn.gl anchuctor able, one Incbruclor doe not hae a phone cumber./ the phone dumber & unlisted > ull Valen cose a diffiullfes when we acun/updake tie etalon —> It fs vepresented fo table by blank spae - Database Schema * A dababase schema fs logical vepxesentation ofa dakabase, which shows bow the dato i stored logically jn the entixe dakabare - + It Gntoins fet of alferbutes and inshuchion that infowms Mie dotabare engine Abat=-Fsow le. daban 1s Owgarni 20d amd how the elernents a welated +o cach other - > A xelaHon schema Gosicle of a lit of atbibuter > thefs Gow eapondtug domains Biology Comp Set Elec. Evq- Finome Histowq Music | physics, | Saar ere | 2-4 “The department ‘xelation The Schema -fos that velation ts depaatment ( dept-name , buildiug , budget) ® The database Schema derived oom liz nvenatty databare 7s » Shidunt (ID, pame , ckpt. name, totored ) > advisor ($id, i-fd ) > Fakes (ID , Cowme-td , Secatd ,Serenter, yoo, grade) > clawroom ( bufldfug , -soom— number, opacity ) > Hime slot (ime-slotid , cay , start-time , end-time) cle ie Schema Diagrams : A 'dutabese buna , along ‘ath tba: paimay by ond foreign key dependensien Gm he depicted by Schona coguarns Foom-No Hime-slot_no — > amrow cenoter the prima me without arrow cknoke lta fomeign boy Mame database 9 Sequene of operations om ite ‘database 40 Gmpate liz desived seawt- > For prea dural loinguage we need tp pride whak the data fe megutved amd How to vebsiave Jit data. EE Relatfonat Algebra f ute preadual Language . Example Softwooes -fow welabonat algebra an BASIC, FORTRAN ‘ ALGoL, c, coBor. etc. non prvadunal Lamquage + => User needs 40 descithe only the destved Inforrnabion "ke what dhe data. ic weguived: ro need +0 deseibe bow to weleive those data Relatvonal calculus ‘is example for pon-prvadunal language Example coffurares. * Prolog. usp, S@L Scherne . = % The Relational Algebra : +> The Relatfonal algebra defines a Setof operations on stelatvons - > The a set of algebefe_operalfons. such ax acon , Subshact’on , rulliplfcation etc. > Wis velabfonal atgebro taken 1 pr more relatWons a8 inpak- amd returns a velation as outpal . The RelaHonal Algebva operations Fundamental operations Additiorad. operations Eatended operations Select ( Sigrma- ) Seb-Tuteasection (9) Generalised pavjects Project ( pi -ar ) Pasigoment (<) Agyregation (.G) Onion (VU) Nakol yoin (pA) Sum Set. difterna (—) Lett ower Join (4) Avg | Garketan Product (x) Right oder oio (ML) mtn @ = Rename ( she =P) full ouker oto (2) Gunt-dictinck ® “The Select operation + > Tt waa denoted by lowercase Greek letter Sigrna (+) ~> Tt Select tuples -lbat oe! a given predicate: ae |e We Gan use Comparision operators hes oy ey 5 > amd also having Some Gnnectives I’ke AND(A), oR(v), NoT (7) Example Queries ; [5 Flind all the jnshuctrs with Salary qzeaker than 99,000p- Cpe s qo000 (Inslsuckor ) te Find the ‘rskuchxs in physics with a Saboory greater than Joo00/— Niet: pame= " physics” 1 Sataoy > 90000 ( Inshuctor ) O he prafeck operation - > zk wechone Ms 2 gqureent- rrelabion with Certain altshutes 1. Lick all fnchuctor id, rare , Sabaony Hed, Dame, nent 2: Find mame of all inshuctors io the Computer Sdenw dprorment (Inehsuctor ) TN eiieee ( 0 gept-name =" Comp. 2c." (Anstructor) ) ® umion : This stella to union operation jn set theory - > Téa bt operator. => Ike prvject, duplicate rows ane eliminated . > Tt fsa set of all objecke that ome a member of A or B or both 5 ot & denoted by koe SP {TT (Relation) Tealumy (Relation 2) & 6UB A 1 [2 | For Rus +p be valid nh 3 La > Rand s roiat be of Same 5 . = aaity ( equal. Columns ) Ai y 4 2+ Fovall f, Domain of 1 aths = OF R= Domein of Mratbibae obs. a> 1, plod the set of all Goursea offered in efter fall 2009. Spiuq 2010 or both semesters. Tease d(T Semester = Fall” A gem 2009 (sectin)) U THeourme-td (T semester = sprig” A yor = 2010 (SecHon)) @ Set-differena operation + > Th & Uke the Same Set diffenena io set theory: > itka binany operation. > Tt Will fod tuples hak oe 7p one relation bul ae not in amother relation - > R-S = Tuple in R but not in Ss. > Tk fe denoted by ious (—) Symbol - Ped [e)< fees 1 a re] Py ag aa = ‘A Find all the Coumses, taught ‘no the Fal 2009) Semester but mot fn Sprtug 2010 Sermester. | MNeooae- td ( semester = "Fall? a yer! = 2009 ‘section y) = TMeoura eid (T Semester =" Spring ’ a yen shee (Seckfon’) ) BEL Colette Penk: 2 © ak suotibe coy tuple OF R, with cvew tuple of Ro_ RIxRa = pill possible poring. > Ita binary operation > Itis denoted by Gave) Symbol. ee find iz came of all fnskucoxs jh the phytes department- Aogetber with dt Course-id of all Courses, they taught» Se oP ee a Gor ne ee Sgept fame = physter ” ( rcheuchor ¥ teaches) e Since the Comrtesian — prrduct operation aaouabes cv tuple of Toshuclor with even tuple of teaches , we know thet if 1a’ an fostsuctor in the ee dept, amd has tought a Buse, then thewe is tuple in above quow that Gonlaine bis name, which sett ‘inshuctor, fd = teaches. id Vinshuctor vid = teaches. fd (Opt rome = "pbysice” (insheuctov x Fencla)) © The Rename. operation ; > Relatfons in the database have names > The -veaults of -velatfonal — algebra. cuprewsions do not have a name - ! > Tt & useful 4p be able to give them: names - >t v operations « > Ib % denoted i“ the lowercase Greek letter vbo(P) eo (ke) For above wample we cam rename lke Frock phy ip Foshuckor. fd =teaches. 7d (aipt-reme _apbipice” (Trosheschorrx teacbil) @ Sek - Intersection > similor to intessechon operation in set t theory: > Ita Binoy operator. > Denoled ee > tt fsa set of all pies that we a member of A and B bob [ane =: t2-0)] @ The Natural ~Join operation : @ = A Nabwal join js the set of -+upler of all Combinations in R amd S that am equal on theix Common albsbube mames > Itt a ‘inaoy operation > Denoted by ood’ — It simpltfe Certain quentes Hab requive a Cartesian Pavduct we Flod the mame of all fnsleuctors together wilh tbe Gane id of all Courses they taught 7) ° Nijamne, Couse id 'Stuchor ba teaches ) @ cater jen : — The outer join operation fc the ealension of raherad join Peers 3 > Th fused to dead with missing Toformation - Suppose tbat there 4s Some nshuctr who teacher ro Cources , then ‘that fnstuctow dala would not appean fr the reaudl OF potural join. > we use the outer join operation ty avoid {his loss of info Ouder—foin Gntains 3 forms. : 1D Lefk-oubegoin + Tt takes all the tuples ip the lett velafon that did mot match ony tuple ‘in the ight “elation > denoted bg (a4) + ll Info fe present fo the left -welatfon a [eaches 4 Fpshuctow | i) Right - Oubenjoin = > Denvted by Me + TE TS Symme bie with the left ouber join Tt pads tuples fro the abt elation bak dil not makcs amy feo dit let with nui « Ya; | teaches Dt Tooshuctor| “iY pall outer jsio > Penoted by > Tt does botbe the. Lett amd Rig ouker join operations . | teaches IM foshuctor | aeeotel & the eutension of podject operation by allocofug. Wons Such a8 arithmetic amd Shug functions . |, name /dept_pane , ee eat: (Inshuctor ) Tt will vetwins the monly Soli of inskuctor Cranley Ces) Relational Caboulus « G oe fs a eon~ procedural lamqua e = prrvider a Sequence of proddunnes {oat genorasea the amcaren, 5 cto ow ques a at provictes Ihe desired information withouk giviug a Spec ofic © prvtedure Tt divided into 2 types oO Taple Relational Calewtus + (TR) > Ah spetitied +> Sebect the tuples in a welation » : A quey fo dhe tupk velatfonad calculus ic empwemed a8 [f+ [pe 4] $= Reauttiug tuple ae Gondlttfon used -tv fetch T Fit of tuples | t Such that pweditte p ‘ic tue for t * a fe fy relation x * Univenad Quantitiens all tuples Sati : It denoted by # Enistenliay Quamtifien > ok least one Value Satisfy a given on ct CHhere eucts ) yee given Onditfon we Find dit ‘nshuctow fd efor each inckuchr with a Salone i Freaker thom | 0000 4/ 3, ‘oshuctor ¢ tid} = Sfid) As Sr tate ie [salamy ) x95 ae 204) >$0000)) t fea teen Voniable 5 fsa bound Vaamable. A TRe fosmula ts builtup out of atome. Ap atom bas one Of- the following forms + Ser, where sic atuple Variable ard y fs a relation Sfx) B uly] , where < and u aw tuple Vanvahles, «Ts am athshute on whfeh, ic defined , 4 4c om athshuke u Ic defined: ® 16a Comparision opoaler (<,<,>,%.=,4) + st) Oc yuhere © 92:0: Gest» + TP Pi & forowa, then apy amd (pi) BER, cu formuta, then PV TeeRiAieE = pyaaelps, EF, 6 toa relation on no athsbuker 21,999 Ce domain Variables constants UDG, andy ae domain Variables, @ isa Grnparison. Operator (2,6, >) nOc , c isa Gonstomt TE pr tsa formwa , then —P, and (pi) oe Py) PPa 0% formula, then PvP, PiMPa» PI> Pr : oth pil, fsa fosrmouta fox, (pita) e oy CP) : ee Find insbuctor id, nome , dept rame , Sabor for inshructor whose Salowy fs greater dham 80,000. ) < ‘i,n,ds> [ € inshuchy A S > 80000} n d Ss Dame dept. Pamne Sobe Filed all frchuctor 1d for foskuclor whase salary fc greats than eae a : 80000 <> | Arye (dhndss € Tosksuctor A SS govo0) $ Note: Ip fret enample thy have given all the atsbuter . ‘thaks why we didn't create a bound Vostables . Eamples for TRe_9. 1 pRe Find abe set of all Gorse tought in. Fall 2009 and Speiug 2010 or both. ~oukpul + Gounce- id (secon). fovdition + Semester = = fal yest 208 : Semestor= Spiiiq oe Secon G Godiition : “opel ron (Hounset) =s[toxome ty in) | wifeumesten)}= “Fall” x(yeont] = 2002) $ on ( {course id | = yficounse -id\)) A [Semester] iS "Speug” A atten es role) be eon Oe eae Sec-id soi spo bail voor. Heb | | | | ek dee oR unr T (chapter - 2) nhwdaction to fo_SQt * overview of Se. Tam developed the oviginal Version of cal, oviginally Called Sequed , lakeron 7 has changed to S@L (Shructused Quesuy Lamquoge Jin the yeor of 1910s The SL. hax Several pants: D Data- Definition Lamguage (DpL) 2 Tt paevides Command ow defining Schemas , deleting velations amd rood ty fag Schemas Data- momupwtation Lemguage (Dml.) : Tt prsvides the biltly 40 Tosent, delete amd madtty -bples io the datohane “Tnkgxily ¢ DDL Spcludes. Grom ands for Specttyfag Integty Gmstrainte that the data Stored in db mount satisfy. View definition, + DDL focludes Gremands -for defiainge a a Views - ae Transaction Conkol 2 SQL includes Commande for specitying Ki the beagising and codes tsamsactions a Folate SOL_% dynamic sar ¢ TH defines how SOL. Statements: can be embetled wilbin qoenal pepipose. poreranomn fag languages, Sudb as C, C++ “pJava - 4) Batbortzadion DDL includes Commands “low Spectfytug . acces apis +b relations and Vien ‘ SOL Data Definition ¢ Data efinition Lamquages allowe us to Create a Shuctumes » dele ug velatfone amd rmodi-fytug shuchores ue loot [arent Ageretn — Tinga < delete Lee ahaa The SAL supports a variety of buill-in datatypes, ocding |coeate “Chaxta) < Flaed length chasacter Tt Supports (0-40 255 byt) Veoiable length character It sipports (1 +0 2000 bytes ) 2 ‘Venchar2 (P) : Suppowts I+ 4000 bytes a nt 2 Integer type. Supporls 4. butes | Smalliot 1 Small ‘oteger type » Supports 2 bytes 6 Cuamerie (pd) + fined pofot number with Prectcion . 1g Supposts 5) bytes weal, double precision : Floahig - peiot and double- precision : Supports 8 bates eben? A 1 floabieg Porot number » Supports & bytes. define so. relation by utiug Cyeale table Gmmand . : cae ett (ce name Va%chan(20) prmauy bey * : — butldiug Varchan(26) budget Purmber(10)) : > Tk Supports a pe of Integrity Gnalaints - oO + prtminy key $4 These athiburea oe eequined ty be not oul] amd unique. + 00 tuple can howe a pull Value for a potrmaony keg » Tk & optional « Tt fe weferenced key , refered! from amother + Foreigo key + d elation, Cowecponds Ae Value of pemramy fu Not Nuit t “The not pull Conchratnts op atbesbubea., Spectty the nu Value ic not allowed - TINSERT = using this Fnsert Command. to load data fot ta velation + fosent into ‘nskeuctr Values (lor1! .' Smith’, ’ Biology’, 66000) ALTER: By usiug thie aHer Command we Can modity the sSluctuye of the fable - = alter table tablename add new dolurn ; f + alter table tablename drop Column ; © Renome +. Rename oldtable to neotablename tumcate ; Tk deletes’ the whole Valuer in a fable amd shuctane e WEeMarns ad hounscate table Aablenarne : Drop + TA deletes the data and shuctune of Ibe able > Dep cable tablename 2 Find insheuclr names p Course fd for ioshructee in Gompulrer @ sefente department <> Select name, Comseid from inshuctor , teaches where dept-name = ' Comp. Sc?’ amd foshuctor. 1d =beaches . fd: Queries Om Natural Join ¢ “For all fochuctors jp the wnivensity who base tauybt some Course , find thetr names amd the Coune-fd of all Courses they tought « + Select Course-id, Namee from ‘inshuctor potural foin reaches Lik the: pames of instsuctore along with the titles of Comes that hey teach - ie lee fame, Fite som jnshuchr pahlal join “rteaches, Gounse wher teaches. Gounse.id = Course. Course » * addi¥fonal Baste o exalfons —_— = D The Rename. operation + For all Tostucloes I the university who have taught Some Gurce, Flod their ames Govoise.id of all Course they taught => Select T. name , S. Counce - id. trom ‘inshuchoy T, teaches S there oT fd = S.3d; Find the rames ofall fnshuclors base Salary ic qreater than ‘ak least one fnshuclor fn the Biology depantment > Seleck T) name feom inshuctory T, instruct § where T- Saco > S: Sabary amd S.dipt name = ' Biology’ » mk Additional Bosfc_ Operations + Quesies on o_ shrug operations ¢ > Sk Specifics shrings by enclosiig them in siugle quotes. ae we legs © The SaL Shondand specifies thet the equality. operation on sheiugs {Case Sensfhive - “comp. sc’. =' Comp. Sci.“ Tt evaluates -falce - ae pattern malching Cam be performed 90 Shaiuga aig the operator Wher |< , : Sy percent (4) > The % character matcher omy Subshieg - + amdescove (—) > The — chodiacley matches omy characte These. potteans cre Case sensitive. Uppencase chanactens do not match with lowerase chanactexs ov via Versa Toko,’ emnleha any shiug bejinviag, with nh! 2. A.Gempt, roatches amy shu, Gootaining "Gop ° 3. '_-_! malcha ai Sheiq of ewac tly bree Characters 4 71) make any shing of atleast thre characterg 1 Find lie ames of all departnnents whose buildivg fame freludes the Subshvg ! watson! « + Select dept_name from departrnent where boildieg Ike '% watson, / 2. find Ike foshuclor came endiig with 7 2 > Select nome from inshuchoy whee name Itke ‘277 | 3 Find Us fostuctor name stig with '6:' and Contains only 3 Choocters vert to 'G’. > select nome from fosksuctor wbere mame like pec 1 ® elhibete paiftalion jo selacl chuse : > The astexisk Symbol ‘ge! fs used fn thi Select clause +o Amol ib pigbiten. Eu: . oe Select # from inshuctor ; 0} Ordoing ts_dieplay of tuple ( Onley by) Ls ae Keywoorel fs used to sort Ji veaulhset in astendtug ‘or deseonding order roe by defoutt, orden by bayword Sots dhe wecords fn aserding Ovdey Se Select Column, Glame 2 feom table- name Order by Column! , Columns Asc| Desc + ; y \ List ata all tnshuctors fp destandig Orden of Salary, FL Sevenal inshucrs have Same Sabary » Ovder thom in. abphebelie aseemdiug orden by ame > Select a from instructor odenby Sabcoy dece, pame axe : ©) whore clause predate : > SQL Tncluda a behocon Comparision operator “to Sho pit e Clases lesstham (<) Ham (>) + equah (=) pid liz ames of ‘nshuchnc wilh Salaw behoen qo000 amd 100000 9 > Select name prom fnshuclor whore Saban belaveon. 90000 amd (00000 ; [stead of wating ft ax <=l00000 amd >=90000"| These oe te ae ctype of operator cobich axe aged to cage ‘wo queries 1D Onion : : => Th fs used» Gmbine Ite > Duplfaite rows will be’ elimfoated, after Portorring las union operation neegatt Of wo Select stalkements - Sa Find dia Set of all Comeer taught efther ‘in fall 2007 oe to Spoug 2010 or both . >. elect Coumeid from Section where semester = ‘Fall’ and | Gyee'= 2009) Union “(Select Covrse-fd fromm Sechon awbere Semester = ' Spug' amd a = 2010); ee Vein all Se = by ra petorming this union all operctor , tbe duplicate rows vail | oot: be Perret. Ea: Gonsida above example question ~> (Select Groene fd (Sdect Gurme-id form Seckion whow Semecter = 'Pall' amd 4°" = 2009) Intersect (Select Cowise-id from Section where Semester= 'Spasug' and year = 20/0) © Eaapt fri + > ort displays tt wows which ow ek io Ie fiest qu uk absent ‘ip Me Secound quey wilh no duplicates - o Bu: Comsides above o> (Select Gouseeid fromm Section abere Semester =! Fall’ amd = 2007) prinua (Select Cownse-fd from section @bere Semester = " Spotug ' ond geo = 2010); ge Nol Vals —> A ftdld witb o Nur Value fo a field with no Value > tk f pot possible to teat for noi Value witb Comparision Operators , Suchag =) <)> > we will have +o use the TS Nou (TS Nor NOLL —operotms instead Yai y Find all fpshuctere bo appear fo Un ‘oshuchy velatfon c with pull Valuer or pame. : > Selec a from fostuctor Where nome ‘ null ; roe tow pull. valor — _> Select id from “Srsheucor whe%e Pame is not mall ; . ee > paysegete fumcKons ome dumecHons thet +akeo Collection of- Value. aa ‘input amd vretums a Shagl Value. SQL offea 5 built-in aggregate functions : Average : ong pie. * Minimum {min Moaniroumn : max : Find de alewage Bahasa of foskuctoxc - Select owg(sallasey efsom foshuchor : “Fs Ui. roan Seicoy of Fnsheuctors ip Ma Gorspulter Sdene departwent - Seleck man(sadory) foom fnshmctor where cept-name= \ Comp: Sef." aggregation with qroupiug — Find Mie aneroge Shon fo each depantment Select oug(solay) doom inshuchor qr by chpt_name } opjregation with havivg Clause 4 Find die auesroge Sabarwy fo each chpartment ako i haviag moore Thame 42,000 a8 Select ang sabany ) from ‘nshsuctor qreup by dept name. haviug adlatcalay) > 42000 } v O / AK Nested subgufates ¢ > SQL provider a machanfim -for meted Subguiaves « A gue having a Subquesw. / 4 guy within a qed AW ib 08 oeted Set > sub query % ao hevig sdect—faon- where expression. > The uses of Nested cubquiwer — % teats fox set menmberch’p # make Set Comparisons % Peteamine Sd crdinabity we Cam Set memberchip ¢ The fo] not in Presene /ahsene ‘The. In Connective test Mie ee ae mernbensbip he Norn Connective feat dhe pane’ gf cet membership. Connective tests for set memberships a year = 2000) amd Coumefd io( Sebect Guose-id form “Gectfon obese Semester = 'Spaug! ond geod = 2010) 5 Gum perform not ir connective ty clack only for 2009 pot in Spriug 2010 - 2) Sel Gmperision + (Some, all, Amy’) ® > nested ssubquery is bduteg the obiltty +e Grmpane Jie seks. ey Find bi mame of, all foshuctws whose Sabary fe qveaker thom ok lest one todhuclor io ttt Biology depantweent Select name from — tnstouctor where Saleday > Some( Select Sab teem ‘inshuctor here dept name = ' Biology’ ) 1 © 2) Find Ue names of all inshucty thot have a Salary Value qraxer than thar of each Snshnuchr fn Bidlogy dept ome , >Some , > Some , <>Some fs nok doe Same. Identead to 119 <>all fs Sdenkeal-+to NoT IN S Some Krokidentied to NoTIn | =all ts not fkotal + IN 3) Delemmine set Girenatily ¢ “Tet for empty relation : Sats focluder a feahae for ‘eetfug whelber a Sub queeny bas a tuples oe Pol > The enist amd not enict vehons dhe Valuen s enist wehons Value te hue + vot etst -veluns (B expopt A) ee. Find all diz students who have taken all tle Cousmen ban -offeed fn Biology depantment: Select id, name from student where eutsts( sect Course id from Course whew ~ dept- name = ‘siology’) ; Il ramet of all fnshuctose that haye a Sal e Tap than that of. each chperkment-inchuctos % Biology ment. where: centslel Select feom ‘oshuctoy where i AC ' Biology’) ; el ° whee pot exists (sdect Soheouy form inshuctor where. Ae cept pame = | Biology’); ke

You might also like