SELECT vote_for_pid, SUM( vote ) FROM photo_contest_voters GROUP BY vote_for_pid LIMIT 0 , 30 Number of Contestants: SELECT contest_id, SUM( approval ) FROM photo_contest_participant GROUP BY contest_id HAVING contest_id =12133448; Contestant Display: SELECT name, fb_id, photo_url, description FROM `photo_contest_participant` WHERE contest_id =12133448 AND approval =1 Check if voted today: SELECT COUNT( vote ) FROM `photo_contest_voters` WHERE contest_id =12133448 AND vote_for_pid = 'mihir.mohan' AND fb_id =134564788 AND vote_date = CURDATE( ) Update votes on Participant Table : UPDATE `photo_contest_participant` SET `votes` = '4' WHERE fb_id = 'sunil.mishra2' AND contest_id =12133448; GET Votes for a partiular table : SELECT votes FROM `photo_contest_participant` WHERE contest_id =12133448 AND fb_id = 'sushree.mishra1';