Bird
0
0

Which of the following is the correct syntax to get the total sales from a table named Orders with a column Amount?

easy📝 Syntax Q12 of 15
SQL - Aggregate Functions
Which of the following is the correct syntax to get the total sales from a table named Orders with a column Amount?
ASELECT COUNT(Amount) FROM Orders;
BSELECT TOTAL(Amount) FROM Orders;
CSELECT SUM(Amount) FROM Orders;
DSELECT ADD(Amount) FROM Orders;
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct aggregation function for total

    The function to add values is SUM(), so SUM(Amount) is correct.
  2. Step 2: Check syntax correctness

    SUM(Amount) with SELECT and FROM table is valid SQL syntax.
  3. Final Answer:

    SELECT SUM(Amount) FROM Orders; -> Option C
  4. Quick Check:

    SUM() sums values [OK]
Quick Trick: Use SUM() to add values in SQL [OK]
Common Mistakes:
MISTAKES
  • Using TOTAL() which is not standard SQL
  • Using COUNT() instead of SUM() for totals
  • Using ADD() which is not a SQL function

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes