368 views
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

1 Answer

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.$
selected by
Answer:

Related questions

1 votes
1 votes
1 answer
1
gatecse asked Oct 8, 2020
289 views
Given the following relation $R$$$\textbf{R}$$$$\begin{array}{|c|c|c|c|c|c|c|}\hline \textbf{A} & \textbf{B} \\\hline1 & \text{NULL}\\ \hline1 & \text{NULL}\\ \hline\text...
3 votes
3 votes
1 answer
2
gatecse asked Oct 8, 2020
351 views
Consider the following relation.$$\textbf{Emp}$$$$\begin{array}{|c|c|c|c|c|c|c|}\hline\underline{\textbf{EmpId}} & \textbf{DeptNo} & \textbf{EmpName} & \textbf{Salary} \\...
2 votes
2 votes
1 answer
3
gatecse asked Oct 8, 2020
275 views
Consider the following relation instance.$$\textbf{Student}$$$$\begin{array}{|c|c|c|c|c|}\hline \textbf{Roll}& \textbf{FirstName} & \textbf{LastName} & \textbf{Weight}\\\...
4 votes
4 votes
2 answers
4
gatecse asked Oct 8, 2020
465 views
Consider the following relations.$$\textbf{Emp}$$$$\begin{array}{|c|c|c|c|c|c|c|} \hline\underline{\textbf{EmpId}} & \textbf{DeptNo} & \textbf{EmpName} & \textbf{Salary} ...