By using this table answer this question in SQL : Write a SQL query, which shows a list of all employees last name, their department names and their department city where that department is located...


By using this table answer this question in SQL :





  1. Write a SQL query, which shows a list of all employees last name, their department names and their department city where that department is located from the employees table.  If an employee does not belong to a department, then their department number and department name should show as

    “N/A”

    and their department city should show up as
    “No City info Found”
    .
    MAKE SURE you have all the employees displayed including the employees who do not have a department.



JOB_HISTORY<br>JOBS<br>PF' EMPLOYEE_ID<br>P' START_DATE<br>* END_DATE<br>JOB_ID<br>DEPARTMENT_ID<br>P JOB_ID<br>* JOB_TITLE<br>MIN_SALARY<br>MAX_SALARY NUMBER (6)<br>NUMBER (0)<br>VARCHAR2 (10 BYTE)<br>VARCHAR2 (35 BYTE)<br>DATE<br>DATE<br>NUMBER (8)<br>VARCHAR2 (10 BYTE)<br>NUMBER (4)<br>JOB_ID_PK<br>O IDX_JOB_TITLE<br>JHIST_EMP_ID_ST_DATE_PK<br>O JHIST_JOB_IX<br>JHIST_EMPLOYEE_IX<br>O JHIST_DEPARTMENT_IX<br>DEPARTMENTS<br>DEPARTMENT_ID<br>DEPARTMENT_NAME<br>MANAGER_ID<br>NUMBER (4)<br>VARCHAR2 (30 BYTE)<br>F<br>NUMBER (8)<br>NUMBER (4)<br>EMPLOYEES<br>LOCATION_ID<br>EMPLOYEE_ID<br>FIRST_NAME<br>* LAST NAME<br>U' EMAIL<br>NUMBER (6)<br>VARCHAR2 (20 BYTE)<br>VARCHAR2 (25 BYTE)<br>VARCHAR2 (25 BYTE)<br>VARCHAR2 (20 BYTE)<br>DEPT_ID_PK<br>DEPT_LOCATION_IX<br>PHONE_NUMBER<br>HIRE_DATE<br>JOB_ID<br>SALARY<br>DATE<br>VARCHAR2 (10 BYTE)<br>LOCATIONS<br>NUMBER (8.2)<br>COMMISSION_PCT<br>F<br>MANAGER_ID<br>F<br>DEPARTMENT_ID<br>NUMBER (2.2)<br>NUMBER (8)<br>NUMBER (4)<br>LOCATION_ID<br>STREET_ADDRESS<br>POSTAL_CODE<br>* CITY<br>NUMBER (4)<br>VARCHAR2 (40 BYTE)<br>VARCHAR2 (12 BYTE)<br>STATE_PROVINCE<br>F<br>VARCHAR2 (30 BYTE)<br>VARCHAR2 (25 BYTE)<br>CHAR (2 BYTE)<br>EMP_EMAIL_UK<br>EMP_EMP_ID_PK<br>O EMP_DEPARTMENT_IX<br>O EMP_JOB_IX<br>O EMP_MANAGER_IX<br>O EMP_NAME_IX<br>O IDX SALARY<br>COUNTRY_ID<br>LOC_ID_PK<br>O LOC_CITY_IX<br>O LOC_STATE_PROVINCE_IX<br>O LOC_COUNTRY_Ix<br>Y--<br>EMP_DETAIL S_VIEW<br>COUNTRIES<br>NUMBER (6)<br>VARCHAR2 (1O)<br>EMPLOYEE_ID<br>COUNTRY_ID<br>CHAR (2 BYTE)<br>JOB_ID<br>MANAGER_ID<br>DEPARTMENT_ID<br>COUNTRY_NAME<br>VARCHAR2 (40 BYTE)<br>NUMBER (8)<br>F<br>REGION_ID<br>NUMBER<br>NUMBER (4)<br>COUNTRY_C_ID_PK<br>LOCATION_ID<br>COUNTRY_ID<br>FIRST_NAME<br>LAST_NAME<br>NUMBER (4)<br>CHAR (2)<br>VARCHAR2 (20)<br>VARCHAR2 (25)<br>NUMBER (8, 2)<br>SALARY<br>REGIONS<br>COMMISSION_PCT<br>DEPARTMENT_NAME VARCHAR2 (30)<br>JOB_TITLE<br>NUMBER (2, 2)<br>P REGION_ID<br>NUMBER<br>VARCHAR2 (35)<br>REGION_NAME<br>VARCHAR2 (25 BYTE)<br>VARCHAR2 (30)<br>VARCHAR2 (25)<br>VARCHAR2 (40)<br>VARCHAR2 (25)<br>CITY<br>REG_ID_PK<br>STATE_PROVINCE<br>COUNTRY_NAME<br>REGION_NAME<br>

