SlideShare a Scribd company logo
1 of 29
Relationships within the
 relational database
Relationships within the relational database
 You already know that relationships are classified as one-to-
  one, one-to-many, and many-to-many.

    The 1:M relationship is the relational modeling ideal.
    Therefore, this relationship type should be the norm in any
    relational database design.

 The 1:1 relationship should be rare in any relational database
  design.

 M:N relationships cannot be implemented as such in the
  relational model.
Relationships within the relational database




          The 1:M
         Relationship
Relationships within the relational database
 The 1:M Relationship

The 1:M relationship is the relational database norm.
Relationships within the relational database
 The 1:M Relationship

• Each painting is painted by one and only one painter, but each
  painter could have painted many paintings.
Relationships within the relational database
 The 1:M Relationship

• There is only one row in the PAINTER table for any given row in the
  PAINTING table, but there are may be many rows in the PAINTING
  table for any given row in the PAINTER table.



• The 1:M relationship is found in any database environment. Students in
  a typical college or university will discover that each COURSE can
  generate many CLASSes but that each CLASS refers to only one
  COURSE.
Relationships within the relational database
 The 1:M Relationship

The ERM( entity relationship model) for the 1:M relationship between
  COURSE and CLASS.
Relationships within the relational database
 The 1:M Relationship
Relationships within the relational database
 The 1:M Relationship

• Each COURSE can have many CLASSes, but each CLASS references
  only one COURSE

• There will be only one row in the COURSE table form any given
  row in the COURSE table.
Relationships within the relational database




          The 1:1
         Relationship
Relationships within the relational database
 The 1:1 Relationship

• As the 1:1 label implies, in this relationship, one entity can be
  related to only one other entity, and vise versa.

• For example, one department chair-a professor-can chair only one
  department, and one department can have only one department
  chair.

• The entities PROFESSOR and DEPARTMENT thus exhibit a 1:1
  relationship.
Relationships within the relational database
 The 1:1 Relationship




      The basic relationship modeled in Figure 3.22
Relationships within the relational database
 The 1:1 Relationship




      As you examine the tables in Figure 3.23, note that there
Relationships within the relational database
1.   Each professor is a Tiny College employee. Therefore, the professor
     identification is through the EMP_Num.

2.   The 1:1 PROFESSOR chairs DEPARTMENT relationship is
     implemented by having the EMP_NUM fereign key in the
     DEPARTMENT table.

3.   Also note that the PROFESSOR table contains the DEPT_CODE
     foreign key to implement the 1:M DEPARTMENT employs
     PROFESSOR relationship.
Relationships within the relational database
•    The preceding “PROFESSOR chairs DEPARTMENT
    example illustrates a proper 1:1 relationship. In fact, the
    use of 1:1 relationship ensures that two entity sets are
    not placed in the same table when they should not be.

However, the existence of 1:1 relationship sometimes
  means that the entity components were not defined
  properly. It could indicate that the two entities actually
  belong in the same table!
Relationships within the relational database




     The M:N
   RELATIONSHIP
Relationships within the relational database


•   A many-to-many (M:N) relationship is not supported directly in the relational
    environment. However, M:N relationships can be implemented by creating a
    new entity in 1:M relationships with the original entities.
Relationships within the relational database
Relationships within the relational database
•   To explore the many-to-many (M:N) relationship, consider a rather typical
    college environment in which each STUDENT can take CLASSes and each
    CLASS can contain many STUDENTs. The ER model in Figure 3.24 show
    the M:N relationship.
Relationships within the relational database
•    Each CLASS can have many STUDENTs, and each STUDENT can
    take many CLASSes.

• There can be many rows in the CLASS table for any given row in the
  STUDENT table, and there can be many rows in the STUDENT table
  for any given row in the class



• To examine the M:N relationship more closely, imagine a small
  college with two students, each of whom takes three classes.
Relationships within the relational database
  The M:N relationship should not be implemented for two god reasons:


 The tables create many redundancies. For example, note that the STU_NUM
 values occur many times in the STUDENT table.


 • Given the structure and contents of the two tables, the relational operations
 become very complex and are likely to lead to system efficiency errors and
 output errors.
