Blog
Oracle 12c Sql Hands-on Assignments Solutions Apr 2026
SELECT employee_id, first_name, last_name, hire_date FROM employees ORDER BY hire_date OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY; Problem 7: Calculate the exact number of months and years each employee has worked as of today's date. Output format: "14 years, 3 months".
Write a query to page through employee data, showing rows 21 to 30 (Offset 20, Fetch 10). oracle 12c sql hands-on assignments solutions
WHERE TO_CHAR(hire_date, 'YYYY') = '2012'; Find all products in the oe.product_information table whose list price is between $50 and $200, but exclude products where the product name contains the word 'Monitor'. WHERE TO_CHAR(hire_date, 'YYYY') = '2012'; Find all products
SELECT product_id, product_name, list_price FROM oe.product_information WHERE list_price BETWEEN 50 AND 200 AND UPPER(product_name) NOT LIKE '%MONITOR%'; Problem 3: Show the department name, city, and the number of employees working in that department. Include departments with zero employees. Note: Without WITH TIES
SELECT employee_id, first_name, last_name, salary FROM employees ORDER BY salary DESC FETCH FIRST 5 ROWS WITH TIES; Note: Without WITH TIES , it returns exactly 5 rows. With WITH TIES , it respects the salary rank.
