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.
CREATE TABLE emp_analytics AS SELECT department_id, last_name, salary, RANK() OVER (PARTITION BY department_id ORDER BY salary DESC) AS salary_rank FROM employees; Oracle 12c SQL is robust, but the secret to passing hands-on assignments is understanding the subtle differences in windowing functions and the modern Top-N syntax . Always test your OFFSET/FETCH logic on a small subset first to verify sorting order. oracle 12c sql hands-on assignments solutions
SELECT employee_id, first_name, last_name, hire_date FROM employees WHERE EXTRACT(YEAR FROM hire_date) = 2012 ORDER BY hire_date ASC; You can also use the TO_CHAR method: SELECT product_id, product_name, list_price FROM oe
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". Always test your OFFSET/FETCH logic on a small