Multiple choice

What will happen if the given emp table is queried?

select enpno,DISTINCT ename,Salary from emp;

  1. EMPNO ,unique value of ENAME and then SALARY are displayed.

  2. EMPNO ,unique value of the two columns, ENAME and salary are displayed.

  3. DISTINCT is not a valid keyword in SQL.

  4. No values will be displayed because the statement will return an error.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The query will return an error because DISTINCT cannot be used for individual columns in a SELECT statement - it must apply to all selected columns or the entire row. The syntax 'select enpno, DISTINCT ename, Salary' is invalid because DISTINCT must come before the column list and apply to the combination of all columns, not just one column.