-- $Id: q01-tpch14.sql 2657 2007-06-12 16:08:15Z rdempsey $
-- First query in 100 GB stream0 (tpch14).
SELECT 
	100.00 * SUM ( CASE 
		WHEN P_TYPE LIKE 'PROMO%%'
		THEN L_EXTENDEDPRICE*(1-L_DISCOUNT)
		ELSE 0
	END) / SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) AS PROMO_REVENUE
FROM 
	LINEITEM,
	PART
WHERE 
	L_PARTKEY = P_PARTKEY AND
	L_SHIPDATE >= date '1994-01-01' AND
	L_SHIPDATE < date '1994-01-01' + interval '1' month;

