2.9K views

Uploaded by Shuhana Azmin

Database Systems_ the Complete Book_ Solutions for Chapter 3

- MMT (10&11) is Design Part 2 (1)
- ch6
- DBMS-Lecture1 (P1-C1-T1)
- Database Systems an Application Oriented Approach (Selected Solutions)
- Database Systems Solutions
- cs425 Database Exam studyGuide
- Database Management Systems Tutorial-All 2 Marks
- 17032658 Database Management Systems Tutorial 090917034406 Phpapp02
- Chapter 1
- GIS Map of Sikkim
- chp09
- Adbms Book
- Topic5 NormalizationPART2 Aug14
- Steps on Normalization
- gisy 5003
- Protege Tutor Slide
- Flow Chart1
- Case Study CTTS - Milestone 04 Data Modeling Solution
- Transportation Statistics: table 05 02
- Question Bank Dbms

You are on page 1of 6

Solutions for Section 3.1 Solutions for Section 3.2 Solutions for Section 3.3 Solutions for Section 3.4 Solutions for Section 3.5 Solutions for Section 3.6 Solutions for Section 3.7

Exercise 3.1.2(a)

We can order the three tuples in any of 3! = 6 ways. Also, the columns can be ordered in any of 3! = 6 ways. Thus, the number of presentations is 6*6 = 36. Return to Top

Exercise 3.2.1

C u s t o m e r s ( s s N o ,n a m e ,a d d r e s s ,p h o n e ) F l i g h t s ( n u m b e r ,d a y ,a i r c r a f t ) B o o k i n g s ( s s N o ,n u m b e r ,d a y ,r o w ,s e a t )

Being a weak entity set, Bookings' relation has the keys for Customers and Flights and Bookings' own attributes. Notice that the relations obtained from the t o C u s tand t o F l trelationships are unnecessary. They are:

t o C u s t ( s s N o ,s s N o 1 ,n u m b e r ,d a y ) t o F l t ( s s N o ,n u m b e r ,d a y ,n u m b e r 1 ,d a y 1 )

That is, for toCust, the key of Customers is paired with the key for Bookings. Since both include s s N o , this attribute is repeated with two different names, ssNo and ssNo1. A similar situation exists for toFlt.

Exercise 3.2.3

S h i p s ( n a m e ,y e a r L a u n c h e d ) S i s t e r O f ( n a m e ,s i s t e r N a m e )

Return to Top

infolab.stanford.edu/~ullman/dscbsols/sol3.html 1/6

4/26/13

Exercise 3.3.1

Since Courses is weak, its key is number and the name of its department. We do not have a relation for GivenBy. In part (a), there is a relation for Courses and a relation for LabCourses that has only the key and the computer-allocation attribute. It looks like:

D e p t s ( n a m e ,c h a i r ) C o u r s e s ( n u m b e r ,d e p t N a m e ,r o o m ) L a b C o u r s e s ( n u m b e r ,d e p t N a m e ,a l l o c a t i o n )

D e p t s ( n a m e ,c h a i r ) C o u r s e s ( n u m b e r ,d e p t N a m e ,r o o m ) L a b C o u r s e s ( n u m b e r ,d e p t N a m e ,r o o m ,a l l o c a t i o n )

D e p t s ( n a m e ,c h a i r ) C o u r s e s ( n u m b e r ,d e p t N a m e ,r o o m ,a l l o c a t i o n )

Exercise 3.3.4(a)

There is one relation for each entity set, so the number of relations is e. The relation for the root entity set has a attributes, while the other relations, which must include the key attributes, have a+k attributes. Return to Top

Exercise 3.4.2

Surely ID is a key by itself. However, we think that the attributes x, y, and z together form another key. The reason is that at no time can two molecules occupy the same point.

Exercise 3.4.4

The key attributes are indicated by capitalization in the schema below:

C u s t o m e r s ( S S N O ,n a m e ,a d d r e s s ,p h o n e ) F l i g h t s ( N U M B E R ,D A Y ,a i r c r a f t ) B o o k i n g s ( S S N O ,N U M B E R ,D A Y ,r o w ,s e a t )

Exercise 3.4.6(a)

The superkeys are any subset that contains A1. Thus, there are 2^{n-1} such subsets, since each of the n-1

infolab.stanford.edu/~ullman/dscbsols/sol3.html 2/6

