Multiple choice technology databases

How would you find out the total number of rows in a DB2 table?

  1. Use SELECT COUNT(*)...in db2 query

  2. Use SELECT DISTINCT...in db2 query

  3. Use SELECT MAX(...)...in db2 query

  4. Use SELECT ROWNUM(*)...in db2 query

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

SELECT COUNT(*) is the standard SQL command to count the total number of rows in a table. This works in DB2 as well as other SQL databases. SELECT DISTINCT returns unique rows, SELECT MAX returns the maximum value of a column, and ROWNUM is an Oracle pseudocolumn, not standard DB2 syntax.