CBSE Class 12 Informatics Practices Question 35 of 79

Database Query using SQL — Question 6

Back to all questions
6
Question

Question 6

If column "Salary" contains the data set {10000,15000,25000,10000,15000}, what will be the output after the execution of the given query?

SELECT SUM(DISTINCT SALARY) FROM EMPLOYEE;
  1. 75000
  2. 25000
  3. 10000
  4. 50000
Answer

50000

Reason — The DISTINCT keyword in the SUM() function ensures that only unique values of "Salary" are summed. Therefore, the query will sum up the distinct values of salary, which are 10000, 15000, and 25000, resulting in an output of 50000.