In DBMS, the relational model refers to an abstract model that we use to manage and organise the data that gets stored in a database. Thus, it stores information in inter-related two-dimensional tables, also called relations, in which every row represents some entity while every column represents the entity’s properties.
In this article, we will take a look at the Relational Model in DBMS according to the GATE Syllabus for CSE (Computer Science Engineering). Read ahead to learn more.
Table of Contents
- What is a Relational Model in DBMS?
- Properties of a Relational Model
- Illustration of the Relational Model
- Important Terminologies
- Constraints in Relational Model
- Practice Questions on Relational Model in DBMS
- FAQs
What is a Relational Model in DBMS?
The relational model represents DB in the form of a collection of various relations. This relation refers to a table of various values. And every row present in the table happens to denote some real-world entities or relationships. The names of tables and columns help us interpret the meaning of the values present in every row of the table. This data gets represented in the form of a set of various relations. Thus, in the relational model, basically, this data is stored in the form of tables. However, this data’s physical storage is independent of its logical organisation.
Popular Relational Database Management Systems:
- IBM – DB2 and Informix Dynamic Server
- Oracle – Oracle and RDB
- Microsoft – SQL Server and Access
Properties of a Relational Model
The relational databases consist of the following properties:
- Every row is unique
- All of the values present in a column hold the same data type
- Values are atomic
- The columns sequence is not significant
- The rows sequence is not significant
- The name of every column is unique
Illustration of the Relational Model
A relational model represents how we can store data in Relational Databases. Here, a relational database stores information in the form of relations or tables.
Now, let us consider a relation EMPLOYEE with attributes ID_NO, NAME, ADDRESS, ROLL_NO, and AGE shown in this table:
EMPLOYEE
ID_NO | NAME | ADDRESS | ROLL_NO | AGE |
C1 | RIYA | DELHI | 15 | 20 |
C2 | SUNITA | GURGAON | 16 | 22 |
C3 | ASHWANI | ROHTAK | 12 | 18 |
C4 | PREETI | DELHI | 25 |
Important Terminologies
Here are some Relational Model concepts in DBMS:
- Attribute: It refers to every column present in a table. The attributes refer to the properties that help us define a relation. E.g., Employee_ID, Student_Rollno, SECTION, NAME, etc.
- Tuple – It is a single row of a table that consists of a single record. The relation above consists of four tuples, one of which is like:
C1 | RIYA | DELHI | 15 | 20 |
- Tables – In the case of the relational model, all relations are saved in the table format, and it is stored along with the entities. A table consists of two properties: columns and rows. While rows represent records, the columns represent attributes.
- Degree: It refers to the total number of attributes that are there in the relation. The EMPLOYEE relation defined here has degree 5.
- Relation Schema: It represents the relation’s name along with its attributes. E.g., EMPLOYEE (ID_NO, NAME, ADDRESS, ROLL_NO, AGE) is the relation schema for EMPLOYEE. If a schema has more than 1 relation, then it is known as Relational Schema.
- Column: It represents the set of values for a certain attribute. The column ID_NO is extracted from the relation EMPLOYEE.
- Cardinality: It refers to the total number of rows present in the given table. The EMPLOYEE relation defined here has cardinality 4.
- Relation instance – It refers to a finite set of tuples present in the RDBMS system. A relation instance never has duplicate tuples.
- Attribute domain – Every attribute has some predefined value and scope, which is known as the attribute domain.
- Relation key – Each and every row consists of a single or multiple attributes. It is known as a relation key.
- NULL Values: The value that is NOT known or the value that is unavailable is known as a NULL value. This null value is represented by the blank spaces. E.g., the MOBILE of the EMPLOYEE having ID_NO 4 is NULL.
Constraints in Relational Model
While we design a Relational Model, we have to define some conditions that must hold for the data present in a database. These are known as constraints. One has to check these constraints before performing any operation (like insertion, updating and deletion) in the database. If there occurs any kind of a violation in any of the constraints, the operation will ultimately fail.
Domain Constraints
The domain constraints are like attribute level constraints. Now an attribute is only capable of taking values that lie inside the domain range. For example, if a constraint ID_NO>0 is applied on the EMPLOYEE relation, inserting some negative value of ID_NO will result in failure.
Key Integrity
Each and every relation present in the database should have at least one set of attributes that uniquely defines a tuple. Those sets of attributes are known as keys. For example, ID_NO in EMPLOYEE is a key. Now, remember that no two students would be capable of having the very same ID number. Thus, a key primarily consists of these two properties:
- It has to be unique for all the available tuples.
- It can not consist of any NULL values.
Referential Integrity
Whenever one of the attributes of a relation is capable of only taking values from another attribute of the same relation or other relations, it is termed referential integrity.
Now, let us have the following two relations:
LEARNER
ID_NO | NAME | ADDRESS | ROLL_NO | AGE | CODE_OF_BRANCH |
C1 | RIYA | DELHI | 15 | 20 | CS |
C2 | SUNITA | GURGAON | 16 | 22 | CS |
C3 | ASHWANI | ROHTAK | 12 | 18 | ECE |
C4 | PREETI | DELHI | 18 | 25 | IT |
SUBJECT
SUBJECT_NAME | SUBJECT_CODE |
COMPUTER SCIENCE | CS |
INFORMATION TECHNOLOGY | IT |
ELECTRONICS AND COMMUNICATION ENGINEERING | ECE |
CIVIL ENGINEERING | CV |
The SUBJECT_CODE of LEARNER can only take the values that are present in the SUBJECT_CODE of SUBJECT, which is known as referential integrity constraint. Thus, the relation that is referencing to the other relation is known as REFERENCING RELATION (LEARNER in this case), while that relation to which the other relations refer is known as REFERENCED RELATION (SUBJECT in this case).
Practice Questions on Relational Model in DBMS
1. The attribute in a relation is a __________.
A. Tuple
B. Value
C. Column
D. Row
Answer: C. Column
2. A table in mathematical terms is known as__________.
A. Domain
B. Tuple
C. Attribute
D. Relation
Answer: D. Relation
3. The minimal set of the super keys is known as __________.
A. Foreign key
B. Candidate key
C. Secondary key
D. Primary key
Answer: B. Candidate key
FAQs
What is relational model DBMS?
In DBMS, the relational model refers to an abstract model that we use to manage and organise the data that gets stored in a database. Thus, it stores information in inter-related two-dimensional tables, also called relations, in which every row represents some entity while every column represents the entity’s properties.
What are the 4 types of database models in DBMS?
Here are the Database Models present in DBMS:
- Network Model
- Hierarchical Model
- Relational Model
- Entity-relationship Model
What are the properties of a relational model?
The relational databases consist of the following properties:
- Every row is unique
- All of the values present in a column hold the same data type
- Values are atomic
- The columns sequence is not significant
- The rows sequence is not significant
- The name of every column is unique
What is referred to as a ‘relation’ in a relation model?
An RM (Relational Model) represents the database in the form of a collection of various relations. Thus, a relation is basically a table of values. All the rows present in the table represent a collection of the various related data values. Thus, these rows present in the table happen to denote a real-world entity/relationship.
Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Syllabus for CSE (Computer Science Engineering), GATE CSE Notes, GATE CSE Question Paper, and more.
Also Explore,
Comments