Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
The HR _ JOB _ HISTORY table stores job history of the employees. If an employee changes departments within the job or changes jobs within
The HRJOBHISTORY table stores job history of the employees. If an employee changes departments within the job or changes jobs within the department, new rows get inserted into this table with old job information of the employee. Create a query that will show the concatenated first and last name of all employees in the HRJOBHISTORY table along with their old job title and old department name and their new job title and new department name.Here are the TABLES: DDL for Table HRCOUNTRIES CREATE TABLE HRCOUNTRIES COUNTRYID CHAR COUNTRYNAME VARCHAR REGIONID NUMBER ; DDL for Table HRDEPARTMENTS CREATE TABLE HRDEPARTMENTS DEPARTMENTID NUMBER DEPARTMENTNAME VARCHAR MANAGERID NUMBER LOCATIONID NUMBER ; DDL for Table HREMPLOYEES CREATE TABLE HREMPLOYEES EMPLOYEEID NUMBER FIRSTNAME VARCHAR LASTNAME VARCHAR EMAIL VARCHAR PHONENUMBER VARCHAR HIREDATE DATE, JOBID VARCHAR SALARY NUMBER COMMISSIONPCT NUMBER MANAGERID NUMBER DEPARTMENTID NUMBER ; DDL for Table HRJOBS CREATE TABLE HRJOBS JOBID VARCHAR JOBTITLE VARCHAR MINSALARY NUMBER MAXSALARY NUMBER ; DDL for Table HRJOBHISTORY CREATE TABLE HRJOBHISTORY EMPLOYEEID NUMBER STARTDATE DATE, ENDDATE DATE, JOBID VARCHAR DEPARTMENTID NUMBER ; DDL for Table HRLOCATIONS CREATE TABLE HRLOCATIONS LOCATIONID NUMBER STREETADDRESS VARCHAR POSTALCODE VARCHAR CITY VARCHAR STATEPROVINCE VARCHAR COUNTRYID CHAR ; DDL for Table HRREGIONS CREATE TABLE HRREGIONS REGIONID NUMBER, REGIONNAME VARCHAR ;
The HRJOBHISTORY table stores job history of the employees. If an employee changes departments within the job or changes jobs within the department, new rows get inserted into this table with old job information of the employee. Create a query that will show the concatenated first and last name of all employees in the HRJOBHISTORY table along with their old job title and old department name and their new job title and new department name.Here are the TABLES:
DDL for Table HRCOUNTRIES
CREATE TABLE HRCOUNTRIES
COUNTRYID CHAR
COUNTRYNAME VARCHAR
REGIONID NUMBER
;
DDL for Table HRDEPARTMENTS
CREATE TABLE HRDEPARTMENTS
DEPARTMENTID NUMBER
DEPARTMENTNAME VARCHAR
MANAGERID NUMBER
LOCATIONID NUMBER
;
DDL for Table HREMPLOYEES
CREATE TABLE HREMPLOYEES
EMPLOYEEID NUMBER
FIRSTNAME VARCHAR
LASTNAME VARCHAR
EMAIL VARCHAR
PHONENUMBER VARCHAR
HIREDATE DATE,
JOBID VARCHAR
SALARY NUMBER
COMMISSIONPCT NUMBER
MANAGERID NUMBER
DEPARTMENTID NUMBER
;
DDL for Table HRJOBS
CREATE TABLE HRJOBS
JOBID VARCHAR
JOBTITLE VARCHAR
MINSALARY NUMBER
MAXSALARY NUMBER
;
DDL for Table HRJOBHISTORY
CREATE TABLE HRJOBHISTORY
EMPLOYEEID NUMBER
STARTDATE DATE,
ENDDATE DATE,
JOBID VARCHAR
DEPARTMENTID NUMBER
;
DDL for Table HRLOCATIONS
CREATE TABLE HRLOCATIONS
LOCATIONID NUMBER
STREETADDRESS VARCHAR
POSTALCODE VARCHAR
CITY VARCHAR
STATEPROVINCE VARCHAR
COUNTRYID CHAR
;
DDL for Table HRREGIONS
CREATE TABLE HRREGIONS
REGIONID NUMBER,
REGIONNAME VARCHAR
;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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