Hello, can you please assit me with this. I am struggling to get the code to run correctly without errors:   1.    Write a query using a join that displays          Department names (not Department_IDs)         Employees’ IDs, last & first names     Sort your results by department name and employee last and first name.         NOTE: INNER JOIN is OK here.     NOTE: I suggest you use table aliases. */ /* 2.    Write a query using a join that displays          Department names (no DEPARTMENT_IDs).          Job titles  (not Job_IDs)         Employees’ IDs, last & first names,      Sort your results by department name, job title, and employee last and first name.         NOTE: INNER JOIN is OK here.     NOTE: I suggest you use table aliases. */ /* 3.    Write a query using a self-join to display          Employees’ IDs and names along with          Their manager’s ID and name.      Use column aliases so that it is clear which columns are for the Manager and which columns are for the Employee.     Display Manager data first.     Sort your results by the managers’ last & first names and then by the employees’ last & first names.         NOTE: INNER JOIN is OK here.     NOTE: I suggest you use table aliases. */ /* 4.    The company would like to identify          All of the customers that have never placed an order.         Write a query using a join that provides this information.          Your results should include all the customer details.      Sort your results by the customers’ last & first names.     NOTE: INNER JOIN will NOT work here.     NOTE: I suggest you use table aliases. */ /* 5.    The company needs a list of every Customer and every Book.     In addition to          Customers who have purchased Books and the Books purchased,     This report should also include          Customers who have not purchased Books         Books that have not been purchased.     NOTE: This should NOT be a Cartesian Product.     The managers need to see:         Customer_Id         Last_Name         First_Name         ISBN         Book_Title         Book_Price     For those Books that have been purchased, they also need to see:         Order_Number         Order_Date         Unit_Price         Quantity     Sort your results by cistomer last and first name, book title, and order date     NOTE: INNER JOIN will NOT work here.     NOTE: I suggest you use table aliases.

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter7: Developing An Excel Application
Section: Chapter Questions
Problem 3RA
icon
Related questions
Question

Hello, can you please assit me with this. I am struggling to get the code to run correctly without errors:

 

1.    Write a query using a join that displays 
        Department names (not Department_IDs)
        Employees’ IDs, last & first names
    Sort your results by department name and employee last and first name.    
    NOTE: INNER JOIN is OK here.
    NOTE: I suggest you use table aliases.
*/


/*
2.    Write a query using a join that displays 
        Department names (no DEPARTMENT_IDs). 
        Job titles  (not Job_IDs)
        Employees’ IDs, last & first names, 
    Sort your results by department name, job title, and employee last and first name.    
    NOTE: INNER JOIN is OK here.
    NOTE: I suggest you use table aliases.
*/


/*
3.    Write a query using a self-join to display 
        Employees’ IDs and names along with 
        Their manager’s ID and name. 
    Use column aliases so that it is clear which columns are for the Manager and which columns are for the Employee.
    Display Manager data first.
    Sort your results by the managers’ last & first names and then by the employees’ last & first names.    
    NOTE: INNER JOIN is OK here.
    NOTE: I suggest you use table aliases.
*/


/*
4.    The company would like to identify 
        All of the customers that have never placed an order.
        Write a query using a join that provides this information. 
        Your results should include all the customer details. 
    Sort your results by the customers’ last & first names.
    NOTE: INNER JOIN will NOT work here.
    NOTE: I suggest you use table aliases.
*/


/*
5.    The company needs a list of every Customer and every Book.
    In addition to 
        Customers who have purchased Books and the Books purchased,
    This report should also include 
        Customers who have not purchased Books
        Books that have not been purchased.
    NOTE: This should NOT be a Cartesian Product.

    The managers need to see:
        Customer_Id
        Last_Name
        First_Name
        ISBN
        Book_Title
        Book_Price
    For those Books that have been purchased, they also need to see:
        Order_Number
        Order_Date
        Unit_Price
        Quantity
    Sort your results by cistomer last and first name, book title, and order date

    NOTE: INNER JOIN will NOT work here.
    NOTE: I suggest you use table aliases.
*/

HOL_REGIONS
PK Region ID
HOL_JOBS
PK JOD ID
HOL_CUSTOMERS
PK Customer ID
FK Location_ID
#
To HOL_LOCATIONS
HOL_COUNTRIES
PK Country ID
FK Region ID
HOL JOB HISTORY
PK
FK
FK JOD_ID
FK Department ID
Job History ID
Employee ID
HOL_ORDERS
PK Order Number
FK Customer_ID
HOL_LOCATIONS
PK Location ID
FK Country ID
HOL EMPLOYEES
PK Employee ID
FK
Department ID
JOD ID
FK
HOL_ORDER_ITEMS
PK Order_item_ID
FK Order Number
FK ISSN
HOL_DEPARTMENTS
PK Department ID
FK Location ID
HOL_BOOKS
PK ISEN
FK Book_Category_ID
HOL_BOOK_CATEGORY
PK Book_Category_ID
Transcribed Image Text:HOL_REGIONS PK Region ID HOL_JOBS PK JOD ID HOL_CUSTOMERS PK Customer ID FK Location_ID # To HOL_LOCATIONS HOL_COUNTRIES PK Country ID FK Region ID HOL JOB HISTORY PK FK FK JOD_ID FK Department ID Job History ID Employee ID HOL_ORDERS PK Order Number FK Customer_ID HOL_LOCATIONS PK Location ID FK Country ID HOL EMPLOYEES PK Employee ID FK Department ID JOD ID FK HOL_ORDER_ITEMS PK Order_item_ID FK Order Number FK ISSN HOL_DEPARTMENTS PK Department ID FK Location ID HOL_BOOKS PK ISEN FK Book_Category_ID HOL_BOOK_CATEGORY PK Book_Category_ID
FK
FK
FK Country Code
Country Name
Region ID
PK
FK
FK
FX
FK
FK
U
FK
FK
FK
FK
Legend
Tables provided
Tables you complete
FK
Region ID
Region Name
Location ID
Street
City
State Province
Postal Code
Country 10
Manager ID
Location ID
Customer ID
First Name
Middle Name
Last Name
Email
Phone
Department ID
Department Name
Birth Date
Gender
Location ID
Order Number
Order Date
Order Total
Customer_ID
Sales Person ID
Order Item ID
Unit Price
Quantity
Order Number
FK
FK ISBN
HOL_REGIONS
INTEGER
VARCHAR2(250)
HOL_COUNTRIES
CHAR(2)
|VARCHAR2(250)
INTEGER
HOL_LOCATIONS
INTEGER
VARCHAR2(250)
VARCHAR2(250)
CHAR(3)
|VARCHAR2(30)
INTEGER
HOL DEPARTMENTS
INTEGER
VARCHAR2(250)
INTEGER
INTEGER
HOL_CUSTOMERS
INTEGER
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2 250
VARCHAR2(30)
DATE
VARCHAR2(30)
INTEGER
HOL ORDERS
INTEGER
DATE
NUMBER 18,2)
INTEGER
INTEGER
HOL_ORDER_ITEMS
INTEGER
NUMBER 12,2)
INTEGER
INTEGER
INTEGER
PK
FK
NN
U
FK
NN
NN
FK
FK
FK
FK
NN
FK
FK
FK
FK
FK
PRIMARY KEY
FOREIGN KEY
FK
NN
NOT NULL
UNIQUE
Employee ID
First Name
Middle Name
Last Name
Email
Phone
Hire Date
Current Salary
Commision Pet
Bonus
Job ID
Manager D
Department ID
Job ID
Job Title
Max Salary
Min Salary
FK
ISBN
NN Book Title
Job History ID
Employee D
Start Date
End Date
Job ID
Department ID
HOL EMPLOYEES
Book Description
Book Price
Book Reviews
User Rating
Book_Category ID
INTEGER
VARCHAR2(250)
VARCHAR2(250)
VARCHAR2 250)
VARCHAR2(250)
VARCHAR2(30)
DATE
NUMBER 12,2)
NUMBER(2,2)
NUMBER 12,2)
INTEGER
INTEGER
INTEGER
HOL JOBS
HOL_JOB HISTORY
Book Category ID
Book_Category_Neme
INTEGER
VARCHAR2(250)
NUMBER 12,2)
NUMBER 12,2)
IDENTITY
INTEGER
DATE
DATE
INTEGER
INTEGER
HOL BOOKS
INTEGER
VARCHAR2(250)
VARCHAR2(4000)
NUMBER 12,2)
INTEGER
NUMBER (4,2)
INTEGER
HOL_BOOK_CATEGORY
INTEGER
VARCHAR2(250)
Book_Category_Description VARCHAR2(4000)
Transcribed Image Text:FK FK FK Country Code Country Name Region ID PK FK FK FX FK FK U FK FK FK FK Legend Tables provided Tables you complete FK Region ID Region Name Location ID Street City State Province Postal Code Country 10 Manager ID Location ID Customer ID First Name Middle Name Last Name Email Phone Department ID Department Name Birth Date Gender Location ID Order Number Order Date Order Total Customer_ID Sales Person ID Order Item ID Unit Price Quantity Order Number FK FK ISBN HOL_REGIONS INTEGER VARCHAR2(250) HOL_COUNTRIES CHAR(2) |VARCHAR2(250) INTEGER HOL_LOCATIONS INTEGER VARCHAR2(250) VARCHAR2(250) CHAR(3) |VARCHAR2(30) INTEGER HOL DEPARTMENTS INTEGER VARCHAR2(250) INTEGER INTEGER HOL_CUSTOMERS INTEGER VARCHAR2(250) VARCHAR2(250) VARCHAR2(250) VARCHAR2 250 VARCHAR2(30) DATE VARCHAR2(30) INTEGER HOL ORDERS INTEGER DATE NUMBER 18,2) INTEGER INTEGER HOL_ORDER_ITEMS INTEGER NUMBER 12,2) INTEGER INTEGER INTEGER PK FK NN U FK NN NN FK FK FK FK NN FK FK FK FK FK PRIMARY KEY FOREIGN KEY FK NN NOT NULL UNIQUE Employee ID First Name Middle Name Last Name Email Phone Hire Date Current Salary Commision Pet Bonus Job ID Manager D Department ID Job ID Job Title Max Salary Min Salary FK ISBN NN Book Title Job History ID Employee D Start Date End Date Job ID Department ID HOL EMPLOYEES Book Description Book Price Book Reviews User Rating Book_Category ID INTEGER VARCHAR2(250) VARCHAR2(250) VARCHAR2 250) VARCHAR2(250) VARCHAR2(30) DATE NUMBER 12,2) NUMBER(2,2) NUMBER 12,2) INTEGER INTEGER INTEGER HOL JOBS HOL_JOB HISTORY Book Category ID Book_Category_Neme INTEGER VARCHAR2(250) NUMBER 12,2) NUMBER 12,2) IDENTITY INTEGER DATE DATE INTEGER INTEGER HOL BOOKS INTEGER VARCHAR2(250) VARCHAR2(4000) NUMBER 12,2) INTEGER NUMBER (4,2) INTEGER HOL_BOOK_CATEGORY INTEGER VARCHAR2(250) Book_Category_Description VARCHAR2(4000)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 7 steps

Blurred answer
Knowledge Booster
Multiple table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning