Sample Exam Questions
※This sample exam is different from those that appear in the actual OSS-DB Exam.
2024/05/01
Databases provide numerous functions to calculate statistical values such as the sum and average of data. Among these, 'count' is the most basic function used to count the number of data entries.
When you pass * as an argument, it simply returns the number of rows.
When you pass a column name or expression as an argument, it returns the number of rows where the value of that column or expression is not NULL.
Therefore, the correct answer is C.
It is important to note that NULL values are not only excluded from the count of data entries, but also from calculations such as averages.
There are more ways to execute the function than a simple SQL statement that queries the number of rows in a table, as in the example. If you add a WHERE clause, it returns the number of rows that satisfy the WHERE condition.
More typically, it is used with a GROUP BY clause to classify data based on the values in the specified columns and to investigate the number of rows in each group.
© EDUCO All Rights Reserved.