1.Write a query to display the current date. Label the column Date.
2.For each employee, display the employee number, last_name, salary, and salary increased by 15% and expressed as a whole number. Label the column New Salary. Place your SQL statement ina text file named lab3_2.sql.
3.Modify your query lab3_2.sql to add a column that subtracts the old salary fromthe new salary. Label the column Increase. Save the contents of the file as lab3_4.sql.Run the revised query.
4.Write a query that displays the employee’s last names with the first letter capitalized and all otherletters lowercase and the length of the name for all employees whose name starts with J, A, or M.Give each column an appropriate label. Sort the results by the employees’ last names.
5.For each employee, display the employee’s last name, and calculate the number of monthsbetween today and the date the employee was hired. Label the column MONTHS_WORKED. Orderyour results by the number of months employed. Round the number of months up to the closestwhole number.
6.Create a query to display the last name and salary for all employees. Format the salary to be 10characters long, left-padded with $. Label the column SALARY.
7.Using the DECODE function, write a query that displays the grade of all employees based on thevalue of the column JOB_ID, as per the following data:
JOB GRADE
AD_PRES A
ST_MAN B
IT_PROG C
SA_REP D
None of the above 0
Monday, November 10, 2008
Subscribe to:
Comments (Atom)