0% found this document useful (0 votes)
277 views7 pages

CMPT 354 Assignment 3

The summary provides the key information from the document in 3 sentences: The document discusses the output of queries on a Java program that executes on student data. It then provides examples of decomposing relations into different normal forms, checking for dependency preservation, and determining candidate keys. Various relational algebra operations are applied to tables to help answer questions about functional dependencies and decompositions.

Uploaded by

rakyn21
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
277 views7 pages

CMPT 354 Assignment 3

The summary provides the key information from the document in 3 sentences: The document discusses the output of queries on a Java program that executes on student data. It then provides examples of decomposing relations into different normal forms, checking for dependency preservation, and determining candidate keys. Various relational algebra operations are applied to tables to help answer questions about functional dependencies and decompositions.

Uploaded by

rakyn21
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 7

CMPT 354 Assignment 3

Part 1:
The following is the output of the Java program that executes queries 2. d), e), and f): first_name : last_name

2 Andrei : ulatov !ugenia : Ternovs"a #unda : !rgun $reg : %ori Jian : &ei Jiangchuan : 'iu (a"as : null (e : )ang %ar" : *rew +ianping : $u ,ichard : -hang title : classification Automated 'oad .urve *ata .leansing in &ower /0stems : orderline .ognitive modeling of sentence meaning acquisition using a h01rid connectionist computational model inspired 10 .ognitive $rammar : orderline .omputational /tud0 on idimensionalit0 Theor0 ased Algorithms : ,e2ect !fficient 3uman Action *etection using a Transfera1le *istance #unction : ,e2ect !m1edding &arallel it /tream Technolog0 into !xpat. : orderline !nerg0 Aware .olour %apping for 4isuali5ation. : orderline !xploring *isease Association from the 63A6!/ *ata: *ata %ining, &attern /ummari5ation, and 4isual Anal0tics : orderline 37**!6 T,!A/8,!/ 76 86/&'7.!* !/T *ATA : orderline 7mproving Access to *ata in 'egac0 3ealth 7nformation /0stems : orderline (e0word search on large9scale data: from relational and graph data to :'A& infrastructure : orderline 'atenc0 ,eduction in :nline %ultipla0er $ames 8sing *etour ,outing : ,e2ect 'earning Transfera1le *istance #unctions for 3uman Action ,ecognition and *etection. : orderline %ax9%argin 'atent *irichlet Allocation for 7mage .lassification and Annotation : ,e2ect %ining *iscriminative 7tems in %ultiple *ata /treams : orderline 6etwor"ed )ireless /ensor *ata .ollection: 7ssues, .hallenges, and Approaches : ,e2ect :n ,elia1le roadcast in 'ow *ut09.0cle )ireless /ensor 6etwor"s : orderline &eer9to9peer ;*<multi9view video streaming : Accepted /pectral Anal0sis of :utput *evices, from &rinting to &redicting : orderline /ummari5ing .ertaint0 in 8ncertain *ata : orderline The complexit0 of glo1al cardinalit0 constraints. : orderline Towards automated s"in lesion diagnosis : orderline 8sing A1stract /tate %achines to %odel a $raphical 8ser 7nterface /0stem : ,e2ect 8sing spatial em1eddedness and ph0sical em1odiment for computation in multi9ro1ot s0stems : ,e2ect

email_id : first_name : last_name: average ester=cs.sfu.ca : %artin : !ster : > hao5=cs.sfu.ca : ,ichard : -hang : > 2pei=cs.sfu.ca : Jian : &ei : > mori=cs.sfu.ca : $reg : %ori : >

; ter=cs.sfu.ca : !ugenia : Ternovs"a : ? wang"=cs.sfu.ca : (e : )ang : ? a1ulatov=cs.sfu.ca : Andrei : ulatov : ? mar"=cs.sfu.ca : %ar" : *rew : ? funda=cs.sfu.ca : #unda : !rgun : ? 2cliu=cs.sfu.ca : Jiangchuan : 'iu : @ qgu=cs.sfu.ca : +ianping : $u : @ "a"as=sfu.ca : (a"as : null : A

