nerdexam
Oracle

1Z0-061 · Question #55

Which two statements are true regarding the count function?

The correct answer is B. Count (*) returns the number of rows including duplicate rows and rows containing null value in any D. Count (distinct inv_amt) returns the number of rows excluding rows containing duplicates and NULL. Using the COUNT Function The COUNT function has three formats: COUNT(DISTINCT expr) COUNT() returns the number of rows in a table that satisfy the criteria of the SELECT statement, including duplicate rows and rows containing null values in any of the columns. If a WHERE clause…

Reporting Aggregated Data using the Group Functions

Question

Which two statements are true regarding the count function?

Options

  • AThe count function can be used only for CHAR, VARCHAR2, and NUMBER data types.
  • BCount (*) returns the number of rows including duplicate rows and rows containing null value in any
  • CCount (cust_id) returns the number of rows including rows with duplicate customer IDs and NULL
  • DCount (distinct inv_amt) returns the number of rows excluding rows containing duplicates and NULL
  • EA select statement using the COUNT function with a DISTINCT keyword cannot have a where clause.

How the community answered

(39 responses)
  • A
    5% (2)
  • B
    79% (31)
  • C
    13% (5)
  • E
    3% (1)

Explanation

Using the COUNT Function The COUNT function has three formats: COUNT(DISTINCT expr) COUNT() returns the number of rows in a table that satisfy the criteria of the SELECT statement, including duplicate rows and rows containing null values in any of the columns. If a WHERE clause is included in the SELECT statement, COUNT() returns the number of rows that satisfy the condition in the WHERE clause. COUNT(expr) returns the number of non-null values that are in the column identified by expr. COUNT(DISTINCT expr) returns the number of unique, non-null values that are in the column identified by expr.

Topics

#COUNT function#DISTINCT#NULL values#aggregate functions

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice