Download presentation

Presentation is loading. Please wait.

Published byAlize Armiger Modified about 1 year ago

1
1 Quiz 2

2
2 One instructor cannot be at two or more class rooms at the same time. One class room cannot be shared by two or more instructors at the same time. Section Number (SecNo) includes lecture, lab, discussion, and all other possible sections. InstructorNo and CourseID are unique for instructors and courses, respectively. HallID and RoomNum together uniquely identify class rooms. Classes are scheduled only for weekdays (Mon, Tue, Wed, Thu, Fri). Schedule (HallID, RoomNum, InstructorID, InstructorName, WeekDay, TimeStart, TimeEnd, CourseID, SecNo) Ullrich002YangQQiWed10:0010:52CS Ullrich002YangQQiWed11:0011:52CS Ullrich111YangQQiTue09:3010:48CS Ullrich111YangQQiThu09:3010:48CS Ullrich002LandgrafLisaWed09:0009:52CS

3
3 Which of the following are functional dependencies on the table? InstructorName InstructorID YesNo InstructorID InstructorName YesNo HallID, RoomNum, WeekDay InstructorID YesNo HallID, RoomNum, WeekDay, TimeStart All YesNo InstructorID, HallID, RoomNum All YesNo

4
4 Derive table schemas(s) for the following entity. Use DBDL to specify the table schema(s). EntityOne A1 A2 A3: multi-value A4: composite (A41, A42) A5 Primary Key: (A1, A2) A4: composite (A41, A42)Use A41 and A42 to replace A4 A3: multi-valueNeed a new table A3 and (A1, A2)

5
5 EntityOne A1 A2 A3: multi-value A4: composite (A41, A42) A5 Primary Key: (A1, A2) EntityOne (A1, A2, A41, A42, A5) PK: A1, A2 AK: None FK: None EntityM (ID, A1, A2, A3) PK: ID (new attribute) AK: None FK: (A1, A2) references EntityOne

6
6 Derive table schemas for the following entities with a one-to-many relationship. Use DBDL to specify the table schemas. EntityTwo EntityThree B1 C1 B2: composite (B21, B22) C2 PK: B1 PK: C1 EntityTwo (1..*) IsRelatedTo EntityThree (1) Attributes: D1, D2 EntityTwo (B1, B21, B22, C1, D1, D2)EntiyThree (C1, C2)

7
7 EntityTwo EntityThree B1 C1 B2: composite (B21, B22) C2 PK: B1 PK: C1 EntityTwo (1..*) IsRelatedTo EntityThree (1) Attributes: D1, D2 EntityTwo (B1, B21, B22, C1, D1, D2) PK: B1 AK: None FK: C1 references EntiyThree EntiyThree (C1, C2) PK: C1 AK: None FK: None

8
8 Derive table schemas for the following entities with a many-to-many relationship. Use DBDL to specify the table schemas. EntityFour EntityFive E1F1 E2F2: composite (F21, F22) E3: composite (E31, E32)F3 PK: E1 PK: F1 EntityFour (1..*) IsRelatedTo EntityFive (0..*) Attributes: R1, R2 Many-to-Many: New table

9
9 EntityFour EntityFive E1F1 E2F2: composite (F21, F22) E3: composite (E31, E32)F3 PK: E1 PK: F1 EntityFour (1..*) IsRelatedTo EntityFive (0..*) Attributes: R1, R2 EntityFour (E1, E2, E31, E32) PK: E1 AK: None FK: None EntityFive (F1, F21, F22, F3) PK: F1 AK: None FK: None EntityR (NewAtt, E1, F1, R1, R2) PK: NewAtt (new attribute) AK: None FK: E1 references EntityFour F1 references EntityFive

10
10 EntitySix EntitySeven G1 H1 G2: composite (G21, G22) H2 G3: multi-value H3: composite (H31, H32, H33) composite (G31, G32, G33) H4: multi-value PK: G2 PK: H1 EntitySix (0..*) IsRelatedTo EntitySeven (1) Attribute: K1, K2 G3: multi-value: new table H4: multi-value: new table One-to-Many: No new table Copy H1 to EntitySix with K1 and K2

11
11 EntitySix EntitySeven G1 H1 G2: composite (G21, G22) H2 G3: multi-value H3: composite (H31, H32, H33) composite (G31, G32, G33) H4: multi-value PK: G2 PK: H1 EntitySix (0..*) IsRelatedTo EntitySeven (1) Attribute: K1, K2 EntitySix (G1, G21, G22, H1, K1, K2) PK: G21, G22 AK: None FK: H1 references EntitySeven EntitySeven (H1, H2, H31, H32, H33) PK: H1 AK: None FK: None EntitySevenMV (NewAtt, H1, H4) PK: NewAtt (new attribute) AK: None FK: H1 references EntitySeven EntitySixMV (ID, G21, G22, G31, G32, G33) PK: ID AK: None FK: (G21, G22) references EntitySix

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google