Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following tables form part of a Human Resources database held in a Relational Database Management System: HR_COUNTRIES (COUNTRY_ID, COUNTRY_NAME, REGION_ID) HR_DEPARTMENTS (DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID,

The following tables form part of a Human Resources database held in a Relational Database Management System: HR_COUNTRIES (COUNTRY_ID, COUNTRY_NAME, REGION_ID) HR_DEPARTMENTS (DEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_ID) HR_EMPLOYEES (EMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_ID) JOB_HISTORY (EMPLOYEE_ID, START_DATE, END_DATE, JOB_ID, DEPARTMENT_ID) HR_JOBS (JOB_ID, JOB_TITLE, MIN_SALARY, MAX_SALARY) HR_LOCATIONS (LOCATION_ID, STREET_ADDRESS, POSTAL_CODE, CITY, STATE_PROVINCE, COUNTRY_ID) HR_REGIONS (REGION_ID, REGION_NAME) The primary keys are underlined in the above table. Write the following queries using SQL: a) List the details of all Employees orders by EMPLOYEE_ID. [2 Marks] b) List the details of all Employees working in department 30 or 50 or 100. [2 Marks] c) List the details of all jobs order by JOB_TITLE. [2 Marks] d) How many Employees with JOB_ID = ST_CLERK? [2 Marks] e) List the details of all Employees that have a salary greater than or equal to 3000 and less than or equal 7000. [2 Marks] f) List details of countries with COUNTRY_NAME start with S. [2 Marks] g) List the name of all departments, their City and street address, their country name, and their region name. [3 Marks] h) List the average salary of employees per department. [3 Marks] i) List the details of the employee with maximum salary. [3 Marks] j) List the name of each department and the name of its manager including the departments without a manager. [3 Marks] k) List the name of the employee with the highest frequent job change (Job change is stored in JOB_HISTORY).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions