SIMULATION -
You create a table named Sales.Categories by running the following Transact-SQL statement:
You add the following data to the table.
You need to create a query that uses a common table expression (CTE) to show the parent category of each category. The query must meet the following requirements:
✑ Return all columns from the Categories table in the order shown.
✑ Exclude all categories that do not have a parent category.
Construct the query using the following guidelines:
✑ Name the expression ParentCategories.
✑ Use PC as the alias for the expression.
✑ Use C as the alias for the Categories table.
Use the AS keyword for all table aliases.
✑ Use individual column names for each column that the query returns.
✑ Do not use a prefix for any column name.
✑ Do not use implicit joins.
Do not surround object names with square brackets.
Part of the correct Transact-SQL has been provided in the answer area below. Enter the code in the answer area that resolves the problem and meets the stated goals or requirements. You can add code within the code that has been provided as well as below it.
Use the Check Syntax button to verify your work. Any syntax or spelling errors will be reported by line and character position. You may check syntax as many times as needed.
raf77
Highly Voted 5 years, 8 months agoM4x
5 years, 8 months agoimran
5 years, 6 months agoimran
5 years, 6 months agoIlray
5 years, 8 months agoimran
5 years, 6 months agoVermonster
Most Recent 4 years, 4 months agokiri2020
4 years, 7 months agoNhiN
4 years, 4 months agoAghie
4 years, 9 months agolilyzhang
4 years, 10 months agoAnette
4 years, 11 months agojortizhuedo
5 years, 1 month agoMML
5 years, 1 month agojortizhuedo
5 years, 1 month agojortizhuedo
5 years, 1 month agojortizhuedo
5 years, 1 month agomoehijawe
5 years, 4 months agomlourinho
5 years, 6 months agoNew_user
5 years, 4 months ago