Bird
0
0

Find the error in this query: SELECT AVG(salary FROM Employees;

medium📝 Debug Q7 of 15
SQL - Aggregate Functions
Find the error in this query: SELECT AVG(salary FROM Employees;
AMissing closing parenthesis for AVG()
BAVG() cannot be used on salary
CEmployees table does not exist
DAVG() requires GROUP BY clause
Step-by-Step Solution
Solution:
  1. Step 1: Check parentheses balance

    AVG() function requires opening and closing parentheses around the column.
  2. Step 2: Identify missing closing parenthesis

    The query misses the closing parenthesis after salary.
  3. Final Answer:

    Missing closing parenthesis for AVG() -> Option A
  4. Quick Check:

    Parentheses must be balanced in AVG() [OK]
Quick Trick: Check parentheses carefully in functions [OK]
Common Mistakes:
MISTAKES
  • Forgetting closing parenthesis
  • Misplacing parentheses in function calls

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes