SQL Record Questions(XII CS)
SQL Record Questions(XII CS)
Table emp:
Table dept:
10. Display the name and salary of salesmen with salary more than
15000.
Select empname,sal from emp where job=’SALESMAN’ and
sal>15000;
11. Display the details of employees whose salary is not equal to 30000
Select * from emp where sal != 30000;
15. Display the details of all employees other than managers and
salesman.’
Select * from emp where job not in(‘MANAGER’,’SALESMAN’);
16. Display the different jobs without duplicate values.
Select distinct job from emp;
17. Display the details of employees whose name starts with ‘S’.
Select * from emp where empname like ‘S%’;
29.Add a column to the table dept called Place with data type varchar
Alter table dept add place varchar(20)
empname
JONES
max(hiredate) min(hiredate)
1993-01-12 1990-12-17
count(distinct job)
5
empname
ADAMS
JAMES
MILLER
SMITH
empname
JONES
FORD
SCOTT
avg(comm)
550
job max(sal)
PRESIDENT 50000
ANALYST 30000
MANAGER 29750
SALESMAN 16000
CLERK 13000
job count(*)
ANALYST 2
MANAGER 3
PRESIDENT 1
empname dname
KING SALES
CLARK SALES