Question
Based on the following Relational Schema: EMPLOYEES (EMP_ID, EMP_NAME, EMAIL, HP_NUMBER, HIRE_DATE, SALARY, COMMISSION, MANAGER_ID, DEPT_ID*) DEPARTMENT (DEPT_ID, DEPT_NAME, LOCATION_ID, MANAGER_ID) Write a complete SQL
Based on the following Relational Schema:
EMPLOYEES (EMP_ID, EMP_NAME, EMAIL, HP_NUMBER, HIRE_DATE, SALARY, COMMISSION, MANAGER_ID, DEPT_ID*)
DEPARTMENT (DEPT_ID, DEPT_NAME, LOCATION_ID, MANAGER_ID)
Write a complete SQL command for each of the following questions.
a) Using Type I nested query, list all the information of the employees who does not work in departments where the manager id within range of 100 and 200. [3 marks]
b) Using Type II nested query, list all the information of the employees who attached to Human Resources Department. [3 marks]
c) Create a view for all employees with columns EMP_ID, EMP_NAME, DEPT_ID and salary more than RM3,000. [ 3 marks]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started