1 A Demo of Logical Database Design. 2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model.

Slides:



Advertisements
Similar presentations
Entity Relationship (E-R) Modeling
Advertisements

Entity Relationship (E-R) Modeling Hachim Haddouti
Entity Relationship (ER) Modeling
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 4 Entity Relationship (ER) Modeling.
Chapter 4 Entity Relationship (E-R) Modeling
Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Systems Development Life Cycle
Entity Relationship (E-R) Modeling
Copyright © 2007 Ramez Elmasr and Shamkant B. Navathei Week 3 Outline Overview of Database Design Process Example Database Application (COMPANY) ER Model.
Database Systems: Design, Implementation, & Management, 5 th Edition, Rob & Coronel 1 Data Models: Degrees of Data Abstraction l Modified ANSI/SPARC Framework.
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Chapter 4 Entity Relationship (E-R) Modeling
Chapter Five Data Modeling with the Entity-Relationship Model.
Class Number – CS 304 Class Name - DBMS Instructor – Sanjay Madria Instructor – Sanjay Madria Lesson Title – ER Model.
BTM 382 Database Management Chapter 4: Entity Relationship (ER) Modeling Chitu Okoli Associate Professor in Business Technology Management John Molson.
Data Modeling 1 Yong Choi School of Business CSUB.
Yong Choi School of Business CSUB
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
3 Chapter 3 Entity Relationship (E-R) Modeling Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
1. 2 Data Modeling 3 Process of creating a logical representation of the structure of the database The most important task in database development E-R.
Chapter 7 Data Modeling with Entity Relationship Diagrams Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Entities and Attributes
ITEC 3220M Using and Designing Database Systems Instructor: Prof. Z.Yang Course Website: 3220m.htm
4 1 Chapter 4 Entity Relationship (ER) Modeling Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Chapter 5 Entity Relationship (ER) Modelling
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
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.
ICS 321 Spring 2011 High Level Database Models Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 2/7/20111Lipyeow.
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 
Database Design – Lecture 5 Conceptual Data Modeling – adding attributes.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Chapters 3 and 4 Drawing ERDs October 16, 2006 Week 3.
Chapter 9: Logical Database Design and the Relational Model (ERD Mapping)
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
3 & 4 1 Database Systems: Design, Implementation, & Management, 7 th Edition, Rob & Coronel Keys Consists of one or more attributes that determine other.
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.
Entity Relationship Modeling
Data Modeling Using the Entity-Relationship (ER) Data Model (Based on Chapter 3 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 3)
Entity-Relation Model. E-R Model The Entity-Relationship (ER) model was originally proposed by Peter in 1976 ER model is a conceptual data model that.
Data Modeling Yong Choi School of Business CSUB. Part # 2 2 Study Objectives Understand concepts of data modeling and its purpose Learn how relationships.
DatabaseIM ISU1 Fundamentals of Database Systems Chapter 3 Data Modeling Using Entity-Relationship Model.
Data Modeling Using the Entity-Relationship (ER) Data Model.
Data Modeling Using the Entity- Relationship (ER) Model.
The Entity-Relationship Model, P. I R. Nakatsu. Data Modeling A data model is the relatively simple representation, usually graphic, of the structure.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Department of Mathematics Computer and Information Science1 CS 351: Database Management Systems Christopher I. G. Lanclos Chapter 4.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Entity Relationship (E-R) Model
COP Introduction to Database Structures
TMC2034 Database Concept and Design
Entity Relationship (E-R) Modeling
Entity Relationship (E-R) Modeling
Tables and Their Characteristics
Chapter 4 Entity Relationship (ER) Modeling
Database Systems: Design, Implementation, and Management Tenth Edition
Review of Week 1 Database DBMS File systems vs. database systems
Chapter 4 Entity Relationship (ER) Modeling
Entity Relationship (ER) Modeling
Chapter # 4 Entity Relationship (ER) Modeling.
Presentation transcript:

1 A Demo of Logical Database Design

2 Aim of the demo To develop an understanding of the logical view of data and the importance of the relational model To consider entities, attributes, and tables within the relational view Learn basic and advanced ER modelling techniques

3 Entities Relational database design starts by defining the required entities Entities are anything you want to store data about –people (students, customers, employees, etc.) –places (resorts, cities, countries, etc.) –things (restaurants, products, invoices, movies, paintings, books, buildings, contracts, etc.) –events (elections, presentations, earthquakes, hurricanes, etc.)

