p3[1]
p3[1]
Semester III
a) For each employee, display the first name, last name, and email address. The email
address will be composed from the first letter of the first name, concatenated with the
first three letters of the last name, concatenated with @oracle.com.
3. For each employee, display the first name concatenated with the last name,
concatenated with the hire date.
4. Display the last name for all employees where the last name's length is greater
than 8 characters.
7. For each employee, display the first name, hire date, hire date minus 10 days,
hire date plus one month, and the day difference between the current date and
the hire date.
9. For each employee, display the first name, hire date, and hire date plus one year.
11. For each employee, display the first name, the day of his hire date, and the year
of his hire date.
13. For each employee, display the first name, last name, salary, and commission
percentage. If an employee doesn't earn a commission, display 0 instead of
NULL.
15. For each employee, display the first name, last name, salary, and a salary grade
based on these conditions:
a) If the salary is between 0 and 5000 - salary grade level is A
b) If the salary is between 5001 and 15000 - salary grade level is B
SELECT first_name, last_name, salary, CASE WHEN salary BETWEEN 0 AND 5000 THEN
'A' WHEN salary BETWEEN 5001 AND 15000 THEN 'B' WHEN salary BETWEEN 15001
AND 20000 THEN 'C' ELSE 'D' END AS "Salary Grade" FROM employees;
16. Display the first name, salary, and round the salary to thousands.
17. Display all the employees who joined in the month of May.
SELECT first_name, last_name, hire_date FROM employees WHERE
TO_CHAR(hire_date, 'MM') = '05';
19. Display the length of the first name for employees whose last name contains the
character 'b' after the third position (without using LIKE).