Skip to main content

Posts

Showing posts from July, 2015

FOREIGN KEY WITH DELETE CASCADE

DELETE CASCADE : Foreign key delete cascade means when parent table records is deleted the corresponding child table records also deleted. --CREATE DEMOS DATABASE CREATE DATABASE DEMOS USE DEMOS CREATE TABLE DBO . DEPT (             ID INT PRIMARY KEY ,             DEPTNAME VARCHAR ( 100 ) ) --INSERT DATA TO DEPT TABLE INSERT INTO DBO . DEPT ( ID , DEPTNAME ) VALUES ( 1 , 'SOFTWARE' ),( 2 , 'BPO' ) --CREATE EMP TABLE CREATE TABLE DBO . EMP (             ID INT IDENTITY ( 1 , 1 ) PRIMARY KEY ,             FIRTSNAME VARCHAR ( 100 ) ,             LASTNAME VARCHAR ( 100 ),             LOCATION VA...