{"Activity": {"columns": [[0, "actid", "INTEGER", 0, null, 1], [1, "activity_name", "varchar(25)", 0, null, 0]], "primary_keys": ["actid"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Participates_in": {"columns": [[0, "stuid", "INTEGER", 0, null, 0], [1, "actid", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Activity", "actid", "actid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Student", "stuid", "StuID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Faculty_Participates_in": {"columns": [[0, "FacID", "INTEGER", 0, null, 0], [1, "actid", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Activity", "actid", "actid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Faculty", "FacID", "FacID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "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": []}, "Faculty": {"columns": [[0, "FacID", "INTEGER", 0, null, 1], [1, "Lname", "VARCHAR(15)", 0, null, 0], [2, "Fname", "VARCHAR(15)", 0, null, 0], [3, "Rank", "VARCHAR(15)", 0, null, 0], [4, "Sex", "VARCHAR(1)", 0, null, 0], [5, "Phone", "INTEGER", 0, null, 0], [6, "Room", "VARCHAR(5)", 0, null, 0], [7, "Building", "VARCHAR(13)", 0, null, 0]], "primary_keys": ["FacID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Activity (
    actid INTEGER   PRIMARY KEY,
    activity_name varchar(25)
);

CREATE TABLE Participates_in (
    stuid INTEGER,
    actid INTEGER,
    FOREIGN KEY (actid) REFERENCES Activity(actid),
    FOREIGN KEY (stuid) REFERENCES Student(StuID)
);

CREATE TABLE Faculty_Participates_in (
    FacID INTEGER,
    actid INTEGER,
    FOREIGN KEY (actid) REFERENCES Activity(actid),
    FOREIGN KEY (FacID) REFERENCES Faculty(FacID)
);

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 Faculty (
    FacID INTEGER   PRIMARY KEY,
    Lname VARCHAR(15),
    Fname VARCHAR(15),
    Rank VARCHAR(15),
    Sex VARCHAR(1),
    Phone INTEGER,
    Room VARCHAR(5),
    Building VARCHAR(13)
);