Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Scenario: In a database with a Products table containing columns ProductID, CategoryID, and Price, which SQL query would create a view named CategoryAverages to retrieve
Scenario: In a database with a Products table containing columns ProductID, CategoryID, and Price, which SQL query would create a view named CategoryAverages to retrieve the average price for each product category?
Context:
Products Table Columns:
ProductID
CategoryID
Price
A
CREATE VIEW CategoryAverages AS
SELECT CategoryID, AVGPrice AS AvgPrice
FROM Products
GROUP BY CategoryID;
B
CREATE VIEW CategoryAverages AS
SELECT
FROM Products
GROUP BY CategoryID, AVGPrice;
C
CREATE VIEW CategoryAverages CategoryID AvgPrice AS
SELECT
FROM Products
GROUP BY CategoryID, AVGPrice;
D
CREATE VIEW CategoryAverages AS
SELECT CategoryID, Price
FROM Products
WHERE AVGPrice;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started