📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!

  • google app store apple app store
  • ✖

      Question

      Which SQL function is used to count the number of rows

      in a table?
      A SUM() Correct Answer Incorrect Answer
      B COUNT() Correct Answer Incorrect Answer
      C AVG() Correct Answer Incorrect Answer
      D MAX() Correct Answer Incorrect Answer
      E MIN() Correct Answer Incorrect Answer

      Solution

      The COUNT() function in SQL is specifically designed to return the number of rows that match a specified condition. This function can be used to count all rows in a table, rows that satisfy a particular condition, or rows for a specific column. It is one of the aggregate functions in SQL that helps in summarizing data. Option A (SUM()) is incorrect because SUM() is used to calculate the total of a numeric column, not to count rows. Option C (AVG()) is incorrect as it calculates the average value of a numeric column. Option D (MAX()) is incorrect because it returns the maximum value in a specified column. Option E (MIN()) is incorrect since it returns the minimum value in a specified column.

      Practice Next

      Relevant for Exams:

      ask-question