Informatics Practices

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

SQL Queries

2 Likes

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.

Answered By

2 Likes


Related Questions