---
# System prepended metadata

title: Constraints

---

# Constraints

**Note: The primary keys for all the entities are underlined in the diagram.**

* The candidate a respondent will vote for must runs in that race.
* A candidate cannot run for the Senate (or the House for that matter, but we’re not including that) and President at the same time.
* It should be noted that not all states/territories can hold every type of election. For example, DC votes for a district mayor (de facto governor) and President, but not senator or governor. Puerto Rico votes for governor but not President or senator. For the sake of scope for this project, we will not attempt to explicitly note every single possible case.
* `region`: `['Northeast', 'Midwest', 'South', 'West']` as specified in https://en.wikipedia.org/wiki/List_of_regions_of_the_United_States#Census_Bureau-designated_regions_and_divisions
* Domain Constrains:
  * `response`
    * `political_scale`: `['Very Conservative', 'Somewhat Conservative', 'Centrist/Moderate', 'Somewhat Liberal', 'Very Liberal']`
    * `gender`: `['Male', 'Female', 'Non-Binary', 'Rather Not Tell']`
    * `likeliness_to_vote`: an integer between 1 and 5
    * `eligibility to vote`: boolean
    * `age`: `['below 18 (not included)', '18–25', '26–35', '36–45', '46–55', '56–65', '66–75', 'over 75 (not included)', 'Rather Not Tell']`
    * `ethinicity`: `Hispanic or Latino`, `Not Hispanic or Latino`
    * `race`: `['American Indian or Alaska Native', 'Asian', 'Black or African American', 'Native Hawaiian or Other Pacific Islander', 'White']`
    * `household_annual_income`: `['Less than $20,000', '$20,000 to $44,999', '$45,000 to $69,999', '$70,000 to $94,999', '$95,000 to $119,999', '$120,000 to 199,999', $200,000+', 'Rather Not Tell or Not Sure']`
    * `party_affiliation`: `['Democratic Party', 'Republican Party', 'Other', 'Not Affiliated']`
    * `education_level`: `['Did Not Graduate from High School', 'High School Diploma or Equivalent', 'Associate's Degree', 'Bachelor's Degree', 'Master's Degree and Above']`
  * `county`
    * `voting_age_population`: an integer between 0 and 100,000,000
  * `voting_expectation`
      * `political_scale`: `['Strong Republican ', 'Leans Republican', 'Tossup', 'Leans Democratic', 'Strong Democratic']`
      * `year`: an integer between 1900 and 2200
  * `state.name`: a valid state name as listed in https://en.wikipedia.org/wiki/List_of_states_and_territories_of_the_United_States. We have chosen to call this entity "state" because that includes the vast majority of likely use cases for this database; however, the `state` entity could also include DC (which is a district) and territories like Puerto Rico or Guam. For simplicity we will refer to all of these places as "states".
  * `election.year`: an integer between 1900 and 2200
  * `candidate`
    * `gender`: `['Male', 'Female', 'Non-Binary']`
    * `ethinicity`: `Hispanic or Latino`, `Not Hispanic or Latino`
    * `race`: `['American Indian or Alaska Native', 'Asian', 'Black or African American', 'Native Hawaiian or Other Pacific Islander', 'White']`
  * `runs_in.party`: `['Democrat', 'Republican', 'Independent', 'Other Party', 'Non-Partisan']`