Below are some example queries/use cases used in day to day data engineering tasks.
suppose, you are given three tables customers, orders and orders_payment. You are asked to find the city wise ordered amount from these tables.
Note : This data is taken from https://www.kaggle.com/datasets/olistbr/brazilian-ecommerce
Note : This data is taken from https://www.kaggle.com/datasets/olistbr/brazilian-ecommerce
Note : This data is taken from https://www.kaggle.com/datasets/olistbr/brazilian-ecommerce
To find out the city wise total ordered amount from above three tables, we need to use join and aggregate functions.
select cust.customer_city, sum(paymnt.payment_value) as total_amount from `hardy-position-352014.ecommerce.customers` cust left join `hardy-position-352014.ecommerce.orders` ord on cust.customer_id = ord.customer_id left join `hardy-position-352014.ecommerce.orders-payments` paymnt on ord.order_id = paymnt.order_id group by cust.customer_city