Open dbolson opened 7 years ago
candidates_elections
has the party for a candidate at the time of the election.district_election_results
and municipality_election_results
.states
table because we can use a uniform two digit lowercase state code. We could add a database constraint to normalize these in different tables (eg., always a two digit lowercase string).Thanks for iterating on this. One other wrinkle: we want to be able to store data about how the people within a district voted in other elections, e.g. the 2012 presidential election or a 2014 U.S. Senate race.
The district_election_results
should take care of this. It records
This is the same for municipality_election_results
.
Does this get us the data you're talking about?
Oh, I see. I had misunderstood your design.
Would it be helpful to show example data for this design?
Nah, it's clear now.
Some suggestions on the schema:
(previously discussed)
(new)
Also add the following columns to the *_election_results tables:
Based on the initial proposed schema and data from New Jersey, here is a proposed updated schema. I left off a few details from the first one but only for the sake of clarity here. This would be version 1 of a few before we would have a final schema for the mvp.