SlideShare a Scribd company logo
1 of 29
RELATIONSHIP
IN DBMS
 ADARSHA DALABEHERA-220301120183
 RUDRA PRASAD BARAL-220301120187
 G. SIPRARANI PATRA-220301120188
 ABHIPSA SAHOO-220301120189
 NYAYABRATA DAS -220301120191
CONTENTS:-
Introduction
How are relationships established ?
keys
Why are relationships important in a Database ?
Relationship
Types of relationship
Importance of relationship in DBMS
Conclusion
INTRODUCTION:-
A relationship in DBMS is the way in which two or
more data sets are linked i.e, any association between
two entity types is called a relationship.
The main feature of relational database is relationships.
Different relationship types control how the data and
tables relate to one another.
Establishing relationship makes this database type
unique, and knowing how relationship works helps
broaden database modeling capabilities.
 How are relationships established ?
The two following elements define how a database
relationship is established.
 Primary key
 Foreign key
KEYS :-
Keys play an important role in the relational database.
It is used to uniquely identify any record or row of data from the table.
 It is also used to establish and identify relationships between tables.
PRIMARY KEY:-
It is the first key used to identify one and only one instance of an entity uniquely. An
entity can contain multiple keys, as we saw in the PERSON table. The key which is
most suitable from those lists becomes a primary key.
In the EMPLOYEE table, ID can be the primary key since it is unique for each
employee. In the EMPLOYEE table, we can even select License Number and Passport
Number as primary keys since they are also unique.
For each entity, the primary key selection is based on requirements and developers.
FOREIGN KEY:-
When tables relate , the primary key of one table becomes a foreign key of the
other table.
For the example, in the two tables on the right , employees table as a primary
key and in the order as a foreign key .
FOREIGN KEY when tables are linked by the primary key, the related field in
the second table is known as the foreign key.
CANDIDATE KEY:-
A candidate key is an attribute or set of attributes that can uniquely
identify a tuple(A tuple in DBMS is a collection of attribute values in
which no two unique items have the same name.).
Except for the primary key, the remaining attributes are considered a
candidate key.
 The candidate keys are as strong as the primary key.
Example:-
• In the EMPLOYEE table, id is best suited for the primary key. The rest of the
attributes, like SSN, Passport_Number, License_Number, etc., are considered a
candidate key.
Candidate key
SUPER KEYS :
• Super key is an attribute set that can uniquely identify a tuple. A super
key is a superset of a candidate key.
• For example: In the EMPLOYEE table, for(EMPLOEE_ID,
EMPLOYEE_NAME), the name of two employees can be the same,
but their EMPLYEE_ID can't be the same. Hence, this combination
can also be a key.
ALTERNATE KEY:-
Alternate Key or Secondary Key is the key that has not been selected to be
the primary key, but are candidate keys.
 However, it is considered a candidate key for the primary key.
For example, employee relation has two attributes, Employee_Id and
PAN_No, that act as candidate keys. In this relation, Employee_Id is
chosen as the primary key, so the other candidate key, PAN_No, acts as
the Alternate key.
COMPOSITE KEY:-
Whenever a primary key consists of more than one attribute, it is known
as a composite key. This key is also known as Concatenated Key.
For example, in employee relations, we assume that an employee may
be assigned multiple roles, and an employee may work on multiple
projects simultaneously. So the primary key will be composed of all three
attributes, namely Emp_ID, Emp_role, and Proj_ID in combination. So
these attributes act as a composite key since the primary key comprises
more than one attribute.
ARTIFICIAL KEY:-
The key created using arbitrarily assigned data are known as artificial keys.
These keys are created when a primary key is large and complex and has no
relationship with many other relations.
The data values of the artificial keys are usually numbered in a serial order.
For example, the primary key, which is composed of Emp_ID, Emp_role,
and Proj_ID, is large in employee relations. So it would be better to add a new
virtual attribute to identify each tuple in the relation uniquely.
 Why are relationships important
in a Database ?
Relationships in a database help create meaningful information. As
a result, database relationships result in:
 Reduced data redundancy : Relationships help reference
information stored in existing tables, reducing repetition.
Better organized database : Relationships help implement
database normalization techniques. Normalization helps yield a
better organized and robust database.
 Referential integrity : As database grow, joins quires and sorting become
expensive. Relationships help reduce the number of transactions and improve
data validity.
RELATIONSHIP:-
DBMS, or Database Management Systems, is the process through which a Database
is managed or controlled.
A database is a collection of data. It may be in the form of tables, columns, charts,
texts, etc.
The way these databases are acted upon gives us , we call Database management
systems or DBMS.
The different steps that are taken to retrieve the data as well as store it, keeping in
mind strict security concerns, is the ideal definition of a DBMS.
CONTINUED:-
The different steps that are taken to retrieve the data as well as store
it, keeping in mind strict security concerns, is the ideal definition of a
DBMS.
A relationship is used to describe the relation between entities.
Diamond or rhombus is used to represent the relationship.
TYPES OF RELATIONSHIPS IN DBMS:-
There are four types of relationships that can be
found in DBMS:-
One to One
One to Many
Many to one
Many to Many
ONE-TO-ONE RELATIONSHIP:-
When only one instance of an entity is associated
with the relationship, then it is known as one-to-
one relationship.
For example, A female can marry to one
male, and a male can marry to one
female.
CONTINUED :-
In a one-to-one relationship, one record in a tables is associated with one and
only one record in another table. For example, in a school database, each
student has only one student ID, and each student ID is assigned to only one
person.
A one-to-one relationship looks like this in the relationships graph.
CONTINUED :-
In this example, the key field in each table, Student ID, is designed to
contain unique values. In the students table, the student ID field is the
Primary key; in the contact info table, the student ID field is a Foreign
key.
This relationship returns related records when the value in the Student
ID field in the Contact Info table is the same as the Student ID field in
the Students table.
ONE-TO-MANY RELATIONSHIP:-
When only one instance of the entity on the left, and more than one instance of an
entity on the right associates with the relationship then this is known as a one-to-
many relationship.
For example, Scientist can invent many inventions, but the invention is done by
the only specific scientist.
CONTINUED :-
To support a one-to-many relationship, we need to design
two tables.
We can then create the one-to-many relationship by storing
the primary key of the table Teacher (i.e., teacherID) (the
"one"-end or the parent table) in the table classes (the
"many"-end or the child table), as illustrated below.
The column teacherID in the child table Classes is known
as the foreign key. A foreign key of a child table is a
primary key of a parent table, used to reference the parent
table.
MANY-TO-ONE RELATIONSHIP:-
When more than one instance of the entity on the left, and only one
instance of an entity on the right associates with the relationship then it
is known as a many-to-one relationship.
For example, Student enrolls for only one course, but a course can have
many students.
In relational databases, many-to-one relationships are often enforced by
foreign key/primary key relationships, and the relationships typically are
between fact and dimension tables and between levels in a hierarchy.
The relationship is often used to describe classifications or groupings.
MANY-TO-MANY RELATIONSHIP:-
When more than one instance of the entity on the left, and more than
one instance of an entity on the right associates with the relationship
then it is known as a many-to-many relationship.
For example, Employee can assign by many projects and project can
have many employees.
CONTINUED :-
In this table where each row represent an item
of a particular order. For orderdetails table the
primary key consists of two columns : orderID
and productID, that uniquely identifies each
row.
The many-to-many relationship is, in fact,
implemented as two one-to-many relationships,
with the introduction of the junction table.
An order has many items in OrderDetails. An
OrderDetails item belongs to one particular
order.
A product may appear in many OrderDetails.
Each OrderDetails item specified one product.
CONTINUED:-
An order has many items in OrderDetails. An OrderDetails item belongs to one
particular order.
A product may appear in many OrderDetails. Each OrderDetails item specified one
product.
CONCLUSION:-
The relationship in a Database Management System (DBMS)
is the most essential part of its functioning. Without proper
relationships, the entire database structure would become
useless. We also need to keep in mind that though it is
essential to create relationships that may look to be complex
at times, it has to be thought after and well-defined for a
favorable outcome.
THANK YOU

More Related Content

What's hot

Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Mudasir Qazi
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to databasePradnya Saval
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database DesignArchit Saxena
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of DatabaseMarlon Jamera
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sqlzahid6
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)Sabana Maharjan
 
Sql joins inner join self join outer joins
Sql joins inner join self join outer joinsSql joins inner join self join outer joins
Sql joins inner join self join outer joinsDeepthi Rachumallu
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database ModelShishir Aryal
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbmsdarshhingu
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model IntroductionNishant Munjal
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptxAnusha sivakumar
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity ConstraintsMegha yadav
 

What's hot (20)

Basic DBMS ppt
Basic DBMS pptBasic DBMS ppt
Basic DBMS ppt
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
Relational Database Design
Relational Database DesignRelational Database Design
Relational Database Design
 
Relational model
Relational modelRelational model
Relational model
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
 
Sql joins inner join self join outer joins
Sql joins inner join self join outer joinsSql joins inner join self join outer joins
Sql joins inner join self join outer joins
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
joins in database
 joins in database joins in database
joins in database
 
The Relational Database Model
The Relational Database ModelThe Relational Database Model
The Relational Database Model
 
Types of keys in dbms
Types of keys in dbmsTypes of keys in dbms
Types of keys in dbms
 
Relational databases
Relational databasesRelational databases
Relational databases
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
database language ppt.pptx
database language ppt.pptxdatabase language ppt.pptx
database language ppt.pptx
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 

Similar to RELATIONSHIP IN DBMS.pptx

Data resource management
Data resource managementData resource management
Data resource managementNirajan Silwal
 
Database Concepts.pptx
Database Concepts.pptxDatabase Concepts.pptx
Database Concepts.pptxDhruvSavaliya9
 
MIS201 SQL database .pdf
MIS201  SQL database .pdfMIS201  SQL database .pdf
MIS201 SQL database .pdfDrSalehAlSaleh
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraintsNikhil Deswal
 
Key,ID Field and Tables Relationship
Key,ID Field and Tables Relationship Key,ID Field and Tables Relationship
Key,ID Field and Tables Relationship ShouaQureshi
 
Design your own database
Design your own databaseDesign your own database
Design your own databaseFrank Katta
 
2.2 keys
2.2 keys2.2 keys
2.2 keysELIMENG
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal waghharshalkwagh999
 
Database and Math Relations
Database and Math RelationsDatabase and Math Relations
Database and Math RelationsProf Ansari
 
3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdffikadumola
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide sharefanta teferi
 
Data Models & Introduction to UML
Data Models & Introduction to UML Data Models & Introduction to UML
Data Models & Introduction to UML نبيله نواز
 

Similar to RELATIONSHIP IN DBMS.pptx (20)

Data resource management
Data resource managementData resource management
Data resource management
 
Database Concepts.pptx
Database Concepts.pptxDatabase Concepts.pptx
Database Concepts.pptx
 
B & c
B & cB & c
B & c
 
DBMS-Unit-2.pptx
DBMS-Unit-2.pptxDBMS-Unit-2.pptx
DBMS-Unit-2.pptx
 
ans_dbms.pdf
ans_dbms.pdfans_dbms.pdf
ans_dbms.pdf
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 
Data processing
Data processingData processing
Data processing
 
MIS201 SQL database .pdf
MIS201  SQL database .pdfMIS201  SQL database .pdf
MIS201 SQL database .pdf
 
Unit 2 DBMS.pptx
Unit 2 DBMS.pptxUnit 2 DBMS.pptx
Unit 2 DBMS.pptx
 
Cardinality and participation constraints
Cardinality and participation constraintsCardinality and participation constraints
Cardinality and participation constraints
 
Key,ID Field and Tables Relationship
Key,ID Field and Tables Relationship Key,ID Field and Tables Relationship
Key,ID Field and Tables Relationship
 
Design your own database
Design your own databaseDesign your own database
Design your own database
 
2.2 keys
2.2 keys2.2 keys
2.2 keys
 
ER Digramms by Harshal wagh
ER Digramms by Harshal waghER Digramms by Harshal wagh
ER Digramms by Harshal wagh
 
Database and Math Relations
Database and Math RelationsDatabase and Math Relations
Database and Math Relations
 
3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdf
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
 
Data Models & Introduction to UML
Data Models & Introduction to UML Data Models & Introduction to UML
Data Models & Introduction to UML
 
Database design
Database designDatabase design
Database design
 

More from KAnurag2

