Project – Phase II Derive Database Schema from E-R Model DBDL.

Slides:



Advertisements
Similar presentations
ER Modeling Case Studies
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.
Assignment 6-1 Schedule(staffNo, dentistName, patNo, patName, surgeryNo, Date, Time) Make assumptions: surgeryNo is the surgery room number. staffNo, patNo,
Assignment6-1 Assignment6-2 Due Wednesday, March 13 1.
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.
Boyce-Codd Normal Form (BCNF) Definition R in 1NF and Every determinant (the left side of a FD) is a candidate key. 1.
Concepts of Database Management Sixth Edition
Entity-Relationship Model and Diagrams (continued)
Information Resources Management February 13, 2001.
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.
An Example: Video Rental System Video Rental Database Videos RentalsCustomers.
LOGICAL DATABASE DESIGN
Database Architecture The Relational Database Model.
Mapping ERM to relational database
Assignment 5-1 Functional Dependencies Attributes within one table True for all table instances Part of table schema (Assumptions) Cannot get FDs just.
ER Modeling Case Studies
 Keys are special fields that serve two main purposes: ◦ Primary keys are unique identifiers of the relation in question. Examples include employee numbers,
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Ref. Chapter3 Lecture4 1.
DATA MODELING AND DATABASE DESIGN
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.
Concepts of Database Management Seventh Edition Chapter 4 Keys and Relationship.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
1 CS 3630 Database Design and Implementation. 2 Sets Foundation of relational database. Basic Operations Power set Mapping.
CSCI 3140 Module 3 – Logical Database Design for the Relational Model Theodore Chiasson Dalhousie University.
1 n 1 n 1 1 n n Schema for part of a business application relational database.
Chapters 15 &16 Conceptual and Logical Database Design Methodology.
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)
Creating Tables and Inserting Records -- Not easy to edit! -- check constraints! Create table test1 ( C1 char(5) primary key, C2 Varchar2(15) not null.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
1 Translating ER Schema to Relational Model Instructor: Mohamed Eltabakh
E-R to Relational - Basic
1 Chapter 17 Methodology - Local Logical Database Design.
ENTITY RELATIONSHIP DIAGRAM ENTITY RELATIONSHIP DIAGRAM IS A SPECIALIZED GRAPHIC THAT ILLUSTRATES THE INTERRELATIONSHIPS BETWEEN ENTITIES IN A DATABASE.
Relational Theory and Design
Chapter 9 Logical Database Design : Mapping ER Model To Tables.
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.
HO 1 & 2 - Check Have you: Created a new Access database –Hands-on 1 Created a Suppliers table in design view –Hands-on 2 Downloaded and unzipped the two.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
Database Design – Lecture 7
Lecture4: Informal guidelines for good relational design Mapping ERD to Relation Prepared by L. Nouf Almujally Ref. Chapter3 Lecture4 1.
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.
Quiz Where to Store Attributes of Relationship Staff (1) Interviews (0..*) Client Attributes: date, time, comment Staff (StaffNo, …) PK: StaffNo.
CS 3630 Database Design and Implementation. Null Value The value of an attribute could be NULL NOT known at the moment or NOT Applicable Example Cell.
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.
Howard Paul. Sequential Access Index Files and Data File Random Access.
IST 220 – Intro to DB Lecture 4 Database Design thru ER Modeling.
CS3431: C-Term Translating ER Schema to Relational Model Instructor: Mohamed Eltabakh
What Is Normalization  In relational database design, the process of organizing data to minimize redundancy  Usually involves dividing a database into.
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
Chapter -3- Data Modeling Using the Entity-Relationship Model
CS 3630 Database Design and Implementation
Assignment 4 Map entities with relationships to relational schemas.
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
Boyce-Codd Normal Form (BCNF)
CS 3630 Database Design and Implementation
Presentation transcript:

Project – Phase II Derive Database Schema from E-R Model DBDL

E-R Model to DBDL Entity Type  Table Composite: Use individual fields Multi-Value: Separate table Relationship Type  Table or No Table Many-to-Many: Separate table One-to-Many: No new table Copy PK as FK (one direction) One-to-One: No new table Copy PK as FK (either direction)

Multi-Value Attributes Staff staffNo... qualifications: Composite (…) : Multi-Value wkExp: Composite (…) : Multi-Value... Tables: Staff Qualification WorkExperience

Many-to-Many Relationship Supply (1..*) Has (1..*) Supplier One supply can come from multiple suppliers One supplier can provide multiple supplies Tables: Supply Supplier SupplyFromSupplier

Foreign Keys Primary key of another table Medication (patNo, fName, lName, wardNo, drugNo, drugName, unitsPerDay, adminMethod, startDate, finishDate, staffNo) Primary Key: patNo, drugNo, startDate Alternate Key: patNo, drugNo, finishDate Foreign Key : patNo references Patient wardNo references Ward staffNo references Staff. drugNo references Pharmaceutical

Foreign Keys Appointment (1..*) GettingInfoFrom (1) LocalDoctor Appointment (apptNo, patNo, firstName, lastName, consultantNo, date, time, room, comment, docNo, clinicNo, clinicPhone) Primary Key: apptNo Alternate Key: consultantNo, date, time patNo, date, time Foreign Key : consultantNo references Staff(staffNo) patNo references Patient docNo references LocalDoctor

Foreign Keys InPatient (0..1) Has (1) Appointment InPatient (patNo, patName, dateOnWaitList, wardReq, expectedStay, dateInWard, actDateDepart, bedNo, examApt) Primary Key: patNo, dateOnWaitList Alternate Key: none Foreign Key : patNo references Patient wardReq references Ward(wardNo) examApt references Appointment(apptNo)

Foreign Keys OutPatient (0..1) Has (1) Appointment OutPatient (patNo, fName, lName, address, phone, DOB, gender, appDate, appTime, examApt) Primary Key: patNo, appDate Alternate Key: none Foreign Key : patNo references Patient examApt references Appointment(apptNo)

Project – Phase III Normalization Notes: 14 – 18 Assignment 5, 6 Test 1 DBDL for final tables in BCNF.

Quiz 3 10

Comparing Dates Insert into booking Values('H01', 'G01011', SysDate, SysDate + 2, 'R103'); Select * From Booking Where Date_From = SysDate; -- no rows selected

Comparing Dates Insert into booking Values('H01', 'G01011', SysDate, SysDate + 2, 'R103'); Select * From Booking Where Date_From = SysDate; Select * From Booking Where to_char(Date_From, 'dd mm yyyy') = to_char(SysDate, 'dd mm yyyy'); -- one row selected -- Date has time inside!

Schedule Phase III Wednesday, May 1 Quiz 4 Wednesday, May 1 Test 2 Wednesday May 8 Final Exam Thursday, May 16, at 7 PM 13

Lab 10 14