0% found this document useful (0 votes)
4 views2 pages

Assignment 1

The document contains a series of SQL queries that retrieve employee data from an 'EMP' table based on various conditions such as employee names starting with specific letters, salary thresholds, job titles, and department numbers. The queries also filter results based on manager status and commission details. Overall, the document focuses on extracting specific employee information for analysis.

Uploaded by

mchandini392
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Assignment 1

The document contains a series of SQL queries that retrieve employee data from an 'EMP' table based on various conditions such as employee names starting with specific letters, salary thresholds, job titles, and department numbers. The queries also filter results based on manager status and commission details. Overall, the document focuses on extracting specific employee information for analysis.

Uploaded by

mchandini392
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

1) SELECT ENAME

FROM EMP
WHERE ENAME LIKE 'A%'
OR ENAME LIKE 'E%'
OR ENAME LIKE 'I%'
OR ENAME LIKE 'O%'
OR ENAME LIKE 'U%';

2) SELECT *
FROM EMP
WHERE MGR IS NULL
AND SAL > 4000;

3) SELECT *
FROM EMP
WHERE JOB = 'SALESMAN' AND DEPTNO = 30;

4) SELECT *
FROM EMP
WHERE JOB = 'SALESMAN' AND DEPTNO = 30 AND SAL > 1500;

5) SELECT *
FROM EMP
WHERE ENAME LIKE 'S%' OR ENAME LIKE 'A%';

6)SELECT ENAME, COMM * 12


FROM EMP
WHERE DEPTNO NOT IN (10, 20);

7) SELECT ENAME
FROM EMP
WHERE ENAME NOT LIKE 'S%' AND MGR LIKE '%9%' AND SAL>1000 AND SAL<3000;

8) SELECT *
FROM EMP
WHERE MGR IS NOT NULL
AND DEPTNO IN (10, 30);
9)
SELECT ENAME
FROM EMP
WHERE COMM IS NULL AND JOB NOT IN ('CLERK') AND SAL BETWEEN 1100 AND 2500;

10)SELECT *
FROM EMP
WHERE MGR IS NULL AND DEPTNO IN (10,30);
11)
SELECT *
FROM EMP
WHERE JOB='SALESMAN' AND DEPTNO=30 AND SAL>2450;

12) SELECT *
FROM EMP
WHERE JOB = 'ANALYST'
AND DEPTNO = 20
AND SAL > 2500;

13) SELECT *
FROM EMP
WHERE ENAME LIKE 'M%' OR ENAME LIKE 'J%';
14) SELECT ENAME, SAL * 12
FROM EMP
WHERE DEPTNO NOT IN (30);

15) SELECT *
FROM EMP
WHERE ENAME NOT LIKE '%ES'
AND ENAME NOT LIKE '%R';
16)
SELECT ENAME,SAL+(SAL*10/100)
FROM EMP
WHERE MGR IS NOT NULL AND DEPTNO=10 ;

You might also like