Professional Documents
Culture Documents
Lab Exercise 6 - Saiful Naim Bin Norazman - 2023368399
Lab Exercise 6 - Saiful Naim Bin Norazman - 2023368399
Q1: By using natural join, display employees’ last name and their department’s name.
SQL:
FROM employees
Q2:
I. Find the first name and department name for all employees in department 60.
II. Find the country’s name and city for each location.
III. Find employees’ name that have salary more than 5000 and display together their job
title.
i.SQL:
FROM employees
WHERE department_id = 60
SELECT first_name, department_name
FROM employees
ii. SQL:
FROM countries
SQL:
FROM countries c
iii. SQL:
FROM employees
FROM employees e
Q3:
Find the employees’ last name and their hire date if they were hired after Ernst.
SQL:
FROM employees
SELECT hire_date
FROM employees
Q4:
SELECT
FROM employees m
JOIN employees s ON m.employee_id = s.manager_id
Q5: Find the employees name, even though they do not have any department. Display together the
department’s name if they have it.
SQL:
FROM employees e