You are on page 1of 3

Try on the machine 1.

Display Employee name, department number, date of joining from EMP table of SCOTT schema 2.Display all columns of SALGRADE table 3.Display emp#, employee name, deptno and present salary, present commission and proposed_comm(present commission plus 5% of the salary) 4.Try to display all unique departments from emp table 5.Try to display all unique combinations of departments and jobs form emp table 6.Try to display empno,ename, sal, comm and twelve times of the total income (salary plus comm) 7.Try to display proposed incremented salary on existing salary by increasing 15 percent on the existing salary and name the column as new_sal in the output 8.Try to display a sentence like ename working for department# deptno for every emp record 9.Try - SELECT * FROM EMP WHERE MGR IS NOT NULL and SELECT * FROM EMP WHERE MGR = NULL ..analyze and understand the reason for the result you get 10.List out EMPNO, ENAME FROM EMP of those employees whose ename contains an E or e in its second position 11.List out EMPNO, ENAME FROM EMP of those employees whose ename does not end with T. 12.Select mgr, empno , ename, hiredate in the ascending order of their managers empno 13.Select above details in ascending order of mgr and in descending order of hiredate 14.Select emp details in the ascending order of their comm and observe ordering of NULL comm valued rows. 15.List out empno,ename,sal of those employees whose salary figure contains a digit 5 any where in it.

16.List out empno,ename,sal of those employees whose salary figure ends with 500. 17.List out ename,hiredate,sal of all the employees by formatting sal column as Rs.99,99,999.99 18.List out empno,ename,mgr of those employees by displaying NOMAN if there is no manager for him/her 19.List out dd and mm of hiredate, empno, ename, nth Brithday of the employees in the order of month of joining of employees 20.List out the empno, No. of years, Months and days (in separate columns) they have serVed the company 21.Bonus payments would be calculated as 27.43% on gross annual income (sal*12 + comm if any) rounded to nearest 100th rupee. Write an SQL for the same. 22.Bonus payments would be calculated as 27.43% on gross annual income (sal*12 + comm if any) rounded to nearest lowest 100th rupee. Write an SQL for the same. 23.Display the name, hire date, and day of the week on which the employee joined. Name the column as Day_of_Joining. Order the results by the day of the week as Monday first, Tuesday next etc. 24.Because of budget issues, the HR department needs a report that displays the lastname and salary of employees who earn more than $12,000. 25.The HR department needs to find high-salary and low-salary employees. Modify lab_02_01.sql to display the last name and salary for any employee whose salary is not in the range of $5,000 to $12,000. 26.Display the last name and department ID of all employees in departments 20 or 50 in ascending alphabetical order by name. 27.The HR department needs a report that displays the last name and hires date for all employees who were hired in 1994. 28.Create a report to display the last name and job title of all employees who do not have a manager. 29.Display all employee last names in which the third letter of the name is a. 30.Display the last name, job, and salary for all employees whose job is that of a sales

representative or a stock clerk, and whose salary is not equal to $2,500, $3,500, or $7,000. 31.Write a query that displays the last name (with the first letter in uppercase and all the other letters in lowercase) and the length of the last name for all employees whose name starts with the letters J, A, or M. Give each column an appropriate label. Sort the results by the employees last names. 32.The HR department wants to find the duration of employment for each employee. For each employee, display the last name and calculate the number of months between today and the date on which the employee was hired. Label the column as MONTHS_WORKED. Order your results by the number of months employed. Round the number of months up to the closest whole number. 33.Create a query that displays the first eight characters of the employees last names and indicates the amounts of their salaries with asterisks. Each asterisk signifies a thousand dollars. Sort the data in descending order of salary. Label the column EMPLOYEES_AND_THEIR_SALARIES. 34.Display the last name, hire date, and day of the week on which the employee started. Label the column DAY. Order the results by the day of the week, starting with Monday. 35.Create a report to display the manager number and the salary of the lowest-paid employee for that manager. Exclude anyone whose manager is not known. Exclude any groups where the minimum salary is $6,000 or less. Sort the output in descending order of salary.

You might also like