Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Total Sales Calculation | Aggregating and Grouping Data
SQL for Data Analysis
Seção 2. Capítulo 1
single

single

bookChallenge: Total Sales Calculation

Deslize para mostrar o menu

Tarefa

Deslize para começar a programar

Write a SQL query against the sales table that returns two summary metrics in a single row.

  • Return exactly one row with two columns:
    • total_sales — total number of rows in the table, using COUNT(*)
    • total_quantity — total sum of the quantity column, using SUM(quantity)
  • Use a single SELECT statement with no subqueries
  • Do not use WHERE, GROUP BY, or any filtering — aggregate the entire table
  • Column aliases must match exactly: total_sales and total_quantity

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 1
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

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

some-alt