4/26/13

Exercise 3.5.1(a)

We could try inference rules to deduce new dependencies until we are satisfied we have them all. A more systematic way is to consider the closures of all 15 nonempty sets of attributes. For the single attributes we have A+ = A, B+ = B, C+ = ACD, and D+ = AD. Thus, the only new dependency we get with a single attribute on the left is C->A. Now consider pairs of attributes: AB+ = ABCD, so we get new dependency AB->D. AC+ = ACD, and AC->D is nontrivial. AD+ = AD, so nothing new. BC+ = ABCD, so we get BC->A, and BC->D. BD+ = ABCD, giving us BD->A and BD->C. CD+ = ACD, giving CD->A. For the triples of attributes, ACD+ = ACD, but the closures of the other sets are each ABCD. Thus, we get new dependencies ABC->D, ABD->C, and BCD->A. Since ABCD+ = ABCD, we get no new dependencies. The collection of 11 new dependencies mentioned above is: C->A, AB->D, AC->D, BC->A, BC->D, BD>A, BD->C, CD->A, ABC->D, ABD->C, and BCD->A.

Exercise 3.5.1(b)

From the analysis of closures above, we find that AB, BC, and BD are keys. All other sets either do not have ABCD as the closure or contain one of these three sets.

Exercise 3.5.1(c)

The superkeys are all those that contain one of those three keys. That is, a superkey that is not a key must contain B and more than one of A, C, and D. Thus, the (proper) superkeys are ABC, ABD, BCD, and ABCD.

Exercise 3.5.3(a)

We must compute the closure of A1A2...AnC. Since A1A2...An->B is a dependency, surely B is in this set, proving A1A2...AnC->B.

Exercise 3.5.4(a)

Consider the relation

infolab.stanford.edu/~ullman/dscbsols/sol3.html 3/6

4/26/13

Exercise 3.5.8(a)

If all sets of attributes are closed, then there cannot be any nontrivial functional dependencies. For suppose A1A2...An->B is a nontrivial dependency. Then A1A2...An+ contains B and thus A1A2...An is not closed.

Exercise 3.5.10(a)

We need to compute the closures of all subsets of {ABC}, although there is no need to think about the empty set or the set of all three attributes. Here are the calculations for the remaining six sets: A+ = A B+ = B C+ = ACE AB+ = ABCDE AC+ = ACE BC+ = ABCDE We ignore D and E, so a basis for the resulting functional dependencies for ABC are: C->A and AB->C. Note that BC->A is true, but follows logically from C->A, and therefore may be omitted from our list. Return to Top

Exercise 3.6.1(a)

In the solution to Exercise 3.5.1 we found that there are 14 nontrivial dependencies, including the three given ones and 11 derived dependencies. These are: C->A, C->D, D->A, AB->D, AB-> C, AC->D, BC->A, BC>D, BD->A, BD->C, CD->A, ABC->D, ABD->C, and BCD->A. We also learned that the three keys were AB, BC, and BD. Thus, any dependency above that does not have one of these pairs on the left is a BCNF violation. These are: C->A, C->D, D->A, AC->D, and CD->A. One choice is to decompose using C->D. That gives us ABC and CD as decomposed relations. CD is surely in BCNF, since any two-attribute relation is. ABC is not in BCNF, since AB and BC are its only keys, but C->A is a dependency that holds in ABCD and therefore holds in ABC. We must further decompose ABC into AC and BC. Thus, the three relations of the decomposition are AC, BC, and CD. Since all attributes are in at least one key of ABCD, that relation is already in 3NF, and no decomposition is necessary.

infolab.stanford.edu/~ullman/dscbsols/sol3.html 4/6

4/26/13

Exercise 3.6.1(b)

(Revised 1/19/02) The only key is AB. Thus, B->C and B->D are both BCNF violations. The derived FD's BD->C and BC->D are also BCNF violations. However, any other nontrivial, derived FD will have A and B on the left, and therefore will contain a key. One possible BCNF decomposition is AB and BCD. It is obtained starting with any of the four violations mentioned above. AB is the only key for AB, and B is the only key for BCD. Since there is only one key for ABCD, the 3NF violations are the same, and so is the decomposition. Return to Top

Exercise 3.7.1

