Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Total Sales Calculation | Aggregating and Grouping Data
SQL for Data Analysis
Sezione 2. Capitolo 1
single

single

bookChallenge: Total Sales Calculation

Scorri per mostrare il menu

Compito

Scorri per iniziare a programmare

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

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 1
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt