Oracle SQL in 10 Minutes - Asim Abbasi
CH1: SQL Basics | CH2: SQL Operators | CH3: SQL Built-in Functions | CH4: SQL Joins | CH5: UPDATE, INSERT & DELETE Statements | CH6: CREATE, ALTER & DROP Statements | CH7: Constraints | CH8: Linking Tables vs Joining Tables | CH9: SQL Statements for Other Database Objects | CH10: SQL Statements for Database Security
Chapter 7: Constraints
• If someone tries to Update/Insert a value in the FOREIGN KEY
constraint column of child table and there is no such value in the
parent table PRIMARY KEY column, this task will result again in
Referential Integrity constraint violation error.
Developing a PRIMARY KEY and FOREIGN KEY relationship between two or more tables has one another name, its called “Referential Integrity (RI) constraint”. So instead of saying that you have developed and implemted PRIMARY/FOREIGN KEY relationship between dept_test and emp_test tables, you can say that you have implemented RI constraint between dept_test and emp_test.

Figure 16: Two beauties of Oracle: Data Integrity &
Data Consistency.
________________________________________
Whenever you come across “Data Integrity” just say in your mind that the author or speaker is referring to all different sorts of constraints. Being a DBA, it will be one of your jobs to take all possible steps for having data integrity in the database because if it is an enterprise wide system, users from all over the world may be interacting with the system. For any given instance some request would be coming to Oracle instance to insert new records others would be to update certain records and just think for a moment if would not be having all these different kinds of constraints, then there would be lots of redundancy of information, lots of errors etc. Its like filling a form online and you are allowed to enter date of birth in the zip code field.
In short all these constrains available in Oracle
helps attaining maximum data integrity.
Another term that is used widely in all sorts of RDBMS (Relational
Database Management Systems) not only just Oracle is “Data Consistency”.
It means that everyone connected to Oracle Instance will see the
consistent view of information. Oracle has very beautiful built-in
locking mechanism. Above all Oracle takes care of this by default
magnificently but if you want you can configure and override the default
configuration. Transactional changes will only made visible to everyone
once committed by executing the COMMIT command.
Chapter 7: Constraints
CH1: SQL Basics | CH2:
SQL Operators |
CH3: SQL Built-in Functions | CH4:
SQL Joins | CH5:
UPDATE, INSERT & DELETE Statements |
CH6: CREATE, ALTER & DROP Statements | CH7:
Constraints | CH8:
Linking Tables vs Joining Tables | CH9:
SQL
Statements for Other Database Objects | CH10:
SQL Statements for
Database Security Share with others: