sql queries:

 create database db0;

use db0;


create table employee_details(id int, name varchar(255),place varchar(255),salary int);

create table purchase_details(name varchar(255), place varchar(255),amount int);


insert into employee_details(id,name,place,salary)

values ('10','nandhini','coimbatore','40000');


insert into employee_details(id,name,place,salary)

values ('20','kavitha','chennai','60000');


insert into employee_details(id,name,place,salary)

values ('30','arun','us','45000');


insert into employee_details(id,name,place,salary)

values ('40','arul','delhi','70000');



insert into employee_details(id,name,place,salary)

values ('50','priya','calfornia','90000');


insert into employee_details(id,name,place,salary)

values ('60','sarala','russia','100000');


select * from employee_details;


insert into employee_details(id,name,place,salary)

values ('70','thippu','puram','200000');


select * from employee_details;



insert into employee_details(id,name,place,salary)

values ('80','annai','ooty','200000');


insert into employee_details(id,name,place,salary)

values ('90','prabhu','kodaikanal','200000');



insert into employee_details(id,name,place,salary)

values ('100','selvam','pandichery','200000');


select * from employee_details;


select distinct name from employee_details;






select * from employee_details;


select name from employee_details where salary = 45000;


select * from employee_details where name='arun';


select * from employee_details;


select place from employee_details where id =20;


select * from employee_details where name ='arul';



select name from employee_details;



select name,id from employee_details;


select distinct name from employee_details;


select * from employee_details;


select name from employee_details  where id = 10;

select * from employee_details where name='nandhini';

select name from employee_details;



select name from employee_details where salary >50000;


select *from employee_details where name ='arul';


select * from employee_details;


select * from employee_details where salary > 70000 and place = 'ooty';


select * from employee_details;


select * from employee_details order by id;


select * from employee_details order by id DESC;


select * from employee_details where id in (100,90,60,70);


select * from employee_details where id = 60 and salary = 10000;

select * from employee_details where salary >50000 and place = 'ooty';

select * from employee_details where name = 'priya' and salary = 45000;

select * from employee_details where id = 10 OR name = 'navin';

select * from employee_details where id = 20 AND name = 'navin';

select * from employee_details where not id = 10;












select * from employee_details where not name ='arun';


select * from employee_details where id = 10 AND place='coimbatore';

select * from employee_details where salary > 45000 AND name ='arul';


select * from employee_details where id = 10 or name = 'poorani';


select * from employee_details where id in (10,70,80,40);


backup database db0 

 to DISK = 'sql today'

 WITH DIFFERENTIAL ;

differential usees to reduces the data backup time 

how to restore the data back into sql:


















































Comments

Popular posts from this blog

Linux interview Questions :

AWs Interview Questions