GROUP BY clause on the candidateId column in the Vote table.ORDER BY clause.LIMIT clause.Candidate table to get the name of the candidate with the most votes.
erDiagram
Candidate {
int id PK "Unique identifier for the candidate"
varchar name "Name of the candidate"
}
Vote {
int id PK "Auto-increment primary key"
int candidateId FK "Foreign key to Candidate.id"
}
Candidate ||--o{ Vote : "has"