Since A->->B, and all the tuples have the same value for attribute A, we can pair the B-value from any tuple with the value of the remaining attribute C from any other tuple. Thus, we know that R must have at least the nine tuples of the form (a,b,c), where b is any of b1, b2, or b3, and c is any of c1, c2, or c3. That is, we can derive, using the definition of a multivalued dependency, that each of the tuples (a,b1,c2), (a,b1,c3), (a,b2,c1), (a,b2,c3), (a,b3,c1), and (a,b3,c2) are also in R.

Exercise 3.7.2(a)

First, people have unique Social Security numbers and unique birthdates. Thus, we expect the functional dependencies ssNo->name and ssNo->birthdate hold. The same applies to children, so we expect childSSNo>childname and childSSNo->childBirthdate. Finally, an automobile has a unique brand, so we expect autoSerialNo->autoMake. There are two multivalued dependencies that do not follow from these functional dependencies. First, the information about one child of a person is independent of other information about that person. That is, if a person with social security number s has a tuple with cn,cs,cb, then if there is any other tuple t for the same person, there will also be another tuple that agrees with t except that it has cn,cs,cb in its components for the child name, Social Security number, and birthdate. That is the multivalued dependency ssNo->->childSSNo childName childBirthdate Similarly, an automobile serial number and make are independent of any of the other attributes, so we expect the multivalued dependency ssNo->->autoSerialNo autoMake The dependencies are summarized below:

s s N o>n a m eb i r t h d a t e c h i l d S S N o>c h i l d N a m ec h i l d B i r t h d a t e a u t o S e r i a l N o>a u t o M a k e

infolab.stanford.edu/~ullman/dscbsols/sol3.html 5/6

4/26/13

Exercise 3.7.2(b)

We suggest the relation schemas

{ s s N o ,n a m e ,b i r t h d a t e } { s s N o ,c h i l d S S N o } { c h i l d S S N o ,c h i l d N a m ec h i l d B i r t h d a t e } { s s N o ,a u t o S e r i a l N o } { a u t o S e r i a l N o ,a u t o M a k e }

{ s s N o ,n a m e ,b i r t h D a t e } { s s N o ,c h i l d S S N o ,c h i l d N a m e ,c h i l d B i r t h d a t e } { s s N o ,a u t o S e r i a l N o ,a u t o M a k e }

Exercise 3.7.3(a)

Since there are no functional dependencies, the only key is all four attributes, ABCD. Thus, each of the nontrvial multivalued dependencies A->->B and A->->C violate 4NF. We must separate out the attributes of these dependencies, first decomposing into AB and ACD, and then decomposing the latter into AC and AD because A->->C is still a 4NF violation for ACD. The final set of relations are AB, AC, and AD.

Exercise 3.7.7(a)

Let W be the set of attributes not in X, Y, or Z. Consider two tuples xyzw and xy'z'w' in the relation R in question. Because X ->-> Y, we can swap the y's, so xy'zw and xyz'w' are in R. Because X ->-> Z, we can take the pair of tuples xyzw and xyz'w' and swap Z's to get xyz'w and xyzw'. Similarly, we can take the pair xy'z'w' and xy'zw and swap Z's to get xy'zw' and xy'z'w. In conclusion, we started with tuples xyzw and xy'z'w' and showed that xyzw' and xy'z'w must also be in the relation. That is exactly the statement of the MVD X ->-> Y-union-Z. Note that the above statements all make sense even if there are attributes in common among X, Y, and Z.

Exercise 3.7.8(a)

Consider a relation R with schema ABCD and the instance with four tuples abcd, abcd', ab'c'd, and ab'c'd'. This instance satisfies the MVD A ->-> BC. However, it does not satisfy A ->-> B. For example, if it did satisfy A >-> B, then because the instance contains the tuples abcd and ab'c'd, we would expect it to contain abc'd and ab'cd, neither of which is in the instance. Return to Top

infolab.stanford.edu/~ullman/dscbsols/sol3.html

6/6

- MMT (10&11) is Design Part 2 (1)Uploaded byUud Achmad
- ch6Uploaded byalsf20
- DBMS-Lecture1 (P1-C1-T1)Uploaded bycharnegrete
- Database Systems an Application Oriented Approach (Selected Solutions)Uploaded byKnight7
- Database Systems SolutionsUploaded byZeb Aslam
- cs425 Database Exam studyGuideUploaded byhidrovo3589
- Database Management Systems Tutorial-All 2 MarksUploaded byKarthik Mk
- 17032658 Database Management Systems Tutorial 090917034406 Phpapp02Uploaded bybushemmy
- Chapter 1Uploaded bypreeti198615
- GIS Map of SikkimUploaded bydonbosskiss
- chp09Uploaded byMSAMHOURI
- Adbms BookUploaded byHassan Ali
- Topic5 NormalizationPART2 Aug14Uploaded byAiyas Aboobakar
- Steps on NormalizationUploaded byafzhussain
- gisy 5003Uploaded byapi-254268575
- Protege Tutor SlideUploaded bynguyende2004
- Flow Chart1Uploaded byKevin Collins
- Case Study CTTS - Milestone 04 Data Modeling SolutionUploaded byShithi Tamanna
- Transportation Statistics: table 05 02Uploaded byBTS
- Question Bank DbmsUploaded bymartinmystery5994
- State Space VariablesUploaded byvani
- Raster DataUploaded byRolando Tomy Salas Lopez
- UNL MatLab 155N Project 5 ReportUploaded byDillon Weller
- wsdlUploaded byshravan522
- Lumpy Demand ForecastingUploaded byHassan
- Photoshop Tutorials CcUploaded byFabiana Go
- DIP3E Chapter03 ArtUploaded byThippeswamy Kh
- Dispersion TestsUploaded byMarios Maltensis
- Sensitivity AnalysisUploaded byLekshmi Nair
- 55-7963 Control of Linear Systems Assignment_1415.pdfUploaded byMB Fazli Nisar

- what internet is - 4 layers.pdfUploaded byShuhana Azmin
- cs491.lecture01.pptxUploaded byShuhana Azmin
- ERD(Hall Management)Uploaded byShuhana Azmin
- En He is suffering from waswaas (Insinuatingwhispers) Of the Shaytaan about the Essence of AllaahUploaded byDear2013
- the_school_for_robinsons.pdfUploaded byShuhana Azmin
- Lexi CalUploaded byShuhana Azmin
- Px c 3883490Uploaded byShuhana Azmin
- b+treesUploaded byddro
- IJIP-74Uploaded byShuhana Azmin

- 2. Computer Memories.pdfUploaded byflobarragan90
- S04AUploaded byAndriyani Yani
- 000511768-protectionUploaded byvisdeceara
- TECHNICAL NOTE 010 Raft Foundations, s'– t Plots and SPT-N ValuesUploaded byapirakq
- Ghadir EssayUploaded byAbuzahra Dimasangca
- Anti-White Translation Guide & Survivalist DictionaryUploaded byscribmem
- Chapter 4 VariablesUploaded byHum92re
- Sag and Tension CalculationUploaded byRatana Kem
- IntroObadiah.pdfUploaded byNarcis Ciobanu
- HP LexiconUploaded byNara Rizaki
- Emerging Market_The End of Corporate ImperialismUploaded byVaibhav Vandhav
- smart card black updated with levels of performance by dgroupUploaded byapi-280340107
- Dell™ OptiPlex™ GX620Uploaded byWasif Ahmed
- The Storyteller (Carlos Fuentes)Uploaded byGeraldine
- Test Paper 1 Page 2Uploaded byRanjit Kumar
- sdarticle-16Uploaded byVinh Tran
- B006677JUploaded byjfjd6889
- Critical Intimacy- Jacques Derrida and the Friendship of PoliticsUploaded byKatarzyna Słoboda
- VHS 1008p050 Spotlight RevUploaded byoslosser
- Accounting Template.docUploaded byFeeling_so_fly
- Working with EtaPRO Client.pptUploaded byBari Dominguez
- Energy SourcesUploaded byMukharram Khan
- A Generalization of Routh’s Triangle TheoremUploaded byKonstantinos Michailidis
- Legendary Pastor John Touch Berry Dies at 80Uploaded byrfaxman
- Surfactant ReviewUploaded byAhmad Andika Himawan
- Maintenance and Repair of Pressure VesselsUploaded byjishnunelliparambil
- Building Composite Applications With Notes Widgets in IBM Lotus Notes 8Uploaded byAshish Daga
- Optimizing Fixed Income Funds BlackrockUploaded byNITIN
- CV ETESJunior SalesUploaded byKate Hiscox
- Economist SociologistUploaded byfieldsa83