Wednesday, 7 September 2016

SOLUTIONS TO FLIP SQL ASSIGNMENT

Solutions to flip SQL assignment
1.a.select deptno,dname,loc from dept;
b.select * name from emp;
c.select ename,hiredate,sal*12 from emp;
d.select distinct deptno from emp;
e.select ename,hiredate from emp where sal IS NOT NULL;
f.select name,age from emp order by name;
g.select name,dept from emp where dept=30;
h.select name ,age from emp where dept='sales' order by name;
i.create table employee (eno integer,name varchar(25),salary decimal(7,2),dob date);
j.insert into employees values(20,"Kellington",4569.00,"1980-02-07");

2.a.insert into sales values(1,"Rajat","north",0,4000.00,98989878);
b.insert into sales values(2,"Manpreet","south",2000000,459.22, 9810023450);
c.select * from sales where area="north" or area="south";
d.select area,sale from sales where sale>9000 and sale <40000;
e.select s_name from sales where commission between 200 and 400;
f.select * from sales where commission>900.00;
g.select area,sum (sale) from sales group by area;
h.select avg (sale) from sales;
i.select area from sales order by salesman_no desc;
j.update sales set sale=sale+0.10;
k.alter table sales modify mobileno integer;

l.select count (*)from sales

No comments:

Post a Comment