Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Why is my code not outputting results? CREATE TEMP TABLE clean _ data AS SELECT product _ id , COALESCE ( product _ type, 'Unknown'
Why is my code not outputting results? CREATE TEMP TABLE cleandata AS
SELECT
productid
COALESCEproducttype, 'Unknown' AS producttype,
COALESCEbrand 'Unknown' AS brand,
SELECT ROUNDAVGCOALESCENULLIFsubstringweight::text, ::NUMERIC
FROM
SELECT weight,
ROWNUMBER OVER ORDER BY COALESCENULLIFsubstringweight::text, ::NUMERIC AS rownum,
COUNT OVER AS totalrows
FROM products
WHERE weight::text ~
AS sub
WHERE rownum IN totalrows totalrows
AS weightmedian,
SELECT ROUNDAVGCOALESCENULLIFsubstringprice::text, ::NUMERIC
FROM
SELECT price,
ROWNUMBER OVER ORDER BY COALESCENULLIFsubstringprice::text, ::NUMERIC AS rownum,
COUNT OVER AS totalrows
FROM products
WHERE price::text ~
AS sub
WHERE rownum IN totalrows totalrows
AS pricemedian,
COALESCEaverageunitssold, AS averageunitssold,
COALESCEyearadded, AS yearadded,
COALESCEstocklocation, 'Unknown' AS stocklocation
FROM products;
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