Extracted text: JOB_HISTORY JOBS PF' EMPLOYEE_ID P' START_DATE * END_DATE JOB_ID DEPARTMENT_ID P JOB_ID * JOB_TITLE MIN_SALARY MAX_SALARY NUMBER (6) NUMBER (0) VARCHAR2 (10 BYTE) VARCHAR2 (35 BYTE) DATE DATE NUMBER (8) VARCHAR2 (10 BYTE) NUMBER (4) JOB_ID_PK O IDX_JOB_TITLE JHIST_EMP_ID_ST_DATE_PK O JHIST_JOB_IX JHIST_EMPLOYEE_IX O JHIST_DEPARTMENT_IX DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID NUMBER (4) VARCHAR2 (30 BYTE) F NUMBER (8) NUMBER (4) EMPLOYEES LOCATION_ID EMPLOYEE_ID FIRST_NAME * LAST NAME U' EMAIL NUMBER (6) VARCHAR2 (20 BYTE) VARCHAR2 (25 BYTE) VARCHAR2 (25 BYTE) VARCHAR2 (20 BYTE) DEPT_ID_PK DEPT_LOCATION_IX PHONE_NUMBER HIRE_DATE JOB_ID SALARY DATE VARCHAR2 (10 BYTE) LOCATIONS NUMBER (8.2) COMMISSION_PCT F MANAGER_ID F DEPARTMENT_ID NUMBER (2.2) NUMBER (8) NUMBER (4) LOCATION_ID STREET_ADDRESS POSTAL_CODE * CITY NUMBER (4) VARCHAR2 (40 BYTE) VARCHAR2 (12 BYTE) STATE_PROVINCE F VARCHAR2 (30 BYTE) VARCHAR2 (25 BYTE) CHAR (2 BYTE) EMP_EMAIL_UK EMP_EMP_ID_PK O EMP_DEPARTMENT_IX O EMP_JOB_IX O EMP_MANAGER_IX O EMP_NAME_IX O IDX SALARY COUNTRY_ID LOC_ID_PK O LOC_CITY_IX O LOC_STATE_PROVINCE_IX O LOC_COUNTRY_Ix Y-- EMP_DETAIL S_VIEW COUNTRIES NUMBER (6) VARCHAR2 (1O) EMPLOYEE_ID COUNTRY_ID CHAR (2 BYTE) JOB_ID MANAGER_ID DEPARTMENT_ID COUNTRY_NAME VARCHAR2 (40 BYTE) NUMBER (8) F REGION_ID NUMBER NUMBER (4) COUNTRY_C_ID_PK LOCATION_ID COUNTRY_ID FIRST_NAME LAST_NAME NUMBER (4) CHAR (2) VARCHAR2 (20) VARCHAR2 (25) NUMBER (8, 2) SALARY REGIONS COMMISSION_PCT DEPARTMENT_NAME VARCHAR2 (30) JOB_TITLE NUMBER (2, 2) P REGION_ID NUMBER VARCHAR2 (35) REGION_NAME VARCHAR2 (25 BYTE) VARCHAR2 (30) VARCHAR2 (25) VARCHAR2 (40) VARCHAR2 (25) CITY REG_ID_PK STATE_PROVINCE COUNTRY_NAME REGION_NAME
Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here