Oracle integrity constraints | Integrity Constraint - oracle tutorial - sql tutorial
What is Oracle Integrity Constraints ?
- Integrity Constraints are used to prevent entry of invalid information into tables.
oracle tutorial , sql tutorial , sql , pl sql tutorial , oracle , pl sql , plsql
There are five Integrity Constraints Available in Oracle. They are :
- Integrity Constraints are used to prevent entry of invalid information into tables.
- Not Null
- Primary Key
- Foreign Key
- Check
- Unique
Not Null:
- A column in a table can be specified not null.
- It's not possible to insert a null in such a column.
- The default is null.
Primary Key:
- Primary Key Constraint defines a column or combination of columns which uniquely identifies each row in the table.
- After creating a primary key, it can be referenced by a foreign key
Foreign Key:
- This constraint identifies any column referencing the PRIMARY KEY in another table.
- It establishes a relationship between two columns in the same table or between different tables.
- One or more columns can be defined as Foreign key.
Unique Key:
- Unique Key Constraint ensures that a column or a group of columns in each row have a distinct value.
- A column(s) can have a null value but the values cannot be duplicated
Check Key:
- Check Key Constraint defines a business rule on a column.
- All the rows must satisfy this rule.
- The constraint can be applied for a single column or a group of columns.