Hey @Dmitry_Polovinkin!
I hope you’re doing great. There is a table given in the question and we need to tell what the query outputs. The table has only one column “Number” as follows:
And following is the query:
SELECT SUM(1) FROM tableA;
SELECT SUM(2) FROM tableA;
SELECT SUM(3) FROM tableA;
We usually use the name of the column with the SUM()
function. But if we specify a number in the function. It returns the number of rows if 1
is specified. In the case of 2
, it will multiply the number of rows by 2. The number of rows is multiplied by 3 if we have specified 3
in the SUM()
function. And the query given in the question will output 5, 10, and 15 using this logic.
I hope this explanation helps. Also, thank you for pointing this out. We are working on reviewing this course and we will soon fix the gaps in this course.
Happy learning!