Computer AwarenessVery hardIBPS SO IT · SBI PO

A table CUSTOMER has 6 rows; the Phone column is NULL in 2 of them. What do COUNT(*) and COUNT(Phone) return?

  1. A. 6 and 6
  2. B. 4 and 4
  3. C. 6 and 4
  4. D. 4 and 6

Correct answer: C. 6 and 4

COUNT(*) counts every row, including those with NULLs, so it gives 6; COUNT(column) ignores NULL values, so COUNT(Phone) gives 4.

हिंदी में

CUSTOMER तालिका में 6 पंक्तियाँ हैं; उनमें से 2 में Phone स्तंभ NULL है। COUNT(*) और COUNT(Phone) क्या लौटाते हैं?

  1. A. 6 और 6
  2. B. 4 और 4
  3. C. 6 और 4
  4. D. 4 और 6

उत्तर: C. COUNT(*) NULL वाली पंक्तियों सहित प्रत्येक पंक्ति गिनता है, इसलिए 6 देता है; COUNT(column) NULL मानों की उपेक्षा करता है, इसलिए COUNT(Phone) 4 देता है।

More Computer Awareness questions

Exams that ask this topic