Step 1 Entity v Students Entity Simple Attribute
Step 1 Entity vขนตอนการแปลง Students Entity § กรณ Simple Attribute -สรางตารางสำหรบ Entity -ชอของตาราง นำมาจาก ชอของ Entity -ชอของคอลมน นำมาจากชอของ Attribute ของ Entity -Primary Key ของ ตาราง S_ID First_name Birth. Year Last_name Students S_ID First_name Last_name Birth. Year
Step 1 Entity vขนตอนการแปลง Entity state Customer § กรณ Composite Attributes -นำเพยงแอตทรบวตแบบ simple ทบรรจอยในแอตทรบ วตแบบ Composite มาเทานน city street Zip Code Address cus_ID First_name Last_name Customer cus_ID First_name Last_name street city State zipcode
Multivalued Attributes - Relational Model จะยอมใหมเพยง 1 ขอมลในแตละ attribute -Multivalued attribute ใน ER Model จะถกสรางเปนตารางให ม เพอเกบขอมลโดยเฉ พาะ Instructor Degrees Tel ID Name Instructor_degree ID Degree
Step 2 Weak Entity emp_first. Name emp_ID EMPLOYEE First Name emp_Last. Name Last Name dependentname 1 claims EMPLOYEE emp_ID emp_first. Name M DEPENDENT emp_Last. Name DEPENDENT first. Name lastname emp_ID birth. Date gender
Step 2 Weak Entity Building_name Building Room_number … 1 has Building_name … Room Building_name Room_number M … Room …
Step 4 : Many -to-Many Relationship … C_ID STUDENT M takes N COURSE … C_ID STUDENT S_ID … 1 M takes STUDENT_COURSE S_ID C_ID … M 1 … COURSE C_ID …
Step 4 : Many -to-Many Relationship vในกรณทความสมพนธมแอตทรบวท ใหนำแอตทรบวท … นนไปตอทายแอตทรบวททนำมาจากตารางท Registration_date S_ID ง 2 ฝง N M takes STUDENT C_ID COURSE … C_ID STUDENT takes M STUDENT_COURSE S_ID C_ID Registration_date STUDENT S_ID 1 M … … 1 COURSE Registration_date COURSE C_ID … …
Step 5 : One-to-One Relationship v. Transforming One-to-One Relationship : (0, 1) และ (1, 1( -จะดทสดถานำ Primary Key ฝง (0, 1) ไปเพมเปน Attribute ทางฝง (1, 1) เพอหลกเลยง Null
Step 6 : การแปลงความสมพนธแบบ v ความสมพนธแบบ Unary ชนดหนงตอกลม (1: M( emp_ID emp_Name EMPLOYEE M birth. Date 1 manages EMPLOYEE emp_ID emp_Name birth. Date manager. ID
Step 7 : การแปลงความสมพนธแบบ Ternary (and n-ary( v ความสมพนธแบบ Ternary เปนความสมพนธระหวางเอนทต patient_ID patient_Name PATIENT M results treatment. Code physician_ID Patient_ Treatment date M TREATMENT M 3 ตวดวยกน physician _Name PHYSICAIN time description
Step 7 : การแปลงความสมพนธแบบ Ternary (and n-ary( v ขนท patient_ID 1 ในการแปลง patient_Name PATIENT 1 M results treatment. Code physician _Name physician_ID M 1 PHYSICAIN Patient_ Treatment M 1 date TREATMENT time description
Step 8 : การแปลงความสมพนธแบบ Subtype name Supertype และ address emp. No data. Hired EMPLOYEE d SALARIED_EMP salary bonus HOURLY_EMP hourly. Rate CONSULTANT contract. No Billing. Rate
Step 8 : การแปลงความสมพนธแบบ Subtype EMPLOYEE emp. No name address SALARIED_EMP semp. No salary HOURLY_EMP hemp. No CONSULTANT cemp. No Supertype และ data. Hired bonus hourly. Rate contract. No Billing. Rate
- Slides: 44