Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

4. OUTER JOIN Scenario 4: The logistics department of PVFC is trying to optimize

ID: 348336 • Letter: 4

Question

4. OUTER JOIN Scenario 4: The logistics department of PVFC is trying to optimize the firm's capacity of processing orders in territory areas. As a data analyst in the Bl department, you are given the following three sets of requirements and asked to generate three result sets from the PVFD DB for the logistics department. ui Display territory ID, territory name, customer ID and customer name even if the customer does not have any business in one territory. Sort the result set first by territory name in alphabetic order and by customer ID in ascending order SELECT FROM Customer_T ASc LEFT JOIN DOES, BUSINESS-IN-TAS doi ON c. Customer-ID-doiCustomer-ID LEFT JOIN Territory_TAS_ ON ORDER BY

Explanation / Answer

Select T.Territory_ID, T.Territory_Name, c.Customer_ID, c.Customer_Name

Explanation: We have all the columns written in select statement, this will give us an output having all the values for all the columns.

From Customer_T AS c, Territory_T AS T

Explanation: These are the tables which will be used to fetch the data.

Left Join Does_Business_In_T AS doi ON c.Customer_ID= doi.Customer_ID

Left Join Territory_T AS T ON Customer AS c

Explanation: These two statements joins and combines two tables and forms them into 1 larger tables using which data is fetched.

Order by T.Territory_Name

Order by c.Customer_ID;

Explanation: Sorting of results is done by the last 2 statement.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote