Quantcast
Viewing all articles
Browse latest Browse all 60

SQL - referential integrity - Foreign key and Check constraint

Please let me know if below two declarations are same.

create table R1( a INT PRIMARY KEY,   b INT references K(w));

Note: K is a table with single attribute w as primary key

create table R1( a INT PRIMARY KEY,   b INT CHECK (b in (SELECT w FROM K));

Viewing all articles
Browse latest Browse all 60

Trending Articles