Challenge: Data Types
Deslize para mostrar o menu
- Write a query that calculates the total revenue per store using the data in the
retail_data_updatedtable: Multiply thequantity(INTEGER) andunit_price(FLOAT) to calculate revenue per transaction.- Group the results by
store_id; - Sum the revenue for each store;
- Your query should return these columns:
store_id(identifier for each store);total_revenue(sum of quantity × unit_price per store).
- Group the results by
- Write a query that counts how many transactions happened each year and month using the
datefield in theretail_data_updatedtable:- Extract the year and month from the
datefield; - Group by year and month;
- Count the number of transactions in each time period;
- Your query should return these columns:
year_month(formatted asYYYY-MM);transaction_count(number of transactions per month).
- Extract the year and month from the
- Write a query that compares the number of online vs in-store transactions in the
retail_data_updatedtable:- Group the data by the
is_onlinecolumn (BOOLEAN); - Count how many transactions occurred for each value (
TRUE= online,FALSE= in-store); - Your query should return these columns:
is_online(TRUEorFALSE);transaction_count(number of transactions for each group).
- Group the data by the
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 2
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Seção 3. Capítulo 2