The Wayback Machine - https://web.archive.org/web/20240803184029/https://www.geeksforgeeks.org/tuple-in-dbms/
Open In App

Tuple in DBMS

Last Updated : 21 Mar, 2023
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report

Pre-requisites: Introduction of DBMS

A tuple, also known as a record or row, is a basic unit of data in a relational database management system (DBMS). A tuple represents a single instance of a relation, or table, in the database. Each tuple contains a set of values, or attributes, that correspond to the columns, or fields, of the relation. 

E.F. Codd invented the Relational Database Management System where he defined relationships as a collection of unique tuples. The relational model uses unique keys to organize data into at least one table of rows and columns. These rows can be depicted as Tables.

A tuple in a database management system is one record in the context of relational databases (one row). You can compare the data present in the database with a spreadsheet, with rows (known as tuples) and columns (known as fields or attributes) representing various data types. 

In DBMS, a unique key is assigned to each table that is used to organize and identify the elements. This key is known as the table’s primary key and is unique for each record present. In DBMS, the user can add a column containing the value from another table’s column. This enables the user to link the tuple of different tables.

The rows in the tables represent the records in the database, and the columns represent the attributes associated with the entity.

Working with Tuple in DBMS

In a relational database, a relation is defined by a set of attributes and a set of tuples that have values for those attributes.

Example:

A relation called “CUSTOMER” might have attributes such as “customer_id”, “first_name”, “last_name”, and “email”. Each tuple in the relationship would have a unique value for the “customer_id” attribute and corresponding values for the other attributes, such as “John” for “first_name” and “Smith” for “last_name”.

CUSTOMER Table

customer_id

first_name

last_name

email

1

John

Smith

abc@gmail.com

2

Abhishek

Bhosle

cde@gmail.com

3

Natasha

Witch

fgh@gmail.com

Tuples are also used in the process of normalization in a relational database. Normalization is the process of organizing data in a database to minimize data redundancy and improve data integrity. In the process of normalization, a relation is broken down into multiple smaller relations, each with a specific purpose and containing a specific set of attributes and tuples.

Example

In an un-normalized relation, an “ORDER” relation may include attributes such as “order_id”, “customer_id”, “product_id”, and “quantity”. In the process of normalization, the relation may be broken down into two separate relations, one called “orders” containing attributes such as “order_id” and “customer_id”, and another called “order_details” containing attributes such as “product_id” and “quantity”.

ORDER Table

order_id customer_id product_id quantity
A 1 AAA1 5
B 2 BBB1 6
C 3 CCC1 7

Tuples are also used in the process of querying a relational database. Queries are used to retrieve specific data from the database, and the result of a query is a set of tuples that match the criteria specified in the query. For example, a query to retrieve the first and last names of customers with a specific email address would return a set of tuples with those attributes for each customer that matches the criteria.

Types of Tuples

There are two types of tuples in a database management system:

  • Physical Tuples: Physical Tuples are the actual data stored in the storage media of a database. It is also known as a record or row.
  • Logical Tuples: Logical Tuples are the data representation in memory, where data is temporarily stored before being written to disk or during a query operation.

Both physical and logical tuples have the same attributes, but their representation and usage can differ based on the context of the operation.

Conclusion

In conclusion, a tuple is a basic unit of data in a relational database management system. It represents a single instance of a relation and contains a set of values that correspond to the attributes of that relation. Tuples are used in the process of normalization, as well as querying a relational database, to retrieve specific data. They play a vital role in organizing and structuring data in a database, improving data integrity, and making data retrieval easy.

FAQs

1. What are the Attributes of DBMS?

In Database Management System, Attributes are the properties or characteristics reflected by each entity of the entity set. 

For more, refer to the article: https://www.geeksforgeeks.org/types-of-attributes-in-er-model/ 

2. Can we have duplicates in Tuples?

Yes, Tuples allows duplicate members. Duplicate elements are not allowed in Primary Keys. 

3. How can you uniquely identify a tuple in the relation?

You can easily identify a tuple in relation with the help of Primary Key.



Similar Reads

Tuple Relational Calculus (TRC) in DBMS
Tuple Relational Calculus (TRC) is a non-procedural query language used in relational database management systems (RDBMS) to retrieve data from tables. TRC is based on the concept of tuples, which are ordered sets of attribute values that represent a single row or record in a database table. TRC is a declarative language, meaning that it specifies
4 min read
Tuple Type in Cassandra
In this article we will discuss Tuple Data Type which is supported by Cassandra Query Language in which we can easily defined data as per need. It is an alternative to a User Defined Data Type. A tuple data type is useful when we need to accommodate many fields we can accommodate maximum 32768 fields. let's understand tuple data type with an exampl
2 min read
Difference between Tuple Relational Calculus (TRC) and Domain Relational Calculus (DRC)
1. Tuple Relational Calculus (TRC) : A tuple relational calculus is a non-procedural query language that specifies to select of the tuples in a relation. It can select the tuples with a range of values or tuples for certain attribute values etc. The resulting relation can have one or more tuples. Notation : {T | P (T)} or {T | Condition (T)} where
3 min read
What is NULL ? Give an example to illustrate testing for NULL in SQL. What is dangling tuple problem ?
What is NULL ?In Structured Query Language Null Or NULL is a special type of marker which is used to tell us about that a data value does not present in the database. In Structured Query Language (SQL) Null is a predefined word which is used to identity this marker. It is very important to understand that a NULL value is totally different than a ze
3 min read
Need for DBMS
A Data Base Management System is a system software for easy, efficient and reliable data processing and management. It can be used for: Creation of a database.Retrieval of information from the database.Updating the database.Managing a database.Multiple User InterfaceData scalability, expandability and flexibility: We can change schema of the databa
4 min read
Introduction of Relational Model and Codd Rules in DBMS
Pre-Requisite: Relational Model in DBMS It was proposed by Dr. E.F. Codd. It uses the concept of relations to represent each and every file. Relations are Two-Dimensional Tables. It is easy to implement and easy to simplification in the operations to manipulate the data. This is the most popular data model. It is simple to implement. It uses the pr
12 min read
Thomas Write Rule in DBMS
The "write rule" in database management systems (DBMS) refers to a principle that governs how changes to the database are handled. Specifically, the write rule states that any modification to a database must be written to disk before control is returned to the user. In other words, when a user executes a command that modifies the database (such as
5 min read
Armstrong's Axioms in Functional Dependency in DBMS
Prerequisite - Functional Dependencies This article contains Armstrong's Axioms and how Armstrong's Axioms are used to decide about the functional dependency on the database. We will be also learning about the Secondary Rules and Armstrong Relations. We will learn each thing in detail. Before moving ahead, you must have a knowledge of Functional De
4 min read
Transaction Isolation Levels in DBMS
Prerequisite - Concurrency control in DBMS, ACID Properties in DBMS As we know, in order to maintain consistency in a database, it follows ACID properties. Among these four properties (Atomicity, Consistency, Isolation, and Durability) Isolation determines how transaction integrity is visible to other users and systems. It means that a transaction
5 min read
Database Objects in DBMS
A database object is any defined object in a database that is used to store or reference data.Anything which we make from create command is known as Database Object.It can be used to hold and manipulate the data.Some of the examples of database objects are : view, sequence, indexes, etc. Table - Basic unit of storage; composed rows and columns View
4 min read
Article Tags :
three90RightbarBannerImg