SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
Entity Relationship Modeling
Objectives:

• To illustrate how relationships between entities are
  defined and refined.

• To know how relationships are incorporated into the
  database design process.

• To describe how ERD components affect database
  design and implementation.
Entity-Relationship (ER) Modeling.

 ER Modeling is a top-down approach to database
  design.
 Entity Relationship (ER) Diagram
   A detailed, logical representation of the
    entities, associations and data elements for an
    organization or business
 Notation uses three main constructs
   Data entities
   Relationships
   Attributes
Notation
   Entity       Attribute   Relationship


               EntityName
EntityName                  Verb phrase

              List of
              Attributes




Acceptable
Entities
 Examples of entities:
   Person: LECTURER, STUDENT
   Place: CLASS ROOM, WAREHOUSE
   Object: MACHINE, PRODUCT, CAR
   Event: REGISTRATION, LECTURE
   Concept: COURSE, LECTURE

 Guidelines for naming and defining entity types:
   An entity type name is a singular noun
   An entity type should be descriptive and specific
   An entity name should be concise
   Event entity types should be named for the result of the event, not the
    activity or process of the event.
Attributes
 Example of entity types and associated attributes:
   STUDENT: Student_ID, Student_Name, Home_Address,
     Phone_Number, B_Date


 Guidelines for naming attributes:
    An attribute name is a noun.
    An attribute name should be unique
    To make an attribute name unique and clear, each attribute name
     should follow a standard format
    Similar attributes of different entity types should use similar but
     distinguishing names.
Relationship
 Associations between instances of one or more entity types that is of interest
 Given a name that describes its function.
    • relationship name is an active or a passive verb.




                                     Relationship name:
                                           Lecture

                   Lecturer                                       Subject


                       An Lecturer gives lecture on one or more Subjects
                        A Subject can be taught by one or more lecturer.
Relationship
 The degree of a relationship = the number of entity
 sets that participate in the relationship
   Mostly binary relationships
   Sometimes more
 Mapping cardinality of a relationship
   1 –1
   1 – many
   many – 1
   Many-many
One-One and One-Many
Many-one and many-many
Notations
Notations
Example
Tables
                                     Student
                             PK     N_ID
                                    F_Name                   Subject
                                    L_Name
                                                         Subject_Dscription
      Enrollment                    Address
     Stud_ID       FK               B_Date               Subject_Unit

CK                                                  PK   Subject_Code
     Course_Name   FK

     CC#           FK

     Enroll_Date
                                                             Lecturer
                                    Lecture
                                                         L_Address
                        PK   CC#
                                                         L_FirstName
                             Subject           FK
                                                         L_LastName
                             Time
                             Date                        L_Email

                             Lecturer_ID       FK   PK   Lecturer_ID

Contenu connexe

En vedette

Data structure unitfirst part1
Data structure unitfirst part1Data structure unitfirst part1
Data structure unitfirst part1Amar Rawat
 
datamodel_vector
datamodel_vectordatamodel_vector
datamodel_vectorRiya Gupta
 
Knowledgebase vs Database
Knowledgebase vs DatabaseKnowledgebase vs Database
Knowledgebase vs DatabaseCJ Jenkins
 
Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)manojg1990
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Mudasir Qazi
 
Tour and travel management system
Tour and travel management systemTour and travel management system
Tour and travel management systemRavindra Chaudhary
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and AlgorithmDhaval Kaneria
 
Data Structure: TREES
Data Structure: TREESData Structure: TREES
Data Structure: TREESTABISH HAMID
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 

En vedette (19)

Lp ppt tsl
Lp ppt tslLp ppt tsl
Lp ppt tsl
 
Data structure unitfirst part1
Data structure unitfirst part1Data structure unitfirst part1
Data structure unitfirst part1
 
Normalisation and anomalies
Normalisation and anomaliesNormalisation and anomalies
Normalisation and anomalies
 
Data mining 1
Data mining 1Data mining 1
Data mining 1
 
datamodel_vector
datamodel_vectordatamodel_vector
datamodel_vector
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
Knowledgebase vs Database
Knowledgebase vs DatabaseKnowledgebase vs Database
Knowledgebase vs Database
 
Data structures
Data structuresData structures
Data structures
 
Dbms mca-section a
Dbms mca-section aDbms mca-section a
Dbms mca-section a
 
Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)
 
Files Vs DataBase
Files Vs DataBaseFiles Vs DataBase
Files Vs DataBase
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
Tour and travel management system
Tour and travel management systemTour and travel management system
Tour and travel management system
 
Dbms models
Dbms modelsDbms models
Dbms models
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Different data models
Different data modelsDifferent data models
Different data models
 
Data Structure: TREES
Data Structure: TREESData Structure: TREES
Data Structure: TREES
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 

Entity relationship modeling

  • 1. Entity Relationship Modeling Objectives: • To illustrate how relationships between entities are defined and refined. • To know how relationships are incorporated into the database design process. • To describe how ERD components affect database design and implementation.
  • 2. Entity-Relationship (ER) Modeling.  ER Modeling is a top-down approach to database design.  Entity Relationship (ER) Diagram  A detailed, logical representation of the entities, associations and data elements for an organization or business  Notation uses three main constructs  Data entities  Relationships  Attributes
  • 3. Notation Entity Attribute Relationship EntityName EntityName Verb phrase List of Attributes Acceptable
  • 4. Entities  Examples of entities:  Person: LECTURER, STUDENT  Place: CLASS ROOM, WAREHOUSE  Object: MACHINE, PRODUCT, CAR  Event: REGISTRATION, LECTURE  Concept: COURSE, LECTURE  Guidelines for naming and defining entity types:  An entity type name is a singular noun  An entity type should be descriptive and specific  An entity name should be concise  Event entity types should be named for the result of the event, not the activity or process of the event.
  • 5. Attributes  Example of entity types and associated attributes: STUDENT: Student_ID, Student_Name, Home_Address, Phone_Number, B_Date  Guidelines for naming attributes:  An attribute name is a noun.  An attribute name should be unique  To make an attribute name unique and clear, each attribute name should follow a standard format  Similar attributes of different entity types should use similar but distinguishing names.
  • 6. Relationship  Associations between instances of one or more entity types that is of interest  Given a name that describes its function. • relationship name is an active or a passive verb. Relationship name: Lecture Lecturer Subject An Lecturer gives lecture on one or more Subjects A Subject can be taught by one or more lecturer.
  • 7. Relationship  The degree of a relationship = the number of entity sets that participate in the relationship  Mostly binary relationships  Sometimes more  Mapping cardinality of a relationship  1 –1  1 – many  many – 1  Many-many
  • 13. Tables Student PK N_ID F_Name Subject L_Name Subject_Dscription Enrollment Address Stud_ID FK B_Date Subject_Unit CK PK Subject_Code Course_Name FK CC# FK Enroll_Date Lecturer Lecture L_Address PK CC# L_FirstName Subject FK L_LastName Time Date L_Email Lecturer_ID FK PK Lecturer_ID