Challenge: Total Sales Calculation
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
quantitycolumn 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.
Løsning
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 5.56
Challenge: Total Sales Calculation
Sveip for å vise menyen
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
quantitycolumn 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.
Løsning
Takk for tilbakemeldingene dine!
single