We are using Microsoft SQL 2017 for Database Administration. Please provide a de
ID: 3902857 • Letter: W
Question
We are using Microsoft SQL 2017 for Database Administration. Please provide a detailed explanation. Thank you.
22. In the schema module4schema yourInitials, create a view named vwModule4_yourInitialsjoining Sales.SalesOrderHeader to Sales.SalesOrderDetail with the following columns: Derivation Column Name OrderYear ProductID Quantity datepart(year, SalesOrderHeader.orderdate) as OrderYear alesorderDetail.ProductID count(*) To create the view, you will need to group by the derived value of the order year and the product ID.Explanation / Answer
If you have any doubts, please give me comment...
CREATE VIEW vwModule4_AN AS
SELECT datepart(year, SalesOrderHeader.orderdate) as OrderYear, SalesOrderDetail.ProductID AS ProductID, count(*) AS Quantity
FROM Sales.SalesOrderHeader NATURAL JOIN Sales.SalesOrderDetail
GROUP BY datepart(year, SalesOrderHeader.orderdate), SalesOrderDetail.ProductID;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.