MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003, 2004.

Slides:



Advertisements
Similar presentations
Chapter 6: Entity-Relationship Model (part I)
Advertisements

Database Design The process of finding user requirement
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
Text-Book Chapters (7 and 8) Entity-Relationship Model
Data Modeling using the Entity-Relationship (ER) Model
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
1–1 The E-R Model Prof. Sin-Min Lee Department of Computer Science.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Slides adapted from A. Silberschatz et al. Database System Concepts, 5th Ed. Entity-Relationship Model Database Management Systems I Alex Coman, Winter.
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)
Entity Relationship Model Chapter 6. Basic Elements of E-R Model Entity Object of the real world that stores data. Eg. Customer, State, Project, Supplier,
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Modeling Using the Entity-Relationship Model
Entity-Relationship Modeling I The cautious seldom err. Confucius.
Data Modeling Using the Entity-Relationship Model
1 © Prentice Hall, 2002 CMIS564: E/R Modeling Dr. Bordoloi Based on Chapter 3; Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott,
Data Modeling Using the Entity-Relationship Model
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
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.
Chapter 3 Data Modeling Using the Entity-Relationship (ER) Model.
the Entity-Relationship Model
Dr. Mohamed Osman Hegaz1 Conceptual data base design: The conceptual models: The Entity Relationship Model.
Entities and Attributes
1 Data Modeling : ER Model Lecture Why We Model  We build models of complex systems because we cannot comprehend any such system in its entirety.
Module Title? Data Base Design 30/6/2007 Entity Relationship Diagrams (ERDs)
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Database Systems Lecture # 7 8 th Feb, Conceptual and Logical Design Person buys Product name pricenamessn Conceptual Model: Relational Model: (plus.
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2008.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj RM/SQL Lecture 1 ©Akhilesh Bajaj, 2000, 2002, 2003, All.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Plug-In T5: Designing Database Applications Business Driven Technology.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Chapter 7 Database Design and The E–R Model. 2 Goals n Facilitate DB design and represent the overall logical structure of the DB. n Definition Entities.
MIS 7003 MIS Core Course The MBA Program The University of Tulsa Professor: Akhilesh Bajaj Introduction to Database Design All Slides in this presentation.
Entity-Relationship Model Using High-Level Conceptual Data Models for Database Design Entity Types, Sets, Attributes and Keys Relationship Types, Sets,
Entity – Relationship Model (E-R Model)
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 7 Data Modeling with Entity Relationship Diagrams
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Data modeling using the entity-relationship model Chapter 3 Objectives How entities, tuples, attributes and relationships among entities are represented.
Database Management Systems MIT Lesson 02 – Database Design (Entity Relationship Diagram) By S. Sabraz Nawaz.
ITTelkom Entity Relationship Diagram (1) CS2343 Perancangan Basisdata Relasional.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Databases Illuminated Chapter 3 The Entity Relationship Model.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
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 Using the Entity-Relationship (ER) Data Model.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 2 © Akhilesh Bajaj, 2000, 2002, 2003, 2004,
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 3: Modeling Data in the Organization. Business Rules Statements that define or constrain some aspect of the business Assert business structure.
Data Modeling and the Entity-Relationship Model CS 475 Lecture Notes.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Mapping Constraints Keys.
Chapter 2: Entity-Relationship Model. 3.2 Chapter 2: Entity-Relationship Model Design Process Modeling Constraints E-R Diagram Design Issues Weak Entity.
©Silberschatz, Korth and Sudarshan7.1Database System Concepts - 6 th Edition Chapter 7: Entity-Relationship Model.
Database Designsemester Slide 1 Database Design Lecture 7 Entity-relationship modeling Text , 7.1.
Data Modeling Using the Entity- Relationship (ER) Model
COP Introduction to Database Structures
Entity-Relationship Model
Entity-Relationship Model
Entity Relationship Model
Entity-Relationship Model
Chapter -3- Data Modeling Using the Entity-Relationship Model
Chapter 7 Entity-Relationship Model
Outline of the ER Model By S.Saha
Entity Relationship Diagrams
Chapter 7: Entity-Relationship Model
Entity Relation Model Tingting Zhang.
Presentation transcript:

MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj ER Model Lecture 1 © Akhilesh Bajaj, 2000, 2002, 2003, All Rights Reserved.

What is a Data Model? It is a collection of conceptual tools for describing data, data relationships, data semantics and consistency constraints. Essentially answers the following questions: - What is data? - How are the data related to each other? - How can we query the data and change it? - How do we ensure that the data represents a correct view of the real world (data integrity)? Examples of data models include the relational model, the ER model, the network model and the hierarchical model. The network and hierarchical models are found on older mainframe systems (usually in large organizations).

Where Does the ER Model fit in? In the 1960’s and early 1970’s, the network & hierarchical models were used. In the relational model was proposed as an alternative data model. In 1976, the ER model was proposed, as another data model. Today, most database management systems (DBMS) use the relational model. The ER model is very useful in getting requirements from end-users. Many consulting firms are starting to use it. A “standard” database development methodology, is to capture user requirements in the ER model, and then map the ER diagram to the relational model.

Entities & Entity Sets An entity is a “thing” or “object” in the real world that is distinguishable from other objects. An entity set (or entity class) is a set of things or objects that are described by the same properties. E.g., Joe Dahmer is a person. “Persons” is an entity class described by, say, name, address, height, weight, fingerprint, age and gender. Hence, Joe Dahmer, who is an element of the entity set “persons” is described by these properties. In the example above, Joe Dahmer is the entity and “persons” is the entity class or entity set. Consider 2 entity sets, “employees” and “persons”. “Employees” may be described by additional properties, such as salary and grade. Joe Dahmer could be a member of both sets.