Part 2:
1. #*Bs: A C ., .* C !, C *, ! C A 7t follows that: DA C , A C .) 10 the splitting rule, D.* C A, A C *, A C !) 10 transitivit0, and D.* C !A, A C .*!) 10 the com1ining rule. A is a "e0 1ecause A C .*!. .* and ! are also "e0s 1ecause .* C A and ! C A. /o, the "e0s for , are EA, .*, !F 2. , G EA, , ., *, !, #, $F. ,H G EA, !, #F. )e ta"e AI, !I, and #I. AI G EA, , ., *, #F. !I G EA, , ., *, !, #, $F. #I G EF. )e then ta"e #*Bs J C A where J ,H, A ,H, and A !I 1ecause !I contains all attri1utes of ,. )e end up with #*Bs: A C #, ! C A, and ! C #. ! C # follows from the other two #*Bs, so we remove it. /o, the set of #*Bs that hold over the pro2ection onto A!# is EA C #, ! C AF 3. The three decompositions are A ., .*, and .*! Ta1leau: A B C a 1 c a2 1 c a; 1; c Appl0 * C A: A B C a 1 c a; 1 c a; 1; c Appl0 A* C !: A B C a 1 c a; 1 c a; 1; c

D dH d d D dH d d D dH d d

E eH e2 e E eH e2 e E eH e e

A )e canBt do an0thing else, and we donBt end up with an un9su1scripted row. Therefore, the decomposition is 6:T lossless.

4. , G EA, , ., *, !, #F EA, F is the onl0 "e0. To chec", we calculate EA, FI G EA, , ., *, !F. /o, EA, F is a super"e0. EAFI and E FI are empt0, so A and are not "e0s. .hec" for ;6# violations: . C * and * C ! violate ;6# 1ecause . K * are not super"e0s and * K ! are not prime. #ind a minimal 1asis for the #*Bs: EA C ., . C *, * C , * C !F is a minimal 1asis. 6one of the #*Bs follows from the others. ;6# *ecompositions: ,H G EA, , .F, ,2 G E., *F, ,; G E*, F, ,A G E*, !F. EA, , .F is a super"e0 for ,, so we donBt need to add another relation. ecause these relations are in ;6#, dependencies are preserved, and the decomposition is lossless. .hec" for .6# violations: . C *, * C , and * C ! violate .6# 1ecause . K * are not super"e0s. .hoose violation * C : ,H G *I G E*, , !F. The relevant #*Bs are: * C Therefore, ,H is in .6#. and * C !, so * is the "e0.

,2 G E*, A, .F. The onl0 relevant #* is . C *, so EA, .F is the "e0. . C * violates .6# 1ecause . is not a super"e0. *ecompose ,2, choosing violation . C *: ,2 G .I G E., *F. The onl0 relevant #* is . C *, so . is the "e0. Therefore, ,2 is in .6#. ,; G E., AF. There are no relevant #*Bs, so E., AF is the "e0. Therefore, ,; is in .6#. .6# decompositions: ,H G E*, , !F, ,2 G E., *F, ,; G E., AF. ecause these relations are in .6#, the decomposition is lossless. .hec" for dependenc0 preservation: ,elevant #*Bs for ,H, ,2, and ,;: * C !, * C , . C *. )e cannot recreate A C. from these #*Bs, so dependencies are 6:T preserved in the decomposition.

5. , G EA, , ., *, !, #F EA, !F, EA, F are the onl0 "e0s. EA!FI G EA, , ., *, !, #F. EA FI G EA, , ., *, !, #F. /o, EA, !F and EA, #F are super"e0s. EAFI G . E FI G E , ., *, !, #F. E!FI G E., *, !F. A, , and . are not "e0s, so EA, !F and EA, #F are the "e0s. , is 6:T in ;6# 1ecause there are violations. ;6# violations: ! C *, . C #, C.. #ind a minimal 1asis for #*Bs: EA! C , ! C *, . C !, . C #, from the others. C !, * C .F is a minimal 1asis. 6one of the #*Bs follow C *, and *

