Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write SQL query for this question: Design some queries that will generate following reports using the set operators. 1. Employees have their current job (identified

write SQL query for this question:

Design some queries that will generate following reports using the set operators.

1. Employees have their current job (identified by JOB_ID) recorded in their EMPLOYEES row.

Jobs they have held previously (but not their current job) are recorded in JOB_HISTORY.

Which employees have never changed jobs? The listing should include the employees

EMPLOYEE_ID and LAST_NAME.

2. Which employees were recruited into one job, then changed to a different job, but are now back

in a job they held before. Again, you will need to construct a query that compares EMPLOYEES

with JOB_HISTORY. The report should show the employees names and the job titles. Job titles

are stored in the table JOBS.

3. What jobs has any one employee held? This will be the JOB_ID for the employees current

job (in EMPLOYEES) and all previous jobs (in JOB_HISTORY). If the employee has held a

job more than once, there is no need to list it more than once. Use a substitution variable to

prompt for the EMPLOYEE_ID and display the job title(s). Employees 101 and 200 will be

suitable employees for testing.

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions