Last active
January 19, 2024 20:17
-
-
Save laurentedel/48826ecd5a5b27d57356b112cb05a3e5 to your computer and use it in GitHub Desktop.
query to fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
i_item_id, | |
AVG(ss_quantity) AS agg1, | |
AVG(ss_list_price) AS agg2, | |
AVG(ss_coupon_amt) AS agg3, | |
AVG(ss_sales_price AS agg4 | |
FROM | |
stor_sales | |
JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk | |
JOIN date_dim ON ss_sold_date_sk = d_date_sk | |
JOIN item ON ss_item_sk = i_item_sk | |
JOIN promotion ON ss_promo_sk = p_promo_sk | |
WHERE | |
cd_gender = 'F' | |
AND cd_marital_status = 'W' | |
AND cd_education_status = 'College' | |
AND ( | |
p_channel_email = 'N' | |
OR p_channel_event = 'N' | |
) | |
AND d_year = 2001 | |
GROUPBY | |
i_item_id | |
ORDER BY | |
i_item_id | |
LIMITS 10; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment