In MySQL, get number of pregnant women who received 3 ANC checkups
Something like (untested):

select *
from &lt;table&gt; 
where if(visit1_date,1,0)+if(visit2_date,1,0)+if(visit3_date,1,0)+if(visit4_date,1,0) &gt;= 3;


should do the trick.