{"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": []}, "Restaurant": {"columns": [[0, "ResID", "INTEGER", 0, null, 1], [1, "ResName", "VARCHAR(100)", 0, null, 0], [2, "Address", "VARCHAR(100)", 0, null, 0], [3, "Rating", "INTEGER", 0, null, 0]], "primary_keys": ["ResID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Type_Of_Restaurant": {"columns": [[0, "ResID", "INTEGER", 0, null, 0], [1, "ResTypeID", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Restaurant_Type", "ResTypeID", "ResTypeID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Restaurant", "ResID", "ResID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Restaurant_Type": {"columns": [[0, "ResTypeID", "INTEGER", 0, null, 1], [1, "ResTypeName", "VARCHAR(40)", 0, null, 0], [2, "ResTypeDescription", "VARCHAR(100)", 0, null, 0]], "primary_keys": ["ResTypeID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Visits_Restaurant": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "ResID", "INTEGER", 0, null, 0], [2, "Time", "TIMESTAMP", 0, null, 0], [3, "Spent", "FLOAT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Restaurant", "ResID", "ResID", "NO ACTION", "NO ACTION", "NONE"], [1, 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 Restaurant (
    ResID INTEGER   PRIMARY KEY,
    ResName VARCHAR(100),
    Address VARCHAR(100),
    Rating INTEGER
);

CREATE TABLE Type_Of_Restaurant (
    ResID INTEGER,
    ResTypeID INTEGER,
    FOREIGN KEY (ResTypeID) REFERENCES Restaurant_Type(ResTypeID),
    FOREIGN KEY (ResID) REFERENCES Restaurant(ResID)
);

CREATE TABLE Restaurant_Type (
    ResTypeID INTEGER   PRIMARY KEY,
    ResTypeName VARCHAR(40),
    ResTypeDescription VARCHAR(100)
);

CREATE TABLE Visits_Restaurant (
    StuID INTEGER,
    ResID INTEGER,
    Time TIMESTAMP,
    Spent FLOAT,
    FOREIGN KEY (ResID) REFERENCES Restaurant(ResID),
    FOREIGN KEY (StuID) REFERENCES Student(StuID)
);