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

Computer Applications Assignment: Page - 1

This document contains 39 questions and answers related to querying an employee database table. The questions ask to select and display various columns like name, job, salary, etc. either alone or with conditions on columns like department, job type, salary range, etc. Some questions also involve aggregate functions like count, sum, max, min, avg. Sorting and string functions are also used in some queries.

Uploaded by

Lavanya Arora
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Computer Applications Assignment: Page - 1

This document contains 39 questions and answers related to querying an employee database table. The questions ask to select and display various columns like name, job, salary, etc. either alone or with conditions on columns like department, job type, salary range, etc. Some questions also involve aggregate functions like count, sum, max, min, avg. Sorting and string functions are also used in some queries.

Uploaded by

Lavanya Arora
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Computer Applications Assignment

Q1. Display the details of all employees. A1. Select ename,job,salary,hiredate from table1. Q2. Display the name and job for all the employees. A2. Select ename,job from table1. Q3. Display the name and salary for all the employees. A3. Select ename,salary from table1. Q4. Display the names of all the employees who are working in depart number 10. A4. Select ename from table1 where deptno =10. Q5. Display the names of all the employees who are working as clerks and drawing a salary more than 3000. A5. Select ename from table1 where job=clerk and salary>3000. Q6. Display the employee number and name who are earning comm. A6. Select ename from table1 where comm>0. Q7. Display the employee number and name who do not earn any comm. A7. Select ename,empno from table1 where comm = 0. Q8. Display the names of employees who are working as clerks,salesman or analyst and drawing a salary more than 3000. A8. Select ename from table1 where (job = clerk and salary>3000). Q9. Display the names of employees working in depart number 10 or 20 or 40 or employees working as CLERKS,SALESMAN,or ANALYST.

Page | 1

A9. Select ename from table1 where (dept=10,20,300)and (job=Clerk or salesmanoranalyst. Q10. Display the names of employees whose name starts with alaphabet S. A10. Select ename from table1 where ename is like S*. Q11. Display the Employee names for employees whose name ends with alphabet S. A11. Select ename from table1 where like *S. Q12. Select the names of the employees whose names is exactly five characters in length. A12. Select ename from table1 where len(ename)=5;. Q13. Display the names of the employee who are not working as MANAGERS. A13. Select ename from table1 where job<>manager. Q14. Display the names of the employees who are not working as SALESMAN OR CLERK OR ANALYST. A14. Select ename from table1 where(job <>clerk or salesman oranalyst. Q15. Display the total number of employee working in the company. A15. Select count (*) from table1. Q16. Display the total salary beiging paid to all employees. A16. Select sum (salary)from table1. Q17. Display the maximum salary from emp Table. A17. Select max (salary) from table1. Q18. Display the minimum salary from emp Table. A18. Select min (salary) from table1. Q19. Display the average salary from emp Table.
Page | 2

A19. Select avg (salary) from table1. Q20. Display the maximum salary being paid to CLERK. A20. Select max(salary)from table1 where job =clerk. Q21. Display the maximum salary being paid to depart number 20. A21. Select max(salary) from table1 where deptno=20. Q22. Display the first salary from emp table. A22. Select first(salary) from table1. Q23. Display the last salary from emp table. A23. Select last(salary)from table1. Q24. Display the minimum salary being paid to any SALESMAN. A24. Select min(salary) from table1 where job=salesman. Q25. Display the average salary drawn by MANAGERS. A25. Select avg(salary) from table1 where job=manager. Q26. Display the total salary drawn by ANALYST working in depart nimber20.

A26. Select sum(salary) from table1 where (job=analyst) and (deptno=20). Q27. Display depart numbers and total number of employees working in each department. A27. Select deptno, count(deptno) from table1 group by deptno; Q28. Display the various jobs and total number of employees within each job group. A28. Select job, count(job) from table1 group by (job). Q29. Display the depart numbers and total salary for each department. A29. Select deptno, sum(salary) from table1 group by(deptno).

Page | 3

Q30. Display the depart numbers and max salary for each department. A30. Select deptno, max(salary)from table1 group by(deptno). Q31. Display the various jobs and total salary for each job. A31. Select job, sum(salary) from table1 group by (job). Q32. Display the names of the employee in order of salary i.e the name of the employee earning lowest salary should salary appear first. A32. Select ename from table1 order by salary asc. Q33. Display the names of the employee in descending order of salary. A33. Select ename from table1 order by salary dsc. Q34. Display the names of the employee in order of employee name. A34. Select ename from table order by ename. Q35. Display the names of the employees in uppercase.

A35. Select ucase(ename) from table1. Q36. Display the names of the employees in lowercase. A36. Select lcase(ename) from table1. Q37. Display the length of all the employee names. A37. Select len(ename) from table1. Q38. Display the first four characters of the job column from emp table. A38. Select mid(job,1,4) from table1. Q39. Display the current date and time. A39. Select now().

Page | 4

You might also like