SlideShare ist ein Scribd-Unternehmen logo
1 von 51
Downloaden Sie, um offline zu lesen
2. Entity Relationship(ER) Model DATABASE MANAGEMENT SYSTEMS
THE RELATİON MODEL ,[object Object],[object Object],[object Object],[object Object]
BASİC CONCEPT ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],BASİC CONCEPT
AN ENTİTY SET İS A SET OF ENTİTİES OF THE SAME TYPE ,[object Object],Employee Entity Type : e 1 e 2 e 3 Entity set: … The actual employees A general specification
ATTRİBUTES ,[object Object],[object Object],[object Object],[object Object]
TYPES OF ATTRİBUTES ,[object Object],Employee EmpNo Name Address
CONPOSİTE ATTRİBUTE:CONSİST OF SEVERAL COMPONENTS Country Employee Address Street City EmpNo Name
MULTİVALUE ATTRİBUTE :CONTAİNS   MORE THAN ONE VALUE Employee Phone Email
DERİVED ATTRİBUTE:COMPUTED FROM  OTHER ATTRİBUTES Employee Age Bonus
KEY ATTRİBUTES ,[object Object],ERD tabular Employee EmpNo Name EmpNo Name . . . 123456 John Wong . . . 456789 . . . 146777 . . . John Wong Mary Cheung
KEY ATTRİBUTES ,[object Object],Employee Name Address
KEY ATTRİBUTES ,[object Object],[object Object],[object Object],In many cases, a key is artificially introduced (e.g., EmpNo) to make applications more efficient. Employee EmpNo Name Address
RELATİONSHİP ,[object Object],[object Object],[object Object]
[object Object],[object Object],Question: Could Amount be an attribute of Customer? Or an attribute of Account? What does Amount mean? How many values you want to keep? Customer depositor Account Amount CusNo Name AccNo Name
REPRESENTATİON OF RELATİONSHİP ,[object Object],Depositor Note: this is NOT an ERD The amount in  each  deposit. CustomerNo A123456 B456789 B456789 AccountNo A-101 A-201 A-302 Amount 500 900 700 A123456 B456789 A-101 A-201 A-202 500 900 700 ,[object Object]
TRY AN ALTERNATİVE  ,[object Object],AccountNo A-101 A-201 A-302 Name Current Saving Current Amount 500 900 700 ,[object Object],[object Object]
CARDİNALİTY OF RELATİONSHİPS ,[object Object],[object Object],Customer Loan Borrows ,[object Object]
1 :  N  Customer Loan One entity of type  X  can be associated with many entities of type  Y . One entity of type  Y  can be associated with, at most, one entity of type  X .  Customer Borrow Loan ,[object Object],[object Object]
N  :  M One entity of type  X  can be associated with many entities of type  Y . One entity of type  Y  can be associated with many entities of type  X . Customer Borrow loan ,[object Object],[object Object]
NOTES ,[object Object],[object Object],[object Object],[object Object],[object Object]
DEGREES OF A RELATİONSHİPS SET  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Customer Loan Borrow - Binary Customer Loan Borrow Branch - Ternary
RECURSİVE RELATİONSHİPS ,[object Object],[object Object],[object Object],[object Object],manager worker Employee work-for Employee manager worker Employee work-for
TABULAR REPRESENTATİON OF RECURSİVE   RELATİONSHİPS ,[object Object],[object Object],[object Object],ManagerNo WorkerNo A1234 A6543 A1234 A8734 EmployeeNo EmployeeNo A1234 A8734 A1234 A6543
OPTİONAL VERSUS MANDATORY ,[object Object],[object Object],[object Object],[object Object],[object Object]
OPTİONAL VERSUS MANDATORY Neither one is preferable to the other. The proper one to choose depends on the business situation. Mandatory sub-typing is represented by creating a double line from the super-type ( person  in the following ER diagram) to the circle.  Optional sub-typing is represented by leaving a single line from the super-type to the circle.
AGGREGATİON OF ENTİTY TYPES ,[object Object]
AGGREGATİON OF ENTİTY TYPES Consider the relationship between a car and its engine and body. The engine and body are both part of the car. The relationship is represented as follows in an ER diagram.
PARALLEL RELATİONSHİPS ,[object Object]
PARALLEL RELATİONSHİPS A person pays for zero or more insurance policies. An insurance policy is paid for by exactly one person.  A person is insured by zero or more insurance policies. An insurance policy insures one or more persons.
EXİSTENCE DEPENDENCE ,[object Object],Customer Loan loan borrow CusNo LoanNo A loan cannot exist if there is no borrower.
WEAK ENTİTİES ,[object Object],[object Object]
LoanNo Amount Date_pay PaymentNo Payment ,[object Object],[object Object],[object Object],[object Object],Loan payment Question: Why not combine  loan  and  payment  into one entity type? Amount Loan
WEAK ENTİTY VS EXİSTENCE CONSTRAİNTS ,[object Object],[object Object]
ANOTHER EXAMPLE OF WEAK ENTİTY   TYPE ,[object Object],[object Object],EmpNo Name Dependent Emp_Dep Age Employee
TERNARY RELATİONSHİPS Customer Loan Borrow Branch A customer borrows a loan from a branch. Customer Loan Borrow Branch Issue A customer borrows a loan. A loan is issued from a branch.
WHAT ARE THE DİFFERENCES? A customer borrows a loan from a branch. A customer borrows a loan. A loan is issued from a branch.
[object Object],[object Object],[object Object],Customer Loan Borrow Branch Issue Cus_Br
WHY? ,[object Object],[object Object],[object Object],A12345 B56789 A12345 A12345 L-001
BİNARY RELATİONSHİPS TO TERNARY? ,[object Object],[object Object],Customer Loan Borrow Branch Issue Buy_stock
A CASE STUDY A primary school student writes a composition about a picnic:   Today is Sep 9, the weather is fine.  My classmates, John, Mary and I go to a picnic in Sai Kung.  Our teacher is Ms Wong Initial Design: Picnic weather destination date Students Name Teacher Name
QUESTİONS ? ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],My solution Question: How to record number of students in a picnic? Student StudentNo Name weather date destination Picnic goes leading Teacher Name
E-R DESİGN DECİSİONS ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
E-R DİAGRAM FOR COMPANY DATABASE EMPLOYEE WORKS_FOR MANAGES CONTROLS Startdate DEPARTMENT WORKS_ON PROJECT Hours DEPENDENTS_OF DEPENDENT SUPERVISION supervisee supervisor Fname Minit Lname Name Sex Address Salary Ssn Bdate Number Of Employees Locations Can you translate it back into English? Name Number Name Number Location Relationship Birthdate Sex Name
LİMİTATİONS OF ER MODEL ,[object Object],[object Object],[object Object],[object Object]
REDUCTİON OF AN E-R SCHEMA TO TABLES ,[object Object],[object Object],[object Object]
REPRESENTİNG ENTİTY SETS AS TABLES ,[object Object],[object Object],Composite key payment loan-no   payment-date payment-no payment-amount L-17 L-15 L-23 5 22 11 10 May 1999 23 May 1999 17 May 1999 50 300 75 customer customer-name   customer-street customer-id Jones Hayes Smith 321-12-3123  677-89-9011  019-28-3746  Main Main North customer-city Harrison Rye Harrison
REPRESENTİNG RELATİONSHİP SETS AS TABLES depositor ,[object Object],customer borrow loan loan-no cust-no share% date cust-name
[object Object],[object Object],customer cust-no   cust-name A12345 B56789 Peter Wong Mary Cheung loan loan-no   L-001 L-002 date Sep 2000 Aug 2001 customer borrow loan cust-no cust-name date loan-no cust-no A12345 B56789 indicates who borrowed the loan
WEAK ENTİTİES ,[object Object],Already indicates the 1:N relationship between loan-no and payment-no payment loan-no   payment-date payment-no payment-amount L-17 L-17 L-17 5 7 6 10 May 1999 23 May 1999 17 May 1999 50 300 75

Weitere ähnliche Inhalte

Ähnlich wie Chapter2

Pertemuan-4------------------------------------------------
Pertemuan-4------------------------------------------------Pertemuan-4------------------------------------------------
Pertemuan-4------------------------------------------------keishaangelina2
 
Chapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxChapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxsantosh96234
 
Er Model Nandha&Mani
Er Model Nandha&ManiEr Model Nandha&Mani
Er Model Nandha&Maniguest1e0229a
 
Jobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptxJobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptxprosofts1
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...Mustafa Kamel Mohammadi
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mcaEdhole.com
 
Basic concepts of Data and Databases
Basic concepts of Data and Databases Basic concepts of Data and Databases
Basic concepts of Data and Databases Tharindu Weerasinghe
 
ERD with complete knowledge
ERD with complete knowledgeERD with complete knowledge
ERD with complete knowledgeAsma Rasool
 
Data modeling using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship modelJafar Nesargi
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER ModelAjay Chhimpa
 
ER Model and other topics in DBMS
ER Model and other topics in DBMSER Model and other topics in DBMS
ER Model and other topics in DBMSHarinarayananR2
 
ECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxmiftah88
 
Conceptual Modeling of Data
Conceptual Modeling of DataConceptual Modeling of Data
Conceptual Modeling of DataM.Zalmai Rahmani
 

Ähnlich wie Chapter2 (20)

Pertemuan-4------------------------------------------------
Pertemuan-4------------------------------------------------Pertemuan-4------------------------------------------------
Pertemuan-4------------------------------------------------
 
Chapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxChapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptx
 
E R Model details.ppt
E R Model details.pptE R Model details.ppt
E R Model details.ppt
 
Er Model Nandha&Mani
Er Model Nandha&ManiEr Model Nandha&Mani
Er Model Nandha&Mani
 
Jobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptxJobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptx
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
 
Data & Databases
Data & Databases Data & Databases
Data & Databases
 
Unit 3 final.pptx
Unit 3 final.pptxUnit 3 final.pptx
Unit 3 final.pptx
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mca
 
Basic concepts of Data and Databases
Basic concepts of Data and Databases Basic concepts of Data and Databases
Basic concepts of Data and Databases
 
ERD with complete knowledge
ERD with complete knowledgeERD with complete knowledge
ERD with complete knowledge
 
Data modeling using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship model
 
Chapter3
Chapter3Chapter3
Chapter3
 
Chapter3
Chapter3Chapter3
Chapter3
 
Desigining of Database - ER Model
Desigining of Database - ER ModelDesigining of Database - ER Model
Desigining of Database - ER Model
 
02er
02er02er
02er
 
ER Model and other topics in DBMS
ER Model and other topics in DBMSER Model and other topics in DBMS
ER Model and other topics in DBMS
 
ECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptx
 
Conceptual Modeling of Data
Conceptual Modeling of DataConceptual Modeling of Data
Conceptual Modeling of Data
 

Kürzlich hochgeladen

Cyber Security Training in Office Environment
Cyber Security Training in Office EnvironmentCyber Security Training in Office Environment
Cyber Security Training in Office Environmentelijahj01012
 
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdfGUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdfDanny Diep To
 
NAB Show Exhibitor List 2024 - Exhibitors Data
NAB Show Exhibitor List 2024 - Exhibitors DataNAB Show Exhibitor List 2024 - Exhibitors Data
NAB Show Exhibitor List 2024 - Exhibitors DataExhibitors Data
 
Introducing the Analogic framework for business planning applications
Introducing the Analogic framework for business planning applicationsIntroducing the Analogic framework for business planning applications
Introducing the Analogic framework for business planning applicationsKnowledgeSeed
 
Darshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfDarshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfShashank Mehta
 
WSMM Media and Entertainment Feb_March_Final.pdf
WSMM Media and Entertainment Feb_March_Final.pdfWSMM Media and Entertainment Feb_March_Final.pdf
WSMM Media and Entertainment Feb_March_Final.pdfJamesConcepcion7
 
1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdf1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdfShaun Heinrichs
 
business environment micro environment macro environment.pptx
business environment micro environment macro environment.pptxbusiness environment micro environment macro environment.pptx
business environment micro environment macro environment.pptxShruti Mittal
 
14680-51-4.pdf Good quality CAS Good quality CAS
14680-51-4.pdf  Good  quality CAS Good  quality CAS14680-51-4.pdf  Good  quality CAS Good  quality CAS
14680-51-4.pdf Good quality CAS Good quality CAScathy664059
 
Planetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in LifePlanetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in LifeBhavana Pujan Kendra
 
How Generative AI Is Transforming Your Business | Byond Growth Insights | Apr...
How Generative AI Is Transforming Your Business | Byond Growth Insights | Apr...How Generative AI Is Transforming Your Business | Byond Growth Insights | Apr...
How Generative AI Is Transforming Your Business | Byond Growth Insights | Apr...Hector Del Castillo, CPM, CPMM
 
Unveiling the Soundscape Music for Psychedelic Experiences
Unveiling the Soundscape Music for Psychedelic ExperiencesUnveiling the Soundscape Music for Psychedelic Experiences
Unveiling the Soundscape Music for Psychedelic ExperiencesDoe Paoro
 
Environmental Impact Of Rotary Screw Compressors
Environmental Impact Of Rotary Screw CompressorsEnvironmental Impact Of Rotary Screw Compressors
Environmental Impact Of Rotary Screw Compressorselgieurope
 
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptxThe-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptxmbikashkanyari
 
How To Simplify Your Scheduling with AI Calendarfly The Hassle-Free Online Bo...
How To Simplify Your Scheduling with AI Calendarfly The Hassle-Free Online Bo...How To Simplify Your Scheduling with AI Calendarfly The Hassle-Free Online Bo...
How To Simplify Your Scheduling with AI Calendarfly The Hassle-Free Online Bo...SOFTTECHHUB
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationAnamaria Contreras
 
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdftrending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdfMintel Group
 
Interoperability and ecosystems: Assembling the industrial metaverse
Interoperability and ecosystems:  Assembling the industrial metaverseInteroperability and ecosystems:  Assembling the industrial metaverse
Interoperability and ecosystems: Assembling the industrial metaverseSiemens
 
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...Operational Excellence Consulting
 
Intermediate Accounting, Volume 2, 13th Canadian Edition by Donald E. Kieso t...
Intermediate Accounting, Volume 2, 13th Canadian Edition by Donald E. Kieso t...Intermediate Accounting, Volume 2, 13th Canadian Edition by Donald E. Kieso t...
Intermediate Accounting, Volume 2, 13th Canadian Edition by Donald E. Kieso t...ssuserf63bd7
 

Kürzlich hochgeladen (20)

Cyber Security Training in Office Environment
Cyber Security Training in Office EnvironmentCyber Security Training in Office Environment
Cyber Security Training in Office Environment
 
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdfGUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
GUIDELINES ON USEFUL FORMS IN FREIGHT FORWARDING (F) Danny Diep Toh MBA.pdf
 
NAB Show Exhibitor List 2024 - Exhibitors Data
NAB Show Exhibitor List 2024 - Exhibitors DataNAB Show Exhibitor List 2024 - Exhibitors Data
NAB Show Exhibitor List 2024 - Exhibitors Data
 
Introducing the Analogic framework for business planning applications
Introducing the Analogic framework for business planning applicationsIntroducing the Analogic framework for business planning applications
Introducing the Analogic framework for business planning applications
 
Darshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdfDarshan Hiranandani [News About Next CEO].pdf
Darshan Hiranandani [News About Next CEO].pdf
 
WSMM Media and Entertainment Feb_March_Final.pdf
WSMM Media and Entertainment Feb_March_Final.pdfWSMM Media and Entertainment Feb_March_Final.pdf
WSMM Media and Entertainment Feb_March_Final.pdf
 
1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdf1911 Gold Corporate Presentation Apr 2024.pdf
1911 Gold Corporate Presentation Apr 2024.pdf
 
business environment micro environment macro environment.pptx
business environment micro environment macro environment.pptxbusiness environment micro environment macro environment.pptx
business environment micro environment macro environment.pptx
 
14680-51-4.pdf Good quality CAS Good quality CAS
14680-51-4.pdf  Good  quality CAS Good  quality CAS14680-51-4.pdf  Good  quality CAS Good  quality CAS
14680-51-4.pdf Good quality CAS Good quality CAS
 
Planetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in LifePlanetary and Vedic Yagyas Bring Positive Impacts in Life
Planetary and Vedic Yagyas Bring Positive Impacts in Life
 
How Generative AI Is Transforming Your Business | Byond Growth Insights | Apr...
How Generative AI Is Transforming Your Business | Byond Growth Insights | Apr...How Generative AI Is Transforming Your Business | Byond Growth Insights | Apr...
How Generative AI Is Transforming Your Business | Byond Growth Insights | Apr...
 
Unveiling the Soundscape Music for Psychedelic Experiences
Unveiling the Soundscape Music for Psychedelic ExperiencesUnveiling the Soundscape Music for Psychedelic Experiences
Unveiling the Soundscape Music for Psychedelic Experiences
 
Environmental Impact Of Rotary Screw Compressors
Environmental Impact Of Rotary Screw CompressorsEnvironmental Impact Of Rotary Screw Compressors
Environmental Impact Of Rotary Screw Compressors
 
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptxThe-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
The-Ethical-issues-ghhhhhhhhjof-Byjus.pptx
 
How To Simplify Your Scheduling with AI Calendarfly The Hassle-Free Online Bo...
How To Simplify Your Scheduling with AI Calendarfly The Hassle-Free Online Bo...How To Simplify Your Scheduling with AI Calendarfly The Hassle-Free Online Bo...
How To Simplify Your Scheduling with AI Calendarfly The Hassle-Free Online Bo...
 
PSCC - Capability Statement Presentation
PSCC - Capability Statement PresentationPSCC - Capability Statement Presentation
PSCC - Capability Statement Presentation
 
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdftrending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
trending-flavors-and-ingredients-in-salty-snacks-us-2024_Redacted-V2.pdf
 
Interoperability and ecosystems: Assembling the industrial metaverse
Interoperability and ecosystems:  Assembling the industrial metaverseInteroperability and ecosystems:  Assembling the industrial metaverse
Interoperability and ecosystems: Assembling the industrial metaverse
 
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
The McKinsey 7S Framework: A Holistic Approach to Harmonizing All Parts of th...
 
Intermediate Accounting, Volume 2, 13th Canadian Edition by Donald E. Kieso t...
Intermediate Accounting, Volume 2, 13th Canadian Edition by Donald E. Kieso t...Intermediate Accounting, Volume 2, 13th Canadian Edition by Donald E. Kieso t...
Intermediate Accounting, Volume 2, 13th Canadian Edition by Donald E. Kieso t...
 

Chapter2

  • 1. 2. Entity Relationship(ER) Model DATABASE MANAGEMENT SYSTEMS
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. CONPOSİTE ATTRİBUTE:CONSİST OF SEVERAL COMPONENTS Country Employee Address Street City EmpNo Name
  • 9. MULTİVALUE ATTRİBUTE :CONTAİNS MORE THAN ONE VALUE Employee Phone Email
  • 10. DERİVED ATTRİBUTE:COMPUTED FROM OTHER ATTRİBUTES Employee Age Bonus
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. OPTİONAL VERSUS MANDATORY Neither one is preferable to the other. The proper one to choose depends on the business situation. Mandatory sub-typing is represented by creating a double line from the super-type ( person in the following ER diagram) to the circle. Optional sub-typing is represented by leaving a single line from the super-type to the circle.
  • 27.
  • 28. AGGREGATİON OF ENTİTY TYPES Consider the relationship between a car and its engine and body. The engine and body are both part of the car. The relationship is represented as follows in an ER diagram.
  • 29.
  • 30. PARALLEL RELATİONSHİPS A person pays for zero or more insurance policies. An insurance policy is paid for by exactly one person. A person is insured by zero or more insurance policies. An insurance policy insures one or more persons.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36. TERNARY RELATİONSHİPS Customer Loan Borrow Branch A customer borrows a loan from a branch. Customer Loan Borrow Branch Issue A customer borrows a loan. A loan is issued from a branch.
  • 37. WHAT ARE THE DİFFERENCES? A customer borrows a loan from a branch. A customer borrows a loan. A loan is issued from a branch.
  • 38.
  • 39.
  • 40.
  • 41. A CASE STUDY A primary school student writes a composition about a picnic: Today is Sep 9, the weather is fine. My classmates, John, Mary and I go to a picnic in Sai Kung. Our teacher is Ms Wong Initial Design: Picnic weather destination date Students Name Teacher Name
  • 42.
  • 43.
  • 44.
  • 45. E-R DİAGRAM FOR COMPANY DATABASE EMPLOYEE WORKS_FOR MANAGES CONTROLS Startdate DEPARTMENT WORKS_ON PROJECT Hours DEPENDENTS_OF DEPENDENT SUPERVISION supervisee supervisor Fname Minit Lname Name Sex Address Salary Ssn Bdate Number Of Employees Locations Can you translate it back into English? Name Number Name Number Location Relationship Birthdate Sex Name
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.