Computer AwarenessVery hardIBPS SO IT Officer
A column Bonus holds the values 10, 20, NULL and 30 in four rows. What does SELECT AVG(Bonus) return?
- A. 20
- B. 15
- C. NULL
- D. 60
Correct answer: A. 20
Aggregate functions skip NULLs, so AVG = (10 + 20 + 30) ÷ 3 = 20. Treating NULL as 0 and dividing by 4 gives the trap 15.
हिंदी में
चार पंक्तियों में Bonus स्तंभ के मान 10, 20, NULL और 30 हैं। SELECT AVG(Bonus) क्या लौटाता है?
- A. 20
- B. 15
- C. NULL
- D. 60
उत्तर: A. समुच्चय फ़ंक्शन NULL को छोड़ देते हैं, इसलिए AVG = (10 + 20 + 30) ÷ 3 = 20। NULL को 0 मानकर 4 से भाग देने पर जाल वाला उत्तर 15 आता है।
More Computer Awareness questions
- Which statement about DELETE and TRUNCATE in SQL is correct?
- In which order does a database logically process the clauses of a SELECT statement?
- The condition WHERE Salary BETWEEN 20000 AND 30000 selects rows whose salary is:
- A query must list the customers who have no phone number recorded (the Phone column is NULL). Which condition works?
- A City column holds Delhi, Pune, Delhi, NULL, Pune, NULL in six rows. What does SELECT COUNT(DISTINCT City) return?
- A transaction runs: INSERT row 1; SAVEPOINT s1; INSERT row 2; ROLLBACK TO s1; COMMIT. Which of the inserted rows are in the table…