EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials DBMS Tutorial Relationship in DBMS
Secondary Sidebar
DBMS Tutorial
  • DBMS
    • What is DBMS?
    • Introduction To DBMS
    • DBMS ER Diagram
    • DBMS_RANDOM
    • DBMS_XPLAN
    • DBMS join
    • DBMS Functions
    • Data Administrator in DBMS
    • Checkpoint in DBMS
    • DBMS Table
    • Mapping Constraints in DBMS
    • DBMS Canonical Cover
    • DBMS Log-Based Recovery
    • DBMS Multivalued Dependency
    • View Serializability in DBMS
    • DBMS Concepts
    • DBMS Constraints
    • DBMS_Scheduler
    • B+ Tree in DBMS
    • DBMS_LOB
    • dbms entity
    • DBMS Foreign Key
    • DBMS Users
    • DBMS_Metadata.get_ddl
    • Relational Algebra in DBMS
    • DBMS Components
    • DBMS Features
    • DBMS Models
    • DBMS Relational Model
    • Hashing in DBMS
    • DBMS network model
    • Relationship in DBMS
    • ER Model in DBMS
    • Data Models in DBMS
    • Static Hashing in DBMS
    • Advantages of DBMS
    • dbms_output.put_line
    • DBMS Data Dictionary
    • dbms_xplan.display_cursor
    • Normal Forms in DBMS
    • DBMS helps achieve
    • DBMS 3 tier Architecture
    • Relational Calculus in DBMS
    • Serializability in DBMS
    • File Organization in DBMS
    • DBMS Transaction Processing
    • States of Transaction in DBMS
    • Functional Dependency in DBMS
    • Generalization in DBMS
    • Data Independence in DBMS
    • Lock Based Protocols in DBMS
    • Deadlock in DBMS
    • Integrity Constraints in DBMS
    • Concurrency Control in DBMS
    • Validation Based Protocol in DBMS
    • DBMS Locks
    • Normalization in DBMS
    • Transaction Property in DBMS
    • Specialization in DBMS
    • Aggregation in DBMS
    • Types of DBMS

Relationship in DBMS

By Priya PedamkarPriya Pedamkar

Relationship in DBMS

Introduction to Relationship in DBMS

DBMS, or Database Management Systems, is the process through which a Database is managed or controlled.

The correct explanation would require a bit more depth. Let’s start with what exactly is a database. A database is a collection of data. It may be in the form of tables, columns, charts, texts, etc. Now, there can be many such databases piled together to form a single database. The manner in which these databases are acted upon gives us, what we call Database management systems or DBMS. A database may have data of all forms, as suggested previously. 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. Database Management Systems come in myriad forms. However, for this article, our focus is on the different Relationship in DBMS

A basic Entity Relationship Diagram

A basic Entity Relationship Diagram

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

What are Relationships?

A relationship in a DBMS is primarily the way two or more data sets are linked. This is so true for Relational Database Management Systems. One dataset may be then termed as the Foreign key and the ones linked to it may be termed the Primary Key. There may be multiple Foreign and Primary keys linked to each other.

Relationships allow the datasets to share and store the data in separate tables. They also help link disparate data with each other.

Relationships are of three types and the next segment talks about the same.

Types of Relationships in DBMS

There are three types of relationships that can be found in DBMS:

  • One to One
  • One to Many
  • Many to Many

Let us see what each one of them entails.

All in One Data Science Bundle(360+ Courses, 50+ projects)
Python TutorialMachine LearningAWSArtificial Intelligence
TableauR ProgrammingPowerBIDeep Learning
Price
View Courses
360+ Online Courses | 50+ projects | 1500+ Hours | Verifiable Certificates | Lifetime Access
4.7 (86,584 ratings)

1. One to One

This relationship tells us that a single record in Table A is related to a single record in Table B. And vice versa. Now, the moot question that may arise here is, why not move both data into a single table? There may be many reasons for it. One primary reason usually is security.

Let us look into an example: We have to create a table where details of our name, age, email, address, telephone number, and password need to be stored. Now, all of this is sensitive information and we would not want to have them bundled together in a single table. Hence, to create greater security around it, we create a separate table for the password with different access control, so that only a select few will have access to it.

2. One to Many

This type of relationship in a Database Management System (DBMS) is the most common type of relationship. This entails one data in Table A to have links to multiple data in Table B. However, a single data in Table B, will have link to a single data in Table A. One good example to showcase such a relationship is through a bank account. One individual may have multiple bank accounts, but each bank account will be linked to one specific owner or account holder only (provided we are not talking about a joint bank account)

3. Many to Many

Consider two tables A and B. Each data in Table A is linked to all the data in Table B and vice versa. A great example would be linking a student table to the courses table. Table A has the name of all the students while Table B has the name of all the courses. A particular student may enroll oneself in more than one course whilst a course may have more than one student. Hence, it becomes a many-to-many relationship.

Now, the market is replete with Database management systems like MySql, Microsoft Access, SQL Server, and Oracle. Because of the glut of so many of them, it becomes imperative that they have to be in communication with each other. Hence, most Database Management Systems come in with something called an Open Database Connectivity (ODBC) driver. What this does is allows a particular database to integrate with the other database and sync the flow of information. A good example would be the SQL statements: SELECT which queries to select the said data and INSERT which queries to push the selected data into a particular table.

What is the importance of Relationships in DBMS

  • A relationship in DBMS is an integral cog in the wheel. It helps to streamline the entire workflow, through the database can provide a relevant output. Let us look at some of the advantages of having relationships in a Database Management System (DBMS).
  • The redundancy of data is minimized because of relationships. While creating relationships, finer changes will be made to the table structure. Hence, as and when more data is added, a level of perfection will be achieved. This leads to a final table structure that is near perfect and devoid of irrelevant information.
  • Relationships also help in establishing a smooth workflow. Many times there will be queries that will force the command to pull data from disparate tables. In the absence of a relationship, such a venture will fail and the query will return a null.
  • A well-defined relationship adds more integrity to the table structure and makes the Database Management System more efficient. This leads to better decision-making. Another advantage that comes to mind is the flexibility it provides to users while querying for data. Complex queries are easily pulled off. The more maturity the database undergoes, the greater is the probability of perfection. Collaboration also becomes easy amongst multiple users.

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.

Recommended Articles

This is a guide to Relationships in DBMS. Here we discuss the introduction to Relationships in DBMS, with flowchart, types with explanation, and importance. You can also go through our other related articles to learn more –

  1. Normal Forms in DBMS
  2. Aggregation in DBMS
  3. Specialization in DBMS
  4. Generalization in DBMS
Popular Course in this category
SQL Training Program (7 Courses, 8+ Projects)
  7 Online Courses |  8 Hands-on Projects |  73+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

SPSS, Data visualization with Python, Matplotlib Library, Seaborn Package

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more