select time_by_day.the_year as c0, customer.gender as c1, customer.marital_status as c2, store.store_type as c3, promotion.promotion_name as c4, product_class.product_family as c5, product_class.product_department as c6, product_class.product_category as c7, product_class.product_subcategory as c8, product.brand_name as c9, product.product_name as c10 from time_by_day as time_by_day, sales_fact_1997 as sales_fact_1997, customer as customer, store as store, promotion as promotion, product as product, product_class as product_class where sales_fact_1997.time_id = time_by_day.time_id and sales_fact_1997.customer_id = customer.customer_id and sales_fact_1997.store_id = store.store_id and sales_fact_1997.promotion_id = promotion.promotion_id and product.product_class_id = product_class.product_class_id and sales_fact_1997.product_id = product.product_id and (time_by_day.the_year = 1997) and (promotion.promotion_name in ('Bag Stuffers', 'Best Savings', 'Big Promo', 'Big Time Discounts', 'Big Time Savings', 'Bye Bye Baby', 'Cash Register Lottery', 'Coupon Spectacular', 'Dimes Off', 'Dollar Cutters', 'Dollar Days', 'Double Down Sale', 'Double Your Savings', 'Fantastic Discounts', 'Free For All', 'Go For It', 'Green Light Days', 'Green Light Special', 'High Roller Savings', 'I Cant Believe It Sale', 'Money Grabbers', 'Money Savers', 'Mystery Sale', 'No Promotion', 'One Day Sale', 'Pick Your Savings', 'Price Cutters', 'Price Destroyers', 'Price Savers', 'Price Slashers', 'Price Smashers', 'Price Winners', 'Sale Winners', 'Sales Days', 'Sales Galore', 'Save-It Sale', 'Saving Days', 'Savings Galore', 'Shelf Clearing Days', 'Shelf Emptiers', 'Super Duper Savers', 'Super Savers', 'Super Wallet Savers', 'Three for One', 'Tip Top Savings', 'Two Day Sale', 'Two for One', 'Unbeatable Price Savers', 'Wallet Savers', 'Weekend Markdown', 'You Save Days')) and (product.product_name = 'Pearl Imported Beer') group by time_by_day.the_year, customer.gender, customer.marital_status, store.store_type, promotion.promotion_name, product_class.product_family, product_class.product_department, product_class.product_category, product_class.product_subcategory, product.brand_name, product.product_name order by time_by_day.the_year ASC NULLS LAST, customer.gender ASC NULLS LAST, customer.marital_status ASC NULLS LAST, store.store_type ASC NULLS LAST, promotion.promotion_name ASC NULLS LAST, product_class.product_family ASC NULLS LAST, product_class.product_department ASC NULLS LAST, product_class.product_category ASC NULLS LAST, product_class.product_subcategory ASC NULLS LAST, product.brand_name ASC NULLS LAST, product.product_name ASC NULLS LAST; |