SlideShare una empresa de Scribd logo
1 de 23
Logical database design
Converting ER diagrams to relational schema
2
Converting Strong entity types
• Each entity type becomes a table
• Each single-valued attribute becomes a column
• Derived attributes are ignored
• Composite attributes are represented by components
• Multi-valued attributes are represented by a separate table
• The key attribute of the entiry type becomes the primary key of the table
3
Entity example
• Here address is a composite
attribute
• Years of service is a derived attribute
(can be calculated from date of
joining and current date)
• Skill set is a multi-valued attribute
• The relational Schema
Employee (E#, Name, Door_No, Street, City, Pincode, Date_Of_Joining)
Emp_Skillset( E#, Skillset)
4
Entity Example (Contd…)
SkillSet
EmpCode FK
Skills
Employee Table
EmpCode PK
EmpName
DateofJoining
SkillSet
5
Converting weak entity types
• Weak entity types are converted
into a table of their own, with the
primary key of the strong entity
acting as a foreign key in the table
• This foreign key along with the key
of the weak entity form the
composite primary key of this table
• The Relational Schema
Employee (E# ,…….)
Dependant (Employee, Dependant_ID, Name, Address)
6
Converting weak entity types (Contd…)
Dependent
EmpCode PK /FK
Dependent_ID PK
Name
Address
Employee Table
EmpCode PK
EmpName
DateofJoining
SkillSet
7
Converting relationships
• The way relationships are represented depends on the cardinality and the degree
of the relationship
• The possible cardinalities are:
1:1, 1:M, N:M
• The degrees are:
Unary
Binary
Ternary …
8
Binary 1:1
• Case 1: Combination of participation types
The primary key of the partial participant will become the foreign key of the total
participant
Employee( E#, Name,…)
Department (Dept#, Name…,MgrE#)
departmentEmployee
Manages1 1
partial
Total
9
Binary 1 : 1
Department
DeptCode PK
DeptName
Location
MgrEmpCode FK
Employee Table
EmpCode PK
EmpName
DateofJoining
SkillSet
10
Binary 1:1
• Case 2: Uniform participation types
The primary key of either of the participants can become a foreign key in the other
Employee (E#,name…)
Chair( item#, model, location, used_by)
(or)
Employee ( E#, Name….Sits_on)
Chair (item#,….)
Employee CHAIRSits_on
11
Binary 1 : 1
Chair
ItemNo PK
Model
Location
Used_By FK
Employee Table
EmpCode PK
EmpName
DateofJoining
SkillSet
Chair
ItemNo PK
Model
Location
Employee Table
EmpCode PK
EmpName
DateofJoining
SkillSet
Sits_On FK
12
Binary 1:N
The primary key of the relation on the “1” side of the relationship becomes a
foreign key in the relation on the “N” side
Teacher (ID, Name, Telephone, ...)
Subject (Code, Name, ..., Teacher)
Teacher teaches Subject
1 N
13
Binary 1 : N
Subject
SubCode PK
SubName
Duration
TeacherID FK
Teacher
TeacherID PK
Name
Telephone
Cabin
14
Binary M:N
• A new table is created to represent the relationship
• Contains two foreign keys - one from each of the participants in the relationship
• The primary key of the new table is the combination of the two foreign keys
Student (Sid#,Title…) Course(C#,CName,…)
Enrolls (Sid#, C#)
Student
Enrolls
Course
M
N
15
Binary M : N
Course
CourseID PK
Coursename
Student
StudentID PK
StudentName
DOB
Address
Enrolls
StudentCode PK / FK
CourseID PK / FK
DOIssue
Status
16
Self referencing 1:1
Employee( E#, Name,... Spouse)
• Consider employees who are also a
couple
• The primary key field itself will become
foreign key in the same table
17
Self referencing 1 : 1
Employee Table
EmpCode PK
EmpName
DateofJoining
SkillSet
Spouse FK
18
Self referencing 1:N
Employee( E#, Name,…,Manager)
• The primary key field itself will
become foreign key in the
same table
• Same as unary 1:1
19
Self referencing 1 : N
Employee Table
EmpCode PK
EmpName
DateofJoining
SkillSet
Manager FK
20
Self referencing M:N
• There will be two resulting tables. One to represent the entity and another to
represent the M:N relationship as follows
Employee( E#, Name,…)
Guaranty( Guarantor, beneficiary)
Employee
Guarantor_of
M
N
21
Self referncing M : N
Guaranty
Guarantor PK/FK
Beneficiary PK /FK
Employee Table
EmpCode PK
EmpName
DateofJoining
SkillSet
22
Ternary relationship
• Represented by a new table
• The new table contains three foreign keys
- one from each of the participating
Entities
• The primary key of the new table is the
combination of all three foreign keys
• Prescription (Doctor#, Patient #,
Medicine_Name)
23
Ternary
Doctor
DocID PK
Title
Prescription
DocID PK / FK
PatCode PK / FK
MedName PK/ FK
NextVisit
Patient
PatCode PK
PatName
DOB
Address
Medicine
MedName PK
ExpDate

Más contenido relacionado

La actualidad más candente

Database Normalization
Database NormalizationDatabase Normalization
Database NormalizationArun Sharma
 
Normalization
NormalizationNormalization
Normalizationmomo2187
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mappingsaurabhshertukde
 
Hospital Management system Database design
Hospital Management system Database designHospital Management system Database design
Hospital Management system Database designElias Dinsa
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramShakila Mahjabin
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLEVraj Patel
 
Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12koolkampus
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra pptGirdharRatne
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional DependencyRaj Naik
 
Dbms 14: Relational Calculus
Dbms 14: Relational CalculusDbms 14: Relational Calculus
Dbms 14: Relational CalculusAmiya9439793168
 
Indexing and Hashing
Indexing and HashingIndexing and Hashing
Indexing and Hashingsathish sak
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagramssadique_ghitm
 
ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...Raj vardhan
 
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
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraintsNikhil Deswal
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMSkoolkampus
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Oum Saokosal
 

La actualidad más candente (20)

Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Normalization
NormalizationNormalization
Normalization
 
Er & eer to relational mapping
Er & eer to relational mappingEr & eer to relational mapping
Er & eer to relational mapping
 
Hospital Management system Database design
Hospital Management system Database designHospital Management system Database design
Hospital Management system Database design
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 
Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Decomposition using Functional Dependency
Decomposition using Functional DependencyDecomposition using Functional Dependency
Decomposition using Functional Dependency
 
Dbms 14: Relational Calculus
Dbms 14: Relational CalculusDbms 14: Relational Calculus
Dbms 14: Relational Calculus
 
Indexing and Hashing
Indexing and HashingIndexing and Hashing
Indexing and Hashing
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...
 
Relational model
Relational modelRelational model
Relational model
 
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
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
joins in database
 joins in database joins in database
joins in database
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraints
 
2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)Database Concept - Normalization (1NF, 2NF, 3NF)
Database Concept - Normalization (1NF, 2NF, 3NF)
 

Destacado

Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesJafar Nesargi
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 
Airline reservation system documentation
Airline reservation system documentationAirline reservation system documentation
Airline reservation system documentationSurya Indira
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Jargalsaikhan Alyeksandr
 

Destacado (6)

Crj 3 1-b
Crj 3 1-bCrj 3 1-b
Crj 3 1-b
 
Functional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databasesFunctional dependencies and normalization for relational databases
Functional dependencies and normalization for relational databases
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Airline reservation system documentation
Airline reservation system documentationAirline reservation system documentation
Airline reservation system documentation
 
Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)Database design & Normalization (1NF, 2NF, 3NF)
Database design & Normalization (1NF, 2NF, 3NF)
 

Similar a ER DIAGRAM TO RELATIONAL SCHEMA MAPPING

Nunes database
Nunes databaseNunes database
Nunes databaseRohini17
 
Assignment statements
Assignment statementsAssignment statements
Assignment statementsDivya Devan
 
Assignment statements
Assignment statementsAssignment statements
Assignment statementsDivya Devan
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Mudasir Qazi
 
3 relational model
3 relational model3 relational model
3 relational modelUtkarsh De
 
Chapter – 3 Database Design P-II.pdf
Chapter – 3 Database Design P-II.pdfChapter – 3 Database Design P-II.pdf
Chapter – 3 Database Design P-II.pdfTamiratDejene1
 
Advance database system(part 5)
Advance database system(part 5)Advance database system(part 5)
Advance database system(part 5)Abdullah Khosa
 
Databases - Unit 2.pdf
Databases - Unit 2.pdfDatabases - Unit 2.pdf
Databases - Unit 2.pdfCynthiaAdzornu
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 
Dbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelDbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelAmiya9439793168
 
Unit i b(er model)
Unit i b(er model)Unit i b(er model)
Unit i b(er model)Rohit Rathi
 
7.relational model
7.relational model7.relational model
7.relational modelraghuinfo
 
[Www.pkbulk.blogspot.com]dbms03
[Www.pkbulk.blogspot.com]dbms03[Www.pkbulk.blogspot.com]dbms03
[Www.pkbulk.blogspot.com]dbms03AnusAhmad
 
Schema relationship to E-R diagram
Schema relationship to E-R diagramSchema relationship to E-R diagram
Schema relationship to E-R diagramBadrul Alam
 
Lec4slides
Lec4slidesLec4slides
Lec4slidesshawiz
 
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdfPokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdfjefrifrans
 

Similar a ER DIAGRAM TO RELATIONAL SCHEMA MAPPING (20)

Nunes database
Nunes databaseNunes database
Nunes database
 
Assignment statements
Assignment statementsAssignment statements
Assignment statements
 
Assignment statements
Assignment statementsAssignment statements
Assignment statements
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
3 relational model
3 relational model3 relational model
3 relational model
 
Chapter – 3 Database Design P-II.pdf
Chapter – 3 Database Design P-II.pdfChapter – 3 Database Design P-II.pdf
Chapter – 3 Database Design P-II.pdf
 
Advance database system(part 5)
Advance database system(part 5)Advance database system(part 5)
Advance database system(part 5)
 
3_Relational_Model.pdf
3_Relational_Model.pdf3_Relational_Model.pdf
3_Relational_Model.pdf
 
Databases - Unit 2.pdf
Databases - Unit 2.pdfDatabases - Unit 2.pdf
Databases - Unit 2.pdf
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
Dbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelDbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational Model
 
Unit i b(er model)
Unit i b(er model)Unit i b(er model)
Unit i b(er model)
 
7.relational model
7.relational model7.relational model
7.relational model
 
[Www.pkbulk.blogspot.com]dbms03
[Www.pkbulk.blogspot.com]dbms03[Www.pkbulk.blogspot.com]dbms03
[Www.pkbulk.blogspot.com]dbms03
 
Lex Tool
Lex ToolLex Tool
Lex Tool
 
Schema relationship to E-R diagram
Schema relationship to E-R diagramSchema relationship to E-R diagram
Schema relationship to E-R diagram
 
Lec4slides
Lec4slidesLec4slides
Lec4slides
 
ERModel1.pdf
ERModel1.pdfERModel1.pdf
ERModel1.pdf
 
R Algebra.ppt
R Algebra.pptR Algebra.ppt
R Algebra.ppt
 
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdfPokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
Pokok Bahasan 06 ER-EER to Relational Mapping (1).pdf
 

Último

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 

Último (20)

Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 

ER DIAGRAM TO RELATIONAL SCHEMA MAPPING

  • 1. Logical database design Converting ER diagrams to relational schema
  • 2. 2 Converting Strong entity types • Each entity type becomes a table • Each single-valued attribute becomes a column • Derived attributes are ignored • Composite attributes are represented by components • Multi-valued attributes are represented by a separate table • The key attribute of the entiry type becomes the primary key of the table
  • 3. 3 Entity example • Here address is a composite attribute • Years of service is a derived attribute (can be calculated from date of joining and current date) • Skill set is a multi-valued attribute • The relational Schema Employee (E#, Name, Door_No, Street, City, Pincode, Date_Of_Joining) Emp_Skillset( E#, Skillset)
  • 4. 4 Entity Example (Contd…) SkillSet EmpCode FK Skills Employee Table EmpCode PK EmpName DateofJoining SkillSet
  • 5. 5 Converting weak entity types • Weak entity types are converted into a table of their own, with the primary key of the strong entity acting as a foreign key in the table • This foreign key along with the key of the weak entity form the composite primary key of this table • The Relational Schema Employee (E# ,…….) Dependant (Employee, Dependant_ID, Name, Address)
  • 6. 6 Converting weak entity types (Contd…) Dependent EmpCode PK /FK Dependent_ID PK Name Address Employee Table EmpCode PK EmpName DateofJoining SkillSet
  • 7. 7 Converting relationships • The way relationships are represented depends on the cardinality and the degree of the relationship • The possible cardinalities are: 1:1, 1:M, N:M • The degrees are: Unary Binary Ternary …
  • 8. 8 Binary 1:1 • Case 1: Combination of participation types The primary key of the partial participant will become the foreign key of the total participant Employee( E#, Name,…) Department (Dept#, Name…,MgrE#) departmentEmployee Manages1 1 partial Total
  • 9. 9 Binary 1 : 1 Department DeptCode PK DeptName Location MgrEmpCode FK Employee Table EmpCode PK EmpName DateofJoining SkillSet
  • 10. 10 Binary 1:1 • Case 2: Uniform participation types The primary key of either of the participants can become a foreign key in the other Employee (E#,name…) Chair( item#, model, location, used_by) (or) Employee ( E#, Name….Sits_on) Chair (item#,….) Employee CHAIRSits_on
  • 11. 11 Binary 1 : 1 Chair ItemNo PK Model Location Used_By FK Employee Table EmpCode PK EmpName DateofJoining SkillSet Chair ItemNo PK Model Location Employee Table EmpCode PK EmpName DateofJoining SkillSet Sits_On FK
  • 12. 12 Binary 1:N The primary key of the relation on the “1” side of the relationship becomes a foreign key in the relation on the “N” side Teacher (ID, Name, Telephone, ...) Subject (Code, Name, ..., Teacher) Teacher teaches Subject 1 N
  • 13. 13 Binary 1 : N Subject SubCode PK SubName Duration TeacherID FK Teacher TeacherID PK Name Telephone Cabin
  • 14. 14 Binary M:N • A new table is created to represent the relationship • Contains two foreign keys - one from each of the participants in the relationship • The primary key of the new table is the combination of the two foreign keys Student (Sid#,Title…) Course(C#,CName,…) Enrolls (Sid#, C#) Student Enrolls Course M N
  • 15. 15 Binary M : N Course CourseID PK Coursename Student StudentID PK StudentName DOB Address Enrolls StudentCode PK / FK CourseID PK / FK DOIssue Status
  • 16. 16 Self referencing 1:1 Employee( E#, Name,... Spouse) • Consider employees who are also a couple • The primary key field itself will become foreign key in the same table
  • 17. 17 Self referencing 1 : 1 Employee Table EmpCode PK EmpName DateofJoining SkillSet Spouse FK
  • 18. 18 Self referencing 1:N Employee( E#, Name,…,Manager) • The primary key field itself will become foreign key in the same table • Same as unary 1:1
  • 19. 19 Self referencing 1 : N Employee Table EmpCode PK EmpName DateofJoining SkillSet Manager FK
  • 20. 20 Self referencing M:N • There will be two resulting tables. One to represent the entity and another to represent the M:N relationship as follows Employee( E#, Name,…) Guaranty( Guarantor, beneficiary) Employee Guarantor_of M N
  • 21. 21 Self referncing M : N Guaranty Guarantor PK/FK Beneficiary PK /FK Employee Table EmpCode PK EmpName DateofJoining SkillSet
  • 22. 22 Ternary relationship • Represented by a new table • The new table contains three foreign keys - one from each of the participating Entities • The primary key of the new table is the combination of all three foreign keys • Prescription (Doctor#, Patient #, Medicine_Name)
  • 23. 23 Ternary Doctor DocID PK Title Prescription DocID PK / FK PatCode PK / FK MedName PK/ FK NextVisit Patient PatCode PK PatName DOB Address Medicine MedName PK ExpDate

Notas del editor

  1. Logical database design Process of converting the conceptual model into an equivalent representation in the implementation model (relational/hierarchical/network etc.) We will focus on the relational model Relational database design Convert ER model into relational schema (a specification of the table definitions and their foreign key links) There are well defined rules for this conversion
  2. As per the rules: Derived attributes are ignored Composite attributes are represented by components Multi-valued attributes are represented by a separate table
  3. Here dependant is a weak entity. Dependant doesn’t mean anything to the problem without the information on for which employee the person is a dependant.