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

single

bookChallenge: Total Sales Calculation

Sveip for å vise menyen

Oppgave

Sveip for å begynne å kode

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

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 1
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

some-alt