Define referential integrity

Define referential integrity.

Referential integrity in Oracle is used to establish relationships between tables through foreign keys. When one table’s primary key is taken as a “reference” in another table, it is called as a foreign key. This ensures that no record may be added containing the foreign key until a record in the corresponding table exists.

Example:
Below is an example of how a relationship between manager and employee is established in which manager’s id is taken as a foreign key in employees table.
ALTER TABLE employee
         ADD
                   CONSTRAINT ( emp_id_fk )
                   FOREIGN KEY
                   ( manager_id )
                   REFERENCES employee (manager_id);

Define referential integrity.

Referential integrity is the rules that governs the relationships between primary keys and foreign keys of the tables and ensure data consistency. It ensures the value of foreign key be matched by the value of a primary key in another table.
Differences between char and varchar2 data types
The char data type accepts strings that are of fixed length.....
Explain BLOB, CLOB, NCLOB and BFILE
BLOB, CLOB, NCLOB are stored internally where as BFILE is stored externally....
Explain ROWID in oracle
Each table in oracle has a pseudocolumn called ROWID. Oracle uses ROWID to store address of each rows of the table......
Post your comment