0% found this document useful (0 votes)
706 views1 page

MRF SQL

This document contains 20 SQL queries against an EMP database table. The queries select and aggregate data on employee salary, department, name, hire date and other fields to return counts, sums, averages and other metrics. The queries filter on criteria like job type, department and salary amounts to analyze subsets of the employee data.

Uploaded by

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

MRF SQL

This document contains 20 SQL queries against an EMP database table. The queries select and aggregate data on employee salary, department, name, hire date and other fields to return counts, sums, averages and other metrics. The queries filter on criteria like job type, department and salary amounts to analyze subsets of the employee data.

Uploaded by

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

Q1.

SELECT count(*) From EMP where SAL < 2000 and DEPTNO= 10;

Q2. SELECT SUM(SAL) FROM EMP WHERE JOB= ‘CLERK’;

Q3. SELECT AVG(SAL) FROM EMP;

Q4. SELECT COUNT(*) FROM EMP WHERE ENAME LIKE ‘A%’;

Q5. SELECT COUNT(*) FROM EMP WHERE JOB = ‘ CLERK’ OR JOB = ‘ MANAGER’;

Q6. SELECT SUM(SAL) FROM EMP WHERE HIREDATE LIKE ‘%-FEB-%’;

Q7. SELECT COUNT(*) FROM EMP WHERE MGR = 7839;

Q8. SELECT COUNT(*) FROM EMP WHERE COMM IS NOT NULL AND DEPTNO= 30;

Q9. SELECT SUM(SAL) , AVG(SAL), COUNT(*), MAX(SAL) FROM EMP WHERE JOB = ‘ PRESIDENT’;

Q10 SELECT COUNT(*) FROM EMP WHERE ENAME LIKE ‘%A%’;

Q11 SELECT SUM(SAL), COUNT(*) FROM EMP WHERE ENAME LIKE ‘%LL%’;

Q12 SELECT COUNT(DISTINCT DEPTNO) FROM EMP;

Q13 SELECT COUNT(*) FRIM EMP WHERE ENAME LIKE ‘%Z%’;

Q14 SELECT COUNT(*) FROM EMP WHERE ENAME LIKE ‘%S%’;

Q15 SELECT SUM(SAL) FROM EMP WHERE JOB = ‘CLERK’ AND DEPTNO= 30;

Q16 SELECT MAN(SAL) FROM EMP WHERE JOB=’ ANALYST’;

Q17 SELECT COUNT(DISTINCT SAL) FROM EMP;

Q18 SELECT COUNT(DISTINCT JOB) FROM EMP;

Q19 SELECT AVG(SAL) FROM EMP WHERE JOB=’CLERK’;

Q20 SELECT MIN(SAL) FROM EMP WHERE DEPTNO =10 AND JOB IN(‘MANAGER’,’CLERK’);

You might also like