4 Entity sets are collections of related entities. Entities are related by their classification: student entities are related by the fact that they are all students invoice entities are related by the fact that they are all invoices car entities are related by the fact that they are all cars Entity Sets / Entity Types

5 Unfortunately, database designers almost always use the two terms as synonyms. When database designers refer to entities, they really are referring to entity sets or entity types. Therefore, when you see a reference to an EMPLOYEE “entity” in a database design, remember that EMPLOYEE actually represents an entity set/type that contains a collection of employee entities and each instance of this type is one single entity. Entity Set (type) = Class Entity = Object Entity Sets/Types and Entities

6 Attributes Properties of entities or relationships This is the data stored about an entity  E.g. student entity could have attributes such as name, address, DOB etc.

7 Types of attributes Simple – each entity has a single atomic value for the attribute. Cannot be subdivided –Age, sex, marital status Composite (composed of several components): Can be subdivided into additional attributes –Address into street, city, zip –Name(FirstName, MiddleName, LastName) Single-valued: Can have only a single value –Person has one social security number Multi-valued: an entity may have multiple values for that attribute –Person may have several college degrees (qualifications, skills) –Color of a car Derived: Can be derived with algorithm –Age can be derived from date of birth

8 Conceptual design: (ER Model is used at this stage.) – What are the entities and relationships in the database? – What information about these entities and relationships should we store in the database? – What are the integrity constraints or business rules that hold? – A database `schema’ in the ER Model can be represented pictorially (ER diagrams). – Can map an ER diagram into a relational schema by hands or tools. Overview of Database Design

9 ER Diagram: Two Most Commonly Used Notations

10 ER Diagrams - The Basics

11 ER Diagram Basics - Cardinalities

12 Classification of Cardinalities Minimum cardinality - relationship participation –Mandatory: (existence dependent) Entity occurrence requires corresponding occurrence in the related entity. Offering cannot exist without being related to a course. –Optional: Entity occurrence does not require a corresponding occurrence in the related entity. A course does not necessarily need an offering to exist. Maximum cardinality based –1-M –M-N –1-1

13 Weak Entities – Identifying Relationship Identifying relationship –One entity is existence-dependent on another –PK of related entity contains PK component of parent entity

14 –A weak entity is an entity that Is existence-dependent i.e. weak entities cannot exist without the owner entity AND Has a primary key that is partially or totally derived from the parent entity in the relationship. They do not have the PK of their own –However not every existence dependency results in a weak entity type. Eg – Driver License cannot exist unless it is related to PERSON entity even though it has its own key (Licence number) and hence is not a weak entity. Weak Entities

15 M-N Relationships with Attributes Replace M-N relationship with Associative entity type Two identifying 1-M relationships

16 Associative Entity Type Example

17 – A recursive entity is one in which a relationship can exist between occurrences of the same entity set. – A recursive entity is found within a unary relationship. Recursive Entities

18 Entity Supertypes and Subtypes Generalization hierarchy – Depicts relationships between higher-level supertype and lower-level subtype entities – Supertype has shared attributes – Subtypes have unique attributes – A subtype entity inherits its attributes and its relationships from the supertype entity – The supertype and its subtype(s) maintain an is-a relationship

19 Generalization Hierarchies

20 Disjointness and Completeness of Subtypes Disjointness: D means intersection is empty Overlap: No symbol means intersection is not empty: Faculty and Student. Subtypes have common entities Completeness: C means union of subtype entities is the set of supertype entities Nothing: supertype can have free standing entities ((not in any subtype). Union does not provide supertype

21 Entity Vs Attribute Should address be an attribute of Employees or an entity (connected to Employees by a relationship)? Depends upon the use we want to make of address information, and the semantics of the data: If we have several addresses per employee, address must be an entity (since attributes cannot be set-valued). If the structure (city, street, etc.) is important, e.g., we want to retrieve employees in a given city, address must be modelled as an entity (since attribute values are atomic).

22 Summary A data model is the relatively simple representation, usually graphic, of complex real-world data structures. It represents data structures and their characteristics, relations, constraints, and transformations. Different type attributes have different implications in a database. Some of these need to be considered carefully.

23 Comprehensive Example