0% found this document useful (0 votes)
10 views

Computer

Uploaded by

ryzengfx6
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Computer

Uploaded by

ryzengfx6
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Computer

Science

Holiday homework
St.Martin’s Diocesan School
Name: Atharva Tyagi

Class:12-A
Roll.No:8
Case Study For Practical:
Consider the following tables:

Write SQL queries of the following:-


1.Select all the columns of employee table.

2.To list the name and employee number from the above table.
3.To list all names, hiredate and salary of all employees.

4.To display the employee name and incremented value of SAL as SAL + 300.

5.To list the employee name, his annual salary(Annual salary = 12*SAL+100).
6.To convert the designation into lower case.

7.To list the salary where salary is less than the commission.

8.To list all the columns where salary is greater than 4100.

9.To list name and hiredate of all the employees who are hired in 1981.
10.Display the ename and sal where comm is NULL.

11.To list all the employees who do not have manager.

12.To list name and salary of all employees who earn commissions.

SELECT query using DISTINCT Clause :

13.To list the distinct department number from the table.


14.To list the unique jobs from the table.

SELECT query using Logical Operators (NOT, AND, OR):

15.To list the name and salary of all the employees who earn more than 1200 and
are in department 10 or 40.

16.To list the names and job of all he employees who work in department 20 and
their manager is 7788.

SELECT query using IN Operator:

17.To list the mgr which are IN 7902, 7566, 7788.


SELECT query using BETWEEN Operator:
18.To list the salary between 3000 and 4000.

19.To display the employee name and job of employees hired between Feb 20,
1981 and May 1 1981.

SELECT query using LIKE Operator:


20.To list the ename starting with 'S’.

21.To list the names of all employees where the second letter of their name is an 'a'.
22.Display EName, Salary and dname of those employees whose salary is less than 4000.

23.Display employee name, Job, Hiredate and department name of employees


working in Mumbai.

24.To list all the columns in the ascending order of hiredate.

25.To list all the columns in the ascending order of deptno and descending order
of salary.
26.Display the ename and deptno of all employees in department 20 and 30 in
alphabetical ORDER BY name.

27.To list the deptno, job and sum of salary group by deptno and job.

Write the Output of the following queries: -


28.SELECT ENAME, INSTR(ENAME, 'a', 1, 2) FROM EMPLOYEE;
29.SELECT SUBSTR(ENAME, 1,5 ) FROM EMPLOYEE;

30.SELECT CONCAT(ENAME, JOB) FROM EMPLOYEE;

31.SELECT ENAME, 12*SAL + COMM FROM EMPLOYEE WHERE


ENAME ='Ashok Singhal';

32.SELECT ENAME FROM EMPLOYEE WHERE ENAME LIKE'_a8;

33.SELECT NAME, MGR FROM EMPLOYEE WHERE MGR IS NULL;


34.SELECT AVG(SAL), MAX(SAL), MIN(SAL), SUM(SAL) FROM
EMPLOYEE WHERE JOB LIKE 'SALES%;

35.SELECT DEPT,AVG(SAL) FROM EMPLOYEE GROUP BY DEPT;

36.SELECT COUNT() FROM EMPLOYEE WHERE DEPT = 20;

37.SELECT COUNT(COMM) FROMEMPLOYEE WHERE DEPT is 30.


38.SELECT DEPT, MAX(SAL) FROM EMPLOYEE GROUP
BYDEPTHAVING MAX(SAL)>2900;

You might also like