blob: f883860620ec5bc42995e58ab1e587e6bd8f6ff6 [file] [log] [blame]
SELECT
100.00 * SUM(CASE
WHEN P.P_TYPE LIKE 'PROMO%'
THEN L.L_EXTENDEDPRICE * (1 - L.L_DISCOUNT)
ELSE 0
END) / SUM(L.L_EXTENDEDPRICE * (1 - L.L_DISCOUNT)) AS PROMO_REVENUE
FROM
lineitem L,
part P
WHERE
L.L_PARTKEY = P.P_PARTKEY
AND L.L_SHIPDate >= DATE '1994-08-01'
AND L.L_SHIPDate < CAST((DATE '1994-08-01' + INTERVAL '1' MONTH) AS DATE);