Download presentation
Presentation is loading. Please wait.
Published byRalph Powell Modified over 9 years ago
1
Assignment 5-1 Functional Dependencies Attributes within one table True for all table instances Part of table schema (Assumptions) Cannot get FDs just from one table instance Not normalization yet
2
Assumptions NIN, hNo, and ContractNo are unique for Staff, Hotel, and Contract, respectively. hLoc is the city where a hotel is located. Several hotels may be in the same city. One hotel could have several contracts. One contract is for one hotel. Several staff may work on one contract. One staff may work on several contracts on the same hotel. hours is the total hours of one staff on one contract. More than one employee could have the same name.
3
eName NIN NIN contractNo hours eName hNo hLoc 1135 C1024 16 Smith J H25 East Kilbride 1135 C1025 15 Smith J H4 Glasgow ….. ……... ……… …. ……………. 1160 C1024 16 Smith J H25 East Kilbride Incorrect: eName NIN (More than one employee could have the same name.) Correct: NIN eName (NIN is unique for Staff)
4
NIN All NIN contractNo hours eName hNo hLoc 1135 C1024 16 Smith J H25 East Kilbride 1135 C1025 15 Smith J H4 Glasgow ….. ……... ……… …. ……………. 1160 C1024 16 Smith J H25 East Kilbride Incorrect: NIN All Incorrect: NIN hours Incorrect: NIN hNo (One staff may work on several contracts on the same hotel)
5
NIN, hNo All NIN contractNo hours eName hNo hLoc 1135 C1024 16 Smith J H25 East Kilbride 1135 C1025 15 Smith J H4 Glasgow ….. ……... ……… …. ……………. 1135 C1029 6 Smith J H25 East Kilbride Incorrect: NIN, hNo All (One staff may work on several contracts on the same hotel) Incorrect: NIN, hLoc All
6
ContractNo, hNo All NIN contractNo hours eName hNo hLoc 1135 C1024 16 Smith J H25 East Kilbride 1057 C1024 24 Hocine D H25 East Kilbride 1068 C1025 28 White T H4 Glasgow 1135 C1025 15 Smith J H4 Glasgow ….. ……... ……… …. ……………. Incorrect: ContractNo, hNo All (Several staff may work on one contract) hNo not needed anyway: ContractNo All Incorrect: ContractNo, hLoc All
7
ContractNo eName NIN contractNo hours eName hNo hLoc 1135 C1024 16 Smith J H25 East Kilbride 1057 C1024 24 Hocine D H25 East Kilbride 1068 C1025 28 White T H4 Glasgow 1135 C1025 15 Smith J H4 Glasgow ….. ……... ……… …. ……………. Incorrect: ContractNo eName (Several staff may work on one contract) Incorrect: ContractNo hours
8
hNo ContractNo NIN contractNo hours eName hNo hLoc 1135 C1024 16 Smith J H25 East Kilbride 1057 C1024 24 Hocine D H25 East Kilbride 1068 C1025 28 White T H4 Glasgow 1135 C1025 15 Smith J H4 Glasgow ….. ……... ……… …. ……………. 1135 C1035 5 Smith J H4 Glasgow Incorrect: hNo ContractNo (One hotel could have several contracts)
9
hLoc hNo NIN contractNo hours eName hNo hLoc 1135 C1024 16 Smith J H25 East Kilbride 1057 C1024 24 Hocine D H25 East Kilbride 1068 C1025 28 White T H4 Glasgow 1135 C1025 15 Smith J H4 Glasgow ….. ……... ……… …. ……………. 1135 C1035 5 Smith J H14 Glasgow Incorrect: hLoc hNo (hLoc is the city where a hotel is located) (Several hotels may be in the same city)
10
NIN eName contractNo hNo hNo hLoc NIN, contractNo hours NIN, contractNo hours, eName, hNo, hLoc NIN, contractNo All
11
1.Assumptions 2.Identify all non-trivial FDs NIN eName contractNo hNo hNo hLoc NIN, contractNo hours ( NIN, contractNo All) 3.Choose a PK: NIN, contractNo 4.List all AKs: NONE
12
Assignment 6-1 Schedule(staffNo, dentistName, patNo, patName, surgeryNo, Date, Time) Make assumptions: staffNo, patNo, and surgeryNo are unique. (for what?) SurgeryNo is the surgery room number. Date and Time are two different attributes. No Appointment! A patient is allowed to have more than one surgery a day. Only one surgery can take place in a room at any given time. A dentist can perform only one surgery at any given time. A dentist is allocated in one surgery room each day. But a surgery room can be used by multiple dentists on the same day. Due Monday 12
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.