Relationships within the relational database
Relationships within the relational database
  Fortunately, the problems inherent in the many-to-many (M:N)
 relationship can easily be avoided by creating a composite entity (also
 referred to as a bridge entity or an associative entity). Because such a table
 is used to link the tables that were originally related in an M:N relationship,
 the composite entity structure includes-as foreign keys – at least the
 primary keys of the tables that are to be linked.
Relationships within the relational database
Relationships within the relational database
  The ENROLL table yields the required M:N to 1:M conversion. Observe that
 the composite entity represented by the ENROLL table must contain at least
 the primary keys of the CLASS and STUDENTS tables (CLASS_CODE and
 STU_NUM, respectively) for which it serves as a connector. Also note that the
 STUDENT and CLASS tables now contain only one row per entity.


 The ENROLL table contains multiple occurrences of the foreign key
 values, but those controlled redundancies are incapable of producing
 anomalies as long as referential integrity is enforced.
Relationships within the relational database




 •As you can examine the figure, note that composite entity named ENROLL
 represents the linking table between STUDENT and CLASS.
Relationships within the relational database




 •This figure shows the expanded ERM, including the expanded 1:M relationship
 between COURSE and CLASS
Relationships within the relational database
Prepared BY:

•HARRY OCHINANG
  •JANE CATALLA
   •RONN RIVERA

More Related Content

What's hot

12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMSkoolkampus
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMSPadamNepal1
 
Database abstraction
Database abstractionDatabase abstraction
Database abstractionRituBhargava7
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLEDrkhanchanaR
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignArchit Saxena
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity ConstraintsMegha yadav
 
ER model to Relational model mapping
ER model to Relational model mappingER model to Relational model mapping
ER model to Relational model mappingShubham Saini
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 
Relational database
Relational database Relational database
Relational database Megha Sharma
 
Previous question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEBPrevious question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEBShabeeb Shabi
 

What's hot (20)

12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
DATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEMDATABASE MANAGEMENT SYSTEM
DATABASE MANAGEMENT SYSTEM
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
Dbms architecture
Dbms architectureDbms architecture
Dbms architecture
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
Dbms
DbmsDbms
Dbms
 
Database abstraction
Database abstractionDatabase abstraction
Database abstraction
 
joins in database
 joins in database joins in database
joins in database
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLE
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
ER model to Relational model mapping
ER model to Relational model mappingER model to Relational model mapping
ER model to Relational model mapping
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Unit 2 oracle9i
Unit 2  oracle9i Unit 2  oracle9i
Unit 2 oracle9i
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
Relational database
Relational database Relational database
Relational database
 
Previous question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEBPrevious question papers of Database Management System (DBMS) By SHABEEB
Previous question papers of Database Management System (DBMS) By SHABEEB
 
ER MODEL
ER MODELER MODEL
ER MODEL
 

Viewers also liked

Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data ModelSmriti Jain
 
Creating relationships with tables
Creating relationships with tablesCreating relationships with tables
Creating relationships with tablesJhen Articona
 
Database Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity TypesDatabase Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity Typesaakanksha s
 
4 the relational data model and relational database constraints
4 the relational data model and relational database constraints4 the relational data model and relational database constraints
4 the relational data model and relational database constraintsKumar
 
3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMSkoolkampus
 
Example : parallelize a simple problem
Example : parallelize a simple problemExample : parallelize a simple problem
Example : parallelize a simple problemMrMaKKaWi
 
Data Models In Database Management System
Data Models In Database Management SystemData Models In Database Management System
Data Models In Database Management SystemAmad Ahmad
 
Relational database management system
Relational database management systemRelational database management system
Relational database management systemMuhammad Bilal Tariq
 
Entity (types, attibute types)
Entity (types, attibute types)Entity (types, attibute types)
Entity (types, attibute types)Zaheer Soomro
 

Viewers also liked (20)

Database Relationships
Database RelationshipsDatabase Relationships
Database Relationships
 
