Sección 2. Capítulo 1
single
Challenge: Total Sales Calculation
Desliza para mostrar el menú
Tarea
Desliza para comenzar 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, usingCOUNT(*)total_quantity— total sum of thequantitycolumn, usingSUM(quantity)
- Use a single
SELECTstatement with no subqueries - Do not use
WHERE,GROUP BY, or any filtering — aggregate the entire table - Column aliases must match exactly:
total_salesandtotal_quantity
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 1
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla