in Databases
319 views
0 votes
0 votes

consider the raletion schema:-

R(A,B,C) with functional dependency {A->B}

which of the following query returns “0” if no records of R violates A->B functional dependency[assume no NULL’s]

 

for this question I directly marked (d) option as they have used count(*) and count func  gives 1 even for null.

am i wrong??

in Databases
319 views

3 Comments

when there is no row in result set count will return 0 why it will return 1?
0
0
but why would null be there? I think no output would come for it as every relation follows the fd so it should be query 1 i.e A
0
0
count(*) counts the number of tuples returned . In second case , surely it wont be 0.

But in 1st case , there won't be any tuples returned after filtering out , since A->B functional dependency is being maintained.

count(*) here will give 0 since number of tuples after filter is none
0
0

1 Answer

0 votes
0 votes

Count(*) returns the number of tuples . 1st case wont return any tuple so 0 .