Database : Relational Data Model
Database : Relational Data ModelDatabase : Relational Data Model
Database : Relational Data Model
 
Creating relationships with tables
Creating relationships with tablesCreating relationships with tables
Creating relationships with tables
 
Database Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity TypesDatabase Modeling Using Entity.. Weak And Strong Entity Types
Database Modeling Using Entity.. Weak And Strong Entity Types
 
4 the relational data model and relational database constraints
4 the relational data model and relational database constraints4 the relational data model and relational database constraints
4 the relational data model and relational database constraints
 
3. Relational Models in DBMS
3. Relational Models in DBMS3. Relational Models in DBMS
3. Relational Models in DBMS
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
Example : parallelize a simple problem
Example : parallelize a simple problemExample : parallelize a simple problem
Example : parallelize a simple problem
 
Data Models In Database Management System
Data Models In Database Management SystemData Models In Database Management System
Data Models In Database Management System
 
ISDD Database Structure N5
ISDD Database Structure N5ISDD Database Structure N5
ISDD Database Structure N5
 
Field Types
Field TypesField Types
Field Types
 
Erd optionality
Erd optionalityErd optionality
Erd optionality
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
 
Relational database management system
Relational database management systemRelational database management system
Relational database management system
 
Database Validation
Database ValidationDatabase Validation
Database Validation
 
ISDD Media Types - File Compression
ISDD Media Types - File CompressionISDD Media Types - File Compression
ISDD Media Types - File Compression
 
ISDD Standard File Formats
ISDD Standard File FormatsISDD Standard File Formats
ISDD Standard File Formats
 
Conditional statements
Conditional statementsConditional statements
Conditional statements
 
Entity (types, attibute types)
Entity (types, attibute types)Entity (types, attibute types)
Entity (types, attibute types)
 
Rdbms
RdbmsRdbms
Rdbms
 

Similar to Relationships within the relational database

Sql server ___________session2-data_modeling
Sql server  ___________session2-data_modelingSql server  ___________session2-data_modeling
Sql server ___________session2-data_modelingEhtisham Ali
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraintsNikhil Deswal
 
Lecture Basic HTML tags. Beginning Web Site Design Stanford University Contin...
Lecture Basic HTML tags. Beginning Web Site Design Stanford University Contin...Lecture Basic HTML tags. Beginning Web Site Design Stanford University Contin...
Lecture Basic HTML tags. Beginning Web Site Design Stanford University Contin...Anwar Patel
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide sharefanta teferi
 
5e7ry754.pptx
5e7ry754.pptx5e7ry754.pptx
5e7ry754.pptxqwert001
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptxThangamaniR3
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Data Modeling Er
Data Modeling ErData Modeling Er
Data Modeling Er1ajnabi4u
 
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...gamuhuto
 
Create table relationships
Create table relationshipsCreate table relationships
Create table relationshipsDastan Kamaran
 
Create table relationships
Create table relationshipsCreate table relationships
Create table relationshipsDastan Kamaran
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptIRWANBINISMAILKPMGur1
 
ERD - Entity Relationship Diagram
ERD - Entity Relationship DiagramERD - Entity Relationship Diagram
ERD - Entity Relationship DiagramAsher Jawad
 

Similar to Relationships within the relational database (20)

Sql server ___________session2-data_modeling
Sql server  ___________session2-data_modelingSql server  ___________session2-data_modeling
Sql server ___________session2-data_modeling
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraints
 
DATABASE DESIGN.pptx
DATABASE DESIGN.pptxDATABASE DESIGN.pptx
DATABASE DESIGN.pptx
 
Lecture Basic HTML tags. Beginning Web Site Design Stanford University Contin...
Lecture Basic HTML tags. Beginning Web Site Design Stanford University Contin...Lecture Basic HTML tags. Beginning Web Site Design Stanford University Contin...
Lecture Basic HTML tags. Beginning Web Site Design Stanford University Contin...
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
 
5e7ry754.pptx
5e7ry754.pptx5e7ry754.pptx
5e7ry754.pptx
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Data Modeling Er
Data Modeling ErData Modeling Er
Data Modeling Er
 
Relational Model
Relational ModelRelational Model
Relational Model
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
Data base lec3 (erd)
Data base lec3 (erd)Data base lec3 (erd)
Data base lec3 (erd)
 
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
Fundamentals of Database Management Systems 2nd Edition Gillenson Solutions M...
 
Data modeling
Data modelingData modeling
Data modeling
 
Create table relationships
Create table relationshipsCreate table relationships
Create table relationships
 
Create table relationships
Create table relationshipsCreate table relationships
Create table relationships
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.ppt
 
UNIT II DBMS.pptx
UNIT II DBMS.pptxUNIT II DBMS.pptx
UNIT II DBMS.pptx
 
09.01 normalization
09.01 normalization09.01 normalization
09.01 normalization
 
ERD - Entity Relationship Diagram
ERD - Entity Relationship DiagramERD - Entity Relationship Diagram
ERD - Entity Relationship Diagram
 

More from Janecatalla

More from Janecatalla (20)

Bedlibrary4
Bedlibrary4Bedlibrary4
Bedlibrary4
 
Bedlibrary6
Bedlibrary6Bedlibrary6
Bedlibrary6
 
Bedlibrary5
Bedlibrary5Bedlibrary5
Bedlibrary5
 
Bedlibrary4
Bedlibrary4Bedlibrary4
Bedlibrary4
 
Bedlibrary3
Bedlibrary3Bedlibrary3
Bedlibrary3
 
Bedlibrary2
Bedlibrary2Bedlibrary2
Bedlibrary2
 
Bedlibrary
BedlibraryBedlibrary
Bedlibrary
 
Lis124
Lis124Lis124
Lis124
 
My presentation-for-infolit-workshop1
My presentation-for-infolit-workshop1My presentation-for-infolit-workshop1
My presentation-for-infolit-workshop1
 
Pp lis
Pp  lisPp  lis
Pp lis
 
Object oriented database model
Object oriented database modelObject oriented database model
Object oriented database model
 
Jane catalla
Jane catallaJane catalla
Jane catalla
 
Catalla & cea
Catalla & ceaCatalla & cea
Catalla & cea
 
Dbms
DbmsDbms
Dbms
 
Indexing report
Indexing reportIndexing report
Indexing report
 
Permuted Title Index
Permuted Title IndexPermuted Title Index
Permuted Title Index
 
Indexing report
Indexing reportIndexing report
Indexing report
 
Jane iii
Jane iiiJane iii
Jane iii
 
Readers advisory services final
Readers advisory services finalReaders advisory services final
Readers advisory services final
 
Term paper counseling
Term paper counselingTerm paper counseling
Term paper counseling
 

Recently uploaded

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

