SlideShare a Scribd company logo
1 of 20
Relationship
‫ارتباط‬
‫کننده‬ ‫تهیه‬:‫عادل‬ ‫هللا‬ ‫عصمت‬
Topics:
• Relationship
• Degree of a relation
• Associative entity
• Cardinality of relationships
•‫ارتباط‬
•‫ارتباط‬ ‫درجه‬
•‫پذیر‬ ‫شرکت‬ ‫موجودیت‬
•‫ارتباط‬ ‫کاردینالیتی‬
1:50 AM
Gharjistan University Computer Science
Faculty Farah Branch
2
Relationship:
• Showing association among
two or more than two entity
types is called Relationship.
•‫اضا‬ ‫یا‬ ‫و‬ ‫دو‬ ‫بین‬ ‫رابطه‬ ‫دادن‬ ‫نشان‬‫فه‬
‫بنام‬ ‫را‬ ‫موجودیت‬ ‫نوع‬ ‫دو‬ ‫از‬ ‫تر‬
‫میکند‬ ‫یاد‬ ‫ارتباط‬.
Nangarhar University Computer Sceince
Faculty
3
Continue…
Nangarhar University Computer Sceince
Faculty
4
Teacher SubjectTeaches
Degree of a relation:
• The number of entity types
that participate in a
relationship is called its
degree.
•‫یک‬ ‫در‬ ‫که‬ ‫موجودیت‬ ‫نوع‬ ‫تعداد‬
‫درجه‬ ‫بنام‬ ‫میکند‬ ‫شرکت‬ ‫ارتباط‬
‫میشود‬ ‫یاد‬ ‫ارتباط‬.
Nangarhar University Computer Sceince
Faculty
5
Degree of a relation…
• Three most common degree
are:
1. Unary Relationship(Degree
one).
2. Binary Relationship(Degree
two).
3. Ternary
Relationship(degree three).
•‫ذیل‬ ‫قرار‬ ‫معمول‬ ‫بسیار‬ ‫درجه‬ ‫سه‬
‫است‬:
.1‫یگانه‬ ‫ارتباط‬(‫یک‬ ‫درجه‬)
.2‫دوگانه‬ ‫ارتباط‬(‫دو‬ ‫درجه‬)
.3‫گانه‬ ‫سه‬ ‫ارتباط‬(‫سه‬ ‫درجه‬)
Nangarhar University Computer Sceince
Faculty
6
Unary relationship(degree one):
• A relation between the
instances of single entity
type is called Unary(Degree
one) Relationship .
• An entity type linked with
itself, also called recursive
relationship.
•‫ن‬ ‫یک‬ ‫های‬ ‫نمونه‬ ‫بین‬ ‫ارتباط‬ ‫یک‬‫وع‬
‫یاد‬ ‫یگانه‬ ‫ارتباط‬ ‫بنام‬ ‫موجودیت‬
‫میشود‬.
•‫موجودیت‬ ‫نوع‬ ‫یک‬‫خودش‬ ‫با‬ ‫ایکه‬
‫ارتباط‬ ‫بنام‬ ‫همچنان‬ ‫باشد‬ ‫وصل‬
‫میشود‬ ‫یاد‬ ‫بازگشتی‬.
Nangarhar University Computer Sceince
Faculty
7
person
Is_married_to
EMPLOYEE
Manages
Binary relationship(degree two):
• A relation between the
instances of two entity
types is called
binary(degree two)
relationship.
•‫های‬ ‫نمونه‬ ‫بین‬ ‫ارتباط‬ ‫یک‬‫نوع‬ ‫دو‬
‫ارتباط‬ ‫بنام‬ ‫موجودیت‬‫یاد‬ ‫دوگانه‬
‫میشود‬.
Nangarhar University Computer Sceince
Faculty
8
Teacher SubjectTeaches
Ternary relationship(degree three):
• A Relationship between the
instances of three entity
types is called
Ternary(Degree three)
relationship.
• Example: Many venders
ships many items to
many warehouses.
•‫های‬ ‫نمونه‬ ‫بین‬ ‫ارتباط‬ ‫یک‬‫سه‬‫نو‬‫ع‬
‫ارتباط‬ ‫بنام‬ ‫موجودیت‬‫ی‬ ‫گانه‬ ‫سه‬‫اد‬
‫میشود‬.
•‫مثال‬:‫اشیای‬ ‫زیاد‬ ‫گان‬ ‫فروشنده‬
‫انتقال‬ ‫زیاد‬ ‫های‬ ‫گدام‬ ‫به‬ ‫را‬ ‫زیادی‬
‫میدهد‬.
Nangarhar University Computer Sceince
Faculty
9
Ternary relationship(degree three)…
• The Institute might need to
record which teachers
taught which subjects in
which courses.
•‫داشت‬ ‫ضرورت‬ ‫ممکن‬ ‫انستیتیوت‬‫ه‬
‫استا‬ ‫کدام‬ ‫که‬ ‫کند‬ ‫ثبت‬ ‫تا‬ ‫باشد‬‫کدام‬ ‫د‬
‫درس‬ ‫صنف‬ ‫کدام‬ ‫در‬ ‫را‬ ‫مضمون‬
‫میدهد‬.
1:50 AM
Gharjistan University Computer Science
Faculty Farah Branch
10
Degree of relationships:
Nangarhar University Computer Sceince
Faculty 11
Entities of
two different
types related
to each other.
Entities of three
different types
related to each
other.
One entity
related to
another of
the same
entity type.
Associative entity:
• The presence of one or
more attributes on a
relationship suggests to the
designer that the
relationship should perhaps
be represented as an entity
type.
• That entity type is called
associative Entity.
•‫یک‬ ‫از‬ ‫بیشتر‬ ‫یا‬ ‫و‬ ‫یک‬ ‫موجودیت‬
‫ب‬ ‫ارتباط‬ ‫یک‬ ‫باالی‬ ‫خاصه‬ ‫صفت‬‫ه‬
‫ارت‬ ‫که‬ ‫میکند‬ ‫پیشنهاد‬ ‫دیزاینر‬‫به‬ ‫باط‬
‫داده‬ ‫نمایش‬ ‫موجودیت‬ ‫نوع‬ ‫شکل‬
‫شود‬.
•‫بنام‬ ‫موجودیت‬ ‫نوع‬ ‫این‬ ‫که‬
‫میشود‬ ‫یاد‬ ‫پذیر‬ ‫شرکت‬ ‫موجودیت‬.
Nangarhar University Computer Sceince
Faculty
12
Nangarhar University Computer Sceince Faculty
Associative entity example:
Nangarhar University Computer Science
Faculty
13
STUDENT COURSE
Std_id S_name Course_id C_title
Certificate
Date_comp
Certificate_No
Cardinality of relationships:
• One to One:
• Each entity in the
relationship will have
exactly one related entity.
• For example:
•‫یک‬ ‫به‬ ‫یک‬:
•‫یک‬ ً‫ا‬‫دقیق‬ ‫ارتباط‬ ‫در‬ ‫موجودیت‬ ‫هر‬
‫داشت‬ ‫خواهد‬ ‫وابسته‬ ‫موجودیت‬.
•‫مثال‬ ‫بطور‬:
Nangarhar University Computer Sceince
Faculty
14
Person Passporthas
Cardinality of relationships…
• One to Many:
• An entity on one side of the
relationship can have many
related entities, but an
entity on the other side will
have a maximum of one
related entity.
• For example:
•‫چند‬ ‫به‬ ‫یک‬:
•‫ارتباط‬ ‫طرف‬ ‫یک‬ ‫در‬ ‫موجودیت‬ ‫یک‬
‫وابس‬ ‫موجودیت‬ ‫چندین‬ ‫که‬ ‫میتواند‬‫ته‬
‫طرف‬ ‫موجودیت‬ ‫اما‬ ‫باشد‬ ‫داشته‬ ‫را‬
‫وابس‬ ‫موجودیت‬ ‫یک‬ ‫حداکثر‬ ‫دیگر‬‫ته‬
‫داشت‬ ‫خواهد‬.
•‫مثال‬ ‫بطور‬:
Nangarhar University Computer Sceince
Faculty
15
Instructor Coursesteaches
Cardinality of relationships…
• Many to Many:
• Entities on both sides of the
relationship can have many
related entities on the other
side.
•‫چند‬ ‫به‬ ‫چند‬:
•‫طرف‬ ‫دو‬ ‫هر‬ ‫در‬ ‫ها‬ ‫موجودیت‬
‫موجودی‬ ‫چندین‬ ‫که‬ ‫میتواند‬ ‫ارتباط‬‫ت‬
‫باش‬ ‫داشته‬ ‫دیگر‬ ‫طرف‬ ‫در‬ ‫وابسته‬‫د‬.
1:50 AM
Gharjistan University Computer Science
Faculty Farah Branch
16
Student CoursesRegister for
Mandatory/Optional Relationships:
• Participation by an entity in
a relationship may
be optional or mandatory.
• For example:
•‫یک‬ ‫در‬ ‫موجودیت‬ ‫یک‬ ‫شرکت‬
‫اجباری‬ ‫یا‬ ‫و‬ ‫اختیاری‬ ‫ممکن‬ ‫رابطه‬
‫باشد‬.
•‫مثال‬ ‫بطور‬:
Nangarhar University Computer Sceince
Faculty
17
Employee CarDrives
Continue…
1:50 AM
Gharjistan University Computer Science
Faculty Farah Branch
18
Continue…
1:50 AM
Gharjistan University Computer Science
Faculty Farah Branch
19
1:50 AM
Gharjistan University Computer Science
Faculty Farah Branch
20

