📅  最后修改于: 2023-12-03 15:03:25.090000             🧑  作者: Mango
本文将分享在 Oracle 的面试中的体验,包括面试前的准备,面试中的内容和问题,以及我个人的反思和建议。
SELECT COUNT(DISTINCT department_id) FROM employees;
SELECT department_id, AVG(salary) FROM employees GROUP BY department_id HAVING AVG(salary) > 5000;
SELECT e.employee_id, j.job_id FROM employees e JOIN jobs j ON e.job_id = j.job_id;
SELECT COUNT(*) FROM customers WHERE state = 'CA' AND account_balance > 10000;
CREATE OR REPLACE PACKAGE my_package AS
FUNCTION get_employee_salary(p_employee_id IN NUMBER) RETURN NUMBER;
END my_package;
CREATE OR REPLACE PACKAGE BODY my_package AS
FUNCTION get_employee_salary(p_employee_id IN NUMBER) RETURN NUMBER
IS
v_salary employees.salary%TYPE;
BEGIN
SELECT salary INTO v_salary FROM employees WHERE employee_id = p_employee_id;
RETURN v_salary;
END get_employee_salary;
END my_package;
在准备 Oracle 面试时,我们需要重视基础知识的掌握。这是面试官考察候选人的第一步,如果基础知识不够扎实,其他更高级的问题也会难以解决。
在面试过程中,我们需要注重沟通表达能力。面试官通常会考察候选人的思维逻辑和沟通能力,我们需要清晰地表达自己的思路和想法,展示自己的工作方式。
最后,我们需要学会总结和反思。无论面试是否成功,我们都需要总结经验、发现不足、并及时进行学习和提高。这样,我们才能在未来的面试中更加得心应手。
SELECT COUNT(DISTINCT department_id) FROM employees;
SELECT department_id, AVG(salary) FROM employees GROUP BY department_id HAVING AVG(salary) > 5000;
SELECT e.employee_id, j.job_id FROM employees e JOIN jobs j ON e.job_id = j.job_id;
SELECT COUNT(*) FROM customers WHERE state = 'CA' AND account_balance > 10000;
CREATE OR REPLACE PACKAGE my_package AS
FUNCTION get_employee_salary(p_employee_id IN NUMBER) RETURN NUMBER;
END my_package;
CREATE OR REPLACE PACKAGE BODY my_package AS
FUNCTION get_employee_salary(p_employee_id IN NUMBER) RETURN NUMBER
IS
v_salary employees.salary%TYPE;
BEGIN
SELECT salary INTO v_salary FROM employees WHERE employee_id = p_employee_id;
RETURN v_salary;
END get_employee_salary;
END my_package;