Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Fix code CREATE VIEW clean _ data AS SELECT product _ id , COALESCE ( product _ type, 'Unknown' ) AS product _ type, COALESCE
Fix code CREATE VIEW cleandata AS
SELECT
productid
COALESCEproducttype, 'Unknown' AS producttype,
COALESCEbrand 'Unknown' AS brand,
COALESCEweightSELECT ROUNDPERCENTILECONT WITHIN GROUP ORDER BY weight FROM products AS weight,
COALESCEpriceSELECT ROUNDPERCENTILECONT WITHIN GROUP ORDER BY price
FROM products AS price,
COALESCEaverageunitssold, AS averageunitssold,
COALESCEyearadded, AS yearadded,
COALESCEstocklocation, 'Unknown' AS stocklocation
FROM
SELECT
NTILE OVER ORDER BY weight AS weightpercentile,
NTILE OVER ORDER BY price AS pricepercentile
FROM products
WHERE weightpercentile BETWEEN AND
AND pricepercentile BETWEEN AND ;
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