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

You are given a database in a MS Access file that contains data collected in an

ID: 3743309 • Letter: Y

Question

You are given a database in a MS Access file that contains data collected in an outdoor sports retail store. The retail store hired you as a data analyst to answer questions in order to help them make business decisions that will help them grow. Write the SQL statement for each query.

Table Name FROM 1 Conditional Expression WHERE2 GROUP BYCondstional HAVING 4 Colum Lise ORDER BY 6 ATALOG SK KU DATA SKU Descriotion Buver WarehouseID SKU SKU Description Quantity Price StorezIP QuantityOnHand QuantityOnOrder Manager OrderYear OrderTotal uery Question SQL Statement Show the sku, description, and the buyer name "in" department name in one cell as sponsor (RTRIM(Buyer)& in '&RTRIM(Department) as Sponsor) For each department, show the number of items in which catalog page for 2014 was not blank For each department, show the number of items they contain for sku/item that is not 302000 and the total number of items is more than 1 Can you show an example of an SQL cross join (Cartesian product) for the retail_order and order item tables? 4 This is illogical in database work because we only need rows that somehow logically correspond in the two tables 5 Can you create an implicit SQL inner join for retail_order and order item tables? Sort by order number and SKU of Order_Item 6 Can you create an explicit SQL inner join for retail_order and order_item tables? Sort by order number and SKU of Order_ltem

Explanation / Answer

If you have any doutbs, please give me comment...

-- 1)

SELECT SKU, [SKU Description], (RTRIM(Buyer)&' in '&RTRIM(Department) as sponser)

FROM [SKU Data];

-- 2)

SELECT Department, COUNT(*) AS no_of_items

FROM [CATALOG SKU 2014]

GROUP BY Department;

-- 3)

SELECT Department, COUNT(*) AS no_of_items

FROM [CATALOG SKU 2014]

WHERE SKU<>302000

GROUP BY Department

HAVING COUNT(*)>1;

-- 4)

SELECT *

FROM RETAIL_ORDER R CROSS JOIN ORDER_ITEM O

WHERE R.OrderNumber = O.OrderNumber;

--5)

SELECT *

FROM RETAIL_ORDER R, ORDER_ITEM O

WHERE R.OrderNumber = O.OrderNumber;

-- 6)

SELECT *

FROM REATAIL_ORDER R INNER JOIN ORDER_ITEM O ON R.OrderNumber = O.OrderNumber

ORDER BY OrderNumber, SKU;

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