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

bookChallenge: Total Sales Calculation

Tehtävä

Swipe to start coding

Write a SQL query on the provided sales table to calculate two summary metrics in a single query:

  • The total number of sales records (rows) in the table.
  • The total sum of the quantity column across all sales records.

Your query must return both results as separate columns in a single row. Do not include any print statements or comments in your query. Use aggregate functions such as COUNT(*) and SUM(quantity) to obtain the required results.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 1
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookChallenge: Total Sales Calculation

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

Write a SQL query on the provided sales table to calculate two summary metrics in a single query:

  • The total number of sales records (rows) in the table.
  • The total sum of the quantity column across all sales records.

Your query must return both results as separate columns in a single row. Do not include any print statements or comments in your query. Use aggregate functions such as COUNT(*) and SUM(quantity) to obtain the required results.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 1
single

single

some-alt