PRACTICE Questions with solutions.docx - Practice 3 Part 1...

This preview shows page 1 - 2 out of 5 pages.

Practice 3 Part 1 1. Write a query to display the system date. Label the column as ‘Date’. Note: If your database is remotely located in a different time zone, the output will be the date for the operating system on which the database resides.
2. The HR department needs a report to display the employee number, last name, salary, and salary increased by 15.5% (expressed as a whole number) for each employee. Label the column ‘New Salary’. select employee_id, last_name, salary, round(salary*1.155,0) as "New Salary" from employees; 3. Modify your query lab_03_02.sql to add a column that subtracts the old salary from the new salary. Label the column ‘Increase’. select employee_id, last_name, salary, round(salary*1.155,0) as "New Salary", round(salary*1.155,0)-salary as "Increase" from employees; 4. 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’, ‘M’. Give each column appropriate label. Sort the results by the employees’ last names. Rewrite the query so that the user is prompted to enter a letter that the last name starts with. For example, if the user enters ‘H’ (capitalized) when prompted for a letter, then the output should show all employees whose last name starts with the letter ‘H’.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture