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

Lesson 2 Function Practices

The document provides examples of SQL functions and queries to practice using functions like UPPER, formatting dates and numbers, calculating differences between dates, aggregating data, and filtering results. The examples range from selecting specific records to aggregating and calculating values from the employees table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Lesson 2 Function Practices

The document provides examples of SQL functions and queries to practice using functions like UPPER, formatting dates and numbers, calculating differences between dates, aggregating data, and filtering results. The examples range from selecting specific records to aggregating and calculating values from the employees table.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Functions Practice Problems

1. Create a list of employees names who have the job_id of AD_VP, use the UPPER function in the WHERE statement.

2. Create a list that includes the first initial of every employee's first name, a space, and the last name of the employee, call it “Employee
Names”.

3. Create a list of weekly salaries from the employees table where the weekly salary is between 700 and 3000. The salaries should be
formatted to include a $-sign and be rounded to two decimal points like: $9999.99.

4. Create a list of last_names and hire_dates for employees with dates formated as ‘April 10th, 2018’, call date “Hire Date”.

5. Convert the string ‘March 20, 2018’ to a date field with the column heading “First Day of Spring”.

6. Calculate the number of months between today and Christmas, rounded to a whole number.

7. Display each employee’s name and a calculation of the date a year from their hire_date call it “First Anniversary”.

8. Create a list of every employee's first initial and last name, salary, and commission, if they don’t make a commission substitute 0, call
the column “Commission”.

9. Show the “First” last name and the “Last” last name from the employees table.

10. Produce a list of the earliest hire date as “Highest” the latest hire date as “Lowest”, and the number of employees as “No of
Employees” from the employees table.

11. Show the highest average salary for the departments in the employees table. Round the result to the nearest whole number.

12. Create list of departments and the number of employees in them but only for departments with 3 or more employees.

Copyright © 2020, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

You might also like