MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which two statements are true regarding the COUNT function? A. COUNT(cust ____ id) returns the number of rows including rows with duplicate customer IDs and NULL value in the CUST ____ ID column B. A SELECT statement using COUNT function with a DISTINCT keyword cannot have a WHERE clause C. COUNT(*) returns the number of rows including duplicate rows and rows containing NULL value in any of the columns D. COUNT(DISTINCT inv ____ amt) returns the number of rows excluding rows containing duplicates and NULL values in the INV ____ AMT column
A
A only
B
A, B
C
B, C
D
C, D
Explanation: 

Detailed explanation-1: -Which of the following statements are true about the COUNT function? Answer: B. The COUNT(*) counts the number of rows including duplicates and NULLs. Use DISTINCT and ALL keyword to restrict duplicate and NULL values.

Detailed explanation-2: -The COUNT function counts the number of cells that contain numbers, and counts numbers within the list of arguments. Use the COUNT function to get the number of entries in a number field that is in a range or array of numbers.

Detailed explanation-3: -COUNT(*) returns the number of rows in the table or view. COUNT(*) counts all rows, including ones that contain duplicate column values or NULL values.

Detailed explanation-4: -The COUNT() is a function that returns the number of records in a table.

There is 1 question to complete.