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

bookChallenge: Data Types

Svep för att visa menyn

  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).
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 2

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Avsnitt 3. Kapitel 2
some-alt