A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/dbms/relational-model-in-dbms/ below:

Relational Model in DBMS - GeeksforGeeks

Relational Model in DBMS

Last Updated : 23 Jul, 2025

The Relational Model organizes data using tables (relations) consisting of rows and columns.

Example: Consider a relation STUDENT with attributes ROLL_NO, NAME, ADDRESS, PHONE and AGE shown in the table. 

Relational Model Key Terms in the Relational Model
  1. Attribute: Attributes are the properties that define an entity. For example, ROLL_NO, NAME, ADDRESS etc.
  2. Relation Schema: A relation schema defines the structure of the relation and represents the name of the relation with its attributes. For example, STUDENT (ROLL_NO, NAME, ADDRESS, PHONE and AGE) is the relation schema for STUDENT. If a schema has more than 1 relation it is called Relational Schema.
  3. Tuple: A Tuple represents a row in a relation. Each tuple contains a set of attribute values that describe a particular entity. For example, (1, RAM, DELHI, 9455123451, 18) is a tuple in the STUDENT table.
  4. Relation Instance: The set of tuples of a relation at a particular instance of time is called a relation instance. It can change whenever there is an insertion, deletion or update in the database.
  5. Degree: The number of attributes in the relation is known as the degree of the relation. For example, The STUDENT relation has a degree of 5, as it has 5 attributes.
  6. Cardinality: The number of tuples in a relation is known as cardinality. For example, The STUDENT relation defined above has cardinality 4.
  7. NULL Values: The value which is not known or unavailable is called a NULL value. It is represented by NULL. For example, PHONE of STUDENT having ROLL_NO 4 is NULL. 
Types of Keys in the Relational Model
  1. Primary Key: A Primary Key uniquely identifies each tuple in a relation. It must contain unique values and cannot have NULL values.
  2. Candidate Key: A Candidate Key is a set of attributes that can uniquely identify a tuple in a relation.
  3. Super Key: A Super Key is a set of attributes that can uniquely identify a tuple.
  4. Foreign Key: A Foreign Key is an attribute in one relation that refers to the primary key of another relation.
  5. Composite Key: A Composite Key is formed by combining two or more attributes to uniquely identify a tuple.
Relational Model Notation Characteristics of the Relational Model Constraints in Relational Model

While designing the Relational Model, we define some conditions which must hold for data present in the database are called Constraints. These constraints are checked before performing any operation (insertion, deletion and updation) in the database. If there is a violation of any of the constraints, the operation will fail.

1. Domain Constraints

Domain Constraints ensure that the value of each attribute A in a tuple must be an atomic value derived from its specified domain, dom(A). Domains are defined by the data types associated with the attributes. Common data types include:

2. Key Integrity

Every relation in the database should have at least one set of attributes that defines a tuple uniquely. Those set of attributes is called keys. e.g.; ROLL_NO in STUDENT is key. No two students can have the same roll number. So a key has two properties: 

3. Referential Integrity Constraints

When one attribute of a relation can only take values from another attribute of the same relation or any other relation, it is called referential integrity. Let us suppose we have 2 relations 

Table: STUDENT

ROLL_NO NAME ADDRESS PHONE AGE BRANCH_CODE 1 RAM DELHI 9455123451 18 CS 2 RAMESH GURGAON 9652431543 18 CS 3 SUJIT ROHTAK 9156253131 20 ECE 4 SURESH DELHI   18 IT

Table: BRANCH

BRANCH_CODE BRANCH_NAME CS COMPUTER SCIENCE IT INFORMATION TECHNOLOGY ECE ELECTRONICS AND COMMUNICATION ENGINEERING CV CIVIL ENGINEERING

Explanation: BRANCH_CODE of STUDENT can only take the values which are present in BRANCH_CODE of BRANCH which is called referential integrity constraint. The relation which is referencing another relation is called REFERENCING RELATION (STUDENT in this case) and the relation to which other relations refer is called REFERENCED RELATION (BRANCH in this case). 

Anomalies in the Relational Model

An anomaly is an irregularity or something which deviates from the expected or normal state. When designing databases, we identify three types of anomalies: Insert, Update, and Delete.

Codd Rules in Relational Model

E.F. Codd, the creator of the relational model, proposed 12 rules (known as Codd’s 12 Rules) that define what constitutes a relational database system. These rules emphasize the importance of data independence, consistency and structure.

Key Codd’s Rules Advantages of the Relational Model Disadvantages of the Relational Model

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4