{"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": []}, "Department": {"columns": [[0, "DNO", "INTEGER", 0, null, 1], [1, "Division", "VARCHAR(2)", 0, null, 0], [2, "DName", "VARCHAR(25)", 0, null, 0], [3, "Room", "VARCHAR(5)", 0, null, 0], [4, "Building", "VARCHAR(13)", 0, null, 0], [5, "DPhone", "INTEGER", 0, null, 0]], "primary_keys": ["DNO"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Member_of": {"columns": [[0, "FacID", "INTEGER", 0, null, 0], [1, "DNO", "INTEGER", 0, null, 0], [2, "Appt_Type", "VARCHAR(15)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Department", "DNO", "DNO", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Faculty", "FacID", "FacID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Course": {"columns": [[0, "CID", "VARCHAR(7)", 0, null, 1], [1, "CName", "VARCHAR(40)", 0, null, 0], [2, "Credits", "INTEGER", 0, null, 0], [3, "Instructor", "INTEGER", 0, null, 0], [4, "Days", "VARCHAR(5)", 0, null, 0], [5, "Hours", "VARCHAR(11)", 0, null, 0], [6, "DNO", "INTEGER", 0, null, 0]], "primary_keys": ["CID"], "foreign_keys": [[0, 0, "Department", "DNO", "DNO", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Faculty", "Instructor", "FacID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "CID"]]], "check_constraints": []}, "Minor_in": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "DNO", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Department", "DNO", "DNO", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Enrolled_in": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "CID", "VARCHAR(7)", 0, null, 0], [2, "Grade", "VARCHAR(2)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Gradeconversion", "Grade", "lettergrade", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Course", "CID", "CID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Gradeconversion": {"columns": [[0, "lettergrade", "VARCHAR(2)", 0, null, 1], [1, "gradepoint", "FLOAT", 0, null, 0]], "primary_keys": ["lettergrade"], "foreign_keys": [], "unique_constraints": [[[0, 0, "lettergrade"]]], "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 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)
);

CREATE TABLE Department (
    DNO INTEGER   PRIMARY KEY,
    Division VARCHAR(2),
    DName VARCHAR(25),
    Room VARCHAR(5),
    Building VARCHAR(13),
    DPhone INTEGER
);

CREATE TABLE Member_of (
    FacID INTEGER,
    DNO INTEGER,
    Appt_Type VARCHAR(15),
    FOREIGN KEY (DNO) REFERENCES Department(DNO),
    FOREIGN KEY (FacID) REFERENCES Faculty(FacID)
);

CREATE TABLE Course (
    CID VARCHAR(7)   PRIMARY KEY,
    CName VARCHAR(40),
    Credits INTEGER,
    Instructor INTEGER,
    Days VARCHAR(5),
    Hours VARCHAR(11),
    DNO INTEGER,
    UNIQUE (CID),
    FOREIGN KEY (DNO) REFERENCES Department(DNO),
    FOREIGN KEY (Instructor) REFERENCES Faculty(FacID)
);

CREATE TABLE Minor_in (
    StuID INTEGER,
    DNO INTEGER,
    FOREIGN KEY (DNO) REFERENCES Department(DNO),
    FOREIGN KEY (StuID) REFERENCES Student(StuID)
);

CREATE TABLE Enrolled_in (
    StuID INTEGER,
    CID VARCHAR(7),
    Grade VARCHAR(2),
    FOREIGN KEY (Grade) REFERENCES Gradeconversion(lettergrade),
    FOREIGN KEY (CID) REFERENCES Course(CID),
    FOREIGN KEY (StuID) REFERENCES Student(StuID)
);

CREATE TABLE Gradeconversion (
    lettergrade VARCHAR(2)   PRIMARY KEY,
    gradepoint FLOAT,
    UNIQUE (lettergrade)
);