Which of following is incorrect SQL?

2025

Which of following is incorrect SQL?

  1. A.

    Select max(marks) from student

  2. B.

    Select sum(marks) from student

  3. C.

    Select max(marks1 + marks2) from student

  4. D.

    Select sum(marks1 , marks2) from student

Attempted by 801 students.

Show answer & explanation

Correct answer: D

Ans D

Solution

Aggregate functions are functions that take a collection (a set or multiset) of values as input and return a single value.

The input to sum and avg must be a collection of numbers, but the other operators can operate on collections of non-numeric data types, such as strings.

Sum function cannot work on two columns.

Explore the full course: Wipro Preparation