Quiz 1 1. 2 Where to Store Attributes of Relationship Staff (1) Interviews (0..*) Client Attributes: date, time, comment Staff (StaffNo, …) PK: StaffNo.

Slides:



Advertisements
Similar presentations
Convert ER to Relational Database Entity relation Entity relation Attributes attributes Attributes attributes Primary key primary key Primary key primary.
Advertisements

ER Modeling Case Studies
1 Assignment 4 Map entities with relationships to relational schemas. Use DBDL to describe the table schemas.
Assignment Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the.
Logical Database Design
Mapping an ERD to a Relational Database To map an ERD to a relational database, five rules are defined to govern how tables are constructed. 1)Rule for.
Chapter 6 Methodology Logical Database Design for the Relational Model Transparencies © Pearson Education Limited 1995, 2005.
1 Methodology : Conceptual Databases Design © Pearson Education Limited 1995, 2005.
Methodology Logical Database Design for the Relational Model
Chapter 4 ENTITY-RELATIONSHIP MODELLING.
1 Design Methodology A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the process of design.
CS 3630 Database Design and Implementation. First Normal Form (1NF) No multi-value attributes Done when mapping E-R model to relational schema DBDL 2.
1 CS 3630 Database Design and Implementation. 2 Final Exam 7:00 – 8:52 PM, Thursday, May 16 Section 1: Ull 009 Section 2: Ull Points –50 points.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Reduction of an E-R Schema to Tables A database which conforms to an E-R diagram can be represented.
Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – ER Model.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
LOGICAL DATABASE DESIGN
Mapping ERM to relational database
Amity School of Engineering & Technology E-R Diagram for a University Enterprise.
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Ref. Chapter3 Lecture4 1.
Entity-Relationship modeling Transparencies
1 Test1 N = {n: n is an integer and n  0} X = {x: x = n + 5, where n  N} Y = {y: y = 7 * n - 1, where n  N} List the three smallest elements of each.
Chapter 11 (I) CIS458 Sungchul Hong. Chapter 11 - Objectives How to use Entity–Relationship (ER) modelling in database design. Basic concepts associated.
Chapter 3: Relational Model I Structure of Relational Databases Structure of Relational Databases Convert a ER Design to a Relational Database Convert.
Project – Phase II Derive Database Schema from E-R Model DBDL.
Chapter 3: Relational Model  Structure of Relational Databases  Normal forms (chap. 7)  Reduction of an E-R Schema to Relational (Sect. 2.9)  Relational.
1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.
Chapter 9 Methodology - Logical Database Design Chapter 16 in Textbook.
CSCI 3140 Module 3 – Logical Database Design for the Relational Model Theodore Chiasson Dalhousie University.
Team Dosen UMN Database Design Connolly Book Chapter
© Pearson Education Limited, Chapter 9 Logical database design – Step 1 Transparencies.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
CS 3630 Database Design and Implementation. 2 DreamHome Branch (branchNo, street, city, state, zipcode, phone1, phone2, phone3) Staff (staffNo, firstName,
1 Session 2 Welcome: The seventh learning sequence “ Reduction of an EER schema to tables“ Recap : In the previous learning sequence, we discussed the.
CS 3630 Database Design and Implementation. 2 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
1 E-R Model (II) Keys To identify records in a table Candidate Key Primary Key Alternate Key Composite Key.
CS 3630 Database Design and Implementation. Assignment 1 2 What is 3630?
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
ICOM 5016 – Introduction to Database Systems Lecture 9 Dr. Manuel Rodriguez Department of Electrical and Computer Engineering University of Puerto Rico,
E-R to Relational - Basic
1 Chapter 17 Methodology - Local Logical Database Design.
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
CS 3630 Database Design and Implementation. 2 Design Methodology Three main phases 1.Conceptual database design Understanding client data E-R (EER) Model.
CS 3630 Database Design and Implementation. Unnormalized Form (UNF) student courses John CS363 CS334 CS323 Multi-Value attribute Common in reports 2.
Chapter 17 Logical Database Design for the Relational Model Pearson Education © 2009.
Software School of Hunan University Database Systems Design Part III : Mapping ER Diagram to Relational Schema.
Database Design – Lecture 6 Moving to a Logical Model.
Modelling Methodologies Chapter 16, 17, 18. Modeling Methodologies2 Database Design Physical DB design Logical DB design Conceptual DB design Hardware.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
Database Design – Lecture 7
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Prepared by L. Nouf Almujally Ref. Chapter3 Lecture4 1.
CSC271 Database Systems Lecture # 23. Summary: Previous Lecture  Database design using ER modeling  Concepts of ER model  Entities  Relationships.
Second Normal Form (2NF) A relation R is in 1NF, and every non-primary-key attribute is fully functionally dependent on the primary key Then R is in 2NF.
Database Design Slide 1 Database Design Lecture 7 part 2 Mapping ERD to Tables.
Concepts of Database Management, Fifth Edition Chapter 6: Database Design 2: Design Methodology.
Chapter 8 Entity-Relationship Modeling Pearson Education © 2009.
Overview/Review of DB Logical Design ER Model to Relational Model Mapping.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
Assignment 4 Map entities with relationships to relational schemas.
The Relational Database Model
CS 3630 Database Design and Implementation
Logical Database Design
DBMS ER-Relational Mapping
Presentation transcript:

Quiz 1 1

2 Where to Store Attributes of Relationship Staff (1) Interviews (0..*) Client Attributes: date, time, comment Staff (StaffNo, …) PK: StaffNo AK: None FK: BranchNo references Branch Client (ClientNo, Name, Address,... InterviewStaffNo, InterviewDate, IntervieTime, InterviewResult) PK: ClientNo AK: None FK: InterviewStaffNo references Staff

3 Where to Store Attributes of Relationship E1 (0..1) RelatedTo (1) E2 Attributes: Att1, Att2 E1 (A1, A2, A3, A41, A42, A43, A44, Att1, Att2, B1, B2) PK: A1, A2 AK: None FK: B1, B2 references E2 E2 (B1, B2, B31, B32, B33) PK: B1, B2 AK: None FK: None

4 Where to Store Attributes of Relationship Staff (0..*) Inspects (0..*) Car Attributes: date, time, fault Staff (StaffNo,...) Car (CarNo,...) Inspection (ID, StaffNo, CarNo, Date, Time, Fault) PK: ID AK: CarNo, Date, Time StaffNo, Date, Time FK: StaffNo references Staff CarNo references Car

5 Complex Relationship (involving 3 or more entities) Client REGESTERS with Staff at Branch Add a new table Registration BranchStaff Client Registers

6 Complex Relationship Client REGESTERS with Staff at Branch Add a new table Registration Client RegistrationBranchStaff HasCarryOut Does * * 1..1 Is Client the same as Registration?

7 Recursive Relationship One-to-Many (1:*) Staff (0..1) Supervises (0..*) Staff (Supervisor) (Supervisee) Add a new column (SupervisorNo) One-to-One (1:1) Add a new column Many-to-Many (*:*) Add a new table

8 Superclass/subclass Relationship

9 Multiple Relationships between two Entities Staff and Branch Branch (Bno, Street, City, State, Zipcode, Phone) Staff (Sno, firstName, lastName, Address) Branch (1) Has (1..*) Staff Staff (1) Manages (0..1) Branch Cannot have circular references. Branch (Bno, Street, City, State, Zipcode, Phone) Staff (Sno, firstName, lastName, Address, Bno, Position)

10 Mapping Weak Entities to Relation Schema Primary Key may not exist Adding PK based on the relationship Combining weak entity into parent entity

11 Strong and Weak Entities Staff (Sno, firstName, lastName, Address, Phone, Salary) Next_Of_Kin(firstName, lastName, Address, Phone) Staff (1..*) RelatedTo (0..1) Next_Of_Kin attribute: relationship This is a one-to-many relationship. Create PK for Next_Of_Kin and copy that with attribute relationship to Staff as FK Combine into one table Staff Same person may be Next_Of_Kin of multiple staff members Next_Of_Kin of different staff members are not related

12 DBDL (Database Design Language) Branch (Bno, Street, City, State, Zipcode, Phone) PK: Bno AK: Street, City, Zipcode Phone FK: None Staff (Sno, firstName, lastName, Address, Bno ) PK: Sno AK: None FK: Bno references Branch Client (Cno, firstName, lastName, Phone, MaxRent, PrefType) PK: Cno AK: None FK: None Viewing (ID, Rno, Pno, ViewDate, Comment) PK: ID AK: Rno, ViewDate FK: Rno references Client (Cno) Pno references Property No multi-value attributes, no composite attributes. All relationships are maintained through FKs. New attribute ID for Viewing.

13 Design Methodology Three main phases 1.Conceptual database design Understanding client data E-R (EER) Model Contract between clients and designers E-R Model could be used for any database system 2.Logical database design Mapping E-R Model to (relational) database schema Normalization 3.Physical database design

Assignment4 Due Friday, Beginning of class DropBox UserName_A4 (UserName_A4_2) No UserName_A4_3! 14