What is integrity and what is constraint??Explain with
example



What is integrity and what is constraint??Explain with example..

Answer / Jagrit Kashyap

Integrity in the context of databases refers to maintaining the consistency, accuracy, and reliability of data. It ensures that the data remains valid and trustworthy throughout its life cycle. Integrity can be enforced through various constraints.

A database constraint is a rule or condition that restricts the possible values that can be stored in one or more columns of a table to ensure data consistency. There are several types of database constraints:
1. Entity Integrity (Primary Key): ensures that each row in a table has a unique value for its primary key column(s). For example, in an Employees table, the employee_id column should have unique values to maintain entity integrity.
2. Domain Integrity (Check Constraint): enforces a specific range or set of allowed values for a column. For example, a salary column might have a domain constraint that only allows positive numbers.
3. Referential Integrity (Foreign Key): ensures the relationships between tables are maintained by linking columns in one table to columns in another. For instance, an Orders table may have a foreign key referencing the customer_id column in the Customers table.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

How can you use check constraints for self referential integrity?

1 Answers  


What is the purpose of a cluster?

1 Answers  


What is hot backup and logical backup?

1 Answers  


Explain about achiever in sql?

1 Answers  


How to create a stored function in oracle?

1 Answers  


What is Hash Index?

1 Answers  


What is a database schema in oracle?

1 Answers  


Display Odd/ Even number of records?

3 Answers  


How to define a sub function?

1 Answers  


What is a database table in oracle?

1 Answers  


Can a field be used in a report without it appearing in any data group ?

4 Answers   Oracle,


What is the difference between count (*), count (expression), count (distinct expression)?

1 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1803)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)