;6# decompositions: ,H G EA, , !F, ,2 G E*, !F, ,; G E , ., !F, ,A G E , ., #F, ,@ G E , !F, ,? G E*, .F. EA, , !F is a super"e0 for ,, so we donBt need to add another relation. ,H, ,2, ,A, ,@, and ,? are in .6# 1ecause the left sides of their relevant #*Bs are super"e0s. ,; is not in .6#. ,elevant #*Bs for ,;: . C!, of .6#. C !. The onl0 "e0 for E , ., !F is ., so C !, so is the "e0. C ! is in violation

,; G I G E , !F. The onl0 relevant #* is Therefore, ,; is in .6#.

,> G E , .F. There are no relevant #*Bs, so . is the "e0. Therefore, ,> is in .6#. ,; and ,@ are duplicates, so we can eliminate ,@. .6# decompositions: ,H G EA, , !F, ,2 G E*, !F, ,; G E , !F, ,A G E , ., #F, ,? G E*, .F, ,> G E , .F.

6. .ourses G E., T, 3, ,, /, $F a) 3 and / onl0 appear on the left side, so ever0 "e0 must include 3 and /. E3, /FI G E3, /, ,, ., T, $F, so E3, /F is a super"e0. E3FI G . E/FI G . / and 3 are not "e0s, so E3, /F is the onl0 "e0. b) E.FI GE., TF. E3,FI G E3, ,, .F. E3TFI G E3, T, ,F. E3/FI G E3, /, ,F. E./FI G E., /, $F. 6o #* follows from an0 of the others, so the given #*Bs are their own minimal 1asis. c) ;6# decompositions: ,H G E., TF, ,2 G E3, ,, .F, ,; G E3, T, ,F, ,A G E3, /, ,F, ,@ G E., /, $F. E3, ,, .F is a super"e0 of ,, so we donBt need to add another relation. !ach of these relations is in .6#.

? 7. , G EA, , ., *, !F a) Ta1leau: A a a Appl0 A CC .: A a a a a Appl0 . CC !: A a a a a a a a a Appl0 C *: A a a a a a a a a

B 1 12 B 1 12 12 1 B 1 12 12 1 1 1 12 12 B 1 12 12 1 1 1 12 12

C cH c C cH c c cH C cH c c cH cH cH c c C cH c c cH cH cH c c

D d d2 D d d2 d d2 D d d2 d d2 d d2 d2 d D d d d d d d d d

E eH e E eH e eH e E eH e eH e e eH eH e E eH e eH e e eH eH e

)e canBt do an0thing else. 6ot all the tuples agree in the ! column, so A C ! does not hold. There is not an un9su1scripted row, so A CC ! does not hold.

8. , G EA, , ., *, !F EA, , .F is the onl0 "e0. EA, , .FI G EA, , ., *, !F, so A . is a super"e0. EA, FI G EA, , *, !F. EA, .FI G . E , .FI G E , *F. A , A., . are not super"e0s, so A . is the "e0. A6# violations: A CC . and .hoose violation A CC .: ,H G EA, , .F. There are no relevant #*Bs, so the "e0 is A .. The relevant %4*Bs are A CC . and CC A. CC A violates A6# 1ecause is not a super"e0. CC A violate A6# 1ecause A K are not super"e0s.

>

,2 G EA, , *, !F. The relevant #*Bs are A6# 1ecause is not a super"e0. *ecompose ,H:

C * and A C !, so the "e0 is A .

C * violates

,H G EA, F. There are no relevant #*Bs, so the "e0 is A . Therefore, ,H is in A6#. ,; G E , .F. There are no relevant #*Bs, so the "e0 is .. Therefore, ,; is in A6#. *ecompose ,2: ,2 G E , *F. The onl0 relevant #* is Therefore, ,2 is in A6#. C *, so the "e0 is .

,A G EA, , !F. The onl0 relevant #* is A C !, so the "e0 is A . The onl0 relevant %4* is CC A. CC A violates A6# 1ecause is not a super"e0. *ecompose ,A: ,A G EA, F. There is no relevant #*, so the "e0 is A . Therefore ,A is in A6#. ,@ G E , !F. There is no relevant #*, so the "e0 is !. Therefore ,@ is in A6#. ,H and ,A are duplicates, so we can eliminate ,A. A6# decompositions: ,H G EA, F, ,2 G E , *F, ,; G E , .F, ,@ G E , !F.

You might also like