Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Margin of Victory per Region

For each region return the winning candidate and the margin (winner votes minus runner-up votes). Assume no tie for first. Order by region.

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.