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...
It accepts the two values, if both the values are matched then it will return NULL otherwise it will return first value. Examples-1: Declare @FisrtName varchar ( 100 ), @LastName varchar ( 100 ) Set @FisrtName = 'Rakesh' Set @LastName = 'Rakesh' Select NULLIF ( @FisrtName , @LastName ) As [NULLIF] Example-2: Declare @FisrtName varchar ( 100 ), @LastName varchar ( 100 ) Set @FisrtName = 'Rakesh' Set @LastName = 'Kalluri' Select NULLIF ( @FisrtName , @LastName ) As [NULLIF]