I use cosette online to prove the count projection equivalence. The answer should be not equivalent. Because count(*) will include NULL value, while count(column) will exclude NULL value.
The following is the code:
schema s(a:int, b:int);
table r(s);
query q1 -- define query q1
select count(*) as a from r x;
query q2 -- define query q2 likewise
select count(y.b) from r y;
verify q1 q2;
There should be not equivalent if there exist some NULL values in y.b column. Even the int type, we can still set default value to NULL, not 0.
I use cosette online to prove the count projection equivalence. The answer should be not equivalent. Because count(*) will include NULL value, while count(column) will exclude NULL value. The following is the code:
schema s(a:int, b:int); table r(s); query q1 -- define query q1
select count(*) as a from r x
;query q2 -- define query q2 likewise
select count(y.b) from r y
;verify q1 q2;
There should be not equivalent if there exist some NULL values in y.b column. Even the int type, we can still set default value to NULL, not 0.