Que-What is the use of CASCADE CONSTRAINTS?
Ans-When this clause is used with the DROP command, a parent table can be dropped even when a child table exists.
Example
create table primary1(roll int primary key,name varchar)
insert into primary1 values(1,'A')
insert into primary1 values(2,'B')
select * from primary1
create table foreign1(roll1 int references primary1(roll),address varchar(10))
insert into foreign1 values(1,'Delhi')
insert into foreign1 values(2,'Fbd')
select * from foreign1
If i write DROP TABLE PRIMARY1,table cannot be dropped.Its right.
If i write drop table primary1 CASCADE, it means that primary1 table can be deleted even if it referenced by foreign1............If i m not wrong.......
But the primary1 table is not deleting when i write drop table primary1 CASCADE,
ERROR is coming Incorrect syntax near the keyword 'CASCADE'.
Your Prompt Reply will be appreciated.