- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain the concept of integrity in DB2 along with types of integrity
Problem: What is INTEGRITY in a DB2? Explain DOMAIN, ENTITY and REFERENTIAL integrity with the help of an example in ORDERS table.
Solution
The integrity refers to the accuracy, consistency and correctness of data present in the DB2 database. Data integrity is imposed during the database design to make sure that data residing in the database remains complete, accurate and reliable.
There are three types of integrity described in below figure.
Domain integrity
It ensures that column data in the DB2 table adhere to the permissible set of values. For example, in the ORDERS table, the domain integrity on the ORDER_DATE column ensures that data in this column is always in DATE format.
Entity integrity
It ensures that each row in a DB2 table is unique. This integrity is achieved using the primary key. For example, the ORDERS DB2 table has a primary key as ORDER_ID, which cannot be duplicated throughout the table.
Referential integrity
It ensures that data integrity is maintained between primary and foreign key. For example, ORDERS DB2 table has a primary key as ORDER_ID and foreign key as TRANSACTION_ID which refers to the TRANSACTIONS DB2 table.
- Related Articles
- What are the types of data integrity?
- Importance of Integrity in Leadership
- Verifying MySQL Package Integrity
- What is Data Integrity?
- Referential Integrity Rule in RDBMS
- Entity Integrity Rule in RDBMS
- Explain the concept of DYNAMIC SQL in DB2 with the help of an example
- Security, Integrity and Authorization in DBMS
- What are integrity constraints over the relation in DBMS?
- What is the difference between data security and data integrity?
- Explain the concept of DBMS schema with examples?
- Give and explain the panel command to display all the components of DB2 database DSNDB01 along with their status?
- SQL Query to Demonstrate Addition Anomaly in Referential Integrity in a Table
- SQL Query to Demonstrate Deletion Anomaly in Referential Integrity in a Table
- SQL Query to Demonstrate Updation Anomaly in Referential Integrity in a Table