twitter ppt .pptx
twitter ppt                                  .pptxtwitter ppt                                  .pptx
twitter ppt .pptxKAnurag2
 
Module-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.ppt
Module-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.pptModule-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.ppt
Module-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.pptKAnurag2
 
Module III - 1 - Orders of Growth.p df
Module III - 1 - Orders of Growth.p   dfModule III - 1 - Orders of Growth.p   df
Module III - 1 - Orders of Growth.p dfKAnurag2
 
Module-2Deadlock.ppt
Module-2Deadlock.pptModule-2Deadlock.ppt
Module-2Deadlock.pptKAnurag2
 
dsppt-141121224848-conversion-gate01.pptx
dsppt-141121224848-conversion-gate01.pptxdsppt-141121224848-conversion-gate01.pptx
dsppt-141121224848-conversion-gate01.pptxKAnurag2
 
Feasibility Study.pptx
Feasibility Study.pptxFeasibility Study.pptx
Feasibility Study.pptxKAnurag2
 
Law-Of-Supply-_-Elasticity-of-Supply-PPT.ppt
Law-Of-Supply-_-Elasticity-of-Supply-PPT.pptLaw-Of-Supply-_-Elasticity-of-Supply-PPT.ppt
Law-Of-Supply-_-Elasticity-of-Supply-PPT.pptKAnurag2
 
dsa project.pptx
dsa project.pptxdsa project.pptx
dsa project.pptxKAnurag2
 
Transformer.pptx
Transformer.pptxTransformer.pptx
Transformer.pptxKAnurag2
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptxKAnurag2
 
C PROJECT 1.pptx
C PROJECT 1.pptxC PROJECT 1.pptx
C PROJECT 1.pptxKAnurag2
 
PPT - Independent and Dependent.pptx
PPT - Independent and Dependent.pptxPPT - Independent and Dependent.pptx
PPT - Independent and Dependent.pptxKAnurag2
 
MATH PROJECT (3).pptx
MATH PROJECT (3).pptxMATH PROJECT (3).pptx
MATH PROJECT (3).pptxKAnurag2
 
Operting system
Operting systemOperting system
Operting systemKAnurag2
 
DBMS .pptx
DBMS .pptxDBMS .pptx
DBMS .pptxKAnurag2
 
ML PROJECT FINAL[1].pptx
ML PROJECT FINAL[1].pptxML PROJECT FINAL[1].pptx
ML PROJECT FINAL[1].pptxKAnurag2
 
Project 1.pptx
Project 1.pptxProject 1.pptx
Project 1.pptxKAnurag2
 
RLC Circuits^Jpedulum.pptx
RLC Circuits^Jpedulum.pptxRLC Circuits^Jpedulum.pptx
RLC Circuits^Jpedulum.pptxKAnurag2
 
Human-Rights_Basic-Concepts-1.pptx
Human-Rights_Basic-Concepts-1.pptxHuman-Rights_Basic-Concepts-1.pptx
Human-Rights_Basic-Concepts-1.pptxKAnurag2
 
DBMS[1].pptx
DBMS[1].pptxDBMS[1].pptx
DBMS[1].pptxKAnurag2
 

More from KAnurag2 (20)

twitter ppt .pptx
twitter ppt                                  .pptxtwitter ppt                                  .pptx
twitter ppt .pptx
 
Module-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.ppt
Module-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.pptModule-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.ppt
Module-6 process managedf;jsovj;ksdv;sdkvnksdnvldknvlkdfsment.ppt
 
Module III - 1 - Orders of Growth.p df
Module III - 1 - Orders of Growth.p   dfModule III - 1 - Orders of Growth.p   df
Module III - 1 - Orders of Growth.p df
 
Module-2Deadlock.ppt
Module-2Deadlock.pptModule-2Deadlock.ppt
Module-2Deadlock.ppt
 
dsppt-141121224848-conversion-gate01.pptx
dsppt-141121224848-conversion-gate01.pptxdsppt-141121224848-conversion-gate01.pptx
dsppt-141121224848-conversion-gate01.pptx
 
Feasibility Study.pptx
Feasibility Study.pptxFeasibility Study.pptx
Feasibility Study.pptx
 
Law-Of-Supply-_-Elasticity-of-Supply-PPT.ppt
Law-Of-Supply-_-Elasticity-of-Supply-PPT.pptLaw-Of-Supply-_-Elasticity-of-Supply-PPT.ppt
Law-Of-Supply-_-Elasticity-of-Supply-PPT.ppt
 
dsa project.pptx
dsa project.pptxdsa project.pptx
dsa project.pptx
 
Transformer.pptx
Transformer.pptxTransformer.pptx
Transformer.pptx
 
key (1).pptx
key (1).pptxkey (1).pptx
key (1).pptx
 
C PROJECT 1.pptx
C PROJECT 1.pptxC PROJECT 1.pptx
C PROJECT 1.pptx
 
PPT - Independent and Dependent.pptx
PPT - Independent and Dependent.pptxPPT - Independent and Dependent.pptx
PPT - Independent and Dependent.pptx
 
MATH PROJECT (3).pptx
MATH PROJECT (3).pptxMATH PROJECT (3).pptx
MATH PROJECT (3).pptx
 
Operting system
Operting systemOperting system
Operting system
 
DBMS .pptx
DBMS .pptxDBMS .pptx
DBMS .pptx
 
ML PROJECT FINAL[1].pptx
ML PROJECT FINAL[1].pptxML PROJECT FINAL[1].pptx
ML PROJECT FINAL[1].pptx
 
Project 1.pptx
Project 1.pptxProject 1.pptx
Project 1.pptx
 
RLC Circuits^Jpedulum.pptx
RLC Circuits^Jpedulum.pptxRLC Circuits^Jpedulum.pptx
RLC Circuits^Jpedulum.pptx
 
Human-Rights_Basic-Concepts-1.pptx
Human-Rights_Basic-Concepts-1.pptxHuman-Rights_Basic-Concepts-1.pptx
Human-Rights_Basic-Concepts-1.pptx
 
DBMS[1].pptx
DBMS[1].pptxDBMS[1].pptx
DBMS[1].pptx
 

Recently uploaded

Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testspriyanshukumar97908
 
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home MadeDubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Madekojalkojal131
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...gurkirankumar98700
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackSuhani Kapoor
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfjtzach
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girlsshivangimorya083
 
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...Suhani Kapoor
 
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service CuttackVIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service CuttackSuhani Kapoor
 
Gray Gold Clean CV Resume2024tod (1).pdf
Gray Gold Clean CV Resume2024tod (1).pdfGray Gold Clean CV Resume2024tod (1).pdf
Gray Gold Clean CV Resume2024tod (1).pdfpadillaangelina0023
 
Final Completion Certificate of Marketing Management Internship
Final Completion Certificate of Marketing Management InternshipFinal Completion Certificate of Marketing Management Internship
Final Completion Certificate of Marketing Management InternshipSoham Mondal
 
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一Fs
 
Preventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptxPreventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptxGry Tina Tinde
 
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)obuhobo
 
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdfobuhobo
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterHector Del Castillo, CPM, CPMM
 
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...Suhani Kapoor
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsNiya Khan
 
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...shivangimorya083
 
加利福尼亚艺术学院毕业证文凭证书( 咨询 )证书双学位
加利福尼亚艺术学院毕业证文凭证书( 咨询 )证书双学位加利福尼亚艺术学院毕业证文凭证书( 咨询 )证书双学位
加利福尼亚艺术学院毕业证文凭证书( 咨询 )证书双学位obuhobo
 

Recently uploaded (20)

Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and tests
 
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home MadeDubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
 
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdf
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
 
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
 
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service CuttackVIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
 
Gray Gold Clean CV Resume2024tod (1).pdf
Gray Gold Clean CV Resume2024tod (1).pdfGray Gold Clean CV Resume2024tod (1).pdf
Gray Gold Clean CV Resume2024tod (1).pdf
 
Final Completion Certificate of Marketing Management Internship
Final Completion Certificate of Marketing Management InternshipFinal Completion Certificate of Marketing Management Internship
Final Completion Certificate of Marketing Management Internship
 
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
 
Preventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptxPreventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptx
 
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
 
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring Chapter
 
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
 
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
Delhi Call Girls Preet Vihar 9711199171 ☎✔👌✔ Whatsapp Body to body massage wi...
 
