{"Student": {"columns": [[0, "StuID", "INTEGER", 0, null, 1], [1, "LName", "VARCHAR(12)", 0, null, 0], [2, "Fname", "VARCHAR(12)", 0, null, 0], [3, "Age", "INTEGER", 0, null, 0], [4, "Sex", "VARCHAR(1)", 0, null, 0], [5, "Major", "INTEGER", 0, null, 0], [6, "Advisor", "INTEGER", 0, null, 0], [7, "city_code", "VARCHAR(3)", 0, null, 0]], "primary_keys": ["StuID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Voting_record": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "Registration_Date", "VARCHAR(12)", 0, null, 0], [2, "Election_Cycle", "VARCHAR(12)", 0, null, 0], [3, "President_Vote", "INTEGER", 0, null, 0], [4, "Vice_President_Vote", "INTEGER", 0, null, 0], [5, "Secretary_Vote", "INTEGER", 0, null, 0], [6, "Treasurer_Vote", "INTEGER", 0, null, 0], [7, "Class_President_Vote", "INTEGER", 0, null, 0], [8, "Class_Senator_Vote", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Student", "Class_Senator_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Student", "Class_President_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Student", "Treasurer_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Student", "Secretary_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [4, 0, "Student", "Vice_President_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [5, 0, "Student", "President_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [6, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Student (
    StuID INTEGER   PRIMARY KEY,
    LName VARCHAR(12),
    Fname VARCHAR(12),
    Age INTEGER,
    Sex VARCHAR(1),
    Major INTEGER,
    Advisor INTEGER,
    city_code VARCHAR(3)
);

CREATE TABLE Voting_record (
    StuID INTEGER,
    Registration_Date VARCHAR(12),
    Election_Cycle VARCHAR(12),
    President_Vote INTEGER,
    Vice_President_Vote INTEGER,
    Secretary_Vote INTEGER,
    Treasurer_Vote INTEGER,
    Class_President_Vote INTEGER,
    Class_Senator_Vote INTEGER,
    FOREIGN KEY (Class_Senator_Vote) REFERENCES Student(StuID),
    FOREIGN KEY (Class_President_Vote) REFERENCES Student(StuID),
    FOREIGN KEY (Treasurer_Vote) REFERENCES Student(StuID),
    FOREIGN KEY (Secretary_Vote) REFERENCES Student(StuID),
    FOREIGN KEY (Vice_President_Vote) REFERENCES Student(StuID),
    FOREIGN KEY (President_Vote) REFERENCES Student(StuID),
    FOREIGN KEY (StuID) REFERENCES Student(StuID)
);