Vote Share per Candidate
Medium
Elections & Voting
Return each candidate and their percentage of all votes rounded to 2 decimals, ordered by share descending then candidate.
Table schema
Votes(voter_id INT PRIMARY KEY, candidate VARCHAR(5), region VARCHAR(5))Sample data
voter_id | candidate | region
1 | X | N
2 | X | N
3 | Y | N
4 | Y | S
5 | Z | S
6 | Y | S
7 | X | S
8 | Z | N
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.