Tuple/Record in DBMS

Tuple/Record in DBMS

On this page, we will discuss about the Tuples and Records in DBMS.
TupleRecord in DBMS

TUPLE IN DBMS

  • Generally, the database table is  viewed  as a collection of tuples.
  • The term tuple  is often also called row and record in a database table.

Each tuple represents complete information of the specific data item, each tuple stores different data with the same structure.

Example : For example in an employee table, we need to store the details of 10 employees then the database table will consist of 10 tuples every each tuple contains details of that particular employee i.e 1 tuple for storing the information of one employee

Consider a sample table ‘emp’ 

ENAMEJOBSALHIREDATEHIREDATE+2
KINGPRESIDENT500017-NOV-8119-NOV-81
BLAKEMANAGER285001-MAY-8103-MAY-81
CLARKMANAGER245009-JUN-8111-JUN-81
JONESMANAGER297502-APR-8104-APR-81
SCOTTANALYST300019-APR-8721-APR-87
FORDANALYST300003-DEC-8105-DEC-81
SMITHCLERK80017-DEC-8019-DEC-80

Table contents seven rows i.e it stores the details of all the 7 employees in 7 separate tuples

SQL Query to retrieve particular tuples  

SELECT * FROM EMP
WHERE DEPTNO=20;
Output:
4 rows selected.
EMPNOENAMEJOBMGRHIREDATESALCOMMDEPTNO
7566JONESMANAGER783902-APR-81297520
7788SCOTTANALYST756619-APR-87300020
7902FORDANALYST756603-DEC-81300020
7369SMITHCLERK790217-DEC-8080050020

Only those tuples corresponding to the details of Department number 20 are displayed.

Tuple img

RECORD IN DBMS

Each record represents complete information of the specific data item, each record stores different data with the same structure

Example : For example in an employee table, we need to store the details of 10 employees then the database table will consist of 10 records every each record contains details of that particular employee i.e 1 record for storing the information of one employee

Consider a sample table ‘emp’ 

ENAMEJOBSALHIREDATEHIREDATE+2
KINGPRESIDENT500017-NOV-8119-NOV-81
BLAKEMANAGER285001-MAY-8103-MAY-81
CLARKMANAGER245009-JUN-8111-JUN-81
JONESMANAGER297502-APR-8104-APR-81
SCOTTANALYST300019-APR-8721-APR-87
FORDANALYST300003-DEC-8105-DEC-81
SMITHCLERK80017-DEC-8019-DEC-80

Table contents seven rows i.e it stores the details of all the 7 employees in 7 separate records

SQL Query to retrieve particular records  

SELECT * FROM EMP
WHERE DEPTNO=20;
Output:
4 rows selected.
EMPNOENAMEJOBMGRHIREDATESALCOMMDEPTNO
7566JONESMANAGER783902-APR-81297520
7788SCOTTANALYST756619-APR-87300020
7902FORDANALYST756603-DEC-81300020
7369SMITHCLERK790217-DEC-8080050020

Only those records corresponding to the details of Department number 20 are displayed.

record img

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription