CS 3630 Database Design and Implementation

Slides:



Advertisements
Similar presentations
ER Modeling Case Studies
Advertisements

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.
Relational Model (CB Chapter 4) CPSC 356 Database Ellen Walker Hiram College.
Logical Database Design
Assignment6-1 Assignment6-2 Due Wednesday, March 13 1.
1 6 Concepts of Database Management, 4 th Edition, Pratt & Adamski Chapter 6 Database Design 2: Design Methodology.
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.
Relational Database Management System A type of database in which records are stored in relational form is called relational database management system.
Database Management COP4540, SCS, FIU Database Modeling Using the Entity-Relationship Model (Chapter 3)
LOGICAL DATABASE DESIGN
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
CSC271 Database Systems Lecture # 6. Summary: Previous Lecture  Relational model terminology  Mathematical relations  Database relations  Properties.
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.
Physical Database Design
Project – Phase II Derive Database Schema from E-R Model DBDL.
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.
CS370 Spring 2007 CS 370 Database Systems Lecture 4 Introduction to Database Design.
CS 3630 Database Design and Implementation. 2 DreamHome Branch (branchNo, street, city, state, zipcode, phone1, phone2, phone3) Staff (staffNo, firstName,
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?
1 Chapter 17 Methodology - Local Logical Database Design.
Normalization Is the gradual and sequential process of efficiently organizing data in a database that follows the rules listed in the previous slide –
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.
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.
Chapter 15 & 16 Conceptual and Logical Database Design Methodology Thomas Connolly, Carolyn Begg, Database System, A Practical Approach to Design Implementation.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Week 7-8 DBMS ER-Relational Mapping. ER-Relational Mapping.
Database Design – Lecture 7
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.
Howard Paul. Sequential Access Index Files and Data File Random Access.
Overview/Review of DB Logical Design ER Model to Relational Model Mapping.
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
© The McGraw-Hill Companies, All Rights Reserved APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
The Relational Model May Aldoayan.
Chapter Design Methodology Pearson Education © 2009.
Tables and Their Characteristics
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
Database Normalization
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
Logical Database Design
Session 2 Welcome: The seventh learning sequence
CS 3630 Database Design and Implementation
Relationships as Primary & Foreign Keys
ER Modeling Case Studies
DBMS ER-Relational Mapping
Mapping an ERD to a Relational Database
Relationships—Topics
Presentation transcript:

CS 3630 Database Design and Implementation

Design Methodology Three main phases A structured approach that uses procedures, techniques, tools, and documentation aids to support and facilitate the process of design. Three main phases Conceptual database design Understanding client data E-R (EER) Model Agreement between clients and designers E-R Model could be used for any database system Logical database design Mapping E-R Model to (relational) database schema Normalization Physical database design 2013: Finished at 43 for both sections

Mapping E-R Model to Relational Database Schema Entity type  Table schema How to maintain relationships?

Mapping Strong Entities to Relation (Table) Schemas Replacing composite attributes with simple attributes Adding new tables to remove multi-value attributes

Replacing Composite Attributes with Simple Attributes Name: Composite (FirstName, LastName) Use two attributes: FirstName LastName Address : Composite (Street, City, State, Zipcode) Use four attributes: Street City State Zipcode Performance issue

Composite Attributes Search/Project on state or zip code staffNo Name Address . . . SL21 John White 1 main street, Platteville, WI 53818 SG37 Ann Beech 15 University Dr, Madison, WI 53706 SA9 Mary Howe 908 Western avenue, Dubuque, IA 52001-1234 Search/Project on state or zip code

Simple Attributes Search/Project on state or zip code staffNo firstName lastName Street City State zip SL21 John White 1 main street Platteville WI 53818 SG37 Ann Beech 15 University Dr Madison 53706 SA9 Mary Howe 908 Western avenue Dubuque IA 52001-1234 Search/Project on state or zip code

E-R Model Staff StaffNo Name: Simple or Composite? Address Salary . . .

Removing Multi-Value Attributes No multi-value attributes in relational databases First Order Logic No sets as set elements

Multi-Value Attributes branchNo street city state zipCode telNo B001 1 main street Platteville WI 53818 608-348-1234 608-348-3345 B002 15 university drive Madison 53706 608-255-3034 608-255-1023 877-323-5678 …

Removing Multi-Value Attributes without Losing Data Entity Type in E-R Model Branch branchNo . . . telNo: multi-value How to Store telNo? phoneOne phoneTwo phoneThree (When we know the limit of phone numbers at a branch: at most three) Staff staffNo homePhone workPhone cellPhone

Each Branch Has at Most Three Phone Numbers branchNo street . . . phone1 phone2 phone3 B001 1 main street 608-348-1234 608-348-3345 B002 15 university drive 608-255-3034 608-255-1023 877-323-5678 …

Home Phone, WorkPhone and Cell Phone staffNo street . . . homePhone workPhone cellPhone SL21 1 main street 608-348-1234 608-348-3345 SG37 15 university drive 608-255-1023 877-323-5678 SA79 … 608-255-3034 608-255-3847

Multi-Value Attributes Without Limit Entity Type in E-R Model Branch branchNo . . . telNo: multi-value (NO LIMIT or LIMIT TOO LARGE) More Examples Student Major Work Experience Research publications . . .

Replacing Multi-Value Attributes branchNo Street City State zipCode B001 B002 … branchNo . . . telNo B001 608-348-1234 608-348-3345 B002 608-255-3034 608-255-1023 877-323-5678 … branchNo telNo B001 608-348-1234 608-348-3345 B002 608-255-3034 608-255-1023 877-323-5678 … One table  two tables Multi-Value attribute  multiple records Primary Key  Foreign Key

Replacing Multi-Value Attributes Entity Type in E-R Model Branch branchNo . . . telNo: multi-value (NO LIMIT!) How to Store telNo? Remove it from Branch and create a new table! BranchPhone telPhone Which attributes should be in the new table? The PK attribute(s) and the multi-value attribute. Is branchNo the PK in Branch? Is branchNo the PK in BranchPhone? Foreign Key!

Primary Key and Foreign Key branchNo telNo B001 608-348-1234 608-348-3345 B002 608-255-3034 608-255-1023 877-323-5678 … branchNo Street City State zipCode B001 B002 …

What is the Primary Key? BranchPhone branchNo telPhone Assumption Two branches don’t share the same phone # Two branch can shared the same phone # (branchNo, telephone) newAtt Must be unique!

Replacing Multi-Value Attributes Always use a new table to replace any multi-value attribute IN Assignments Quizzes Tests Final

Mapping Entity Type to Table Schema Entity Type in E-R Model Branch branchNo address: composite (street, city, state, zipCode) telNo: multi-value (with or without limit!) Table Schema (DBDL) Branch (branchNo, street, city, state, zipCode) PK: branchNo AK: street, city, state, zipCode FK: NONE BranchPhone (newAtt, branchNo, telPhone) PK: newAtt AK: NONE FK: branchNo references Branch

Mapping Entity Type to Table Schema Entity Type in E-R Model Staff staffNo . . . DOB workExperince: multi-value Composite (start, end, org, position) Store workExperince with staffNo in a new Table! WorkExperience start end org position PK? Could create a new PK attribute (workExpID) FK?

Storing Work Experience Entity Type in E-R Model Staff staffNo . . . DOB workExperince: multi-value Composite (start, end, org, position) Table Schema (DBDL) Staff (staffNo, . . ., DOB) PK: staffNo AK: NONE FK: NONE WorkExperience(workExpID, staffNo, start, end, org, position) PK: workExpID AK: None FK: staffNo references Staff

Individual Assignment Due Wednesday, Feb 22