Last active
September 2, 2022 02:54
-
-
Save tuanchris/2194a3d8012cb3f245d99ccbda570ac5 to your computer and use it in GitHub Desktop.
fashionly_basic_query
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 | |
DATE(o.created_at) AS order_created_date, | |
SUM(oi.sale_price) AS revenue, | |
COUNT(DISTINCT o.order_id) AS order_count, | |
COUNT(DISTINCT o.user_id) AS customers_orderd | |
FROM | |
`bigquery-public-data.thelook_ecommerce.orders` o | |
LEFT JOIN | |
`bigquery-public-data.thelook_ecommerce.order_items` oi | |
ON | |
o.order_id = oi.order_id | |
WHERE | |
o.status NOT IN ('Cancelled', | |
'Returned') | |
GROUP BY | |
1 | |
ORDER BY | |
1 desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment