Multiple choice technology databases

Suppose emp table contains 5 records then Select 1 from emp; o/p ?

  1. 5

  2. 1

  3. five times 1

  4. one time 5

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

SELECT 1 from emp returns the constant value 1 for each row in the table. With 5 records, it outputs the value 1 five times (5 rows x 1 column). This is different from SELECT COUNT(*) which would return just 5.