Attributes An attribute is a descriptive property possessed by each element (or entity) in an entity set. E.g., the entity set “persons” in the previous slide has seven attributes. Each attribute is associated with a domain. E.g., name is associated with the character string domain. fingerprint is associated with the JPEG domain. The domain is the set of permitted values of the attribute. The domain is similar to type in programming languages, and the attribute is similar to a variable of that type.

Types of Attributes Simple & Composite Attributes Simple attributes cannot be divided into subparts, while composite attributes can be divided into sub-parts. E.g., name may be divisible into first-name, middle-name and last-name. Address may consist of street and city. Street may be further decomposed into street_info and apartment_info. City may be further decomposed into city_name, state_name and zip_code. Single-Valued and Multivalued Attributes Some attributes, such as height, are single valued, i.e., they have only one value at a time. Other attributes, such as dependent_name, may be multivalued, i.e., they can have multiple values at the same time (in this case, if there is > 1 dependent for a person).

Types of Attributes Null Attributes A null attribute is one that can have a null value. Null can mean one of two things, we don’t know which. E.g., a dependent value being null could mean that there are no dependents, OR that there are dependents but we don’t have information on them. Derived Attribute A derived attribute is one whose value can be mathematically derived from existing data. E.g., If an employee has a start_date and an end_date, then the tenure attribute is a derived attribute.

Relationships and Relationship Sets A relationship is an association among two or more entities. E.g., Akhilesh (entity) teaches (relationship) MIS3053_fall_2010_sectionA (entity). A relationship set is a set of relationships of the same type. E.g., Professors (entity set) teach (relationship set) course_sections (entity set). Relationship sets relate entity sets in meaningful, real world relationships. Each entity set involved in a relationship set plays a role in that relationship set. E.g., Professors play the role of teachers in the teach relationship set. Course_sections play the role of taught by in the teach relationship set.

Attributes of Relationship Sets An attribute of a relationship set is very similar to an attribute of an entity set. Attributes of relationship sets are used when we are trying to capture additional information about the relationship set. E.g., the teach relationship set may have the attributes date_began, date_ended. These 2 relationship set attributes of the teach relationship set tell us the beginning and ending dates that the course_section was taught. Each relationship in the relationship set will have values for the relationship set attributes. So, the relationship Akhilesh teaches MIS3053_fall_2010_sectionA will have the values ‘August 23, 2010’ and ‘Dec 8, 2010’ for the date_began and date_ended attributes.

Fun In Class Example The University of Sherwood has students, professors and courses. Students have a student_id, last_name, middle_initial, first_name, date of birth, address, several s and several phone numbers. Professors have fac_id, name, highest)degree, subject area. Courses have course_id, title, description, number of credits. A course is taught many times, often by different professors. Students take courses and get grades. Sherwood offers many majors, and Professors advise students in their major. A Professor may be qualified to advise in more than one major, and a student may take more than one major. Each student needs an advisor for every major in which they are enrolled. Course are linked to majors, with each course being linked to on or more majors. A course may be required or optional for a major. Draw an ER sketch for these requirements.

Degree of Relationship Sets The degree of a relationship set is the number of entity sets that participate in the relationship set. E.g., the degree of the teach relationship set is 2. It is a binary relationship set. Consider a relationship set between students, degree majors and professors, called advise. Advise is a ternary relationship set. While we can theoretically have a relationship set that is n-ary, in reality, most relationship sets are binary, and occasionally, ternary.

Cardinalities of Relationship Sets Cardinalities express the number of entities to which another entity may be associated via a relationship set. For a binary relationship set (between, say, entity sets A and B): 1:1: Each entity in entity set B is associated with at least one entity in entity set A, and at most one entity in entity set A. The 1:1 shows up on the A side. 1:n: Each entity in B is associated with at least one entity in entity set A, and at most any number of entities (>0) in entity set A. The 1:n shows up on the A side. 0:n: at least 0 entities, at most n entities. m:n: at least any number (>0) and at most any number (>0). Here we would write an actual number for m, and maybe an actual number for n.

Cardinalities of Ternary Relationship Sets Cardinalities of ternary relationship sets are best illustrated by an example. Consider the (ternary) relationship set advise between Professors, students and degree majors. For each combination of Professor and Student (e.g., Akhilesh, Bill) how many minimum majors can there be? How many maximum majors? The minimum and maximum values are the cardinality numbers written on the degree majors side. Similarly, for each Student and degree major combination, how many minimum and maximum Professors are there? These are the cardinality numbers written on the Professors side.

Several software are available for drawing ER diagrams. Each one uses a slightly different convention. We shall use a convention that covers more than almost all conventions, and is as follows: Drawing ER diagrams Entity Set Attribute (underlined if a primary key) Link between entity set and attribute 0:1 0:n Relationship Set Cardinality Role MinimumMaximum

Example of binary teach relationship set, and ternary advise relationship set. Drawing ER diagrams

Is it a real-world object? Is it likely to be in relationships with other objects? Is it described by a set of properties? E.g., Should telephone be a telephone_number attribute or an entity set Telephones, described by telephone_ number (and maybe other attributes like phone_type)? Design Issues: Entity Sets or Attributes?

One strategy is to model actions (verbs) as relationships and nouns as entities. E.g., Professors teach Course_sections. Design Issues: Entity Sets or Relationship Sets? Noun Entity Set Verb relationship set Noun Entity Set Another strategy is to ask yourself: Is this a real-world object, or does it represent a relationship between 2 real-world objects? E.g., Loan in a bank could be an entity set or a relationship set between customers and branches.