Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. select distinct p.product_id, p.product_name
  2. from sales_fact sf join product p on sf.product_id=p.product_id join time_by_day t on sf.time_id=t.time_id join store st on sf.store_id=st.store_id join promotion pr on pr.promotion_id=sf.promotion_id
  3. where t.the_year= 1997 and sf.store_sales>15.00 and sf.product_id in
  4. (select sf.product_id
  5. from sales_fact sf join product p on sf.product_id=p.product_id join time_by_day t on sf.time_id=t.time_id join store st on sf.store_id=st.store_id join promotion pr on pr.promotion_id=sf.promotion_id
  6. where t.the_year=1998 and pr.promotion_name='Price Winners'and sf.store_sales>10.00)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement