Download presentation
Presentation is loading. Please wait.
1
Advanced Data Modeling
2
2 Why Needs A Database To maintain consistency and integrity in your data by reducing redundancy and eliminating anomalies via Data Modeling and Database Design.
3
3 All attributes must be single-valued. First Normalization. All attributes must be dependent on its entity’s entire UID. Second Normalization. No non-UID attribute can be dependent on another non_UID attribute. Third Normalization. Normalization
4
4 1st Normalization All attributes must be single-valued. EMPLOYEE #* id Name 。 leave_type * leave_date To resolve, add an entity LEAVE EMPLOYEE #* id * name LEAVE #* type #* start_date #*end_date (1) #* employee_id
5
5 1st Normalization EMPLOYEE id name phone address leave_type leave_date Ex. 差假系統 : 記錄員工請假資料 Has multi-values Repeat Group
6
6 1st Normalization( 續 ) ORDER #* id * status 。 date * prod_item To resolve, add an entity PROD_ITEM ORDER #* id * status *date PROD_ITEM #* id * name *description (2) #* order_id
7
7 The above process is called 1st normalization. The final result is said to be in 1NF(Normalization Form). Conclusion: If an attribute has multi-valued attribute, create an additional entity and relate it to the original entity with M:1 relationship. 1st Normalization( 續 )
8
8 All attributes must be dependent on its entity’s entire UID. 2nd Normalization COURSE #* id * name 。 fee * duration ACCOUNT #* number * balance 。 date_opened * bank_location PRODUCT #* name #* warehouse 。 Warehouse_ location OK Not dependent on its UID
9
9 The above process is called 2nd normalization. The final result is said to be in 2NF(Normalization Form). Conclusion: If an attribute is not dependent on its entire UID, it is misplaced and must be moved. 2nd Normalization( 續 )
10
10 No non-UID attribute can be dependent on another non_UID attribute. 3rd Normalization TUTOR #* id * name *department * dept_location *dept_phone dept_location( 系辦位置 ) and dept_phone( 系辦電話 ) are dependent upon Department( 系 ) (1)
11
11 3rd Normalization( 續 ) Way to resolve: TUTOR #* id * name DEPARTMENT #* name * location * phone
12
12 3rd Normalization( 續 ) EMPLOYEE #* id * name *work_depart * mgrno *admrdept *location (2) mgrno( 主管代號 ), Admrdept( 主管部門 ) and Location( 部門地點 ) are dependent upon work_depart( 工作部門 )
13
13 3rd Normalization( 續 ) Way to resolve: EMPLOYEE #* id * name DEPARTMENT #* id * name * mgrno * admrdept * location
14
14 The above process is called 3rd normalization. The final result is said to be in 3NF(Normalization Form). Conclusion: If an attribute is dependent upon a non_UID attribute, move both the dependent attribute and the attribute it is dependent upon to a new related entity. 3rd Normalization( 續 )
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.