More Related Content

Similar to Relationship in database

E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptxsandeep54552
 
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
 
Transactional Research from the Inter/National Coalition for Electronic Portf...
Transactional Research from the Inter/National Coalition for Electronic Portf...Transactional Research from the Inter/National Coalition for Electronic Portf...
Transactional Research from the Inter/National Coalition for Electronic Portf...dcambrid
 
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptxBUSHRASHAIKH804312
 
Link and association in Java
Link and association in JavaLink and association in Java
Link and association in JavaBhargav Parekh
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramRakhi Mukherji
 
Mapping cardinality (cardinality constraint) in ER MODEL
Mapping cardinality (cardinality constraint) in ER MODELMapping cardinality (cardinality constraint) in ER MODEL
Mapping cardinality (cardinality constraint) in ER MODELRUpaliLohar
 
Dialogue based Meaning Negotiation
Dialogue based Meaning NegotiationDialogue based Meaning Negotiation
Dialogue based Meaning NegotiationTerry Payne
 
An investigation of the information literacy instruction practices, attitudes...
An investigation of the information literacy instruction practices, attitudes...An investigation of the information literacy instruction practices, attitudes...
An investigation of the information literacy instruction practices, attitudes...IL Group (CILIP Information Literacy Group)
 
Wk9 Slides Social Networks - Class.pptx
Wk9 Slides Social Networks - Class.pptxWk9 Slides Social Networks - Class.pptx
Wk9 Slides Social Networks - Class.pptxNathanChris1
 
