Database Design Lessons 2 & 3 Database Models, Entities, Relationships.

Slides:



Advertisements
Similar presentations
Chapter # 4 BIS Database Systems
Advertisements

Entity Relationship Diagrams
More Diagramming & Practice with Relationship Modeling
Chapter 6: Entity-Relationship Model (part I)
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
ENTITY RELATIONSHIP MODELLING
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Entity Relationship (ER) Modeling
System Analysis - Data Modeling
Agenda for Week 1/31 & 2/2 Learn about database design
Ch5: Software Specification. 1 Descriptive specifications  Describe desired properties of system  Three types:
Lecture 3 :Database Analysis and Design (II)
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Modern Systems Analysis and Design Third Edition
APPENDIX C DESIGNING DATABASES
Things are bad. Children no longer obey their parents and everyone is writing a book. -- Marcus Tillius Cicero.
Oracle Academy -Week 1-.
Entity Relationship Modeling Objectives: To illustrate how relationships between entities are defined and refined. To know how relationships are incorporated.
Data Modeling Using the Entity-Relationship Model
DATA MODELING AND DATABASE DESIGN DATA MODELING AND DATABASE DESIGN Part 1.
IT 244 Database Management System Data Modeling 1 Ref: A First Course in Database System Jeffrey D Ullman & Jennifer Widom.
Module 2: Conceptual Data Modeling with ERD
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Data Modeling ERM ERD.
Entity Relationship Diagrams
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Overview of Database Development
Conceptual Design Lecture - 2 Database Development.
BIS 360 – Lecture Six (Part 2) Conceptual Data Modeling (Chapter 10 and partial Chapter 12)
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Copyright Ó Oracle Corporation, All rights reserved. Normalization Use the student note section below for further explanation of the slide content.Use.
Copyright  Oracle Corporation, All rights reserved. 11 ® Introduction to Entities, Attributes, and Relationships Section 02 – Lessons 1,2,3 Use.
Database Design Principles – Lecture 3
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
1.  An introduction to data modelling  The purpose of data modelling  Modelling data relationships 2.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (ER) Modeling.  ER model forms the basis of an ER diagram  ERD represents conceptual database as viewed by end user 
1. Objectives At the end of this chapter you should be able to:  Discuss the use and features of a data model  Define the terms entity and attribute.
Lecture 4 Conceptual Data Modeling. Objectives Define terms related to entity relationship modeling, including entity, entity instance, attribute, relationship,
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
IT 21103/41103 System Analysis & Design. Chapter 04 Data Modeling.
Description and exemplification of entity-relationship modelling.
ERD ( Conceptual data model From the statement of data requirements a conceptual data model is produced. This describes.
Database Systems: Design, Implementation, and Management Ninth Edition Chapter 4 Entity Relationship (ER) Modeling.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 4 ENTITY RELATIONSHIP (ER) MODELING Instructor Ms. Arwa Binsaleh 1.
Database Design – Lecture 6 Moving to a Logical Model.
INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.
Entities, Instances, Attributes and Identifiers. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –Define and give.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
ERD :: 19 / 1 / Entity-Relationship (ER) Modeling. ER Modeling is a top-down approach to database design. Entity Relationship (ER) Diagram –A.
1 Database Design Sections 6 & 7 First Normal Form (1NF), Second Normal Form (2NF), Unique Identifiers (UID), Third Normal Form (3NF), Arcs, Hierarchies.
Entity Relationship Modeling
DATA MODELING AND DATABASE DESIGN
Entity-Relationship Model
© The McGraw-Hill Companies, All Rights Reserved APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
Tables and Their Characteristics
Database Design – Lecture 4
Data Modeling for Database Design 1
ERD’s REVIEW DBS201.
Chapter 4 Entity Relationship (ER) Modeling
Entity-Relationship Diagram (ERD)
IT 244 Database Management System
DATA MODELING AND DATABASE DESIGN
Presentation transcript:

Database Design Lessons 2 & 3 Database Models, Entities, Relationships

Database Design Conceptual Analysis What Logical Design How Physical Build Data Information

An Entity Something of significance to business about which data must be known A name for the things that you can list A single name of noun Entities have Instances Occurrences of entities Rows

Entities vs. Instance Entities can be: Tangible, like Person or Product Nontangible, like skill level An event, like concert, graduation, wedding Instance examples: Animal entity instances like, Dalmatian, Siamese cat, cow, tiger Car entity instances like, sedan, station wagon, SUV, convertible

Examples Entity = Product New York = instance Director can be either an entity or instance – context is important

Attributes Entities have Attributes Single-value property, detail of an entity Piece of information that describes, qualifies, quantifies, classifies and/or specifies an entity Property of an entity Attributes have a data type

Attributes Describe an entity Attribute vs. attribute value color vs. blue animal type vs. dog Can have one and only one value at a given point in time One or more attributes must be defined as a unique identifier (UID)

Unique Identifier (UID) Used to distinguish one instance of an entity from another Example: Student ID as a UID for student entity part number as a UID for product entity Social security number (UID) for employee Denote with a #

Attributes Must be a single-values at any point in time Should be stored in one and only one entity Values have data type Example: entity CAR may have attributes model & color (values of beetle, green) An attribute may change over time

Attribute Volatile may change with time, like age should look for non-volatile attributes like birth date rather than age Mandatory vs. Optional address mandatory for EMPLOYEE if modeling application address optional for CUSTOMER is modeling an online catalog

Entity relationship diagram (ERD) Visual way to display business requirements Tool used in design stage Used to react to, validate, and correct data in database Entities should be implemetation- free

Relationship Represents something significant to a business Expresses how entities are mutually related Always exist between entities Always have two perspectives Is named at both ends Between two entities (or one entity and itself) Have an optionality Have a degree or cardinality

Conventions Entities appear as all capital letters and singular Relationships are italicized Entities are placed in soft boxes (rounded corners) Examples: EMPLOYEE hold JOBs JOBs are held by EMPLOYEEs PRODUCTs are classified by a PRODUCT TYPE PRODUCT TYPE classifies a PRODUCT

Optionality of relationships A relationship adds a link between entities Relationships come from business rules Is it a mandatory or optional relationship

Optionality of relationships Are either Mandatory or Optional Mandatory value is a REQUIRED field Use MUST to describe Denoted with an * and a solid line Optional value may be supplier or not Use MAY to describe Denoted with a ° and a dashed line Example: Each DEPARTMENT must have one or more EMPLOYEEs Each DEPARTMENT may have one or more EMPLOYEEs

Identifying Relationships Cardinality or Degree of relationship Describes how many? Use one and only one or one or more use crow foot to denote one or more in ERD Examples: Each DEPARTMENT may have one or more EMPLOYEEs Each EMPLOYEE must be assigned to one and only one DEPARTMENT See ERD on next slide

ERD Entities use soft boxes DEPARTMENT # ID o name o location EMPLOYEE #ID * first name * last name o telephone number o salary * job hire assigned to

Examples: Each SEAT may be sold to one or more PASSENGERs this example accounts for overbooking Each PASSENGER may purchase one and only one SEAT

Entity naming Name must be unique Create a description of the entity (be explicit) Be aware of homonyms Market = 16 to 25 years Market = Europe, Asia etc. Avoid reserved words Remove the relationship name from the entity name

ERD conventions - summary Entities go in soft boxes Entity names are singular and written in all capital letters Attributes go under Entity # is a UID (unique identifier – Key) * mandatory attribute o optional attribute

ERD conventions - summary Relationships are lines (optionality) solid are mandatory dashed are optional Lines terminations express cardinality single toe denotes one and only one crows foot denotes one or more

Example Each HAIRSTYLIST may work on one or more CLIENTs Each CLIENT must be assigned to one and only one HAIRSTYLIST See next slide to ERD

ERD diagram List entity and attributes HAIRSTYLIST # id * first name *last name * address * phone number * social-security number * salary CLIENT # client number * first name o last name o phone number work on assigned to

Conventions Not a strict requirement (can reverse) this crow is flying east this crow is flying south

Matrix Diagram 3.4 TRAVELERCOUNTRYLANDMARK TRAVELERVisitHave seen COUNTRYVisited byThe location of LANDMARKSeen byLocated in

ERD TRAVELER COUNTRY LANDMARK visit visited by have seen seen by the location of located in

Previous ERD Note ERD included optionality and cardinality Note there are several M:M relationship. This is a valid relationship, but discussed in later chapters