加利福尼亚艺术学院毕业证文凭证书( 咨询 )证书双学位
加利福尼亚艺术学院毕业证文凭证书( 咨询 )证书双学位加利福尼亚艺术学院毕业证文凭证书( 咨询 )证书双学位
加利福尼亚艺术学院毕业证文凭证书( 咨询 )证书双学位
 

RELATIONSHIP IN DBMS.pptx

  • 1. RELATIONSHIP IN DBMS  ADARSHA DALABEHERA-220301120183  RUDRA PRASAD BARAL-220301120187  G. SIPRARANI PATRA-220301120188  ABHIPSA SAHOO-220301120189  NYAYABRATA DAS -220301120191
  • 2. CONTENTS:- Introduction How are relationships established ? keys Why are relationships important in a Database ? Relationship Types of relationship Importance of relationship in DBMS Conclusion
  • 3. INTRODUCTION:- A relationship in DBMS is the way in which two or more data sets are linked i.e, any association between two entity types is called a relationship. The main feature of relational database is relationships. Different relationship types control how the data and tables relate to one another. Establishing relationship makes this database type unique, and knowing how relationship works helps broaden database modeling capabilities.
  • 4.  How are relationships established ? The two following elements define how a database relationship is established.  Primary key  Foreign key
  • 5. KEYS :- Keys play an important role in the relational database. It is used to uniquely identify any record or row of data from the table.  It is also used to establish and identify relationships between tables.
  • 6. PRIMARY KEY:- It is the first key used to identify one and only one instance of an entity uniquely. An entity can contain multiple keys, as we saw in the PERSON table. The key which is most suitable from those lists becomes a primary key. In the EMPLOYEE table, ID can be the primary key since it is unique for each employee. In the EMPLOYEE table, we can even select License Number and Passport Number as primary keys since they are also unique. For each entity, the primary key selection is based on requirements and developers.
  • 7. FOREIGN KEY:- When tables relate , the primary key of one table becomes a foreign key of the other table. For the example, in the two tables on the right , employees table as a primary key and in the order as a foreign key . FOREIGN KEY when tables are linked by the primary key, the related field in the second table is known as the foreign key.
  • 8. CANDIDATE KEY:- A candidate key is an attribute or set of attributes that can uniquely identify a tuple(A tuple in DBMS is a collection of attribute values in which no two unique items have the same name.). Except for the primary key, the remaining attributes are considered a candidate key.  The candidate keys are as strong as the primary key.
  • 9. Example:- • In the EMPLOYEE table, id is best suited for the primary key. The rest of the attributes, like SSN, Passport_Number, License_Number, etc., are considered a candidate key. Candidate key
  • 10. SUPER KEYS : • Super key is an attribute set that can uniquely identify a tuple. A super key is a superset of a candidate key. • For example: In the EMPLOYEE table, for(EMPLOEE_ID, EMPLOYEE_NAME), the name of two employees can be the same, but their EMPLYEE_ID can't be the same. Hence, this combination can also be a key.
  • 11. ALTERNATE KEY:- Alternate Key or Secondary Key is the key that has not been selected to be the primary key, but are candidate keys.  However, it is considered a candidate key for the primary key. For example, employee relation has two attributes, Employee_Id and PAN_No, that act as candidate keys. In this relation, Employee_Id is chosen as the primary key, so the other candidate key, PAN_No, acts as the Alternate key.
  • 12. COMPOSITE KEY:- Whenever a primary key consists of more than one attribute, it is known as a composite key. This key is also known as Concatenated Key. For example, in employee relations, we assume that an employee may be assigned multiple roles, and an employee may work on multiple projects simultaneously. So the primary key will be composed of all three attributes, namely Emp_ID, Emp_role, and Proj_ID in combination. So these attributes act as a composite key since the primary key comprises more than one attribute.
  • 13. ARTIFICIAL KEY:- The key created using arbitrarily assigned data are known as artificial keys. These keys are created when a primary key is large and complex and has no relationship with many other relations. The data values of the artificial keys are usually numbered in a serial order. For example, the primary key, which is composed of Emp_ID, Emp_role, and Proj_ID, is large in employee relations. So it would be better to add a new virtual attribute to identify each tuple in the relation uniquely.
  • 14.  Why are relationships important in a Database ? Relationships in a database help create meaningful information. As a result, database relationships result in:  Reduced data redundancy : Relationships help reference information stored in existing tables, reducing repetition. Better organized database : Relationships help implement database normalization techniques. Normalization helps yield a better organized and robust database.  Referential integrity : As database grow, joins quires and sorting become expensive. Relationships help reduce the number of transactions and improve data validity.
  • 15. RELATIONSHIP:- DBMS, or Database Management Systems, is the process through which a Database is managed or controlled. A database is a collection of data. It may be in the form of tables, columns, charts, texts, etc. The way these databases are acted upon gives us , we call Database management systems or DBMS. The different steps that are taken to retrieve the data as well as store it, keeping in mind strict security concerns, is the ideal definition of a DBMS.
  • 16. CONTINUED:- The different steps that are taken to retrieve the data as well as store it, keeping in mind strict security concerns, is the ideal definition of a DBMS. A relationship is used to describe the relation between entities. Diamond or rhombus is used to represent the relationship.
  • 17. TYPES OF RELATIONSHIPS IN DBMS:- There are four types of relationships that can be found in DBMS:- One to One One to Many Many to one Many to Many
  • 18. ONE-TO-ONE RELATIONSHIP:- When only one instance of an entity is associated with the relationship, then it is known as one-to- one relationship. For example, A female can marry to one male, and a male can marry to one female.
  • 19. CONTINUED :- In a one-to-one relationship, one record in a tables is associated with one and only one record in another table. For example, in a school database, each student has only one student ID, and each student ID is assigned to only one person. A one-to-one relationship looks like this in the relationships graph.
  • 20. CONTINUED :- In this example, the key field in each table, Student ID, is designed to contain unique values. In the students table, the student ID field is the Primary key; in the contact info table, the student ID field is a Foreign key. This relationship returns related records when the value in the Student ID field in the Contact Info table is the same as the Student ID field in the Students table.
  • 21. ONE-TO-MANY RELATIONSHIP:- When only one instance of the entity on the left, and more than one instance of an entity on the right associates with the relationship then this is known as a one-to- many relationship. For example, Scientist can invent many inventions, but the invention is done by the only specific scientist.
  • 22. CONTINUED :- To support a one-to-many relationship, we need to design two tables. We can then create the one-to-many relationship by storing the primary key of the table Teacher (i.e., teacherID) (the "one"-end or the parent table) in the table classes (the "many"-end or the child table), as illustrated below. The column teacherID in the child table Classes is known as the foreign key. A foreign key of a child table is a primary key of a parent table, used to reference the parent table.
  • 23. MANY-TO-ONE RELATIONSHIP:- When more than one instance of the entity on the left, and only one instance of an entity on the right associates with the relationship then it is known as a many-to-one relationship. For example, Student enrolls for only one course, but a course can have many students.
  • 24. In relational databases, many-to-one relationships are often enforced by foreign key/primary key relationships, and the relationships typically are between fact and dimension tables and between levels in a hierarchy. The relationship is often used to describe classifications or groupings.
  • 25. MANY-TO-MANY RELATIONSHIP:- When more than one instance of the entity on the left, and more than one instance of an entity on the right associates with the relationship then it is known as a many-to-many relationship. For example, Employee can assign by many projects and project can have many employees.
  • 26. CONTINUED :- In this table where each row represent an item of a particular order. For orderdetails table the primary key consists of two columns : orderID and productID, that uniquely identifies each row. The many-to-many relationship is, in fact, implemented as two one-to-many relationships, with the introduction of the junction table. An order has many items in OrderDetails. An OrderDetails item belongs to one particular order. A product may appear in many OrderDetails. Each OrderDetails item specified one product.
  • 27. CONTINUED:- An order has many items in OrderDetails. An OrderDetails item belongs to one particular order. A product may appear in many OrderDetails. Each OrderDetails item specified one product.
  • 28. CONCLUSION:- The relationship in a Database Management System (DBMS) is the most essential part of its functioning. Without proper relationships, the entire database structure would become useless. We also need to keep in mind that though it is essential to create relationships that may look to be complex at times, it has to be thought after and well-defined for a favorable outcome.