keys_pk_fk_constraints
You may throw a ball who will umpire your input. A foreign key constraint from a distant table, will raise a flag for invalid data entry.

 
Let us look at this two tables.

 

A primary key can hold the bal in court.

Table: dept

Type of constraints:

Table "emp" under foreign constraints

Constrints

table joblist.

Constraints on the table joblist


 

Consider this new insert

insert into emp values (7934,'Mathew','clerk',7789,'23-jan-87',1300,null,150);

 

 
Data Type Flaws : Numeric over flow at dept no constraint:

Error Numeric Overflow: The dept no should be two digits " less than 10^2. "

ERROR: numeric field overflow
DETAIL: A field with precision 2, scale 0 must round to an absolute value less than 10^2.

********** Error **********

ERROR: numeric field overflow
SQL state: 22003
Detail: A field with precision 2, scale 0 must round to an absolute value less than 10^2.
 

Primary Key violation: 1st configuration constraint check, note deptno= 50 does not exists; debugging one error at a time.

Query Script:

insert into emp values
(7934,'Mathew','clerk',7902,'1987-10-28 00:00:00',1300,null,50);

Foreign Key Constraints: Restricting bad data input in a relational database system.

Query Script:

insert into emp values
(7936,'Mathew','clerk',7902,'1987-10-28 00:00:00',1300,null,50);

Correct Data Input:

Query Script:

insert into emp values
(7936,'Mathew','clerk',7902,'1987-10-28 00:00:00',1300,null,20);

Final Review: Row 15 was added.