{"grapes": {"columns": [[0, "ID", "INTEGER", 0, null, 1], [1, "Grape", "TEXT", 0, null, 0], [2, "Color", "TEXT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Grape"]]], "check_constraints": []}, "appellations": {"columns": [[0, "No", "INTEGER", 0, null, 1], [1, "Appelation", "TEXT", 0, null, 0], [2, "County", "TEXT", 0, null, 0], [3, "State", "TEXT", 0, null, 0], [4, "Area", "TEXT", 0, null, 0], [5, "isAVA", "TEXT", 0, null, 0]], "primary_keys": ["No"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Appelation"]]], "check_constraints": []}, "wine": {"columns": [[0, "No", "INTEGER", 0, null, 0], [1, "Grape", "TEXT", 0, null, 0], [2, "Winery", "TEXT", 0, null, 0], [3, "Appelation", "TEXT", 0, null, 0], [4, "State", "TEXT", 0, null, 0], [5, "Name", "TEXT", 0, null, 0], [6, "Year", "INTEGER", 0, null, 0], [7, "Price", "INTEGER", 0, null, 0], [8, "Score", "INTEGER", 0, null, 0], [9, "Cases", "INTEGER", 0, null, 0], [10, "Drink", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "appellations", "Appelation", "Appelation", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "grapes", "Grape", "Grape", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE grapes (
    ID INTEGER   PRIMARY KEY,
    Grape TEXT,
    Color TEXT,
    UNIQUE (Grape)
);

CREATE TABLE appellations (
    No INTEGER   PRIMARY KEY,
    Appelation TEXT,
    County TEXT,
    State TEXT,
    Area TEXT,
    isAVA TEXT,
    UNIQUE (Appelation)
);

CREATE TABLE wine (
    No INTEGER,
    Grape TEXT,
    Winery TEXT,
    Appelation TEXT,
    State TEXT,
    Name TEXT,
    Year INTEGER,
    Price INTEGER,
    Score INTEGER,
    Cases INTEGER,
    Drink TEXT,
    FOREIGN KEY (Appelation) REFERENCES appellations(Appelation),
    FOREIGN KEY (Grape) REFERENCES grapes(Grape)
);