Newsletter Presentation
Newsletter PresentationNewsletter Presentation
Newsletter Presentationmcculloe
 
Entity Relationship Diagram part9
Entity Relationship Diagram part9Entity Relationship Diagram part9
Entity Relationship Diagram part9DrMohammed Qassim
 
Curriculum and Actor Network Theory
Curriculum and Actor Network TheoryCurriculum and Actor Network Theory
Curriculum and Actor Network TheoryMichael Carroll
 
Literacies for Employability (L4E): A framework for development of workplace ...
Literacies for Employability (L4E): A framework for development of workplace ...Literacies for Employability (L4E): A framework for development of workplace ...
Literacies for Employability (L4E): A framework for development of workplace ...The Higher Education Academy
 

Similar to Relationship in database (20)

E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
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...
 
Transactional Research from the Inter/National Coalition for Electronic Portf...
Transactional Research from the Inter/National Coalition for Electronic Portf...Transactional Research from the Inter/National Coalition for Electronic Portf...
Transactional Research from the Inter/National Coalition for Electronic Portf...
 
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
 
Link and association in Java
Link and association in JavaLink and association in Java
Link and association in Java
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
ERModel1.pdf
ERModel1.pdfERModel1.pdf
ERModel1.pdf
 
haythornthwaite
haythornthwaitehaythornthwaite
haythornthwaite
 
Mapping cardinality (cardinality constraint) in ER MODEL
Mapping cardinality (cardinality constraint) in ER MODELMapping cardinality (cardinality constraint) in ER MODEL
Mapping cardinality (cardinality constraint) in ER MODEL
 
Dialogue based Meaning Negotiation
Dialogue based Meaning NegotiationDialogue based Meaning Negotiation
Dialogue based Meaning Negotiation
 
An investigation of the information literacy instruction practices, attitudes...
An investigation of the information literacy instruction practices, attitudes...An investigation of the information literacy instruction practices, attitudes...
An investigation of the information literacy instruction practices, attitudes...
 
Wk9 Slides Social Networks - Class.pptx
Wk9 Slides Social Networks - Class.pptxWk9 Slides Social Networks - Class.pptx
Wk9 Slides Social Networks - Class.pptx
 
Newsletter Presentation
Newsletter PresentationNewsletter Presentation
Newsletter Presentation
 
Entity Relationship Diagram part9
Entity Relationship Diagram part9Entity Relationship Diagram part9
Entity Relationship Diagram part9
 
Curriculum and Actor Network Theory
Curriculum and Actor Network TheoryCurriculum and Actor Network Theory
Curriculum and Actor Network Theory
 
Literacies for Employability (L4E): A framework for development of workplace ...
Literacies for Employability (L4E): A framework for development of workplace ...Literacies for Employability (L4E): A framework for development of workplace ...
Literacies for Employability (L4E): A framework for development of workplace ...
 
RDBMS ERD
RDBMS ERDRDBMS ERD
RDBMS ERD
 
Unit iv dbms
Unit   iv dbmsUnit   iv dbms
Unit iv dbms
 
EER MODEL
EER MODELEER MODEL
EER MODEL
 

More from Esmatullah Adel

More from Esmatullah Adel (7)

Introduction to sql_02
Introduction to sql_02Introduction to sql_02
Introduction to sql_02
 
Introduction to sql_01
Introduction to sql_01Introduction to sql_01
Introduction to sql_01
 
Mapping in database
Mapping in databaseMapping in database
Mapping in database
 
Enhanced entity relationship model
Enhanced entity relationship modelEnhanced entity relationship model
Enhanced entity relationship model
 
Identifiers in database
Identifiers in databaseIdentifiers in database
Identifiers in database
 