Relationships within the relational database

  • 1. Relationships within the relational database
  • 2. Relationships within the relational database  You already know that relationships are classified as one-to- one, one-to-many, and many-to-many.  The 1:M relationship is the relational modeling ideal. Therefore, this relationship type should be the norm in any relational database design.  The 1:1 relationship should be rare in any relational database design.  M:N relationships cannot be implemented as such in the relational model.
  • 3. Relationships within the relational database The 1:M Relationship
  • 4. Relationships within the relational database  The 1:M Relationship The 1:M relationship is the relational database norm.
  • 5. Relationships within the relational database  The 1:M Relationship • Each painting is painted by one and only one painter, but each painter could have painted many paintings.
  • 6. Relationships within the relational database  The 1:M Relationship • There is only one row in the PAINTER table for any given row in the PAINTING table, but there are may be many rows in the PAINTING table for any given row in the PAINTER table. • The 1:M relationship is found in any database environment. Students in a typical college or university will discover that each COURSE can generate many CLASSes but that each CLASS refers to only one COURSE.
  • 7. Relationships within the relational database  The 1:M Relationship The ERM( entity relationship model) for the 1:M relationship between COURSE and CLASS.
  • 8. Relationships within the relational database  The 1:M Relationship
  • 9. Relationships within the relational database  The 1:M Relationship • Each COURSE can have many CLASSes, but each CLASS references only one COURSE • There will be only one row in the COURSE table form any given row in the COURSE table.
  • 10. Relationships within the relational database The 1:1 Relationship
  • 11. Relationships within the relational database  The 1:1 Relationship • As the 1:1 label implies, in this relationship, one entity can be related to only one other entity, and vise versa. • For example, one department chair-a professor-can chair only one department, and one department can have only one department chair. • The entities PROFESSOR and DEPARTMENT thus exhibit a 1:1 relationship.
  • 12. Relationships within the relational database  The 1:1 Relationship The basic relationship modeled in Figure 3.22
  • 13. Relationships within the relational database  The 1:1 Relationship As you examine the tables in Figure 3.23, note that there
  • 14. Relationships within the relational database 1. Each professor is a Tiny College employee. Therefore, the professor identification is through the EMP_Num. 2. The 1:1 PROFESSOR chairs DEPARTMENT relationship is implemented by having the EMP_NUM fereign key in the DEPARTMENT table. 3. Also note that the PROFESSOR table contains the DEPT_CODE foreign key to implement the 1:M DEPARTMENT employs PROFESSOR relationship.
  • 15. Relationships within the relational database • The preceding “PROFESSOR chairs DEPARTMENT example illustrates a proper 1:1 relationship. In fact, the use of 1:1 relationship ensures that two entity sets are not placed in the same table when they should not be. However, the existence of 1:1 relationship sometimes means that the entity components were not defined properly. It could indicate that the two entities actually belong in the same table!
  • 16. Relationships within the relational database The M:N RELATIONSHIP
  • 17. Relationships within the relational database • A many-to-many (M:N) relationship is not supported directly in the relational environment. However, M:N relationships can be implemented by creating a new entity in 1:M relationships with the original entities.
  • 18. Relationships within the relational database
  • 19. Relationships within the relational database • To explore the many-to-many (M:N) relationship, consider a rather typical college environment in which each STUDENT can take CLASSes and each CLASS can contain many STUDENTs. The ER model in Figure 3.24 show the M:N relationship.
  • 20. Relationships within the relational database • Each CLASS can have many STUDENTs, and each STUDENT can take many CLASSes. • There can be many rows in the CLASS table for any given row in the STUDENT table, and there can be many rows in the STUDENT table for any given row in the class • To examine the M:N relationship more closely, imagine a small college with two students, each of whom takes three classes.
  • 21. Relationships within the relational database  The M:N relationship should not be implemented for two god reasons: The tables create many redundancies. For example, note that the STU_NUM values occur many times in the STUDENT table. • Given the structure and contents of the two tables, the relational operations become very complex and are likely to lead to system efficiency errors and output errors.
  • 22. Relationships within the relational database
  • 23. Relationships within the relational database  Fortunately, the problems inherent in the many-to-many (M:N) relationship can easily be avoided by creating a composite entity (also referred to as a bridge entity or an associative entity). Because such a table is used to link the tables that were originally related in an M:N relationship, the composite entity structure includes-as foreign keys – at least the primary keys of the tables that are to be linked.
  • 24. Relationships within the relational database
  • 25. Relationships within the relational database  The ENROLL table yields the required M:N to 1:M conversion. Observe that the composite entity represented by the ENROLL table must contain at least the primary keys of the CLASS and STUDENTS tables (CLASS_CODE and STU_NUM, respectively) for which it serves as a connector. Also note that the STUDENT and CLASS tables now contain only one row per entity. The ENROLL table contains multiple occurrences of the foreign key values, but those controlled redundancies are incapable of producing anomalies as long as referential integrity is enforced.
  • 26. Relationships within the relational database •As you can examine the figure, note that composite entity named ENROLL represents the linking table between STUDENT and CLASS.
  • 27. Relationships within the relational database •This figure shows the expanded ERM, including the expanded 1:M relationship between COURSE and CLASS
  • 28. Relationships within the relational database
  • 29. Prepared BY: •HARRY OCHINANG •JANE CATALLA •RONN RIVERA