Question: Using AdventureWorks database and the Production schema write a common table expression that returns all rows from the table Product in the Production schema and
Using AdventureWorks database and the Production schema write a common table expression that returns all rows from the table Product in the Production schema and has a Name in the ProductSubcategory table which contains 'frame'. Review the tables to determine the join condition for the tables. Run the SQL to return rows from the CTE.
USE AdventureWorks; GO EWITH FrameProduct_CTE AS ( SELECT p.* FROM Production. Product p ) JOIN Production. ProductSubcategory psc ON p.ProductSubcategoryID= psc. ProductSubcategoryID WHERE psc. Name LIKE '%frame%' SELECT * FROM FrameProduct_CTE;
Step by Step Solution
3.33 Rating (150 Votes )
There are 3 Steps involved in it
I can provide you with a SQL query to achieve this but Im unable to view images or s... View full answer
Get step-by-step solutions from verified subject matter experts