Requirements analysis
Requirements analysisRequirements analysis
Requirements analysis
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Relationship in database

  • 2. Topics: • Relationship • Degree of a relation • Associative entity • Cardinality of relationships •‫ارتباط‬ •‫ارتباط‬ ‫درجه‬ •‫پذیر‬ ‫شرکت‬ ‫موجودیت‬ •‫ارتباط‬ ‫کاردینالیتی‬ 1:50 AM Gharjistan University Computer Science Faculty Farah Branch 2
  • 3. Relationship: • Showing association among two or more than two entity types is called Relationship. •‫اضا‬ ‫یا‬ ‫و‬ ‫دو‬ ‫بین‬ ‫رابطه‬ ‫دادن‬ ‫نشان‬‫فه‬ ‫بنام‬ ‫را‬ ‫موجودیت‬ ‫نوع‬ ‫دو‬ ‫از‬ ‫تر‬ ‫میکند‬ ‫یاد‬ ‫ارتباط‬. Nangarhar University Computer Sceince Faculty 3
  • 4. Continue… Nangarhar University Computer Sceince Faculty 4 Teacher SubjectTeaches
  • 5. Degree of a relation: • The number of entity types that participate in a relationship is called its degree. •‫یک‬ ‫در‬ ‫که‬ ‫موجودیت‬ ‫نوع‬ ‫تعداد‬ ‫درجه‬ ‫بنام‬ ‫میکند‬ ‫شرکت‬ ‫ارتباط‬ ‫میشود‬ ‫یاد‬ ‫ارتباط‬. Nangarhar University Computer Sceince Faculty 5
  • 6. Degree of a relation… • Three most common degree are: 1. Unary Relationship(Degree one). 2. Binary Relationship(Degree two). 3. Ternary Relationship(degree three). •‫ذیل‬ ‫قرار‬ ‫معمول‬ ‫بسیار‬ ‫درجه‬ ‫سه‬ ‫است‬: .1‫یگانه‬ ‫ارتباط‬(‫یک‬ ‫درجه‬) .2‫دوگانه‬ ‫ارتباط‬(‫دو‬ ‫درجه‬) .3‫گانه‬ ‫سه‬ ‫ارتباط‬(‫سه‬ ‫درجه‬) Nangarhar University Computer Sceince Faculty 6
  • 7. Unary relationship(degree one): • A relation between the instances of single entity type is called Unary(Degree one) Relationship . • An entity type linked with itself, also called recursive relationship. •‫ن‬ ‫یک‬ ‫های‬ ‫نمونه‬ ‫بین‬ ‫ارتباط‬ ‫یک‬‫وع‬ ‫یاد‬ ‫یگانه‬ ‫ارتباط‬ ‫بنام‬ ‫موجودیت‬ ‫میشود‬. •‫موجودیت‬ ‫نوع‬ ‫یک‬‫خودش‬ ‫با‬ ‫ایکه‬ ‫ارتباط‬ ‫بنام‬ ‫همچنان‬ ‫باشد‬ ‫وصل‬ ‫میشود‬ ‫یاد‬ ‫بازگشتی‬. Nangarhar University Computer Sceince Faculty 7 person Is_married_to EMPLOYEE Manages
  • 8. Binary relationship(degree two): • A relation between the instances of two entity types is called binary(degree two) relationship. •‫های‬ ‫نمونه‬ ‫بین‬ ‫ارتباط‬ ‫یک‬‫نوع‬ ‫دو‬ ‫ارتباط‬ ‫بنام‬ ‫موجودیت‬‫یاد‬ ‫دوگانه‬ ‫میشود‬. Nangarhar University Computer Sceince Faculty 8 Teacher SubjectTeaches
  • 9. Ternary relationship(degree three): • A Relationship between the instances of three entity types is called Ternary(Degree three) relationship. • Example: Many venders ships many items to many warehouses. •‫های‬ ‫نمونه‬ ‫بین‬ ‫ارتباط‬ ‫یک‬‫سه‬‫نو‬‫ع‬ ‫ارتباط‬ ‫بنام‬ ‫موجودیت‬‫ی‬ ‫گانه‬ ‫سه‬‫اد‬ ‫میشود‬. •‫مثال‬:‫اشیای‬ ‫زیاد‬ ‫گان‬ ‫فروشنده‬ ‫انتقال‬ ‫زیاد‬ ‫های‬ ‫گدام‬ ‫به‬ ‫را‬ ‫زیادی‬ ‫میدهد‬. Nangarhar University Computer Sceince Faculty 9
  • 10. Ternary relationship(degree three)… • The Institute might need to record which teachers taught which subjects in which courses. •‫داشت‬ ‫ضرورت‬ ‫ممکن‬ ‫انستیتیوت‬‫ه‬ ‫استا‬ ‫کدام‬ ‫که‬ ‫کند‬ ‫ثبت‬ ‫تا‬ ‫باشد‬‫کدام‬ ‫د‬ ‫درس‬ ‫صنف‬ ‫کدام‬ ‫در‬ ‫را‬ ‫مضمون‬ ‫میدهد‬. 1:50 AM Gharjistan University Computer Science Faculty Farah Branch 10
  • 11. Degree of relationships: Nangarhar University Computer Sceince Faculty 11 Entities of two different types related to each other. Entities of three different types related to each other. One entity related to another of the same entity type.
  • 12. Associative entity: • The presence of one or more attributes on a relationship suggests to the designer that the relationship should perhaps be represented as an entity type. • That entity type is called associative Entity. •‫یک‬ ‫از‬ ‫بیشتر‬ ‫یا‬ ‫و‬ ‫یک‬ ‫موجودیت‬ ‫ب‬ ‫ارتباط‬ ‫یک‬ ‫باالی‬ ‫خاصه‬ ‫صفت‬‫ه‬ ‫ارت‬ ‫که‬ ‫میکند‬ ‫پیشنهاد‬ ‫دیزاینر‬‫به‬ ‫باط‬ ‫داده‬ ‫نمایش‬ ‫موجودیت‬ ‫نوع‬ ‫شکل‬ ‫شود‬. •‫بنام‬ ‫موجودیت‬ ‫نوع‬ ‫این‬ ‫که‬ ‫میشود‬ ‫یاد‬ ‫پذیر‬ ‫شرکت‬ ‫موجودیت‬. Nangarhar University Computer Sceince Faculty 12 Nangarhar University Computer Sceince Faculty
  • 13. Associative entity example: Nangarhar University Computer Science Faculty 13 STUDENT COURSE Std_id S_name Course_id C_title Certificate Date_comp Certificate_No
  • 14. Cardinality of relationships: • One to One: • Each entity in the relationship will have exactly one related entity. • For example: •‫یک‬ ‫به‬ ‫یک‬: •‫یک‬ ً‫ا‬‫دقیق‬ ‫ارتباط‬ ‫در‬ ‫موجودیت‬ ‫هر‬ ‫داشت‬ ‫خواهد‬ ‫وابسته‬ ‫موجودیت‬. •‫مثال‬ ‫بطور‬: Nangarhar University Computer Sceince Faculty 14 Person Passporthas
  • 15. Cardinality of relationships… • One to Many: • An entity on one side of the relationship can have many related entities, but an entity on the other side will have a maximum of one related entity. • For example: •‫چند‬ ‫به‬ ‫یک‬: •‫ارتباط‬ ‫طرف‬ ‫یک‬ ‫در‬ ‫موجودیت‬ ‫یک‬ ‫وابس‬ ‫موجودیت‬ ‫چندین‬ ‫که‬ ‫میتواند‬‫ته‬ ‫طرف‬ ‫موجودیت‬ ‫اما‬ ‫باشد‬ ‫داشته‬ ‫را‬ ‫وابس‬ ‫موجودیت‬ ‫یک‬ ‫حداکثر‬ ‫دیگر‬‫ته‬ ‫داشت‬ ‫خواهد‬. •‫مثال‬ ‫بطور‬: Nangarhar University Computer Sceince Faculty 15 Instructor Coursesteaches
  • 16. Cardinality of relationships… • Many to Many: • Entities on both sides of the relationship can have many related entities on the other side. •‫چند‬ ‫به‬ ‫چند‬: •‫طرف‬ ‫دو‬ ‫هر‬ ‫در‬ ‫ها‬ ‫موجودیت‬ ‫موجودی‬ ‫چندین‬ ‫که‬ ‫میتواند‬ ‫ارتباط‬‫ت‬ ‫باش‬ ‫داشته‬ ‫دیگر‬ ‫طرف‬ ‫در‬ ‫وابسته‬‫د‬. 1:50 AM Gharjistan University Computer Science Faculty Farah Branch 16 Student CoursesRegister for
  • 17. Mandatory/Optional Relationships: • Participation by an entity in a relationship may be optional or mandatory. • For example: •‫یک‬ ‫در‬ ‫موجودیت‬ ‫یک‬ ‫شرکت‬ ‫اجباری‬ ‫یا‬ ‫و‬ ‫اختیاری‬ ‫ممکن‬ ‫رابطه‬ ‫باشد‬. •‫مثال‬ ‫بطور‬: Nangarhar University Computer Sceince Faculty 17 Employee CarDrives
  • 18. Continue… 1:50 AM Gharjistan University Computer Science Faculty Farah Branch 18
  • 19. Continue… 1:50 AM Gharjistan University Computer Science Faculty Farah Branch 19
  • 20. 1:50 AM Gharjistan University Computer Science Faculty Farah Branch 20