Aug2016 cs Q20

0. Consider a database table R with attributes A and B. Which of the following SQL queries is illegal ?

  • Option : B
  • Explanation :
    SELECT A FROM R; legal query SELECT A, COUNT(*) FROM R; Illegal query because we can't SELECT A, COUNT(*) unless it is grouped by A. SELECT A, COUNT(*) FROM R GROUP BY A; legal query SELECT A, B, COUNT(*) FROM R GROUP BY A, B; legal query So, option (B) is correct.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *