Challenge: Data Types
Pyyhkäise näyttääksesi valikon
- 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
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 3. Luku 2
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Osio 3. Luku 2