SQL - Aggregate FunctionsWhich of the following SQL queries correctly combines COUNT and AVG aggregates on a table named sales?ASELECT COUNT(*), AVG(amount) FROM sales;BSELECT COUNT(*), AVG(amount) sales;CSELECT COUNT(*), AVG(amount) WHERE sales;DSELECT COUNT(*), AVG(amount) FROM;Check Answer
Step-by-Step SolutionSolution:Step 1: Check basic SELECT syntaxCorrect syntax requires SELECT, aggregates, and FROM table name.Step 2: Validate each optionSELECT COUNT(*), AVG(amount) FROM sales; has correct syntax; others miss FROM or have wrong clauses.Final Answer:SELECT COUNT(*), AVG(amount) FROM sales; -> Option AQuick Check:Correct aggregate syntax = SELECT COUNT(*), AVG(amount) FROM sales; [OK]Quick Trick: Always include FROM table after aggregates [OK]Common Mistakes:MISTAKESOmitting FROM clauseUsing WHERE without conditionIncorrect clause order
Master "Aggregate Functions" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Aggregate Functions - SUM function - Quiz 4medium INNER JOIN - INNER JOIN with multiple conditions - Quiz 7medium INNER JOIN - How the join engine matches rows - Quiz 3easy LEFT and RIGHT JOIN - RIGHT JOIN execution behavior - Quiz 12easy LEFT and RIGHT JOIN - Why outer joins are needed - Quiz 9hard Set Operations - Set operation column matching rules - Quiz 1easy Subqueries - Subquery with IN operator - Quiz 7medium Subqueries - Subquery with EXISTS operator - Quiz 3easy Table Relationships - Foreign key linking mental model - Quiz 10hard Views - View as a saved query mental model - Quiz 10hard