4 votes 4 votes Consider the following relation $R$ $$\textbf{R}$$$$\begin{array}{|c|c|c|c|c|c|c|} \hline \textbf{A} & \textbf{B} \\ \hline 1 & \text{NULL} \\ \hline 1 & \text{NULL} \\ \hline \text{NULL} & \text{NULL} \\ \hline 3 & \text{NULL} \\ \hline \end{array}$$ The output of the following query will be _____ select count(*) + count(A) + count(B) from R Databases go2025-dbms-1 numerical-answers sql + – gatecse asked Oct 8, 2020 gatecse 368 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 5 votes 5 votes Count(*) will count including null but count(A) and count(B) will exclude NULL. So, we get $4+3+0 = 7.$ gatecse answered Oct 8, 2020 • selected Oct 2, 2021 by Arjun gatecse comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments Arpit Patel commented Dec 21, 2021 reply Follow Share @anmol_ Count(*) counts NULL so it should be 5 then. 1 votes 1 votes Arpit Patel commented Dec 21, 2021 reply Follow Share SQL NULL Cases 3 votes 3 votes anmol_ commented Dec 21, 2021 reply Follow Share Alright! Thank you :) 0 votes 0 votes Please log in or register to add a comment.