db_id
stringlengths
4
28
tables
stringlengths
682
40.1k
schema
stringlengths
319
29.3k
description
stringclasses
1 value
language_corpus
{"langs": {"columns": [[0, "lid", "INTEGER", 0, null, 1], [1, "lang", "TEXT", 0, null, 0], [2, "locale", "TEXT", 0, null, 0], [3, "pages", "INTEGER", 0, "0", 0], [4, "words", "INTEGER", 0, "0", 0]], "primary_keys": ["lid"], "foreign_keys": [], "unique_constraints": [[[0, 2, "locale"]], [[0, 1, "lang"]]], "check_constraints": []}, "sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "pages": {"columns": [[0, "pid", "INTEGER", 0, null, 1], [1, "lid", "INTEGER", 0, null, 0], [2, "page", "INTEGER", 0, "NULL", 0], [3, "revision", "INTEGER", 0, "NULL", 0], [4, "title", "TEXT", 0, null, 0], [5, "words", "INTEGER", 0, "0", 0]], "primary_keys": ["pid"], "foreign_keys": [[0, 0, "langs", "lid", "lid", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 1, "lid"], [1, 2, "page"], [2, 4, "title"]]], "check_constraints": []}, "words": {"columns": [[0, "wid", "INTEGER", 0, null, 1], [1, "word", "TEXT", 0, null, 0], [2, "occurrences", "INTEGER", 0, "0", 0]], "primary_keys": ["wid"], "foreign_keys": [], "unique_constraints": [[[0, 1, "word"]]], "check_constraints": []}, "langs_words": {"columns": [[0, "lid", "INTEGER", 1, null, 1], [1, "wid", "INTEGER", 1, null, 2], [2, "occurrences", "INTEGER", 0, null, 0]], "primary_keys": ["lid", "wid"], "foreign_keys": [[0, 0, "words", "wid", "wid", "CASCADE", "CASCADE", "NONE"], [1, 0, "langs", "lid", "lid", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "lid"], [1, 1, "wid"]]], "check_constraints": []}, "pages_words": {"columns": [[0, "pid", "INTEGER", 1, null, 1], [1, "wid", "INTEGER", 1, null, 2], [2, "occurrences", "INTEGER", 0, "0", 0]], "primary_keys": ["pid", "wid"], "foreign_keys": [[0, 0, "words", "wid", "wid", "CASCADE", "CASCADE", "NONE"], [1, 0, "pages", "pid", "pid", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "pid"], [1, 1, "wid"]]], "check_constraints": []}, "biwords": {"columns": [[0, "lid", "INTEGER", 1, null, 1], [1, "w1st", "INTEGER", 1, null, 2], [2, "w2nd", "INTEGER", 1, null, 3], [3, "occurrences", "INTEGER", 0, "0", 0]], "primary_keys": ["lid", "w1st", "w2nd"], "foreign_keys": [[0, 0, "words", "w2nd", "wid", "CASCADE", "CASCADE", "NONE"], [1, 0, "words", "w1st", "wid", "CASCADE", "CASCADE", "NONE"], [2, 0, "langs", "lid", "lid", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "lid"], [1, 1, "w1st"], [2, 2, "w2nd"]]], "check_constraints": []}}
CREATE TABLE langs ( lid INTEGER PRIMARY KEY, lang TEXT, locale TEXT, pages INTEGER DEFAULT 0, words INTEGER DEFAULT 0, UNIQUE (locale), UNIQUE (lang) ); CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE pages ( pid INTEGER PRIMARY KEY, lid INTEGER, page INTEGER DEFAULT NULL, revision INTEGER DEFAULT NULL, title TEXT, words INTEGER DEFAULT 0, UNIQUE (lid, page, title), FOREIGN KEY (lid) REFERENCES langs(lid) ); CREATE TABLE words ( wid INTEGER PRIMARY KEY, word TEXT, occurrences INTEGER DEFAULT 0, UNIQUE (word) ); CREATE TABLE langs_words ( lid INTEGER NOT NULL PRIMARY KEY, wid INTEGER NOT NULL PRIMARY KEY, occurrences INTEGER, PRIMARY KEY (lid, wid), UNIQUE (lid, wid), FOREIGN KEY (wid) REFERENCES words(wid), FOREIGN KEY (lid) REFERENCES langs(lid) ); CREATE TABLE pages_words ( pid INTEGER NOT NULL PRIMARY KEY, wid INTEGER NOT NULL PRIMARY KEY, occurrences INTEGER DEFAULT 0, PRIMARY KEY (pid, wid), UNIQUE (pid, wid), FOREIGN KEY (wid) REFERENCES words(wid), FOREIGN KEY (pid) REFERENCES pages(pid) ); CREATE TABLE biwords ( lid INTEGER NOT NULL PRIMARY KEY, w1st INTEGER NOT NULL PRIMARY KEY, w2nd INTEGER NOT NULL PRIMARY KEY, occurrences INTEGER DEFAULT 0, PRIMARY KEY (lid, w1st, w2nd), UNIQUE (lid, w1st, w2nd), FOREIGN KEY (w2nd) REFERENCES words(wid), FOREIGN KEY (w1st) REFERENCES words(wid), FOREIGN KEY (lid) REFERENCES langs(lid) );
mental_health_survey
{"Question": {"columns": [[0, "questiontext", "TEXT", 0, null, 0], [1, "questionid", "INTEGER", 0, null, 1]], "primary_keys": ["questionid"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Survey": {"columns": [[0, "SurveyID", "INTEGER", 0, null, 1], [1, "Description", "TEXT", 0, null, 0]], "primary_keys": ["SurveyID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Answer": {"columns": [[0, "AnswerText", "TEXT", 0, null, 0], [1, "SurveyID", "INTEGER", 0, null, 0], [2, "UserID", "INTEGER", 0, null, 1], [3, "QuestionID", "INTEGER", 0, null, 2]], "primary_keys": ["UserID", "QuestionID"], "foreign_keys": [[0, 0, "Question", "QuestionID", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Survey", "SurveyID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 2, "UserID"], [1, 3, "QuestionID"]]], "check_constraints": []}}
CREATE TABLE Question ( questiontext TEXT, questionid INTEGER PRIMARY KEY ); CREATE TABLE Survey ( SurveyID INTEGER PRIMARY KEY, Description TEXT ); CREATE TABLE Answer ( AnswerText TEXT, SurveyID INTEGER, UserID INTEGER PRIMARY KEY, QuestionID INTEGER PRIMARY KEY, PRIMARY KEY (UserID, QuestionID), UNIQUE (UserID, QuestionID), FOREIGN KEY (QuestionID) REFERENCES Question(None), FOREIGN KEY (SurveyID) REFERENCES Survey(None) );
sales_in_weather
{"sales_in_weather": {"columns": [[0, "date", "DATE", 0, null, 2], [1, "store_nbr", "INTEGER", 0, null, 1], [2, "item_nbr", "INTEGER", 0, null, 3], [3, "units", "INTEGER", 0, null, 0]], "primary_keys": ["date", "store_nbr", "item_nbr"], "foreign_keys": [], "unique_constraints": [[[0, 1, "store_nbr"], [1, 0, "date"], [2, 2, "item_nbr"]]], "check_constraints": []}, "weather": {"columns": [[0, "station_nbr", "INTEGER", 0, null, 1], [1, "date", "DATE", 0, null, 2], [2, "tmax", "INTEGER", 0, null, 0], [3, "tmin", "INTEGER", 0, null, 0], [4, "tavg", "INTEGER", 0, null, 0], [5, "depart", "INTEGER", 0, null, 0], [6, "dewpoint", "INTEGER", 0, null, 0], [7, "wetbulb", "INTEGER", 0, null, 0], [8, "heat", "INTEGER", 0, null, 0], [9, "cool", "INTEGER", 0, null, 0], [10, "sunrise", "TEXT", 0, null, 0], [11, "sunset", "TEXT", 0, null, 0], [12, "codesum", "TEXT", 0, null, 0], [13, "snowfall", "REAL", 0, null, 0], [14, "preciptotal", "REAL", 0, null, 0], [15, "stnpressure", "REAL", 0, null, 0], [16, "sealevel", "REAL", 0, null, 0], [17, "resultspeed", "REAL", 0, null, 0], [18, "resultdir", "INTEGER", 0, null, 0], [19, "avgspeed", "REAL", 0, null, 0]], "primary_keys": ["station_nbr", "date"], "foreign_keys": [], "unique_constraints": [[[0, 0, "station_nbr"], [1, 1, "date"]]], "check_constraints": []}, "relation": {"columns": [[0, "store_nbr", "INTEGER", 0, null, 1], [1, "station_nbr", "INTEGER", 0, null, 0]], "primary_keys": ["store_nbr"], "foreign_keys": [[0, 0, "weather", "station_nbr", "station_nbr", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "sales_in_weather", "store_nbr", "store_nbr", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE sales_in_weather ( date DATE PRIMARY KEY, store_nbr INTEGER PRIMARY KEY, item_nbr INTEGER PRIMARY KEY, units INTEGER, PRIMARY KEY (date, store_nbr, item_nbr), UNIQUE (store_nbr, date, item_nbr) ); CREATE TABLE weather ( station_nbr INTEGER PRIMARY KEY, date DATE PRIMARY KEY, tmax INTEGER, tmin INTEGER, tavg INTEGER, depart INTEGER, dewpoint INTEGER, wetbulb INTEGER, heat INTEGER, cool INTEGER, sunrise TEXT, sunset TEXT, codesum TEXT, snowfall REAL, preciptotal REAL, stnpressure REAL, sealevel REAL, resultspeed REAL, resultdir INTEGER, avgspeed REAL, PRIMARY KEY (station_nbr, date), UNIQUE (station_nbr, date) ); CREATE TABLE relation ( store_nbr INTEGER PRIMARY KEY, station_nbr INTEGER, FOREIGN KEY (station_nbr) REFERENCES weather(station_nbr), FOREIGN KEY (store_nbr) REFERENCES sales_in_weather(store_nbr) );
synthea
{"all_prevalences": {"columns": [[0, "ITEM", "TEXT", 0, null, 1], [1, "POPULATION TYPE", "TEXT", 0, null, 0], [2, "OCCURRENCES", "INTEGER", 0, null, 0], [3, "POPULATION COUNT", "INTEGER", 0, null, 0], [4, "PREVALENCE RATE", "REAL", 0, null, 0], [5, "PREVALENCE PERCENTAGE", "REAL", 0, null, 0]], "primary_keys": ["ITEM"], "foreign_keys": [], "unique_constraints": [[[0, 0, "ITEM"]]], "check_constraints": []}, "patients": {"columns": [[0, "patient", "TEXT", 0, null, 1], [1, "birthdate", "DATE", 0, null, 0], [2, "deathdate", "DATE", 0, null, 0], [3, "ssn", "TEXT", 0, null, 0], [4, "drivers", "TEXT", 0, null, 0], [5, "passport", "TEXT", 0, null, 0], [6, "prefix", "TEXT", 0, null, 0], [7, "first", "TEXT", 0, null, 0], [8, "last", "TEXT", 0, null, 0], [9, "suffix", "TEXT", 0, null, 0], [10, "maiden", "TEXT", 0, null, 0], [11, "marital", "TEXT", 0, null, 0], [12, "race", "TEXT", 0, null, 0], [13, "ethnicity", "TEXT", 0, null, 0], [14, "gender", "TEXT", 0, null, 0], [15, "birthplace", "TEXT", 0, null, 0], [16, "address", "TEXT", 0, null, 0]], "primary_keys": ["patient"], "foreign_keys": [], "unique_constraints": [[[0, 0, "patient"]]], "check_constraints": []}, "encounters": {"columns": [[0, "ID", "TEXT", 0, null, 1], [1, "DATE", "DATE", 0, null, 0], [2, "PATIENT", "TEXT", 0, null, 0], [3, "CODE", "INTEGER", 0, null, 0], [4, "DESCRIPTION", "TEXT", 0, null, 0], [5, "REASONCODE", "INTEGER", 0, null, 0], [6, "REASONDESCRIPTION", "TEXT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [[0, 0, "patients", "PATIENT", "patient", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": []}, "allergies": {"columns": [[0, "START", "TEXT", 0, null, 0], [1, "STOP", "TEXT", 0, null, 0], [2, "PATIENT", "TEXT", 0, null, 1], [3, "ENCOUNTER", "TEXT", 0, null, 2], [4, "CODE", "INTEGER", 0, null, 3], [5, "DESCRIPTION", "TEXT", 0, null, 0]], "primary_keys": ["PATIENT", "ENCOUNTER", "CODE"], "foreign_keys": [[0, 0, "patients", "PATIENT", "patient", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "encounters", "ENCOUNTER", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 2, "PATIENT"], [1, 3, "ENCOUNTER"], [2, 4, "CODE"]]], "check_constraints": []}, "careplans": {"columns": [[0, "ID", "TEXT", 0, null, 0], [1, "START", "DATE", 0, null, 0], [2, "STOP", "DATE", 0, null, 0], [3, "PATIENT", "TEXT", 0, null, 0], [4, "ENCOUNTER", "TEXT", 0, null, 0], [5, "CODE", "REAL", 0, null, 0], [6, "DESCRIPTION", "TEXT", 0, null, 0], [7, "REASONCODE", "INTEGER", 0, null, 0], [8, "REASONDESCRIPTION", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "patients", "PATIENT", "patient", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "encounters", "ENCOUNTER", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "conditions": {"columns": [[0, "START", "DATE", 0, null, 0], [1, "STOP", "DATE", 0, null, 0], [2, "PATIENT", "TEXT", 0, null, 0], [3, "ENCOUNTER", "TEXT", 0, null, 0], [4, "CODE", "INTEGER", 0, null, 0], [5, "DESCRIPTION", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "all_prevalences", "DESCRIPTION", "ITEM", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "patients", "PATIENT", "patient", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "encounters", "ENCOUNTER", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "immunizations": {"columns": [[0, "DATE", "DATE", 0, null, 1], [1, "PATIENT", "TEXT", 0, null, 2], [2, "ENCOUNTER", "TEXT", 0, null, 3], [3, "CODE", "INTEGER", 0, null, 4], [4, "DESCRIPTION", "TEXT", 0, null, 0]], "primary_keys": ["DATE", "PATIENT", "ENCOUNTER", "CODE"], "foreign_keys": [[0, 0, "patients", "PATIENT", "patient", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "encounters", "ENCOUNTER", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "DATE"], [1, 1, "PATIENT"], [2, 2, "ENCOUNTER"], [3, 3, "CODE"]]], "check_constraints": []}, "medications": {"columns": [[0, "START", "DATE", 0, null, 1], [1, "STOP", "DATE", 0, null, 0], [2, "PATIENT", "TEXT", 0, null, 2], [3, "ENCOUNTER", "TEXT", 0, null, 3], [4, "CODE", "INTEGER", 0, null, 4], [5, "DESCRIPTION", "TEXT", 0, null, 0], [6, "REASONCODE", "INTEGER", 0, null, 0], [7, "REASONDESCRIPTION", "TEXT", 0, null, 0]], "primary_keys": ["START", "PATIENT", "ENCOUNTER", "CODE"], "foreign_keys": [[0, 0, "patients", "PATIENT", "patient", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "encounters", "ENCOUNTER", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "START"], [1, 2, "PATIENT"], [2, 3, "ENCOUNTER"], [3, 4, "CODE"]]], "check_constraints": []}, "observations": {"columns": [[0, "DATE", "DATE", 0, null, 0], [1, "PATIENT", "TEXT", 0, null, 0], [2, "ENCOUNTER", "TEXT", 0, null, 0], [3, "CODE", "TEXT", 0, null, 0], [4, "DESCRIPTION", "TEXT", 0, null, 0], [5, "VALUE", "REAL", 0, null, 0], [6, "UNITS", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "patients", "PATIENT", "patient", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "encounters", "ENCOUNTER", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "procedures": {"columns": [[0, "DATE", "DATE", 0, null, 0], [1, "PATIENT", "TEXT", 0, null, 0], [2, "ENCOUNTER", "TEXT", 0, null, 0], [3, "CODE", "INTEGER", 0, null, 0], [4, "DESCRIPTION", "TEXT", 0, null, 0], [5, "REASONCODE", "INTEGER", 0, null, 0], [6, "REASONDESCRIPTION", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "patients", "PATIENT", "patient", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "encounters", "ENCOUNTER", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "claims": {"columns": [[0, "ID", "TEXT", 0, null, 1], [1, "PATIENT", "TEXT", 0, null, 0], [2, "BILLABLEPERIOD", "DATE", 0, null, 0], [3, "ORGANIZATION", "TEXT", 0, null, 0], [4, "ENCOUNTER", "TEXT", 0, null, 0], [5, "DIAGNOSIS", "TEXT", 0, null, 0], [6, "TOTAL", "INTEGER", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [[0, 0, "encounters", "ENCOUNTER", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "patients", "PATIENT", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": []}}
CREATE TABLE all_prevalences ( ITEM TEXT PRIMARY KEY, POPULATION TYPE TEXT, OCCURRENCES INTEGER, POPULATION COUNT INTEGER, PREVALENCE RATE REAL, PREVALENCE PERCENTAGE REAL, UNIQUE (ITEM) ); CREATE TABLE patients ( patient TEXT PRIMARY KEY, birthdate DATE, deathdate DATE, ssn TEXT, drivers TEXT, passport TEXT, prefix TEXT, first TEXT, last TEXT, suffix TEXT, maiden TEXT, marital TEXT, race TEXT, ethnicity TEXT, gender TEXT, birthplace TEXT, address TEXT, UNIQUE (patient) ); CREATE TABLE encounters ( ID TEXT PRIMARY KEY, DATE DATE, PATIENT TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, UNIQUE (ID), FOREIGN KEY (PATIENT) REFERENCES patients(patient) ); CREATE TABLE allergies ( START TEXT, STOP TEXT, PATIENT TEXT PRIMARY KEY, ENCOUNTER TEXT PRIMARY KEY, CODE INTEGER PRIMARY KEY, DESCRIPTION TEXT, PRIMARY KEY (PATIENT, ENCOUNTER, CODE), UNIQUE (PATIENT, ENCOUNTER, CODE), FOREIGN KEY (PATIENT) REFERENCES patients(patient), FOREIGN KEY (ENCOUNTER) REFERENCES encounters(ID) ); CREATE TABLE careplans ( ID TEXT, START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE REAL, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, FOREIGN KEY (PATIENT) REFERENCES patients(patient), FOREIGN KEY (ENCOUNTER) REFERENCES encounters(ID) ); CREATE TABLE conditions ( START DATE, STOP DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, FOREIGN KEY (DESCRIPTION) REFERENCES all_prevalences(ITEM), FOREIGN KEY (PATIENT) REFERENCES patients(patient), FOREIGN KEY (ENCOUNTER) REFERENCES encounters(ID) ); CREATE TABLE immunizations ( DATE DATE PRIMARY KEY, PATIENT TEXT PRIMARY KEY, ENCOUNTER TEXT PRIMARY KEY, CODE INTEGER PRIMARY KEY, DESCRIPTION TEXT, PRIMARY KEY (DATE, PATIENT, ENCOUNTER, CODE), UNIQUE (DATE, PATIENT, ENCOUNTER, CODE), FOREIGN KEY (PATIENT) REFERENCES patients(patient), FOREIGN KEY (ENCOUNTER) REFERENCES encounters(ID) ); CREATE TABLE medications ( START DATE PRIMARY KEY, STOP DATE, PATIENT TEXT PRIMARY KEY, ENCOUNTER TEXT PRIMARY KEY, CODE INTEGER PRIMARY KEY, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, PRIMARY KEY (START, PATIENT, ENCOUNTER, CODE), UNIQUE (START, PATIENT, ENCOUNTER, CODE), FOREIGN KEY (PATIENT) REFERENCES patients(patient), FOREIGN KEY (ENCOUNTER) REFERENCES encounters(ID) ); CREATE TABLE observations ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE TEXT, DESCRIPTION TEXT, VALUE REAL, UNITS TEXT, FOREIGN KEY (PATIENT) REFERENCES patients(patient), FOREIGN KEY (ENCOUNTER) REFERENCES encounters(ID) ); CREATE TABLE procedures ( DATE DATE, PATIENT TEXT, ENCOUNTER TEXT, CODE INTEGER, DESCRIPTION TEXT, REASONCODE INTEGER, REASONDESCRIPTION TEXT, FOREIGN KEY (PATIENT) REFERENCES patients(patient), FOREIGN KEY (ENCOUNTER) REFERENCES encounters(ID) ); CREATE TABLE claims ( ID TEXT PRIMARY KEY, PATIENT TEXT, BILLABLEPERIOD DATE, ORGANIZATION TEXT, ENCOUNTER TEXT, DIAGNOSIS TEXT, TOTAL INTEGER, UNIQUE (ID), FOREIGN KEY (ENCOUNTER) REFERENCES encounters(None), FOREIGN KEY (PATIENT) REFERENCES patients(None) );
cookbook
{"Ingredient": {"columns": [[0, "ingredient_id", "INTEGER", 0, null, 1], [1, "category", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0], [3, "plural", "TEXT", 0, null, 0]], "primary_keys": ["ingredient_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Recipe": {"columns": [[0, "recipe_id", "INTEGER", 0, null, 1], [1, "title", "TEXT", 0, null, 0], [2, "subtitle", "TEXT", 0, null, 0], [3, "servings", "INTEGER", 0, null, 0], [4, "yield_unit", "TEXT", 0, null, 0], [5, "prep_min", "INTEGER", 0, null, 0], [6, "cook_min", "INTEGER", 0, null, 0], [7, "stnd_min", "INTEGER", 0, null, 0], [8, "source", "TEXT", 0, null, 0], [9, "intro", "TEXT", 0, null, 0], [10, "directions", "TEXT", 0, null, 0]], "primary_keys": ["recipe_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Nutrition": {"columns": [[0, "recipe_id", "INTEGER", 0, null, 1], [1, "protein", "REAL", 0, null, 0], [2, "carbo", "REAL", 0, null, 0], [3, "alcohol", "REAL", 0, null, 0], [4, "total_fat", "REAL", 0, null, 0], [5, "sat_fat", "REAL", 0, null, 0], [6, "cholestrl", "REAL", 0, null, 0], [7, "sodium", "REAL", 0, null, 0], [8, "iron", "REAL", 0, null, 0], [9, "vitamin_c", "REAL", 0, null, 0], [10, "vitamin_a", "REAL", 0, null, 0], [11, "fiber", "REAL", 0, null, 0], [12, "pcnt_cal_carb", "REAL", 0, null, 0], [13, "pcnt_cal_fat", "REAL", 0, null, 0], [14, "pcnt_cal_prot", "REAL", 0, null, 0], [15, "calories", "REAL", 0, null, 0]], "primary_keys": ["recipe_id"], "foreign_keys": [[0, 0, "Recipe", "recipe_id", "recipe_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Quantity": {"columns": [[0, "quantity_id", "INTEGER", 0, null, 1], [1, "recipe_id", "INTEGER", 0, null, 0], [2, "ingredient_id", "INTEGER", 0, null, 0], [3, "max_qty", "REAL", 0, null, 0], [4, "min_qty", "REAL", 0, null, 0], [5, "unit", "TEXT", 0, null, 0], [6, "preparation", "TEXT", 0, null, 0], [7, "optional", "TEXT", 0, null, 0]], "primary_keys": ["quantity_id"], "foreign_keys": [[0, 0, "Nutrition", "recipe_id", "recipe_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ingredient", "ingredient_id", "ingredient_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Recipe", "recipe_id", "recipe_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Ingredient ( ingredient_id INTEGER PRIMARY KEY, category TEXT, name TEXT, plural TEXT ); CREATE TABLE Recipe ( recipe_id INTEGER PRIMARY KEY, title TEXT, subtitle TEXT, servings INTEGER, yield_unit TEXT, prep_min INTEGER, cook_min INTEGER, stnd_min INTEGER, source TEXT, intro TEXT, directions TEXT ); CREATE TABLE Nutrition ( recipe_id INTEGER PRIMARY KEY, protein REAL, carbo REAL, alcohol REAL, total_fat REAL, sat_fat REAL, cholestrl REAL, sodium REAL, iron REAL, vitamin_c REAL, vitamin_a REAL, fiber REAL, pcnt_cal_carb REAL, pcnt_cal_fat REAL, pcnt_cal_prot REAL, calories REAL, FOREIGN KEY (recipe_id) REFERENCES Recipe(recipe_id) ); CREATE TABLE Quantity ( quantity_id INTEGER PRIMARY KEY, recipe_id INTEGER, ingredient_id INTEGER, max_qty REAL, min_qty REAL, unit TEXT, preparation TEXT, optional TEXT, FOREIGN KEY (recipe_id) REFERENCES Nutrition(recipe_id), FOREIGN KEY (ingredient_id) REFERENCES Ingredient(ingredient_id), FOREIGN KEY (recipe_id) REFERENCES Recipe(recipe_id) );
bike_share_1
{"station": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "lat", "REAL", 0, null, 0], [3, "long", "REAL", 0, null, 0], [4, "dock_count", "INTEGER", 0, null, 0], [5, "city", "TEXT", 0, null, 0], [6, "installation_date", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "status": {"columns": [[0, "station_id", "INTEGER", 0, null, 0], [1, "bikes_available", "INTEGER", 0, null, 0], [2, "docks_available", "INTEGER", 0, null, 0], [3, "time", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "trip": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "duration", "INTEGER", 0, null, 0], [2, "start_date", "TEXT", 0, null, 0], [3, "start_station_name", "TEXT", 0, null, 0], [4, "start_station_id", "INTEGER", 0, null, 0], [5, "end_date", "TEXT", 0, null, 0], [6, "end_station_name", "TEXT", 0, null, 0], [7, "end_station_id", "INTEGER", 0, null, 0], [8, "bike_id", "INTEGER", 0, null, 0], [9, "subscription_type", "TEXT", 0, null, 0], [10, "zip_code", "INTEGER", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "weather": {"columns": [[0, "date", "TEXT", 0, null, 0], [1, "max_temperature_f", "INTEGER", 0, null, 0], [2, "mean_temperature_f", "INTEGER", 0, null, 0], [3, "min_temperature_f", "INTEGER", 0, null, 0], [4, "max_dew_point_f", "INTEGER", 0, null, 0], [5, "mean_dew_point_f", "INTEGER", 0, null, 0], [6, "min_dew_point_f", "INTEGER", 0, null, 0], [7, "max_humidity", "INTEGER", 0, null, 0], [8, "mean_humidity", "INTEGER", 0, null, 0], [9, "min_humidity", "INTEGER", 0, null, 0], [10, "max_sea_level_pressure_inches", "REAL", 0, null, 0], [11, "mean_sea_level_pressure_inches", "REAL", 0, null, 0], [12, "min_sea_level_pressure_inches", "REAL", 0, null, 0], [13, "max_visibility_miles", "INTEGER", 0, null, 0], [14, "mean_visibility_miles", "INTEGER", 0, null, 0], [15, "min_visibility_miles", "INTEGER", 0, null, 0], [16, "max_wind_Speed_mph", "INTEGER", 0, null, 0], [17, "mean_wind_speed_mph", "INTEGER", 0, null, 0], [18, "max_gust_speed_mph", "INTEGER", 0, null, 0], [19, "precipitation_inches", "TEXT", 0, null, 0], [20, "cloud_cover", "INTEGER", 0, null, 0], [21, "events", "TEXT", 0, null, 0], [22, "wind_dir_degrees", "INTEGER", 0, null, 0], [23, "zip_code", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE station ( id INTEGER NOT NULL PRIMARY KEY, name TEXT, lat REAL, long REAL, dock_count INTEGER, city TEXT, installation_date TEXT ); CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ); CREATE TABLE trip ( id INTEGER NOT NULL PRIMARY KEY, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ); CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pressure_inches REAL, mean_sea_level_pressure_inches REAL, min_sea_level_pressure_inches REAL, max_visibility_miles INTEGER, mean_visibility_miles INTEGER, min_visibility_miles INTEGER, max_wind_Speed_mph INTEGER, mean_wind_speed_mph INTEGER, max_gust_speed_mph INTEGER, precipitation_inches TEXT, cloud_cover INTEGER, events TEXT, wind_dir_degrees INTEGER, zip_code TEXT );
retail_complains
{"state": {"columns": [[0, "StateCode", "TEXT", 0, null, 1], [1, "State", "TEXT", 0, null, 0], [2, "Region", "TEXT", 0, null, 0]], "primary_keys": ["StateCode"], "foreign_keys": [], "unique_constraints": [[[0, 0, "StateCode"]]], "check_constraints": []}, "callcenterlogs": {"columns": [[0, "Date received", "DATE", 0, null, 0], [1, "Complaint ID", "TEXT", 0, null, 1], [2, "rand client", "TEXT", 0, null, 0], [3, "phonefinal", "TEXT", 0, null, 0], [4, "vru+line", "TEXT", 0, null, 0], [5, "call_id", "INTEGER", 0, null, 0], [6, "priority", "INTEGER", 0, null, 0], [7, "type", "TEXT", 0, null, 0], [8, "outcome", "TEXT", 0, null, 0], [9, "server", "TEXT", 0, null, 0], [10, "ser_start", "TEXT", 0, null, 0], [11, "ser_exit", "TEXT", 0, null, 0], [12, "ser_time", "TEXT", 0, null, 0]], "primary_keys": ["Complaint ID"], "foreign_keys": [[0, 0, "client", "rand client", "client_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "Complaint ID"]]], "check_constraints": []}, "client": {"columns": [[0, "client_id", "TEXT", 0, null, 1], [1, "sex", "TEXT", 0, null, 0], [2, "day", "INTEGER", 0, null, 0], [3, "month", "INTEGER", 0, null, 0], [4, "year", "INTEGER", 0, null, 0], [5, "age", "INTEGER", 0, null, 0], [6, "social", "TEXT", 0, null, 0], [7, "first", "TEXT", 0, null, 0], [8, "middle", "TEXT", 0, null, 0], [9, "last", "TEXT", 0, null, 0], [10, "phone", "TEXT", 0, null, 0], [11, "email", "TEXT", 0, null, 0], [12, "address_1", "TEXT", 0, null, 0], [13, "address_2", "TEXT", 0, null, 0], [14, "city", "TEXT", 0, null, 0], [15, "state", "TEXT", 0, null, 0], [16, "zipcode", "INTEGER", 0, null, 0], [17, "district_id", "INTEGER", 0, null, 0]], "primary_keys": ["client_id"], "foreign_keys": [[0, 0, "district", "district_id", "district_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "client_id"]]], "check_constraints": []}, "district": {"columns": [[0, "district_id", "INTEGER", 0, null, 1], [1, "city", "TEXT", 0, null, 0], [2, "state_abbrev", "TEXT", 0, null, 0], [3, "division", "TEXT", 0, null, 0]], "primary_keys": ["district_id"], "foreign_keys": [[0, 0, "state", "state_abbrev", "StateCode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "events": {"columns": [[0, "Date received", "DATE", 0, null, 0], [1, "Product", "TEXT", 0, null, 0], [2, "Sub-product", "TEXT", 0, null, 0], [3, "Issue", "TEXT", 0, null, 0], [4, "Sub-issue", "TEXT", 0, null, 0], [5, "Consumer complaint narrative", "TEXT", 0, null, 0], [6, "Tags", "TEXT", 0, null, 0], [7, "Consumer consent provided?", "TEXT", 0, null, 0], [8, "Submitted via", "TEXT", 0, null, 0], [9, "Date sent to company", "TEXT", 0, null, 0], [10, "Company response to consumer", "TEXT", 0, null, 0], [11, "Timely response?", "TEXT", 0, null, 0], [12, "Consumer disputed?", "TEXT", 0, null, 0], [13, "Complaint ID", "TEXT", 0, null, 1], [14, "Client_ID", "TEXT", 0, null, 2]], "primary_keys": ["Complaint ID", "Client_ID"], "foreign_keys": [[0, 0, "client", "Client_ID", "client_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "callcenterlogs", "Complaint ID", "Complaint ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 13, "Complaint ID"], [1, 14, "Client_ID"]]], "check_constraints": []}, "reviews": {"columns": [[0, "Date", "DATE", 0, null, 1], [1, "Stars", "INTEGER", 0, null, 0], [2, "Reviews", "TEXT", 0, null, 0], [3, "Product", "TEXT", 0, null, 0], [4, "district_id", "INTEGER", 0, null, 0]], "primary_keys": ["Date"], "foreign_keys": [[0, 0, "district", "district_id", "district_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Date"]]], "check_constraints": []}}
CREATE TABLE state ( StateCode TEXT PRIMARY KEY, State TEXT, Region TEXT, UNIQUE (StateCode) ); CREATE TABLE callcenterlogs ( Date received DATE, Complaint ID TEXT PRIMARY KEY, rand client TEXT, phonefinal TEXT, vru+line TEXT, call_id INTEGER, priority INTEGER, type TEXT, outcome TEXT, server TEXT, ser_start TEXT, ser_exit TEXT, ser_time TEXT, UNIQUE (Complaint ID), FOREIGN KEY (rand client) REFERENCES client(client_id) ); CREATE TABLE client ( client_id TEXT PRIMARY KEY, sex TEXT, day INTEGER, month INTEGER, year INTEGER, age INTEGER, social TEXT, first TEXT, middle TEXT, last TEXT, phone TEXT, email TEXT, address_1 TEXT, address_2 TEXT, city TEXT, state TEXT, zipcode INTEGER, district_id INTEGER, UNIQUE (client_id), FOREIGN KEY (district_id) REFERENCES district(district_id) ); CREATE TABLE district ( district_id INTEGER PRIMARY KEY, city TEXT, state_abbrev TEXT, division TEXT, FOREIGN KEY (state_abbrev) REFERENCES state(StateCode) ); CREATE TABLE events ( Date received DATE, Product TEXT, Sub-product TEXT, Issue TEXT, Sub-issue TEXT, Consumer complaint narrative TEXT, Tags TEXT, Consumer consent provided? TEXT, Submitted via TEXT, Date sent to company TEXT, Company response to consumer TEXT, Timely response? TEXT, Consumer disputed? TEXT, Complaint ID TEXT PRIMARY KEY, Client_ID TEXT PRIMARY KEY, PRIMARY KEY (Complaint ID, Client_ID), UNIQUE (Complaint ID, Client_ID), FOREIGN KEY (Client_ID) REFERENCES client(client_id), FOREIGN KEY (Complaint ID) REFERENCES callcenterlogs(Complaint ID) ); CREATE TABLE reviews ( Date DATE PRIMARY KEY, Stars INTEGER, Reviews TEXT, Product TEXT, district_id INTEGER, UNIQUE (Date), FOREIGN KEY (district_id) REFERENCES district(district_id) );
simpson_episodes
{"Episode": {"columns": [[0, "episode_id", "TEXT", 0, null, 1], [1, "season", "INTEGER", 0, null, 0], [2, "episode", "INTEGER", 0, null, 0], [3, "number_in_series", "INTEGER", 0, null, 0], [4, "title", "TEXT", 0, null, 0], [5, "summary", "TEXT", 0, null, 0], [6, "air_date", "TEXT", 0, null, 0], [7, "episode_image", "TEXT", 0, null, 0], [8, "rating", "REAL", 0, null, 0], [9, "votes", "INTEGER", 0, null, 0]], "primary_keys": ["episode_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "episode_id"]]], "check_constraints": []}, "Person": {"columns": [[0, "name", "TEXT", 0, null, 1], [1, "birthdate", "TEXT", 0, null, 0], [2, "birth_name", "TEXT", 0, null, 0], [3, "birth_place", "TEXT", 0, null, 0], [4, "birth_region", "TEXT", 0, null, 0], [5, "birth_country", "TEXT", 0, null, 0], [6, "height_meters", "REAL", 0, null, 0], [7, "nickname", "TEXT", 0, null, 0]], "primary_keys": ["name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "Award": {"columns": [[0, "award_id", "INTEGER", 0, null, 1], [1, "organization", "TEXT", 0, null, 0], [2, "year", "INTEGER", 0, null, 0], [3, "award_category", "TEXT", 0, null, 0], [4, "award", "TEXT", 0, null, 0], [5, "person", "TEXT", 0, null, 0], [6, "role", "TEXT", 0, null, 0], [7, "episode_id", "TEXT", 0, null, 0], [8, "season", "TEXT", 0, null, 0], [9, "song", "TEXT", 0, null, 0], [10, "result", "TEXT", 0, null, 0]], "primary_keys": ["award_id"], "foreign_keys": [[0, 0, "Episode", "episode_id", "episode_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Person", "person", "name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Character_Award": {"columns": [[0, "award_id", "INTEGER", 0, null, 0], [1, "character", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Award", "award_id", "award_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Credit": {"columns": [[0, "episode_id", "TEXT", 0, null, 0], [1, "category", "TEXT", 0, null, 0], [2, "person", "TEXT", 0, null, 0], [3, "role", "TEXT", 0, null, 0], [4, "credited", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Person", "person", "name", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Episode", "episode_id", "episode_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Keyword": {"columns": [[0, "episode_id", "TEXT", 0, null, 1], [1, "keyword", "TEXT", 0, null, 2]], "primary_keys": ["episode_id", "keyword"], "foreign_keys": [[0, 0, "Episode", "episode_id", "episode_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "episode_id"], [1, 1, "keyword"]]], "check_constraints": []}, "Vote": {"columns": [[0, "episode_id", "TEXT", 0, null, 0], [1, "stars", "INTEGER", 0, null, 0], [2, "votes", "INTEGER", 0, null, 0], [3, "percent", "REAL", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Episode", "episode_id", "episode_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Episode ( episode_id TEXT PRIMARY KEY, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date TEXT, episode_image TEXT, rating REAL, votes INTEGER, UNIQUE (episode_id) ); CREATE TABLE Person ( name TEXT PRIMARY KEY, birthdate TEXT, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT, UNIQUE (name) ); CREATE TABLE Award ( award_id INTEGER PRIMARY KEY, organization TEXT, year INTEGER, award_category TEXT, award TEXT, person TEXT, role TEXT, episode_id TEXT, season TEXT, song TEXT, result TEXT, FOREIGN KEY (episode_id) REFERENCES Episode(episode_id), FOREIGN KEY (person) REFERENCES Person(name) ); CREATE TABLE Character_Award ( award_id INTEGER, character TEXT, FOREIGN KEY (award_id) REFERENCES Award(award_id) ); CREATE TABLE Credit ( episode_id TEXT, category TEXT, person TEXT, role TEXT, credited TEXT, FOREIGN KEY (person) REFERENCES Person(name), FOREIGN KEY (episode_id) REFERENCES Episode(episode_id) ); CREATE TABLE Keyword ( episode_id TEXT PRIMARY KEY, keyword TEXT PRIMARY KEY, PRIMARY KEY (episode_id, keyword), UNIQUE (episode_id, keyword), FOREIGN KEY (episode_id) REFERENCES Episode(episode_id) ); CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, FOREIGN KEY (episode_id) REFERENCES Episode(episode_id) );
music_platform_2
{"runs": {"columns": [[0, "run_at", "TEXT", 1, null, 0], [1, "max_rowid", "INTEGER", 1, null, 0], [2, "reviews_added", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "podcasts": {"columns": [[0, "podcast_id", "TEXT", 0, null, 1], [1, "itunes_id", "INTEGER", 1, null, 0], [2, "slug", "TEXT", 1, null, 0], [3, "itunes_url", "TEXT", 1, null, 0], [4, "title", "TEXT", 1, null, 0]], "primary_keys": ["podcast_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "podcast_id"]]], "check_constraints": []}, "reviews": {"columns": [[0, "podcast_id", "TEXT", 1, null, 0], [1, "title", "TEXT", 1, null, 0], [2, "content", "TEXT", 1, null, 0], [3, "rating", "INTEGER", 1, null, 0], [4, "author_id", "TEXT", 1, null, 0], [5, "created_at", "TEXT", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "podcasts", "podcast_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "categories": {"columns": [[0, "podcast_id", "TEXT", 1, null, 1], [1, "category", "TEXT", 1, null, 2]], "primary_keys": ["podcast_id", "category"], "foreign_keys": [[0, 0, "podcasts", "podcast_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "podcast_id"], [1, 1, "category"]]], "check_constraints": []}}
CREATE TABLE runs ( run_at TEXT NOT NULL, max_rowid INTEGER NOT NULL, reviews_added INTEGER NOT NULL ); CREATE TABLE podcasts ( podcast_id TEXT PRIMARY KEY, itunes_id INTEGER NOT NULL, slug TEXT NOT NULL, itunes_url TEXT NOT NULL, title TEXT NOT NULL, UNIQUE (podcast_id) ); CREATE TABLE reviews ( podcast_id TEXT NOT NULL, title TEXT NOT NULL, content TEXT NOT NULL, rating INTEGER NOT NULL, author_id TEXT NOT NULL, created_at TEXT NOT NULL, FOREIGN KEY (podcast_id) REFERENCES podcasts(None) ); CREATE TABLE categories ( podcast_id TEXT NOT NULL PRIMARY KEY, category TEXT NOT NULL PRIMARY KEY, PRIMARY KEY (podcast_id, category), UNIQUE (podcast_id, category), FOREIGN KEY (podcast_id) REFERENCES podcasts(None) );
codebase_comments
{"sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Method": {"columns": [[0, "Id", "INTEGER", 1, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "FullComment", "TEXT", 0, null, 0], [3, "Summary", "TEXT", 0, null, 0], [4, "ApiCalls", "TEXT", 0, null, 0], [5, "CommentIsXml", "INTEGER", 0, null, 0], [6, "SampledAt", "INTEGER", 0, null, 0], [7, "SolutionId", "INTEGER", 0, null, 0], [8, "Lang", "TEXT", 0, null, 0], [9, "NameTokenized", "TEXT", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "MethodParameter": {"columns": [[0, "Id", "INTEGER", 1, null, 1], [1, "MethodId", "TEXT", 0, null, 0], [2, "Type", "TEXT", 0, null, 0], [3, "Name", "TEXT", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Repo": {"columns": [[0, "Id", "INTEGER", 1, null, 1], [1, "Url", "TEXT", 0, null, 0], [2, "Stars", "INTEGER", 0, null, 0], [3, "Forks", "INTEGER", 0, null, 0], [4, "Watchers", "INTEGER", 0, null, 0], [5, "ProcessedTime", "INTEGER", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Solution": {"columns": [[0, "Id", "INTEGER", 1, null, 1], [1, "RepoId", "INTEGER", 0, null, 0], [2, "Path", "TEXT", 0, null, 0], [3, "ProcessedTime", "INTEGER", 0, null, 0], [4, "WasCompiled", "INTEGER", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE Method ( Id INTEGER NOT NULL PRIMARY KEY, Name TEXT, FullComment TEXT, Summary TEXT, ApiCalls TEXT, CommentIsXml INTEGER, SampledAt INTEGER, SolutionId INTEGER, Lang TEXT, NameTokenized TEXT ); CREATE TABLE MethodParameter ( Id INTEGER NOT NULL PRIMARY KEY, MethodId TEXT, Type TEXT, Name TEXT ); CREATE TABLE Repo ( Id INTEGER NOT NULL PRIMARY KEY, Url TEXT, Stars INTEGER, Forks INTEGER, Watchers INTEGER, ProcessedTime INTEGER ); CREATE TABLE Solution ( Id INTEGER NOT NULL PRIMARY KEY, RepoId INTEGER, Path TEXT, ProcessedTime INTEGER, WasCompiled INTEGER );
app_store
{"playstore": {"columns": [[0, "App", "TEXT", 0, null, 0], [1, "Category", "TEXT", 0, null, 0], [2, "Rating", "REAL", 0, null, 0], [3, "Reviews", "INTEGER", 0, null, 0], [4, "Size", "TEXT", 0, null, 0], [5, "Installs", "TEXT", 0, null, 0], [6, "Type", "TEXT", 0, null, 0], [7, "Price", "TEXT", 0, null, 0], [8, "Content Rating", "TEXT", 0, null, 0], [9, "Genres", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "user_reviews": {"columns": [[0, "App", "TEXT", 0, null, 0], [1, "Translated_Review", "TEXT", 0, null, 0], [2, "Sentiment", "TEXT", 0, null, 0], [3, "Sentiment_Polarity", "TEXT", 0, null, 0], [4, "Sentiment_Subjectivity", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "playstore", "App", "App", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE playstore ( App TEXT, Category TEXT, Rating REAL, Reviews INTEGER, Size TEXT, Installs TEXT, Type TEXT, Price TEXT, Content Rating TEXT, Genres TEXT ); CREATE TABLE user_reviews ( App TEXT, Translated_Review TEXT, Sentiment TEXT, Sentiment_Polarity TEXT, Sentiment_Subjectivity TEXT, FOREIGN KEY (App) REFERENCES playstore(App) );
world
{"sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "City": {"columns": [[0, "ID", "INTEGER", 1, null, 1], [1, "Name", "TEXT", 1, "''", 0], [2, "CountryCode", "TEXT", 1, "''", 0], [3, "District", "TEXT", 1, "''", 0], [4, "Population", "INTEGER", 1, "0", 0]], "primary_keys": ["ID"], "foreign_keys": [[0, 0, "Country", "CountryCode", "Code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Country": {"columns": [[0, "Code", "TEXT", 1, "''", 1], [1, "Name", "TEXT", 1, "''", 0], [2, "Continent", "TEXT", 1, "'Asia'", 0], [3, "Region", "TEXT", 1, "''", 0], [4, "SurfaceArea", "REAL", 1, "0.00", 0], [5, "IndepYear", "INTEGER", 0, "NULL", 0], [6, "Population", "INTEGER", 1, "0", 0], [7, "LifeExpectancy", "REAL", 0, "NULL", 0], [8, "GNP", "REAL", 0, "NULL", 0], [9, "GNPOld", "REAL", 0, "NULL", 0], [10, "LocalName", "TEXT", 1, "''", 0], [11, "GovernmentForm", "TEXT", 1, "''", 0], [12, "HeadOfState", "TEXT", 0, "NULL", 0], [13, "Capital", "INTEGER", 0, "NULL", 0], [14, "Code2", "TEXT", 1, "''", 0]], "primary_keys": ["Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Code"]]], "check_constraints": []}, "CountryLanguage": {"columns": [[0, "CountryCode", "TEXT", 1, "''", 1], [1, "Language", "TEXT", 1, "''", 2], [2, "IsOfficial", "TEXT", 1, "'F'", 0], [3, "Percentage", "REAL", 1, "0.0", 0]], "primary_keys": ["CountryCode", "Language"], "foreign_keys": [[0, 0, "Country", "CountryCode", "Code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "CountryCode"], [1, 1, "Language"]]], "check_constraints": []}}
CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE City ( ID INTEGER NOT NULL PRIMARY KEY, Name TEXT NOT NULL DEFAULT '', CountryCode TEXT NOT NULL DEFAULT '', District TEXT NOT NULL DEFAULT '', Population INTEGER NOT NULL DEFAULT 0, FOREIGN KEY (CountryCode) REFERENCES Country(Code) ); CREATE TABLE Country ( Code TEXT NOT NULL DEFAULT '' PRIMARY KEY, Name TEXT NOT NULL DEFAULT '', Continent TEXT NOT NULL DEFAULT 'Asia', Region TEXT NOT NULL DEFAULT '', SurfaceArea REAL NOT NULL DEFAULT 0.00, IndepYear INTEGER DEFAULT NULL, Population INTEGER NOT NULL DEFAULT 0, LifeExpectancy REAL DEFAULT NULL, GNP REAL DEFAULT NULL, GNPOld REAL DEFAULT NULL, LocalName TEXT NOT NULL DEFAULT '', GovernmentForm TEXT NOT NULL DEFAULT '', HeadOfState TEXT DEFAULT NULL, Capital INTEGER DEFAULT NULL, Code2 TEXT NOT NULL DEFAULT '', UNIQUE (Code) ); CREATE TABLE CountryLanguage ( CountryCode TEXT NOT NULL DEFAULT '' PRIMARY KEY, Language TEXT NOT NULL DEFAULT '' PRIMARY KEY, IsOfficial TEXT NOT NULL DEFAULT 'F', Percentage REAL NOT NULL DEFAULT 0.0, PRIMARY KEY (CountryCode, Language), UNIQUE (CountryCode, Language), FOREIGN KEY (CountryCode) REFERENCES Country(Code) );
olympics
{"city": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "city_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "games": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "games_year", "INTEGER", 0, "NULL", 0], [2, "games_name", "TEXT", 0, "NULL", 0], [3, "season", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "games_city": {"columns": [[0, "games_id", "INTEGER", 0, "NULL", 0], [1, "city_id", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "games", "games_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "city", "city_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "medal": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "medal_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "noc_region": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "noc", "TEXT", 0, "NULL", 0], [2, "region_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "person": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "full_name", "TEXT", 0, "NULL", 0], [2, "gender", "TEXT", 0, "NULL", 0], [3, "height", "INTEGER", 0, "NULL", 0], [4, "weight", "INTEGER", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "games_competitor": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "games_id", "INTEGER", 0, "NULL", 0], [2, "person_id", "INTEGER", 0, "NULL", 0], [3, "age", "INTEGER", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "person", "person_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "games", "games_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "person_region": {"columns": [[0, "person_id", "INTEGER", 0, "NULL", 0], [1, "region_id", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "noc_region", "region_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "person", "person_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "sport": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "sport_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "event": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "sport_id", "INTEGER", 0, "NULL", 0], [2, "event_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "sport", "sport_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "competitor_event": {"columns": [[0, "event_id", "INTEGER", 0, "NULL", 0], [1, "competitor_id", "INTEGER", 0, "NULL", 0], [2, "medal_id", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "medal", "medal_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "event", "event_id", "id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "games_competitor", "competitor_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE city ( id INTEGER NOT NULL PRIMARY KEY, city_name TEXT DEFAULT NULL ); CREATE TABLE games ( id INTEGER NOT NULL PRIMARY KEY, games_year INTEGER DEFAULT NULL, games_name TEXT DEFAULT NULL, season TEXT DEFAULT NULL ); CREATE TABLE games_city ( games_id INTEGER DEFAULT NULL, city_id INTEGER DEFAULT NULL, FOREIGN KEY (games_id) REFERENCES games(id), FOREIGN KEY (city_id) REFERENCES city(id) ); CREATE TABLE medal ( id INTEGER NOT NULL PRIMARY KEY, medal_name TEXT DEFAULT NULL ); CREATE TABLE noc_region ( id INTEGER NOT NULL PRIMARY KEY, noc TEXT DEFAULT NULL, region_name TEXT DEFAULT NULL ); CREATE TABLE person ( id INTEGER NOT NULL PRIMARY KEY, full_name TEXT DEFAULT NULL, gender TEXT DEFAULT NULL, height INTEGER DEFAULT NULL, weight INTEGER DEFAULT NULL ); CREATE TABLE games_competitor ( id INTEGER NOT NULL PRIMARY KEY, games_id INTEGER DEFAULT NULL, person_id INTEGER DEFAULT NULL, age INTEGER DEFAULT NULL, FOREIGN KEY (person_id) REFERENCES person(id), FOREIGN KEY (games_id) REFERENCES games(id) ); CREATE TABLE person_region ( person_id INTEGER DEFAULT NULL, region_id INTEGER DEFAULT NULL, FOREIGN KEY (region_id) REFERENCES noc_region(id), FOREIGN KEY (person_id) REFERENCES person(id) ); CREATE TABLE sport ( id INTEGER NOT NULL PRIMARY KEY, sport_name TEXT DEFAULT NULL ); CREATE TABLE event ( id INTEGER NOT NULL PRIMARY KEY, sport_id INTEGER DEFAULT NULL, event_name TEXT DEFAULT NULL, FOREIGN KEY (sport_id) REFERENCES sport(id) ); CREATE TABLE competitor_event ( event_id INTEGER DEFAULT NULL, competitor_id INTEGER DEFAULT NULL, medal_id INTEGER DEFAULT NULL, FOREIGN KEY (medal_id) REFERENCES medal(id), FOREIGN KEY (event_id) REFERENCES event(id), FOREIGN KEY (competitor_id) REFERENCES games_competitor(id) );
music_tracker
{"torrents": {"columns": [[0, "groupName", "TEXT", 0, null, 0], [1, "totalSnatched", "INTEGER", 0, null, 0], [2, "artist", "TEXT", 0, null, 0], [3, "groupYear", "INTEGER", 0, null, 0], [4, "releaseType", "TEXT", 0, null, 0], [5, "groupId", "INTEGER", 0, null, 0], [6, "id", "INTEGER", 0, null, 1]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "tags": {"columns": [[0, "index", "INTEGER", 0, null, 1], [1, "id", "INTEGER", 0, null, 0], [2, "tag", "TEXT", 0, null, 0]], "primary_keys": ["index"], "foreign_keys": [[0, 0, "torrents", "id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE torrents ( groupName TEXT, totalSnatched INTEGER, artist TEXT, groupYear INTEGER, releaseType TEXT, groupId INTEGER, id INTEGER PRIMARY KEY ); CREATE TABLE tags ( index INTEGER PRIMARY KEY, id INTEGER, tag TEXT, FOREIGN KEY (id) REFERENCES torrents(None) );
retail_world
{"sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Categories": {"columns": [[0, "CategoryID", "INTEGER", 0, null, 1], [1, "CategoryName", "TEXT", 0, null, 0], [2, "Description", "TEXT", 0, null, 0]], "primary_keys": ["CategoryID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers": {"columns": [[0, "CustomerID", "INTEGER", 0, null, 1], [1, "CustomerName", "TEXT", 0, null, 0], [2, "ContactName", "TEXT", 0, null, 0], [3, "Address", "TEXT", 0, null, 0], [4, "City", "TEXT", 0, null, 0], [5, "PostalCode", "TEXT", 0, null, 0], [6, "Country", "TEXT", 0, null, 0]], "primary_keys": ["CustomerID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Employees": {"columns": [[0, "EmployeeID", "INTEGER", 0, null, 1], [1, "LastName", "TEXT", 0, null, 0], [2, "FirstName", "TEXT", 0, null, 0], [3, "BirthDate", "DATE", 0, null, 0], [4, "Photo", "TEXT", 0, null, 0], [5, "Notes", "TEXT", 0, null, 0]], "primary_keys": ["EmployeeID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Shippers": {"columns": [[0, "ShipperID", "INTEGER", 0, null, 1], [1, "ShipperName", "TEXT", 0, null, 0], [2, "Phone", "TEXT", 0, null, 0]], "primary_keys": ["ShipperID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Suppliers": {"columns": [[0, "SupplierID", "INTEGER", 0, null, 1], [1, "SupplierName", "TEXT", 0, null, 0], [2, "ContactName", "TEXT", 0, null, 0], [3, "Address", "TEXT", 0, null, 0], [4, "City", "TEXT", 0, null, 0], [5, "PostalCode", "TEXT", 0, null, 0], [6, "Country", "TEXT", 0, null, 0], [7, "Phone", "TEXT", 0, null, 0]], "primary_keys": ["SupplierID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "ProductID", "INTEGER", 0, null, 1], [1, "ProductName", "TEXT", 0, null, 0], [2, "SupplierID", "INTEGER", 0, null, 0], [3, "CategoryID", "INTEGER", 0, null, 0], [4, "Unit", "TEXT", 0, null, 0], [5, "Price", "REAL", 0, "0", 0]], "primary_keys": ["ProductID"], "foreign_keys": [[0, 0, "Suppliers", "SupplierID", "SupplierID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Categories", "CategoryID", "CategoryID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Orders": {"columns": [[0, "OrderID", "INTEGER", 0, null, 1], [1, "CustomerID", "INTEGER", 0, null, 0], [2, "EmployeeID", "INTEGER", 0, null, 0], [3, "OrderDate", "DATETIME", 0, null, 0], [4, "ShipperID", "INTEGER", 0, null, 0]], "primary_keys": ["OrderID"], "foreign_keys": [[0, 0, "Shippers", "ShipperID", "ShipperID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Customers", "CustomerID", "CustomerID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Employees", "EmployeeID", "EmployeeID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "OrderDetails": {"columns": [[0, "OrderDetailID", "INTEGER", 0, null, 1], [1, "OrderID", "INTEGER", 0, null, 0], [2, "ProductID", "INTEGER", 0, null, 0], [3, "Quantity", "INTEGER", 0, null, 0]], "primary_keys": ["OrderDetailID"], "foreign_keys": [[0, 0, "Products", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Orders", "OrderID", "OrderID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE Categories ( CategoryID INTEGER PRIMARY KEY, CategoryName TEXT, Description TEXT ); CREATE TABLE Customers ( CustomerID INTEGER PRIMARY KEY, CustomerName TEXT, ContactName TEXT, Address TEXT, City TEXT, PostalCode TEXT, Country TEXT ); CREATE TABLE Employees ( EmployeeID INTEGER PRIMARY KEY, LastName TEXT, FirstName TEXT, BirthDate DATE, Photo TEXT, Notes TEXT ); CREATE TABLE Shippers ( ShipperID INTEGER PRIMARY KEY, ShipperName TEXT, Phone TEXT ); CREATE TABLE Suppliers ( SupplierID INTEGER PRIMARY KEY, SupplierName TEXT, ContactName TEXT, Address TEXT, City TEXT, PostalCode TEXT, Country TEXT, Phone TEXT ); CREATE TABLE Products ( ProductID INTEGER PRIMARY KEY, ProductName TEXT, SupplierID INTEGER, CategoryID INTEGER, Unit TEXT, Price REAL DEFAULT 0, FOREIGN KEY (SupplierID) REFERENCES Suppliers(SupplierID), FOREIGN KEY (CategoryID) REFERENCES Categories(CategoryID) ); CREATE TABLE Orders ( OrderID INTEGER PRIMARY KEY, CustomerID INTEGER, EmployeeID INTEGER, OrderDate DATETIME, ShipperID INTEGER, FOREIGN KEY (ShipperID) REFERENCES Shippers(ShipperID), FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID), FOREIGN KEY (EmployeeID) REFERENCES Employees(EmployeeID) ); CREATE TABLE OrderDetails ( OrderDetailID INTEGER PRIMARY KEY, OrderID INTEGER, ProductID INTEGER, Quantity INTEGER, FOREIGN KEY (ProductID) REFERENCES Products(ProductID), FOREIGN KEY (OrderID) REFERENCES Orders(OrderID) );
image_and_language
{"ATT_CLASSES": {"columns": [[0, "ATT_CLASS_ID", "INTEGER", 1, "0", 1], [1, "ATT_CLASS", "TEXT", 1, null, 0]], "primary_keys": ["ATT_CLASS_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "OBJ_CLASSES": {"columns": [[0, "OBJ_CLASS_ID", "INTEGER", 1, "0", 1], [1, "OBJ_CLASS", "TEXT", 1, null, 0]], "primary_keys": ["OBJ_CLASS_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "IMG_OBJ": {"columns": [[0, "IMG_ID", "INTEGER", 1, "0", 1], [1, "OBJ_SAMPLE_ID", "INTEGER", 1, "0", 2], [2, "OBJ_CLASS_ID", "INTEGER", 0, null, 0], [3, "X", "INTEGER", 0, null, 0], [4, "Y", "INTEGER", 0, null, 0], [5, "W", "INTEGER", 0, null, 0], [6, "H", "INTEGER", 0, null, 0]], "primary_keys": ["IMG_ID", "OBJ_SAMPLE_ID"], "foreign_keys": [[0, 0, "OBJ_CLASSES", "OBJ_CLASS_ID", "OBJ_CLASS_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "IMG_ID"], [1, 1, "OBJ_SAMPLE_ID"]]], "check_constraints": []}, "IMG_OBJ_ATT": {"columns": [[0, "IMG_ID", "INTEGER", 1, "0", 1], [1, "ATT_CLASS_ID", "INTEGER", 1, "0", 2], [2, "OBJ_SAMPLE_ID", "INTEGER", 1, "0", 3]], "primary_keys": ["IMG_ID", "ATT_CLASS_ID", "OBJ_SAMPLE_ID"], "foreign_keys": [[0, 0, "IMG_OBJ", "IMG_ID", "IMG_ID", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "IMG_OBJ", "OBJ_SAMPLE_ID", "OBJ_SAMPLE_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "ATT_CLASSES", "ATT_CLASS_ID", "ATT_CLASS_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "IMG_ID"], [1, 1, "ATT_CLASS_ID"], [2, 2, "OBJ_SAMPLE_ID"]]], "check_constraints": []}, "PRED_CLASSES": {"columns": [[0, "PRED_CLASS_ID", "INTEGER", 1, "0", 1], [1, "PRED_CLASS", "TEXT", 1, null, 0]], "primary_keys": ["PRED_CLASS_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "IMG_REL": {"columns": [[0, "IMG_ID", "INTEGER", 1, "0", 1], [1, "PRED_CLASS_ID", "INTEGER", 1, "0", 2], [2, "OBJ1_SAMPLE_ID", "INTEGER", 1, "0", 3], [3, "OBJ2_SAMPLE_ID", "INTEGER", 1, "0", 4]], "primary_keys": ["IMG_ID", "PRED_CLASS_ID", "OBJ1_SAMPLE_ID", "OBJ2_SAMPLE_ID"], "foreign_keys": [[0, 0, "IMG_OBJ", "IMG_ID", "IMG_ID", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "IMG_OBJ", "OBJ2_SAMPLE_ID", "OBJ_SAMPLE_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "IMG_OBJ", "IMG_ID", "IMG_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 1, "IMG_OBJ", "OBJ1_SAMPLE_ID", "OBJ_SAMPLE_ID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "PRED_CLASSES", "PRED_CLASS_ID", "PRED_CLASS_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "IMG_ID"], [1, 1, "PRED_CLASS_ID"], [2, 2, "OBJ1_SAMPLE_ID"], [3, 3, "OBJ2_SAMPLE_ID"]]], "check_constraints": []}}
CREATE TABLE ATT_CLASSES ( ATT_CLASS_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, ATT_CLASS TEXT NOT NULL ); CREATE TABLE OBJ_CLASSES ( OBJ_CLASS_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, OBJ_CLASS TEXT NOT NULL ); CREATE TABLE IMG_OBJ ( IMG_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, OBJ_SAMPLE_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, OBJ_CLASS_ID INTEGER, X INTEGER, Y INTEGER, W INTEGER, H INTEGER, PRIMARY KEY (IMG_ID, OBJ_SAMPLE_ID), UNIQUE (IMG_ID, OBJ_SAMPLE_ID), FOREIGN KEY (OBJ_CLASS_ID) REFERENCES OBJ_CLASSES(OBJ_CLASS_ID) ); CREATE TABLE IMG_OBJ_ATT ( IMG_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, ATT_CLASS_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, OBJ_SAMPLE_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, PRIMARY KEY (IMG_ID, ATT_CLASS_ID, OBJ_SAMPLE_ID), UNIQUE (IMG_ID, ATT_CLASS_ID, OBJ_SAMPLE_ID), FOREIGN KEY (IMG_ID) REFERENCES IMG_OBJ(IMG_ID), FOREIGN KEY (OBJ_SAMPLE_ID) REFERENCES IMG_OBJ(OBJ_SAMPLE_ID), FOREIGN KEY (ATT_CLASS_ID) REFERENCES ATT_CLASSES(ATT_CLASS_ID) ); CREATE TABLE PRED_CLASSES ( PRED_CLASS_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, PRED_CLASS TEXT NOT NULL ); CREATE TABLE IMG_REL ( IMG_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, PRED_CLASS_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, OBJ1_SAMPLE_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, OBJ2_SAMPLE_ID INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, PRIMARY KEY (IMG_ID, PRED_CLASS_ID, OBJ1_SAMPLE_ID, OBJ2_SAMPLE_ID), UNIQUE (IMG_ID, PRED_CLASS_ID, OBJ1_SAMPLE_ID, OBJ2_SAMPLE_ID), FOREIGN KEY (IMG_ID) REFERENCES IMG_OBJ(IMG_ID), FOREIGN KEY (OBJ2_SAMPLE_ID) REFERENCES IMG_OBJ(OBJ_SAMPLE_ID), FOREIGN KEY (IMG_ID) REFERENCES IMG_OBJ(IMG_ID), FOREIGN KEY (OBJ1_SAMPLE_ID) REFERENCES IMG_OBJ(OBJ_SAMPLE_ID), FOREIGN KEY (PRED_CLASS_ID) REFERENCES PRED_CLASSES(PRED_CLASS_ID) );
college_completion
{"institution_details": {"columns": [[0, "unitid", "INTEGER", 0, null, 1], [1, "chronname", "TEXT", 0, null, 0], [2, "city", "TEXT", 0, null, 0], [3, "state", "TEXT", 0, null, 0], [4, "level", "TEXT", 0, null, 0], [5, "control", "TEXT", 0, null, 0], [6, "basic", "TEXT", 0, null, 0], [7, "hbcu", "TEXT", 0, null, 0], [8, "flagship", "TEXT", 0, null, 0], [9, "long_x", "REAL", 0, null, 0], [10, "lat_y", "REAL", 0, null, 0], [11, "site", "TEXT", 0, null, 0], [12, "student_count", "INTEGER", 0, null, 0], [13, "awards_per_value", "REAL", 0, null, 0], [14, "awards_per_state_value", "REAL", 0, null, 0], [15, "awards_per_natl_value", "REAL", 0, null, 0], [16, "exp_award_value", "INTEGER", 0, null, 0], [17, "exp_award_state_value", "INTEGER", 0, null, 0], [18, "exp_award_natl_value", "INTEGER", 0, null, 0], [19, "exp_award_percentile", "INTEGER", 0, null, 0], [20, "ft_pct", "REAL", 0, null, 0], [21, "fte_value", "INTEGER", 0, null, 0], [22, "fte_percentile", "INTEGER", 0, null, 0], [23, "med_sat_value", "TEXT", 0, null, 0], [24, "med_sat_percentile", "TEXT", 0, null, 0], [25, "aid_value", "INTEGER", 0, null, 0], [26, "aid_percentile", "INTEGER", 0, null, 0], [27, "endow_value", "TEXT", 0, null, 0], [28, "endow_percentile", "TEXT", 0, null, 0], [29, "grad_100_value", "REAL", 0, null, 0], [30, "grad_100_percentile", "INTEGER", 0, null, 0], [31, "grad_150_value", "REAL", 0, null, 0], [32, "grad_150_percentile", "INTEGER", 0, null, 0], [33, "pell_value", "REAL", 0, null, 0], [34, "pell_percentile", "INTEGER", 0, null, 0], [35, "retain_value", "REAL", 0, null, 0], [36, "retain_percentile", "INTEGER", 0, null, 0], [37, "ft_fac_value", "REAL", 0, null, 0], [38, "ft_fac_percentile", "INTEGER", 0, null, 0], [39, "vsa_year", "TEXT", 0, null, 0], [40, "vsa_grad_after4_first", "TEXT", 0, null, 0], [41, "vsa_grad_elsewhere_after4_first", "TEXT", 0, null, 0], [42, "vsa_enroll_after4_first", "TEXT", 0, null, 0], [43, "vsa_enroll_elsewhere_after4_first", "TEXT", 0, null, 0], [44, "vsa_grad_after6_first", "TEXT", 0, null, 0], [45, "vsa_grad_elsewhere_after6_first", "TEXT", 0, null, 0], [46, "vsa_enroll_after6_first", "TEXT", 0, null, 0], [47, "vsa_enroll_elsewhere_after6_first", "TEXT", 0, null, 0], [48, "vsa_grad_after4_transfer", "TEXT", 0, null, 0], [49, "vsa_grad_elsewhere_after4_transfer", "TEXT", 0, null, 0], [50, "vsa_enroll_after4_transfer", "TEXT", 0, null, 0], [51, "vsa_enroll_elsewhere_after4_transfer", "TEXT", 0, null, 0], [52, "vsa_grad_after6_transfer", "TEXT", 0, null, 0], [53, "vsa_grad_elsewhere_after6_transfer", "TEXT", 0, null, 0], [54, "vsa_enroll_after6_transfer", "TEXT", 0, null, 0], [55, "vsa_enroll_elsewhere_after6_transfer", "TEXT", 0, null, 0], [56, "similar", "TEXT", 0, null, 0], [57, "state_sector_ct", "INTEGER", 0, null, 0], [58, "carnegie_ct", "INTEGER", 0, null, 0], [59, "counted_pct", "TEXT", 0, null, 0], [60, "nicknames", "TEXT", 0, null, 0], [61, "cohort_size", "INTEGER", 0, null, 0]], "primary_keys": ["unitid"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "institution_grads": {"columns": [[0, "unitid", "INTEGER", 0, null, 0], [1, "year", "INTEGER", 0, null, 0], [2, "gender", "TEXT", 0, null, 0], [3, "race", "TEXT", 0, null, 0], [4, "cohort", "TEXT", 0, null, 0], [5, "grad_cohort", "TEXT", 0, null, 0], [6, "grad_100", "TEXT", 0, null, 0], [7, "grad_150", "TEXT", 0, null, 0], [8, "grad_100_rate", "TEXT", 0, null, 0], [9, "grad_150_rate", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "institution_details", "unitid", "unitid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "state_sector_grads": {"columns": [[0, "stateid", "INTEGER", 0, null, 0], [1, "state", "TEXT", 0, null, 0], [2, "state_abbr", "TEXT", 0, null, 0], [3, "control", "TEXT", 0, null, 0], [4, "level", "TEXT", 0, null, 0], [5, "year", "INTEGER", 0, null, 0], [6, "gender", "TEXT", 0, null, 0], [7, "race", "TEXT", 0, null, 0], [8, "cohort", "TEXT", 0, null, 0], [9, "grad_cohort", "TEXT", 0, null, 0], [10, "grad_100", "TEXT", 0, null, 0], [11, "grad_150", "TEXT", 0, null, 0], [12, "grad_100_rate", "TEXT", 0, null, 0], [13, "grad_150_rate", "TEXT", 0, null, 0], [14, "grad_cohort_ct", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "state_sector_details", "stateid", "stateid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "institution_details", "state", "state", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "state_sector_details": {"columns": [[0, "stateid", "INTEGER", 0, null, 1], [1, "state", "TEXT", 0, null, 0], [2, "state_post", "TEXT", 0, null, 0], [3, "level", "TEXT", 0, null, 2], [4, "control", "TEXT", 0, null, 3], [5, "schools_count", "INTEGER", 0, null, 0], [6, "counted_pct", "TEXT", 0, null, 0], [7, "awards_per_state_value", "TEXT", 0, null, 0], [8, "awards_per_natl_value", "REAL", 0, null, 0], [9, "exp_award_state_value", "TEXT", 0, null, 0], [10, "exp_award_natl_value", "INTEGER", 0, null, 0], [11, "state_appr_value", "TEXT", 0, null, 0], [12, "state_appr_rank", "TEXT", 0, null, 0], [13, "grad_rate_rank", "TEXT", 0, null, 0], [14, "awards_per_rank", "TEXT", 0, null, 0]], "primary_keys": ["stateid", "level", "control"], "foreign_keys": [[0, 0, "institution_details", "state", "state", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "stateid"], [1, 3, "level"], [2, 4, "control"]]], "check_constraints": []}}
CREATE TABLE institution_details ( unitid INTEGER PRIMARY KEY, chronname TEXT, city TEXT, state TEXT, level TEXT, control TEXT, basic TEXT, hbcu TEXT, flagship TEXT, long_x REAL, lat_y REAL, site TEXT, student_count INTEGER, awards_per_value REAL, awards_per_state_value REAL, awards_per_natl_value REAL, exp_award_value INTEGER, exp_award_state_value INTEGER, exp_award_natl_value INTEGER, exp_award_percentile INTEGER, ft_pct REAL, fte_value INTEGER, fte_percentile INTEGER, med_sat_value TEXT, med_sat_percentile TEXT, aid_value INTEGER, aid_percentile INTEGER, endow_value TEXT, endow_percentile TEXT, grad_100_value REAL, grad_100_percentile INTEGER, grad_150_value REAL, grad_150_percentile INTEGER, pell_value REAL, pell_percentile INTEGER, retain_value REAL, retain_percentile INTEGER, ft_fac_value REAL, ft_fac_percentile INTEGER, vsa_year TEXT, vsa_grad_after4_first TEXT, vsa_grad_elsewhere_after4_first TEXT, vsa_enroll_after4_first TEXT, vsa_enroll_elsewhere_after4_first TEXT, vsa_grad_after6_first TEXT, vsa_grad_elsewhere_after6_first TEXT, vsa_enroll_after6_first TEXT, vsa_enroll_elsewhere_after6_first TEXT, vsa_grad_after4_transfer TEXT, vsa_grad_elsewhere_after4_transfer TEXT, vsa_enroll_after4_transfer TEXT, vsa_enroll_elsewhere_after4_transfer TEXT, vsa_grad_after6_transfer TEXT, vsa_grad_elsewhere_after6_transfer TEXT, vsa_enroll_after6_transfer TEXT, vsa_enroll_elsewhere_after6_transfer TEXT, similar TEXT, state_sector_ct INTEGER, carnegie_ct INTEGER, counted_pct TEXT, nicknames TEXT, cohort_size INTEGER ); CREATE TABLE institution_grads ( unitid INTEGER, year INTEGER, gender TEXT, race TEXT, cohort TEXT, grad_cohort TEXT, grad_100 TEXT, grad_150 TEXT, grad_100_rate TEXT, grad_150_rate TEXT, FOREIGN KEY (unitid) REFERENCES institution_details(unitid) ); CREATE TABLE state_sector_grads ( stateid INTEGER, state TEXT, state_abbr TEXT, control TEXT, level TEXT, year INTEGER, gender TEXT, race TEXT, cohort TEXT, grad_cohort TEXT, grad_100 TEXT, grad_150 TEXT, grad_100_rate TEXT, grad_150_rate TEXT, grad_cohort_ct INTEGER, FOREIGN KEY (stateid) REFERENCES state_sector_details(stateid), FOREIGN KEY (state) REFERENCES institution_details(state) ); CREATE TABLE state_sector_details ( stateid INTEGER PRIMARY KEY, state TEXT, state_post TEXT, level TEXT PRIMARY KEY, control TEXT PRIMARY KEY, schools_count INTEGER, counted_pct TEXT, awards_per_state_value TEXT, awards_per_natl_value REAL, exp_award_state_value TEXT, exp_award_natl_value INTEGER, state_appr_value TEXT, state_appr_rank TEXT, grad_rate_rank TEXT, awards_per_rank TEXT, PRIMARY KEY (stateid, level, control), UNIQUE (stateid, level, control), FOREIGN KEY (state) REFERENCES institution_details(state) );
book_publishing_company
{"authors": {"columns": [[0, "au_id", "TEXT", 0, null, 1], [1, "au_lname", "TEXT", 1, null, 0], [2, "au_fname", "TEXT", 1, null, 0], [3, "phone", "TEXT", 1, null, 0], [4, "address", "TEXT", 0, null, 0], [5, "city", "TEXT", 0, null, 0], [6, "state", "TEXT", 0, null, 0], [7, "zip", "TEXT", 0, null, 0], [8, "contract", "TEXT", 1, null, 0]], "primary_keys": ["au_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "au_id"]]], "check_constraints": []}, "jobs": {"columns": [[0, "job_id", "INTEGER", 0, null, 1], [1, "job_desc", "TEXT", 1, null, 0], [2, "min_lvl", "INTEGER", 1, null, 0], [3, "max_lvl", "INTEGER", 1, null, 0]], "primary_keys": ["job_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "publishers": {"columns": [[0, "pub_id", "TEXT", 0, null, 1], [1, "pub_name", "TEXT", 0, null, 0], [2, "city", "TEXT", 0, null, 0], [3, "state", "TEXT", 0, null, 0], [4, "country", "TEXT", 0, null, 0]], "primary_keys": ["pub_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "pub_id"]]], "check_constraints": []}, "employee": {"columns": [[0, "emp_id", "TEXT", 0, null, 1], [1, "fname", "TEXT", 1, null, 0], [2, "minit", "TEXT", 0, null, 0], [3, "lname", "TEXT", 1, null, 0], [4, "job_id", "INTEGER", 1, null, 0], [5, "job_lvl", "INTEGER", 0, null, 0], [6, "pub_id", "TEXT", 1, null, 0], [7, "hire_date", "DATETIME", 1, null, 0]], "primary_keys": ["emp_id"], "foreign_keys": [[0, 0, "publishers", "pub_id", "pub_id", "CASCADE", "CASCADE", "NONE"], [1, 0, "jobs", "job_id", "job_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "emp_id"]]], "check_constraints": []}, "pub_info": {"columns": [[0, "pub_id", "TEXT", 0, null, 1], [1, "logo", "BLOB", 0, null, 0], [2, "pr_info", "TEXT", 0, null, 0]], "primary_keys": ["pub_id"], "foreign_keys": [[0, 0, "publishers", "pub_id", "pub_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "pub_id"]]], "check_constraints": []}, "stores": {"columns": [[0, "stor_id", "TEXT", 0, null, 1], [1, "stor_name", "TEXT", 0, null, 0], [2, "stor_address", "TEXT", 0, null, 0], [3, "city", "TEXT", 0, null, 0], [4, "state", "TEXT", 0, null, 0], [5, "zip", "TEXT", 0, null, 0]], "primary_keys": ["stor_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "stor_id"]]], "check_constraints": []}, "discounts": {"columns": [[0, "discounttype", "TEXT", 1, null, 0], [1, "stor_id", "TEXT", 0, null, 0], [2, "lowqty", "INTEGER", 0, null, 0], [3, "highqty", "INTEGER", 0, null, 0], [4, "discount", "REAL", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "stores", "stor_id", "stor_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "titles": {"columns": [[0, "title_id", "TEXT", 0, null, 1], [1, "title", "TEXT", 1, null, 0], [2, "type", "TEXT", 1, null, 0], [3, "pub_id", "TEXT", 0, null, 0], [4, "price", "REAL", 0, null, 0], [5, "advance", "REAL", 0, null, 0], [6, "royalty", "INTEGER", 0, null, 0], [7, "ytd_sales", "INTEGER", 0, null, 0], [8, "notes", "TEXT", 0, null, 0], [9, "pubdate", "DATETIME", 1, null, 0]], "primary_keys": ["title_id"], "foreign_keys": [[0, 0, "publishers", "pub_id", "pub_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "title_id"]]], "check_constraints": []}, "roysched": {"columns": [[0, "title_id", "TEXT", 1, null, 0], [1, "lorange", "INTEGER", 0, null, 0], [2, "hirange", "INTEGER", 0, null, 0], [3, "royalty", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "titles", "title_id", "title_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "sales": {"columns": [[0, "stor_id", "TEXT", 1, null, 1], [1, "ord_num", "TEXT", 1, null, 2], [2, "ord_date", "DATETIME", 1, null, 0], [3, "qty", "INTEGER", 1, null, 0], [4, "payterms", "TEXT", 1, null, 0], [5, "title_id", "TEXT", 1, null, 3]], "primary_keys": ["stor_id", "ord_num", "title_id"], "foreign_keys": [[0, 0, "titles", "title_id", "title_id", "CASCADE", "CASCADE", "NONE"], [1, 0, "stores", "stor_id", "stor_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "stor_id"], [1, 1, "ord_num"], [2, 5, "title_id"]]], "check_constraints": []}, "titleauthor": {"columns": [[0, "au_id", "TEXT", 1, null, 1], [1, "title_id", "TEXT", 1, null, 2], [2, "au_ord", "INTEGER", 0, null, 0], [3, "royaltyper", "INTEGER", 0, null, 0]], "primary_keys": ["au_id", "title_id"], "foreign_keys": [[0, 0, "titles", "title_id", "title_id", "CASCADE", "CASCADE", "NONE"], [1, 0, "authors", "au_id", "au_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "au_id"], [1, 1, "title_id"]]], "check_constraints": []}}
CREATE TABLE authors ( au_id TEXT PRIMARY KEY, au_lname TEXT NOT NULL, au_fname TEXT NOT NULL, phone TEXT NOT NULL, address TEXT, city TEXT, state TEXT, zip TEXT, contract TEXT NOT NULL, UNIQUE (au_id) ); CREATE TABLE jobs ( job_id INTEGER PRIMARY KEY, job_desc TEXT NOT NULL, min_lvl INTEGER NOT NULL, max_lvl INTEGER NOT NULL ); CREATE TABLE publishers ( pub_id TEXT PRIMARY KEY, pub_name TEXT, city TEXT, state TEXT, country TEXT, UNIQUE (pub_id) ); CREATE TABLE employee ( emp_id TEXT PRIMARY KEY, fname TEXT NOT NULL, minit TEXT, lname TEXT NOT NULL, job_id INTEGER NOT NULL, job_lvl INTEGER, pub_id TEXT NOT NULL, hire_date DATETIME NOT NULL, UNIQUE (emp_id), FOREIGN KEY (pub_id) REFERENCES publishers(pub_id), FOREIGN KEY (job_id) REFERENCES jobs(job_id) ); CREATE TABLE pub_info ( pub_id TEXT PRIMARY KEY, logo BLOB, pr_info TEXT, UNIQUE (pub_id), FOREIGN KEY (pub_id) REFERENCES publishers(pub_id) ); CREATE TABLE stores ( stor_id TEXT PRIMARY KEY, stor_name TEXT, stor_address TEXT, city TEXT, state TEXT, zip TEXT, UNIQUE (stor_id) ); CREATE TABLE discounts ( discounttype TEXT NOT NULL, stor_id TEXT, lowqty INTEGER, highqty INTEGER, discount REAL NOT NULL, FOREIGN KEY (stor_id) REFERENCES stores(stor_id) ); CREATE TABLE titles ( title_id TEXT PRIMARY KEY, title TEXT NOT NULL, type TEXT NOT NULL, pub_id TEXT, price REAL, advance REAL, royalty INTEGER, ytd_sales INTEGER, notes TEXT, pubdate DATETIME NOT NULL, UNIQUE (title_id), FOREIGN KEY (pub_id) REFERENCES publishers(pub_id) ); CREATE TABLE roysched ( title_id TEXT NOT NULL, lorange INTEGER, hirange INTEGER, royalty INTEGER, FOREIGN KEY (title_id) REFERENCES titles(title_id) ); CREATE TABLE sales ( stor_id TEXT NOT NULL PRIMARY KEY, ord_num TEXT NOT NULL PRIMARY KEY, ord_date DATETIME NOT NULL, qty INTEGER NOT NULL, payterms TEXT NOT NULL, title_id TEXT NOT NULL PRIMARY KEY, PRIMARY KEY (stor_id, ord_num, title_id), UNIQUE (stor_id, ord_num, title_id), FOREIGN KEY (title_id) REFERENCES titles(title_id), FOREIGN KEY (stor_id) REFERENCES stores(stor_id) ); CREATE TABLE titleauthor ( au_id TEXT NOT NULL PRIMARY KEY, title_id TEXT NOT NULL PRIMARY KEY, au_ord INTEGER, royaltyper INTEGER, PRIMARY KEY (au_id, title_id), UNIQUE (au_id, title_id), FOREIGN KEY (title_id) REFERENCES titles(title_id), FOREIGN KEY (au_id) REFERENCES authors(au_id) );
genes
{"Classification": {"columns": [[0, "GeneID", "TEXT", 1, null, 1], [1, "Localization", "TEXT", 1, null, 0]], "primary_keys": ["GeneID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "GeneID"]]], "check_constraints": []}, "Genes": {"columns": [[0, "GeneID", "TEXT", 1, null, 0], [1, "Essential", "TEXT", 1, null, 0], [2, "Class", "TEXT", 1, null, 0], [3, "Complex", "TEXT", 0, null, 0], [4, "Phenotype", "TEXT", 1, null, 0], [5, "Motif", "TEXT", 1, null, 0], [6, "Chromosome", "INTEGER", 1, null, 0], [7, "Function", "TEXT", 1, null, 0], [8, "Localization", "TEXT", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Classification", "GeneID", "GeneID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Interactions": {"columns": [[0, "GeneID1", "TEXT", 1, null, 1], [1, "GeneID2", "TEXT", 1, null, 2], [2, "Type", "TEXT", 1, null, 0], [3, "Expression_Corr", "REAL", 1, null, 0]], "primary_keys": ["GeneID1", "GeneID2"], "foreign_keys": [[0, 0, "Classification", "GeneID2", "GeneID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Classification", "GeneID1", "GeneID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "GeneID1"], [1, 1, "GeneID2"]]], "check_constraints": []}}
CREATE TABLE Classification ( GeneID TEXT NOT NULL PRIMARY KEY, Localization TEXT NOT NULL, UNIQUE (GeneID) ); CREATE TABLE Genes ( GeneID TEXT NOT NULL, Essential TEXT NOT NULL, Class TEXT NOT NULL, Complex TEXT, Phenotype TEXT NOT NULL, Motif TEXT NOT NULL, Chromosome INTEGER NOT NULL, Function TEXT NOT NULL, Localization TEXT NOT NULL, FOREIGN KEY (GeneID) REFERENCES Classification(GeneID) ); CREATE TABLE Interactions ( GeneID1 TEXT NOT NULL PRIMARY KEY, GeneID2 TEXT NOT NULL PRIMARY KEY, Type TEXT NOT NULL, Expression_Corr REAL NOT NULL, PRIMARY KEY (GeneID1, GeneID2), UNIQUE (GeneID1, GeneID2), FOREIGN KEY (GeneID2) REFERENCES Classification(GeneID), FOREIGN KEY (GeneID1) REFERENCES Classification(GeneID) );
coinmarketcap
{"coins": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "slug", "TEXT", 0, null, 0], [3, "symbol", "TEXT", 0, null, 0], [4, "status", "TEXT", 0, null, 0], [5, "category", "TEXT", 0, null, 0], [6, "description", "TEXT", 0, null, 0], [7, "subreddit", "TEXT", 0, null, 0], [8, "notice", "TEXT", 0, null, 0], [9, "tags", "TEXT", 0, null, 0], [10, "tag_names", "TEXT", 0, null, 0], [11, "website", "TEXT", 0, null, 0], [12, "platform_id", "INTEGER", 0, null, 0], [13, "date_added", "TEXT", 0, null, 0], [14, "date_launched", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "historical": {"columns": [[0, "date", "DATE", 0, null, 0], [1, "coin_id", "INTEGER", 0, null, 0], [2, "cmc_rank", "INTEGER", 0, null, 0], [3, "market_cap", "REAL", 0, null, 0], [4, "price", "REAL", 0, null, 0], [5, "open", "REAL", 0, null, 0], [6, "high", "REAL", 0, null, 0], [7, "low", "REAL", 0, null, 0], [8, "close", "REAL", 0, null, 0], [9, "time_high", "TEXT", 0, null, 0], [10, "time_low", "TEXT", 0, null, 0], [11, "volume_24h", "REAL", 0, null, 0], [12, "percent_change_1h", "REAL", 0, null, 0], [13, "percent_change_24h", "REAL", 0, null, 0], [14, "percent_change_7d", "REAL", 0, null, 0], [15, "circulating_supply", "REAL", 0, null, 0], [16, "total_supply", "REAL", 0, null, 0], [17, "max_supply", "REAL", 0, null, 0], [18, "num_market_pairs", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE coins ( id INTEGER NOT NULL PRIMARY KEY, name TEXT, slug TEXT, symbol TEXT, status TEXT, category TEXT, description TEXT, subreddit TEXT, notice TEXT, tags TEXT, tag_names TEXT, website TEXT, platform_id INTEGER, date_added TEXT, date_launched TEXT ); CREATE TABLE historical ( date DATE, coin_id INTEGER, cmc_rank INTEGER, market_cap REAL, price REAL, open REAL, high REAL, low REAL, close REAL, time_high TEXT, time_low TEXT, volume_24h REAL, percent_change_1h REAL, percent_change_24h REAL, percent_change_7d REAL, circulating_supply REAL, total_supply REAL, max_supply REAL, num_market_pairs INTEGER );
movies_4
{"country": {"columns": [[0, "country_id", "INTEGER", 1, null, 1], [1, "country_iso_code", "TEXT", 0, "NULL", 0], [2, "country_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["country_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "department": {"columns": [[0, "department_id", "INTEGER", 1, null, 1], [1, "department_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["department_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "gender": {"columns": [[0, "gender_id", "INTEGER", 1, null, 1], [1, "gender", "TEXT", 0, "NULL", 0]], "primary_keys": ["gender_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "genre": {"columns": [[0, "genre_id", "INTEGER", 1, null, 1], [1, "genre_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["genre_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "keyword": {"columns": [[0, "keyword_id", "INTEGER", 1, null, 1], [1, "keyword_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["keyword_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "language": {"columns": [[0, "language_id", "INTEGER", 1, null, 1], [1, "language_code", "TEXT", 0, "NULL", 0], [2, "language_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["language_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "language_role": {"columns": [[0, "role_id", "INTEGER", 1, null, 1], [1, "language_role", "TEXT", 0, "NULL", 0]], "primary_keys": ["role_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "movie": {"columns": [[0, "movie_id", "INTEGER", 1, null, 1], [1, "title", "TEXT", 0, "NULL", 0], [2, "budget", "INTEGER", 0, "NULL", 0], [3, "homepage", "TEXT", 0, "NULL", 0], [4, "overview", "TEXT", 0, "NULL", 0], [5, "popularity", "REAL", 0, "NULL", 0], [6, "release_date", "DATE", 0, "NULL", 0], [7, "revenue", "INTEGER", 0, "NULL", 0], [8, "runtime", "INTEGER", 0, "NULL", 0], [9, "movie_status", "TEXT", 0, "NULL", 0], [10, "tagline", "TEXT", 0, "NULL", 0], [11, "vote_average", "REAL", 0, "NULL", 0], [12, "vote_count", "INTEGER", 0, "NULL", 0]], "primary_keys": ["movie_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "movie_genres": {"columns": [[0, "movie_id", "INTEGER", 0, "NULL", 0], [1, "genre_id", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "movie", "movie_id", "movie_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "genre", "genre_id", "genre_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "movie_languages": {"columns": [[0, "movie_id", "INTEGER", 0, "NULL", 0], [1, "language_id", "INTEGER", 0, "NULL", 0], [2, "language_role_id", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "language_role", "language_role_id", "role_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "movie", "movie_id", "movie_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "language", "language_id", "language_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "person": {"columns": [[0, "person_id", "INTEGER", 1, null, 1], [1, "person_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["person_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "movie_crew": {"columns": [[0, "movie_id", "INTEGER", 0, "NULL", 0], [1, "person_id", "INTEGER", 0, "NULL", 0], [2, "department_id", "INTEGER", 0, "NULL", 0], [3, "job", "TEXT", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "person", "person_id", "person_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "movie", "movie_id", "movie_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "department", "department_id", "department_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "production_company": {"columns": [[0, "company_id", "INTEGER", 1, null, 1], [1, "company_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["company_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "production_country": {"columns": [[0, "movie_id", "INTEGER", 0, "NULL", 0], [1, "country_id", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "movie", "movie_id", "movie_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "country", "country_id", "country_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "movie_cast": {"columns": [[0, "movie_id", "INTEGER", 0, "NULL", 0], [1, "person_id", "INTEGER", 0, "NULL", 0], [2, "character_name", "TEXT", 0, "NULL", 0], [3, "gender_id", "INTEGER", 0, "NULL", 0], [4, "cast_order", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "person", "person_id", "person_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "movie", "movie_id", "movie_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "gender", "gender_id", "gender_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "movie_keywords": {"columns": [[0, "movie_id", "INTEGER", 0, "NULL", 0], [1, "keyword_id", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "keyword", "keyword_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "movie", "movie_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "movie_company": {"columns": [[0, "movie_id", "INTEGER", 0, "NULL", 0], [1, "company_id", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "production_company", "company_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "movie", "movie_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE country ( country_id INTEGER NOT NULL PRIMARY KEY, country_iso_code TEXT DEFAULT NULL, country_name TEXT DEFAULT NULL ); CREATE TABLE department ( department_id INTEGER NOT NULL PRIMARY KEY, department_name TEXT DEFAULT NULL ); CREATE TABLE gender ( gender_id INTEGER NOT NULL PRIMARY KEY, gender TEXT DEFAULT NULL ); CREATE TABLE genre ( genre_id INTEGER NOT NULL PRIMARY KEY, genre_name TEXT DEFAULT NULL ); CREATE TABLE keyword ( keyword_id INTEGER NOT NULL PRIMARY KEY, keyword_name TEXT DEFAULT NULL ); CREATE TABLE language ( language_id INTEGER NOT NULL PRIMARY KEY, language_code TEXT DEFAULT NULL, language_name TEXT DEFAULT NULL ); CREATE TABLE language_role ( role_id INTEGER NOT NULL PRIMARY KEY, language_role TEXT DEFAULT NULL ); CREATE TABLE movie ( movie_id INTEGER NOT NULL PRIMARY KEY, title TEXT DEFAULT NULL, budget INTEGER DEFAULT NULL, homepage TEXT DEFAULT NULL, overview TEXT DEFAULT NULL, popularity REAL DEFAULT NULL, release_date DATE DEFAULT NULL, revenue INTEGER DEFAULT NULL, runtime INTEGER DEFAULT NULL, movie_status TEXT DEFAULT NULL, tagline TEXT DEFAULT NULL, vote_average REAL DEFAULT NULL, vote_count INTEGER DEFAULT NULL ); CREATE TABLE movie_genres ( movie_id INTEGER DEFAULT NULL, genre_id INTEGER DEFAULT NULL, FOREIGN KEY (movie_id) REFERENCES movie(movie_id), FOREIGN KEY (genre_id) REFERENCES genre(genre_id) ); CREATE TABLE movie_languages ( movie_id INTEGER DEFAULT NULL, language_id INTEGER DEFAULT NULL, language_role_id INTEGER DEFAULT NULL, FOREIGN KEY (language_role_id) REFERENCES language_role(role_id), FOREIGN KEY (movie_id) REFERENCES movie(movie_id), FOREIGN KEY (language_id) REFERENCES language(language_id) ); CREATE TABLE person ( person_id INTEGER NOT NULL PRIMARY KEY, person_name TEXT DEFAULT NULL ); CREATE TABLE movie_crew ( movie_id INTEGER DEFAULT NULL, person_id INTEGER DEFAULT NULL, department_id INTEGER DEFAULT NULL, job TEXT DEFAULT NULL, FOREIGN KEY (person_id) REFERENCES person(person_id), FOREIGN KEY (movie_id) REFERENCES movie(movie_id), FOREIGN KEY (department_id) REFERENCES department(department_id) ); CREATE TABLE production_company ( company_id INTEGER NOT NULL PRIMARY KEY, company_name TEXT DEFAULT NULL ); CREATE TABLE production_country ( movie_id INTEGER DEFAULT NULL, country_id INTEGER DEFAULT NULL, FOREIGN KEY (movie_id) REFERENCES movie(movie_id), FOREIGN KEY (country_id) REFERENCES country(country_id) ); CREATE TABLE movie_cast ( movie_id INTEGER DEFAULT NULL, person_id INTEGER DEFAULT NULL, character_name TEXT DEFAULT NULL, gender_id INTEGER DEFAULT NULL, cast_order INTEGER DEFAULT NULL, FOREIGN KEY (person_id) REFERENCES person(person_id), FOREIGN KEY (movie_id) REFERENCES movie(movie_id), FOREIGN KEY (gender_id) REFERENCES gender(gender_id) ); CREATE TABLE movie_keywords ( movie_id INTEGER DEFAULT NULL, keyword_id INTEGER DEFAULT NULL, FOREIGN KEY (keyword_id) REFERENCES keyword(None), FOREIGN KEY (movie_id) REFERENCES movie(None) ); CREATE TABLE movie_company ( movie_id INTEGER DEFAULT NULL, company_id INTEGER DEFAULT NULL, FOREIGN KEY (company_id) REFERENCES production_company(None), FOREIGN KEY (movie_id) REFERENCES movie(None) );
address
{"CBSA": {"columns": [[0, "CBSA", "INTEGER", 0, null, 1], [1, "CBSA_name", "TEXT", 0, null, 0], [2, "CBSA_type", "TEXT", 0, null, 0]], "primary_keys": ["CBSA"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "state": {"columns": [[0, "abbreviation", "TEXT", 0, null, 1], [1, "name", "TEXT", 0, null, 0]], "primary_keys": ["abbreviation"], "foreign_keys": [], "unique_constraints": [[[0, 0, "abbreviation"]]], "check_constraints": []}, "congress": {"columns": [[0, "cognress_rep_id", "TEXT", 0, null, 1], [1, "first_name", "TEXT", 0, null, 0], [2, "last_name", "TEXT", 0, null, 0], [3, "CID", "TEXT", 0, null, 0], [4, "party", "TEXT", 0, null, 0], [5, "state", "TEXT", 0, null, 0], [6, "abbreviation", "TEXT", 0, null, 0], [7, "House", "TEXT", 0, null, 0], [8, "District", "INTEGER", 0, null, 0], [9, "land_area", "REAL", 0, null, 0]], "primary_keys": ["cognress_rep_id"], "foreign_keys": [[0, 0, "state", "abbreviation", "abbreviation", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "cognress_rep_id"]]], "check_constraints": []}, "zip_data": {"columns": [[0, "zip_code", "INTEGER", 0, null, 1], [1, "city", "TEXT", 0, null, 0], [2, "state", "TEXT", 0, null, 0], [3, "multi_county", "TEXT", 0, null, 0], [4, "type", "TEXT", 0, null, 0], [5, "organization", "TEXT", 0, null, 0], [6, "time_zone", "TEXT", 0, null, 0], [7, "daylight_savings", "TEXT", 0, null, 0], [8, "latitude", "REAL", 0, null, 0], [9, "longitude", "REAL", 0, null, 0], [10, "elevation", "INTEGER", 0, null, 0], [11, "state_fips", "INTEGER", 0, null, 0], [12, "county_fips", "INTEGER", 0, null, 0], [13, "region", "TEXT", 0, null, 0], [14, "division", "TEXT", 0, null, 0], [15, "population_2020", "INTEGER", 0, null, 0], [16, "population_2010", "INTEGER", 0, null, 0], [17, "households", "INTEGER", 0, null, 0], [18, "avg_house_value", "INTEGER", 0, null, 0], [19, "avg_income_per_household", "INTEGER", 0, null, 0], [20, "persons_per_household", "REAL", 0, null, 0], [21, "white_population", "INTEGER", 0, null, 0], [22, "black_population", "INTEGER", 0, null, 0], [23, "hispanic_population", "INTEGER", 0, null, 0], [24, "asian_population", "INTEGER", 0, null, 0], [25, "american_indian_population", "INTEGER", 0, null, 0], [26, "hawaiian_population", "INTEGER", 0, null, 0], [27, "other_population", "INTEGER", 0, null, 0], [28, "male_population", "INTEGER", 0, null, 0], [29, "female_population", "INTEGER", 0, null, 0], [30, "median_age", "REAL", 0, null, 0], [31, "male_median_age", "REAL", 0, null, 0], [32, "female_median_age", "REAL", 0, null, 0], [33, "residential_mailboxes", "INTEGER", 0, null, 0], [34, "business_mailboxes", "INTEGER", 0, null, 0], [35, "total_delivery_receptacles", "INTEGER", 0, null, 0], [36, "businesses", "INTEGER", 0, null, 0], [37, "1st_quarter_payroll", "INTEGER", 0, null, 0], [38, "annual_payroll", "INTEGER", 0, null, 0], [39, "employees", "INTEGER", 0, null, 0], [40, "water_area", "REAL", 0, null, 0], [41, "land_area", "REAL", 0, null, 0], [42, "single_family_delivery_units", "INTEGER", 0, null, 0], [43, "multi_family_delivery_units", "INTEGER", 0, null, 0], [44, "total_beneficiaries", "INTEGER", 0, null, 0], [45, "retired_workers", "INTEGER", 0, null, 0], [46, "disabled_workers", "INTEGER", 0, null, 0], [47, "parents_and_widowed", "INTEGER", 0, null, 0], [48, "spouses", "INTEGER", 0, null, 0], [49, "children", "INTEGER", 0, null, 0], [50, "over_65", "INTEGER", 0, null, 0], [51, "monthly_benefits_all", "INTEGER", 0, null, 0], [52, "monthly_benefits_retired_workers", "INTEGER", 0, null, 0], [53, "monthly_benefits_widowed", "INTEGER", 0, null, 0], [54, "CBSA", "INTEGER", 0, null, 0]], "primary_keys": ["zip_code"], "foreign_keys": [[0, 0, "CBSA", "CBSA", "CBSA", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "state", "state", "abbreviation", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "alias": {"columns": [[0, "zip_code", "INTEGER", 0, null, 1], [1, "alias", "TEXT", 0, null, 0]], "primary_keys": ["zip_code"], "foreign_keys": [[0, 0, "zip_data", "zip_code", "zip_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "area_code": {"columns": [[0, "zip_code", "INTEGER", 0, null, 1], [1, "area_code", "INTEGER", 0, null, 2]], "primary_keys": ["zip_code", "area_code"], "foreign_keys": [[0, 0, "zip_data", "zip_code", "zip_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "zip_code"], [1, 1, "area_code"]]], "check_constraints": []}, "avoid": {"columns": [[0, "zip_code", "INTEGER", 0, null, 1], [1, "bad_alias", "TEXT", 0, null, 2]], "primary_keys": ["zip_code", "bad_alias"], "foreign_keys": [[0, 0, "zip_data", "zip_code", "zip_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "zip_code"], [1, 1, "bad_alias"]]], "check_constraints": []}, "country": {"columns": [[0, "zip_code", "INTEGER", 0, null, 1], [1, "county", "TEXT", 0, null, 2], [2, "state", "TEXT", 0, null, 0]], "primary_keys": ["zip_code", "county"], "foreign_keys": [[0, 0, "state", "state", "abbreviation", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "zip_data", "zip_code", "zip_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "zip_code"], [1, 1, "county"]]], "check_constraints": []}, "zip_congress": {"columns": [[0, "zip_code", "INTEGER", 0, null, 1], [1, "district", "TEXT", 0, null, 2]], "primary_keys": ["zip_code", "district"], "foreign_keys": [[0, 0, "zip_data", "zip_code", "zip_code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "congress", "district", "cognress_rep_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "zip_code"], [1, 1, "district"]]], "check_constraints": []}}
CREATE TABLE CBSA ( CBSA INTEGER PRIMARY KEY, CBSA_name TEXT, CBSA_type TEXT ); CREATE TABLE state ( abbreviation TEXT PRIMARY KEY, name TEXT, UNIQUE (abbreviation) ); CREATE TABLE congress ( cognress_rep_id TEXT PRIMARY KEY, first_name TEXT, last_name TEXT, CID TEXT, party TEXT, state TEXT, abbreviation TEXT, House TEXT, District INTEGER, land_area REAL, UNIQUE (cognress_rep_id), FOREIGN KEY (abbreviation) REFERENCES state(abbreviation) ); CREATE TABLE zip_data ( zip_code INTEGER PRIMARY KEY, city TEXT, state TEXT, multi_county TEXT, type TEXT, organization TEXT, time_zone TEXT, daylight_savings TEXT, latitude REAL, longitude REAL, elevation INTEGER, state_fips INTEGER, county_fips INTEGER, region TEXT, division TEXT, population_2020 INTEGER, population_2010 INTEGER, households INTEGER, avg_house_value INTEGER, avg_income_per_household INTEGER, persons_per_household REAL, white_population INTEGER, black_population INTEGER, hispanic_population INTEGER, asian_population INTEGER, american_indian_population INTEGER, hawaiian_population INTEGER, other_population INTEGER, male_population INTEGER, female_population INTEGER, median_age REAL, male_median_age REAL, female_median_age REAL, residential_mailboxes INTEGER, business_mailboxes INTEGER, total_delivery_receptacles INTEGER, businesses INTEGER, 1st_quarter_payroll INTEGER, annual_payroll INTEGER, employees INTEGER, water_area REAL, land_area REAL, single_family_delivery_units INTEGER, multi_family_delivery_units INTEGER, total_beneficiaries INTEGER, retired_workers INTEGER, disabled_workers INTEGER, parents_and_widowed INTEGER, spouses INTEGER, children INTEGER, over_65 INTEGER, monthly_benefits_all INTEGER, monthly_benefits_retired_workers INTEGER, monthly_benefits_widowed INTEGER, CBSA INTEGER, FOREIGN KEY (CBSA) REFERENCES CBSA(CBSA), FOREIGN KEY (state) REFERENCES state(abbreviation) ); CREATE TABLE alias ( zip_code INTEGER PRIMARY KEY, alias TEXT, FOREIGN KEY (zip_code) REFERENCES zip_data(zip_code) ); CREATE TABLE area_code ( zip_code INTEGER PRIMARY KEY, area_code INTEGER PRIMARY KEY, PRIMARY KEY (zip_code, area_code), UNIQUE (zip_code, area_code), FOREIGN KEY (zip_code) REFERENCES zip_data(zip_code) ); CREATE TABLE avoid ( zip_code INTEGER PRIMARY KEY, bad_alias TEXT PRIMARY KEY, PRIMARY KEY (zip_code, bad_alias), UNIQUE (zip_code, bad_alias), FOREIGN KEY (zip_code) REFERENCES zip_data(zip_code) ); CREATE TABLE country ( zip_code INTEGER PRIMARY KEY, county TEXT PRIMARY KEY, state TEXT, PRIMARY KEY (zip_code, county), UNIQUE (zip_code, county), FOREIGN KEY (state) REFERENCES state(abbreviation), FOREIGN KEY (zip_code) REFERENCES zip_data(zip_code) ); CREATE TABLE zip_congress ( zip_code INTEGER PRIMARY KEY, district TEXT PRIMARY KEY, PRIMARY KEY (zip_code, district), UNIQUE (zip_code, district), FOREIGN KEY (zip_code) REFERENCES zip_data(zip_code), FOREIGN KEY (district) REFERENCES congress(cognress_rep_id) );
software_company
{"Demog": {"columns": [[0, "GEOID", "INTEGER", 0, null, 1], [1, "INHABITANTS_K", "REAL", 0, null, 0], [2, "INCOME_K", "REAL", 0, null, 0], [3, "A_VAR1", "REAL", 0, null, 0], [4, "A_VAR2", "REAL", 0, null, 0], [5, "A_VAR3", "REAL", 0, null, 0], [6, "A_VAR4", "REAL", 0, null, 0], [7, "A_VAR5", "REAL", 0, null, 0], [8, "A_VAR6", "REAL", 0, null, 0], [9, "A_VAR7", "REAL", 0, null, 0], [10, "A_VAR8", "REAL", 0, null, 0], [11, "A_VAR9", "REAL", 0, null, 0], [12, "A_VAR10", "REAL", 0, null, 0], [13, "A_VAR11", "REAL", 0, null, 0], [14, "A_VAR12", "REAL", 0, null, 0], [15, "A_VAR13", "REAL", 0, null, 0], [16, "A_VAR14", "REAL", 0, null, 0], [17, "A_VAR15", "REAL", 0, null, 0], [18, "A_VAR16", "REAL", 0, null, 0], [19, "A_VAR17", "REAL", 0, null, 0], [20, "A_VAR18", "REAL", 0, null, 0]], "primary_keys": ["GEOID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "mailings3": {"columns": [[0, "REFID", "INTEGER", 0, null, 1], [1, "REF_DATE", "DATETIME", 0, null, 0], [2, "RESPONSE", "TEXT", 0, null, 0]], "primary_keys": ["REFID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers": {"columns": [[0, "ID", "INTEGER", 0, null, 1], [1, "SEX", "TEXT", 0, null, 0], [2, "MARITAL_STATUS", "TEXT", 0, null, 0], [3, "GEOID", "INTEGER", 0, null, 0], [4, "EDUCATIONNUM", "INTEGER", 0, null, 0], [5, "OCCUPATION", "TEXT", 0, null, 0], [6, "age", "INTEGER", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [[0, 0, "Demog", "GEOID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Mailings1_2": {"columns": [[0, "REFID", "INTEGER", 0, null, 1], [1, "REF_DATE", "DATETIME", 0, null, 0], [2, "RESPONSE", "TEXT", 0, null, 0]], "primary_keys": ["REFID"], "foreign_keys": [[0, 0, "Customers", "REFID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Sales": {"columns": [[0, "EVENTID", "INTEGER", 0, null, 1], [1, "REFID", "INTEGER", 0, null, 0], [2, "EVENT_DATE", "DATETIME", 0, null, 0], [3, "AMOUNT", "REAL", 0, null, 0]], "primary_keys": ["EVENTID"], "foreign_keys": [[0, 0, "Customers", "REFID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Demog ( GEOID INTEGER PRIMARY KEY, INHABITANTS_K REAL, INCOME_K REAL, A_VAR1 REAL, A_VAR2 REAL, A_VAR3 REAL, A_VAR4 REAL, A_VAR5 REAL, A_VAR6 REAL, A_VAR7 REAL, A_VAR8 REAL, A_VAR9 REAL, A_VAR10 REAL, A_VAR11 REAL, A_VAR12 REAL, A_VAR13 REAL, A_VAR14 REAL, A_VAR15 REAL, A_VAR16 REAL, A_VAR17 REAL, A_VAR18 REAL ); CREATE TABLE mailings3 ( REFID INTEGER PRIMARY KEY, REF_DATE DATETIME, RESPONSE TEXT ); CREATE TABLE Customers ( ID INTEGER PRIMARY KEY, SEX TEXT, MARITAL_STATUS TEXT, GEOID INTEGER, EDUCATIONNUM INTEGER, OCCUPATION TEXT, age INTEGER, FOREIGN KEY (GEOID) REFERENCES Demog(None) ); CREATE TABLE Mailings1_2 ( REFID INTEGER PRIMARY KEY, REF_DATE DATETIME, RESPONSE TEXT, FOREIGN KEY (REFID) REFERENCES Customers(None) ); CREATE TABLE Sales ( EVENTID INTEGER PRIMARY KEY, REFID INTEGER, EVENT_DATE DATETIME, AMOUNT REAL, FOREIGN KEY (REFID) REFERENCES Customers(None) );
student_loan
{"bool": {"columns": [[0, "name", "TEXT", 1, "''", 1]], "primary_keys": ["name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "person": {"columns": [[0, "name", "TEXT", 1, "''", 1]], "primary_keys": ["name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "disabled": {"columns": [[0, "name", "TEXT", 1, "''", 1]], "primary_keys": ["name"], "foreign_keys": [[0, 0, "person", "name", "name", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "enlist": {"columns": [[0, "name", "TEXT", 1, null, 0], [1, "organ", "TEXT", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "person", "name", "name", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "filed_for_bankrupcy": {"columns": [[0, "name", "TEXT", 1, "''", 1]], "primary_keys": ["name"], "foreign_keys": [[0, 0, "person", "name", "name", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "longest_absense_from_school": {"columns": [[0, "name", "TEXT", 1, "''", 1], [1, "month", "INTEGER", 0, "0", 0]], "primary_keys": ["name"], "foreign_keys": [[0, 0, "person", "name", "name", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "male": {"columns": [[0, "name", "TEXT", 1, "''", 1]], "primary_keys": ["name"], "foreign_keys": [[0, 0, "person", "name", "name", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "no_payment_due": {"columns": [[0, "name", "TEXT", 1, "''", 1], [1, "bool", "TEXT", 0, null, 0]], "primary_keys": ["name"], "foreign_keys": [[0, 0, "bool", "bool", "name", "CASCADE", "CASCADE", "NONE"], [1, 0, "person", "name", "name", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "unemployed": {"columns": [[0, "name", "TEXT", 1, "''", 1]], "primary_keys": ["name"], "foreign_keys": [[0, 0, "person", "name", "name", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "enrolled": {"columns": [[0, "name", "TEXT", 1, null, 1], [1, "school", "TEXT", 1, null, 2], [2, "month", "INTEGER", 1, "0", 0]], "primary_keys": ["name", "school"], "foreign_keys": [[0, 0, "person", "name", "name", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "name"], [1, 1, "school"]]], "check_constraints": []}}
CREATE TABLE bool ( name TEXT NOT NULL DEFAULT '' PRIMARY KEY, UNIQUE (name) ); CREATE TABLE person ( name TEXT NOT NULL DEFAULT '' PRIMARY KEY, UNIQUE (name) ); CREATE TABLE disabled ( name TEXT NOT NULL DEFAULT '' PRIMARY KEY, UNIQUE (name), FOREIGN KEY (name) REFERENCES person(name) ); CREATE TABLE enlist ( name TEXT NOT NULL, organ TEXT NOT NULL, FOREIGN KEY (name) REFERENCES person(name) ); CREATE TABLE filed_for_bankrupcy ( name TEXT NOT NULL DEFAULT '' PRIMARY KEY, UNIQUE (name), FOREIGN KEY (name) REFERENCES person(name) ); CREATE TABLE longest_absense_from_school ( name TEXT NOT NULL DEFAULT '' PRIMARY KEY, month INTEGER DEFAULT 0, UNIQUE (name), FOREIGN KEY (name) REFERENCES person(name) ); CREATE TABLE male ( name TEXT NOT NULL DEFAULT '' PRIMARY KEY, UNIQUE (name), FOREIGN KEY (name) REFERENCES person(name) ); CREATE TABLE no_payment_due ( name TEXT NOT NULL DEFAULT '' PRIMARY KEY, bool TEXT, UNIQUE (name), FOREIGN KEY (bool) REFERENCES bool(name), FOREIGN KEY (name) REFERENCES person(name) ); CREATE TABLE unemployed ( name TEXT NOT NULL DEFAULT '' PRIMARY KEY, UNIQUE (name), FOREIGN KEY (name) REFERENCES person(name) ); CREATE TABLE enrolled ( name TEXT NOT NULL PRIMARY KEY, school TEXT NOT NULL PRIMARY KEY, month INTEGER NOT NULL DEFAULT 0, PRIMARY KEY (name, school), UNIQUE (name, school), FOREIGN KEY (name) REFERENCES person(name) );
food_inspection_2
{"employee": {"columns": [[0, "employee_id", "INTEGER", 0, null, 1], [1, "first_name", "TEXT", 0, null, 0], [2, "last_name", "TEXT", 0, null, 0], [3, "address", "TEXT", 0, null, 0], [4, "city", "TEXT", 0, null, 0], [5, "state", "TEXT", 0, null, 0], [6, "zip", "INTEGER", 0, null, 0], [7, "phone", "TEXT", 0, null, 0], [8, "title", "TEXT", 0, null, 0], [9, "salary", "INTEGER", 0, null, 0], [10, "supervisor", "INTEGER", 0, null, 0]], "primary_keys": ["employee_id"], "foreign_keys": [[0, 0, "employee", "supervisor", "employee_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "establishment": {"columns": [[0, "license_no", "INTEGER", 0, null, 1], [1, "dba_name", "TEXT", 0, null, 0], [2, "aka_name", "TEXT", 0, null, 0], [3, "facility_type", "TEXT", 0, null, 0], [4, "risk_level", "INTEGER", 0, null, 0], [5, "address", "TEXT", 0, null, 0], [6, "city", "TEXT", 0, null, 0], [7, "state", "TEXT", 0, null, 0], [8, "zip", "INTEGER", 0, null, 0], [9, "latitude", "REAL", 0, null, 0], [10, "longitude", "REAL", 0, null, 0], [11, "ward", "INTEGER", 0, null, 0]], "primary_keys": ["license_no"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "inspection": {"columns": [[0, "inspection_id", "INTEGER", 0, null, 1], [1, "inspection_date", "DATE", 0, null, 0], [2, "inspection_type", "TEXT", 0, null, 0], [3, "results", "TEXT", 0, null, 0], [4, "employee_id", "INTEGER", 0, null, 0], [5, "license_no", "INTEGER", 0, null, 0], [6, "followup_to", "INTEGER", 0, null, 0]], "primary_keys": ["inspection_id"], "foreign_keys": [[0, 0, "inspection", "followup_to", "inspection_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "establishment", "license_no", "license_no", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "employee", "employee_id", "employee_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "inspection_point": {"columns": [[0, "point_id", "INTEGER", 0, null, 1], [1, "Description", "TEXT", 0, null, 0], [2, "category", "TEXT", 0, null, 0], [3, "code", "TEXT", 0, null, 0], [4, "fine", "INTEGER", 0, null, 0], [5, "point_level", "TEXT", 0, null, 0]], "primary_keys": ["point_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "violation": {"columns": [[0, "inspection_id", "INTEGER", 0, null, 1], [1, "point_id", "INTEGER", 0, null, 2], [2, "fine", "INTEGER", 0, null, 0], [3, "inspector_comment", "TEXT", 0, null, 0]], "primary_keys": ["inspection_id", "point_id"], "foreign_keys": [[0, 0, "inspection_point", "point_id", "point_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "inspection", "inspection_id", "inspection_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "inspection_id"], [1, 1, "point_id"]]], "check_constraints": []}}
CREATE TABLE employee ( employee_id INTEGER PRIMARY KEY, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip INTEGER, phone TEXT, title TEXT, salary INTEGER, supervisor INTEGER, FOREIGN KEY (supervisor) REFERENCES employee(employee_id) ); CREATE TABLE establishment ( license_no INTEGER PRIMARY KEY, dba_name TEXT, aka_name TEXT, facility_type TEXT, risk_level INTEGER, address TEXT, city TEXT, state TEXT, zip INTEGER, latitude REAL, longitude REAL, ward INTEGER ); CREATE TABLE inspection ( inspection_id INTEGER PRIMARY KEY, inspection_date DATE, inspection_type TEXT, results TEXT, employee_id INTEGER, license_no INTEGER, followup_to INTEGER, FOREIGN KEY (followup_to) REFERENCES inspection(inspection_id), FOREIGN KEY (license_no) REFERENCES establishment(license_no), FOREIGN KEY (employee_id) REFERENCES employee(employee_id) ); CREATE TABLE inspection_point ( point_id INTEGER PRIMARY KEY, Description TEXT, category TEXT, code TEXT, fine INTEGER, point_level TEXT ); CREATE TABLE violation ( inspection_id INTEGER PRIMARY KEY, point_id INTEGER PRIMARY KEY, fine INTEGER, inspector_comment TEXT, PRIMARY KEY (inspection_id, point_id), UNIQUE (inspection_id, point_id), FOREIGN KEY (point_id) REFERENCES inspection_point(point_id), FOREIGN KEY (inspection_id) REFERENCES inspection(inspection_id) );
human_resources
{"location": {"columns": [[0, "locationID", "INTEGER", 0, null, 1], [1, "locationcity", "TEXT", 0, null, 0], [2, "address", "TEXT", 0, null, 0], [3, "state", "TEXT", 0, null, 0], [4, "zipcode", "INTEGER", 0, null, 0], [5, "officephone", "TEXT", 0, null, 0]], "primary_keys": ["locationID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "position": {"columns": [[0, "positionID", "INTEGER", 0, null, 1], [1, "positiontitle", "TEXT", 0, null, 0], [2, "educationrequired", "TEXT", 0, null, 0], [3, "minsalary", "TEXT", 0, null, 0], [4, "maxsalary", "TEXT", 0, null, 0]], "primary_keys": ["positionID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "employee": {"columns": [[0, "ssn", "TEXT", 0, null, 1], [1, "lastname", "TEXT", 0, null, 0], [2, "firstname", "TEXT", 0, null, 0], [3, "hiredate", "TEXT", 0, null, 0], [4, "salary", "TEXT", 0, null, 0], [5, "gender", "TEXT", 0, null, 0], [6, "performance", "TEXT", 0, null, 0], [7, "positionID", "INTEGER", 0, null, 0], [8, "locationID", "INTEGER", 0, null, 0]], "primary_keys": ["ssn"], "foreign_keys": [[0, 0, "position", "positionID", "positionID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "location", "locationID", "locationID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ssn"]]], "check_constraints": []}}
CREATE TABLE location ( locationID INTEGER PRIMARY KEY, locationcity TEXT, address TEXT, state TEXT, zipcode INTEGER, officephone TEXT ); CREATE TABLE position ( positionID INTEGER PRIMARY KEY, positiontitle TEXT, educationrequired TEXT, minsalary TEXT, maxsalary TEXT ); CREATE TABLE employee ( ssn TEXT PRIMARY KEY, lastname TEXT, firstname TEXT, hiredate TEXT, salary TEXT, gender TEXT, performance TEXT, positionID INTEGER, locationID INTEGER, UNIQUE (ssn), FOREIGN KEY (positionID) REFERENCES position(positionID), FOREIGN KEY (locationID) REFERENCES location(locationID) );
world_development_indicators
{"Country": {"columns": [[0, "CountryCode", "TEXT", 1, null, 1], [1, "ShortName", "TEXT", 0, null, 0], [2, "TableName", "TEXT", 0, null, 0], [3, "LongName", "TEXT", 0, null, 0], [4, "Alpha2Code", "TEXT", 0, null, 0], [5, "CurrencyUnit", "TEXT", 0, null, 0], [6, "SpecialNotes", "TEXT", 0, null, 0], [7, "Region", "TEXT", 0, null, 0], [8, "IncomeGroup", "TEXT", 0, null, 0], [9, "Wb2Code", "TEXT", 0, null, 0], [10, "NationalAccountsBaseYear", "TEXT", 0, null, 0], [11, "NationalAccountsReferenceYear", "TEXT", 0, null, 0], [12, "SnaPriceValuation", "TEXT", 0, null, 0], [13, "LendingCategory", "TEXT", 0, null, 0], [14, "OtherGroups", "TEXT", 0, null, 0], [15, "SystemOfNationalAccounts", "TEXT", 0, null, 0], [16, "AlternativeConversionFactor", "TEXT", 0, null, 0], [17, "PppSurveyYear", "TEXT", 0, null, 0], [18, "BalanceOfPaymentsManualInUse", "TEXT", 0, null, 0], [19, "ExternalDebtReportingStatus", "TEXT", 0, null, 0], [20, "SystemOfTrade", "TEXT", 0, null, 0], [21, "GovernmentAccountingConcept", "TEXT", 0, null, 0], [22, "ImfDataDisseminationStandard", "TEXT", 0, null, 0], [23, "LatestPopulationCensus", "TEXT", 0, null, 0], [24, "LatestHouseholdSurvey", "TEXT", 0, null, 0], [25, "SourceOfMostRecentIncomeAndExpenditureData", "TEXT", 0, null, 0], [26, "VitalRegistrationComplete", "TEXT", 0, null, 0], [27, "LatestAgriculturalCensus", "TEXT", 0, null, 0], [28, "LatestIndustrialData", "INTEGER", 0, null, 0], [29, "LatestTradeData", "INTEGER", 0, null, 0], [30, "LatestWaterWithdrawalData", "INTEGER", 0, null, 0]], "primary_keys": ["CountryCode"], "foreign_keys": [], "unique_constraints": [[[0, 0, "CountryCode"]]], "check_constraints": []}, "Series": {"columns": [[0, "SeriesCode", "TEXT", 1, null, 1], [1, "Topic", "TEXT", 0, null, 0], [2, "IndicatorName", "TEXT", 0, null, 0], [3, "ShortDefinition", "TEXT", 0, null, 0], [4, "LongDefinition", "TEXT", 0, null, 0], [5, "UnitOfMeasure", "TEXT", 0, null, 0], [6, "Periodicity", "TEXT", 0, null, 0], [7, "BasePeriod", "TEXT", 0, null, 0], [8, "OtherNotes", "INTEGER", 0, null, 0], [9, "AggregationMethod", "TEXT", 0, null, 0], [10, "LimitationsAndExceptions", "TEXT", 0, null, 0], [11, "NotesFromOriginalSource", "TEXT", 0, null, 0], [12, "GeneralComments", "TEXT", 0, null, 0], [13, "Source", "TEXT", 0, null, 0], [14, "StatisticalConceptAndMethodology", "TEXT", 0, null, 0], [15, "DevelopmentRelevance", "TEXT", 0, null, 0], [16, "RelatedSourceLinks", "TEXT", 0, null, 0], [17, "OtherWebLinks", "INTEGER", 0, null, 0], [18, "RelatedIndicators", "INTEGER", 0, null, 0], [19, "LicenseType", "TEXT", 0, null, 0]], "primary_keys": ["SeriesCode"], "foreign_keys": [], "unique_constraints": [[[0, 0, "SeriesCode"]]], "check_constraints": []}, "CountryNotes": {"columns": [[0, "Countrycode", "TEXT", 1, null, 1], [1, "Seriescode", "TEXT", 1, null, 2], [2, "Description", "TEXT", 0, null, 0]], "primary_keys": ["Countrycode", "Seriescode"], "foreign_keys": [[0, 0, "Country", "Countrycode", "CountryCode", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Series", "Seriescode", "SeriesCode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Countrycode"], [1, 1, "Seriescode"]]], "check_constraints": []}, "Footnotes": {"columns": [[0, "Countrycode", "TEXT", 1, null, 1], [1, "Seriescode", "TEXT", 1, null, 2], [2, "Year", "TEXT", 0, null, 3], [3, "Description", "TEXT", 0, null, 0]], "primary_keys": ["Countrycode", "Seriescode", "Year"], "foreign_keys": [[0, 0, "Country", "Countrycode", "CountryCode", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Series", "Seriescode", "SeriesCode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Countrycode"], [1, 1, "Seriescode"], [2, 2, "Year"]]], "check_constraints": []}, "Indicators": {"columns": [[0, "CountryName", "TEXT", 0, null, 0], [1, "CountryCode", "TEXT", 1, null, 1], [2, "IndicatorName", "TEXT", 0, null, 0], [3, "IndicatorCode", "TEXT", 1, null, 2], [4, "Year", "INTEGER", 1, null, 3], [5, "Value", "INTEGER", 0, null, 0]], "primary_keys": ["CountryCode", "IndicatorCode", "Year"], "foreign_keys": [[0, 0, "Country", "CountryCode", "CountryCode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "CountryCode"], [1, 3, "IndicatorCode"], [2, 4, "Year"]]], "check_constraints": []}, "SeriesNotes": {"columns": [[0, "Seriescode", "TEXT", 1, null, 1], [1, "Year", "TEXT", 1, null, 2], [2, "Description", "TEXT", 0, null, 0]], "primary_keys": ["Seriescode", "Year"], "foreign_keys": [[0, 0, "Series", "Seriescode", "SeriesCode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Seriescode"], [1, 1, "Year"]]], "check_constraints": []}}
CREATE TABLE Country ( CountryCode TEXT NOT NULL PRIMARY KEY, ShortName TEXT, TableName TEXT, LongName TEXT, Alpha2Code TEXT, CurrencyUnit TEXT, SpecialNotes TEXT, Region TEXT, IncomeGroup TEXT, Wb2Code TEXT, NationalAccountsBaseYear TEXT, NationalAccountsReferenceYear TEXT, SnaPriceValuation TEXT, LendingCategory TEXT, OtherGroups TEXT, SystemOfNationalAccounts TEXT, AlternativeConversionFactor TEXT, PppSurveyYear TEXT, BalanceOfPaymentsManualInUse TEXT, ExternalDebtReportingStatus TEXT, SystemOfTrade TEXT, GovernmentAccountingConcept TEXT, ImfDataDisseminationStandard TEXT, LatestPopulationCensus TEXT, LatestHouseholdSurvey TEXT, SourceOfMostRecentIncomeAndExpenditureData TEXT, VitalRegistrationComplete TEXT, LatestAgriculturalCensus TEXT, LatestIndustrialData INTEGER, LatestTradeData INTEGER, LatestWaterWithdrawalData INTEGER, UNIQUE (CountryCode) ); CREATE TABLE Series ( SeriesCode TEXT NOT NULL PRIMARY KEY, Topic TEXT, IndicatorName TEXT, ShortDefinition TEXT, LongDefinition TEXT, UnitOfMeasure TEXT, Periodicity TEXT, BasePeriod TEXT, OtherNotes INTEGER, AggregationMethod TEXT, LimitationsAndExceptions TEXT, NotesFromOriginalSource TEXT, GeneralComments TEXT, Source TEXT, StatisticalConceptAndMethodology TEXT, DevelopmentRelevance TEXT, RelatedSourceLinks TEXT, OtherWebLinks INTEGER, RelatedIndicators INTEGER, LicenseType TEXT, UNIQUE (SeriesCode) ); CREATE TABLE CountryNotes ( Countrycode TEXT NOT NULL PRIMARY KEY, Seriescode TEXT NOT NULL PRIMARY KEY, Description TEXT, PRIMARY KEY (Countrycode, Seriescode), UNIQUE (Countrycode, Seriescode), FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode) ); CREATE TABLE Footnotes ( Countrycode TEXT NOT NULL PRIMARY KEY, Seriescode TEXT NOT NULL PRIMARY KEY, Year TEXT PRIMARY KEY, Description TEXT, PRIMARY KEY (Countrycode, Seriescode, Year), UNIQUE (Countrycode, Seriescode, Year), FOREIGN KEY (Countrycode) REFERENCES Country(CountryCode), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode) ); CREATE TABLE Indicators ( CountryName TEXT, CountryCode TEXT NOT NULL PRIMARY KEY, IndicatorName TEXT, IndicatorCode TEXT NOT NULL PRIMARY KEY, Year INTEGER NOT NULL PRIMARY KEY, Value INTEGER, PRIMARY KEY (CountryCode, IndicatorCode, Year), UNIQUE (CountryCode, IndicatorCode, Year), FOREIGN KEY (CountryCode) REFERENCES Country(CountryCode) ); CREATE TABLE SeriesNotes ( Seriescode TEXT NOT NULL PRIMARY KEY, Year TEXT NOT NULL PRIMARY KEY, Description TEXT, PRIMARY KEY (Seriescode, Year), UNIQUE (Seriescode, Year), FOREIGN KEY (Seriescode) REFERENCES Series(SeriesCode) );
social_media
{"location": {"columns": [[0, "LocationID", "INTEGER", 0, null, 1], [1, "Country", "TEXT", 0, null, 0], [2, "State", "TEXT", 0, null, 0], [3, "StateCode", "TEXT", 0, null, 0], [4, "City", "TEXT", 0, null, 0]], "primary_keys": ["LocationID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "user": {"columns": [[0, "UserID", "TEXT", 0, null, 1], [1, "Gender", "TEXT", 0, null, 0]], "primary_keys": ["UserID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "UserID"]]], "check_constraints": []}, "twitter": {"columns": [[0, "TweetID", "TEXT", 0, null, 1], [1, "Weekday", "TEXT", 0, null, 0], [2, "Hour", "INTEGER", 0, null, 0], [3, "Day", "INTEGER", 0, null, 0], [4, "Lang", "TEXT", 0, null, 0], [5, "IsReshare", "TEXT", 0, null, 0], [6, "Reach", "INTEGER", 0, null, 0], [7, "RetweetCount", "INTEGER", 0, null, 0], [8, "Likes", "INTEGER", 0, null, 0], [9, "Klout", "INTEGER", 0, null, 0], [10, "Sentiment", "REAL", 0, null, 0], [11, "text", "TEXT", 0, null, 0], [12, "LocationID", "INTEGER", 0, null, 0], [13, "UserID", "TEXT", 0, null, 0]], "primary_keys": ["TweetID"], "foreign_keys": [[0, 0, "user", "UserID", "UserID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "location", "LocationID", "LocationID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "TweetID"]]], "check_constraints": []}}
CREATE TABLE location ( LocationID INTEGER PRIMARY KEY, Country TEXT, State TEXT, StateCode TEXT, City TEXT ); CREATE TABLE user ( UserID TEXT PRIMARY KEY, Gender TEXT, UNIQUE (UserID) ); CREATE TABLE twitter ( TweetID TEXT PRIMARY KEY, Weekday TEXT, Hour INTEGER, Day INTEGER, Lang TEXT, IsReshare TEXT, Reach INTEGER, RetweetCount INTEGER, Likes INTEGER, Klout INTEGER, Sentiment REAL, text TEXT, LocationID INTEGER, UserID TEXT, UNIQUE (TweetID), FOREIGN KEY (UserID) REFERENCES user(UserID), FOREIGN KEY (LocationID) REFERENCES location(LocationID) );
authors
{"Author": {"columns": [[0, "Id", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Affiliation", "TEXT", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Conference": {"columns": [[0, "Id", "INTEGER", 0, null, 1], [1, "ShortName", "TEXT", 0, null, 0], [2, "FullName", "TEXT", 0, null, 0], [3, "HomePage", "TEXT", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Journal": {"columns": [[0, "Id", "INTEGER", 0, null, 1], [1, "ShortName", "TEXT", 0, null, 0], [2, "FullName", "TEXT", 0, null, 0], [3, "HomePage", "TEXT", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Paper": {"columns": [[0, "Id", "INTEGER", 0, null, 1], [1, "Title", "TEXT", 0, null, 0], [2, "Year", "INTEGER", 0, null, 0], [3, "ConferenceId", "INTEGER", 0, null, 0], [4, "JournalId", "INTEGER", 0, null, 0], [5, "Keyword", "TEXT", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [[0, 0, "Journal", "JournalId", "Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Conference", "ConferenceId", "Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "PaperAuthor": {"columns": [[0, "PaperId", "INTEGER", 0, null, 0], [1, "AuthorId", "INTEGER", 0, null, 0], [2, "Name", "TEXT", 0, null, 0], [3, "Affiliation", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Author", "AuthorId", "Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Paper", "PaperId", "Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Author ( Id INTEGER PRIMARY KEY, Name TEXT, Affiliation TEXT ); CREATE TABLE Conference ( Id INTEGER PRIMARY KEY, ShortName TEXT, FullName TEXT, HomePage TEXT ); CREATE TABLE Journal ( Id INTEGER PRIMARY KEY, ShortName TEXT, FullName TEXT, HomePage TEXT ); CREATE TABLE Paper ( Id INTEGER PRIMARY KEY, Title TEXT, Year INTEGER, ConferenceId INTEGER, JournalId INTEGER, Keyword TEXT, FOREIGN KEY (JournalId) REFERENCES Journal(Id), FOREIGN KEY (ConferenceId) REFERENCES Conference(Id) ); CREATE TABLE PaperAuthor ( PaperId INTEGER, AuthorId INTEGER, Name TEXT, Affiliation TEXT, FOREIGN KEY (AuthorId) REFERENCES Author(Id), FOREIGN KEY (PaperId) REFERENCES Paper(Id) );
airline
{"Air Carriers": {"columns": [[0, "Code", "INTEGER", 0, null, 1], [1, "Description", "TEXT", 0, null, 0]], "primary_keys": ["Code"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Airports": {"columns": [[0, "Code", "TEXT", 0, null, 1], [1, "Description", "TEXT", 0, null, 0]], "primary_keys": ["Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Code"]]], "check_constraints": []}, "Airlines": {"columns": [[0, "FL_DATE", "TEXT", 0, null, 0], [1, "OP_CARRIER_AIRLINE_ID", "INTEGER", 0, null, 0], [2, "TAIL_NUM", "TEXT", 0, null, 0], [3, "OP_CARRIER_FL_NUM", "INTEGER", 0, null, 0], [4, "ORIGIN_AIRPORT_ID", "INTEGER", 0, null, 0], [5, "ORIGIN_AIRPORT_SEQ_ID", "INTEGER", 0, null, 0], [6, "ORIGIN_CITY_MARKET_ID", "INTEGER", 0, null, 0], [7, "ORIGIN", "TEXT", 0, null, 0], [8, "DEST_AIRPORT_ID", "INTEGER", 0, null, 0], [9, "DEST_AIRPORT_SEQ_ID", "INTEGER", 0, null, 0], [10, "DEST_CITY_MARKET_ID", "INTEGER", 0, null, 0], [11, "DEST", "TEXT", 0, null, 0], [12, "CRS_DEP_TIME", "INTEGER", 0, null, 0], [13, "DEP_TIME", "INTEGER", 0, null, 0], [14, "DEP_DELAY", "INTEGER", 0, null, 0], [15, "DEP_DELAY_NEW", "INTEGER", 0, null, 0], [16, "ARR_TIME", "INTEGER", 0, null, 0], [17, "ARR_DELAY", "INTEGER", 0, null, 0], [18, "ARR_DELAY_NEW", "INTEGER", 0, null, 0], [19, "CANCELLED", "INTEGER", 0, null, 0], [20, "CANCELLATION_CODE", "TEXT", 0, null, 0], [21, "CRS_ELAPSED_TIME", "INTEGER", 0, null, 0], [22, "ACTUAL_ELAPSED_TIME", "INTEGER", 0, null, 0], [23, "CARRIER_DELAY", "INTEGER", 0, null, 0], [24, "WEATHER_DELAY", "INTEGER", 0, null, 0], [25, "NAS_DELAY", "INTEGER", 0, null, 0], [26, "SECURITY_DELAY", "INTEGER", 0, null, 0], [27, "LATE_AIRCRAFT_DELAY", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Air Carriers", "OP_CARRIER_AIRLINE_ID", "Code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Airports", "DEST", "Code", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Airports", "ORIGIN", "Code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Air Carriers ( Code INTEGER PRIMARY KEY, Description TEXT ); CREATE TABLE Airports ( Code TEXT PRIMARY KEY, Description TEXT, UNIQUE (Code) ); CREATE TABLE Airlines ( FL_DATE TEXT, OP_CARRIER_AIRLINE_ID INTEGER, TAIL_NUM TEXT, OP_CARRIER_FL_NUM INTEGER, ORIGIN_AIRPORT_ID INTEGER, ORIGIN_AIRPORT_SEQ_ID INTEGER, ORIGIN_CITY_MARKET_ID INTEGER, ORIGIN TEXT, DEST_AIRPORT_ID INTEGER, DEST_AIRPORT_SEQ_ID INTEGER, DEST_CITY_MARKET_ID INTEGER, DEST TEXT, CRS_DEP_TIME INTEGER, DEP_TIME INTEGER, DEP_DELAY INTEGER, DEP_DELAY_NEW INTEGER, ARR_TIME INTEGER, ARR_DELAY INTEGER, ARR_DELAY_NEW INTEGER, CANCELLED INTEGER, CANCELLATION_CODE TEXT, CRS_ELAPSED_TIME INTEGER, ACTUAL_ELAPSED_TIME INTEGER, CARRIER_DELAY INTEGER, WEATHER_DELAY INTEGER, NAS_DELAY INTEGER, SECURITY_DELAY INTEGER, LATE_AIRCRAFT_DELAY INTEGER, FOREIGN KEY (OP_CARRIER_AIRLINE_ID) REFERENCES Air Carriers(Code), FOREIGN KEY (DEST) REFERENCES Airports(Code), FOREIGN KEY (ORIGIN) REFERENCES Airports(Code) );
hockey
{"AwardsMisc": {"columns": [[0, "name", "TEXT", 1, null, 1], [1, "ID", "TEXT", 0, null, 0], [2, "award", "TEXT", 0, null, 0], [3, "year", "INTEGER", 0, null, 0], [4, "lgID", "TEXT", 0, null, 0], [5, "note", "TEXT", 0, null, 0]], "primary_keys": ["name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "HOF": {"columns": [[0, "year", "INTEGER", 0, null, 0], [1, "hofID", "TEXT", 1, null, 1], [2, "name", "TEXT", 0, null, 0], [3, "category", "TEXT", 0, null, 0]], "primary_keys": ["hofID"], "foreign_keys": [], "unique_constraints": [[[0, 1, "hofID"]]], "check_constraints": []}, "Teams": {"columns": [[0, "year", "INTEGER", 1, null, 1], [1, "lgID", "TEXT", 0, null, 0], [2, "tmID", "TEXT", 1, null, 2], [3, "franchID", "TEXT", 0, null, 0], [4, "confID", "TEXT", 0, null, 0], [5, "divID", "TEXT", 0, null, 0], [6, "rank", "INTEGER", 0, null, 0], [7, "playoff", "TEXT", 0, null, 0], [8, "G", "INTEGER", 0, null, 0], [9, "W", "INTEGER", 0, null, 0], [10, "L", "INTEGER", 0, null, 0], [11, "T", "INTEGER", 0, null, 0], [12, "OTL", "TEXT", 0, null, 0], [13, "Pts", "INTEGER", 0, null, 0], [14, "SoW", "TEXT", 0, null, 0], [15, "SoL", "TEXT", 0, null, 0], [16, "GF", "INTEGER", 0, null, 0], [17, "GA", "INTEGER", 0, null, 0], [18, "name", "TEXT", 0, null, 0], [19, "PIM", "TEXT", 0, null, 0], [20, "BenchMinor", "TEXT", 0, null, 0], [21, "PPG", "TEXT", 0, null, 0], [22, "PPC", "TEXT", 0, null, 0], [23, "SHA", "TEXT", 0, null, 0], [24, "PKG", "TEXT", 0, null, 0], [25, "PKC", "TEXT", 0, null, 0], [26, "SHF", "TEXT", 0, null, 0]], "primary_keys": ["year", "tmID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "year"], [1, 2, "tmID"]]], "check_constraints": []}, "Coaches": {"columns": [[0, "coachID", "TEXT", 1, null, 1], [1, "year", "INTEGER", 1, null, 2], [2, "tmID", "TEXT", 1, null, 3], [3, "lgID", "TEXT", 0, null, 0], [4, "stint", "INTEGER", 1, null, 4], [5, "notes", "TEXT", 0, null, 0], [6, "g", "INTEGER", 0, null, 0], [7, "w", "INTEGER", 0, null, 0], [8, "l", "INTEGER", 0, null, 0], [9, "t", "INTEGER", 0, null, 0], [10, "postg", "TEXT", 0, null, 0], [11, "postw", "TEXT", 0, null, 0], [12, "postl", "TEXT", 0, null, 0], [13, "postt", "TEXT", 0, null, 0]], "primary_keys": ["coachID", "year", "tmID", "stint"], "foreign_keys": [[0, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [0, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "coachID"], [1, 1, "year"], [2, 2, "tmID"], [3, 4, "stint"]]], "check_constraints": []}, "AwardsCoaches": {"columns": [[0, "coachID", "TEXT", 0, null, 0], [1, "award", "TEXT", 0, null, 0], [2, "year", "INTEGER", 0, null, 0], [3, "lgID", "TEXT", 0, null, 0], [4, "note", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Coaches", "coachID", "coachID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Master": {"columns": [[0, "playerID", "TEXT", 0, null, 0], [1, "coachID", "TEXT", 0, null, 0], [2, "hofID", "TEXT", 0, null, 0], [3, "firstName", "TEXT", 0, null, 0], [4, "lastName", "TEXT", 1, null, 0], [5, "nameNote", "TEXT", 0, null, 0], [6, "nameGiven", "TEXT", 0, null, 0], [7, "nameNick", "TEXT", 0, null, 0], [8, "height", "TEXT", 0, null, 0], [9, "weight", "TEXT", 0, null, 0], [10, "shootCatch", "TEXT", 0, null, 0], [11, "legendsID", "TEXT", 0, null, 0], [12, "ihdbID", "TEXT", 0, null, 0], [13, "hrefID", "TEXT", 0, null, 0], [14, "firstNHL", "TEXT", 0, null, 0], [15, "lastNHL", "TEXT", 0, null, 0], [16, "firstWHA", "TEXT", 0, null, 0], [17, "lastWHA", "TEXT", 0, null, 0], [18, "pos", "TEXT", 0, null, 0], [19, "birthYear", "TEXT", 0, null, 0], [20, "birthMon", "TEXT", 0, null, 0], [21, "birthDay", "TEXT", 0, null, 0], [22, "birthCountry", "TEXT", 0, null, 0], [23, "birthState", "TEXT", 0, null, 0], [24, "birthCity", "TEXT", 0, null, 0], [25, "deathYear", "TEXT", 0, null, 0], [26, "deathMon", "TEXT", 0, null, 0], [27, "deathDay", "TEXT", 0, null, 0], [28, "deathCountry", "TEXT", 0, null, 0], [29, "deathState", "TEXT", 0, null, 0], [30, "deathCity", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Coaches", "coachID", "coachID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "AwardsPlayers": {"columns": [[0, "playerID", "TEXT", 1, null, 1], [1, "award", "TEXT", 1, null, 2], [2, "year", "INTEGER", 1, null, 3], [3, "lgID", "TEXT", 0, null, 0], [4, "note", "TEXT", 0, null, 0], [5, "pos", "TEXT", 0, null, 0]], "primary_keys": ["playerID", "award", "year"], "foreign_keys": [[0, 0, "Master", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "playerID"], [1, 1, "award"], [2, 2, "year"]]], "check_constraints": []}, "CombinedShutouts": {"columns": [[0, "year", "INTEGER", 0, null, 0], [1, "month", "INTEGER", 0, null, 0], [2, "date", "INTEGER", 0, null, 0], [3, "tmID", "TEXT", 0, null, 0], [4, "oppID", "TEXT", 0, null, 0], [5, "R/P", "TEXT", 0, null, 0], [6, "IDgoalie1", "TEXT", 0, null, 0], [7, "IDgoalie2", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Master", "IDgoalie2", "playerID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Master", "IDgoalie1", "playerID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Goalies": {"columns": [[0, "playerID", "TEXT", 1, null, 1], [1, "year", "INTEGER", 1, null, 2], [2, "stint", "INTEGER", 1, null, 3], [3, "tmID", "TEXT", 0, null, 0], [4, "lgID", "TEXT", 0, null, 0], [5, "GP", "TEXT", 0, null, 0], [6, "Min", "TEXT", 0, null, 0], [7, "W", "TEXT", 0, null, 0], [8, "L", "TEXT", 0, null, 0], [9, "T/OL", "TEXT", 0, null, 0], [10, "ENG", "TEXT", 0, null, 0], [11, "SHO", "TEXT", 0, null, 0], [12, "GA", "TEXT", 0, null, 0], [13, "SA", "TEXT", 0, null, 0], [14, "PostGP", "TEXT", 0, null, 0], [15, "PostMin", "TEXT", 0, null, 0], [16, "PostW", "TEXT", 0, null, 0], [17, "PostL", "TEXT", 0, null, 0], [18, "PostT", "TEXT", 0, null, 0], [19, "PostENG", "TEXT", 0, null, 0], [20, "PostSHO", "TEXT", 0, null, 0], [21, "PostGA", "TEXT", 0, null, 0], [22, "PostSA", "TEXT", 0, null, 0]], "primary_keys": ["playerID", "year", "stint"], "foreign_keys": [[0, 0, "Master", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "playerID"], [1, 1, "year"], [2, 2, "stint"]]], "check_constraints": []}, "GoaliesSC": {"columns": [[0, "playerID", "TEXT", 1, null, 1], [1, "year", "INTEGER", 1, null, 2], [2, "tmID", "TEXT", 0, null, 0], [3, "lgID", "TEXT", 0, null, 0], [4, "GP", "INTEGER", 0, null, 0], [5, "Min", "INTEGER", 0, null, 0], [6, "W", "INTEGER", 0, null, 0], [7, "L", "INTEGER", 0, null, 0], [8, "T", "INTEGER", 0, null, 0], [9, "SHO", "INTEGER", 0, null, 0], [10, "GA", "INTEGER", 0, null, 0]], "primary_keys": ["playerID", "year"], "foreign_keys": [[0, 0, "Master", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "playerID"], [1, 1, "year"]]], "check_constraints": []}, "GoaliesShootout": {"columns": [[0, "playerID", "TEXT", 0, null, 0], [1, "year", "INTEGER", 0, null, 0], [2, "stint", "INTEGER", 0, null, 0], [3, "tmID", "TEXT", 0, null, 0], [4, "W", "INTEGER", 0, null, 0], [5, "L", "INTEGER", 0, null, 0], [6, "SA", "INTEGER", 0, null, 0], [7, "GA", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Master", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Scoring": {"columns": [[0, "playerID", "TEXT", 0, null, 0], [1, "year", "INTEGER", 0, null, 0], [2, "stint", "INTEGER", 0, null, 0], [3, "tmID", "TEXT", 0, null, 0], [4, "lgID", "TEXT", 0, null, 0], [5, "pos", "TEXT", 0, null, 0], [6, "GP", "INTEGER", 0, null, 0], [7, "G", "INTEGER", 0, null, 0], [8, "A", "INTEGER", 0, null, 0], [9, "Pts", "INTEGER", 0, null, 0], [10, "PIM", "INTEGER", 0, null, 0], [11, "+/-", "TEXT", 0, null, 0], [12, "PPG", "TEXT", 0, null, 0], [13, "PPA", "TEXT", 0, null, 0], [14, "SHG", "TEXT", 0, null, 0], [15, "SHA", "TEXT", 0, null, 0], [16, "GWG", "TEXT", 0, null, 0], [17, "GTG", "TEXT", 0, null, 0], [18, "SOG", "TEXT", 0, null, 0], [19, "PostGP", "TEXT", 0, null, 0], [20, "PostG", "TEXT", 0, null, 0], [21, "PostA", "TEXT", 0, null, 0], [22, "PostPts", "TEXT", 0, null, 0], [23, "PostPIM", "TEXT", 0, null, 0], [24, "Post+/-", "TEXT", 0, null, 0], [25, "PostPPG", "TEXT", 0, null, 0], [26, "PostPPA", "TEXT", 0, null, 0], [27, "PostSHG", "TEXT", 0, null, 0], [28, "PostSHA", "TEXT", 0, null, 0], [29, "PostGWG", "TEXT", 0, null, 0], [30, "PostSOG", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Master", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "ScoringSC": {"columns": [[0, "playerID", "TEXT", 0, null, 0], [1, "year", "INTEGER", 0, null, 0], [2, "tmID", "TEXT", 0, null, 0], [3, "lgID", "TEXT", 0, null, 0], [4, "pos", "TEXT", 0, null, 0], [5, "GP", "INTEGER", 0, null, 0], [6, "G", "INTEGER", 0, null, 0], [7, "A", "INTEGER", 0, null, 0], [8, "Pts", "INTEGER", 0, null, 0], [9, "PIM", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Master", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "ScoringShootout": {"columns": [[0, "playerID", "TEXT", 0, null, 0], [1, "year", "INTEGER", 0, null, 0], [2, "stint", "INTEGER", 0, null, 0], [3, "tmID", "TEXT", 0, null, 0], [4, "S", "INTEGER", 0, null, 0], [5, "G", "INTEGER", 0, null, 0], [6, "GDG", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Master", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "ScoringSup": {"columns": [[0, "playerID", "TEXT", 0, null, 0], [1, "year", "INTEGER", 0, null, 0], [2, "PPA", "TEXT", 0, null, 0], [3, "SHA", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Master", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "SeriesPost": {"columns": [[0, "year", "INTEGER", 0, null, 0], [1, "round", "TEXT", 0, null, 0], [2, "series", "TEXT", 0, null, 0], [3, "tmIDWinner", "TEXT", 0, null, 0], [4, "lgIDWinner", "TEXT", 0, null, 0], [5, "tmIDLoser", "TEXT", 0, null, 0], [6, "lgIDLoser", "TEXT", 0, null, 0], [7, "W", "INTEGER", 0, null, 0], [8, "L", "INTEGER", 0, null, 0], [9, "T", "INTEGER", 0, null, 0], [10, "GoalsWinner", "INTEGER", 0, null, 0], [11, "GoalsLoser", "INTEGER", 0, null, 0], [12, "note", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [0, 1, "Teams", "tmIDLoser", "tmID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 1, "Teams", "tmIDWinner", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "TeamSplits": {"columns": [[0, "year", "INTEGER", 1, null, 1], [1, "lgID", "TEXT", 0, null, 0], [2, "tmID", "TEXT", 1, null, 2], [3, "hW", "INTEGER", 0, null, 0], [4, "hL", "INTEGER", 0, null, 0], [5, "hT", "INTEGER", 0, null, 0], [6, "hOTL", "TEXT", 0, null, 0], [7, "rW", "INTEGER", 0, null, 0], [8, "rL", "INTEGER", 0, null, 0], [9, "rT", "INTEGER", 0, null, 0], [10, "rOTL", "TEXT", 0, null, 0], [11, "SepW", "TEXT", 0, null, 0], [12, "SepL", "TEXT", 0, null, 0], [13, "SepT", "TEXT", 0, null, 0], [14, "SepOL", "TEXT", 0, null, 0], [15, "OctW", "TEXT", 0, null, 0], [16, "OctL", "TEXT", 0, null, 0], [17, "OctT", "TEXT", 0, null, 0], [18, "OctOL", "TEXT", 0, null, 0], [19, "NovW", "TEXT", 0, null, 0], [20, "NovL", "TEXT", 0, null, 0], [21, "NovT", "TEXT", 0, null, 0], [22, "NovOL", "TEXT", 0, null, 0], [23, "DecW", "TEXT", 0, null, 0], [24, "DecL", "TEXT", 0, null, 0], [25, "DecT", "TEXT", 0, null, 0], [26, "DecOL", "TEXT", 0, null, 0], [27, "JanW", "INTEGER", 0, null, 0], [28, "JanL", "INTEGER", 0, null, 0], [29, "JanT", "INTEGER", 0, null, 0], [30, "JanOL", "TEXT", 0, null, 0], [31, "FebW", "INTEGER", 0, null, 0], [32, "FebL", "INTEGER", 0, null, 0], [33, "FebT", "INTEGER", 0, null, 0], [34, "FebOL", "TEXT", 0, null, 0], [35, "MarW", "TEXT", 0, null, 0], [36, "MarL", "TEXT", 0, null, 0], [37, "MarT", "TEXT", 0, null, 0], [38, "MarOL", "TEXT", 0, null, 0], [39, "AprW", "TEXT", 0, null, 0], [40, "AprL", "TEXT", 0, null, 0], [41, "AprT", "TEXT", 0, null, 0], [42, "AprOL", "TEXT", 0, null, 0]], "primary_keys": ["year", "tmID"], "foreign_keys": [[0, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [0, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "year"], [1, 2, "tmID"]]], "check_constraints": []}, "TeamVsTeam": {"columns": [[0, "year", "INTEGER", 1, null, 1], [1, "lgID", "TEXT", 0, null, 0], [2, "tmID", "TEXT", 1, null, 2], [3, "oppID", "TEXT", 1, null, 3], [4, "W", "INTEGER", 0, null, 0], [5, "L", "INTEGER", 0, null, 0], [6, "T", "INTEGER", 0, null, 0], [7, "OTL", "TEXT", 0, null, 0]], "primary_keys": ["year", "tmID", "oppID"], "foreign_keys": [[0, 0, "Teams", "oppID", "tmID", "CASCADE", "CASCADE", "NONE"], [0, 1, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "year"], [1, 2, "tmID"], [2, 3, "oppID"]]], "check_constraints": []}, "TeamsHalf": {"columns": [[0, "year", "INTEGER", 1, null, 1], [1, "lgID", "TEXT", 0, null, 0], [2, "tmID", "TEXT", 1, null, 2], [3, "half", "INTEGER", 1, null, 3], [4, "rank", "INTEGER", 0, null, 0], [5, "G", "INTEGER", 0, null, 0], [6, "W", "INTEGER", 0, null, 0], [7, "L", "INTEGER", 0, null, 0], [8, "T", "INTEGER", 0, null, 0], [9, "GF", "INTEGER", 0, null, 0], [10, "GA", "INTEGER", 0, null, 0]], "primary_keys": ["year", "tmID", "half"], "foreign_keys": [[0, 0, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"], [0, 1, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "year"], [1, 2, "tmID"], [2, 3, "half"]]], "check_constraints": []}, "TeamsPost": {"columns": [[0, "year", "INTEGER", 1, null, 1], [1, "lgID", "TEXT", 0, null, 0], [2, "tmID", "TEXT", 1, null, 2], [3, "G", "INTEGER", 0, null, 0], [4, "W", "INTEGER", 0, null, 0], [5, "L", "INTEGER", 0, null, 0], [6, "T", "INTEGER", 0, null, 0], [7, "GF", "INTEGER", 0, null, 0], [8, "GA", "INTEGER", 0, null, 0], [9, "PIM", "TEXT", 0, null, 0], [10, "BenchMinor", "TEXT", 0, null, 0], [11, "PPG", "TEXT", 0, null, 0], [12, "PPC", "TEXT", 0, null, 0], [13, "SHA", "TEXT", 0, null, 0], [14, "PKG", "TEXT", 0, null, 0], [15, "PKC", "TEXT", 0, null, 0], [16, "SHF", "TEXT", 0, null, 0]], "primary_keys": ["year", "tmID"], "foreign_keys": [[0, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [0, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "year"], [1, 2, "tmID"]]], "check_constraints": []}, "TeamsSC": {"columns": [[0, "year", "INTEGER", 1, null, 1], [1, "lgID", "TEXT", 0, null, 0], [2, "tmID", "TEXT", 1, null, 2], [3, "G", "INTEGER", 0, null, 0], [4, "W", "INTEGER", 0, null, 0], [5, "L", "INTEGER", 0, null, 0], [6, "T", "INTEGER", 0, null, 0], [7, "GF", "INTEGER", 0, null, 0], [8, "GA", "INTEGER", 0, null, 0], [9, "PIM", "TEXT", 0, null, 0]], "primary_keys": ["year", "tmID"], "foreign_keys": [[0, 0, "Teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [0, 1, "Teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "year"], [1, 2, "tmID"]]], "check_constraints": []}, "abbrev": {"columns": [[0, "Type", "TEXT", 1, null, 1], [1, "Code", "TEXT", 1, null, 2], [2, "Fullname", "TEXT", 0, null, 0]], "primary_keys": ["Type", "Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Type"], [1, 1, "Code"]]], "check_constraints": []}}
CREATE TABLE AwardsMisc ( name TEXT NOT NULL PRIMARY KEY, ID TEXT, award TEXT, year INTEGER, lgID TEXT, note TEXT, UNIQUE (name) ); CREATE TABLE HOF ( year INTEGER, hofID TEXT NOT NULL PRIMARY KEY, name TEXT, category TEXT, UNIQUE (hofID) ); CREATE TABLE Teams ( year INTEGER NOT NULL PRIMARY KEY, lgID TEXT, tmID TEXT NOT NULL PRIMARY KEY, franchID TEXT, confID TEXT, divID TEXT, rank INTEGER, playoff TEXT, G INTEGER, W INTEGER, L INTEGER, T INTEGER, OTL TEXT, Pts INTEGER, SoW TEXT, SoL TEXT, GF INTEGER, GA INTEGER, name TEXT, PIM TEXT, BenchMinor TEXT, PPG TEXT, PPC TEXT, SHA TEXT, PKG TEXT, PKC TEXT, SHF TEXT, PRIMARY KEY (year, tmID), UNIQUE (year, tmID) ); CREATE TABLE Coaches ( coachID TEXT NOT NULL PRIMARY KEY, year INTEGER NOT NULL PRIMARY KEY, tmID TEXT NOT NULL PRIMARY KEY, lgID TEXT, stint INTEGER NOT NULL PRIMARY KEY, notes TEXT, g INTEGER, w INTEGER, l INTEGER, t INTEGER, postg TEXT, postw TEXT, postl TEXT, postt TEXT, PRIMARY KEY (coachID, year, tmID, stint), UNIQUE (coachID, year, tmID, stint), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE AwardsCoaches ( coachID TEXT, award TEXT, year INTEGER, lgID TEXT, note TEXT, FOREIGN KEY (coachID) REFERENCES Coaches(coachID) ); CREATE TABLE Master ( playerID TEXT, coachID TEXT, hofID TEXT, firstName TEXT, lastName TEXT NOT NULL, nameNote TEXT, nameGiven TEXT, nameNick TEXT, height TEXT, weight TEXT, shootCatch TEXT, legendsID TEXT, ihdbID TEXT, hrefID TEXT, firstNHL TEXT, lastNHL TEXT, firstWHA TEXT, lastWHA TEXT, pos TEXT, birthYear TEXT, birthMon TEXT, birthDay TEXT, birthCountry TEXT, birthState TEXT, birthCity TEXT, deathYear TEXT, deathMon TEXT, deathDay TEXT, deathCountry TEXT, deathState TEXT, deathCity TEXT, FOREIGN KEY (coachID) REFERENCES Coaches(coachID) ); CREATE TABLE AwardsPlayers ( playerID TEXT NOT NULL PRIMARY KEY, award TEXT NOT NULL PRIMARY KEY, year INTEGER NOT NULL PRIMARY KEY, lgID TEXT, note TEXT, pos TEXT, PRIMARY KEY (playerID, award, year), UNIQUE (playerID, award, year), FOREIGN KEY (playerID) REFERENCES Master(playerID) ); CREATE TABLE CombinedShutouts ( year INTEGER, month INTEGER, date INTEGER, tmID TEXT, oppID TEXT, R/P TEXT, IDgoalie1 TEXT, IDgoalie2 TEXT, FOREIGN KEY (IDgoalie2) REFERENCES Master(playerID), FOREIGN KEY (IDgoalie1) REFERENCES Master(playerID) ); CREATE TABLE Goalies ( playerID TEXT NOT NULL PRIMARY KEY, year INTEGER NOT NULL PRIMARY KEY, stint INTEGER NOT NULL PRIMARY KEY, tmID TEXT, lgID TEXT, GP TEXT, Min TEXT, W TEXT, L TEXT, T/OL TEXT, ENG TEXT, SHO TEXT, GA TEXT, SA TEXT, PostGP TEXT, PostMin TEXT, PostW TEXT, PostL TEXT, PostT TEXT, PostENG TEXT, PostSHO TEXT, PostGA TEXT, PostSA TEXT, PRIMARY KEY (playerID, year, stint), UNIQUE (playerID, year, stint), FOREIGN KEY (playerID) REFERENCES Master(playerID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE GoaliesSC ( playerID TEXT NOT NULL PRIMARY KEY, year INTEGER NOT NULL PRIMARY KEY, tmID TEXT, lgID TEXT, GP INTEGER, Min INTEGER, W INTEGER, L INTEGER, T INTEGER, SHO INTEGER, GA INTEGER, PRIMARY KEY (playerID, year), UNIQUE (playerID, year), FOREIGN KEY (playerID) REFERENCES Master(playerID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE GoaliesShootout ( playerID TEXT, year INTEGER, stint INTEGER, tmID TEXT, W INTEGER, L INTEGER, SA INTEGER, GA INTEGER, FOREIGN KEY (playerID) REFERENCES Master(playerID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE Scoring ( playerID TEXT, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, pos TEXT, GP INTEGER, G INTEGER, A INTEGER, Pts INTEGER, PIM INTEGER, +/- TEXT, PPG TEXT, PPA TEXT, SHG TEXT, SHA TEXT, GWG TEXT, GTG TEXT, SOG TEXT, PostGP TEXT, PostG TEXT, PostA TEXT, PostPts TEXT, PostPIM TEXT, Post+/- TEXT, PostPPG TEXT, PostPPA TEXT, PostSHG TEXT, PostSHA TEXT, PostGWG TEXT, PostSOG TEXT, FOREIGN KEY (playerID) REFERENCES Master(playerID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE ScoringSC ( playerID TEXT, year INTEGER, tmID TEXT, lgID TEXT, pos TEXT, GP INTEGER, G INTEGER, A INTEGER, Pts INTEGER, PIM INTEGER, FOREIGN KEY (playerID) REFERENCES Master(playerID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE ScoringShootout ( playerID TEXT, year INTEGER, stint INTEGER, tmID TEXT, S INTEGER, G INTEGER, GDG INTEGER, FOREIGN KEY (playerID) REFERENCES Master(playerID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE ScoringSup ( playerID TEXT, year INTEGER, PPA TEXT, SHA TEXT, FOREIGN KEY (playerID) REFERENCES Master(playerID) ); CREATE TABLE SeriesPost ( year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, T INTEGER, GoalsWinner INTEGER, GoalsLoser INTEGER, note TEXT, FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmIDLoser) REFERENCES Teams(tmID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmIDWinner) REFERENCES Teams(tmID) ); CREATE TABLE TeamSplits ( year INTEGER NOT NULL PRIMARY KEY, lgID TEXT, tmID TEXT NOT NULL PRIMARY KEY, hW INTEGER, hL INTEGER, hT INTEGER, hOTL TEXT, rW INTEGER, rL INTEGER, rT INTEGER, rOTL TEXT, SepW TEXT, SepL TEXT, SepT TEXT, SepOL TEXT, OctW TEXT, OctL TEXT, OctT TEXT, OctOL TEXT, NovW TEXT, NovL TEXT, NovT TEXT, NovOL TEXT, DecW TEXT, DecL TEXT, DecT TEXT, DecOL TEXT, JanW INTEGER, JanL INTEGER, JanT INTEGER, JanOL TEXT, FebW INTEGER, FebL INTEGER, FebT INTEGER, FebOL TEXT, MarW TEXT, MarL TEXT, MarT TEXT, MarOL TEXT, AprW TEXT, AprL TEXT, AprT TEXT, AprOL TEXT, PRIMARY KEY (year, tmID), UNIQUE (year, tmID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE TeamVsTeam ( year INTEGER NOT NULL PRIMARY KEY, lgID TEXT, tmID TEXT NOT NULL PRIMARY KEY, oppID TEXT NOT NULL PRIMARY KEY, W INTEGER, L INTEGER, T INTEGER, OTL TEXT, PRIMARY KEY (year, tmID, oppID), UNIQUE (year, tmID, oppID), FOREIGN KEY (oppID) REFERENCES Teams(tmID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE TeamsHalf ( year INTEGER NOT NULL PRIMARY KEY, lgID TEXT, tmID TEXT NOT NULL PRIMARY KEY, half INTEGER NOT NULL PRIMARY KEY, rank INTEGER, G INTEGER, W INTEGER, L INTEGER, T INTEGER, GF INTEGER, GA INTEGER, PRIMARY KEY (year, tmID, half), UNIQUE (year, tmID, half), FOREIGN KEY (tmID) REFERENCES Teams(tmID), FOREIGN KEY (year) REFERENCES Teams(year) ); CREATE TABLE TeamsPost ( year INTEGER NOT NULL PRIMARY KEY, lgID TEXT, tmID TEXT NOT NULL PRIMARY KEY, G INTEGER, W INTEGER, L INTEGER, T INTEGER, GF INTEGER, GA INTEGER, PIM TEXT, BenchMinor TEXT, PPG TEXT, PPC TEXT, SHA TEXT, PKG TEXT, PKC TEXT, SHF TEXT, PRIMARY KEY (year, tmID), UNIQUE (year, tmID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE TeamsSC ( year INTEGER NOT NULL PRIMARY KEY, lgID TEXT, tmID TEXT NOT NULL PRIMARY KEY, G INTEGER, W INTEGER, L INTEGER, T INTEGER, GF INTEGER, GA INTEGER, PIM TEXT, PRIMARY KEY (year, tmID), UNIQUE (year, tmID), FOREIGN KEY (year) REFERENCES Teams(year), FOREIGN KEY (tmID) REFERENCES Teams(tmID) ); CREATE TABLE abbrev ( Type TEXT NOT NULL PRIMARY KEY, Code TEXT NOT NULL PRIMARY KEY, Fullname TEXT, PRIMARY KEY (Type, Code), UNIQUE (Type, Code) );
shooting
{"incidents": {"columns": [[0, "case_number", "TEXT", 1, null, 1], [1, "date", "DATE", 1, null, 0], [2, "location", "TEXT", 1, null, 0], [3, "subject_statuses", "TEXT", 1, null, 0], [4, "subject_weapon", "TEXT", 1, null, 0], [5, "subjects", "TEXT", 1, null, 0], [6, "subject_count", "INTEGER", 1, null, 0], [7, "officers", "TEXT", 1, null, 0]], "primary_keys": ["case_number"], "foreign_keys": [], "unique_constraints": [[[0, 0, "case_number"]]], "check_constraints": []}, "officers": {"columns": [[0, "case_number", "TEXT", 1, null, 0], [1, "race", "TEXT", 0, null, 0], [2, "gender", "TEXT", 1, null, 0], [3, "last_name", "TEXT", 1, null, 0], [4, "first_name", "TEXT", 0, null, 0], [5, "full_name", "TEXT", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "incidents", "case_number", "case_number", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "subjects": {"columns": [[0, "case_number", "TEXT", 1, null, 0], [1, "race", "TEXT", 1, null, 0], [2, "gender", "TEXT", 1, null, 0], [3, "last_name", "TEXT", 1, null, 0], [4, "first_name", "TEXT", 0, null, 0], [5, "full_name", "TEXT", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "incidents", "case_number", "case_number", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE incidents ( case_number TEXT NOT NULL PRIMARY KEY, date DATE NOT NULL, location TEXT NOT NULL, subject_statuses TEXT NOT NULL, subject_weapon TEXT NOT NULL, subjects TEXT NOT NULL, subject_count INTEGER NOT NULL, officers TEXT NOT NULL, UNIQUE (case_number) ); CREATE TABLE officers ( case_number TEXT NOT NULL, race TEXT, gender TEXT NOT NULL, last_name TEXT NOT NULL, first_name TEXT, full_name TEXT NOT NULL, FOREIGN KEY (case_number) REFERENCES incidents(case_number) ); CREATE TABLE subjects ( case_number TEXT NOT NULL, race TEXT NOT NULL, gender TEXT NOT NULL, last_name TEXT NOT NULL, first_name TEXT, full_name TEXT NOT NULL, FOREIGN KEY (case_number) REFERENCES incidents(case_number) );
superstore
{"people": {"columns": [[0, "Customer ID", "TEXT", 0, null, 1], [1, "Customer Name", "TEXT", 0, null, 0], [2, "Segment", "TEXT", 0, null, 0], [3, "Country", "TEXT", 0, null, 0], [4, "City", "TEXT", 0, null, 0], [5, "State", "TEXT", 0, null, 0], [6, "Postal Code", "INTEGER", 0, null, 0], [7, "Region", "TEXT", 0, null, 2]], "primary_keys": ["Customer ID", "Region"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Customer ID"], [1, 7, "Region"]]], "check_constraints": []}, "product": {"columns": [[0, "Product ID", "TEXT", 0, null, 1], [1, "Product Name", "TEXT", 0, null, 0], [2, "Category", "TEXT", 0, null, 0], [3, "Sub-Category", "TEXT", 0, null, 0], [4, "Region", "TEXT", 0, null, 2]], "primary_keys": ["Product ID", "Region"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Product ID"], [1, 4, "Region"]]], "check_constraints": []}, "central_superstore": {"columns": [[0, "Row ID", "INTEGER", 0, null, 1], [1, "Order ID", "TEXT", 0, null, 0], [2, "Order Date", "DATE", 0, null, 0], [3, "Ship Date", "DATE", 0, null, 0], [4, "Ship Mode", "TEXT", 0, null, 0], [5, "Customer ID", "TEXT", 0, null, 0], [6, "Region", "TEXT", 0, null, 0], [7, "Product ID", "TEXT", 0, null, 0], [8, "Sales", "REAL", 0, null, 0], [9, "Quantity", "INTEGER", 0, null, 0], [10, "Discount", "REAL", 0, null, 0], [11, "Profit", "REAL", 0, null, 0]], "primary_keys": ["Row ID"], "foreign_keys": [[0, 0, "product", "Product ID", "Product ID", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "product", "Region", "Region", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "people", "Customer ID", "Customer ID", "NO ACTION", "NO ACTION", "NONE"], [1, 1, "people", "Region", "Region", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "east_superstore": {"columns": [[0, "Row ID", "INTEGER", 0, null, 1], [1, "Order ID", "TEXT", 0, null, 0], [2, "Order Date", "DATE", 0, null, 0], [3, "Ship Date", "DATE", 0, null, 0], [4, "Ship Mode", "TEXT", 0, null, 0], [5, "Customer ID", "TEXT", 0, null, 0], [6, "Region", "TEXT", 0, null, 0], [7, "Product ID", "TEXT", 0, null, 0], [8, "Sales", "REAL", 0, null, 0], [9, "Quantity", "INTEGER", 0, null, 0], [10, "Discount", "REAL", 0, null, 0], [11, "Profit", "REAL", 0, null, 0]], "primary_keys": ["Row ID"], "foreign_keys": [[0, 0, "product", "Product ID", "Product ID", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "product", "Region", "Region", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "people", "Customer ID", "Customer ID", "NO ACTION", "NO ACTION", "NONE"], [1, 1, "people", "Region", "Region", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "south_superstore": {"columns": [[0, "Row ID", "INTEGER", 0, null, 1], [1, "Order ID", "TEXT", 0, null, 0], [2, "Order Date", "DATE", 0, null, 0], [3, "Ship Date", "DATE", 0, null, 0], [4, "Ship Mode", "TEXT", 0, null, 0], [5, "Customer ID", "TEXT", 0, null, 0], [6, "Region", "TEXT", 0, null, 0], [7, "Product ID", "TEXT", 0, null, 0], [8, "Sales", "REAL", 0, null, 0], [9, "Quantity", "INTEGER", 0, null, 0], [10, "Discount", "REAL", 0, null, 0], [11, "Profit", "REAL", 0, null, 0]], "primary_keys": ["Row ID"], "foreign_keys": [[0, 0, "product", "Product ID", "Product ID", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "product", "Region", "Region", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "people", "Customer ID", "Customer ID", "NO ACTION", "NO ACTION", "NONE"], [1, 1, "people", "Region", "Region", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "west_superstore": {"columns": [[0, "Row ID", "INTEGER", 0, null, 1], [1, "Order ID", "TEXT", 0, null, 0], [2, "Order Date", "DATE", 0, null, 0], [3, "Ship Date", "DATE", 0, null, 0], [4, "Ship Mode", "TEXT", 0, null, 0], [5, "Customer ID", "TEXT", 0, null, 0], [6, "Region", "TEXT", 0, null, 0], [7, "Product ID", "TEXT", 0, null, 0], [8, "Sales", "REAL", 0, null, 0], [9, "Quantity", "INTEGER", 0, null, 0], [10, "Discount", "REAL", 0, null, 0], [11, "Profit", "REAL", 0, null, 0]], "primary_keys": ["Row ID"], "foreign_keys": [[0, 0, "product", "Product ID", "Product ID", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "product", "Region", "Region", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "people", "Customer ID", "Customer ID", "NO ACTION", "NO ACTION", "NONE"], [1, 1, "people", "Region", "Region", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE people ( Customer ID TEXT PRIMARY KEY, Customer Name TEXT, Segment TEXT, Country TEXT, City TEXT, State TEXT, Postal Code INTEGER, Region TEXT PRIMARY KEY, PRIMARY KEY (Customer ID, Region), UNIQUE (Customer ID, Region) ); CREATE TABLE product ( Product ID TEXT PRIMARY KEY, Product Name TEXT, Category TEXT, Sub-Category TEXT, Region TEXT PRIMARY KEY, PRIMARY KEY (Product ID, Region), UNIQUE (Product ID, Region) ); CREATE TABLE central_superstore ( Row ID INTEGER PRIMARY KEY, Order ID TEXT, Order Date DATE, Ship Date DATE, Ship Mode TEXT, Customer ID TEXT, Region TEXT, Product ID TEXT, Sales REAL, Quantity INTEGER, Discount REAL, Profit REAL, FOREIGN KEY (Product ID) REFERENCES product(Product ID), FOREIGN KEY (Region) REFERENCES product(Region), FOREIGN KEY (Customer ID) REFERENCES people(Customer ID), FOREIGN KEY (Region) REFERENCES people(Region) ); CREATE TABLE east_superstore ( Row ID INTEGER PRIMARY KEY, Order ID TEXT, Order Date DATE, Ship Date DATE, Ship Mode TEXT, Customer ID TEXT, Region TEXT, Product ID TEXT, Sales REAL, Quantity INTEGER, Discount REAL, Profit REAL, FOREIGN KEY (Product ID) REFERENCES product(Product ID), FOREIGN KEY (Region) REFERENCES product(Region), FOREIGN KEY (Customer ID) REFERENCES people(Customer ID), FOREIGN KEY (Region) REFERENCES people(Region) ); CREATE TABLE south_superstore ( Row ID INTEGER PRIMARY KEY, Order ID TEXT, Order Date DATE, Ship Date DATE, Ship Mode TEXT, Customer ID TEXT, Region TEXT, Product ID TEXT, Sales REAL, Quantity INTEGER, Discount REAL, Profit REAL, FOREIGN KEY (Product ID) REFERENCES product(Product ID), FOREIGN KEY (Region) REFERENCES product(Region), FOREIGN KEY (Customer ID) REFERENCES people(Customer ID), FOREIGN KEY (Region) REFERENCES people(Region) ); CREATE TABLE west_superstore ( Row ID INTEGER PRIMARY KEY, Order ID TEXT, Order Date DATE, Ship Date DATE, Ship Mode TEXT, Customer ID TEXT, Region TEXT, Product ID TEXT, Sales REAL, Quantity INTEGER, Discount REAL, Profit REAL, FOREIGN KEY (Product ID) REFERENCES product(Product ID), FOREIGN KEY (Region) REFERENCES product(Region), FOREIGN KEY (Customer ID) REFERENCES people(Customer ID), FOREIGN KEY (Region) REFERENCES people(Region) );
regional_sales
{"Customers": {"columns": [[0, "CustomerID", "INTEGER", 0, null, 1], [1, "Customer Names", "TEXT", 0, null, 0]], "primary_keys": ["CustomerID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "ProductID", "INTEGER", 0, null, 1], [1, "Product Name", "TEXT", 0, null, 0]], "primary_keys": ["ProductID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Regions": {"columns": [[0, "StateCode", "TEXT", 0, null, 1], [1, "State", "TEXT", 0, null, 0], [2, "Region", "TEXT", 0, null, 0]], "primary_keys": ["StateCode"], "foreign_keys": [], "unique_constraints": [[[0, 0, "StateCode"]]], "check_constraints": []}, "Sales Team": {"columns": [[0, "SalesTeamID", "INTEGER", 0, null, 1], [1, "Sales Team", "TEXT", 0, null, 0], [2, "Region", "TEXT", 0, null, 0]], "primary_keys": ["SalesTeamID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Store Locations": {"columns": [[0, "StoreID", "INTEGER", 0, null, 1], [1, "City Name", "TEXT", 0, null, 0], [2, "County", "TEXT", 0, null, 0], [3, "StateCode", "TEXT", 0, null, 0], [4, "State", "TEXT", 0, null, 0], [5, "Type", "TEXT", 0, null, 0], [6, "Latitude", "REAL", 0, null, 0], [7, "Longitude", "REAL", 0, null, 0], [8, "AreaCode", "INTEGER", 0, null, 0], [9, "Population", "INTEGER", 0, null, 0], [10, "Household Income", "INTEGER", 0, null, 0], [11, "Median Income", "INTEGER", 0, null, 0], [12, "Land Area", "INTEGER", 0, null, 0], [13, "Water Area", "INTEGER", 0, null, 0], [14, "Time Zone", "TEXT", 0, null, 0]], "primary_keys": ["StoreID"], "foreign_keys": [[0, 0, "Regions", "StateCode", "StateCode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Sales Orders": {"columns": [[0, "OrderNumber", "TEXT", 0, null, 1], [1, "Sales Channel", "TEXT", 0, null, 0], [2, "WarehouseCode", "TEXT", 0, null, 0], [3, "ProcuredDate", "TEXT", 0, null, 0], [4, "OrderDate", "TEXT", 0, null, 0], [5, "ShipDate", "TEXT", 0, null, 0], [6, "DeliveryDate", "TEXT", 0, null, 0], [7, "CurrencyCode", "TEXT", 0, null, 0], [8, "_SalesTeamID", "INTEGER", 0, null, 0], [9, "_CustomerID", "INTEGER", 0, null, 0], [10, "_StoreID", "INTEGER", 0, null, 0], [11, "_ProductID", "INTEGER", 0, null, 0], [12, "Order Quantity", "INTEGER", 0, null, 0], [13, "Discount Applied", "REAL", 0, null, 0], [14, "Unit Price", "TEXT", 0, null, 0], [15, "Unit Cost", "TEXT", 0, null, 0]], "primary_keys": ["OrderNumber"], "foreign_keys": [[0, 0, "Products", "_ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Store Locations", "_StoreID", "StoreID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Customers", "_CustomerID", "CustomerID", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Sales Team", "_SalesTeamID", "SalesTeamID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "OrderNumber"]]], "check_constraints": []}}
CREATE TABLE Customers ( CustomerID INTEGER PRIMARY KEY, Customer Names TEXT ); CREATE TABLE Products ( ProductID INTEGER PRIMARY KEY, Product Name TEXT ); CREATE TABLE Regions ( StateCode TEXT PRIMARY KEY, State TEXT, Region TEXT, UNIQUE (StateCode) ); CREATE TABLE Sales Team ( SalesTeamID INTEGER PRIMARY KEY, Sales Team TEXT, Region TEXT ); CREATE TABLE Store Locations ( StoreID INTEGER PRIMARY KEY, City Name TEXT, County TEXT, StateCode TEXT, State TEXT, Type TEXT, Latitude REAL, Longitude REAL, AreaCode INTEGER, Population INTEGER, Household Income INTEGER, Median Income INTEGER, Land Area INTEGER, Water Area INTEGER, Time Zone TEXT, FOREIGN KEY (StateCode) REFERENCES Regions(StateCode) ); CREATE TABLE Sales Orders ( OrderNumber TEXT PRIMARY KEY, Sales Channel TEXT, WarehouseCode TEXT, ProcuredDate TEXT, OrderDate TEXT, ShipDate TEXT, DeliveryDate TEXT, CurrencyCode TEXT, _SalesTeamID INTEGER, _CustomerID INTEGER, _StoreID INTEGER, _ProductID INTEGER, Order Quantity INTEGER, Discount Applied REAL, Unit Price TEXT, Unit Cost TEXT, UNIQUE (OrderNumber), FOREIGN KEY (_ProductID) REFERENCES Products(ProductID), FOREIGN KEY (_StoreID) REFERENCES Store Locations(StoreID), FOREIGN KEY (_CustomerID) REFERENCES Customers(CustomerID), FOREIGN KEY (_SalesTeamID) REFERENCES Sales Team(SalesTeamID) );
professional_basketball
{"awards_players": {"columns": [[0, "playerID", "TEXT", 1, null, 1], [1, "award", "TEXT", 1, null, 3], [2, "year", "INTEGER", 1, null, 2], [3, "lgID", "TEXT", 0, null, 0], [4, "note", "TEXT", 0, null, 0], [5, "pos", "TEXT", 0, null, 0]], "primary_keys": ["playerID", "award", "year"], "foreign_keys": [[0, 0, "players", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "playerID"], [1, 2, "year"], [2, 1, "award"]]], "check_constraints": []}, "coaches": {"columns": [[0, "coachID", "TEXT", 1, null, 1], [1, "year", "INTEGER", 1, null, 2], [2, "tmID", "TEXT", 1, null, 3], [3, "lgID", "TEXT", 0, null, 0], [4, "stint", "INTEGER", 1, null, 4], [5, "won", "INTEGER", 0, null, 0], [6, "lost", "INTEGER", 0, null, 0], [7, "post_wins", "INTEGER", 0, null, 0], [8, "post_losses", "INTEGER", 0, null, 0]], "primary_keys": ["coachID", "year", "tmID", "stint"], "foreign_keys": [[0, 0, "teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"], [0, 1, "teams", "year", "year", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "coachID"], [1, 1, "year"], [2, 2, "tmID"], [3, 4, "stint"]]], "check_constraints": []}, "draft": {"columns": [[0, "id", "INTEGER", 1, "0", 1], [1, "draftYear", "INTEGER", 0, null, 0], [2, "draftRound", "INTEGER", 0, null, 0], [3, "draftSelection", "INTEGER", 0, null, 0], [4, "draftOverall", "INTEGER", 0, null, 0], [5, "tmID", "TEXT", 0, null, 0], [6, "firstName", "TEXT", 0, null, 0], [7, "lastName", "TEXT", 0, null, 0], [8, "suffixName", "TEXT", 0, null, 0], [9, "playerID", "TEXT", 0, null, 0], [10, "draftFrom", "TEXT", 0, null, 0], [11, "lgID", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"], [0, 1, "teams", "draftYear", "year", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "player_allstar": {"columns": [[0, "playerID", "TEXT", 1, null, 1], [1, "last_name", "TEXT", 0, null, 0], [2, "first_name", "TEXT", 0, null, 0], [3, "season_id", "INTEGER", 1, null, 2], [4, "conference", "TEXT", 0, null, 0], [5, "league_id", "TEXT", 0, null, 0], [6, "games_played", "INTEGER", 0, null, 0], [7, "minutes", "INTEGER", 0, null, 0], [8, "points", "INTEGER", 0, null, 0], [9, "o_rebounds", "INTEGER", 0, null, 0], [10, "d_rebounds", "INTEGER", 0, null, 0], [11, "rebounds", "INTEGER", 0, null, 0], [12, "assists", "INTEGER", 0, null, 0], [13, "steals", "INTEGER", 0, null, 0], [14, "blocks", "INTEGER", 0, null, 0], [15, "turnovers", "INTEGER", 0, null, 0], [16, "personal_fouls", "INTEGER", 0, null, 0], [17, "fg_attempted", "INTEGER", 0, null, 0], [18, "fg_made", "INTEGER", 0, null, 0], [19, "ft_attempted", "INTEGER", 0, null, 0], [20, "ft_made", "INTEGER", 0, null, 0], [21, "three_attempted", "INTEGER", 0, null, 0], [22, "three_made", "INTEGER", 0, null, 0]], "primary_keys": ["playerID", "season_id"], "foreign_keys": [[0, 0, "players", "playerID", "playerID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "playerID"], [1, 3, "season_id"]]], "check_constraints": []}, "players": {"columns": [[0, "playerID", "TEXT", 1, null, 1], [1, "useFirst", "TEXT", 0, null, 0], [2, "firstName", "TEXT", 0, null, 0], [3, "middleName", "TEXT", 0, null, 0], [4, "lastName", "TEXT", 0, null, 0], [5, "nameGiven", "TEXT", 0, null, 0], [6, "fullGivenName", "TEXT", 0, null, 0], [7, "nameSuffix", "TEXT", 0, null, 0], [8, "nameNick", "TEXT", 0, null, 0], [9, "pos", "TEXT", 0, null, 0], [10, "firstseason", "INTEGER", 0, null, 0], [11, "lastseason", "INTEGER", 0, null, 0], [12, "height", "REAL", 0, null, 0], [13, "weight", "INTEGER", 0, null, 0], [14, "college", "TEXT", 0, null, 0], [15, "collegeOther", "TEXT", 0, null, 0], [16, "birthDate", "DATE", 0, null, 0], [17, "birthCity", "TEXT", 0, null, 0], [18, "birthState", "TEXT", 0, null, 0], [19, "birthCountry", "TEXT", 0, null, 0], [20, "highSchool", "TEXT", 0, null, 0], [21, "hsCity", "TEXT", 0, null, 0], [22, "hsState", "TEXT", 0, null, 0], [23, "hsCountry", "TEXT", 0, null, 0], [24, "deathDate", "DATE", 0, null, 0], [25, "race", "TEXT", 0, null, 0]], "primary_keys": ["playerID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "playerID"]]], "check_constraints": []}, "teams": {"columns": [[0, "year", "INTEGER", 1, null, 1], [1, "lgID", "TEXT", 0, null, 0], [2, "tmID", "TEXT", 1, null, 2], [3, "franchID", "TEXT", 0, null, 0], [4, "confID", "TEXT", 0, null, 0], [5, "divID", "TEXT", 0, null, 0], [6, "rank", "INTEGER", 0, null, 0], [7, "confRank", "INTEGER", 0, null, 0], [8, "playoff", "TEXT", 0, null, 0], [9, "name", "TEXT", 0, null, 0], [10, "o_fgm", "INTEGER", 0, null, 0], [11, "o_ftm", "INTEGER", 0, null, 0], [12, "o_pts", "INTEGER", 0, null, 0], [13, "d_pts", "INTEGER", 0, null, 0], [14, "homeWon", "INTEGER", 0, null, 0], [15, "homeLost", "INTEGER", 0, null, 0], [16, "awayWon", "INTEGER", 0, null, 0], [17, "awayLost", "INTEGER", 0, null, 0], [18, "won", "INTEGER", 0, null, 0], [19, "lost", "INTEGER", 0, null, 0], [20, "games", "INTEGER", 0, null, 0], [21, "arena", "TEXT", 0, null, 0]], "primary_keys": ["year", "tmID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "year"], [1, 2, "tmID"]]], "check_constraints": []}, "awards_coaches": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "year", "INTEGER", 0, null, 0], [2, "coachID", "TEXT", 0, null, 0], [3, "award", "TEXT", 0, null, 0], [4, "lgID", "TEXT", 0, null, 0], [5, "note", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "coaches", "coachID", "coachID", "CASCADE", "CASCADE", "NONE"], [0, 1, "coaches", "year", "year", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "players_teams": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "playerID", "TEXT", 1, null, 0], [2, "year", "INTEGER", 0, null, 0], [3, "stint", "INTEGER", 0, null, 0], [4, "tmID", "TEXT", 0, null, 0], [5, "lgID", "TEXT", 0, null, 0], [6, "GP", "INTEGER", 0, null, 0], [7, "GS", "INTEGER", 0, null, 0], [8, "minutes", "INTEGER", 0, null, 0], [9, "points", "INTEGER", 0, null, 0], [10, "oRebounds", "INTEGER", 0, null, 0], [11, "dRebounds", "INTEGER", 0, null, 0], [12, "rebounds", "INTEGER", 0, null, 0], [13, "assists", "INTEGER", 0, null, 0], [14, "steals", "INTEGER", 0, null, 0], [15, "blocks", "INTEGER", 0, null, 0], [16, "turnovers", "INTEGER", 0, null, 0], [17, "PF", "INTEGER", 0, null, 0], [18, "fgAttempted", "INTEGER", 0, null, 0], [19, "fgMade", "INTEGER", 0, null, 0], [20, "ftAttempted", "INTEGER", 0, null, 0], [21, "ftMade", "INTEGER", 0, null, 0], [22, "threeAttempted", "INTEGER", 0, null, 0], [23, "threeMade", "INTEGER", 0, null, 0], [24, "PostGP", "INTEGER", 0, null, 0], [25, "PostGS", "INTEGER", 0, null, 0], [26, "PostMinutes", "INTEGER", 0, null, 0], [27, "PostPoints", "INTEGER", 0, null, 0], [28, "PostoRebounds", "INTEGER", 0, null, 0], [29, "PostdRebounds", "INTEGER", 0, null, 0], [30, "PostRebounds", "INTEGER", 0, null, 0], [31, "PostAssists", "INTEGER", 0, null, 0], [32, "PostSteals", "INTEGER", 0, null, 0], [33, "PostBlocks", "INTEGER", 0, null, 0], [34, "PostTurnovers", "INTEGER", 0, null, 0], [35, "PostPF", "INTEGER", 0, null, 0], [36, "PostfgAttempted", "INTEGER", 0, null, 0], [37, "PostfgMade", "INTEGER", 0, null, 0], [38, "PostftAttempted", "INTEGER", 0, null, 0], [39, "PostftMade", "INTEGER", 0, null, 0], [40, "PostthreeAttempted", "INTEGER", 0, null, 0], [41, "PostthreeMade", "INTEGER", 0, null, 0], [42, "note", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "teams", "tmID", "tmID", "CASCADE", "CASCADE", "NONE"], [0, 1, "teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 0, "players", "playerID", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "series_post": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "year", "INTEGER", 0, null, 0], [2, "round", "TEXT", 0, null, 0], [3, "series", "TEXT", 0, null, 0], [4, "tmIDWinner", "TEXT", 0, null, 0], [5, "lgIDWinner", "TEXT", 0, null, 0], [6, "tmIDLoser", "TEXT", 0, null, 0], [7, "lgIDLoser", "TEXT", 0, null, 0], [8, "W", "INTEGER", 0, null, 0], [9, "L", "INTEGER", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "teams", "tmIDLoser", "tmID", "CASCADE", "CASCADE", "NONE"], [0, 1, "teams", "year", "year", "CASCADE", "CASCADE", "NONE"], [1, 0, "teams", "tmIDWinner", "tmID", "CASCADE", "CASCADE", "NONE"], [1, 1, "teams", "year", "year", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE awards_players ( playerID TEXT NOT NULL PRIMARY KEY, award TEXT NOT NULL PRIMARY KEY, year INTEGER NOT NULL PRIMARY KEY, lgID TEXT, note TEXT, pos TEXT, PRIMARY KEY (playerID, award, year), UNIQUE (playerID, year, award), FOREIGN KEY (playerID) REFERENCES players(playerID) ); CREATE TABLE coaches ( coachID TEXT NOT NULL PRIMARY KEY, year INTEGER NOT NULL PRIMARY KEY, tmID TEXT NOT NULL PRIMARY KEY, lgID TEXT, stint INTEGER NOT NULL PRIMARY KEY, won INTEGER, lost INTEGER, post_wins INTEGER, post_losses INTEGER, PRIMARY KEY (coachID, year, tmID, stint), UNIQUE (coachID, year, tmID, stint), FOREIGN KEY (tmID) REFERENCES teams(tmID), FOREIGN KEY (year) REFERENCES teams(year) ); CREATE TABLE draft ( id INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, draftYear INTEGER, draftRound INTEGER, draftSelection INTEGER, draftOverall INTEGER, tmID TEXT, firstName TEXT, lastName TEXT, suffixName TEXT, playerID TEXT, draftFrom TEXT, lgID TEXT, FOREIGN KEY (tmID) REFERENCES teams(tmID), FOREIGN KEY (draftYear) REFERENCES teams(year) ); CREATE TABLE player_allstar ( playerID TEXT NOT NULL PRIMARY KEY, last_name TEXT, first_name TEXT, season_id INTEGER NOT NULL PRIMARY KEY, conference TEXT, league_id TEXT, games_played INTEGER, minutes INTEGER, points INTEGER, o_rebounds INTEGER, d_rebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, personal_fouls INTEGER, fg_attempted INTEGER, fg_made INTEGER, ft_attempted INTEGER, ft_made INTEGER, three_attempted INTEGER, three_made INTEGER, PRIMARY KEY (playerID, season_id), UNIQUE (playerID, season_id), FOREIGN KEY (playerID) REFERENCES players(playerID) ); CREATE TABLE players ( playerID TEXT NOT NULL PRIMARY KEY, useFirst TEXT, firstName TEXT, middleName TEXT, lastName TEXT, nameGiven TEXT, fullGivenName TEXT, nameSuffix TEXT, nameNick TEXT, pos TEXT, firstseason INTEGER, lastseason INTEGER, height REAL, weight INTEGER, college TEXT, collegeOther TEXT, birthDate DATE, birthCity TEXT, birthState TEXT, birthCountry TEXT, highSchool TEXT, hsCity TEXT, hsState TEXT, hsCountry TEXT, deathDate DATE, race TEXT, UNIQUE (playerID) ); CREATE TABLE teams ( year INTEGER NOT NULL PRIMARY KEY, lgID TEXT, tmID TEXT NOT NULL PRIMARY KEY, franchID TEXT, confID TEXT, divID TEXT, rank INTEGER, confRank INTEGER, playoff TEXT, name TEXT, o_fgm INTEGER, o_ftm INTEGER, o_pts INTEGER, d_pts INTEGER, homeWon INTEGER, homeLost INTEGER, awayWon INTEGER, awayLost INTEGER, won INTEGER, lost INTEGER, games INTEGER, arena TEXT, PRIMARY KEY (year, tmID), UNIQUE (year, tmID) ); CREATE TABLE awards_coaches ( id INTEGER PRIMARY KEY, year INTEGER, coachID TEXT, award TEXT, lgID TEXT, note TEXT, FOREIGN KEY (coachID) REFERENCES coaches(coachID), FOREIGN KEY (year) REFERENCES coaches(year) ); CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE players_teams ( id INTEGER PRIMARY KEY, playerID TEXT NOT NULL, year INTEGER, stint INTEGER, tmID TEXT, lgID TEXT, GP INTEGER, GS INTEGER, minutes INTEGER, points INTEGER, oRebounds INTEGER, dRebounds INTEGER, rebounds INTEGER, assists INTEGER, steals INTEGER, blocks INTEGER, turnovers INTEGER, PF INTEGER, fgAttempted INTEGER, fgMade INTEGER, ftAttempted INTEGER, ftMade INTEGER, threeAttempted INTEGER, threeMade INTEGER, PostGP INTEGER, PostGS INTEGER, PostMinutes INTEGER, PostPoints INTEGER, PostoRebounds INTEGER, PostdRebounds INTEGER, PostRebounds INTEGER, PostAssists INTEGER, PostSteals INTEGER, PostBlocks INTEGER, PostTurnovers INTEGER, PostPF INTEGER, PostfgAttempted INTEGER, PostfgMade INTEGER, PostftAttempted INTEGER, PostftMade INTEGER, PostthreeAttempted INTEGER, PostthreeMade INTEGER, note TEXT, FOREIGN KEY (tmID) REFERENCES teams(tmID), FOREIGN KEY (year) REFERENCES teams(year), FOREIGN KEY (playerID) REFERENCES players(None) ); CREATE TABLE series_post ( id INTEGER PRIMARY KEY, year INTEGER, round TEXT, series TEXT, tmIDWinner TEXT, lgIDWinner TEXT, tmIDLoser TEXT, lgIDLoser TEXT, W INTEGER, L INTEGER, FOREIGN KEY (tmIDLoser) REFERENCES teams(tmID), FOREIGN KEY (year) REFERENCES teams(year), FOREIGN KEY (tmIDWinner) REFERENCES teams(tmID), FOREIGN KEY (year) REFERENCES teams(year) );
movie_3
{"film_text": {"columns": [[0, "film_id", "INTEGER", 1, null, 1], [1, "title", "TEXT", 1, null, 0], [2, "description", "TEXT", 0, null, 0]], "primary_keys": ["film_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "actor": {"columns": [[0, "actor_id", "INTEGER", 0, null, 1], [1, "first_name", "TEXT", 1, null, 0], [2, "last_name", "TEXT", 1, null, 0], [3, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["actor_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "address": {"columns": [[0, "address_id", "INTEGER", 0, null, 1], [1, "address", "TEXT", 1, null, 0], [2, "address2", "TEXT", 0, null, 0], [3, "district", "TEXT", 1, null, 0], [4, "city_id", "INTEGER", 1, null, 0], [5, "postal_code", "TEXT", 0, null, 0], [6, "phone", "TEXT", 1, null, 0], [7, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["address_id"], "foreign_keys": [[0, 0, "city", "city_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "category": {"columns": [[0, "category_id", "INTEGER", 0, null, 1], [1, "name", "TEXT", 1, null, 0], [2, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["category_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "city": {"columns": [[0, "city_id", "INTEGER", 0, null, 1], [1, "city", "TEXT", 1, null, 0], [2, "country_id", "INTEGER", 1, null, 0], [3, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["city_id"], "foreign_keys": [[0, 0, "country", "country_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "country": {"columns": [[0, "country_id", "INTEGER", 0, null, 1], [1, "country", "TEXT", 1, null, 0], [2, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["country_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "customer": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "store_id", "INTEGER", 1, null, 0], [2, "first_name", "TEXT", 1, null, 0], [3, "last_name", "TEXT", 1, null, 0], [4, "email", "TEXT", 0, null, 0], [5, "address_id", "INTEGER", 1, null, 0], [6, "active", "INTEGER", 1, "1", 0], [7, "create_date", "DATETIME", 1, null, 0], [8, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["customer_id"], "foreign_keys": [[0, 0, "address", "address_id", null, "CASCADE", "NO ACTION", "NONE"], [1, 0, "store", "store_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "film": {"columns": [[0, "film_id", "INTEGER", 0, null, 1], [1, "title", "TEXT", 1, null, 0], [2, "description", "TEXT", 0, null, 0], [3, "release_year", "TEXT", 0, null, 0], [4, "language_id", "INTEGER", 1, null, 0], [5, "original_language_id", "INTEGER", 0, null, 0], [6, "rental_duration", "INTEGER", 1, "3", 0], [7, "rental_rate", "REAL", 1, "4.99", 0], [8, "length", "INTEGER", 0, null, 0], [9, "replacement_cost", "REAL", 1, "19.99", 0], [10, "rating", "TEXT", 0, "'G'", 0], [11, "special_features", "TEXT", 0, null, 0], [12, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["film_id"], "foreign_keys": [[0, 0, "language", "original_language_id", null, "CASCADE", "NO ACTION", "NONE"], [1, 0, "language", "language_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "film_actor": {"columns": [[0, "actor_id", "INTEGER", 1, null, 1], [1, "film_id", "INTEGER", 1, null, 2], [2, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["actor_id", "film_id"], "foreign_keys": [[0, 0, "film", "film_id", null, "CASCADE", "NO ACTION", "NONE"], [1, 0, "actor", "actor_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "actor_id"], [1, 1, "film_id"]]], "check_constraints": []}, "film_category": {"columns": [[0, "film_id", "INTEGER", 1, null, 1], [1, "category_id", "INTEGER", 1, null, 2], [2, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["film_id", "category_id"], "foreign_keys": [[0, 0, "category", "category_id", null, "CASCADE", "NO ACTION", "NONE"], [1, 0, "film", "film_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "film_id"], [1, 1, "category_id"]]], "check_constraints": []}, "inventory": {"columns": [[0, "inventory_id", "INTEGER", 0, null, 1], [1, "film_id", "INTEGER", 1, null, 0], [2, "store_id", "INTEGER", 1, null, 0], [3, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["inventory_id"], "foreign_keys": [[0, 0, "store", "store_id", null, "CASCADE", "NO ACTION", "NONE"], [1, 0, "film", "film_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "language": {"columns": [[0, "language_id", "INTEGER", 0, null, 1], [1, "name", "TEXT", 1, null, 0], [2, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["language_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "payment": {"columns": [[0, "payment_id", "INTEGER", 0, null, 1], [1, "customer_id", "INTEGER", 1, null, 0], [2, "staff_id", "INTEGER", 1, null, 0], [3, "rental_id", "INTEGER", 0, null, 0], [4, "amount", "REAL", 1, null, 0], [5, "payment_date", "DATETIME", 1, null, 0], [6, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["payment_id"], "foreign_keys": [[0, 0, "rental", "rental_id", null, "CASCADE", "SET NULL", "NONE"], [1, 0, "staff", "staff_id", null, "CASCADE", "NO ACTION", "NONE"], [2, 0, "customer", "customer_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "rental": {"columns": [[0, "rental_id", "INTEGER", 0, null, 1], [1, "rental_date", "DATETIME", 1, null, 0], [2, "inventory_id", "INTEGER", 1, null, 0], [3, "customer_id", "INTEGER", 1, null, 0], [4, "return_date", "DATETIME", 0, null, 0], [5, "staff_id", "INTEGER", 1, null, 0], [6, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["rental_id"], "foreign_keys": [[0, 0, "staff", "staff_id", null, "CASCADE", "NO ACTION", "NONE"], [1, 0, "customer", "customer_id", null, "CASCADE", "NO ACTION", "NONE"], [2, 0, "inventory", "inventory_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "rental_date"], [1, 2, "inventory_id"], [2, 3, "customer_id"]]], "check_constraints": []}, "staff": {"columns": [[0, "staff_id", "INTEGER", 0, null, 1], [1, "first_name", "TEXT", 1, null, 0], [2, "last_name", "TEXT", 1, null, 0], [3, "address_id", "INTEGER", 1, null, 0], [4, "picture", "BLOB", 0, null, 0], [5, "email", "TEXT", 0, null, 0], [6, "store_id", "INTEGER", 1, null, 0], [7, "active", "INTEGER", 1, "1", 0], [8, "username", "TEXT", 1, null, 0], [9, "password", "TEXT", 0, null, 0], [10, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["staff_id"], "foreign_keys": [[0, 0, "store", "store_id", null, "CASCADE", "NO ACTION", "NONE"], [1, 0, "address", "address_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "store": {"columns": [[0, "store_id", "INTEGER", 0, null, 1], [1, "manager_staff_id", "INTEGER", 1, null, 0], [2, "address_id", "INTEGER", 1, null, 0], [3, "last_update", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["store_id"], "foreign_keys": [[0, 0, "address", "address_id", null, "CASCADE", "NO ACTION", "NONE"], [1, 0, "staff", "manager_staff_id", null, "CASCADE", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "manager_staff_id"]]], "check_constraints": []}}
CREATE TABLE film_text ( film_id INTEGER NOT NULL PRIMARY KEY, title TEXT NOT NULL, description TEXT ); CREATE TABLE actor ( actor_id INTEGER PRIMARY KEY, first_name TEXT NOT NULL, last_name TEXT NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE address ( address_id INTEGER PRIMARY KEY, address TEXT NOT NULL, address2 TEXT, district TEXT NOT NULL, city_id INTEGER NOT NULL, postal_code TEXT, phone TEXT NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (city_id) REFERENCES city(None) ); CREATE TABLE category ( category_id INTEGER PRIMARY KEY, name TEXT NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE city ( city_id INTEGER PRIMARY KEY, city TEXT NOT NULL, country_id INTEGER NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (country_id) REFERENCES country(None) ); CREATE TABLE country ( country_id INTEGER PRIMARY KEY, country TEXT NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE customer ( customer_id INTEGER PRIMARY KEY, store_id INTEGER NOT NULL, first_name TEXT NOT NULL, last_name TEXT NOT NULL, email TEXT, address_id INTEGER NOT NULL, active INTEGER NOT NULL DEFAULT 1, create_date DATETIME NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (address_id) REFERENCES address(None), FOREIGN KEY (store_id) REFERENCES store(None) ); CREATE TABLE film ( film_id INTEGER PRIMARY KEY, title TEXT NOT NULL, description TEXT, release_year TEXT, language_id INTEGER NOT NULL, original_language_id INTEGER, rental_duration INTEGER NOT NULL DEFAULT 3, rental_rate REAL NOT NULL DEFAULT 4.99, length INTEGER, replacement_cost REAL NOT NULL DEFAULT 19.99, rating TEXT DEFAULT 'G', special_features TEXT, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (original_language_id) REFERENCES language(None), FOREIGN KEY (language_id) REFERENCES language(None) ); CREATE TABLE film_actor ( actor_id INTEGER NOT NULL PRIMARY KEY, film_id INTEGER NOT NULL PRIMARY KEY, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (actor_id, film_id), UNIQUE (actor_id, film_id), FOREIGN KEY (film_id) REFERENCES film(None), FOREIGN KEY (actor_id) REFERENCES actor(None) ); CREATE TABLE film_category ( film_id INTEGER NOT NULL PRIMARY KEY, category_id INTEGER NOT NULL PRIMARY KEY, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (film_id, category_id), UNIQUE (film_id, category_id), FOREIGN KEY (category_id) REFERENCES category(None), FOREIGN KEY (film_id) REFERENCES film(None) ); CREATE TABLE inventory ( inventory_id INTEGER PRIMARY KEY, film_id INTEGER NOT NULL, store_id INTEGER NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (store_id) REFERENCES store(None), FOREIGN KEY (film_id) REFERENCES film(None) ); CREATE TABLE language ( language_id INTEGER PRIMARY KEY, name TEXT NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE payment ( payment_id INTEGER PRIMARY KEY, customer_id INTEGER NOT NULL, staff_id INTEGER NOT NULL, rental_id INTEGER, amount REAL NOT NULL, payment_date DATETIME NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (rental_id) REFERENCES rental(None), FOREIGN KEY (staff_id) REFERENCES staff(None), FOREIGN KEY (customer_id) REFERENCES customer(None) ); CREATE TABLE rental ( rental_id INTEGER PRIMARY KEY, rental_date DATETIME NOT NULL, inventory_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, return_date DATETIME, staff_id INTEGER NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rental_date, inventory_id, customer_id), FOREIGN KEY (staff_id) REFERENCES staff(None), FOREIGN KEY (customer_id) REFERENCES customer(None), FOREIGN KEY (inventory_id) REFERENCES inventory(None) ); CREATE TABLE staff ( staff_id INTEGER PRIMARY KEY, first_name TEXT NOT NULL, last_name TEXT NOT NULL, address_id INTEGER NOT NULL, picture BLOB, email TEXT, store_id INTEGER NOT NULL, active INTEGER NOT NULL DEFAULT 1, username TEXT NOT NULL, password TEXT, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (store_id) REFERENCES store(None), FOREIGN KEY (address_id) REFERENCES address(None) ); CREATE TABLE store ( store_id INTEGER PRIMARY KEY, manager_staff_id INTEGER NOT NULL, address_id INTEGER NOT NULL, last_update DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (manager_staff_id), FOREIGN KEY (address_id) REFERENCES address(None), FOREIGN KEY (manager_staff_id) REFERENCES staff(None) );
movie
{"actor": {"columns": [[0, "ActorID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Date of Birth", "DATE", 0, null, 0], [3, "Birth City", "TEXT", 0, null, 0], [4, "Birth Country", "TEXT", 0, null, 0], [5, "Height (Inches)", "INTEGER", 0, null, 0], [6, "Biography", "TEXT", 0, null, 0], [7, "Gender", "TEXT", 0, null, 0], [8, "Ethnicity", "TEXT", 0, null, 0], [9, "NetWorth", "TEXT", 0, null, 0]], "primary_keys": ["ActorID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "movie": {"columns": [[0, "MovieID", "INTEGER", 0, null, 1], [1, "Title", "TEXT", 0, null, 0], [2, "MPAA Rating", "TEXT", 0, null, 0], [3, "Budget", "INTEGER", 0, null, 0], [4, "Gross", "INTEGER", 0, null, 0], [5, "Release Date", "TEXT", 0, null, 0], [6, "Genre", "TEXT", 0, null, 0], [7, "Runtime", "INTEGER", 0, null, 0], [8, "Rating", "REAL", 0, null, 0], [9, "Rating Count", "INTEGER", 0, null, 0], [10, "Summary", "TEXT", 0, null, 0]], "primary_keys": ["MovieID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "characters": {"columns": [[0, "MovieID", "INTEGER", 0, null, 1], [1, "ActorID", "INTEGER", 0, null, 2], [2, "Character Name", "TEXT", 0, null, 0], [3, "creditOrder", "INTEGER", 0, null, 0], [4, "pay", "TEXT", 0, null, 0], [5, "screentime", "TEXT", 0, null, 0]], "primary_keys": ["MovieID", "ActorID"], "foreign_keys": [[0, 0, "movie", "MovieID", "MovieID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "actor", "ActorID", "ActorID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "MovieID"], [1, 1, "ActorID"]]], "check_constraints": []}}
CREATE TABLE actor ( ActorID INTEGER PRIMARY KEY, Name TEXT, Date of Birth DATE, Birth City TEXT, Birth Country TEXT, Height (Inches) INTEGER, Biography TEXT, Gender TEXT, Ethnicity TEXT, NetWorth TEXT ); CREATE TABLE movie ( MovieID INTEGER PRIMARY KEY, Title TEXT, MPAA Rating TEXT, Budget INTEGER, Gross INTEGER, Release Date TEXT, Genre TEXT, Runtime INTEGER, Rating REAL, Rating Count INTEGER, Summary TEXT ); CREATE TABLE characters ( MovieID INTEGER PRIMARY KEY, ActorID INTEGER PRIMARY KEY, Character Name TEXT, creditOrder INTEGER, pay TEXT, screentime TEXT, PRIMARY KEY (MovieID, ActorID), UNIQUE (MovieID, ActorID), FOREIGN KEY (MovieID) REFERENCES movie(MovieID), FOREIGN KEY (ActorID) REFERENCES actor(ActorID) );
law_episode
{"Episode": {"columns": [[0, "episode_id", "TEXT", 0, null, 1], [1, "series", "TEXT", 0, null, 0], [2, "season", "INTEGER", 0, null, 0], [3, "episode", "INTEGER", 0, null, 0], [4, "number_in_series", "INTEGER", 0, null, 0], [5, "title", "TEXT", 0, null, 0], [6, "summary", "TEXT", 0, null, 0], [7, "air_date", "DATE", 0, null, 0], [8, "episode_image", "TEXT", 0, null, 0], [9, "rating", "REAL", 0, null, 0], [10, "votes", "INTEGER", 0, null, 0]], "primary_keys": ["episode_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "episode_id"]]], "check_constraints": []}, "Keyword": {"columns": [[0, "episode_id", "TEXT", 0, null, 1], [1, "keyword", "TEXT", 0, null, 2]], "primary_keys": ["episode_id", "keyword"], "foreign_keys": [[0, 0, "Episode", "episode_id", "episode_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "episode_id"], [1, 1, "keyword"]]], "check_constraints": []}, "Person": {"columns": [[0, "person_id", "TEXT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "birthdate", "DATE", 0, null, 0], [3, "birth_name", "TEXT", 0, null, 0], [4, "birth_place", "TEXT", 0, null, 0], [5, "birth_region", "TEXT", 0, null, 0], [6, "birth_country", "TEXT", 0, null, 0], [7, "height_meters", "REAL", 0, null, 0], [8, "nickname", "TEXT", 0, null, 0]], "primary_keys": ["person_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "person_id"]]], "check_constraints": []}, "Award": {"columns": [[0, "award_id", "INTEGER", 0, null, 1], [1, "organization", "TEXT", 0, null, 0], [2, "year", "INTEGER", 0, null, 0], [3, "award_category", "TEXT", 0, null, 0], [4, "award", "TEXT", 0, null, 0], [5, "series", "TEXT", 0, null, 0], [6, "episode_id", "TEXT", 0, null, 0], [7, "person_id", "TEXT", 0, null, 0], [8, "role", "TEXT", 0, null, 0], [9, "result", "TEXT", 0, null, 0]], "primary_keys": ["award_id"], "foreign_keys": [[0, 0, "Person", "person_id", "person_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Episode", "episode_id", "episode_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Credit": {"columns": [[0, "episode_id", "TEXT", 0, null, 1], [1, "person_id", "TEXT", 0, null, 2], [2, "category", "TEXT", 0, null, 0], [3, "role", "TEXT", 0, null, 0], [4, "credited", "TEXT", 0, null, 0]], "primary_keys": ["episode_id", "person_id"], "foreign_keys": [[0, 0, "Person", "person_id", "person_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Episode", "episode_id", "episode_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "episode_id"], [1, 1, "person_id"]]], "check_constraints": []}, "Vote": {"columns": [[0, "episode_id", "TEXT", 0, null, 0], [1, "stars", "INTEGER", 0, null, 0], [2, "votes", "INTEGER", 0, null, 0], [3, "percent", "REAL", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Episode", "episode_id", "episode_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Episode ( episode_id TEXT PRIMARY KEY, series TEXT, season INTEGER, episode INTEGER, number_in_series INTEGER, title TEXT, summary TEXT, air_date DATE, episode_image TEXT, rating REAL, votes INTEGER, UNIQUE (episode_id) ); CREATE TABLE Keyword ( episode_id TEXT PRIMARY KEY, keyword TEXT PRIMARY KEY, PRIMARY KEY (episode_id, keyword), UNIQUE (episode_id, keyword), FOREIGN KEY (episode_id) REFERENCES Episode(episode_id) ); CREATE TABLE Person ( person_id TEXT PRIMARY KEY, name TEXT, birthdate DATE, birth_name TEXT, birth_place TEXT, birth_region TEXT, birth_country TEXT, height_meters REAL, nickname TEXT, UNIQUE (person_id) ); CREATE TABLE Award ( award_id INTEGER PRIMARY KEY, organization TEXT, year INTEGER, award_category TEXT, award TEXT, series TEXT, episode_id TEXT, person_id TEXT, role TEXT, result TEXT, FOREIGN KEY (person_id) REFERENCES Person(person_id), FOREIGN KEY (episode_id) REFERENCES Episode(episode_id) ); CREATE TABLE Credit ( episode_id TEXT PRIMARY KEY, person_id TEXT PRIMARY KEY, category TEXT, role TEXT, credited TEXT, PRIMARY KEY (episode_id, person_id), UNIQUE (episode_id, person_id), FOREIGN KEY (person_id) REFERENCES Person(person_id), FOREIGN KEY (episode_id) REFERENCES Episode(episode_id) ); CREATE TABLE Vote ( episode_id TEXT, stars INTEGER, votes INTEGER, percent REAL, FOREIGN KEY (episode_id) REFERENCES Episode(episode_id) );
public_review_platform
{"Attributes": {"columns": [[0, "attribute_id", "INTEGER", 0, null, 1], [1, "attribute_name", "TEXT", 0, null, 0]], "primary_keys": ["attribute_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Categories": {"columns": [[0, "category_id", "INTEGER", 0, null, 1], [1, "category_name", "TEXT", 0, null, 0]], "primary_keys": ["category_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Compliments": {"columns": [[0, "compliment_id", "INTEGER", 0, null, 1], [1, "compliment_type", "TEXT", 0, null, 0]], "primary_keys": ["compliment_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Days": {"columns": [[0, "day_id", "INTEGER", 0, null, 1], [1, "day_of_week", "TEXT", 0, null, 0]], "primary_keys": ["day_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Years": {"columns": [[0, "year_id", "INTEGER", 0, null, 1], [1, "actual_year", "INTEGER", 0, null, 0]], "primary_keys": ["year_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Business_Attributes": {"columns": [[0, "attribute_id", "INTEGER", 0, null, 1], [1, "business_id", "INTEGER", 0, null, 2], [2, "attribute_value", "TEXT", 0, null, 0]], "primary_keys": ["attribute_id", "business_id"], "foreign_keys": [[0, 0, "Business", "business_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Attributes", "attribute_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "attribute_id"], [1, 1, "business_id"]]], "check_constraints": []}, "Business_Categories": {"columns": [[0, "business_id", "INTEGER", 0, null, 1], [1, "category_id", "INTEGER", 0, null, 2]], "primary_keys": ["business_id", "category_id"], "foreign_keys": [[0, 0, "Categories", "category_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Business", "business_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "business_id"], [1, 1, "category_id"]]], "check_constraints": []}, "Business_Hours": {"columns": [[0, "business_id", "INTEGER", 0, null, 1], [1, "day_id", "INTEGER", 0, null, 2], [2, "opening_time", "TEXT", 0, null, 0], [3, "closing_time", "TEXT", 0, null, 0]], "primary_keys": ["business_id", "day_id"], "foreign_keys": [[0, 0, "Days", "day_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Business", "business_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "business_id"], [1, 1, "day_id"]]], "check_constraints": []}, "Checkins": {"columns": [[0, "business_id", "INTEGER", 0, null, 1], [1, "day_id", "INTEGER", 0, null, 2], [2, "label_time_0", "TEXT", 0, null, 0], [3, "label_time_1", "TEXT", 0, null, 0], [4, "label_time_2", "TEXT", 0, null, 0], [5, "label_time_3", "TEXT", 0, null, 0], [6, "label_time_4", "TEXT", 0, null, 0], [7, "label_time_5", "TEXT", 0, null, 0], [8, "label_time_6", "TEXT", 0, null, 0], [9, "label_time_7", "TEXT", 0, null, 0], [10, "label_time_8", "TEXT", 0, null, 0], [11, "label_time_9", "TEXT", 0, null, 0], [12, "label_time_10", "TEXT", 0, null, 0], [13, "label_time_11", "TEXT", 0, null, 0], [14, "label_time_12", "TEXT", 0, null, 0], [15, "label_time_13", "TEXT", 0, null, 0], [16, "label_time_14", "TEXT", 0, null, 0], [17, "label_time_15", "TEXT", 0, null, 0], [18, "label_time_16", "TEXT", 0, null, 0], [19, "label_time_17", "TEXT", 0, null, 0], [20, "label_time_18", "TEXT", 0, null, 0], [21, "label_time_19", "TEXT", 0, null, 0], [22, "label_time_20", "TEXT", 0, null, 0], [23, "label_time_21", "TEXT", 0, null, 0], [24, "label_time_22", "TEXT", 0, null, 0], [25, "label_time_23", "TEXT", 0, null, 0]], "primary_keys": ["business_id", "day_id"], "foreign_keys": [[0, 0, "Days", "day_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Business", "business_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "business_id"], [1, 1, "day_id"]]], "check_constraints": ["CREATE TABLE \"Checkins\"", "constraint Checkins_Business_business_id_fk", "constraint Checkins_Days_day_id_fk", "constraint Checkins_pk"]}, "Elite": {"columns": [[0, "user_id", "INTEGER", 0, null, 1], [1, "year_id", "INTEGER", 0, null, 2]], "primary_keys": ["user_id", "year_id"], "foreign_keys": [[0, 0, "Years", "year_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Users", "user_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "user_id"], [1, 1, "year_id"]]], "check_constraints": []}, "Reviews": {"columns": [[0, "business_id", "INTEGER", 0, null, 1], [1, "user_id", "INTEGER", 0, null, 2], [2, "review_stars", "INTEGER", 0, null, 0], [3, "review_votes_funny", "TEXT", 0, null, 0], [4, "review_votes_useful", "TEXT", 0, null, 0], [5, "review_votes_cool", "TEXT", 0, null, 0], [6, "review_length", "TEXT", 0, null, 0]], "primary_keys": ["business_id", "user_id"], "foreign_keys": [[0, 0, "Users", "user_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Business", "business_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "business_id"], [1, 1, "user_id"]]], "check_constraints": []}, "Tips": {"columns": [[0, "business_id", "INTEGER", 0, null, 1], [1, "user_id", "INTEGER", 0, null, 2], [2, "likes", "INTEGER", 0, null, 0], [3, "tip_length", "TEXT", 0, null, 0]], "primary_keys": ["business_id", "user_id"], "foreign_keys": [[0, 0, "Users", "user_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Business", "business_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "business_id"], [1, 1, "user_id"]]], "check_constraints": []}, "Users_Compliments": {"columns": [[0, "compliment_id", "INTEGER", 0, null, 1], [1, "user_id", "INTEGER", 0, null, 2], [2, "number_of_compliments", "TEXT", 0, null, 0]], "primary_keys": ["compliment_id", "user_id"], "foreign_keys": [[0, 0, "Users", "user_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Compliments", "compliment_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "compliment_id"], [1, 1, "user_id"]]], "check_constraints": []}, "Business": {"columns": [[0, "business_id", "INTEGER", 0, null, 1], [1, "active", "TEXT", 0, null, 0], [2, "city", "TEXT", 0, null, 0], [3, "state", "TEXT", 0, null, 0], [4, "stars", "REAL", 0, null, 0], [5, "review_count", "TEXT", 0, null, 0]], "primary_keys": ["business_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Users": {"columns": [[0, "user_id", "INTEGER", 0, null, 1], [1, "user_yelping_since_year", "INTEGER", 0, null, 0], [2, "user_average_stars", "TEXT", 0, null, 0], [3, "user_votes_funny", "TEXT", 0, null, 0], [4, "user_votes_useful", "TEXT", 0, null, 0], [5, "user_votes_cool", "TEXT", 0, null, 0], [6, "user_review_count", "TEXT", 0, null, 0], [7, "user_fans", "TEXT", 0, null, 0]], "primary_keys": ["user_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Attributes ( attribute_id INTEGER PRIMARY KEY, attribute_name TEXT ); CREATE TABLE Categories ( category_id INTEGER PRIMARY KEY, category_name TEXT ); CREATE TABLE Compliments ( compliment_id INTEGER PRIMARY KEY, compliment_type TEXT ); CREATE TABLE Days ( day_id INTEGER PRIMARY KEY, day_of_week TEXT ); CREATE TABLE Years ( year_id INTEGER PRIMARY KEY, actual_year INTEGER ); CREATE TABLE Business_Attributes ( attribute_id INTEGER PRIMARY KEY, business_id INTEGER PRIMARY KEY, attribute_value TEXT, PRIMARY KEY (attribute_id, business_id), UNIQUE (attribute_id, business_id), FOREIGN KEY (business_id) REFERENCES Business(None), FOREIGN KEY (attribute_id) REFERENCES Attributes(None) ); CREATE TABLE Business_Categories ( business_id INTEGER PRIMARY KEY, category_id INTEGER PRIMARY KEY, PRIMARY KEY (business_id, category_id), UNIQUE (business_id, category_id), FOREIGN KEY (category_id) REFERENCES Categories(None), FOREIGN KEY (business_id) REFERENCES Business(None) ); CREATE TABLE Business_Hours ( business_id INTEGER PRIMARY KEY, day_id INTEGER PRIMARY KEY, opening_time TEXT, closing_time TEXT, PRIMARY KEY (business_id, day_id), UNIQUE (business_id, day_id), FOREIGN KEY (day_id) REFERENCES Days(None), FOREIGN KEY (business_id) REFERENCES Business(None) ); CREATE TABLE Checkins ( business_id INTEGER PRIMARY KEY, day_id INTEGER PRIMARY KEY, label_time_0 TEXT, label_time_1 TEXT, label_time_2 TEXT, label_time_3 TEXT, label_time_4 TEXT, label_time_5 TEXT, label_time_6 TEXT, label_time_7 TEXT, label_time_8 TEXT, label_time_9 TEXT, label_time_10 TEXT, label_time_11 TEXT, label_time_12 TEXT, label_time_13 TEXT, label_time_14 TEXT, label_time_15 TEXT, label_time_16 TEXT, label_time_17 TEXT, label_time_18 TEXT, label_time_19 TEXT, label_time_20 TEXT, label_time_21 TEXT, label_time_22 TEXT, label_time_23 TEXT, PRIMARY KEY (business_id, day_id), UNIQUE (business_id, day_id), FOREIGN KEY (day_id) REFERENCES Days(None), FOREIGN KEY (business_id) REFERENCES Business(None), CREATE TABLE "Checkins", constraint Checkins_Business_business_id_fk, constraint Checkins_Days_day_id_fk, constraint Checkins_pk ); CREATE TABLE Elite ( user_id INTEGER PRIMARY KEY, year_id INTEGER PRIMARY KEY, PRIMARY KEY (user_id, year_id), UNIQUE (user_id, year_id), FOREIGN KEY (year_id) REFERENCES Years(None), FOREIGN KEY (user_id) REFERENCES Users(None) ); CREATE TABLE Reviews ( business_id INTEGER PRIMARY KEY, user_id INTEGER PRIMARY KEY, review_stars INTEGER, review_votes_funny TEXT, review_votes_useful TEXT, review_votes_cool TEXT, review_length TEXT, PRIMARY KEY (business_id, user_id), UNIQUE (business_id, user_id), FOREIGN KEY (user_id) REFERENCES Users(None), FOREIGN KEY (business_id) REFERENCES Business(None) ); CREATE TABLE Tips ( business_id INTEGER PRIMARY KEY, user_id INTEGER PRIMARY KEY, likes INTEGER, tip_length TEXT, PRIMARY KEY (business_id, user_id), UNIQUE (business_id, user_id), FOREIGN KEY (user_id) REFERENCES Users(None), FOREIGN KEY (business_id) REFERENCES Business(None) ); CREATE TABLE Users_Compliments ( compliment_id INTEGER PRIMARY KEY, user_id INTEGER PRIMARY KEY, number_of_compliments TEXT, PRIMARY KEY (compliment_id, user_id), UNIQUE (compliment_id, user_id), FOREIGN KEY (user_id) REFERENCES Users(None), FOREIGN KEY (compliment_id) REFERENCES Compliments(None) ); CREATE TABLE Business ( business_id INTEGER PRIMARY KEY, active TEXT, city TEXT, state TEXT, stars REAL, review_count TEXT ); CREATE TABLE Users ( user_id INTEGER PRIMARY KEY, user_yelping_since_year INTEGER, user_average_stars TEXT, user_votes_funny TEXT, user_votes_useful TEXT, user_votes_cool TEXT, user_review_count TEXT, user_fans TEXT );
books
{"address_status": {"columns": [[0, "status_id", "INTEGER", 0, null, 1], [1, "address_status", "TEXT", 0, null, 0]], "primary_keys": ["status_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "author": {"columns": [[0, "author_id", "INTEGER", 0, null, 1], [1, "author_name", "TEXT", 0, null, 0]], "primary_keys": ["author_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "book_language": {"columns": [[0, "language_id", "INTEGER", 0, null, 1], [1, "language_code", "TEXT", 0, null, 0], [2, "language_name", "TEXT", 0, null, 0]], "primary_keys": ["language_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "country": {"columns": [[0, "country_id", "INTEGER", 0, null, 1], [1, "country_name", "TEXT", 0, null, 0]], "primary_keys": ["country_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "address": {"columns": [[0, "address_id", "INTEGER", 0, null, 1], [1, "street_number", "TEXT", 0, null, 0], [2, "street_name", "TEXT", 0, null, 0], [3, "city", "TEXT", 0, null, 0], [4, "country_id", "INTEGER", 0, null, 0]], "primary_keys": ["address_id"], "foreign_keys": [[0, 0, "country", "country_id", "country_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "customer": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "first_name", "TEXT", 0, null, 0], [2, "last_name", "TEXT", 0, null, 0], [3, "email", "TEXT", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "customer_address": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "address_id", "INTEGER", 0, null, 2], [2, "status_id", "INTEGER", 0, null, 0]], "primary_keys": ["customer_id", "address_id"], "foreign_keys": [[0, 0, "customer", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "address", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "customer_id"], [1, 1, "address_id"]]], "check_constraints": []}, "order_status": {"columns": [[0, "status_id", "INTEGER", 0, null, 1], [1, "status_value", "TEXT", 0, null, 0]], "primary_keys": ["status_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "publisher": {"columns": [[0, "publisher_id", "INTEGER", 0, null, 1], [1, "publisher_name", "TEXT", 0, null, 0]], "primary_keys": ["publisher_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "book": {"columns": [[0, "book_id", "INTEGER", 0, null, 1], [1, "title", "TEXT", 0, null, 0], [2, "isbn13", "TEXT", 0, null, 0], [3, "language_id", "INTEGER", 0, null, 0], [4, "num_pages", "INTEGER", 0, null, 0], [5, "publication_date", "DATE", 0, null, 0], [6, "publisher_id", "INTEGER", 0, null, 0]], "primary_keys": ["book_id"], "foreign_keys": [[0, 0, "publisher", "publisher_id", "publisher_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "book_language", "language_id", "language_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "book_author": {"columns": [[0, "book_id", "INTEGER", 0, null, 1], [1, "author_id", "INTEGER", 0, null, 2]], "primary_keys": ["book_id", "author_id"], "foreign_keys": [[0, 0, "book", "book_id", "book_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "author", "author_id", "author_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "book_id"], [1, 1, "author_id"]]], "check_constraints": []}, "shipping_method": {"columns": [[0, "method_id", "INTEGER", 0, null, 1], [1, "method_name", "TEXT", 0, null, 0], [2, "cost", "REAL", 0, null, 0]], "primary_keys": ["method_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "cust_order": {"columns": [[0, "order_id", "INTEGER", 0, null, 1], [1, "order_date", "DATETIME", 0, null, 0], [2, "customer_id", "INTEGER", 0, null, 0], [3, "shipping_method_id", "INTEGER", 0, null, 0], [4, "dest_address_id", "INTEGER", 0, null, 0]], "primary_keys": ["order_id"], "foreign_keys": [[0, 0, "address", "dest_address_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "shipping_method", "shipping_method_id", null, "NO ACTION", "NO ACTION", "NONE"], [2, 0, "customer", "customer_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "order_history": {"columns": [[0, "history_id", "INTEGER", 0, null, 1], [1, "order_id", "INTEGER", 0, null, 0], [2, "status_id", "INTEGER", 0, null, 0], [3, "status_date", "DATETIME", 0, null, 0]], "primary_keys": ["history_id"], "foreign_keys": [[0, 0, "order_status", "status_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "cust_order", "order_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "order_line": {"columns": [[0, "line_id", "INTEGER", 0, null, 1], [1, "order_id", "INTEGER", 0, null, 0], [2, "book_id", "INTEGER", 0, null, 0], [3, "price", "REAL", 0, null, 0]], "primary_keys": ["line_id"], "foreign_keys": [[0, 0, "book", "book_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "cust_order", "order_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE address_status ( status_id INTEGER PRIMARY KEY, address_status TEXT ); CREATE TABLE author ( author_id INTEGER PRIMARY KEY, author_name TEXT ); CREATE TABLE book_language ( language_id INTEGER PRIMARY KEY, language_code TEXT, language_name TEXT ); CREATE TABLE country ( country_id INTEGER PRIMARY KEY, country_name TEXT ); CREATE TABLE address ( address_id INTEGER PRIMARY KEY, street_number TEXT, street_name TEXT, city TEXT, country_id INTEGER, FOREIGN KEY (country_id) REFERENCES country(country_id) ); CREATE TABLE customer ( customer_id INTEGER PRIMARY KEY, first_name TEXT, last_name TEXT, email TEXT ); CREATE TABLE customer_address ( customer_id INTEGER PRIMARY KEY, address_id INTEGER PRIMARY KEY, status_id INTEGER, PRIMARY KEY (customer_id, address_id), UNIQUE (customer_id, address_id), FOREIGN KEY (customer_id) REFERENCES customer(customer_id), FOREIGN KEY (address_id) REFERENCES address(address_id) ); CREATE TABLE order_status ( status_id INTEGER PRIMARY KEY, status_value TEXT ); CREATE TABLE publisher ( publisher_id INTEGER PRIMARY KEY, publisher_name TEXT ); CREATE TABLE book ( book_id INTEGER PRIMARY KEY, title TEXT, isbn13 TEXT, language_id INTEGER, num_pages INTEGER, publication_date DATE, publisher_id INTEGER, FOREIGN KEY (publisher_id) REFERENCES publisher(publisher_id), FOREIGN KEY (language_id) REFERENCES book_language(language_id) ); CREATE TABLE book_author ( book_id INTEGER PRIMARY KEY, author_id INTEGER PRIMARY KEY, PRIMARY KEY (book_id, author_id), UNIQUE (book_id, author_id), FOREIGN KEY (book_id) REFERENCES book(book_id), FOREIGN KEY (author_id) REFERENCES author(author_id) ); CREATE TABLE shipping_method ( method_id INTEGER PRIMARY KEY, method_name TEXT, cost REAL ); CREATE TABLE cust_order ( order_id INTEGER PRIMARY KEY, order_date DATETIME, customer_id INTEGER, shipping_method_id INTEGER, dest_address_id INTEGER, FOREIGN KEY (dest_address_id) REFERENCES address(None), FOREIGN KEY (shipping_method_id) REFERENCES shipping_method(None), FOREIGN KEY (customer_id) REFERENCES customer(None) ); CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE order_history ( history_id INTEGER PRIMARY KEY, order_id INTEGER, status_id INTEGER, status_date DATETIME, FOREIGN KEY (status_id) REFERENCES order_status(None), FOREIGN KEY (order_id) REFERENCES cust_order(None) ); CREATE TABLE order_line ( line_id INTEGER PRIMARY KEY, order_id INTEGER, book_id INTEGER, price REAL, FOREIGN KEY (book_id) REFERENCES book(None), FOREIGN KEY (order_id) REFERENCES cust_order(None) );
ice_hockey_draft
{"height_info": {"columns": [[0, "height_id", "INTEGER", 0, null, 1], [1, "height_in_cm", "INTEGER", 0, null, 0], [2, "height_in_inch", "TEXT", 0, null, 0]], "primary_keys": ["height_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "weight_info": {"columns": [[0, "weight_id", "INTEGER", 0, null, 1], [1, "weight_in_kg", "INTEGER", 0, null, 0], [2, "weight_in_lbs", "INTEGER", 0, null, 0]], "primary_keys": ["weight_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "PlayerInfo": {"columns": [[0, "ELITEID", "INTEGER", 0, null, 1], [1, "PlayerName", "TEXT", 0, null, 0], [2, "birthdate", "TEXT", 0, null, 0], [3, "birthyear", "DATE", 0, null, 0], [4, "birthmonth", "INTEGER", 0, null, 0], [5, "birthday", "INTEGER", 0, null, 0], [6, "birthplace", "TEXT", 0, null, 0], [7, "nation", "TEXT", 0, null, 0], [8, "height", "INTEGER", 0, null, 0], [9, "weight", "INTEGER", 0, null, 0], [10, "position_info", "TEXT", 0, null, 0], [11, "shoots", "TEXT", 0, null, 0], [12, "draftyear", "INTEGER", 0, null, 0], [13, "draftround", "INTEGER", 0, null, 0], [14, "overall", "INTEGER", 0, null, 0], [15, "overallby", "TEXT", 0, null, 0], [16, "CSS_rank", "INTEGER", 0, null, 0], [17, "sum_7yr_GP", "INTEGER", 0, null, 0], [18, "sum_7yr_TOI", "INTEGER", 0, null, 0], [19, "GP_greater_than_0", "TEXT", 0, null, 0]], "primary_keys": ["ELITEID"], "foreign_keys": [[0, 0, "weight_info", "weight", "weight_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "height_info", "height", "height_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "SeasonStatus": {"columns": [[0, "ELITEID", "INTEGER", 0, null, 0], [1, "SEASON", "TEXT", 0, null, 0], [2, "TEAM", "TEXT", 0, null, 0], [3, "LEAGUE", "TEXT", 0, null, 0], [4, "GAMETYPE", "TEXT", 0, null, 0], [5, "GP", "INTEGER", 0, null, 0], [6, "G", "INTEGER", 0, null, 0], [7, "A", "INTEGER", 0, null, 0], [8, "P", "INTEGER", 0, null, 0], [9, "PIM", "INTEGER", 0, null, 0], [10, "PLUSMINUS", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "PlayerInfo", "ELITEID", "ELITEID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE height_info ( height_id INTEGER PRIMARY KEY, height_in_cm INTEGER, height_in_inch TEXT ); CREATE TABLE weight_info ( weight_id INTEGER PRIMARY KEY, weight_in_kg INTEGER, weight_in_lbs INTEGER ); CREATE TABLE PlayerInfo ( ELITEID INTEGER PRIMARY KEY, PlayerName TEXT, birthdate TEXT, birthyear DATE, birthmonth INTEGER, birthday INTEGER, birthplace TEXT, nation TEXT, height INTEGER, weight INTEGER, position_info TEXT, shoots TEXT, draftyear INTEGER, draftround INTEGER, overall INTEGER, overallby TEXT, CSS_rank INTEGER, sum_7yr_GP INTEGER, sum_7yr_TOI INTEGER, GP_greater_than_0 TEXT, FOREIGN KEY (weight) REFERENCES weight_info(weight_id), FOREIGN KEY (height) REFERENCES height_info(height_id) ); CREATE TABLE SeasonStatus ( ELITEID INTEGER, SEASON TEXT, TEAM TEXT, LEAGUE TEXT, GAMETYPE TEXT, GP INTEGER, G INTEGER, A INTEGER, P INTEGER, PIM INTEGER, PLUSMINUS INTEGER, FOREIGN KEY (ELITEID) REFERENCES PlayerInfo(ELITEID) );
european_football_1
{"divisions": {"columns": [[0, "division", "TEXT", 1, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "country", "TEXT", 0, null, 0]], "primary_keys": ["division"], "foreign_keys": [], "unique_constraints": [[[0, 0, "division"]]], "check_constraints": []}, "matchs": {"columns": [[0, "Div", "TEXT", 0, null, 0], [1, "Date", "DATE", 0, null, 0], [2, "HomeTeam", "TEXT", 0, null, 0], [3, "AwayTeam", "TEXT", 0, null, 0], [4, "FTHG", "INTEGER", 0, null, 0], [5, "FTAG", "INTEGER", 0, null, 0], [6, "FTR", "TEXT", 0, null, 0], [7, "season", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "divisions", "Div", "division", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE divisions ( division TEXT NOT NULL PRIMARY KEY, name TEXT, country TEXT, UNIQUE (division) ); CREATE TABLE matchs ( Div TEXT, Date DATE, HomeTeam TEXT, AwayTeam TEXT, FTHG INTEGER, FTAG INTEGER, FTR TEXT, season INTEGER, FOREIGN KEY (Div) REFERENCES divisions(division) );
restaurant
{"geographic": {"columns": [[0, "city", "TEXT", 1, null, 1], [1, "county", "TEXT", 0, null, 0], [2, "region", "TEXT", 0, null, 0]], "primary_keys": ["city"], "foreign_keys": [], "unique_constraints": [[[0, 0, "city"]]], "check_constraints": []}, "generalinfo": {"columns": [[0, "id_restaurant", "INTEGER", 1, null, 1], [1, "label", "TEXT", 0, null, 0], [2, "food_type", "TEXT", 0, null, 0], [3, "city", "TEXT", 0, null, 0], [4, "review", "REAL", 0, null, 0]], "primary_keys": ["id_restaurant"], "foreign_keys": [[0, 0, "geographic", "city", "city", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "location": {"columns": [[0, "id_restaurant", "INTEGER", 1, null, 1], [1, "street_num", "INTEGER", 0, null, 0], [2, "street_name", "TEXT", 0, null, 0], [3, "city", "TEXT", 0, null, 0]], "primary_keys": ["id_restaurant"], "foreign_keys": [[0, 0, "generalinfo", "id_restaurant", "id_restaurant", "CASCADE", "CASCADE", "NONE"], [1, 0, "geographic", "city", "city", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE geographic ( city TEXT NOT NULL PRIMARY KEY, county TEXT, region TEXT, UNIQUE (city) ); CREATE TABLE generalinfo ( id_restaurant INTEGER NOT NULL PRIMARY KEY, label TEXT, food_type TEXT, city TEXT, review REAL, FOREIGN KEY (city) REFERENCES geographic(city) ); CREATE TABLE location ( id_restaurant INTEGER NOT NULL PRIMARY KEY, street_num INTEGER, street_name TEXT, city TEXT, FOREIGN KEY (id_restaurant) REFERENCES generalinfo(id_restaurant), FOREIGN KEY (city) REFERENCES geographic(city) );
citeseer
{"cites": {"columns": [[0, "cited_paper_id", "TEXT", 1, null, 1], [1, "citing_paper_id", "TEXT", 1, null, 2]], "primary_keys": ["cited_paper_id", "citing_paper_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "cited_paper_id"], [1, 1, "citing_paper_id"]]], "check_constraints": []}, "paper": {"columns": [[0, "paper_id", "TEXT", 1, null, 1], [1, "class_label", "TEXT", 1, null, 0]], "primary_keys": ["paper_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "paper_id"]]], "check_constraints": []}, "content": {"columns": [[0, "paper_id", "TEXT", 1, null, 1], [1, "word_cited_id", "TEXT", 1, null, 2]], "primary_keys": ["paper_id", "word_cited_id"], "foreign_keys": [[0, 0, "paper", "paper_id", "paper_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "paper_id"], [1, 1, "word_cited_id"]]], "check_constraints": []}}
CREATE TABLE cites ( cited_paper_id TEXT NOT NULL PRIMARY KEY, citing_paper_id TEXT NOT NULL PRIMARY KEY, PRIMARY KEY (cited_paper_id, citing_paper_id), UNIQUE (cited_paper_id, citing_paper_id) ); CREATE TABLE paper ( paper_id TEXT NOT NULL PRIMARY KEY, class_label TEXT NOT NULL, UNIQUE (paper_id) ); CREATE TABLE content ( paper_id TEXT NOT NULL PRIMARY KEY, word_cited_id TEXT NOT NULL PRIMARY KEY, PRIMARY KEY (paper_id, word_cited_id), UNIQUE (paper_id, word_cited_id), FOREIGN KEY (paper_id) REFERENCES paper(paper_id) );
food_inspection
{"businesses": {"columns": [[0, "business_id", "INTEGER", 1, null, 1], [1, "name", "TEXT", 1, null, 0], [2, "address", "TEXT", 0, "NULL", 0], [3, "city", "TEXT", 0, "NULL", 0], [4, "postal_code", "TEXT", 0, "NULL", 0], [5, "latitude", "REAL", 0, "NULL", 0], [6, "longitude", "REAL", 0, "NULL", 0], [7, "phone_number", "INTEGER", 0, "NULL", 0], [8, "tax_code", "TEXT", 0, "NULL", 0], [9, "business_certificate", "INTEGER", 1, null, 0], [10, "application_date", "DATE", 0, "NULL", 0], [11, "owner_name", "TEXT", 1, null, 0], [12, "owner_address", "TEXT", 0, "NULL", 0], [13, "owner_city", "TEXT", 0, "NULL", 0], [14, "owner_state", "TEXT", 0, "NULL", 0], [15, "owner_zip", "TEXT", 0, "NULL", 0]], "primary_keys": ["business_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "inspections": {"columns": [[0, "business_id", "INTEGER", 1, null, 0], [1, "score", "INTEGER", 0, "NULL", 0], [2, "date", "DATE", 1, null, 0], [3, "type", "TEXT", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "businesses", "business_id", "business_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "violations": {"columns": [[0, "business_id", "INTEGER", 1, null, 0], [1, "date", "DATE", 1, null, 0], [2, "violation_type_id", "TEXT", 1, null, 0], [3, "risk_category", "TEXT", 1, null, 0], [4, "description", "TEXT", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "businesses", "business_id", "business_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE businesses ( business_id INTEGER NOT NULL PRIMARY KEY, name TEXT NOT NULL, address TEXT DEFAULT NULL, city TEXT DEFAULT NULL, postal_code TEXT DEFAULT NULL, latitude REAL DEFAULT NULL, longitude REAL DEFAULT NULL, phone_number INTEGER DEFAULT NULL, tax_code TEXT DEFAULT NULL, business_certificate INTEGER NOT NULL, application_date DATE DEFAULT NULL, owner_name TEXT NOT NULL, owner_address TEXT DEFAULT NULL, owner_city TEXT DEFAULT NULL, owner_state TEXT DEFAULT NULL, owner_zip TEXT DEFAULT NULL ); CREATE TABLE inspections ( business_id INTEGER NOT NULL, score INTEGER DEFAULT NULL, date DATE NOT NULL, type TEXT NOT NULL, FOREIGN KEY (business_id) REFERENCES businesses(business_id) ); CREATE TABLE violations ( business_id INTEGER NOT NULL, date DATE NOT NULL, violation_type_id TEXT NOT NULL, risk_category TEXT NOT NULL, description TEXT NOT NULL, FOREIGN KEY (business_id) REFERENCES businesses(business_id) );
craftbeer
{"breweries": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "city", "TEXT", 0, null, 0], [3, "state", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "beers": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "brewery_id", "INTEGER", 1, null, 0], [2, "abv", "REAL", 0, null, 0], [3, "ibu", "REAL", 0, null, 0], [4, "name", "TEXT", 1, null, 0], [5, "style", "TEXT", 0, null, 0], [6, "ounces", "REAL", 1, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "breweries", "brewery_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE breweries ( id INTEGER NOT NULL PRIMARY KEY, name TEXT, city TEXT, state TEXT ); CREATE TABLE beers ( id INTEGER NOT NULL PRIMARY KEY, brewery_id INTEGER NOT NULL, abv REAL, ibu REAL, name TEXT NOT NULL, style TEXT, ounces REAL NOT NULL, FOREIGN KEY (brewery_id) REFERENCES breweries(None) );
chicago_crime
{"Community_Area": {"columns": [[0, "community_area_no", "INTEGER", 0, null, 1], [1, "community_area_name", "TEXT", 0, null, 0], [2, "side", "TEXT", 0, null, 0], [3, "population", "TEXT", 0, null, 0]], "primary_keys": ["community_area_no"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "District": {"columns": [[0, "district_no", "INTEGER", 0, null, 1], [1, "district_name", "TEXT", 0, null, 0], [2, "address", "TEXT", 0, null, 0], [3, "zip_code", "INTEGER", 0, null, 0], [4, "commander", "TEXT", 0, null, 0], [5, "email", "TEXT", 0, null, 0], [6, "phone", "TEXT", 0, null, 0], [7, "fax", "TEXT", 0, null, 0], [8, "tty", "TEXT", 0, null, 0], [9, "twitter", "TEXT", 0, null, 0]], "primary_keys": ["district_no"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "FBI_Code": {"columns": [[0, "fbi_code_no", "TEXT", 0, null, 1], [1, "title", "TEXT", 0, null, 0], [2, "description", "TEXT", 0, null, 0], [3, "crime_against", "TEXT", 0, null, 0]], "primary_keys": ["fbi_code_no"], "foreign_keys": [], "unique_constraints": [[[0, 0, "fbi_code_no"]]], "check_constraints": []}, "IUCR": {"columns": [[0, "iucr_no", "TEXT", 0, null, 1], [1, "primary_description", "TEXT", 0, null, 0], [2, "secondary_description", "TEXT", 0, null, 0], [3, "index_code", "TEXT", 0, null, 0]], "primary_keys": ["iucr_no"], "foreign_keys": [], "unique_constraints": [[[0, 0, "iucr_no"]]], "check_constraints": []}, "Neighborhood": {"columns": [[0, "neighborhood_name", "TEXT", 0, null, 1], [1, "community_area_no", "INTEGER", 0, null, 0]], "primary_keys": ["neighborhood_name"], "foreign_keys": [[0, 0, "Community_Area", "community_area_no", "community_area_no", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "neighborhood_name"]]], "check_constraints": []}, "Ward": {"columns": [[0, "ward_no", "INTEGER", 0, null, 1], [1, "alderman_first_name", "TEXT", 0, null, 0], [2, "alderman_last_name", "TEXT", 0, null, 0], [3, "alderman_name_suffix", "TEXT", 0, null, 0], [4, "ward_office_address", "TEXT", 0, null, 0], [5, "ward_office_zip", "TEXT", 0, null, 0], [6, "ward_email", "TEXT", 0, null, 0], [7, "ward_office_phone", "TEXT", 0, null, 0], [8, "ward_office_fax", "TEXT", 0, null, 0], [9, "city_hall_office_room", "INTEGER", 0, null, 0], [10, "city_hall_office_phone", "TEXT", 0, null, 0], [11, "city_hall_office_fax", "TEXT", 0, null, 0], [12, "Population", "INTEGER", 0, null, 0]], "primary_keys": ["ward_no"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Crime": {"columns": [[0, "report_no", "INTEGER", 0, null, 1], [1, "case_number", "TEXT", 0, null, 0], [2, "date", "TEXT", 0, null, 0], [3, "block", "TEXT", 0, null, 0], [4, "iucr_no", "TEXT", 0, null, 0], [5, "location_description", "TEXT", 0, null, 0], [6, "arrest", "TEXT", 0, null, 0], [7, "domestic", "TEXT", 0, null, 0], [8, "beat", "INTEGER", 0, null, 0], [9, "district_no", "INTEGER", 0, null, 0], [10, "ward_no", "INTEGER", 0, null, 0], [11, "community_area_no", "INTEGER", 0, null, 0], [12, "fbi_code_no", "TEXT", 0, null, 0], [13, "latitude", "TEXT", 0, null, 0], [14, "longitude", "TEXT", 0, null, 0]], "primary_keys": ["report_no"], "foreign_keys": [[0, 0, "FBI_Code", "fbi_code_no", "fbi_code_no", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Community_Area", "community_area_no", "community_area_no", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "District", "district_no", "district_no", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "IUCR", "iucr_no", "iucr_no", "NO ACTION", "NO ACTION", "NONE"], [4, 0, "Ward", "ward_no", "ward_no", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Community_Area ( community_area_no INTEGER PRIMARY KEY, community_area_name TEXT, side TEXT, population TEXT ); CREATE TABLE District ( district_no INTEGER PRIMARY KEY, district_name TEXT, address TEXT, zip_code INTEGER, commander TEXT, email TEXT, phone TEXT, fax TEXT, tty TEXT, twitter TEXT ); CREATE TABLE FBI_Code ( fbi_code_no TEXT PRIMARY KEY, title TEXT, description TEXT, crime_against TEXT, UNIQUE (fbi_code_no) ); CREATE TABLE IUCR ( iucr_no TEXT PRIMARY KEY, primary_description TEXT, secondary_description TEXT, index_code TEXT, UNIQUE (iucr_no) ); CREATE TABLE Neighborhood ( neighborhood_name TEXT PRIMARY KEY, community_area_no INTEGER, UNIQUE (neighborhood_name), FOREIGN KEY (community_area_no) REFERENCES Community_Area(community_area_no) ); CREATE TABLE Ward ( ward_no INTEGER PRIMARY KEY, alderman_first_name TEXT, alderman_last_name TEXT, alderman_name_suffix TEXT, ward_office_address TEXT, ward_office_zip TEXT, ward_email TEXT, ward_office_phone TEXT, ward_office_fax TEXT, city_hall_office_room INTEGER, city_hall_office_phone TEXT, city_hall_office_fax TEXT, Population INTEGER ); CREATE TABLE Crime ( report_no INTEGER PRIMARY KEY, case_number TEXT, date TEXT, block TEXT, iucr_no TEXT, location_description TEXT, arrest TEXT, domestic TEXT, beat INTEGER, district_no INTEGER, ward_no INTEGER, community_area_no INTEGER, fbi_code_no TEXT, latitude TEXT, longitude TEXT, FOREIGN KEY (fbi_code_no) REFERENCES FBI_Code(fbi_code_no), FOREIGN KEY (community_area_no) REFERENCES Community_Area(community_area_no), FOREIGN KEY (district_no) REFERENCES District(district_no), FOREIGN KEY (iucr_no) REFERENCES IUCR(iucr_no), FOREIGN KEY (ward_no) REFERENCES Ward(ward_no) );
car_retails
{"offices": {"columns": [[0, "officeCode", "TEXT", 1, null, 1], [1, "city", "TEXT", 1, null, 0], [2, "phone", "TEXT", 1, null, 0], [3, "addressLine1", "TEXT", 1, null, 0], [4, "addressLine2", "TEXT", 0, null, 0], [5, "state", "TEXT", 0, null, 0], [6, "country", "TEXT", 1, null, 0], [7, "postalCode", "TEXT", 1, null, 0], [8, "territory", "TEXT", 1, null, 0]], "primary_keys": ["officeCode"], "foreign_keys": [], "unique_constraints": [[[0, 0, "officeCode"]]], "check_constraints": []}, "employees": {"columns": [[0, "employeeNumber", "INTEGER", 1, null, 1], [1, "lastName", "TEXT", 1, null, 0], [2, "firstName", "TEXT", 1, null, 0], [3, "extension", "TEXT", 1, null, 0], [4, "email", "TEXT", 1, null, 0], [5, "officeCode", "TEXT", 1, null, 0], [6, "reportsTo", "INTEGER", 0, null, 0], [7, "jobTitle", "TEXT", 1, null, 0]], "primary_keys": ["employeeNumber"], "foreign_keys": [[0, 0, "employees", "reportsTo", "employeeNumber", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "offices", "officeCode", "officeCode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "customers": {"columns": [[0, "customerNumber", "INTEGER", 1, null, 1], [1, "customerName", "TEXT", 1, null, 0], [2, "contactLastName", "TEXT", 1, null, 0], [3, "contactFirstName", "TEXT", 1, null, 0], [4, "phone", "TEXT", 1, null, 0], [5, "addressLine1", "TEXT", 1, null, 0], [6, "addressLine2", "TEXT", 0, null, 0], [7, "city", "TEXT", 1, null, 0], [8, "state", "TEXT", 0, null, 0], [9, "postalCode", "TEXT", 0, null, 0], [10, "country", "TEXT", 1, null, 0], [11, "salesRepEmployeeNumber", "INTEGER", 0, null, 0], [12, "creditLimit", "REAL", 0, null, 0]], "primary_keys": ["customerNumber"], "foreign_keys": [[0, 0, "employees", "salesRepEmployeeNumber", "employeeNumber", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "orders": {"columns": [[0, "orderNumber", "INTEGER", 1, null, 1], [1, "orderDate", "DATE", 1, null, 0], [2, "requiredDate", "DATE", 1, null, 0], [3, "shippedDate", "DATE", 0, null, 0], [4, "status", "TEXT", 1, null, 0], [5, "comments", "TEXT", 0, null, 0], [6, "customerNumber", "INTEGER", 1, null, 0]], "primary_keys": ["orderNumber"], "foreign_keys": [[0, 0, "customers", "customerNumber", "customerNumber", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "payments": {"columns": [[0, "customerNumber", "INTEGER", 1, null, 1], [1, "checkNumber", "TEXT", 1, null, 2], [2, "paymentDate", "DATE", 1, null, 0], [3, "amount", "REAL", 1, null, 0]], "primary_keys": ["customerNumber", "checkNumber"], "foreign_keys": [[0, 0, "customers", "customerNumber", "customerNumber", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "customerNumber"], [1, 1, "checkNumber"]]], "check_constraints": ["checkNumber TEXT not null,", "primary key (customerNumber, checkNumber),"]}, "productlines": {"columns": [[0, "productLine", "TEXT", 1, null, 1], [1, "textDescription", "TEXT", 0, null, 0], [2, "htmlDescription", "TEXT", 0, null, 0], [3, "image", "BLOB", 0, null, 0]], "primary_keys": ["productLine"], "foreign_keys": [], "unique_constraints": [[[0, 0, "productLine"]]], "check_constraints": []}, "products": {"columns": [[0, "productCode", "TEXT", 1, null, 1], [1, "productName", "TEXT", 1, null, 0], [2, "productLine", "TEXT", 1, null, 0], [3, "productScale", "TEXT", 1, null, 0], [4, "productVendor", "TEXT", 1, null, 0], [5, "productDescription", "TEXT", 1, null, 0], [6, "quantityInStock", "INTEGER", 1, null, 0], [7, "buyPrice", "REAL", 1, null, 0], [8, "MSRP", "REAL", 1, null, 0]], "primary_keys": ["productCode"], "foreign_keys": [[0, 0, "productlines", "productLine", "productLine", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "productCode"]]], "check_constraints": []}, "orderdetails": {"columns": [[0, "orderNumber", "INTEGER", 1, null, 1], [1, "productCode", "TEXT", 1, null, 2], [2, "quantityOrdered", "INTEGER", 1, null, 0], [3, "priceEach", "REAL", 1, null, 0], [4, "orderLineNumber", "INTEGER", 1, null, 0]], "primary_keys": ["orderNumber", "productCode"], "foreign_keys": [[0, 0, "products", "productCode", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "orders", "orderNumber", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "orderNumber"], [1, 1, "productCode"]]], "check_constraints": []}}
CREATE TABLE offices ( officeCode TEXT NOT NULL PRIMARY KEY, city TEXT NOT NULL, phone TEXT NOT NULL, addressLine1 TEXT NOT NULL, addressLine2 TEXT, state TEXT, country TEXT NOT NULL, postalCode TEXT NOT NULL, territory TEXT NOT NULL, UNIQUE (officeCode) ); CREATE TABLE employees ( employeeNumber INTEGER NOT NULL PRIMARY KEY, lastName TEXT NOT NULL, firstName TEXT NOT NULL, extension TEXT NOT NULL, email TEXT NOT NULL, officeCode TEXT NOT NULL, reportsTo INTEGER, jobTitle TEXT NOT NULL, FOREIGN KEY (reportsTo) REFERENCES employees(employeeNumber), FOREIGN KEY (officeCode) REFERENCES offices(officeCode) ); CREATE TABLE customers ( customerNumber INTEGER NOT NULL PRIMARY KEY, customerName TEXT NOT NULL, contactLastName TEXT NOT NULL, contactFirstName TEXT NOT NULL, phone TEXT NOT NULL, addressLine1 TEXT NOT NULL, addressLine2 TEXT, city TEXT NOT NULL, state TEXT, postalCode TEXT, country TEXT NOT NULL, salesRepEmployeeNumber INTEGER, creditLimit REAL, FOREIGN KEY (salesRepEmployeeNumber) REFERENCES employees(employeeNumber) ); CREATE TABLE orders ( orderNumber INTEGER NOT NULL PRIMARY KEY, orderDate DATE NOT NULL, requiredDate DATE NOT NULL, shippedDate DATE, status TEXT NOT NULL, comments TEXT, customerNumber INTEGER NOT NULL, FOREIGN KEY (customerNumber) REFERENCES customers(customerNumber) ); CREATE TABLE payments ( customerNumber INTEGER NOT NULL PRIMARY KEY, checkNumber TEXT NOT NULL PRIMARY KEY, paymentDate DATE NOT NULL, amount REAL NOT NULL, PRIMARY KEY (customerNumber, checkNumber), UNIQUE (customerNumber, checkNumber), FOREIGN KEY (customerNumber) REFERENCES customers(customerNumber), checkNumber TEXT not null,, primary key (customerNumber, checkNumber), ); CREATE TABLE productlines ( productLine TEXT NOT NULL PRIMARY KEY, textDescription TEXT, htmlDescription TEXT, image BLOB, UNIQUE (productLine) ); CREATE TABLE products ( productCode TEXT NOT NULL PRIMARY KEY, productName TEXT NOT NULL, productLine TEXT NOT NULL, productScale TEXT NOT NULL, productVendor TEXT NOT NULL, productDescription TEXT NOT NULL, quantityInStock INTEGER NOT NULL, buyPrice REAL NOT NULL, MSRP REAL NOT NULL, UNIQUE (productCode), FOREIGN KEY (productLine) REFERENCES productlines(productLine) ); CREATE TABLE orderdetails ( orderNumber INTEGER NOT NULL PRIMARY KEY, productCode TEXT NOT NULL PRIMARY KEY, quantityOrdered INTEGER NOT NULL, priceEach REAL NOT NULL, orderLineNumber INTEGER NOT NULL, PRIMARY KEY (orderNumber, productCode), UNIQUE (orderNumber, productCode), FOREIGN KEY (productCode) REFERENCES products(None), FOREIGN KEY (orderNumber) REFERENCES orders(None) );
cars
{"country": {"columns": [[0, "origin", "INTEGER", 0, null, 1], [1, "country", "TEXT", 0, null, 0]], "primary_keys": ["origin"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "price": {"columns": [[0, "ID", "INTEGER", 0, null, 1], [1, "price", "REAL", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "data": {"columns": [[0, "ID", "INTEGER", 0, null, 1], [1, "mpg", "REAL", 0, null, 0], [2, "cylinders", "INTEGER", 0, null, 0], [3, "displacement", "REAL", 0, null, 0], [4, "horsepower", "INTEGER", 0, null, 0], [5, "weight", "INTEGER", 0, null, 0], [6, "acceleration", "REAL", 0, null, 0], [7, "model", "INTEGER", 0, null, 0], [8, "car_name", "TEXT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [[0, 0, "price", "ID", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "production": {"columns": [[0, "ID", "INTEGER", 0, null, 1], [1, "model_year", "INTEGER", 0, null, 2], [2, "country", "INTEGER", 0, null, 0]], "primary_keys": ["ID", "model_year"], "foreign_keys": [[0, 0, "price", "ID", "ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "data", "ID", "ID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "country", "country", "origin", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ID"], [1, 1, "model_year"]]], "check_constraints": []}}
CREATE TABLE country ( origin INTEGER PRIMARY KEY, country TEXT ); CREATE TABLE price ( ID INTEGER PRIMARY KEY, price REAL ); CREATE TABLE data ( ID INTEGER PRIMARY KEY, mpg REAL, cylinders INTEGER, displacement REAL, horsepower INTEGER, weight INTEGER, acceleration REAL, model INTEGER, car_name TEXT, FOREIGN KEY (ID) REFERENCES price(ID) ); CREATE TABLE production ( ID INTEGER PRIMARY KEY, model_year INTEGER PRIMARY KEY, country INTEGER, PRIMARY KEY (ID, model_year), UNIQUE (ID, model_year), FOREIGN KEY (ID) REFERENCES price(ID), FOREIGN KEY (ID) REFERENCES data(ID), FOREIGN KEY (country) REFERENCES country(origin) );
menu
{"Dish": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "description", "TEXT", 0, null, 0], [3, "menus_appeared", "INTEGER", 0, null, 0], [4, "times_appeared", "INTEGER", 0, null, 0], [5, "first_appeared", "INTEGER", 0, null, 0], [6, "last_appeared", "INTEGER", 0, null, 0], [7, "lowest_price", "REAL", 0, null, 0], [8, "highest_price", "REAL", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Menu": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "sponsor", "TEXT", 0, null, 0], [3, "event", "TEXT", 0, null, 0], [4, "venue", "TEXT", 0, null, 0], [5, "place", "TEXT", 0, null, 0], [6, "physical_description", "TEXT", 0, null, 0], [7, "occasion", "TEXT", 0, null, 0], [8, "notes", "TEXT", 0, null, 0], [9, "call_number", "TEXT", 0, null, 0], [10, "keywords", "TEXT", 0, null, 0], [11, "language", "TEXT", 0, null, 0], [12, "date", "DATE", 0, null, 0], [13, "location", "TEXT", 0, null, 0], [14, "location_type", "TEXT", 0, null, 0], [15, "currency", "TEXT", 0, null, 0], [16, "currency_symbol", "TEXT", 0, null, 0], [17, "status", "TEXT", 0, null, 0], [18, "page_count", "INTEGER", 0, null, 0], [19, "dish_count", "INTEGER", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "MenuPage": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "menu_id", "INTEGER", 0, null, 0], [2, "page_number", "INTEGER", 0, null, 0], [3, "image_id", "REAL", 0, null, 0], [4, "full_height", "INTEGER", 0, null, 0], [5, "full_width", "INTEGER", 0, null, 0], [6, "uuid", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "Menu", "menu_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "MenuItem": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "menu_page_id", "INTEGER", 0, null, 0], [2, "price", "REAL", 0, null, 0], [3, "high_price", "REAL", 0, null, 0], [4, "dish_id", "INTEGER", 0, null, 0], [5, "created_at", "TEXT", 0, null, 0], [6, "updated_at", "TEXT", 0, null, 0], [7, "xpos", "REAL", 0, null, 0], [8, "ypos", "REAL", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "MenuPage", "menu_page_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Dish", "dish_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Dish ( id INTEGER PRIMARY KEY, name TEXT, description TEXT, menus_appeared INTEGER, times_appeared INTEGER, first_appeared INTEGER, last_appeared INTEGER, lowest_price REAL, highest_price REAL ); CREATE TABLE Menu ( id INTEGER PRIMARY KEY, name TEXT, sponsor TEXT, event TEXT, venue TEXT, place TEXT, physical_description TEXT, occasion TEXT, notes TEXT, call_number TEXT, keywords TEXT, language TEXT, date DATE, location TEXT, location_type TEXT, currency TEXT, currency_symbol TEXT, status TEXT, page_count INTEGER, dish_count INTEGER ); CREATE TABLE MenuPage ( id INTEGER PRIMARY KEY, menu_id INTEGER, page_number INTEGER, image_id REAL, full_height INTEGER, full_width INTEGER, uuid TEXT, FOREIGN KEY (menu_id) REFERENCES Menu(id) ); CREATE TABLE MenuItem ( id INTEGER PRIMARY KEY, menu_page_id INTEGER, price REAL, high_price REAL, dish_id INTEGER, created_at TEXT, updated_at TEXT, xpos REAL, ypos REAL, FOREIGN KEY (menu_page_id) REFERENCES MenuPage(id), FOREIGN KEY (dish_id) REFERENCES Dish(id) );
video_games
{"genre": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "genre_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "game": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "genre_id", "INTEGER", 0, "NULL", 0], [2, "game_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "genre", "genre_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "platform": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "platform_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "publisher": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "publisher_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "game_publisher": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "game_id", "INTEGER", 0, "NULL", 0], [2, "publisher_id", "INTEGER", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "publisher", "publisher_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "game", "game_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "game_platform": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "game_publisher_id", "INTEGER", 0, "NULL", 0], [2, "platform_id", "INTEGER", 0, "NULL", 0], [3, "release_year", "INTEGER", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "platform", "platform_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "game_publisher", "game_publisher_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "region": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "region_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "region_sales": {"columns": [[0, "region_id", "INTEGER", 0, "NULL", 0], [1, "game_platform_id", "INTEGER", 0, "NULL", 0], [2, "num_sales", "REAL", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "region", "region_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "game_platform", "game_platform_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE genre ( id INTEGER NOT NULL PRIMARY KEY, genre_name TEXT DEFAULT NULL ); CREATE TABLE game ( id INTEGER NOT NULL PRIMARY KEY, genre_id INTEGER DEFAULT NULL, game_name TEXT DEFAULT NULL, FOREIGN KEY (genre_id) REFERENCES genre(id) ); CREATE TABLE platform ( id INTEGER NOT NULL PRIMARY KEY, platform_name TEXT DEFAULT NULL ); CREATE TABLE publisher ( id INTEGER NOT NULL PRIMARY KEY, publisher_name TEXT DEFAULT NULL ); CREATE TABLE game_publisher ( id INTEGER NOT NULL PRIMARY KEY, game_id INTEGER DEFAULT NULL, publisher_id INTEGER DEFAULT NULL, FOREIGN KEY (publisher_id) REFERENCES publisher(id), FOREIGN KEY (game_id) REFERENCES game(id) ); CREATE TABLE game_platform ( id INTEGER NOT NULL PRIMARY KEY, game_publisher_id INTEGER DEFAULT NULL, platform_id INTEGER DEFAULT NULL, release_year INTEGER DEFAULT NULL, FOREIGN KEY (platform_id) REFERENCES platform(id), FOREIGN KEY (game_publisher_id) REFERENCES game_publisher(id) ); CREATE TABLE region ( id INTEGER NOT NULL PRIMARY KEY, region_name TEXT DEFAULT NULL ); CREATE TABLE region_sales ( region_id INTEGER DEFAULT NULL, game_platform_id INTEGER DEFAULT NULL, num_sales REAL DEFAULT NULL, FOREIGN KEY (region_id) REFERENCES region(id), FOREIGN KEY (game_platform_id) REFERENCES game_platform(id) );
cs_semester
{"course": {"columns": [[0, "course_id", "INTEGER", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "credit", "INTEGER", 0, null, 0], [3, "diff", "INTEGER", 0, null, 0]], "primary_keys": ["course_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "prof": {"columns": [[0, "prof_id", "INTEGER", 0, null, 1], [1, "gender", "TEXT", 0, null, 0], [2, "first_name", "TEXT", 0, null, 0], [3, "last_name", "TEXT", 0, null, 0], [4, "email", "TEXT", 0, null, 0], [5, "popularity", "INTEGER", 0, null, 0], [6, "teachingability", "INTEGER", 0, null, 0], [7, "graduate_from", "TEXT", 0, null, 0]], "primary_keys": ["prof_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "RA": {"columns": [[0, "student_id", "INTEGER", 0, null, 1], [1, "capability", "INTEGER", 0, null, 0], [2, "prof_id", "INTEGER", 0, null, 2], [3, "salary", "TEXT", 0, null, 0]], "primary_keys": ["student_id", "prof_id"], "foreign_keys": [[0, 0, "student", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "prof", "prof_id", "prof_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "student_id"], [1, 2, "prof_id"]]], "check_constraints": []}, "registration": {"columns": [[0, "course_id", "INTEGER", 0, null, 1], [1, "student_id", "INTEGER", 0, null, 2], [2, "grade", "TEXT", 0, null, 0], [3, "sat", "INTEGER", 0, null, 0]], "primary_keys": ["course_id", "student_id"], "foreign_keys": [[0, 0, "student", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "course", "course_id", "course_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "course_id"], [1, 1, "student_id"]]], "check_constraints": []}, "student": {"columns": [[0, "student_id", "INTEGER", 0, null, 1], [1, "f_name", "TEXT", 0, null, 0], [2, "l_name", "TEXT", 0, null, 0], [3, "phone_number", "TEXT", 0, null, 0], [4, "email", "TEXT", 0, null, 0], [5, "intelligence", "INTEGER", 0, null, 0], [6, "gpa", "REAL", 0, null, 0], [7, "type", "TEXT", 0, null, 0]], "primary_keys": ["student_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE course ( course_id INTEGER PRIMARY KEY, name TEXT, credit INTEGER, diff INTEGER ); CREATE TABLE prof ( prof_id INTEGER PRIMARY KEY, gender TEXT, first_name TEXT, last_name TEXT, email TEXT, popularity INTEGER, teachingability INTEGER, graduate_from TEXT ); CREATE TABLE RA ( student_id INTEGER PRIMARY KEY, capability INTEGER, prof_id INTEGER PRIMARY KEY, salary TEXT, PRIMARY KEY (student_id, prof_id), UNIQUE (student_id, prof_id), FOREIGN KEY (student_id) REFERENCES student(student_id), FOREIGN KEY (prof_id) REFERENCES prof(prof_id) ); CREATE TABLE registration ( course_id INTEGER PRIMARY KEY, student_id INTEGER PRIMARY KEY, grade TEXT, sat INTEGER, PRIMARY KEY (course_id, student_id), UNIQUE (course_id, student_id), FOREIGN KEY (student_id) REFERENCES student(student_id), FOREIGN KEY (course_id) REFERENCES course(course_id) ); CREATE TABLE student ( student_id INTEGER PRIMARY KEY, f_name TEXT, l_name TEXT, phone_number TEXT, email TEXT, intelligence INTEGER, gpa REAL, type TEXT );
movie_platform
{"lists": {"columns": [[0, "user_id", "INTEGER", 0, null, 0], [1, "list_id", "INTEGER", 1, null, 1], [2, "list_title", "TEXT", 0, null, 0], [3, "list_movie_number", "INTEGER", 0, null, 0], [4, "list_update_timestamp_utc", "TEXT", 0, null, 0], [5, "list_creation_timestamp_utc", "TEXT", 0, null, 0], [6, "list_followers", "INTEGER", 0, null, 0], [7, "list_url", "TEXT", 0, null, 0], [8, "list_comments", "INTEGER", 0, null, 0], [9, "list_description", "TEXT", 0, null, 0], [10, "list_cover_image_url", "TEXT", 0, null, 0], [11, "list_first_image_url", "TEXT", 0, null, 0], [12, "list_second_image_url", "TEXT", 0, null, 0], [13, "list_third_image_url", "TEXT", 0, null, 0]], "primary_keys": ["list_id"], "foreign_keys": [[0, 0, "lists_users", "user_id", "user_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "movies": {"columns": [[0, "movie_id", "INTEGER", 1, null, 1], [1, "movie_title", "TEXT", 0, null, 0], [2, "movie_release_year", "INTEGER", 0, null, 0], [3, "movie_url", "TEXT", 0, null, 0], [4, "movie_title_language", "TEXT", 0, null, 0], [5, "movie_popularity", "INTEGER", 0, null, 0], [6, "movie_image_url", "TEXT", 0, null, 0], [7, "director_id", "TEXT", 0, null, 0], [8, "director_name", "TEXT", 0, null, 0], [9, "director_url", "TEXT", 0, null, 0]], "primary_keys": ["movie_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "ratings_users": {"columns": [[0, "user_id", "INTEGER", 0, null, 0], [1, "rating_date_utc", "TEXT", 0, null, 0], [2, "user_trialist", "INTEGER", 0, null, 0], [3, "user_subscriber", "INTEGER", 0, null, 0], [4, "user_avatar_image_url", "TEXT", 0, null, 0], [5, "user_cover_image_url", "TEXT", 0, null, 0], [6, "user_eligible_for_trial", "INTEGER", 0, null, 0], [7, "user_has_payment_method", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "lists_users", "user_id", "user_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "lists_users": {"columns": [[0, "user_id", "INTEGER", 1, null, 1], [1, "list_id", "INTEGER", 1, null, 2], [2, "list_update_date_utc", "TEXT", 0, null, 0], [3, "list_creation_date_utc", "TEXT", 0, null, 0], [4, "user_trialist", "INTEGER", 0, null, 0], [5, "user_subscriber", "INTEGER", 0, null, 0], [6, "user_avatar_image_url", "TEXT", 0, null, 0], [7, "user_cover_image_url", "TEXT", 0, null, 0], [8, "user_eligible_for_trial", "TEXT", 0, null, 0], [9, "user_has_payment_method", "TEXT", 0, null, 0]], "primary_keys": ["user_id", "list_id"], "foreign_keys": [[0, 0, "lists", "user_id", "user_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "lists", "list_id", "list_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "user_id"], [1, 1, "list_id"]]], "check_constraints": []}, "ratings": {"columns": [[0, "movie_id", "INTEGER", 0, null, 0], [1, "rating_id", "INTEGER", 0, null, 0], [2, "rating_url", "TEXT", 0, null, 0], [3, "rating_score", "INTEGER", 0, null, 0], [4, "rating_timestamp_utc", "TEXT", 0, null, 0], [5, "critic", "TEXT", 0, null, 0], [6, "critic_likes", "INTEGER", 0, null, 0], [7, "critic_comments", "INTEGER", 0, null, 0], [8, "user_id", "INTEGER", 0, null, 0], [9, "user_trialist", "INTEGER", 0, null, 0], [10, "user_subscriber", "INTEGER", 0, null, 0], [11, "user_eligible_for_trial", "INTEGER", 0, null, 0], [12, "user_has_payment_method", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "ratings_users", "user_id", "user_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "ratings", "rating_id", "rating_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "lists_users", "user_id", "user_id", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "movies", "movie_id", "movie_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE lists ( user_id INTEGER, list_id INTEGER NOT NULL PRIMARY KEY, list_title TEXT, list_movie_number INTEGER, list_update_timestamp_utc TEXT, list_creation_timestamp_utc TEXT, list_followers INTEGER, list_url TEXT, list_comments INTEGER, list_description TEXT, list_cover_image_url TEXT, list_first_image_url TEXT, list_second_image_url TEXT, list_third_image_url TEXT, FOREIGN KEY (user_id) REFERENCES lists_users(user_id) ); CREATE TABLE movies ( movie_id INTEGER NOT NULL PRIMARY KEY, movie_title TEXT, movie_release_year INTEGER, movie_url TEXT, movie_title_language TEXT, movie_popularity INTEGER, movie_image_url TEXT, director_id TEXT, director_name TEXT, director_url TEXT ); CREATE TABLE ratings_users ( user_id INTEGER, rating_date_utc TEXT, user_trialist INTEGER, user_subscriber INTEGER, user_avatar_image_url TEXT, user_cover_image_url TEXT, user_eligible_for_trial INTEGER, user_has_payment_method INTEGER, FOREIGN KEY (user_id) REFERENCES lists_users(user_id) ); CREATE TABLE lists_users ( user_id INTEGER NOT NULL PRIMARY KEY, list_id INTEGER NOT NULL PRIMARY KEY, list_update_date_utc TEXT, list_creation_date_utc TEXT, user_trialist INTEGER, user_subscriber INTEGER, user_avatar_image_url TEXT, user_cover_image_url TEXT, user_eligible_for_trial TEXT, user_has_payment_method TEXT, PRIMARY KEY (user_id, list_id), UNIQUE (user_id, list_id), FOREIGN KEY (user_id) REFERENCES lists(user_id), FOREIGN KEY (list_id) REFERENCES lists(list_id) ); CREATE TABLE ratings ( movie_id INTEGER, rating_id INTEGER, rating_url TEXT, rating_score INTEGER, rating_timestamp_utc TEXT, critic TEXT, critic_likes INTEGER, critic_comments INTEGER, user_id INTEGER, user_trialist INTEGER, user_subscriber INTEGER, user_eligible_for_trial INTEGER, user_has_payment_method INTEGER, FOREIGN KEY (user_id) REFERENCES ratings_users(user_id), FOREIGN KEY (rating_id) REFERENCES ratings(rating_id), FOREIGN KEY (user_id) REFERENCES lists_users(user_id), FOREIGN KEY (movie_id) REFERENCES movies(movie_id) );
talkingdata
{"app_all": {"columns": [[0, "app_id", "INTEGER", 1, null, 1]], "primary_keys": ["app_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "app_events": {"columns": [[0, "event_id", "INTEGER", 1, null, 1], [1, "app_id", "INTEGER", 1, null, 2], [2, "is_installed", "INTEGER", 1, null, 0], [3, "is_active", "INTEGER", 1, null, 0]], "primary_keys": ["event_id", "app_id"], "foreign_keys": [[0, 0, "events", "event_id", "event_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "event_id"], [1, 1, "app_id"]]], "check_constraints": []}, "app_events_relevant": {"columns": [[0, "event_id", "INTEGER", 1, null, 1], [1, "app_id", "INTEGER", 1, null, 2], [2, "is_installed", "INTEGER", 0, "NULL", 0], [3, "is_active", "INTEGER", 0, "NULL", 0]], "primary_keys": ["event_id", "app_id"], "foreign_keys": [[0, 0, "app_all", "app_id", "app_id", "CASCADE", "CASCADE", "NONE"], [1, 0, "events_relevant", "event_id", "event_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "event_id"], [1, 1, "app_id"]]], "check_constraints": []}, "app_labels": {"columns": [[0, "app_id", "INTEGER", 1, null, 0], [1, "label_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "app_all", "app_id", "app_id", "CASCADE", "CASCADE", "NONE"], [1, 0, "label_categories", "label_id", "label_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "events": {"columns": [[0, "event_id", "INTEGER", 1, null, 1], [1, "device_id", "INTEGER", 0, "NULL", 0], [2, "timestamp", "DATETIME", 0, "NULL", 0], [3, "longitude", "REAL", 0, "NULL", 0], [4, "latitude", "REAL", 0, "NULL", 0]], "primary_keys": ["event_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "events_relevant": {"columns": [[0, "event_id", "INTEGER", 1, null, 1], [1, "device_id", "INTEGER", 0, "NULL", 0], [2, "timestamp", "DATETIME", 1, null, 0], [3, "longitude", "REAL", 1, null, 0], [4, "latitude", "REAL", 1, null, 0]], "primary_keys": ["event_id"], "foreign_keys": [[0, 0, "gender_age", "device_id", "device_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "gender_age": {"columns": [[0, "device_id", "INTEGER", 1, null, 1], [1, "gender", "TEXT", 0, "NULL", 0], [2, "age", "INTEGER", 0, "NULL", 0], [3, "group", "TEXT", 0, "NULL", 0]], "primary_keys": ["device_id"], "foreign_keys": [[0, 0, "phone_brand_device_model2", "device_id", "device_id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "gender_age_test": {"columns": [[0, "device_id", "INTEGER", 1, null, 1]], "primary_keys": ["device_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "gender_age_train": {"columns": [[0, "device_id", "INTEGER", 1, null, 1], [1, "gender", "TEXT", 0, "NULL", 0], [2, "age", "INTEGER", 0, "NULL", 0], [3, "group", "TEXT", 0, "NULL", 0]], "primary_keys": ["device_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "label_categories": {"columns": [[0, "label_id", "INTEGER", 1, null, 1], [1, "category", "TEXT", 0, "NULL", 0]], "primary_keys": ["label_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "phone_brand_device_model2": {"columns": [[0, "device_id", "INTEGER", 1, null, 1], [1, "phone_brand", "TEXT", 1, null, 2], [2, "device_model", "TEXT", 1, null, 3]], "primary_keys": ["device_id", "phone_brand", "device_model"], "foreign_keys": [], "unique_constraints": [[[0, 0, "device_id"], [1, 1, "phone_brand"], [2, 2, "device_model"]]], "check_constraints": []}, "sample_submission": {"columns": [[0, "device_id", "INTEGER", 1, null, 1], [1, "F23-", "REAL", 0, "NULL", 0], [2, "F24-26", "REAL", 0, "NULL", 0], [3, "F27-28", "REAL", 0, "NULL", 0], [4, "F29-32", "REAL", 0, "NULL", 0], [5, "F33-42", "REAL", 0, "NULL", 0], [6, "F43+", "REAL", 0, "NULL", 0], [7, "M22-", "REAL", 0, "NULL", 0], [8, "M23-26", "REAL", 0, "NULL", 0], [9, "M27-28", "REAL", 0, "NULL", 0], [10, "M29-31", "REAL", 0, "NULL", 0], [11, "M32-38", "REAL", 0, "NULL", 0], [12, "M39+", "REAL", 0, "NULL", 0]], "primary_keys": ["device_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE app_all ( app_id INTEGER NOT NULL PRIMARY KEY ); CREATE TABLE app_events ( event_id INTEGER NOT NULL PRIMARY KEY, app_id INTEGER NOT NULL PRIMARY KEY, is_installed INTEGER NOT NULL, is_active INTEGER NOT NULL, PRIMARY KEY (event_id, app_id), UNIQUE (event_id, app_id), FOREIGN KEY (event_id) REFERENCES events(event_id) ); CREATE TABLE app_events_relevant ( event_id INTEGER NOT NULL PRIMARY KEY, app_id INTEGER NOT NULL PRIMARY KEY, is_installed INTEGER DEFAULT NULL, is_active INTEGER DEFAULT NULL, PRIMARY KEY (event_id, app_id), UNIQUE (event_id, app_id), FOREIGN KEY (app_id) REFERENCES app_all(app_id), FOREIGN KEY (event_id) REFERENCES events_relevant(event_id) ); CREATE TABLE app_labels ( app_id INTEGER NOT NULL, label_id INTEGER NOT NULL, FOREIGN KEY (app_id) REFERENCES app_all(app_id), FOREIGN KEY (label_id) REFERENCES label_categories(label_id) ); CREATE TABLE events ( event_id INTEGER NOT NULL PRIMARY KEY, device_id INTEGER DEFAULT NULL, timestamp DATETIME DEFAULT NULL, longitude REAL DEFAULT NULL, latitude REAL DEFAULT NULL ); CREATE TABLE events_relevant ( event_id INTEGER NOT NULL PRIMARY KEY, device_id INTEGER DEFAULT NULL, timestamp DATETIME NOT NULL, longitude REAL NOT NULL, latitude REAL NOT NULL, FOREIGN KEY (device_id) REFERENCES gender_age(device_id) ); CREATE TABLE gender_age ( device_id INTEGER NOT NULL PRIMARY KEY, gender TEXT DEFAULT NULL, age INTEGER DEFAULT NULL, group TEXT DEFAULT NULL, FOREIGN KEY (device_id) REFERENCES phone_brand_device_model2(device_id) ); CREATE TABLE gender_age_test ( device_id INTEGER NOT NULL PRIMARY KEY ); CREATE TABLE gender_age_train ( device_id INTEGER NOT NULL PRIMARY KEY, gender TEXT DEFAULT NULL, age INTEGER DEFAULT NULL, group TEXT DEFAULT NULL ); CREATE TABLE label_categories ( label_id INTEGER NOT NULL PRIMARY KEY, category TEXT DEFAULT NULL ); CREATE TABLE phone_brand_device_model2 ( device_id INTEGER NOT NULL PRIMARY KEY, phone_brand TEXT NOT NULL PRIMARY KEY, device_model TEXT NOT NULL PRIMARY KEY, PRIMARY KEY (device_id, phone_brand, device_model), UNIQUE (device_id, phone_brand, device_model) ); CREATE TABLE sample_submission ( device_id INTEGER NOT NULL PRIMARY KEY, F23- REAL DEFAULT NULL, F24-26 REAL DEFAULT NULL, F27-28 REAL DEFAULT NULL, F29-32 REAL DEFAULT NULL, F33-42 REAL DEFAULT NULL, F43+ REAL DEFAULT NULL, M22- REAL DEFAULT NULL, M23-26 REAL DEFAULT NULL, M27-28 REAL DEFAULT NULL, M29-31 REAL DEFAULT NULL, M32-38 REAL DEFAULT NULL, M39+ REAL DEFAULT NULL );
retails
{"customer": {"columns": [[0, "c_custkey", "INTEGER", 1, null, 1], [1, "c_mktsegment", "TEXT", 0, "NULL", 0], [2, "c_nationkey", "INTEGER", 0, "NULL", 0], [3, "c_name", "TEXT", 0, "NULL", 0], [4, "c_address", "TEXT", 0, "NULL", 0], [5, "c_phone", "TEXT", 0, "NULL", 0], [6, "c_acctbal", "REAL", 0, "NULL", 0], [7, "c_comment", "TEXT", 0, "NULL", 0]], "primary_keys": ["c_custkey"], "foreign_keys": [[0, 0, "nation", "c_nationkey", "n_nationkey", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "lineitem": {"columns": [[0, "l_shipdate", "DATE", 0, null, 0], [1, "l_orderkey", "INTEGER", 1, null, 1], [2, "l_discount", "REAL", 1, null, 0], [3, "l_extendedprice", "REAL", 1, null, 0], [4, "l_suppkey", "INTEGER", 1, null, 0], [5, "l_quantity", "INTEGER", 1, null, 0], [6, "l_returnflag", "TEXT", 0, null, 0], [7, "l_partkey", "INTEGER", 1, null, 0], [8, "l_linestatus", "TEXT", 0, null, 0], [9, "l_tax", "REAL", 1, null, 0], [10, "l_commitdate", "DATE", 0, null, 0], [11, "l_receiptdate", "DATE", 0, null, 0], [12, "l_shipmode", "TEXT", 0, null, 0], [13, "l_linenumber", "INTEGER", 1, null, 2], [14, "l_shipinstruct", "TEXT", 0, null, 0], [15, "l_comment", "TEXT", 0, null, 0]], "primary_keys": ["l_orderkey", "l_linenumber"], "foreign_keys": [[0, 0, "partsupp", "l_partkey", "ps_partkey", "CASCADE", "CASCADE", "NONE"], [0, 1, "partsupp", "l_suppkey", "ps_suppkey", "CASCADE", "CASCADE", "NONE"], [1, 0, "orders", "l_orderkey", "o_orderkey", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 1, "l_orderkey"], [1, 13, "l_linenumber"]]], "check_constraints": []}, "nation": {"columns": [[0, "n_nationkey", "INTEGER", 1, null, 1], [1, "n_name", "TEXT", 0, null, 0], [2, "n_regionkey", "INTEGER", 0, null, 0], [3, "n_comment", "TEXT", 0, null, 0]], "primary_keys": ["n_nationkey"], "foreign_keys": [[0, 0, "region", "n_regionkey", "r_regionkey", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "orders": {"columns": [[0, "o_orderdate", "DATE", 0, null, 0], [1, "o_orderkey", "INTEGER", 1, null, 1], [2, "o_custkey", "INTEGER", 1, null, 0], [3, "o_orderpriority", "TEXT", 0, null, 0], [4, "o_shippriority", "INTEGER", 0, null, 0], [5, "o_clerk", "TEXT", 0, null, 0], [6, "o_orderstatus", "TEXT", 0, null, 0], [7, "o_totalprice", "REAL", 0, null, 0], [8, "o_comment", "TEXT", 0, null, 0]], "primary_keys": ["o_orderkey"], "foreign_keys": [[0, 0, "customer", "o_custkey", "c_custkey", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "part": {"columns": [[0, "p_partkey", "INTEGER", 1, null, 1], [1, "p_type", "TEXT", 0, null, 0], [2, "p_size", "INTEGER", 0, null, 0], [3, "p_brand", "TEXT", 0, null, 0], [4, "p_name", "TEXT", 0, null, 0], [5, "p_container", "TEXT", 0, null, 0], [6, "p_mfgr", "TEXT", 0, null, 0], [7, "p_retailprice", "REAL", 0, null, 0], [8, "p_comment", "TEXT", 0, null, 0]], "primary_keys": ["p_partkey"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "partsupp": {"columns": [[0, "ps_partkey", "INTEGER", 1, null, 1], [1, "ps_suppkey", "INTEGER", 1, null, 2], [2, "ps_supplycost", "REAL", 1, null, 0], [3, "ps_availqty", "INTEGER", 0, null, 0], [4, "ps_comment", "TEXT", 0, null, 0]], "primary_keys": ["ps_partkey", "ps_suppkey"], "foreign_keys": [[0, 0, "supplier", "ps_suppkey", "s_suppkey", "CASCADE", "CASCADE", "NONE"], [1, 0, "part", "ps_partkey", "p_partkey", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "ps_partkey"], [1, 1, "ps_suppkey"]]], "check_constraints": []}, "region": {"columns": [[0, "r_regionkey", "INTEGER", 1, null, 1], [1, "r_name", "TEXT", 0, null, 0], [2, "r_comment", "TEXT", 0, null, 0]], "primary_keys": ["r_regionkey"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "supplier": {"columns": [[0, "s_suppkey", "INTEGER", 1, null, 1], [1, "s_nationkey", "INTEGER", 0, null, 0], [2, "s_comment", "TEXT", 0, null, 0], [3, "s_name", "TEXT", 0, null, 0], [4, "s_address", "TEXT", 0, null, 0], [5, "s_phone", "TEXT", 0, null, 0], [6, "s_acctbal", "REAL", 0, null, 0]], "primary_keys": ["s_suppkey"], "foreign_keys": [[0, 0, "nation", "s_nationkey", "n_nationkey", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE customer ( c_custkey INTEGER NOT NULL PRIMARY KEY, c_mktsegment TEXT DEFAULT NULL, c_nationkey INTEGER DEFAULT NULL, c_name TEXT DEFAULT NULL, c_address TEXT DEFAULT NULL, c_phone TEXT DEFAULT NULL, c_acctbal REAL DEFAULT NULL, c_comment TEXT DEFAULT NULL, FOREIGN KEY (c_nationkey) REFERENCES nation(n_nationkey) ); CREATE TABLE lineitem ( l_shipdate DATE, l_orderkey INTEGER NOT NULL PRIMARY KEY, l_discount REAL NOT NULL, l_extendedprice REAL NOT NULL, l_suppkey INTEGER NOT NULL, l_quantity INTEGER NOT NULL, l_returnflag TEXT, l_partkey INTEGER NOT NULL, l_linestatus TEXT, l_tax REAL NOT NULL, l_commitdate DATE, l_receiptdate DATE, l_shipmode TEXT, l_linenumber INTEGER NOT NULL PRIMARY KEY, l_shipinstruct TEXT, l_comment TEXT, PRIMARY KEY (l_orderkey, l_linenumber), UNIQUE (l_orderkey, l_linenumber), FOREIGN KEY (l_partkey) REFERENCES partsupp(ps_partkey), FOREIGN KEY (l_suppkey) REFERENCES partsupp(ps_suppkey), FOREIGN KEY (l_orderkey) REFERENCES orders(o_orderkey) ); CREATE TABLE nation ( n_nationkey INTEGER NOT NULL PRIMARY KEY, n_name TEXT, n_regionkey INTEGER, n_comment TEXT, FOREIGN KEY (n_regionkey) REFERENCES region(r_regionkey) ); CREATE TABLE orders ( o_orderdate DATE, o_orderkey INTEGER NOT NULL PRIMARY KEY, o_custkey INTEGER NOT NULL, o_orderpriority TEXT, o_shippriority INTEGER, o_clerk TEXT, o_orderstatus TEXT, o_totalprice REAL, o_comment TEXT, FOREIGN KEY (o_custkey) REFERENCES customer(c_custkey) ); CREATE TABLE part ( p_partkey INTEGER NOT NULL PRIMARY KEY, p_type TEXT, p_size INTEGER, p_brand TEXT, p_name TEXT, p_container TEXT, p_mfgr TEXT, p_retailprice REAL, p_comment TEXT ); CREATE TABLE partsupp ( ps_partkey INTEGER NOT NULL PRIMARY KEY, ps_suppkey INTEGER NOT NULL PRIMARY KEY, ps_supplycost REAL NOT NULL, ps_availqty INTEGER, ps_comment TEXT, PRIMARY KEY (ps_partkey, ps_suppkey), UNIQUE (ps_partkey, ps_suppkey), FOREIGN KEY (ps_suppkey) REFERENCES supplier(s_suppkey), FOREIGN KEY (ps_partkey) REFERENCES part(p_partkey) ); CREATE TABLE region ( r_regionkey INTEGER NOT NULL PRIMARY KEY, r_name TEXT, r_comment TEXT ); CREATE TABLE supplier ( s_suppkey INTEGER NOT NULL PRIMARY KEY, s_nationkey INTEGER, s_comment TEXT, s_name TEXT, s_address TEXT, s_phone TEXT, s_acctbal REAL, FOREIGN KEY (s_nationkey) REFERENCES nation(n_nationkey) );
mondial_geo
{"borders": {"columns": [[0, "Country1", "TEXT", 1, "''", 1], [1, "Country2", "TEXT", 1, "''", 2], [2, "Length", "REAL", 0, null, 0]], "primary_keys": ["Country1", "Country2"], "foreign_keys": [[0, 0, "country", "Country2", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "country", "Country1", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Country1"], [1, 1, "Country2"]]], "check_constraints": []}, "city": {"columns": [[0, "Name", "TEXT", 1, "''", 1], [1, "Country", "TEXT", 1, "''", 0], [2, "Province", "TEXT", 1, "''", 2], [3, "Population", "INTEGER", 0, null, 0], [4, "Longitude", "REAL", 0, null, 0], [5, "Latitude", "REAL", 0, null, 0]], "primary_keys": ["Name", "Province"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Name"], [1, 2, "Province"]]], "check_constraints": []}, "continent": {"columns": [[0, "Name", "TEXT", 1, "''", 1], [1, "Area", "REAL", 0, null, 0]], "primary_keys": ["Name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Name"]]], "check_constraints": []}, "country": {"columns": [[0, "Name", "TEXT", 1, null, 0], [1, "Code", "TEXT", 1, "''", 1], [2, "Capital", "TEXT", 0, null, 0], [3, "Province", "TEXT", 0, null, 0], [4, "Area", "REAL", 0, null, 0], [5, "Population", "INTEGER", 0, null, 0]], "primary_keys": ["Code"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Code"]], [[0, 0, "Name"]]], "check_constraints": []}, "desert": {"columns": [[0, "Name", "TEXT", 1, "''", 1], [1, "Area", "REAL", 0, null, 0], [2, "Longitude", "REAL", 0, null, 0], [3, "Latitude", "REAL", 0, null, 0]], "primary_keys": ["Name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Name"]]], "check_constraints": []}, "economy": {"columns": [[0, "Country", "TEXT", 1, "''", 1], [1, "GDP", "REAL", 0, null, 0], [2, "Agriculture", "REAL", 0, null, 0], [3, "Service", "REAL", 0, null, 0], [4, "Industry", "REAL", 0, null, 0], [5, "Inflation", "REAL", 0, null, 0]], "primary_keys": ["Country"], "foreign_keys": [[0, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Country"]]], "check_constraints": []}, "encompasses": {"columns": [[0, "Country", "TEXT", 1, null, 1], [1, "Continent", "TEXT", 1, null, 2], [2, "Percentage", "REAL", 0, null, 0]], "primary_keys": ["Country", "Continent"], "foreign_keys": [[0, 0, "continent", "Continent", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Country"], [1, 1, "Continent"]]], "check_constraints": []}, "ethnicGroup": {"columns": [[0, "Country", "TEXT", 1, "''", 2], [1, "Name", "TEXT", 1, "''", 1], [2, "Percentage", "REAL", 0, null, 0]], "primary_keys": ["Country", "Name"], "foreign_keys": [[0, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 1, "Name"], [1, 0, "Country"]]], "check_constraints": []}, "geo_desert": {"columns": [[0, "Desert", "TEXT", 1, "''", 3], [1, "Country", "TEXT", 1, "''", 2], [2, "Province", "TEXT", 1, "''", 1]], "primary_keys": ["Desert", "Country", "Province"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "desert", "Desert", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 2, "Province"], [1, 1, "Country"], [2, 0, "Desert"]]], "check_constraints": []}, "geo_estuary": {"columns": [[0, "River", "TEXT", 1, "''", 3], [1, "Country", "TEXT", 1, "''", 2], [2, "Province", "TEXT", 1, "''", 1]], "primary_keys": ["River", "Country", "Province"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "river", "River", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 2, "Province"], [1, 1, "Country"], [2, 0, "River"]]], "check_constraints": []}, "geo_island": {"columns": [[0, "Island", "TEXT", 1, "''", 3], [1, "Country", "TEXT", 1, "''", 2], [2, "Province", "TEXT", 1, "''", 1]], "primary_keys": ["Island", "Country", "Province"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "island", "Island", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 2, "Province"], [1, 1, "Country"], [2, 0, "Island"]]], "check_constraints": []}, "geo_lake": {"columns": [[0, "Lake", "TEXT", 1, "''", 3], [1, "Country", "TEXT", 1, "''", 2], [2, "Province", "TEXT", 1, "''", 1]], "primary_keys": ["Lake", "Country", "Province"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "lake", "Lake", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 2, "Province"], [1, 1, "Country"], [2, 0, "Lake"]]], "check_constraints": []}, "geo_mountain": {"columns": [[0, "Mountain", "TEXT", 1, "''", 3], [1, "Country", "TEXT", 1, "''", 2], [2, "Province", "TEXT", 1, "''", 1]], "primary_keys": ["Mountain", "Country", "Province"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "mountain", "Mountain", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 2, "Province"], [1, 1, "Country"], [2, 0, "Mountain"]]], "check_constraints": []}, "geo_river": {"columns": [[0, "River", "TEXT", 1, "''", 3], [1, "Country", "TEXT", 1, "''", 2], [2, "Province", "TEXT", 1, "''", 1]], "primary_keys": ["River", "Country", "Province"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "river", "River", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 2, "Province"], [1, 1, "Country"], [2, 0, "River"]]], "check_constraints": []}, "geo_sea": {"columns": [[0, "Sea", "TEXT", 1, "''", 3], [1, "Country", "TEXT", 1, "''", 2], [2, "Province", "TEXT", 1, "''", 1]], "primary_keys": ["Sea", "Country", "Province"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "sea", "Sea", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 2, "Province"], [1, 1, "Country"], [2, 0, "Sea"]]], "check_constraints": []}, "geo_source": {"columns": [[0, "River", "TEXT", 1, "''", 3], [1, "Country", "TEXT", 1, "''", 2], [2, "Province", "TEXT", 1, "''", 1]], "primary_keys": ["River", "Country", "Province"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "river", "River", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 2, "Province"], [1, 1, "Country"], [2, 0, "River"]]], "check_constraints": []}, "island": {"columns": [[0, "Name", "TEXT", 1, "''", 1], [1, "Islands", "TEXT", 0, null, 0], [2, "Area", "REAL", 0, null, 0], [3, "Height", "REAL", 0, null, 0], [4, "Type", "TEXT", 0, null, 0], [5, "Longitude", "REAL", 0, null, 0], [6, "Latitude", "REAL", 0, null, 0]], "primary_keys": ["Name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Name"]]], "check_constraints": []}, "islandIn": {"columns": [[0, "Island", "TEXT", 0, null, 0], [1, "Sea", "TEXT", 0, null, 0], [2, "Lake", "TEXT", 0, null, 0], [3, "River", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "river", "River", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "lake", "Lake", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "sea", "Sea", null, "CASCADE", "CASCADE", "NONE"], [3, 0, "island", "Island", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "isMember": {"columns": [[0, "Country", "TEXT", 1, "''", 1], [1, "Organization", "TEXT", 1, "''", 2], [2, "Type", "TEXT", 0, "'member'", 0]], "primary_keys": ["Country", "Organization"], "foreign_keys": [[0, 0, "organization", "Organization", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Country"], [1, 1, "Organization"]]], "check_constraints": []}, "lake": {"columns": [[0, "Name", "TEXT", 1, "''", 1], [1, "Area", "REAL", 0, null, 0], [2, "Depth", "REAL", 0, null, 0], [3, "Altitude", "REAL", 0, null, 0], [4, "Type", "TEXT", 0, null, 0], [5, "River", "TEXT", 0, null, 0], [6, "Longitude", "REAL", 0, null, 0], [7, "Latitude", "REAL", 0, null, 0]], "primary_keys": ["Name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Name"]]], "check_constraints": []}, "language": {"columns": [[0, "Country", "TEXT", 1, "''", 2], [1, "Name", "TEXT", 1, "''", 1], [2, "Percentage", "REAL", 0, null, 0]], "primary_keys": ["Country", "Name"], "foreign_keys": [[0, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 1, "Name"], [1, 0, "Country"]]], "check_constraints": []}, "located": {"columns": [[0, "City", "TEXT", 0, null, 0], [1, "Province", "TEXT", 0, null, 0], [2, "Country", "TEXT", 0, null, 0], [3, "River", "TEXT", 0, null, 0], [4, "Lake", "TEXT", 0, null, 0], [5, "Sea", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "city", "City", null, "CASCADE", "CASCADE", "NONE"], [1, 1, "city", "Province", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "sea", "Sea", null, "CASCADE", "CASCADE", "NONE"], [3, 0, "lake", "Lake", null, "CASCADE", "CASCADE", "NONE"], [4, 0, "river", "River", null, "CASCADE", "CASCADE", "NONE"], [5, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "locatedOn": {"columns": [[0, "City", "TEXT", 1, "''", 1], [1, "Province", "TEXT", 1, "''", 2], [2, "Country", "TEXT", 1, "''", 3], [3, "Island", "TEXT", 1, "''", 4]], "primary_keys": ["City", "Province", "Country", "Island"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "city", "City", null, "CASCADE", "CASCADE", "NONE"], [1, 1, "city", "Province", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "island", "Island", null, "CASCADE", "CASCADE", "NONE"], [3, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "City"], [1, 1, "Province"], [2, 2, "Country"], [3, 3, "Island"]]], "check_constraints": []}, "mergesWith": {"columns": [[0, "Sea1", "TEXT", 1, "''", 1], [1, "Sea2", "TEXT", 1, "''", 2]], "primary_keys": ["Sea1", "Sea2"], "foreign_keys": [[0, 0, "sea", "Sea2", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "sea", "Sea1", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Sea1"], [1, 1, "Sea2"]]], "check_constraints": []}, "mountain": {"columns": [[0, "Name", "TEXT", 1, "''", 1], [1, "Mountains", "TEXT", 0, null, 0], [2, "Height", "REAL", 0, null, 0], [3, "Type", "TEXT", 0, null, 0], [4, "Longitude", "REAL", 0, null, 0], [5, "Latitude", "REAL", 0, null, 0]], "primary_keys": ["Name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Name"]]], "check_constraints": []}, "mountainOnIsland": {"columns": [[0, "Mountain", "TEXT", 1, "''", 1], [1, "Island", "TEXT", 1, "''", 2]], "primary_keys": ["Mountain", "Island"], "foreign_keys": [[0, 0, "island", "Island", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "mountain", "Mountain", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Mountain"], [1, 1, "Island"]]], "check_constraints": []}, "organization": {"columns": [[0, "Abbreviation", "TEXT", 1, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "City", "TEXT", 0, null, 0], [3, "Country", "TEXT", 0, null, 0], [4, "Province", "TEXT", 0, null, 0], [5, "Established", "DATE", 0, null, 0]], "primary_keys": ["Abbreviation"], "foreign_keys": [[0, 0, "province", "Province", null, "CASCADE", "CASCADE", "NONE"], [0, 1, "province", "Country", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "city", "City", null, "CASCADE", "CASCADE", "NONE"], [1, 1, "city", "Province", null, "CASCADE", "CASCADE", "NONE"], [2, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 1, "Name"]], [[0, 0, "Abbreviation"]]], "check_constraints": []}, "politics": {"columns": [[0, "Country", "TEXT", 1, "''", 1], [1, "Independence", "DATE", 0, null, 0], [2, "Dependent", "TEXT", 0, null, 0], [3, "Government", "TEXT", 0, null, 0]], "primary_keys": ["Country"], "foreign_keys": [[0, 0, "country", "Dependent", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Country"]]], "check_constraints": []}, "population": {"columns": [[0, "Country", "TEXT", 1, "''", 1], [1, "Population_Growth", "REAL", 0, null, 0], [2, "Infant_Mortality", "REAL", 0, null, 0]], "primary_keys": ["Country"], "foreign_keys": [[0, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Country"]]], "check_constraints": []}, "province": {"columns": [[0, "Name", "TEXT", 1, null, 1], [1, "Country", "TEXT", 1, null, 2], [2, "Population", "INTEGER", 0, null, 0], [3, "Area", "REAL", 0, null, 0], [4, "Capital", "TEXT", 0, null, 0], [5, "CapProv", "TEXT", 0, null, 0]], "primary_keys": ["Name", "Country"], "foreign_keys": [[0, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Name"], [1, 1, "Country"]]], "check_constraints": []}, "religion": {"columns": [[0, "Country", "TEXT", 1, "''", 2], [1, "Name", "TEXT", 1, "''", 1], [2, "Percentage", "REAL", 0, null, 0]], "primary_keys": ["Country", "Name"], "foreign_keys": [[0, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 1, "Name"], [1, 0, "Country"]]], "check_constraints": []}, "river": {"columns": [[0, "Name", "TEXT", 1, "''", 1], [1, "River", "TEXT", 0, null, 0], [2, "Lake", "TEXT", 0, null, 0], [3, "Sea", "TEXT", 0, null, 0], [4, "Length", "REAL", 0, null, 0], [5, "SourceLongitude", "REAL", 0, null, 0], [6, "SourceLatitude", "REAL", 0, null, 0], [7, "Mountains", "TEXT", 0, null, 0], [8, "SourceAltitude", "REAL", 0, null, 0], [9, "EstuaryLongitude", "REAL", 0, null, 0], [10, "EstuaryLatitude", "REAL", 0, null, 0]], "primary_keys": ["Name"], "foreign_keys": [[0, 0, "lake", "Lake", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Name"]]], "check_constraints": []}, "sea": {"columns": [[0, "Name", "TEXT", 1, "''", 1], [1, "Depth", "REAL", 0, null, 0]], "primary_keys": ["Name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Name"]]], "check_constraints": []}, "target": {"columns": [[0, "Country", "TEXT", 1, null, 1], [1, "Target", "TEXT", 0, null, 0]], "primary_keys": ["Country"], "foreign_keys": [[0, 0, "country", "Country", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "Country"]]], "check_constraints": []}}
CREATE TABLE borders ( Country1 TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country2 TEXT NOT NULL DEFAULT '' PRIMARY KEY, Length REAL, PRIMARY KEY (Country1, Country2), UNIQUE (Country1, Country2), FOREIGN KEY (Country2) REFERENCES country(None), FOREIGN KEY (Country1) REFERENCES country(None) ); CREATE TABLE city ( Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '', Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, Population INTEGER, Longitude REAL, Latitude REAL, PRIMARY KEY (Name, Province), UNIQUE (Name, Province), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE continent ( Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Area REAL, UNIQUE (Name) ); CREATE TABLE country ( Name TEXT NOT NULL, Code TEXT NOT NULL DEFAULT '' PRIMARY KEY, Capital TEXT, Province TEXT, Area REAL, Population INTEGER, UNIQUE (Code), UNIQUE (Name) ); CREATE TABLE desert ( Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Area REAL, Longitude REAL, Latitude REAL, UNIQUE (Name) ); CREATE TABLE economy ( Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, GDP REAL, Agriculture REAL, Service REAL, Industry REAL, Inflation REAL, UNIQUE (Country), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE encompasses ( Country TEXT NOT NULL PRIMARY KEY, Continent TEXT NOT NULL PRIMARY KEY, Percentage REAL, PRIMARY KEY (Country, Continent), UNIQUE (Country, Continent), FOREIGN KEY (Continent) REFERENCES continent(None), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE ethnicGroup ( Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Percentage REAL, PRIMARY KEY (Country, Name), UNIQUE (Name, Country), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE geo_desert ( Desert TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (Desert, Country, Province), UNIQUE (Province, Country, Desert), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES country(None), FOREIGN KEY (Desert) REFERENCES desert(None) ); CREATE TABLE geo_estuary ( River TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (River, Country, Province), UNIQUE (Province, Country, River), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES country(None), FOREIGN KEY (River) REFERENCES river(None) ); CREATE TABLE geo_island ( Island TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (Island, Country, Province), UNIQUE (Province, Country, Island), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES country(None), FOREIGN KEY (Island) REFERENCES island(None) ); CREATE TABLE geo_lake ( Lake TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (Lake, Country, Province), UNIQUE (Province, Country, Lake), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES country(None), FOREIGN KEY (Lake) REFERENCES lake(None) ); CREATE TABLE geo_mountain ( Mountain TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (Mountain, Country, Province), UNIQUE (Province, Country, Mountain), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES country(None), FOREIGN KEY (Mountain) REFERENCES mountain(None) ); CREATE TABLE geo_river ( River TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (River, Country, Province), UNIQUE (Province, Country, River), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES country(None), FOREIGN KEY (River) REFERENCES river(None) ); CREATE TABLE geo_sea ( Sea TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (Sea, Country, Province), UNIQUE (Province, Country, Sea), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES country(None), FOREIGN KEY (Sea) REFERENCES sea(None) ); CREATE TABLE geo_source ( River TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (River, Country, Province), UNIQUE (Province, Country, River), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES country(None), FOREIGN KEY (River) REFERENCES river(None) ); CREATE TABLE island ( Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Islands TEXT, Area REAL, Height REAL, Type TEXT, Longitude REAL, Latitude REAL, UNIQUE (Name) ); CREATE TABLE islandIn ( Island TEXT, Sea TEXT, Lake TEXT, River TEXT, FOREIGN KEY (River) REFERENCES river(None), FOREIGN KEY (Lake) REFERENCES lake(None), FOREIGN KEY (Sea) REFERENCES sea(None), FOREIGN KEY (Island) REFERENCES island(None) ); CREATE TABLE isMember ( Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Organization TEXT NOT NULL DEFAULT '' PRIMARY KEY, Type TEXT DEFAULT 'member', PRIMARY KEY (Country, Organization), UNIQUE (Country, Organization), FOREIGN KEY (Organization) REFERENCES organization(None), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE lake ( Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Area REAL, Depth REAL, Altitude REAL, Type TEXT, River TEXT, Longitude REAL, Latitude REAL, UNIQUE (Name) ); CREATE TABLE language ( Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Percentage REAL, PRIMARY KEY (Country, Name), UNIQUE (Name, Country), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE located ( City TEXT, Province TEXT, Country TEXT, River TEXT, Lake TEXT, Sea TEXT, FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (City) REFERENCES city(None), FOREIGN KEY (Province) REFERENCES city(None), FOREIGN KEY (Sea) REFERENCES sea(None), FOREIGN KEY (Lake) REFERENCES lake(None), FOREIGN KEY (River) REFERENCES river(None), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE locatedOn ( City TEXT NOT NULL DEFAULT '' PRIMARY KEY, Province TEXT NOT NULL DEFAULT '' PRIMARY KEY, Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Island TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (City, Province, Country, Island), UNIQUE (City, Province, Country, Island), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (City) REFERENCES city(None), FOREIGN KEY (Province) REFERENCES city(None), FOREIGN KEY (Island) REFERENCES island(None), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE mergesWith ( Sea1 TEXT NOT NULL DEFAULT '' PRIMARY KEY, Sea2 TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (Sea1, Sea2), UNIQUE (Sea1, Sea2), FOREIGN KEY (Sea2) REFERENCES sea(None), FOREIGN KEY (Sea1) REFERENCES sea(None) ); CREATE TABLE mountain ( Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Mountains TEXT, Height REAL, Type TEXT, Longitude REAL, Latitude REAL, UNIQUE (Name) ); CREATE TABLE mountainOnIsland ( Mountain TEXT NOT NULL DEFAULT '' PRIMARY KEY, Island TEXT NOT NULL DEFAULT '' PRIMARY KEY, PRIMARY KEY (Mountain, Island), UNIQUE (Mountain, Island), FOREIGN KEY (Island) REFERENCES island(None), FOREIGN KEY (Mountain) REFERENCES mountain(None) ); CREATE TABLE organization ( Abbreviation TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, City TEXT, Country TEXT, Province TEXT, Established DATE, UNIQUE (Name), UNIQUE (Abbreviation), FOREIGN KEY (Province) REFERENCES province(None), FOREIGN KEY (Country) REFERENCES province(None), FOREIGN KEY (City) REFERENCES city(None), FOREIGN KEY (Province) REFERENCES city(None), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE politics ( Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Independence DATE, Dependent TEXT, Government TEXT, UNIQUE (Country), FOREIGN KEY (Dependent) REFERENCES country(None), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE population ( Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Population_Growth REAL, Infant_Mortality REAL, UNIQUE (Country), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE province ( Name TEXT NOT NULL PRIMARY KEY, Country TEXT NOT NULL PRIMARY KEY, Population INTEGER, Area REAL, Capital TEXT, CapProv TEXT, PRIMARY KEY (Name, Country), UNIQUE (Name, Country), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE religion ( Country TEXT NOT NULL DEFAULT '' PRIMARY KEY, Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Percentage REAL, PRIMARY KEY (Country, Name), UNIQUE (Name, Country), FOREIGN KEY (Country) REFERENCES country(None) ); CREATE TABLE river ( Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, River TEXT, Lake TEXT, Sea TEXT, Length REAL, SourceLongitude REAL, SourceLatitude REAL, Mountains TEXT, SourceAltitude REAL, EstuaryLongitude REAL, EstuaryLatitude REAL, UNIQUE (Name), FOREIGN KEY (Lake) REFERENCES lake(None) ); CREATE TABLE sea ( Name TEXT NOT NULL DEFAULT '' PRIMARY KEY, Depth REAL, UNIQUE (Name) ); CREATE TABLE target ( Country TEXT NOT NULL PRIMARY KEY, Target TEXT, UNIQUE (Country), FOREIGN KEY (Country) REFERENCES country(None) );
beer_factory
{"customers": {"columns": [[0, "CustomerID", "INTEGER", 0, null, 1], [1, "First", "TEXT", 0, null, 0], [2, "Last", "TEXT", 0, null, 0], [3, "StreetAddress", "TEXT", 0, null, 0], [4, "City", "TEXT", 0, null, 0], [5, "State", "TEXT", 0, null, 0], [6, "ZipCode", "INTEGER", 0, null, 0], [7, "Email", "TEXT", 0, null, 0], [8, "PhoneNumber", "TEXT", 0, null, 0], [9, "FirstPurchaseDate", "DATE", 0, null, 0], [10, "SubscribedToEmailList", "TEXT", 0, null, 0], [11, "Gender", "TEXT", 0, null, 0]], "primary_keys": ["CustomerID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "geolocation": {"columns": [[0, "LocationID", "INTEGER", 0, null, 1], [1, "Latitude", "REAL", 0, null, 0], [2, "Longitude", "REAL", 0, null, 0]], "primary_keys": ["LocationID"], "foreign_keys": [[0, 0, "location", "LocationID", "LocationID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "location": {"columns": [[0, "LocationID", "INTEGER", 0, null, 1], [1, "LocationName", "TEXT", 0, null, 0], [2, "StreetAddress", "TEXT", 0, null, 0], [3, "City", "TEXT", 0, null, 0], [4, "State", "TEXT", 0, null, 0], [5, "ZipCode", "INTEGER", 0, null, 0]], "primary_keys": ["LocationID"], "foreign_keys": [[0, 0, "geolocation", "LocationID", "LocationID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "rootbeerbrand": {"columns": [[0, "BrandID", "INTEGER", 0, null, 1], [1, "BrandName", "TEXT", 0, null, 0], [2, "FirstBrewedYear", "INTEGER", 0, null, 0], [3, "BreweryName", "TEXT", 0, null, 0], [4, "City", "TEXT", 0, null, 0], [5, "State", "TEXT", 0, null, 0], [6, "Country", "TEXT", 0, null, 0], [7, "Description", "TEXT", 0, null, 0], [8, "CaneSugar", "TEXT", 0, null, 0], [9, "CornSyrup", "TEXT", 0, null, 0], [10, "Honey", "TEXT", 0, null, 0], [11, "ArtificialSweetener", "TEXT", 0, null, 0], [12, "Caffeinated", "TEXT", 0, null, 0], [13, "Alcoholic", "TEXT", 0, null, 0], [14, "AvailableInCans", "TEXT", 0, null, 0], [15, "AvailableInBottles", "TEXT", 0, null, 0], [16, "AvailableInKegs", "TEXT", 0, null, 0], [17, "Website", "TEXT", 0, null, 0], [18, "FacebookPage", "TEXT", 0, null, 0], [19, "Twitter", "TEXT", 0, null, 0], [20, "WholesaleCost", "REAL", 0, null, 0], [21, "CurrentRetailPrice", "REAL", 0, null, 0]], "primary_keys": ["BrandID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "rootbeer": {"columns": [[0, "RootBeerID", "INTEGER", 0, null, 1], [1, "BrandID", "INTEGER", 0, null, 0], [2, "ContainerType", "TEXT", 0, null, 0], [3, "LocationID", "INTEGER", 0, null, 0], [4, "PurchaseDate", "DATE", 0, null, 0]], "primary_keys": ["RootBeerID"], "foreign_keys": [[0, 0, "rootbeerbrand", "BrandID", "BrandID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "location", "LocationID", "LocationID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "geolocation", "LocationID", "LocationID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "rootbeerreview": {"columns": [[0, "CustomerID", "INTEGER", 0, null, 1], [1, "BrandID", "INTEGER", 0, null, 2], [2, "StarRating", "INTEGER", 0, null, 0], [3, "ReviewDate", "DATE", 0, null, 0], [4, "Review", "TEXT", 0, null, 0]], "primary_keys": ["CustomerID", "BrandID"], "foreign_keys": [[0, 0, "rootbeerbrand", "BrandID", "BrandID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "customers", "CustomerID", "CustomerID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "CustomerID"], [1, 1, "BrandID"]]], "check_constraints": []}, "transaction": {"columns": [[0, "TransactionID", "INTEGER", 0, null, 1], [1, "CreditCardNumber", "INTEGER", 0, null, 0], [2, "CustomerID", "INTEGER", 0, null, 0], [3, "TransactionDate", "DATE", 0, null, 0], [4, "CreditCardType", "TEXT", 0, null, 0], [5, "LocationID", "INTEGER", 0, null, 0], [6, "RootBeerID", "INTEGER", 0, null, 0], [7, "PurchasePrice", "REAL", 0, null, 0]], "primary_keys": ["TransactionID"], "foreign_keys": [[0, 0, "rootbeer", "RootBeerID", "RootBeerID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "location", "LocationID", "LocationID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "customers", "CustomerID", "CustomerID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE customers ( CustomerID INTEGER PRIMARY KEY, First TEXT, Last TEXT, StreetAddress TEXT, City TEXT, State TEXT, ZipCode INTEGER, Email TEXT, PhoneNumber TEXT, FirstPurchaseDate DATE, SubscribedToEmailList TEXT, Gender TEXT ); CREATE TABLE geolocation ( LocationID INTEGER PRIMARY KEY, Latitude REAL, Longitude REAL, FOREIGN KEY (LocationID) REFERENCES location(LocationID) ); CREATE TABLE location ( LocationID INTEGER PRIMARY KEY, LocationName TEXT, StreetAddress TEXT, City TEXT, State TEXT, ZipCode INTEGER, FOREIGN KEY (LocationID) REFERENCES geolocation(LocationID) ); CREATE TABLE rootbeerbrand ( BrandID INTEGER PRIMARY KEY, BrandName TEXT, FirstBrewedYear INTEGER, BreweryName TEXT, City TEXT, State TEXT, Country TEXT, Description TEXT, CaneSugar TEXT, CornSyrup TEXT, Honey TEXT, ArtificialSweetener TEXT, Caffeinated TEXT, Alcoholic TEXT, AvailableInCans TEXT, AvailableInBottles TEXT, AvailableInKegs TEXT, Website TEXT, FacebookPage TEXT, Twitter TEXT, WholesaleCost REAL, CurrentRetailPrice REAL ); CREATE TABLE rootbeer ( RootBeerID INTEGER PRIMARY KEY, BrandID INTEGER, ContainerType TEXT, LocationID INTEGER, PurchaseDate DATE, FOREIGN KEY (BrandID) REFERENCES rootbeerbrand(BrandID), FOREIGN KEY (LocationID) REFERENCES location(LocationID), FOREIGN KEY (LocationID) REFERENCES geolocation(LocationID) ); CREATE TABLE rootbeerreview ( CustomerID INTEGER PRIMARY KEY, BrandID INTEGER PRIMARY KEY, StarRating INTEGER, ReviewDate DATE, Review TEXT, PRIMARY KEY (CustomerID, BrandID), UNIQUE (CustomerID, BrandID), FOREIGN KEY (BrandID) REFERENCES rootbeerbrand(BrandID), FOREIGN KEY (CustomerID) REFERENCES customers(CustomerID) ); CREATE TABLE transaction ( TransactionID INTEGER PRIMARY KEY, CreditCardNumber INTEGER, CustomerID INTEGER, TransactionDate DATE, CreditCardType TEXT, LocationID INTEGER, RootBeerID INTEGER, PurchasePrice REAL, FOREIGN KEY (RootBeerID) REFERENCES rootbeer(RootBeerID), FOREIGN KEY (LocationID) REFERENCES location(LocationID), FOREIGN KEY (CustomerID) REFERENCES customers(CustomerID) );
trains
{"cars": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "train_id", "INTEGER", 0, "NULL", 0], [2, "position", "INTEGER", 0, "NULL", 0], [3, "shape", "TEXT", 0, "NULL", 0], [4, "len", "TEXT", 0, "NULL", 0], [5, "sides", "TEXT", 0, "NULL", 0], [6, "roof", "TEXT", 0, "NULL", 0], [7, "wheels", "INTEGER", 0, "NULL", 0], [8, "load_shape", "TEXT", 0, "NULL", 0], [9, "load_num", "INTEGER", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "trains", "train_id", "id", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}, "trains": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "direction", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE cars ( id INTEGER NOT NULL PRIMARY KEY, train_id INTEGER DEFAULT NULL, position INTEGER DEFAULT NULL, shape TEXT DEFAULT NULL, len TEXT DEFAULT NULL, sides TEXT DEFAULT NULL, roof TEXT DEFAULT NULL, wheels INTEGER DEFAULT NULL, load_shape TEXT DEFAULT NULL, load_num INTEGER DEFAULT NULL, FOREIGN KEY (train_id) REFERENCES trains(id) ); CREATE TABLE trains ( id INTEGER NOT NULL PRIMARY KEY, direction TEXT DEFAULT NULL );
shakespeare
{"chapters": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "Act", "INTEGER", 1, null, 0], [2, "Scene", "INTEGER", 1, null, 0], [3, "Description", "TEXT", 1, null, 0], [4, "work_id", "INTEGER", 1, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "works", "work_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "characters": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "CharName", "TEXT", 1, null, 0], [2, "Abbrev", "TEXT", 1, null, 0], [3, "Description", "TEXT", 1, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "paragraphs": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "ParagraphNum", "INTEGER", 1, null, 0], [2, "PlainText", "TEXT", 1, null, 0], [3, "character_id", "INTEGER", 1, null, 0], [4, "chapter_id", "INTEGER", 1, "0", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "chapters", "chapter_id", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "characters", "character_id", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "works": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "Title", "TEXT", 1, null, 0], [2, "LongTitle", "TEXT", 1, null, 0], [3, "Date", "INTEGER", 1, null, 0], [4, "GenreType", "TEXT", 1, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE chapters ( id INTEGER PRIMARY KEY, Act INTEGER NOT NULL, Scene INTEGER NOT NULL, Description TEXT NOT NULL, work_id INTEGER NOT NULL, FOREIGN KEY (work_id) REFERENCES works(None) ); CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE characters ( id INTEGER PRIMARY KEY, CharName TEXT NOT NULL, Abbrev TEXT NOT NULL, Description TEXT NOT NULL ); CREATE TABLE paragraphs ( id INTEGER PRIMARY KEY, ParagraphNum INTEGER NOT NULL, PlainText TEXT NOT NULL, character_id INTEGER NOT NULL, chapter_id INTEGER NOT NULL DEFAULT 0, FOREIGN KEY (chapter_id) REFERENCES chapters(None), FOREIGN KEY (character_id) REFERENCES characters(None) ); CREATE TABLE works ( id INTEGER PRIMARY KEY, Title TEXT NOT NULL, LongTitle TEXT NOT NULL, Date INTEGER NOT NULL, GenreType TEXT NOT NULL );
shipping
{"city": {"columns": [[0, "city_id", "INTEGER", 0, null, 1], [1, "city_name", "TEXT", 0, null, 0], [2, "state", "TEXT", 0, null, 0], [3, "population", "INTEGER", 0, null, 0], [4, "area", "REAL", 0, null, 0]], "primary_keys": ["city_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "customer": {"columns": [[0, "cust_id", "INTEGER", 0, null, 1], [1, "cust_name", "TEXT", 0, null, 0], [2, "annual_revenue", "INTEGER", 0, null, 0], [3, "cust_type", "TEXT", 0, null, 0], [4, "address", "TEXT", 0, null, 0], [5, "city", "TEXT", 0, null, 0], [6, "state", "TEXT", 0, null, 0], [7, "zip", "REAL", 0, null, 0], [8, "phone", "TEXT", 0, null, 0]], "primary_keys": ["cust_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "driver": {"columns": [[0, "driver_id", "INTEGER", 0, null, 1], [1, "first_name", "TEXT", 0, null, 0], [2, "last_name", "TEXT", 0, null, 0], [3, "address", "TEXT", 0, null, 0], [4, "city", "TEXT", 0, null, 0], [5, "state", "TEXT", 0, null, 0], [6, "zip_code", "INTEGER", 0, null, 0], [7, "phone", "TEXT", 0, null, 0]], "primary_keys": ["driver_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "truck": {"columns": [[0, "truck_id", "INTEGER", 0, null, 1], [1, "make", "TEXT", 0, null, 0], [2, "model_year", "INTEGER", 0, null, 0]], "primary_keys": ["truck_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "shipment": {"columns": [[0, "ship_id", "INTEGER", 0, null, 1], [1, "cust_id", "INTEGER", 0, null, 0], [2, "weight", "REAL", 0, null, 0], [3, "truck_id", "INTEGER", 0, null, 0], [4, "driver_id", "INTEGER", 0, null, 0], [5, "city_id", "INTEGER", 0, null, 0], [6, "ship_date", "TEXT", 0, null, 0]], "primary_keys": ["ship_id"], "foreign_keys": [[0, 0, "truck", "truck_id", "truck_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "driver", "driver_id", "driver_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "city", "city_id", "city_id", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "customer", "cust_id", "cust_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE city ( city_id INTEGER PRIMARY KEY, city_name TEXT, state TEXT, population INTEGER, area REAL ); CREATE TABLE customer ( cust_id INTEGER PRIMARY KEY, cust_name TEXT, annual_revenue INTEGER, cust_type TEXT, address TEXT, city TEXT, state TEXT, zip REAL, phone TEXT ); CREATE TABLE driver ( driver_id INTEGER PRIMARY KEY, first_name TEXT, last_name TEXT, address TEXT, city TEXT, state TEXT, zip_code INTEGER, phone TEXT ); CREATE TABLE truck ( truck_id INTEGER PRIMARY KEY, make TEXT, model_year INTEGER ); CREATE TABLE shipment ( ship_id INTEGER PRIMARY KEY, cust_id INTEGER, weight REAL, truck_id INTEGER, driver_id INTEGER, city_id INTEGER, ship_date TEXT, FOREIGN KEY (truck_id) REFERENCES truck(truck_id), FOREIGN KEY (driver_id) REFERENCES driver(driver_id), FOREIGN KEY (city_id) REFERENCES city(city_id), FOREIGN KEY (cust_id) REFERENCES customer(cust_id) );
computer_student
{"course": {"columns": [[0, "course_id", "INTEGER", 0, null, 1], [1, "courseLevel", "TEXT", 0, null, 0]], "primary_keys": ["course_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "person": {"columns": [[0, "p_id", "INTEGER", 0, null, 1], [1, "professor", "INTEGER", 0, null, 0], [2, "student", "INTEGER", 0, null, 0], [3, "hasPosition", "TEXT", 0, null, 0], [4, "inPhase", "TEXT", 0, null, 0], [5, "yearsInProgram", "TEXT", 0, null, 0]], "primary_keys": ["p_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "advisedBy": {"columns": [[0, "p_id", "INTEGER", 0, null, 1], [1, "p_id_dummy", "INTEGER", 0, null, 2]], "primary_keys": ["p_id", "p_id_dummy"], "foreign_keys": [[0, 0, "person", "p_id", "p_id", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "person", "p_id_dummy", "p_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "p_id"], [1, 1, "p_id_dummy"]]], "check_constraints": []}, "taughtBy": {"columns": [[0, "course_id", "INTEGER", 0, null, 1], [1, "p_id", "INTEGER", 0, null, 2]], "primary_keys": ["course_id", "p_id"], "foreign_keys": [[0, 0, "course", "course_id", "course_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "person", "p_id", "p_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "course_id"], [1, 1, "p_id"]]], "check_constraints": []}}
CREATE TABLE course ( course_id INTEGER PRIMARY KEY, courseLevel TEXT ); CREATE TABLE person ( p_id INTEGER PRIMARY KEY, professor INTEGER, student INTEGER, hasPosition TEXT, inPhase TEXT, yearsInProgram TEXT ); CREATE TABLE advisedBy ( p_id INTEGER PRIMARY KEY, p_id_dummy INTEGER PRIMARY KEY, PRIMARY KEY (p_id, p_id_dummy), UNIQUE (p_id, p_id_dummy), FOREIGN KEY (p_id) REFERENCES person(p_id), FOREIGN KEY (p_id_dummy) REFERENCES person(p_id) ); CREATE TABLE taughtBy ( course_id INTEGER PRIMARY KEY, p_id INTEGER PRIMARY KEY, PRIMARY KEY (course_id, p_id), UNIQUE (course_id, p_id), FOREIGN KEY (course_id) REFERENCES course(course_id), FOREIGN KEY (p_id) REFERENCES person(p_id) );
soccer_2016
{"Batting_Style": {"columns": [[0, "Batting_Id", "INTEGER", 0, null, 1], [1, "Batting_hand", "TEXT", 0, null, 0]], "primary_keys": ["Batting_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Bowling_Style": {"columns": [[0, "Bowling_Id", "INTEGER", 0, null, 1], [1, "Bowling_skill", "TEXT", 0, null, 0]], "primary_keys": ["Bowling_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "City": {"columns": [[0, "City_Id", "INTEGER", 0, null, 1], [1, "City_Name", "TEXT", 0, null, 0], [2, "Country_id", "INTEGER", 0, null, 0]], "primary_keys": ["City_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Country": {"columns": [[0, "Country_Id", "INTEGER", 0, null, 1], [1, "Country_Name", "TEXT", 0, null, 0]], "primary_keys": ["Country_Id"], "foreign_keys": [[0, 0, "Country", "Country_Id", "Country_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Extra_Type": {"columns": [[0, "Extra_Id", "INTEGER", 0, null, 1], [1, "Extra_Name", "TEXT", 0, null, 0]], "primary_keys": ["Extra_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Extra_Runs": {"columns": [[0, "Match_Id", "INTEGER", 0, null, 1], [1, "Over_Id", "INTEGER", 0, null, 2], [2, "Ball_Id", "INTEGER", 0, null, 3], [3, "Extra_Type_Id", "INTEGER", 0, null, 0], [4, "Extra_Runs", "INTEGER", 0, null, 0], [5, "Innings_No", "INTEGER", 0, null, 4]], "primary_keys": ["Match_Id", "Over_Id", "Ball_Id", "Innings_No"], "foreign_keys": [[0, 0, "Extra_Type", "Extra_Type_Id", "Extra_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Match_Id"], [1, 1, "Over_Id"], [2, 2, "Ball_Id"], [3, 5, "Innings_No"]]], "check_constraints": []}, "Out_Type": {"columns": [[0, "Out_Id", "INTEGER", 0, null, 1], [1, "Out_Name", "TEXT", 0, null, 0]], "primary_keys": ["Out_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Outcome": {"columns": [[0, "Outcome_Id", "INTEGER", 0, null, 1], [1, "Outcome_Type", "TEXT", 0, null, 0]], "primary_keys": ["Outcome_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Player": {"columns": [[0, "Player_Id", "INTEGER", 0, null, 1], [1, "Player_Name", "TEXT", 0, null, 0], [2, "DOB", "DATE", 0, null, 0], [3, "Batting_hand", "INTEGER", 0, null, 0], [4, "Bowling_skill", "INTEGER", 0, null, 0], [5, "Country_Name", "INTEGER", 0, null, 0]], "primary_keys": ["Player_Id"], "foreign_keys": [[0, 0, "Country", "Country_Name", "Country_Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Bowling_Style", "Bowling_skill", "Bowling_Id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Batting_Style", "Batting_hand", "Batting_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Rolee": {"columns": [[0, "Role_Id", "INTEGER", 0, null, 1], [1, "Role_Desc", "TEXT", 0, null, 0]], "primary_keys": ["Role_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Season": {"columns": [[0, "Season_Id", "INTEGER", 0, null, 1], [1, "Man_of_the_Series", "INTEGER", 0, null, 0], [2, "Orange_Cap", "INTEGER", 0, null, 0], [3, "Purple_Cap", "INTEGER", 0, null, 0], [4, "Season_Year", "INTEGER", 0, null, 0]], "primary_keys": ["Season_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Team": {"columns": [[0, "Team_Id", "INTEGER", 0, null, 1], [1, "Team_Name", "TEXT", 0, null, 0]], "primary_keys": ["Team_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Toss_Decision": {"columns": [[0, "Toss_Id", "INTEGER", 0, null, 1], [1, "Toss_Name", "TEXT", 0, null, 0]], "primary_keys": ["Toss_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Umpire": {"columns": [[0, "Umpire_Id", "INTEGER", 0, null, 1], [1, "Umpire_Name", "TEXT", 0, null, 0], [2, "Umpire_Country", "INTEGER", 0, null, 0]], "primary_keys": ["Umpire_Id"], "foreign_keys": [[0, 0, "Country", "Umpire_Country", "Country_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Venue": {"columns": [[0, "Venue_Id", "INTEGER", 0, null, 1], [1, "Venue_Name", "TEXT", 0, null, 0], [2, "City_Id", "INTEGER", 0, null, 0]], "primary_keys": ["Venue_Id"], "foreign_keys": [[0, 0, "City", "City_Id", "City_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Win_By": {"columns": [[0, "Win_Id", "INTEGER", 0, null, 1], [1, "Win_Type", "TEXT", 0, null, 0]], "primary_keys": ["Win_Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Match": {"columns": [[0, "Match_Id", "INTEGER", 0, null, 1], [1, "Team_1", "INTEGER", 0, null, 0], [2, "Team_2", "INTEGER", 0, null, 0], [3, "Match_Date", "DATE", 0, null, 0], [4, "Season_Id", "INTEGER", 0, null, 0], [5, "Venue_Id", "INTEGER", 0, null, 0], [6, "Toss_Winner", "INTEGER", 0, null, 0], [7, "Toss_Decide", "INTEGER", 0, null, 0], [8, "Win_Type", "INTEGER", 0, null, 0], [9, "Win_Margin", "INTEGER", 0, null, 0], [10, "Outcome_type", "INTEGER", 0, null, 0], [11, "Match_Winner", "INTEGER", 0, null, 0], [12, "Man_of_the_Match", "INTEGER", 0, null, 0]], "primary_keys": ["Match_Id"], "foreign_keys": [[0, 0, "Player", "Man_of_the_Match", "Player_Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Team", "Match_Winner", "Team_Id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Out_Type", "Outcome_type", "Out_Id", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Win_By", "Win_Type", "Win_Id", "NO ACTION", "NO ACTION", "NONE"], [4, 0, "Toss_Decision", "Toss_Decide", "Toss_Id", "NO ACTION", "NO ACTION", "NONE"], [5, 0, "Team", "Toss_Winner", "Team_Id", "NO ACTION", "NO ACTION", "NONE"], [6, 0, "Venue", "Venue_Id", "Venue_Id", "NO ACTION", "NO ACTION", "NONE"], [7, 0, "Season", "Season_Id", "Season_Id", "NO ACTION", "NO ACTION", "NONE"], [8, 0, "Team", "Team_2", "Team_Id", "NO ACTION", "NO ACTION", "NONE"], [9, 0, "Team", "Team_1", "Team_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Ball_by_Ball": {"columns": [[0, "Match_Id", "INTEGER", 0, null, 1], [1, "Over_Id", "INTEGER", 0, null, 2], [2, "Ball_Id", "INTEGER", 0, null, 3], [3, "Innings_No", "INTEGER", 0, null, 4], [4, "Team_Batting", "INTEGER", 0, null, 0], [5, "Team_Bowling", "INTEGER", 0, null, 0], [6, "Striker_Batting_Position", "INTEGER", 0, null, 0], [7, "Striker", "INTEGER", 0, null, 0], [8, "Non_Striker", "INTEGER", 0, null, 0], [9, "Bowler", "INTEGER", 0, null, 0]], "primary_keys": ["Match_Id", "Over_Id", "Ball_Id", "Innings_No"], "foreign_keys": [[0, 0, "Match", "Match_Id", "Match_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Match_Id"], [1, 1, "Over_Id"], [2, 2, "Ball_Id"], [3, 3, "Innings_No"]]], "check_constraints": []}, "Batsman_Scored": {"columns": [[0, "Match_Id", "INTEGER", 0, null, 1], [1, "Over_Id", "INTEGER", 0, null, 2], [2, "Ball_Id", "INTEGER", 0, null, 3], [3, "Runs_Scored", "INTEGER", 0, null, 0], [4, "Innings_No", "INTEGER", 0, null, 4]], "primary_keys": ["Match_Id", "Over_Id", "Ball_Id", "Innings_No"], "foreign_keys": [[0, 0, "Match", "Match_Id", "Match_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Match_Id"], [1, 1, "Over_Id"], [2, 2, "Ball_Id"], [3, 4, "Innings_No"]]], "check_constraints": []}, "Player_Match": {"columns": [[0, "Match_Id", "INTEGER", 0, null, 1], [1, "Player_Id", "INTEGER", 0, null, 2], [2, "Role_Id", "INTEGER", 0, null, 3], [3, "Team_Id", "INTEGER", 0, null, 0]], "primary_keys": ["Match_Id", "Player_Id", "Role_Id"], "foreign_keys": [[0, 0, "Rolee", "Role_Id", "Role_Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Team", "Team_Id", "Team_Id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Player", "Player_Id", "Player_Id", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Match", "Match_Id", "Match_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Match_Id"], [1, 1, "Player_Id"], [2, 2, "Role_Id"]]], "check_constraints": []}, "Wicket_Taken": {"columns": [[0, "Match_Id", "INTEGER", 0, null, 1], [1, "Over_Id", "INTEGER", 0, null, 2], [2, "Ball_Id", "INTEGER", 0, null, 3], [3, "Player_Out", "INTEGER", 0, null, 0], [4, "Kind_Out", "INTEGER", 0, null, 0], [5, "Fielders", "INTEGER", 0, null, 0], [6, "Innings_No", "INTEGER", 0, null, 4]], "primary_keys": ["Match_Id", "Over_Id", "Ball_Id", "Innings_No"], "foreign_keys": [[0, 0, "Player", "Fielders", "Player_Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Out_Type", "Kind_Out", "Out_Id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Player", "Player_Out", "Player_Id", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Match", "Match_Id", "Match_Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Match_Id"], [1, 1, "Over_Id"], [2, 2, "Ball_Id"], [3, 6, "Innings_No"]]], "check_constraints": []}}
CREATE TABLE Batting_Style ( Batting_Id INTEGER PRIMARY KEY, Batting_hand TEXT ); CREATE TABLE Bowling_Style ( Bowling_Id INTEGER PRIMARY KEY, Bowling_skill TEXT ); CREATE TABLE City ( City_Id INTEGER PRIMARY KEY, City_Name TEXT, Country_id INTEGER ); CREATE TABLE Country ( Country_Id INTEGER PRIMARY KEY, Country_Name TEXT, FOREIGN KEY (Country_Id) REFERENCES Country(Country_Id) ); CREATE TABLE Extra_Type ( Extra_Id INTEGER PRIMARY KEY, Extra_Name TEXT ); CREATE TABLE Extra_Runs ( Match_Id INTEGER PRIMARY KEY, Over_Id INTEGER PRIMARY KEY, Ball_Id INTEGER PRIMARY KEY, Extra_Type_Id INTEGER, Extra_Runs INTEGER, Innings_No INTEGER PRIMARY KEY, PRIMARY KEY (Match_Id, Over_Id, Ball_Id, Innings_No), UNIQUE (Match_Id, Over_Id, Ball_Id, Innings_No), FOREIGN KEY (Extra_Type_Id) REFERENCES Extra_Type(Extra_Id) ); CREATE TABLE Out_Type ( Out_Id INTEGER PRIMARY KEY, Out_Name TEXT ); CREATE TABLE Outcome ( Outcome_Id INTEGER PRIMARY KEY, Outcome_Type TEXT ); CREATE TABLE Player ( Player_Id INTEGER PRIMARY KEY, Player_Name TEXT, DOB DATE, Batting_hand INTEGER, Bowling_skill INTEGER, Country_Name INTEGER, FOREIGN KEY (Country_Name) REFERENCES Country(Country_Id), FOREIGN KEY (Bowling_skill) REFERENCES Bowling_Style(Bowling_Id), FOREIGN KEY (Batting_hand) REFERENCES Batting_Style(Batting_Id) ); CREATE TABLE Rolee ( Role_Id INTEGER PRIMARY KEY, Role_Desc TEXT ); CREATE TABLE Season ( Season_Id INTEGER PRIMARY KEY, Man_of_the_Series INTEGER, Orange_Cap INTEGER, Purple_Cap INTEGER, Season_Year INTEGER ); CREATE TABLE Team ( Team_Id INTEGER PRIMARY KEY, Team_Name TEXT ); CREATE TABLE Toss_Decision ( Toss_Id INTEGER PRIMARY KEY, Toss_Name TEXT ); CREATE TABLE Umpire ( Umpire_Id INTEGER PRIMARY KEY, Umpire_Name TEXT, Umpire_Country INTEGER, FOREIGN KEY (Umpire_Country) REFERENCES Country(Country_Id) ); CREATE TABLE Venue ( Venue_Id INTEGER PRIMARY KEY, Venue_Name TEXT, City_Id INTEGER, FOREIGN KEY (City_Id) REFERENCES City(City_Id) ); CREATE TABLE Win_By ( Win_Id INTEGER PRIMARY KEY, Win_Type TEXT ); CREATE TABLE Match ( Match_Id INTEGER PRIMARY KEY, Team_1 INTEGER, Team_2 INTEGER, Match_Date DATE, Season_Id INTEGER, Venue_Id INTEGER, Toss_Winner INTEGER, Toss_Decide INTEGER, Win_Type INTEGER, Win_Margin INTEGER, Outcome_type INTEGER, Match_Winner INTEGER, Man_of_the_Match INTEGER, FOREIGN KEY (Man_of_the_Match) REFERENCES Player(Player_Id), FOREIGN KEY (Match_Winner) REFERENCES Team(Team_Id), FOREIGN KEY (Outcome_type) REFERENCES Out_Type(Out_Id), FOREIGN KEY (Win_Type) REFERENCES Win_By(Win_Id), FOREIGN KEY (Toss_Decide) REFERENCES Toss_Decision(Toss_Id), FOREIGN KEY (Toss_Winner) REFERENCES Team(Team_Id), FOREIGN KEY (Venue_Id) REFERENCES Venue(Venue_Id), FOREIGN KEY (Season_Id) REFERENCES Season(Season_Id), FOREIGN KEY (Team_2) REFERENCES Team(Team_Id), FOREIGN KEY (Team_1) REFERENCES Team(Team_Id) ); CREATE TABLE Ball_by_Ball ( Match_Id INTEGER PRIMARY KEY, Over_Id INTEGER PRIMARY KEY, Ball_Id INTEGER PRIMARY KEY, Innings_No INTEGER PRIMARY KEY, Team_Batting INTEGER, Team_Bowling INTEGER, Striker_Batting_Position INTEGER, Striker INTEGER, Non_Striker INTEGER, Bowler INTEGER, PRIMARY KEY (Match_Id, Over_Id, Ball_Id, Innings_No), UNIQUE (Match_Id, Over_Id, Ball_Id, Innings_No), FOREIGN KEY (Match_Id) REFERENCES Match(Match_Id) ); CREATE TABLE Batsman_Scored ( Match_Id INTEGER PRIMARY KEY, Over_Id INTEGER PRIMARY KEY, Ball_Id INTEGER PRIMARY KEY, Runs_Scored INTEGER, Innings_No INTEGER PRIMARY KEY, PRIMARY KEY (Match_Id, Over_Id, Ball_Id, Innings_No), UNIQUE (Match_Id, Over_Id, Ball_Id, Innings_No), FOREIGN KEY (Match_Id) REFERENCES Match(Match_Id) ); CREATE TABLE Player_Match ( Match_Id INTEGER PRIMARY KEY, Player_Id INTEGER PRIMARY KEY, Role_Id INTEGER PRIMARY KEY, Team_Id INTEGER, PRIMARY KEY (Match_Id, Player_Id, Role_Id), UNIQUE (Match_Id, Player_Id, Role_Id), FOREIGN KEY (Role_Id) REFERENCES Rolee(Role_Id), FOREIGN KEY (Team_Id) REFERENCES Team(Team_Id), FOREIGN KEY (Player_Id) REFERENCES Player(Player_Id), FOREIGN KEY (Match_Id) REFERENCES Match(Match_Id) ); CREATE TABLE Wicket_Taken ( Match_Id INTEGER PRIMARY KEY, Over_Id INTEGER PRIMARY KEY, Ball_Id INTEGER PRIMARY KEY, Player_Out INTEGER, Kind_Out INTEGER, Fielders INTEGER, Innings_No INTEGER PRIMARY KEY, PRIMARY KEY (Match_Id, Over_Id, Ball_Id, Innings_No), UNIQUE (Match_Id, Over_Id, Ball_Id, Innings_No), FOREIGN KEY (Fielders) REFERENCES Player(Player_Id), FOREIGN KEY (Kind_Out) REFERENCES Out_Type(Out_Id), FOREIGN KEY (Player_Out) REFERENCES Player(Player_Id), FOREIGN KEY (Match_Id) REFERENCES Match(Match_Id) );
sales
{"Customers": {"columns": [[0, "CustomerID", "INTEGER", 1, null, 1], [1, "FirstName", "TEXT", 1, null, 0], [2, "MiddleInitial", "TEXT", 0, null, 0], [3, "LastName", "TEXT", 1, null, 0]], "primary_keys": ["CustomerID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Employees": {"columns": [[0, "EmployeeID", "INTEGER", 1, null, 1], [1, "FirstName", "TEXT", 1, null, 0], [2, "MiddleInitial", "TEXT", 0, null, 0], [3, "LastName", "TEXT", 1, null, 0]], "primary_keys": ["EmployeeID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "ProductID", "INTEGER", 1, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "Price", "REAL", 0, null, 0]], "primary_keys": ["ProductID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Sales": {"columns": [[0, "SalesID", "INTEGER", 1, null, 1], [1, "SalesPersonID", "INTEGER", 1, null, 0], [2, "CustomerID", "INTEGER", 1, null, 0], [3, "ProductID", "INTEGER", 1, null, 0], [4, "Quantity", "INTEGER", 1, null, 0]], "primary_keys": ["SalesID"], "foreign_keys": [[0, 0, "Products", "ProductID", "ProductID", "CASCADE", "CASCADE", "NONE"], [1, 0, "Customers", "CustomerID", "CustomerID", "CASCADE", "CASCADE", "NONE"], [2, 0, "Employees", "SalesPersonID", "EmployeeID", "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Customers ( CustomerID INTEGER NOT NULL PRIMARY KEY, FirstName TEXT NOT NULL, MiddleInitial TEXT, LastName TEXT NOT NULL ); CREATE TABLE Employees ( EmployeeID INTEGER NOT NULL PRIMARY KEY, FirstName TEXT NOT NULL, MiddleInitial TEXT, LastName TEXT NOT NULL ); CREATE TABLE Products ( ProductID INTEGER NOT NULL PRIMARY KEY, Name TEXT NOT NULL, Price REAL ); CREATE TABLE Sales ( SalesID INTEGER NOT NULL PRIMARY KEY, SalesPersonID INTEGER NOT NULL, CustomerID INTEGER NOT NULL, ProductID INTEGER NOT NULL, Quantity INTEGER NOT NULL, FOREIGN KEY (ProductID) REFERENCES Products(ProductID), FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID), FOREIGN KEY (SalesPersonID) REFERENCES Employees(EmployeeID) );
movielens
{"users": {"columns": [[0, "userid", "INTEGER", 1, "0", 1], [1, "age", "TEXT", 1, null, 0], [2, "u_gender", "TEXT", 1, null, 0], [3, "occupation", "TEXT", 1, null, 0]], "primary_keys": ["userid"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "directors": {"columns": [[0, "directorid", "INTEGER", 1, null, 1], [1, "d_quality", "INTEGER", 1, null, 0], [2, "avg_revenue", "INTEGER", 1, null, 0]], "primary_keys": ["directorid"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "actors": {"columns": [[0, "actorid", "INTEGER", 1, null, 1], [1, "a_gender", "TEXT", 1, null, 0], [2, "a_quality", "INTEGER", 1, null, 0]], "primary_keys": ["actorid"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "movies": {"columns": [[0, "movieid", "INTEGER", 1, "0", 1], [1, "year", "INTEGER", 1, null, 0], [2, "isEnglish", "TEXT", 1, null, 0], [3, "country", "TEXT", 1, null, 0], [4, "runningtime", "INTEGER", 1, null, 0]], "primary_keys": ["movieid"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "movies2actors": {"columns": [[0, "movieid", "INTEGER", 1, null, 1], [1, "actorid", "INTEGER", 1, null, 2], [2, "cast_num", "INTEGER", 1, null, 0]], "primary_keys": ["movieid", "actorid"], "foreign_keys": [[0, 0, "actors", "actorid", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "movies", "movieid", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "movieid"], [1, 1, "actorid"]]], "check_constraints": []}, "movies2directors": {"columns": [[0, "movieid", "INTEGER", 1, null, 1], [1, "directorid", "INTEGER", 1, null, 2], [2, "genre", "TEXT", 1, null, 0]], "primary_keys": ["movieid", "directorid"], "foreign_keys": [[0, 0, "directors", "directorid", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "movies", "movieid", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "movieid"], [1, 1, "directorid"]]], "check_constraints": []}, "u2base": {"columns": [[0, "userid", "INTEGER", 1, "0", 1], [1, "movieid", "INTEGER", 1, null, 2], [2, "rating", "TEXT", 1, null, 0]], "primary_keys": ["userid", "movieid"], "foreign_keys": [[0, 0, "movies", "movieid", null, "CASCADE", "CASCADE", "NONE"], [1, 0, "users", "userid", null, "CASCADE", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "userid"], [1, 1, "movieid"]]], "check_constraints": []}}
CREATE TABLE users ( userid INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, age TEXT NOT NULL, u_gender TEXT NOT NULL, occupation TEXT NOT NULL ); CREATE TABLE directors ( directorid INTEGER NOT NULL PRIMARY KEY, d_quality INTEGER NOT NULL, avg_revenue INTEGER NOT NULL ); CREATE TABLE actors ( actorid INTEGER NOT NULL PRIMARY KEY, a_gender TEXT NOT NULL, a_quality INTEGER NOT NULL ); CREATE TABLE movies ( movieid INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, year INTEGER NOT NULL, isEnglish TEXT NOT NULL, country TEXT NOT NULL, runningtime INTEGER NOT NULL ); CREATE TABLE movies2actors ( movieid INTEGER NOT NULL PRIMARY KEY, actorid INTEGER NOT NULL PRIMARY KEY, cast_num INTEGER NOT NULL, PRIMARY KEY (movieid, actorid), UNIQUE (movieid, actorid), FOREIGN KEY (actorid) REFERENCES actors(None), FOREIGN KEY (movieid) REFERENCES movies(None) ); CREATE TABLE movies2directors ( movieid INTEGER NOT NULL PRIMARY KEY, directorid INTEGER NOT NULL PRIMARY KEY, genre TEXT NOT NULL, PRIMARY KEY (movieid, directorid), UNIQUE (movieid, directorid), FOREIGN KEY (directorid) REFERENCES directors(None), FOREIGN KEY (movieid) REFERENCES movies(None) ); CREATE TABLE u2base ( userid INTEGER NOT NULL DEFAULT 0 PRIMARY KEY, movieid INTEGER NOT NULL PRIMARY KEY, rating TEXT NOT NULL, PRIMARY KEY (userid, movieid), UNIQUE (userid, movieid), FOREIGN KEY (movieid) REFERENCES movies(None), FOREIGN KEY (userid) REFERENCES users(None) );
works_cycles
{"sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "CountryRegion": {"columns": [[0, "CountryRegionCode", "TEXT", 1, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["CountryRegionCode"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Name"]], [[0, 0, "CountryRegionCode"]]], "check_constraints": []}, "Culture": {"columns": [[0, "CultureID", "TEXT", 1, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["CultureID"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Name"]], [[0, 0, "CultureID"]]], "check_constraints": []}, "Currency": {"columns": [[0, "CurrencyCode", "TEXT", 1, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["CurrencyCode"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Name"]], [[0, 0, "CurrencyCode"]]], "check_constraints": []}, "CountryRegionCurrency": {"columns": [[0, "CountryRegionCode", "TEXT", 1, null, 1], [1, "CurrencyCode", "TEXT", 1, null, 2], [2, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["CountryRegionCode", "CurrencyCode"], "foreign_keys": [[0, 0, "Currency", "CurrencyCode", "CurrencyCode", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "CountryRegion", "CountryRegionCode", "CountryRegionCode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "CountryRegionCode"], [1, 1, "CurrencyCode"]]], "check_constraints": []}, "Person": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "PersonType", "TEXT", 1, null, 0], [2, "NameStyle", "INTEGER", 1, "0", 0], [3, "Title", "TEXT", 0, null, 0], [4, "FirstName", "TEXT", 1, null, 0], [5, "MiddleName", "TEXT", 0, null, 0], [6, "LastName", "TEXT", 1, null, 0], [7, "Suffix", "TEXT", 0, null, 0], [8, "EmailPromotion", "INTEGER", 1, "0", 0], [9, "AdditionalContactInfo", "TEXT", 0, null, 0], [10, "Demographics", "TEXT", 0, null, 0], [11, "rowguid", "TEXT", 1, null, 0], [12, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID"], "foreign_keys": [[0, 0, "BusinessEntity", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 11, "rowguid"]]], "check_constraints": []}, "BusinessEntityContact": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "PersonID", "INTEGER", 1, null, 2], [2, "ContactTypeID", "INTEGER", 1, null, 3], [3, "rowguid", "TEXT", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID", "PersonID", "ContactTypeID"], "foreign_keys": [[0, 0, "Person", "PersonID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "ContactType", "ContactTypeID", "ContactTypeID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "BusinessEntity", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "BusinessEntityID"], [1, 1, "PersonID"], [2, 2, "ContactTypeID"]], [[0, 3, "rowguid"]]], "check_constraints": []}, "EmailAddress": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 2], [1, "EmailAddressID", "INTEGER", 0, null, 1], [2, "EmailAddress", "TEXT", 0, null, 0], [3, "rowguid", "TEXT", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID", "EmailAddressID"], "foreign_keys": [[0, 0, "Person", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "EmailAddressID"], [1, 0, "BusinessEntityID"]]], "check_constraints": []}, "Employee": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "NationalIDNumber", "TEXT", 1, null, 0], [2, "LoginID", "TEXT", 1, null, 0], [3, "OrganizationNode", "TEXT", 0, null, 0], [4, "OrganizationLevel", "INTEGER", 0, null, 0], [5, "JobTitle", "TEXT", 1, null, 0], [6, "BirthDate", "DATE", 1, null, 0], [7, "MaritalStatus", "TEXT", 1, null, 0], [8, "Gender", "TEXT", 1, null, 0], [9, "HireDate", "DATE", 1, null, 0], [10, "SalariedFlag", "INTEGER", 1, "1", 0], [11, "VacationHours", "INTEGER", 1, "0", 0], [12, "SickLeaveHours", "INTEGER", 1, "0", 0], [13, "CurrentFlag", "INTEGER", 1, "1", 0], [14, "rowguid", "TEXT", 1, null, 0], [15, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID"], "foreign_keys": [[0, 0, "Person", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 14, "rowguid"]], [[0, 2, "LoginID"]], [[0, 1, "NationalIDNumber"]]], "check_constraints": []}, "Password": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "PasswordHash", "TEXT", 1, null, 0], [2, "PasswordSalt", "TEXT", 1, null, 0], [3, "rowguid", "TEXT", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID"], "foreign_keys": [[0, 0, "Person", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "PersonCreditCard": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "CreditCardID", "INTEGER", 1, null, 2], [2, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID", "CreditCardID"], "foreign_keys": [[0, 0, "Person", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "CreditCard", "CreditCardID", "CreditCardID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "BusinessEntityID"], [1, 1, "CreditCardID"]]], "check_constraints": []}, "ProductCategory": {"columns": [[0, "ProductCategoryID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "rowguid", "TEXT", 1, null, 0], [3, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductCategoryID"], "foreign_keys": [], "unique_constraints": [[[0, 2, "rowguid"]], [[0, 1, "Name"]]], "check_constraints": []}, "ProductDescription": {"columns": [[0, "ProductDescriptionID", "INTEGER", 0, null, 1], [1, "Description", "TEXT", 1, null, 0], [2, "rowguid", "TEXT", 1, null, 0], [3, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductDescriptionID"], "foreign_keys": [], "unique_constraints": [[[0, 2, "rowguid"]]], "check_constraints": []}, "ProductModel": {"columns": [[0, "ProductModelID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "CatalogDescription", "TEXT", 0, null, 0], [3, "Instructions", "TEXT", 0, null, 0], [4, "rowguid", "TEXT", 1, null, 0], [5, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductModelID"], "foreign_keys": [], "unique_constraints": [[[0, 4, "rowguid"]], [[0, 1, "Name"]]], "check_constraints": []}, "ProductModelProductDescriptionCulture": {"columns": [[0, "ProductModelID", "INTEGER", 1, null, 1], [1, "ProductDescriptionID", "INTEGER", 1, null, 2], [2, "CultureID", "TEXT", 1, null, 3], [3, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductModelID", "ProductDescriptionID", "CultureID"], "foreign_keys": [[0, 0, "Culture", "CultureID", "CultureID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "ProductDescription", "ProductDescriptionID", "ProductDescriptionID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "ProductModel", "ProductModelID", "ProductModelID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ProductModelID"], [1, 1, "ProductDescriptionID"], [2, 2, "CultureID"]]], "check_constraints": []}, "ProductPhoto": {"columns": [[0, "ProductPhotoID", "INTEGER", 0, null, 1], [1, "ThumbNailPhoto", "BLOB", 0, null, 0], [2, "ThumbnailPhotoFileName", "TEXT", 0, null, 0], [3, "LargePhoto", "BLOB", 0, null, 0], [4, "LargePhotoFileName", "TEXT", 0, null, 0], [5, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductPhotoID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "ProductSubcategory": {"columns": [[0, "ProductSubcategoryID", "INTEGER", 0, null, 1], [1, "ProductCategoryID", "INTEGER", 1, null, 0], [2, "Name", "TEXT", 1, null, 0], [3, "rowguid", "TEXT", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductSubcategoryID"], "foreign_keys": [[0, 0, "ProductCategory", "ProductCategoryID", "ProductCategoryID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 3, "rowguid"]], [[0, 2, "Name"]]], "check_constraints": []}, "SalesReason": {"columns": [[0, "SalesReasonID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ReasonType", "TEXT", 1, null, 0], [3, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["SalesReasonID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "SalesTerritory": {"columns": [[0, "TerritoryID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "CountryRegionCode", "TEXT", 1, null, 0], [3, "Group", "TEXT", 1, null, 0], [4, "SalesYTD", "REAL", 1, "0.0000", 0], [5, "SalesLastYear", "REAL", 1, "0.0000", 0], [6, "CostYTD", "REAL", 1, "0.0000", 0], [7, "CostLastYear", "REAL", 1, "0.0000", 0], [8, "rowguid", "TEXT", 1, null, 0], [9, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["TerritoryID"], "foreign_keys": [[0, 0, "CountryRegion", "CountryRegionCode", "CountryRegionCode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 8, "rowguid"]], [[0, 1, "Name"]]], "check_constraints": []}, "SalesPerson": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "TerritoryID", "INTEGER", 0, null, 0], [2, "SalesQuota", "REAL", 0, null, 0], [3, "Bonus", "REAL", 1, "0.0000", 0], [4, "CommissionPct", "REAL", 1, "0.0000", 0], [5, "SalesYTD", "REAL", 1, "0.0000", 0], [6, "SalesLastYear", "REAL", 1, "0.0000", 0], [7, "rowguid", "TEXT", 1, null, 0], [8, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["BusinessEntityID"], "foreign_keys": [[0, 0, "SalesTerritory", "TerritoryID", "TerritoryID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Employee", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 7, "rowguid"]]], "check_constraints": []}, "SalesPersonQuotaHistory": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "QuotaDate", "DATETIME", 1, null, 2], [2, "SalesQuota", "REAL", 1, null, 0], [3, "rowguid", "TEXT", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["BusinessEntityID", "QuotaDate"], "foreign_keys": [[0, 0, "SalesPerson", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "BusinessEntityID"], [1, 1, "QuotaDate"]], [[0, 3, "rowguid"]]], "check_constraints": []}, "SalesTerritoryHistory": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "TerritoryID", "INTEGER", 1, null, 3], [2, "StartDate", "DATETIME", 1, null, 2], [3, "EndDate", "DATETIME", 0, null, 0], [4, "rowguid", "TEXT", 1, null, 0], [5, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["BusinessEntityID", "TerritoryID", "StartDate"], "foreign_keys": [[0, 0, "SalesTerritory", "TerritoryID", "TerritoryID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "SalesPerson", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "BusinessEntityID"], [1, 2, "StartDate"], [2, 1, "TerritoryID"]], [[0, 4, "rowguid"]]], "check_constraints": []}, "ScrapReason": {"columns": [[0, "ScrapReasonID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ScrapReasonID"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Name"]]], "check_constraints": []}, "Shift": {"columns": [[0, "ShiftID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "StartTime", "TEXT", 1, null, 0], [3, "EndTime", "TEXT", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ShiftID"], "foreign_keys": [], "unique_constraints": [[[0, 2, "StartTime"], [1, 3, "EndTime"]], [[0, 1, "Name"]]], "check_constraints": []}, "ShipMethod": {"columns": [[0, "ShipMethodID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ShipBase", "REAL", 1, "0.0000", 0], [3, "ShipRate", "REAL", 1, "0.0000", 0], [4, "rowguid", "TEXT", 1, null, 0], [5, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ShipMethodID"], "foreign_keys": [], "unique_constraints": [[[0, 4, "rowguid"]], [[0, 1, "Name"]]], "check_constraints": []}, "SpecialOffer": {"columns": [[0, "SpecialOfferID", "INTEGER", 0, null, 1], [1, "Description", "TEXT", 1, null, 0], [2, "DiscountPct", "REAL", 1, "0.0000", 0], [3, "Type", "TEXT", 1, null, 0], [4, "Category", "TEXT", 1, null, 0], [5, "StartDate", "DATETIME", 1, null, 0], [6, "EndDate", "DATETIME", 1, null, 0], [7, "MinQty", "INTEGER", 1, "0", 0], [8, "MaxQty", "INTEGER", 0, null, 0], [9, "rowguid", "TEXT", 1, null, 0], [10, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["SpecialOfferID"], "foreign_keys": [], "unique_constraints": [[[0, 9, "rowguid"]]], "check_constraints": []}, "BusinessEntityAddress": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "AddressID", "INTEGER", 1, null, 2], [2, "AddressTypeID", "INTEGER", 1, null, 3], [3, "rowguid", "TEXT", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID", "AddressID", "AddressTypeID"], "foreign_keys": [[0, 0, "BusinessEntity", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "AddressType", "AddressTypeID", "AddressTypeID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Address", "AddressID", "AddressID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "BusinessEntityID"], [1, 1, "AddressID"], [2, 2, "AddressTypeID"]], [[0, 3, "rowguid"]]], "check_constraints": []}, "SalesTaxRate": {"columns": [[0, "SalesTaxRateID", "INTEGER", 0, null, 1], [1, "StateProvinceID", "INTEGER", 1, null, 0], [2, "TaxType", "INTEGER", 1, null, 0], [3, "TaxRate", "REAL", 1, "0.0000", 0], [4, "Name", "TEXT", 1, null, 0], [5, "rowguid", "TEXT", 1, null, 0], [6, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["SalesTaxRateID"], "foreign_keys": [[0, 0, "StateProvince", "StateProvinceID", "StateProvinceID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "StateProvinceID"], [1, 2, "TaxType"]], [[0, 5, "rowguid"]]], "check_constraints": []}, "Store": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "SalesPersonID", "INTEGER", 0, null, 0], [3, "Demographics", "TEXT", 0, null, 0], [4, "rowguid", "TEXT", 1, null, 0], [5, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["BusinessEntityID"], "foreign_keys": [[0, 0, "SalesPerson", "SalesPersonID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "BusinessEntity", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 4, "rowguid"]]], "check_constraints": []}, "SalesOrderHeaderSalesReason": {"columns": [[0, "SalesOrderID", "INTEGER", 1, null, 1], [1, "SalesReasonID", "INTEGER", 1, null, 2], [2, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["SalesOrderID", "SalesReasonID"], "foreign_keys": [[0, 0, "SalesReason", "SalesReasonID", "SalesReasonID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "SalesOrderHeader", "SalesOrderID", "SalesOrderID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "SalesOrderID"], [1, 1, "SalesReasonID"]]], "check_constraints": []}, "TransactionHistoryArchive": {"columns": [[0, "TransactionID", "INTEGER", 1, null, 1], [1, "ProductID", "INTEGER", 1, null, 0], [2, "ReferenceOrderID", "INTEGER", 1, null, 0], [3, "ReferenceOrderLineID", "INTEGER", 1, "0", 0], [4, "TransactionDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0], [5, "TransactionType", "TEXT", 1, null, 0], [6, "Quantity", "INTEGER", 1, null, 0], [7, "ActualCost", "REAL", 1, null, 0], [8, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["TransactionID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "UnitMeasure": {"columns": [[0, "UnitMeasureCode", "TEXT", 1, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["UnitMeasureCode"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Name"]], [[0, 0, "UnitMeasureCode"]]], "check_constraints": []}, "ProductCostHistory": {"columns": [[0, "ProductID", "INTEGER", 1, null, 1], [1, "StartDate", "DATE", 1, null, 2], [2, "EndDate", "DATE", 0, null, 0], [3, "StandardCost", "REAL", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductID", "StartDate"], "foreign_keys": [[0, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ProductID"], [1, 1, "StartDate"]]], "check_constraints": []}, "ProductDocument": {"columns": [[0, "ProductID", "INTEGER", 1, null, 1], [1, "DocumentNode", "TEXT", 1, null, 2], [2, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductID", "DocumentNode"], "foreign_keys": [[0, 0, "Document", "DocumentNode", "DocumentNode", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ProductID"], [1, 1, "DocumentNode"]]], "check_constraints": []}, "ProductInventory": {"columns": [[0, "ProductID", "INTEGER", 1, null, 1], [1, "LocationID", "INTEGER", 1, null, 2], [2, "Shelf", "TEXT", 1, null, 0], [3, "Bin", "INTEGER", 1, null, 0], [4, "Quantity", "INTEGER", 1, "0", 0], [5, "rowguid", "TEXT", 1, null, 0], [6, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductID", "LocationID"], "foreign_keys": [[0, 0, "Location", "LocationID", "LocationID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ProductID"], [1, 1, "LocationID"]]], "check_constraints": []}, "ProductProductPhoto": {"columns": [[0, "ProductID", "INTEGER", 1, null, 1], [1, "ProductPhotoID", "INTEGER", 1, null, 2], [2, "Primary", "INTEGER", 1, "0", 0], [3, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductID", "ProductPhotoID"], "foreign_keys": [[0, 0, "ProductPhoto", "ProductPhotoID", "ProductPhotoID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ProductID"], [1, 1, "ProductPhotoID"]]], "check_constraints": []}, "ProductReview": {"columns": [[0, "ProductReviewID", "INTEGER", 0, null, 1], [1, "ProductID", "INTEGER", 1, null, 0], [2, "ReviewerName", "TEXT", 1, null, 0], [3, "ReviewDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0], [4, "EmailAddress", "TEXT", 1, null, 0], [5, "Rating", "INTEGER", 1, null, 0], [6, "Comments", "TEXT", 0, null, 0], [7, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductReviewID"], "foreign_keys": [[0, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "ShoppingCartItem": {"columns": [[0, "ShoppingCartItemID", "INTEGER", 0, null, 1], [1, "ShoppingCartID", "TEXT", 1, null, 0], [2, "Quantity", "INTEGER", 1, "1", 0], [3, "ProductID", "INTEGER", 1, null, 0], [4, "DateCreated", "DATETIME", 1, "CURRENT_TIMESTAMP", 0], [5, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ShoppingCartItemID"], "foreign_keys": [[0, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "SpecialOfferProduct": {"columns": [[0, "SpecialOfferID", "INTEGER", 1, null, 1], [1, "ProductID", "INTEGER", 1, null, 2], [2, "rowguid", "TEXT", 1, null, 0], [3, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["SpecialOfferID", "ProductID"], "foreign_keys": [[0, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "SpecialOffer", "SpecialOfferID", "SpecialOfferID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "SpecialOfferID"], [1, 1, "ProductID"]], [[0, 2, "rowguid"]]], "check_constraints": []}, "SalesOrderDetail": {"columns": [[0, "SalesOrderID", "INTEGER", 1, null, 0], [1, "SalesOrderDetailID", "INTEGER", 0, null, 1], [2, "CarrierTrackingNumber", "TEXT", 0, null, 0], [3, "OrderQty", "INTEGER", 1, null, 0], [4, "ProductID", "INTEGER", 1, null, 0], [5, "SpecialOfferID", "INTEGER", 1, null, 0], [6, "UnitPrice", "REAL", 1, null, 0], [7, "UnitPriceDiscount", "REAL", 1, "0.0000", 0], [8, "LineTotal", "REAL", 1, null, 0], [9, "rowguid", "TEXT", 1, null, 0], [10, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["SalesOrderDetailID"], "foreign_keys": [[0, 0, "SpecialOfferProduct", "SpecialOfferID", "SpecialOfferID", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "SpecialOfferProduct", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "SalesOrderHeader", "SalesOrderID", "SalesOrderID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 9, "rowguid"]]], "check_constraints": []}, "TransactionHistory": {"columns": [[0, "TransactionID", "INTEGER", 0, null, 1], [1, "ProductID", "INTEGER", 1, null, 0], [2, "ReferenceOrderID", "INTEGER", 1, null, 0], [3, "ReferenceOrderLineID", "INTEGER", 1, "0", 0], [4, "TransactionDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0], [5, "TransactionType", "TEXT", 1, null, 0], [6, "Quantity", "INTEGER", 1, null, 0], [7, "ActualCost", "REAL", 1, null, 0], [8, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["TransactionID"], "foreign_keys": [[0, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Vendor": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "AccountNumber", "TEXT", 1, null, 0], [2, "Name", "TEXT", 1, null, 0], [3, "CreditRating", "INTEGER", 1, null, 0], [4, "PreferredVendorStatus", "INTEGER", 1, "1", 0], [5, "ActiveFlag", "INTEGER", 1, "1", 0], [6, "PurchasingWebServiceURL", "TEXT", 0, null, 0], [7, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["BusinessEntityID"], "foreign_keys": [[0, 0, "BusinessEntity", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "AccountNumber"]]], "check_constraints": []}, "ProductVendor": {"columns": [[0, "ProductID", "INTEGER", 1, null, 1], [1, "BusinessEntityID", "INTEGER", 1, null, 2], [2, "AverageLeadTime", "INTEGER", 1, null, 0], [3, "StandardPrice", "REAL", 1, null, 0], [4, "LastReceiptCost", "REAL", 0, null, 0], [5, "LastReceiptDate", "DATETIME", 0, null, 0], [6, "MinOrderQty", "INTEGER", 1, null, 0], [7, "MaxOrderQty", "INTEGER", 1, null, 0], [8, "OnOrderQty", "INTEGER", 0, null, 0], [9, "UnitMeasureCode", "TEXT", 1, null, 0], [10, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductID", "BusinessEntityID"], "foreign_keys": [[0, 0, "UnitMeasure", "UnitMeasureCode", "UnitMeasureCode", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Vendor", "BusinessEntityID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ProductID"], [1, 1, "BusinessEntityID"]]], "check_constraints": []}, "PurchaseOrderHeader": {"columns": [[0, "PurchaseOrderID", "INTEGER", 0, null, 1], [1, "RevisionNumber", "INTEGER", 1, "0", 0], [2, "Status", "INTEGER", 1, "1", 0], [3, "EmployeeID", "INTEGER", 1, null, 0], [4, "VendorID", "INTEGER", 1, null, 0], [5, "ShipMethodID", "INTEGER", 1, null, 0], [6, "OrderDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0], [7, "ShipDate", "DATETIME", 0, null, 0], [8, "SubTotal", "REAL", 1, "0.0000", 0], [9, "TaxAmt", "REAL", 1, "0.0000", 0], [10, "Freight", "REAL", 1, "0.0000", 0], [11, "TotalDue", "REAL", 1, null, 0], [12, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["PurchaseOrderID"], "foreign_keys": [[0, 0, "ShipMethod", "ShipMethodID", "ShipMethodID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Vendor", "VendorID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Employee", "EmployeeID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "PurchaseOrderDetail": {"columns": [[0, "PurchaseOrderID", "INTEGER", 1, null, 0], [1, "PurchaseOrderDetailID", "INTEGER", 0, null, 1], [2, "DueDate", "DATETIME", 1, null, 0], [3, "OrderQty", "INTEGER", 1, null, 0], [4, "ProductID", "INTEGER", 1, null, 0], [5, "UnitPrice", "REAL", 1, null, 0], [6, "LineTotal", "REAL", 1, null, 0], [7, "ReceivedQty", "REAL", 1, null, 0], [8, "RejectedQty", "REAL", 1, null, 0], [9, "StockedQty", "REAL", 1, null, 0], [10, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["PurchaseOrderDetailID"], "foreign_keys": [[0, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "PurchaseOrderHeader", "PurchaseOrderID", "PurchaseOrderID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "WorkOrder": {"columns": [[0, "WorkOrderID", "INTEGER", 0, null, 1], [1, "ProductID", "INTEGER", 1, null, 0], [2, "OrderQty", "INTEGER", 1, null, 0], [3, "StockedQty", "INTEGER", 1, null, 0], [4, "ScrappedQty", "INTEGER", 1, null, 0], [5, "StartDate", "DATETIME", 1, null, 0], [6, "EndDate", "DATETIME", 0, null, 0], [7, "DueDate", "DATETIME", 1, null, 0], [8, "ScrapReasonID", "INTEGER", 0, null, 0], [9, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["WorkOrderID"], "foreign_keys": [[0, 0, "ScrapReason", "ScrapReasonID", "ScrapReasonID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "WorkOrderRouting": {"columns": [[0, "WorkOrderID", "INTEGER", 1, null, 1], [1, "ProductID", "INTEGER", 1, null, 2], [2, "OperationSequence", "INTEGER", 1, null, 3], [3, "LocationID", "INTEGER", 1, null, 0], [4, "ScheduledStartDate", "DATETIME", 1, null, 0], [5, "ScheduledEndDate", "DATETIME", 1, null, 0], [6, "ActualStartDate", "DATETIME", 0, null, 0], [7, "ActualEndDate", "DATETIME", 0, null, 0], [8, "ActualResourceHrs", "REAL", 0, null, 0], [9, "PlannedCost", "REAL", 1, null, 0], [10, "ActualCost", "REAL", 0, null, 0], [11, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["WorkOrderID", "ProductID", "OperationSequence"], "foreign_keys": [[0, 0, "Location", "LocationID", "LocationID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "WorkOrder", "WorkOrderID", "WorkOrderID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "WorkOrderID"], [1, 1, "ProductID"], [2, 2, "OperationSequence"]]], "check_constraints": []}, "Customer": {"columns": [[0, "CustomerID", "INTEGER", 0, null, 1], [1, "PersonID", "INTEGER", 0, null, 0], [2, "StoreID", "INTEGER", 0, null, 0], [3, "TerritoryID", "INTEGER", 0, null, 0], [4, "AccountNumber", "TEXT", 1, null, 0], [5, "rowguid", "TEXT", 1, null, 0], [6, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["CustomerID"], "foreign_keys": [[0, 0, "Store", "StoreID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "SalesTerritory", "TerritoryID", "TerritoryID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Person", "PersonID", "BusinessEntityID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 5, "rowguid"]], [[0, 4, "AccountNumber"]]], "check_constraints": []}, "ProductListPriceHistory": {"columns": [[0, "ProductID", "INTEGER", 1, null, 1], [1, "StartDate", "DATE", 1, null, 2], [2, "EndDate", "DATE", 0, null, 0], [3, "ListPrice", "REAL", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["ProductID", "StartDate"], "foreign_keys": [[0, 0, "Product", "ProductID", "ProductID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ProductID"], [1, 1, "StartDate"]]], "check_constraints": []}, "Address": {"columns": [[0, "AddressID", "INTEGER", 0, null, 1], [1, "AddressLine1", "TEXT", 1, null, 0], [2, "AddressLine2", "TEXT", 0, null, 0], [3, "City", "TEXT", 1, null, 0], [4, "StateProvinceID", "INTEGER", 1, null, 0], [5, "PostalCode", "TEXT", 1, null, 0], [6, "SpatialLocation", "TEXT", 0, null, 0], [7, "rowguid", "TEXT", 1, null, 0], [8, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["AddressID"], "foreign_keys": [[0, 0, "StateProvince", "StateProvinceID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "AddressLine1"], [1, 2, "AddressLine2"], [2, 3, "City"], [3, 4, "StateProvinceID"], [4, 5, "PostalCode"]], [[0, 7, "rowguid"]]], "check_constraints": []}, "AddressType": {"columns": [[0, "AddressTypeID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "rowguid", "TEXT", 1, null, 0], [3, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["AddressTypeID"], "foreign_keys": [], "unique_constraints": [[[0, 2, "rowguid"]], [[0, 1, "Name"]]], "check_constraints": []}, "BillOfMaterials": {"columns": [[0, "BillOfMaterialsID", "INTEGER", 0, null, 1], [1, "ProductAssemblyID", "INTEGER", 0, null, 0], [2, "ComponentID", "INTEGER", 1, null, 0], [3, "StartDate", "DATETIME", 1, "current_timestamp", 0], [4, "EndDate", "DATETIME", 0, null, 0], [5, "UnitMeasureCode", "TEXT", 1, null, 0], [6, "BOMLevel", "INTEGER", 1, null, 0], [7, "PerAssemblyQty", "REAL", 1, "1.00", 0], [8, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BillOfMaterialsID"], "foreign_keys": [[0, 0, "UnitMeasure", "UnitMeasureCode", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Product", "ComponentID", null, "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Product", "ProductAssemblyID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "ProductAssemblyID"], [1, 2, "ComponentID"], [2, 3, "StartDate"]]], "check_constraints": []}, "BusinessEntity": {"columns": [[0, "BusinessEntityID", "INTEGER", 0, null, 1], [1, "rowguid", "TEXT", 1, null, 0], [2, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID"], "foreign_keys": [], "unique_constraints": [[[0, 1, "rowguid"]]], "check_constraints": []}, "ContactType": {"columns": [[0, "ContactTypeID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["ContactTypeID"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Name"]]], "check_constraints": []}, "CurrencyRate": {"columns": [[0, "CurrencyRateID", "INTEGER", 0, null, 1], [1, "CurrencyRateDate", "DATETIME", 1, null, 0], [2, "FromCurrencyCode", "TEXT", 1, null, 0], [3, "ToCurrencyCode", "TEXT", 1, null, 0], [4, "AverageRate", "REAL", 1, null, 0], [5, "EndOfDayRate", "REAL", 1, null, 0], [6, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["CurrencyRateID"], "foreign_keys": [[0, 0, "Currency", "ToCurrencyCode", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Currency", "FromCurrencyCode", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "CurrencyRateDate"], [1, 2, "FromCurrencyCode"], [2, 3, "ToCurrencyCode"]]], "check_constraints": []}, "Department": {"columns": [[0, "DepartmentID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "GroupName", "TEXT", 1, null, 0], [3, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["DepartmentID"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Name"]]], "check_constraints": []}, "EmployeeDepartmentHistory": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "DepartmentID", "INTEGER", 1, null, 3], [2, "ShiftID", "INTEGER", 1, null, 4], [3, "StartDate", "DATE", 1, null, 2], [4, "EndDate", "DATE", 0, null, 0], [5, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID", "DepartmentID", "ShiftID", "StartDate"], "foreign_keys": [[0, 0, "Shift", "ShiftID", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Department", "DepartmentID", null, "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Employee", "BusinessEntityID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "BusinessEntityID"], [1, 3, "StartDate"], [2, 1, "DepartmentID"], [3, 2, "ShiftID"]]], "check_constraints": []}, "EmployeePayHistory": {"columns": [[0, "BusinessEntityID", "INTEGER", 1, null, 1], [1, "RateChangeDate", "DATETIME", 1, null, 2], [2, "Rate", "REAL", 1, null, 0], [3, "PayFrequency", "INTEGER", 1, null, 0], [4, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["BusinessEntityID", "RateChangeDate"], "foreign_keys": [[0, 0, "Employee", "BusinessEntityID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "BusinessEntityID"], [1, 1, "RateChangeDate"]]], "check_constraints": []}, "JobCandidate": {"columns": [[0, "JobCandidateID", "INTEGER", 0, null, 1], [1, "BusinessEntityID", "INTEGER", 0, null, 0], [2, "Resume", "TEXT", 0, null, 0], [3, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["JobCandidateID"], "foreign_keys": [[0, 0, "Employee", "BusinessEntityID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Location": {"columns": [[0, "LocationID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "CostRate", "REAL", 1, "0.0000", 0], [3, "Availability", "REAL", 1, "0.00", 0], [4, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["LocationID"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Name"]]], "check_constraints": []}, "PhoneNumberType": {"columns": [[0, "PhoneNumberTypeID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["PhoneNumberTypeID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Product": {"columns": [[0, "ProductID", "INTEGER", 0, null, 1], [1, "Name", "TEXT", 1, null, 0], [2, "ProductNumber", "TEXT", 1, null, 0], [3, "MakeFlag", "INTEGER", 1, "1", 0], [4, "FinishedGoodsFlag", "INTEGER", 1, "1", 0], [5, "Color", "TEXT", 0, null, 0], [6, "SafetyStockLevel", "INTEGER", 1, null, 0], [7, "ReorderPoint", "INTEGER", 1, null, 0], [8, "StandardCost", "REAL", 1, null, 0], [9, "ListPrice", "REAL", 1, null, 0], [10, "Size", "TEXT", 0, null, 0], [11, "SizeUnitMeasureCode", "TEXT", 0, null, 0], [12, "WeightUnitMeasureCode", "TEXT", 0, null, 0], [13, "Weight", "REAL", 0, null, 0], [14, "DaysToManufacture", "INTEGER", 1, null, 0], [15, "ProductLine", "TEXT", 0, null, 0], [16, "Class", "TEXT", 0, null, 0], [17, "Style", "TEXT", 0, null, 0], [18, "ProductSubcategoryID", "INTEGER", 0, null, 0], [19, "ProductModelID", "INTEGER", 0, null, 0], [20, "SellStartDate", "DATETIME", 1, null, 0], [21, "SellEndDate", "DATETIME", 0, null, 0], [22, "DiscontinuedDate", "DATETIME", 0, null, 0], [23, "rowguid", "TEXT", 1, null, 0], [24, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["ProductID"], "foreign_keys": [[0, 0, "ProductModel", "ProductModelID", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "ProductSubcategory", "ProductSubcategoryID", null, "NO ACTION", "NO ACTION", "NONE"], [2, 0, "UnitMeasure", "WeightUnitMeasureCode", null, "NO ACTION", "NO ACTION", "NONE"], [3, 0, "UnitMeasure", "SizeUnitMeasureCode", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 23, "rowguid"]], [[0, 2, "ProductNumber"]], [[0, 1, "Name"]]], "check_constraints": []}, "Document": {"columns": [[0, "DocumentNode", "TEXT", 1, null, 1], [1, "DocumentLevel", "INTEGER", 0, null, 0], [2, "Title", "TEXT", 1, null, 0], [3, "Owner", "INTEGER", 1, null, 0], [4, "FolderFlag", "INTEGER", 1, "0", 0], [5, "FileName", "TEXT", 1, null, 0], [6, "FileExtension", "TEXT", 1, null, 0], [7, "Revision", "TEXT", 1, null, 0], [8, "ChangeNumber", "INTEGER", 1, "0", 0], [9, "Status", "INTEGER", 1, null, 0], [10, "DocumentSummary", "TEXT", 0, null, 0], [11, "Document", "BLOB", 0, null, 0], [12, "rowguid", "TEXT", 1, null, 0], [13, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["DocumentNode"], "foreign_keys": [[0, 0, "Employee", "Owner", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "DocumentLevel"], [1, 0, "DocumentNode"]], [[0, 12, "rowguid"]], [[0, 0, "DocumentNode"]]], "check_constraints": []}, "StateProvince": {"columns": [[0, "StateProvinceID", "INTEGER", 0, null, 1], [1, "StateProvinceCode", "TEXT", 1, null, 0], [2, "CountryRegionCode", "TEXT", 1, null, 0], [3, "IsOnlyStateProvinceFlag", "INTEGER", 1, "1", 0], [4, "Name", "TEXT", 1, null, 0], [5, "TerritoryID", "INTEGER", 1, null, 0], [6, "rowguid", "TEXT", 1, null, 0], [7, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["StateProvinceID"], "foreign_keys": [[0, 0, "SalesTerritory", "TerritoryID", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "CountryRegion", "CountryRegionCode", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "StateProvinceCode"], [1, 2, "CountryRegionCode"]], [[0, 6, "rowguid"]], [[0, 4, "Name"]]], "check_constraints": []}, "CreditCard": {"columns": [[0, "CreditCardID", "INTEGER", 0, null, 1], [1, "CardType", "TEXT", 1, null, 0], [2, "CardNumber", "TEXT", 1, null, 0], [3, "ExpMonth", "INTEGER", 1, null, 0], [4, "ExpYear", "INTEGER", 1, null, 0], [5, "ModifiedDate", "DATETIME", 1, "current_timestamp", 0]], "primary_keys": ["CreditCardID"], "foreign_keys": [], "unique_constraints": [[[0, 2, "CardNumber"]]], "check_constraints": []}, "SalesOrderHeader": {"columns": [[0, "SalesOrderID", "INTEGER", 0, null, 1], [1, "RevisionNumber", "INTEGER", 1, "0", 0], [2, "OrderDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0], [3, "DueDate", "DATETIME", 1, null, 0], [4, "ShipDate", "DATETIME", 0, null, 0], [5, "Status", "INTEGER", 1, "1", 0], [6, "OnlineOrderFlag", "INTEGER", 1, "1", 0], [7, "SalesOrderNumber", "TEXT", 1, null, 0], [8, "PurchaseOrderNumber", "TEXT", 0, null, 0], [9, "AccountNumber", "TEXT", 0, null, 0], [10, "CustomerID", "INTEGER", 1, null, 0], [11, "SalesPersonID", "INTEGER", 0, null, 0], [12, "TerritoryID", "INTEGER", 0, null, 0], [13, "BillToAddressID", "INTEGER", 1, null, 0], [14, "ShipToAddressID", "INTEGER", 1, null, 0], [15, "ShipMethodID", "INTEGER", 1, null, 0], [16, "CreditCardID", "INTEGER", 0, null, 0], [17, "CreditCardApprovalCode", "TEXT", 0, null, 0], [18, "CurrencyRateID", "INTEGER", 0, null, 0], [19, "SubTotal", "REAL", 1, "0.0000", 0], [20, "TaxAmt", "REAL", 1, "0.0000", 0], [21, "Freight", "REAL", 1, "0.0000", 0], [22, "TotalDue", "REAL", 1, null, 0], [23, "Comment", "TEXT", 0, null, 0], [24, "rowguid", "TEXT", 1, null, 0], [25, "ModifiedDate", "DATETIME", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["SalesOrderID"], "foreign_keys": [[0, 0, "CurrencyRate", "CurrencyRateID", null, "NO ACTION", "NO ACTION", "NONE"], [1, 0, "CreditCard", "CreditCardID", null, "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Address", "ShipMethodID", null, "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Address", "ShipToAddressID", null, "NO ACTION", "NO ACTION", "NONE"], [4, 0, "Address", "BillToAddressID", null, "NO ACTION", "NO ACTION", "NONE"], [5, 0, "SalesTerritory", "TerritoryID", null, "NO ACTION", "NO ACTION", "NONE"], [6, 0, "SalesPerson", "SalesPersonID", null, "NO ACTION", "NO ACTION", "NONE"], [7, 0, "Customer", "CustomerID", null, "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 24, "rowguid"]], [[0, 7, "SalesOrderNumber"]]], "check_constraints": []}}
CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE CountryRegion ( CountryRegionCode TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (Name), UNIQUE (CountryRegionCode) ); CREATE TABLE Culture ( CultureID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (Name), UNIQUE (CultureID) ); CREATE TABLE Currency ( CurrencyCode TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (Name), UNIQUE (CurrencyCode) ); CREATE TABLE CountryRegionCurrency ( CountryRegionCode TEXT NOT NULL PRIMARY KEY, CurrencyCode TEXT NOT NULL PRIMARY KEY, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, PRIMARY KEY (CountryRegionCode, CurrencyCode), UNIQUE (CountryRegionCode, CurrencyCode), FOREIGN KEY (CurrencyCode) REFERENCES Currency(CurrencyCode), FOREIGN KEY (CountryRegionCode) REFERENCES CountryRegion(CountryRegionCode) ); CREATE TABLE Person ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, PersonType TEXT NOT NULL, NameStyle INTEGER NOT NULL DEFAULT 0, Title TEXT, FirstName TEXT NOT NULL, MiddleName TEXT, LastName TEXT NOT NULL, Suffix TEXT, EmailPromotion INTEGER NOT NULL DEFAULT 0, AdditionalContactInfo TEXT, Demographics TEXT, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (rowguid), FOREIGN KEY (BusinessEntityID) REFERENCES BusinessEntity(BusinessEntityID) ); CREATE TABLE BusinessEntityContact ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, PersonID INTEGER NOT NULL PRIMARY KEY, ContactTypeID INTEGER NOT NULL PRIMARY KEY, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, PRIMARY KEY (BusinessEntityID, PersonID, ContactTypeID), UNIQUE (BusinessEntityID, PersonID, ContactTypeID), UNIQUE (rowguid), FOREIGN KEY (PersonID) REFERENCES Person(BusinessEntityID), FOREIGN KEY (ContactTypeID) REFERENCES ContactType(ContactTypeID), FOREIGN KEY (BusinessEntityID) REFERENCES BusinessEntity(BusinessEntityID) ); CREATE TABLE EmailAddress ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, EmailAddressID INTEGER PRIMARY KEY, EmailAddress TEXT, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, PRIMARY KEY (BusinessEntityID, EmailAddressID), UNIQUE (EmailAddressID, BusinessEntityID), FOREIGN KEY (BusinessEntityID) REFERENCES Person(BusinessEntityID) ); CREATE TABLE Employee ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, NationalIDNumber TEXT NOT NULL, LoginID TEXT NOT NULL, OrganizationNode TEXT, OrganizationLevel INTEGER, JobTitle TEXT NOT NULL, BirthDate DATE NOT NULL, MaritalStatus TEXT NOT NULL, Gender TEXT NOT NULL, HireDate DATE NOT NULL, SalariedFlag INTEGER NOT NULL DEFAULT 1, VacationHours INTEGER NOT NULL DEFAULT 0, SickLeaveHours INTEGER NOT NULL DEFAULT 0, CurrentFlag INTEGER NOT NULL DEFAULT 1, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (rowguid), UNIQUE (LoginID), UNIQUE (NationalIDNumber), FOREIGN KEY (BusinessEntityID) REFERENCES Person(BusinessEntityID) ); CREATE TABLE Password ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, PasswordHash TEXT NOT NULL, PasswordSalt TEXT NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, FOREIGN KEY (BusinessEntityID) REFERENCES Person(BusinessEntityID) ); CREATE TABLE PersonCreditCard ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, CreditCardID INTEGER NOT NULL PRIMARY KEY, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, PRIMARY KEY (BusinessEntityID, CreditCardID), UNIQUE (BusinessEntityID, CreditCardID), FOREIGN KEY (BusinessEntityID) REFERENCES Person(BusinessEntityID), FOREIGN KEY (CreditCardID) REFERENCES CreditCard(CreditCardID) ); CREATE TABLE ProductCategory ( ProductCategoryID INTEGER PRIMARY KEY, Name TEXT NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid), UNIQUE (Name) ); CREATE TABLE ProductDescription ( ProductDescriptionID INTEGER PRIMARY KEY, Description TEXT NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid) ); CREATE TABLE ProductModel ( ProductModelID INTEGER PRIMARY KEY, Name TEXT NOT NULL, CatalogDescription TEXT, Instructions TEXT, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid), UNIQUE (Name) ); CREATE TABLE ProductModelProductDescriptionCulture ( ProductModelID INTEGER NOT NULL PRIMARY KEY, ProductDescriptionID INTEGER NOT NULL PRIMARY KEY, CultureID TEXT NOT NULL PRIMARY KEY, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (ProductModelID, ProductDescriptionID, CultureID), UNIQUE (ProductModelID, ProductDescriptionID, CultureID), FOREIGN KEY (CultureID) REFERENCES Culture(CultureID), FOREIGN KEY (ProductDescriptionID) REFERENCES ProductDescription(ProductDescriptionID), FOREIGN KEY (ProductModelID) REFERENCES ProductModel(ProductModelID) ); CREATE TABLE ProductPhoto ( ProductPhotoID INTEGER PRIMARY KEY, ThumbNailPhoto BLOB, ThumbnailPhotoFileName TEXT, LargePhoto BLOB, LargePhotoFileName TEXT, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE ProductSubcategory ( ProductSubcategoryID INTEGER PRIMARY KEY, ProductCategoryID INTEGER NOT NULL, Name TEXT NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid), UNIQUE (Name), FOREIGN KEY (ProductCategoryID) REFERENCES ProductCategory(ProductCategoryID) ); CREATE TABLE SalesReason ( SalesReasonID INTEGER PRIMARY KEY, Name TEXT NOT NULL, ReasonType TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE SalesTerritory ( TerritoryID INTEGER PRIMARY KEY, Name TEXT NOT NULL, CountryRegionCode TEXT NOT NULL, Group TEXT NOT NULL, SalesYTD REAL NOT NULL DEFAULT 0.0000, SalesLastYear REAL NOT NULL DEFAULT 0.0000, CostYTD REAL NOT NULL DEFAULT 0.0000, CostLastYear REAL NOT NULL DEFAULT 0.0000, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid), UNIQUE (Name), FOREIGN KEY (CountryRegionCode) REFERENCES CountryRegion(CountryRegionCode) ); CREATE TABLE SalesPerson ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, TerritoryID INTEGER, SalesQuota REAL, Bonus REAL NOT NULL DEFAULT 0.0000, CommissionPct REAL NOT NULL DEFAULT 0.0000, SalesYTD REAL NOT NULL DEFAULT 0.0000, SalesLastYear REAL NOT NULL DEFAULT 0.0000, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid), FOREIGN KEY (TerritoryID) REFERENCES SalesTerritory(TerritoryID), FOREIGN KEY (BusinessEntityID) REFERENCES Employee(BusinessEntityID) ); CREATE TABLE SalesPersonQuotaHistory ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, QuotaDate DATETIME NOT NULL PRIMARY KEY, SalesQuota REAL NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (BusinessEntityID, QuotaDate), UNIQUE (BusinessEntityID, QuotaDate), UNIQUE (rowguid), FOREIGN KEY (BusinessEntityID) REFERENCES SalesPerson(BusinessEntityID) ); CREATE TABLE SalesTerritoryHistory ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, TerritoryID INTEGER NOT NULL PRIMARY KEY, StartDate DATETIME NOT NULL PRIMARY KEY, EndDate DATETIME, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (BusinessEntityID, TerritoryID, StartDate), UNIQUE (BusinessEntityID, StartDate, TerritoryID), UNIQUE (rowguid), FOREIGN KEY (TerritoryID) REFERENCES SalesTerritory(TerritoryID), FOREIGN KEY (BusinessEntityID) REFERENCES SalesPerson(BusinessEntityID) ); CREATE TABLE ScrapReason ( ScrapReasonID INTEGER PRIMARY KEY, Name TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (Name) ); CREATE TABLE Shift ( ShiftID INTEGER PRIMARY KEY, Name TEXT NOT NULL, StartTime TEXT NOT NULL, EndTime TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (StartTime, EndTime), UNIQUE (Name) ); CREATE TABLE ShipMethod ( ShipMethodID INTEGER PRIMARY KEY, Name TEXT NOT NULL, ShipBase REAL NOT NULL DEFAULT 0.0000, ShipRate REAL NOT NULL DEFAULT 0.0000, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid), UNIQUE (Name) ); CREATE TABLE SpecialOffer ( SpecialOfferID INTEGER PRIMARY KEY, Description TEXT NOT NULL, DiscountPct REAL NOT NULL DEFAULT 0.0000, Type TEXT NOT NULL, Category TEXT NOT NULL, StartDate DATETIME NOT NULL, EndDate DATETIME NOT NULL, MinQty INTEGER NOT NULL DEFAULT 0, MaxQty INTEGER, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid) ); CREATE TABLE BusinessEntityAddress ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, AddressID INTEGER NOT NULL PRIMARY KEY, AddressTypeID INTEGER NOT NULL PRIMARY KEY, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, PRIMARY KEY (BusinessEntityID, AddressID, AddressTypeID), UNIQUE (BusinessEntityID, AddressID, AddressTypeID), UNIQUE (rowguid), FOREIGN KEY (BusinessEntityID) REFERENCES BusinessEntity(BusinessEntityID), FOREIGN KEY (AddressTypeID) REFERENCES AddressType(AddressTypeID), FOREIGN KEY (AddressID) REFERENCES Address(AddressID) ); CREATE TABLE SalesTaxRate ( SalesTaxRateID INTEGER PRIMARY KEY, StateProvinceID INTEGER NOT NULL, TaxType INTEGER NOT NULL, TaxRate REAL NOT NULL DEFAULT 0.0000, Name TEXT NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (StateProvinceID, TaxType), UNIQUE (rowguid), FOREIGN KEY (StateProvinceID) REFERENCES StateProvince(StateProvinceID) ); CREATE TABLE Store ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, Name TEXT NOT NULL, SalesPersonID INTEGER, Demographics TEXT, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid), FOREIGN KEY (SalesPersonID) REFERENCES SalesPerson(BusinessEntityID), FOREIGN KEY (BusinessEntityID) REFERENCES BusinessEntity(BusinessEntityID) ); CREATE TABLE SalesOrderHeaderSalesReason ( SalesOrderID INTEGER NOT NULL PRIMARY KEY, SalesReasonID INTEGER NOT NULL PRIMARY KEY, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (SalesOrderID, SalesReasonID), UNIQUE (SalesOrderID, SalesReasonID), FOREIGN KEY (SalesReasonID) REFERENCES SalesReason(SalesReasonID), FOREIGN KEY (SalesOrderID) REFERENCES SalesOrderHeader(SalesOrderID) ); CREATE TABLE TransactionHistoryArchive ( TransactionID INTEGER NOT NULL PRIMARY KEY, ProductID INTEGER NOT NULL, ReferenceOrderID INTEGER NOT NULL, ReferenceOrderLineID INTEGER NOT NULL DEFAULT 0, TransactionDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, TransactionType TEXT NOT NULL, Quantity INTEGER NOT NULL, ActualCost REAL NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE UnitMeasure ( UnitMeasureCode TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (Name), UNIQUE (UnitMeasureCode) ); CREATE TABLE ProductCostHistory ( ProductID INTEGER NOT NULL PRIMARY KEY, StartDate DATE NOT NULL PRIMARY KEY, EndDate DATE, StandardCost REAL NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (ProductID, StartDate), UNIQUE (ProductID, StartDate), FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE ProductDocument ( ProductID INTEGER NOT NULL PRIMARY KEY, DocumentNode TEXT NOT NULL PRIMARY KEY, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (ProductID, DocumentNode), UNIQUE (ProductID, DocumentNode), FOREIGN KEY (DocumentNode) REFERENCES Document(DocumentNode), FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE ProductInventory ( ProductID INTEGER NOT NULL PRIMARY KEY, LocationID INTEGER NOT NULL PRIMARY KEY, Shelf TEXT NOT NULL, Bin INTEGER NOT NULL, Quantity INTEGER NOT NULL DEFAULT 0, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (ProductID, LocationID), UNIQUE (ProductID, LocationID), FOREIGN KEY (LocationID) REFERENCES Location(LocationID), FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE ProductProductPhoto ( ProductID INTEGER NOT NULL PRIMARY KEY, ProductPhotoID INTEGER NOT NULL PRIMARY KEY, Primary INTEGER NOT NULL DEFAULT 0, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (ProductID, ProductPhotoID), UNIQUE (ProductID, ProductPhotoID), FOREIGN KEY (ProductPhotoID) REFERENCES ProductPhoto(ProductPhotoID), FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE ProductReview ( ProductReviewID INTEGER PRIMARY KEY, ProductID INTEGER NOT NULL, ReviewerName TEXT NOT NULL, ReviewDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, EmailAddress TEXT NOT NULL, Rating INTEGER NOT NULL, Comments TEXT, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE ShoppingCartItem ( ShoppingCartItemID INTEGER PRIMARY KEY, ShoppingCartID TEXT NOT NULL, Quantity INTEGER NOT NULL DEFAULT 1, ProductID INTEGER NOT NULL, DateCreated DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE SpecialOfferProduct ( SpecialOfferID INTEGER NOT NULL PRIMARY KEY, ProductID INTEGER NOT NULL PRIMARY KEY, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (SpecialOfferID, ProductID), UNIQUE (SpecialOfferID, ProductID), UNIQUE (rowguid), FOREIGN KEY (ProductID) REFERENCES Product(ProductID), FOREIGN KEY (SpecialOfferID) REFERENCES SpecialOffer(SpecialOfferID) ); CREATE TABLE SalesOrderDetail ( SalesOrderID INTEGER NOT NULL, SalesOrderDetailID INTEGER PRIMARY KEY, CarrierTrackingNumber TEXT, OrderQty INTEGER NOT NULL, ProductID INTEGER NOT NULL, SpecialOfferID INTEGER NOT NULL, UnitPrice REAL NOT NULL, UnitPriceDiscount REAL NOT NULL DEFAULT 0.0000, LineTotal REAL NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid), FOREIGN KEY (SpecialOfferID) REFERENCES SpecialOfferProduct(SpecialOfferID), FOREIGN KEY (ProductID) REFERENCES SpecialOfferProduct(ProductID), FOREIGN KEY (SalesOrderID) REFERENCES SalesOrderHeader(SalesOrderID) ); CREATE TABLE TransactionHistory ( TransactionID INTEGER PRIMARY KEY, ProductID INTEGER NOT NULL, ReferenceOrderID INTEGER NOT NULL, ReferenceOrderLineID INTEGER NOT NULL DEFAULT 0, TransactionDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, TransactionType TEXT NOT NULL, Quantity INTEGER NOT NULL, ActualCost REAL NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE Vendor ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, AccountNumber TEXT NOT NULL, Name TEXT NOT NULL, CreditRating INTEGER NOT NULL, PreferredVendorStatus INTEGER NOT NULL DEFAULT 1, ActiveFlag INTEGER NOT NULL DEFAULT 1, PurchasingWebServiceURL TEXT, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (AccountNumber), FOREIGN KEY (BusinessEntityID) REFERENCES BusinessEntity(BusinessEntityID) ); CREATE TABLE ProductVendor ( ProductID INTEGER NOT NULL PRIMARY KEY, BusinessEntityID INTEGER NOT NULL PRIMARY KEY, AverageLeadTime INTEGER NOT NULL, StandardPrice REAL NOT NULL, LastReceiptCost REAL, LastReceiptDate DATETIME, MinOrderQty INTEGER NOT NULL, MaxOrderQty INTEGER NOT NULL, OnOrderQty INTEGER, UnitMeasureCode TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (ProductID, BusinessEntityID), UNIQUE (ProductID, BusinessEntityID), FOREIGN KEY (UnitMeasureCode) REFERENCES UnitMeasure(UnitMeasureCode), FOREIGN KEY (BusinessEntityID) REFERENCES Vendor(BusinessEntityID), FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE PurchaseOrderHeader ( PurchaseOrderID INTEGER PRIMARY KEY, RevisionNumber INTEGER NOT NULL DEFAULT 0, Status INTEGER NOT NULL DEFAULT 1, EmployeeID INTEGER NOT NULL, VendorID INTEGER NOT NULL, ShipMethodID INTEGER NOT NULL, OrderDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, ShipDate DATETIME, SubTotal REAL NOT NULL DEFAULT 0.0000, TaxAmt REAL NOT NULL DEFAULT 0.0000, Freight REAL NOT NULL DEFAULT 0.0000, TotalDue REAL NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (ShipMethodID) REFERENCES ShipMethod(ShipMethodID), FOREIGN KEY (VendorID) REFERENCES Vendor(BusinessEntityID), FOREIGN KEY (EmployeeID) REFERENCES Employee(BusinessEntityID) ); CREATE TABLE PurchaseOrderDetail ( PurchaseOrderID INTEGER NOT NULL, PurchaseOrderDetailID INTEGER PRIMARY KEY, DueDate DATETIME NOT NULL, OrderQty INTEGER NOT NULL, ProductID INTEGER NOT NULL, UnitPrice REAL NOT NULL, LineTotal REAL NOT NULL, ReceivedQty REAL NOT NULL, RejectedQty REAL NOT NULL, StockedQty REAL NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (ProductID) REFERENCES Product(ProductID), FOREIGN KEY (PurchaseOrderID) REFERENCES PurchaseOrderHeader(PurchaseOrderID) ); CREATE TABLE WorkOrder ( WorkOrderID INTEGER PRIMARY KEY, ProductID INTEGER NOT NULL, OrderQty INTEGER NOT NULL, StockedQty INTEGER NOT NULL, ScrappedQty INTEGER NOT NULL, StartDate DATETIME NOT NULL, EndDate DATETIME, DueDate DATETIME NOT NULL, ScrapReasonID INTEGER, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (ScrapReasonID) REFERENCES ScrapReason(ScrapReasonID), FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE WorkOrderRouting ( WorkOrderID INTEGER NOT NULL PRIMARY KEY, ProductID INTEGER NOT NULL PRIMARY KEY, OperationSequence INTEGER NOT NULL PRIMARY KEY, LocationID INTEGER NOT NULL, ScheduledStartDate DATETIME NOT NULL, ScheduledEndDate DATETIME NOT NULL, ActualStartDate DATETIME, ActualEndDate DATETIME, ActualResourceHrs REAL, PlannedCost REAL NOT NULL, ActualCost REAL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (WorkOrderID, ProductID, OperationSequence), UNIQUE (WorkOrderID, ProductID, OperationSequence), FOREIGN KEY (LocationID) REFERENCES Location(LocationID), FOREIGN KEY (WorkOrderID) REFERENCES WorkOrder(WorkOrderID) ); CREATE TABLE Customer ( CustomerID INTEGER PRIMARY KEY, PersonID INTEGER, StoreID INTEGER, TerritoryID INTEGER, AccountNumber TEXT NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (rowguid), UNIQUE (AccountNumber), FOREIGN KEY (StoreID) REFERENCES Store(BusinessEntityID), FOREIGN KEY (TerritoryID) REFERENCES SalesTerritory(TerritoryID), FOREIGN KEY (PersonID) REFERENCES Person(BusinessEntityID) ); CREATE TABLE ProductListPriceHistory ( ProductID INTEGER NOT NULL PRIMARY KEY, StartDate DATE NOT NULL PRIMARY KEY, EndDate DATE, ListPrice REAL NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (ProductID, StartDate), UNIQUE (ProductID, StartDate), FOREIGN KEY (ProductID) REFERENCES Product(ProductID) ); CREATE TABLE Address ( AddressID INTEGER PRIMARY KEY, AddressLine1 TEXT NOT NULL, AddressLine2 TEXT, City TEXT NOT NULL, StateProvinceID INTEGER NOT NULL, PostalCode TEXT NOT NULL, SpatialLocation TEXT, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (AddressLine1, AddressLine2, City, StateProvinceID, PostalCode), UNIQUE (rowguid), FOREIGN KEY (StateProvinceID) REFERENCES StateProvince(None) ); CREATE TABLE AddressType ( AddressTypeID INTEGER PRIMARY KEY, Name TEXT NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (rowguid), UNIQUE (Name) ); CREATE TABLE BillOfMaterials ( BillOfMaterialsID INTEGER PRIMARY KEY, ProductAssemblyID INTEGER, ComponentID INTEGER NOT NULL, StartDate DATETIME NOT NULL DEFAULT current_timestamp, EndDate DATETIME, UnitMeasureCode TEXT NOT NULL, BOMLevel INTEGER NOT NULL, PerAssemblyQty REAL NOT NULL DEFAULT 1.00, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (ProductAssemblyID, ComponentID, StartDate), FOREIGN KEY (UnitMeasureCode) REFERENCES UnitMeasure(None), FOREIGN KEY (ComponentID) REFERENCES Product(None), FOREIGN KEY (ProductAssemblyID) REFERENCES Product(None) ); CREATE TABLE BusinessEntity ( BusinessEntityID INTEGER PRIMARY KEY, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (rowguid) ); CREATE TABLE ContactType ( ContactTypeID INTEGER PRIMARY KEY, Name TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (Name) ); CREATE TABLE CurrencyRate ( CurrencyRateID INTEGER PRIMARY KEY, CurrencyRateDate DATETIME NOT NULL, FromCurrencyCode TEXT NOT NULL, ToCurrencyCode TEXT NOT NULL, AverageRate REAL NOT NULL, EndOfDayRate REAL NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (CurrencyRateDate, FromCurrencyCode, ToCurrencyCode), FOREIGN KEY (ToCurrencyCode) REFERENCES Currency(None), FOREIGN KEY (FromCurrencyCode) REFERENCES Currency(None) ); CREATE TABLE Department ( DepartmentID INTEGER PRIMARY KEY, Name TEXT NOT NULL, GroupName TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (Name) ); CREATE TABLE EmployeeDepartmentHistory ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, DepartmentID INTEGER NOT NULL PRIMARY KEY, ShiftID INTEGER NOT NULL PRIMARY KEY, StartDate DATE NOT NULL PRIMARY KEY, EndDate DATE, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, PRIMARY KEY (BusinessEntityID, DepartmentID, ShiftID, StartDate), UNIQUE (BusinessEntityID, StartDate, DepartmentID, ShiftID), FOREIGN KEY (ShiftID) REFERENCES Shift(None), FOREIGN KEY (DepartmentID) REFERENCES Department(None), FOREIGN KEY (BusinessEntityID) REFERENCES Employee(None) ); CREATE TABLE EmployeePayHistory ( BusinessEntityID INTEGER NOT NULL PRIMARY KEY, RateChangeDate DATETIME NOT NULL PRIMARY KEY, Rate REAL NOT NULL, PayFrequency INTEGER NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, PRIMARY KEY (BusinessEntityID, RateChangeDate), UNIQUE (BusinessEntityID, RateChangeDate), FOREIGN KEY (BusinessEntityID) REFERENCES Employee(None) ); CREATE TABLE JobCandidate ( JobCandidateID INTEGER PRIMARY KEY, BusinessEntityID INTEGER, Resume TEXT, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, FOREIGN KEY (BusinessEntityID) REFERENCES Employee(None) ); CREATE TABLE Location ( LocationID INTEGER PRIMARY KEY, Name TEXT NOT NULL, CostRate REAL NOT NULL DEFAULT 0.0000, Availability REAL NOT NULL DEFAULT 0.00, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (Name) ); CREATE TABLE PhoneNumberType ( PhoneNumberTypeID INTEGER PRIMARY KEY, Name TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp ); CREATE TABLE Product ( ProductID INTEGER PRIMARY KEY, Name TEXT NOT NULL, ProductNumber TEXT NOT NULL, MakeFlag INTEGER NOT NULL DEFAULT 1, FinishedGoodsFlag INTEGER NOT NULL DEFAULT 1, Color TEXT, SafetyStockLevel INTEGER NOT NULL, ReorderPoint INTEGER NOT NULL, StandardCost REAL NOT NULL, ListPrice REAL NOT NULL, Size TEXT, SizeUnitMeasureCode TEXT, WeightUnitMeasureCode TEXT, Weight REAL, DaysToManufacture INTEGER NOT NULL, ProductLine TEXT, Class TEXT, Style TEXT, ProductSubcategoryID INTEGER, ProductModelID INTEGER, SellStartDate DATETIME NOT NULL, SellEndDate DATETIME, DiscontinuedDate DATETIME, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (rowguid), UNIQUE (ProductNumber), UNIQUE (Name), FOREIGN KEY (ProductModelID) REFERENCES ProductModel(None), FOREIGN KEY (ProductSubcategoryID) REFERENCES ProductSubcategory(None), FOREIGN KEY (WeightUnitMeasureCode) REFERENCES UnitMeasure(None), FOREIGN KEY (SizeUnitMeasureCode) REFERENCES UnitMeasure(None) ); CREATE TABLE Document ( DocumentNode TEXT NOT NULL PRIMARY KEY, DocumentLevel INTEGER, Title TEXT NOT NULL, Owner INTEGER NOT NULL, FolderFlag INTEGER NOT NULL DEFAULT 0, FileName TEXT NOT NULL, FileExtension TEXT NOT NULL, Revision TEXT NOT NULL, ChangeNumber INTEGER NOT NULL DEFAULT 0, Status INTEGER NOT NULL, DocumentSummary TEXT, Document BLOB, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (DocumentLevel, DocumentNode), UNIQUE (rowguid), UNIQUE (DocumentNode), FOREIGN KEY (Owner) REFERENCES Employee(None) ); CREATE TABLE StateProvince ( StateProvinceID INTEGER PRIMARY KEY, StateProvinceCode TEXT NOT NULL, CountryRegionCode TEXT NOT NULL, IsOnlyStateProvinceFlag INTEGER NOT NULL DEFAULT 1, Name TEXT NOT NULL, TerritoryID INTEGER NOT NULL, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (StateProvinceCode, CountryRegionCode), UNIQUE (rowguid), UNIQUE (Name), FOREIGN KEY (TerritoryID) REFERENCES SalesTerritory(None), FOREIGN KEY (CountryRegionCode) REFERENCES CountryRegion(None) ); CREATE TABLE CreditCard ( CreditCardID INTEGER PRIMARY KEY, CardType TEXT NOT NULL, CardNumber TEXT NOT NULL, ExpMonth INTEGER NOT NULL, ExpYear INTEGER NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT current_timestamp, UNIQUE (CardNumber) ); CREATE TABLE SalesOrderHeader ( SalesOrderID INTEGER PRIMARY KEY, RevisionNumber INTEGER NOT NULL DEFAULT 0, OrderDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, DueDate DATETIME NOT NULL, ShipDate DATETIME, Status INTEGER NOT NULL DEFAULT 1, OnlineOrderFlag INTEGER NOT NULL DEFAULT 1, SalesOrderNumber TEXT NOT NULL, PurchaseOrderNumber TEXT, AccountNumber TEXT, CustomerID INTEGER NOT NULL, SalesPersonID INTEGER, TerritoryID INTEGER, BillToAddressID INTEGER NOT NULL, ShipToAddressID INTEGER NOT NULL, ShipMethodID INTEGER NOT NULL, CreditCardID INTEGER, CreditCardApprovalCode TEXT, CurrencyRateID INTEGER, SubTotal REAL NOT NULL DEFAULT 0.0000, TaxAmt REAL NOT NULL DEFAULT 0.0000, Freight REAL NOT NULL DEFAULT 0.0000, TotalDue REAL NOT NULL, Comment TEXT, rowguid TEXT NOT NULL, ModifiedDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rowguid), UNIQUE (SalesOrderNumber), FOREIGN KEY (CurrencyRateID) REFERENCES CurrencyRate(None), FOREIGN KEY (CreditCardID) REFERENCES CreditCard(None), FOREIGN KEY (ShipMethodID) REFERENCES Address(None), FOREIGN KEY (ShipToAddressID) REFERENCES Address(None), FOREIGN KEY (BillToAddressID) REFERENCES Address(None), FOREIGN KEY (TerritoryID) REFERENCES SalesTerritory(None), FOREIGN KEY (SalesPersonID) REFERENCES SalesPerson(None), FOREIGN KEY (CustomerID) REFERENCES Customer(None) );
legislator
{"current": {"columns": [[0, "ballotpedia_id", "TEXT", 0, null, 0], [1, "bioguide_id", "TEXT", 0, null, 1], [2, "birthday_bio", "DATE", 0, null, 0], [3, "cspan_id", "REAL", 0, null, 2], [4, "fec_id", "TEXT", 0, null, 0], [5, "first_name", "TEXT", 0, null, 0], [6, "gender_bio", "TEXT", 0, null, 0], [7, "google_entity_id_id", "TEXT", 0, null, 0], [8, "govtrack_id", "INTEGER", 0, null, 0], [9, "house_history_id", "REAL", 0, null, 0], [10, "icpsr_id", "REAL", 0, null, 0], [11, "last_name", "TEXT", 0, null, 0], [12, "lis_id", "TEXT", 0, null, 0], [13, "maplight_id", "REAL", 0, null, 0], [14, "middle_name", "TEXT", 0, null, 0], [15, "nickname_name", "TEXT", 0, null, 0], [16, "official_full_name", "TEXT", 0, null, 0], [17, "opensecrets_id", "TEXT", 0, null, 0], [18, "religion_bio", "TEXT", 0, null, 0], [19, "suffix_name", "TEXT", 0, null, 0], [20, "thomas_id", "INTEGER", 0, null, 0], [21, "votesmart_id", "REAL", 0, null, 0], [22, "wikidata_id", "TEXT", 0, null, 0], [23, "wikipedia_id", "TEXT", 0, null, 0]], "primary_keys": ["bioguide_id", "cspan_id"], "foreign_keys": [], "unique_constraints": [[[0, 1, "bioguide_id"], [1, 3, "cspan_id"]]], "check_constraints": []}, "current-terms": {"columns": [[0, "address", "TEXT", 0, null, 0], [1, "bioguide", "TEXT", 0, null, 1], [2, "caucus", "TEXT", 0, null, 0], [3, "chamber", "TEXT", 0, null, 0], [4, "class", "REAL", 0, null, 0], [5, "contact_form", "TEXT", 0, null, 0], [6, "district", "REAL", 0, null, 0], [7, "end", "TEXT", 0, null, 2], [8, "fax", "TEXT", 0, null, 0], [9, "last", "TEXT", 0, null, 0], [10, "name", "TEXT", 0, null, 0], [11, "office", "TEXT", 0, null, 0], [12, "party", "TEXT", 0, null, 0], [13, "party_affiliations", "TEXT", 0, null, 0], [14, "phone", "TEXT", 0, null, 0], [15, "relation", "TEXT", 0, null, 0], [16, "rss_url", "TEXT", 0, null, 0], [17, "start", "TEXT", 0, null, 0], [18, "state", "TEXT", 0, null, 0], [19, "state_rank", "TEXT", 0, null, 0], [20, "title", "TEXT", 0, null, 0], [21, "type", "TEXT", 0, null, 0], [22, "url", "TEXT", 0, null, 0]], "primary_keys": ["bioguide", "end"], "foreign_keys": [[0, 0, "current", "bioguide", "bioguide_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "bioguide"], [1, 7, "end"]]], "check_constraints": []}, "historical": {"columns": [[0, "ballotpedia_id", "TEXT", 0, null, 0], [1, "bioguide_id", "TEXT", 0, null, 1], [2, "bioguide_previous_id", "TEXT", 0, null, 0], [3, "birthday_bio", "TEXT", 0, null, 0], [4, "cspan_id", "TEXT", 0, null, 0], [5, "fec_id", "TEXT", 0, null, 0], [6, "first_name", "TEXT", 0, null, 0], [7, "gender_bio", "TEXT", 0, null, 0], [8, "google_entity_id_id", "TEXT", 0, null, 0], [9, "govtrack_id", "INTEGER", 0, null, 0], [10, "house_history_alternate_id", "TEXT", 0, null, 0], [11, "house_history_id", "REAL", 0, null, 0], [12, "icpsr_id", "REAL", 0, null, 0], [13, "last_name", "TEXT", 0, null, 0], [14, "lis_id", "TEXT", 0, null, 0], [15, "maplight_id", "TEXT", 0, null, 0], [16, "middle_name", "TEXT", 0, null, 0], [17, "nickname_name", "TEXT", 0, null, 0], [18, "official_full_name", "TEXT", 0, null, 0], [19, "opensecrets_id", "TEXT", 0, null, 0], [20, "religion_bio", "TEXT", 0, null, 0], [21, "suffix_name", "TEXT", 0, null, 0], [22, "thomas_id", "TEXT", 0, null, 0], [23, "votesmart_id", "TEXT", 0, null, 0], [24, "wikidata_id", "TEXT", 0, null, 0], [25, "wikipedia_id", "TEXT", 0, null, 0]], "primary_keys": ["bioguide_id"], "foreign_keys": [], "unique_constraints": [[[0, 1, "bioguide_id"]]], "check_constraints": []}, "historical-terms": {"columns": [[0, "address", "TEXT", 0, null, 0], [1, "bioguide", "TEXT", 0, null, 1], [2, "chamber", "TEXT", 0, null, 0], [3, "class", "REAL", 0, null, 0], [4, "contact_form", "TEXT", 0, null, 0], [5, "district", "REAL", 0, null, 0], [6, "end", "TEXT", 0, null, 0], [7, "fax", "TEXT", 0, null, 0], [8, "last", "TEXT", 0, null, 0], [9, "middle", "TEXT", 0, null, 0], [10, "name", "TEXT", 0, null, 0], [11, "office", "TEXT", 0, null, 0], [12, "party", "TEXT", 0, null, 0], [13, "party_affiliations", "TEXT", 0, null, 0], [14, "phone", "TEXT", 0, null, 0], [15, "relation", "TEXT", 0, null, 0], [16, "rss_url", "TEXT", 0, null, 0], [17, "start", "TEXT", 0, null, 0], [18, "state", "TEXT", 0, null, 0], [19, "state_rank", "TEXT", 0, null, 0], [20, "title", "TEXT", 0, null, 0], [21, "type", "TEXT", 0, null, 0], [22, "url", "TEXT", 0, null, 0]], "primary_keys": ["bioguide"], "foreign_keys": [[0, 0, "historical", "bioguide", "bioguide_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "bioguide"]]], "check_constraints": []}, "social-media": {"columns": [[0, "bioguide", "TEXT", 0, null, 1], [1, "facebook", "TEXT", 0, null, 0], [2, "facebook_id", "REAL", 0, null, 0], [3, "govtrack", "REAL", 0, null, 0], [4, "instagram", "TEXT", 0, null, 0], [5, "instagram_id", "REAL", 0, null, 0], [6, "thomas", "INTEGER", 0, null, 0], [7, "twitter", "TEXT", 0, null, 0], [8, "twitter_id", "REAL", 0, null, 0], [9, "youtube", "TEXT", 0, null, 0], [10, "youtube_id", "TEXT", 0, null, 0]], "primary_keys": ["bioguide"], "foreign_keys": [[0, 0, "current", "bioguide", "bioguide_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "bioguide"]]], "check_constraints": []}}
CREATE TABLE current ( ballotpedia_id TEXT, bioguide_id TEXT PRIMARY KEY, birthday_bio DATE, cspan_id REAL PRIMARY KEY, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_id REAL, icpsr_id REAL, last_name TEXT, lis_id TEXT, maplight_id REAL, middle_name TEXT, nickname_name TEXT, official_full_name TEXT, opensecrets_id TEXT, religion_bio TEXT, suffix_name TEXT, thomas_id INTEGER, votesmart_id REAL, wikidata_id TEXT, wikipedia_id TEXT, PRIMARY KEY (bioguide_id, cspan_id), UNIQUE (bioguide_id, cspan_id) ); CREATE TABLE current-terms ( address TEXT, bioguide TEXT PRIMARY KEY, caucus TEXT, chamber TEXT, class REAL, contact_form TEXT, district REAL, end TEXT PRIMARY KEY, fax TEXT, last TEXT, name TEXT, office TEXT, party TEXT, party_affiliations TEXT, phone TEXT, relation TEXT, rss_url TEXT, start TEXT, state TEXT, state_rank TEXT, title TEXT, type TEXT, url TEXT, PRIMARY KEY (bioguide, end), UNIQUE (bioguide, end), FOREIGN KEY (bioguide) REFERENCES current(bioguide_id) ); CREATE TABLE historical ( ballotpedia_id TEXT, bioguide_id TEXT PRIMARY KEY, bioguide_previous_id TEXT, birthday_bio TEXT, cspan_id TEXT, fec_id TEXT, first_name TEXT, gender_bio TEXT, google_entity_id_id TEXT, govtrack_id INTEGER, house_history_alternate_id TEXT, house_history_id REAL, icpsr_id REAL, last_name TEXT, lis_id TEXT, maplight_id TEXT, middle_name TEXT, nickname_name TEXT, official_full_name TEXT, opensecrets_id TEXT, religion_bio TEXT, suffix_name TEXT, thomas_id TEXT, votesmart_id TEXT, wikidata_id TEXT, wikipedia_id TEXT, UNIQUE (bioguide_id) ); CREATE TABLE historical-terms ( address TEXT, bioguide TEXT PRIMARY KEY, chamber TEXT, class REAL, contact_form TEXT, district REAL, end TEXT, fax TEXT, last TEXT, middle TEXT, name TEXT, office TEXT, party TEXT, party_affiliations TEXT, phone TEXT, relation TEXT, rss_url TEXT, start TEXT, state TEXT, state_rank TEXT, title TEXT, type TEXT, url TEXT, UNIQUE (bioguide), FOREIGN KEY (bioguide) REFERENCES historical(bioguide_id) ); CREATE TABLE social-media ( bioguide TEXT PRIMARY KEY, facebook TEXT, facebook_id REAL, govtrack REAL, instagram TEXT, instagram_id REAL, thomas INTEGER, twitter TEXT, twitter_id REAL, youtube TEXT, youtube_id TEXT, UNIQUE (bioguide), FOREIGN KEY (bioguide) REFERENCES current(bioguide_id) );
donor
{"sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "essays": {"columns": [[0, "projectid", "TEXT", 0, null, 0], [1, "teacher_acctid", "TEXT", 0, null, 0], [2, "title", "TEXT", 0, null, 0], [3, "short_description", "TEXT", 0, null, 0], [4, "need_statement", "TEXT", 0, null, 0], [5, "essay", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "projects": {"columns": [[0, "projectid", "TEXT", 1, null, 1], [1, "teacher_acctid", "TEXT", 0, null, 0], [2, "schoolid", "TEXT", 0, null, 0], [3, "school_ncesid", "TEXT", 0, null, 0], [4, "school_latitude", "REAL", 0, null, 0], [5, "school_longitude", "REAL", 0, null, 0], [6, "school_city", "TEXT", 0, null, 0], [7, "school_state", "TEXT", 0, null, 0], [8, "school_zip", "INTEGER", 0, null, 0], [9, "school_metro", "TEXT", 0, null, 0], [10, "school_district", "TEXT", 0, null, 0], [11, "school_county", "TEXT", 0, null, 0], [12, "school_charter", "TEXT", 0, null, 0], [13, "school_magnet", "TEXT", 0, null, 0], [14, "school_year_round", "TEXT", 0, null, 0], [15, "school_nlns", "TEXT", 0, null, 0], [16, "school_kipp", "TEXT", 0, null, 0], [17, "school_charter_ready_promise", "TEXT", 0, null, 0], [18, "teacher_prefix", "TEXT", 0, null, 0], [19, "teacher_teach_for_america", "TEXT", 0, null, 0], [20, "teacher_ny_teaching_fellow", "TEXT", 0, null, 0], [21, "primary_focus_subject", "TEXT", 0, null, 0], [22, "primary_focus_area", "TEXT", 0, null, 0], [23, "secondary_focus_subject", "TEXT", 0, null, 0], [24, "secondary_focus_area", "TEXT", 0, null, 0], [25, "resource_type", "TEXT", 0, null, 0], [26, "poverty_level", "TEXT", 0, null, 0], [27, "grade_level", "TEXT", 0, null, 0], [28, "fulfillment_labor_materials", "REAL", 0, null, 0], [29, "total_price_excluding_optional_support", "REAL", 0, null, 0], [30, "total_price_including_optional_support", "REAL", 0, null, 0], [31, "students_reached", "INTEGER", 0, null, 0], [32, "eligible_double_your_impact_match", "TEXT", 0, null, 0], [33, "eligible_almost_home_match", "TEXT", 0, null, 0], [34, "date_posted", "DATE", 0, null, 0]], "primary_keys": ["projectid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "projectid"]]], "check_constraints": []}, "donations": {"columns": [[0, "donationid", "TEXT", 1, null, 1], [1, "projectid", "TEXT", 0, null, 0], [2, "donor_acctid", "TEXT", 0, null, 0], [3, "donor_city", "TEXT", 0, null, 0], [4, "donor_state", "TEXT", 0, null, 0], [5, "donor_zip", "TEXT", 0, null, 0], [6, "is_teacher_acct", "TEXT", 0, null, 0], [7, "donation_timestamp", "DATETIME", 0, null, 0], [8, "donation_to_project", "REAL", 0, null, 0], [9, "donation_optional_support", "REAL", 0, null, 0], [10, "donation_total", "REAL", 0, null, 0], [11, "dollar_amount", "TEXT", 0, null, 0], [12, "donation_included_optional_support", "TEXT", 0, null, 0], [13, "payment_method", "TEXT", 0, null, 0], [14, "payment_included_acct_credit", "TEXT", 0, null, 0], [15, "payment_included_campaign_gift_card", "TEXT", 0, null, 0], [16, "payment_included_web_purchased_gift_card", "TEXT", 0, null, 0], [17, "payment_was_promo_matched", "TEXT", 0, null, 0], [18, "via_giving_page", "TEXT", 0, null, 0], [19, "for_honoree", "TEXT", 0, null, 0], [20, "donation_message", "TEXT", 0, null, 0]], "primary_keys": ["donationid"], "foreign_keys": [[0, 0, "projects", "projectid", "projectid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "donationid"]]], "check_constraints": []}, "resources": {"columns": [[0, "resourceid", "TEXT", 1, null, 1], [1, "projectid", "TEXT", 0, null, 0], [2, "vendorid", "INTEGER", 0, null, 0], [3, "vendor_name", "TEXT", 0, null, 0], [4, "project_resource_type", "TEXT", 0, null, 0], [5, "item_name", "TEXT", 0, null, 0], [6, "item_number", "TEXT", 0, null, 0], [7, "item_unit_price", "REAL", 0, null, 0], [8, "item_quantity", "INTEGER", 0, null, 0]], "primary_keys": ["resourceid"], "foreign_keys": [[0, 0, "projects", "projectid", "projectid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "resourceid"]]], "check_constraints": []}}
CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE essays ( projectid TEXT, teacher_acctid TEXT, title TEXT, short_description TEXT, need_statement TEXT, essay TEXT ); CREATE TABLE projects ( projectid TEXT NOT NULL PRIMARY KEY, teacher_acctid TEXT, schoolid TEXT, school_ncesid TEXT, school_latitude REAL, school_longitude REAL, school_city TEXT, school_state TEXT, school_zip INTEGER, school_metro TEXT, school_district TEXT, school_county TEXT, school_charter TEXT, school_magnet TEXT, school_year_round TEXT, school_nlns TEXT, school_kipp TEXT, school_charter_ready_promise TEXT, teacher_prefix TEXT, teacher_teach_for_america TEXT, teacher_ny_teaching_fellow TEXT, primary_focus_subject TEXT, primary_focus_area TEXT, secondary_focus_subject TEXT, secondary_focus_area TEXT, resource_type TEXT, poverty_level TEXT, grade_level TEXT, fulfillment_labor_materials REAL, total_price_excluding_optional_support REAL, total_price_including_optional_support REAL, students_reached INTEGER, eligible_double_your_impact_match TEXT, eligible_almost_home_match TEXT, date_posted DATE, UNIQUE (projectid) ); CREATE TABLE donations ( donationid TEXT NOT NULL PRIMARY KEY, projectid TEXT, donor_acctid TEXT, donor_city TEXT, donor_state TEXT, donor_zip TEXT, is_teacher_acct TEXT, donation_timestamp DATETIME, donation_to_project REAL, donation_optional_support REAL, donation_total REAL, dollar_amount TEXT, donation_included_optional_support TEXT, payment_method TEXT, payment_included_acct_credit TEXT, payment_included_campaign_gift_card TEXT, payment_included_web_purchased_gift_card TEXT, payment_was_promo_matched TEXT, via_giving_page TEXT, for_honoree TEXT, donation_message TEXT, UNIQUE (donationid), FOREIGN KEY (projectid) REFERENCES projects(projectid) ); CREATE TABLE resources ( resourceid TEXT NOT NULL PRIMARY KEY, projectid TEXT, vendorid INTEGER, vendor_name TEXT, project_resource_type TEXT, item_name TEXT, item_number TEXT, item_unit_price REAL, item_quantity INTEGER, UNIQUE (resourceid), FOREIGN KEY (projectid) REFERENCES projects(projectid) );
disney
{"characters": {"columns": [[0, "movie_title", "TEXT", 0, null, 1], [1, "release_date", "TEXT", 0, null, 0], [2, "hero", "TEXT", 0, null, 0], [3, "villian", "TEXT", 0, null, 0], [4, "song", "TEXT", 0, null, 0]], "primary_keys": ["movie_title"], "foreign_keys": [[0, 0, "voice-actors", "hero", "character", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "movie_title"]]], "check_constraints": []}, "director": {"columns": [[0, "name", "TEXT", 0, null, 1], [1, "director", "TEXT", 0, null, 0]], "primary_keys": ["name"], "foreign_keys": [[0, 0, "characters", "name", "movie_title", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "name"]]], "check_constraints": []}, "movies_total_gross": {"columns": [[0, "movie_title", "TEXT", 0, null, 1], [1, "release_date", "TEXT", 0, null, 2], [2, "genre", "TEXT", 0, null, 0], [3, "MPAA_rating", "TEXT", 0, null, 0], [4, "total_gross", "TEXT", 0, null, 0], [5, "inflation_adjusted_gross", "TEXT", 0, null, 0]], "primary_keys": ["movie_title", "release_date"], "foreign_keys": [[0, 0, "characters", "movie_title", "movie_title", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "movie_title"], [1, 1, "release_date"]]], "check_constraints": []}, "revenue": {"columns": [[0, "Year", "INTEGER", 0, null, 1], [1, "Studio Entertainment[NI 1]", "REAL", 0, null, 0], [2, "Disney Consumer Products[NI 2]", "REAL", 0, null, 0], [3, "Disney Interactive[NI 3][Rev 1]", "INTEGER", 0, null, 0], [4, "Walt Disney Parks and Resorts", "REAL", 0, null, 0], [5, "Disney Media Networks", "TEXT", 0, null, 0], [6, "Total", "INTEGER", 0, null, 0]], "primary_keys": ["Year"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "voice-actors": {"columns": [[0, "character", "TEXT", 0, null, 1], [1, "voice-actor", "TEXT", 0, null, 0], [2, "movie", "TEXT", 0, null, 0]], "primary_keys": ["character"], "foreign_keys": [[0, 0, "characters", "movie", "movie_title", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "character"]]], "check_constraints": []}}
CREATE TABLE characters ( movie_title TEXT PRIMARY KEY, release_date TEXT, hero TEXT, villian TEXT, song TEXT, UNIQUE (movie_title), FOREIGN KEY (hero) REFERENCES voice-actors(character) ); CREATE TABLE director ( name TEXT PRIMARY KEY, director TEXT, UNIQUE (name), FOREIGN KEY (name) REFERENCES characters(movie_title) ); CREATE TABLE movies_total_gross ( movie_title TEXT PRIMARY KEY, release_date TEXT PRIMARY KEY, genre TEXT, MPAA_rating TEXT, total_gross TEXT, inflation_adjusted_gross TEXT, PRIMARY KEY (movie_title, release_date), UNIQUE (movie_title, release_date), FOREIGN KEY (movie_title) REFERENCES characters(movie_title) ); CREATE TABLE revenue ( Year INTEGER PRIMARY KEY, Studio Entertainment[NI 1] REAL, Disney Consumer Products[NI 2] REAL, Disney Interactive[NI 3][Rev 1] INTEGER, Walt Disney Parks and Resorts REAL, Disney Media Networks TEXT, Total INTEGER ); CREATE TABLE voice-actors ( character TEXT PRIMARY KEY, voice-actor TEXT, movie TEXT, UNIQUE (character), FOREIGN KEY (movie) REFERENCES characters(movie_title) );
university
{"country": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "country_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "ranking_system": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "system_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "ranking_criteria": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "ranking_system_id", "INTEGER", 0, "NULL", 0], [2, "criteria_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "ranking_system", "ranking_system_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "university": {"columns": [[0, "id", "INTEGER", 1, null, 1], [1, "country_id", "INTEGER", 0, "NULL", 0], [2, "university_name", "TEXT", 0, "NULL", 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "country", "country_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "university_ranking_year": {"columns": [[0, "university_id", "INTEGER", 0, "NULL", 0], [1, "ranking_criteria_id", "INTEGER", 0, "NULL", 0], [2, "year", "INTEGER", 0, "NULL", 0], [3, "score", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "university", "university_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "ranking_criteria", "ranking_criteria_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "university_year": {"columns": [[0, "university_id", "INTEGER", 0, "NULL", 0], [1, "year", "INTEGER", 0, "NULL", 0], [2, "num_students", "INTEGER", 0, "NULL", 0], [3, "student_staff_ratio", "REAL", 0, "NULL", 0], [4, "pct_international_students", "INTEGER", 0, "NULL", 0], [5, "pct_female_students", "INTEGER", 0, "NULL", 0]], "primary_keys": [], "foreign_keys": [[0, 0, "university", "university_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE country ( id INTEGER NOT NULL PRIMARY KEY, country_name TEXT DEFAULT NULL ); CREATE TABLE ranking_system ( id INTEGER NOT NULL PRIMARY KEY, system_name TEXT DEFAULT NULL ); CREATE TABLE ranking_criteria ( id INTEGER NOT NULL PRIMARY KEY, ranking_system_id INTEGER DEFAULT NULL, criteria_name TEXT DEFAULT NULL, FOREIGN KEY (ranking_system_id) REFERENCES ranking_system(id) ); CREATE TABLE university ( id INTEGER NOT NULL PRIMARY KEY, country_id INTEGER DEFAULT NULL, university_name TEXT DEFAULT NULL, FOREIGN KEY (country_id) REFERENCES country(id) ); CREATE TABLE university_ranking_year ( university_id INTEGER DEFAULT NULL, ranking_criteria_id INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, score INTEGER DEFAULT NULL, FOREIGN KEY (university_id) REFERENCES university(id), FOREIGN KEY (ranking_criteria_id) REFERENCES ranking_criteria(id) ); CREATE TABLE university_year ( university_id INTEGER DEFAULT NULL, year INTEGER DEFAULT NULL, num_students INTEGER DEFAULT NULL, student_staff_ratio REAL DEFAULT NULL, pct_international_students INTEGER DEFAULT NULL, pct_female_students INTEGER DEFAULT NULL, FOREIGN KEY (university_id) REFERENCES university(id) );