CS-SQL
CS-SQL
17.Write the command to display the no. and name of those employees who
were hired in the year 1981.
18.Write the command to display the name and annual salary of all
employees.
19.Write the command to display the name and job of employees working in
department 20 and earning more than 1000.
20.Write the command to display the no., name and salary of employees
whose salary is not between 1000 and 2000.
22.Write the command to display the names of employees whose name has
the second alphabet ‘A’.
23.Write the command to display the name and job of those employees whose
job does not contain the alphabet ‘A’.
24.Write the command to display the job which has some commission.
26.Write the command to display the name, job and salary of employees
working in department 10, in descending order of salary.
27.Write the command to display the latest and oldest date of hiring among
all the employees.
28.Write the command to display the number of employees who have a
manager.
29.Write the command to display the total salary of the employees working in
department 20.
30.Write the command to display the average salary for each department.
32.Write the command to display the maximum and minimum salary for each
job.
33.Write the command to display the average salary of those departments
whose average salary is more than 500.
34.Write the command to display the department no. and no. of employees in
those departments where the number of employees is less than 5.
(ii) select ename, sal from empl where sal between 800 and 1300;
(iii) select ename, job from empl where ename like ‘%E_’ and job like ‘%E_’;
(v) select emplno, ename, job from empl where deptno=10 order by hiredate;
37.Write the command to display the worker id, name, job id and salary of all
workers.
38.Write the command to display the job id and title of those workers whose
sales is more than 1250000.
39.Write the command to display the worker id and sales of those workers
who are vice president.
40.Write the command to display all the columns from both the tables
without any column getting repeated.
(OR)
select * from worker join job using(jobid);
41.Write the command to display all the possible combinations of all the rows
from both the tables.
select * from worker, job;
(OR)
select * from worker join job;
(OR)
select * from worker cross join job;
42.Write the output of the following SQL commands:
(i) select title, count(*) from worker w, job j where w.jobid=j.jobid
group by title;