sql -interview question-part-02
Sql interview questions: 1)what is sql? 2)what are the subsets of sql? ddl (creaet,alter,drop,truncate,rename) dml(dekete update,insert) dcl(grant,revoke) tcl(commit,roolback,savepoint) 3)create table and add data 4)difference between truncate ,drop and delete in sql? truncate table: truncate table table -name drop drop table table_name select*from table name delete where id ='10'; 5).what are constrains in sql? primary key foreign key not null default check unique 6).difference between primary key and foreign key: primary key: its doesn't accept the null value only one primary key it will be there unique key: accept the null values many unique keys are there 7).Difference between union and union all? union : removes any duplicates records. union all: its doesn't remove duplicate records