Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Data Types | Introduction to BigQuery-Specific Features
/
BigQuery Fundamentals

bookChallenge: Data Types

Deslize para mostrar o menu

  1. Write a query that calculates the total revenue per store using the data in the retail_data_updated table: Multiply the quantity (INTEGER) and unit_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).
  2. Write a query that counts how many transactions happened each year and month using the date field in the retail_data_updated table:
    • Extract the year and month from the date field;
    • Group by year and month;
    • Count the number of transactions in each time period;
    • Your query should return these columns:
      • year_month (formatted as YYYY-MM);
      • transaction_count (number of transactions per month).
  3. Write a query that compares the number of online vs in-store transactions in the retail_data_updated table:
    • Group the data by the is_online column (BOOLEAN);
    • Count how many transactions occurred for each value (TRUE = online, FALSE = in-store);
    • Your query should return these columns:
      • is_online (TRUE or FALSE);
      • transaction_count (number of transactions for each group).
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 2

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Seção 3. Capítulo 2
some-alt