db_id
stringlengths
3
31
tables
stringlengths
629
17.5k
schema
stringlengths
334
8.29k
company_office
{"buildings": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "City", "TEXT", 0, null, 0], [3, "Height", "INT", 0, null, 0], [4, "Stories", "INT", 0, null, 0], [5, "Status", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "Companies": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "Headquarters", "TEXT", 0, null, 0], [3, "Industry", "TEXT", 0, null, 0], [4, "Sales_billion", "REAL", 0, null, 0], [5, "Profits_billion", "REAL", 0, null, 0], [6, "Assets_billion", "REAL", 0, null, 0], [7, "Market_Value_billion", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "Office_locations": {"columns": [[0, "building_id", "INT", 0, null, 1], [1, "company_id", "INT", 0, null, 2], [2, "move_in_year", "INT", 0, null, 0]], "primary_keys": ["building_id", "company_id"], "foreign_keys": [[0, 0, "Companies", "company_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "buildings", "building_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "building_id"], [1, 1, "company_id"]]], "check_constraints": []}}
CREATE TABLE buildings ( id INT PRIMARY KEY, name TEXT, City TEXT, Height INT, Stories INT, Status TEXT, UNIQUE (id) ); CREATE TABLE Companies ( id INT PRIMARY KEY, name TEXT, Headquarters TEXT, Industry TEXT, Sales_billion REAL, Profits_billion REAL, Assets_billion REAL, Market_Value_billion TEXT, UNIQUE (id) ); CREATE TABLE Office_locations ( building_id INT PRIMARY KEY, company_id INT PRIMARY KEY, move_in_year INT, PRIMARY KEY (building_id, company_id), UNIQUE (building_id, company_id), FOREIGN KEY (company_id) REFERENCES Companies(id), FOREIGN KEY (building_id) REFERENCES buildings(id) );
game_1
{"Student": {"columns": [[0, "StuID", "INTEGER", 0, null, 1], [1, "LName", "VARCHAR(12)", 0, null, 0], [2, "Fname", "VARCHAR(12)", 0, null, 0], [3, "Age", "INTEGER", 0, null, 0], [4, "Sex", "VARCHAR(1)", 0, null, 0], [5, "Major", "INTEGER", 0, null, 0], [6, "Advisor", "INTEGER", 0, null, 0], [7, "city_code", "VARCHAR(3)", 0, null, 0]], "primary_keys": ["StuID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Video_Games": {"columns": [[0, "GameID", "INTEGER", 0, null, 1], [1, "GName", "VARCHAR(40)", 0, null, 0], [2, "GType", "VARCHAR(40)", 0, null, 0]], "primary_keys": ["GameID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Plays_Games": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "GameID", "INTEGER", 0, null, 0], [2, "Hours_Played", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Video_Games", "GameID", "GameID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "SportsInfo": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "SportName", "VARCHAR(32)", 0, null, 0], [2, "HoursPerWeek", "INTEGER", 0, null, 0], [3, "GamesPlayed", "INTEGER", 0, null, 0], [4, "OnScholarship", "VARCHAR(1)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); CREATE TABLE Video_Games ( GameID INTEGER PRIMARY KEY, GName VARCHAR(40), GType VARCHAR(40) ); CREATE TABLE Plays_Games ( StuID INTEGER, GameID INTEGER, Hours_Played INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (GameID) REFERENCES Video_Games(GameID) ); CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1), FOREIGN KEY (StuID) REFERENCES Student(StuID) );
swimming
{"swimmer": {"columns": [[0, "ID", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "Nationality", "TEXT", 0, null, 0], [3, "meter_100", "REAL", 0, null, 0], [4, "meter_200", "TEXT", 0, null, 0], [5, "meter_300", "TEXT", 0, null, 0], [6, "meter_400", "TEXT", 0, null, 0], [7, "meter_500", "TEXT", 0, null, 0], [8, "meter_600", "TEXT", 0, null, 0], [9, "meter_700", "TEXT", 0, null, 0], [10, "Time", "TEXT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": []}, "stadium": {"columns": [[0, "ID", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "Capacity", "INT", 0, null, 0], [3, "City", "TEXT", 0, null, 0], [4, "Country", "TEXT", 0, null, 0], [5, "Opening_year", "INT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": []}, "event": {"columns": [[0, "ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Stadium_ID", "INT", 0, null, 0], [3, "Year", "TEXT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [[0, 0, "stadium", "Stadium_ID", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": []}, "record": {"columns": [[0, "ID", "INT", 0, null, 0], [1, "Result", "TEXT", 0, null, 0], [2, "Swimmer_ID", "INT", 0, null, 1], [3, "Event_ID", "INT", 0, null, 2]], "primary_keys": ["Swimmer_ID", "Event_ID"], "foreign_keys": [[0, 0, "swimmer", "Swimmer_ID", "ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "event", "Event_ID", "ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 2, "Swimmer_ID"], [1, 3, "Event_ID"]]], "check_constraints": []}}
CREATE TABLE swimmer ( ID INT PRIMARY KEY, name TEXT, Nationality TEXT, meter_100 REAL, meter_200 TEXT, meter_300 TEXT, meter_400 TEXT, meter_500 TEXT, meter_600 TEXT, meter_700 TEXT, Time TEXT, UNIQUE (ID) ); CREATE TABLE stadium ( ID INT PRIMARY KEY, name TEXT, Capacity INT, City TEXT, Country TEXT, Opening_year INT, UNIQUE (ID) ); CREATE TABLE event ( ID INT PRIMARY KEY, Name TEXT, Stadium_ID INT, Year TEXT, UNIQUE (ID), FOREIGN KEY (Stadium_ID) REFERENCES stadium(ID) ); CREATE TABLE record ( ID INT, Result TEXT, Swimmer_ID INT PRIMARY KEY, Event_ID INT PRIMARY KEY, PRIMARY KEY (Swimmer_ID, Event_ID), UNIQUE (Swimmer_ID, Event_ID), FOREIGN KEY (Swimmer_ID) REFERENCES swimmer(ID), FOREIGN KEY (Event_ID) REFERENCES event(ID) );
local_govt_and_lot
{"Customers": {"columns": [[0, "customer_id", "INTEGER", 1, null, 1], [1, "customer_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Properties": {"columns": [[0, "property_id", "INTEGER", 1, null, 1], [1, "property_type_code", "CHAR(15)", 1, null, 0], [2, "property_address", "VARCHAR(255)", 0, null, 0], [3, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["property_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Residents": {"columns": [[0, "resident_id", "INTEGER", 1, null, 1], [1, "property_id", "INTEGER", 1, null, 2], [2, "date_moved_in", "DATETIME", 1, null, 3], [3, "date_moved_out", "DATETIME", 1, null, 0], [4, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["resident_id", "property_id", "date_moved_in"], "foreign_keys": [[0, 0, "Properties", "property_id", "property_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "resident_id"], [1, 1, "property_id"], [2, 2, "date_moved_in"]]], "check_constraints": []}, "Organizations": {"columns": [[0, "organization_id", "INTEGER", 1, null, 1], [1, "parent_organization_id", "INTEGER", 0, null, 0], [2, "organization_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["organization_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Services": {"columns": [[0, "service_id", "INTEGER", 1, null, 1], [1, "organization_id", "INTEGER", 1, null, 0], [2, "service_type_code", "CHAR(15)", 1, null, 0], [3, "service_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["service_id"], "foreign_keys": [[0, 0, "Organizations", "organization_id", "organization_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Residents_Services": {"columns": [[0, "resident_id", "INTEGER", 1, null, 1], [1, "service_id", "INTEGER", 1, null, 2], [2, "date_moved_in", "DATETIME", 0, null, 0], [3, "property_id", "INTEGER", 0, null, 0], [4, "date_requested", "DATETIME", 0, null, 0], [5, "date_provided", "DATETIME", 0, null, 0], [6, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["resident_id", "service_id"], "foreign_keys": [[0, 0, "Residents", "resident_id", "resident_id", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "Residents", "property_id", "property_id", "NO ACTION", "NO ACTION", "NONE"], [0, 2, "Residents", "date_moved_in", "date_moved_in", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Services", "service_id", "service_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "resident_id"], [1, 1, "service_id"]]], "check_constraints": []}, "Things": {"columns": [[0, "thing_id", "INTEGER", 1, null, 1], [1, "organization_id", "INTEGER", 1, null, 0], [2, "Type_of_Thing_Code", "CHAR(15)", 1, null, 0], [3, "service_type_code", "CHAR(10)", 1, null, 0], [4, "service_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["thing_id"], "foreign_keys": [[0, 0, "Organizations", "organization_id", "organization_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Customer_Events": {"columns": [[0, "Customer_Event_ID", "INTEGER", 1, null, 1], [1, "customer_id", "INTEGER", 0, null, 0], [2, "date_moved_in", "DATETIME", 0, null, 0], [3, "property_id", "INTEGER", 0, null, 0], [4, "resident_id", "INTEGER", 0, null, 0], [5, "thing_id", "INTEGER", 1, null, 0]], "primary_keys": ["Customer_Event_ID"], "foreign_keys": [[0, 0, "Residents", "resident_id", "resident_id", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "Residents", "property_id", "property_id", "NO ACTION", "NO ACTION", "NONE"], [0, 2, "Residents", "date_moved_in", "date_moved_in", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Things", "thing_id", "thing_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Customer_Event_Notes": {"columns": [[0, "Customer_Event_Note_ID", "INTEGER", 1, null, 1], [1, "Customer_Event_ID", "INTEGER", 1, null, 0], [2, "service_type_code", "CHAR(15)", 1, null, 0], [3, "resident_id", "INTEGER", 1, null, 0], [4, "property_id", "INTEGER", 1, null, 0], [5, "date_moved_in", "DATETIME", 1, null, 0]], "primary_keys": ["Customer_Event_Note_ID"], "foreign_keys": [[0, 0, "Customer_Events", "Customer_Event_ID", "Customer_Event_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Timed_Status_of_Things": {"columns": [[0, "thing_id", "INTEGER", 1, null, 1], [1, "Date_and_Date", "DATETIME", 1, null, 2], [2, "Status_of_Thing_Code", "CHAR(15)", 1, null, 3]], "primary_keys": ["thing_id", "Date_and_Date", "Status_of_Thing_Code"], "foreign_keys": [[0, 0, "Things", "thing_id", "thing_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "thing_id"], [1, 1, "Date_and_Date"], [2, 2, "Status_of_Thing_Code"]]], "check_constraints": []}, "Timed_Locations_of_Things": {"columns": [[0, "thing_id", "INTEGER", 1, null, 1], [1, "Date_and_Time", "DATETIME", 1, null, 2], [2, "Location_Code", "CHAR(15)", 1, null, 3]], "primary_keys": ["thing_id", "Date_and_Time", "Location_Code"], "foreign_keys": [[0, 0, "Things", "thing_id", "thing_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "thing_id"], [1, 1, "Date_and_Time"], [2, 2, "Location_Code"]]], "check_constraints": []}}
CREATE TABLE Customers ( customer_id INTEGER NOT NULL PRIMARY KEY, customer_details VARCHAR(255) ); CREATE TABLE Properties ( property_id INTEGER NOT NULL PRIMARY KEY, property_type_code CHAR(15) NOT NULL, property_address VARCHAR(255), other_details VARCHAR(255) ); CREATE TABLE Residents ( resident_id INTEGER NOT NULL PRIMARY KEY, property_id INTEGER NOT NULL PRIMARY KEY, date_moved_in DATETIME NOT NULL PRIMARY KEY, date_moved_out DATETIME NOT NULL, other_details VARCHAR(255), PRIMARY KEY (resident_id, property_id, date_moved_in), UNIQUE (resident_id, property_id, date_moved_in), FOREIGN KEY (property_id) REFERENCES Properties(property_id) ); CREATE TABLE Organizations ( organization_id INTEGER NOT NULL PRIMARY KEY, parent_organization_id INTEGER, organization_details VARCHAR(255) ); CREATE TABLE Services ( service_id INTEGER NOT NULL PRIMARY KEY, organization_id INTEGER NOT NULL, service_type_code CHAR(15) NOT NULL, service_details VARCHAR(255), FOREIGN KEY (organization_id) REFERENCES Organizations(organization_id) ); CREATE TABLE Residents_Services ( resident_id INTEGER NOT NULL PRIMARY KEY, service_id INTEGER NOT NULL PRIMARY KEY, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255), PRIMARY KEY (resident_id, service_id), UNIQUE (resident_id, service_id), FOREIGN KEY (resident_id) REFERENCES Residents(resident_id), FOREIGN KEY (property_id) REFERENCES Residents(property_id), FOREIGN KEY (date_moved_in) REFERENCES Residents(date_moved_in), FOREIGN KEY (service_id) REFERENCES Services(service_id) ); CREATE TABLE Things ( thing_id INTEGER NOT NULL PRIMARY KEY, organization_id INTEGER NOT NULL, Type_of_Thing_Code CHAR(15) NOT NULL, service_type_code CHAR(10) NOT NULL, service_details VARCHAR(255), FOREIGN KEY (organization_id) REFERENCES Organizations(organization_id) ); CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER NOT NULL PRIMARY KEY, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_id INTEGER, thing_id INTEGER NOT NULL, FOREIGN KEY (resident_id) REFERENCES Residents(resident_id), FOREIGN KEY (property_id) REFERENCES Residents(property_id), FOREIGN KEY (date_moved_in) REFERENCES Residents(date_moved_in), FOREIGN KEY (customer_id) REFERENCES Customers(customer_id), FOREIGN KEY (thing_id) REFERENCES Things(thing_id) ); CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER NOT NULL PRIMARY KEY, Customer_Event_ID INTEGER NOT NULL, service_type_code CHAR(15) NOT NULL, resident_id INTEGER NOT NULL, property_id INTEGER NOT NULL, date_moved_in DATETIME NOT NULL, FOREIGN KEY (Customer_Event_ID) REFERENCES Customer_Events(Customer_Event_ID) ); CREATE TABLE Timed_Status_of_Things ( thing_id INTEGER NOT NULL PRIMARY KEY, Date_and_Date DATETIME NOT NULL PRIMARY KEY, Status_of_Thing_Code CHAR(15) NOT NULL PRIMARY KEY, PRIMARY KEY (thing_id, Date_and_Date, Status_of_Thing_Code), UNIQUE (thing_id, Date_and_Date, Status_of_Thing_Code), FOREIGN KEY (thing_id) REFERENCES Things(thing_id) ); CREATE TABLE Timed_Locations_of_Things ( thing_id INTEGER NOT NULL PRIMARY KEY, Date_and_Time DATETIME NOT NULL PRIMARY KEY, Location_Code CHAR(15) NOT NULL PRIMARY KEY, PRIMARY KEY (thing_id, Date_and_Time, Location_Code), UNIQUE (thing_id, Date_and_Time, Location_Code), FOREIGN KEY (thing_id) REFERENCES Things(thing_id) );
customers_campaigns_ecommerce
{"Premises": {"columns": [[0, "premise_id", "INTEGER", 0, null, 1], [1, "premises_type", "VARCHAR(15)", 1, null, 0], [2, "premise_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["premise_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "product_id", "INTEGER", 0, null, 1], [1, "product_category", "VARCHAR(15)", 1, null, 0], [2, "product_name", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["product_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "payment_method", "VARCHAR(15)", 1, null, 0], [2, "customer_name", "VARCHAR(80)", 0, null, 0], [3, "customer_phone", "VARCHAR(80)", 0, null, 0], [4, "customer_email", "VARCHAR(80)", 0, null, 0], [5, "customer_address", "VARCHAR(255)", 0, null, 0], [6, "customer_login", "VARCHAR(80)", 0, null, 0], [7, "customer_password", "VARCHAR(10)", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Mailshot_Campaigns": {"columns": [[0, "mailshot_id", "INTEGER", 0, null, 1], [1, "product_category", "VARCHAR(15)", 0, null, 0], [2, "mailshot_name", "VARCHAR(80)", 0, null, 0], [3, "mailshot_start_date", "DATETIME", 0, null, 0], [4, "mailshot_end_date", "DATETIME", 0, null, 0]], "primary_keys": ["mailshot_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customer_Addresses": {"columns": [[0, "customer_id", "INTEGER", 1, null, 0], [1, "premise_id", "INTEGER", 1, null, 0], [2, "date_address_from", "DATETIME", 1, null, 0], [3, "address_type_code", "VARCHAR(15)", 1, null, 0], [4, "date_address_to", "DATETIME", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Premises", "premise_id", "premise_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Customer_Orders": {"columns": [[0, "order_id", "INTEGER", 0, null, 1], [1, "customer_id", "INTEGER", 1, null, 0], [2, "order_status_code", "VARCHAR(15)", 1, null, 0], [3, "shipping_method_code", "VARCHAR(15)", 1, null, 0], [4, "order_placed_datetime", "DATETIME", 1, null, 0], [5, "order_delivered_datetime", "DATETIME", 0, null, 0], [6, "order_shipping_charges", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["order_id"], "foreign_keys": [[0, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Mailshot_Customers": {"columns": [[0, "mailshot_id", "INTEGER", 1, null, 0], [1, "customer_id", "INTEGER", 1, null, 0], [2, "outcome_code", "VARCHAR(15)", 1, null, 0], [3, "mailshot_customer_date", "DATETIME", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Mailshot_Campaigns", "mailshot_id", "mailshot_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Order_Items": {"columns": [[0, "item_id", "INTEGER", 1, null, 0], [1, "order_item_status_code", "VARCHAR(15)", 1, null, 0], [2, "order_id", "INTEGER", 1, null, 0], [3, "product_id", "INTEGER", 1, null, 0], [4, "item_status_code", "VARCHAR(15)", 0, null, 0], [5, "item_delivered_datetime", "DATETIME", 0, null, 0], [6, "item_order_quantity", "VARCHAR(80)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Customer_Orders", "order_id", "order_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Products", "product_id", "product_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Premises ( premise_id INTEGER PRIMARY KEY, premises_type VARCHAR(15) NOT NULL, premise_details VARCHAR(255) ); CREATE TABLE Products ( product_id INTEGER PRIMARY KEY, product_category VARCHAR(15) NOT NULL, product_name VARCHAR(80) ); CREATE TABLE Customers ( customer_id INTEGER PRIMARY KEY, payment_method VARCHAR(15) NOT NULL, customer_name VARCHAR(80), customer_phone VARCHAR(80), customer_email VARCHAR(80), customer_address VARCHAR(255), customer_login VARCHAR(80), customer_password VARCHAR(10) ); CREATE TABLE Mailshot_Campaigns ( mailshot_id INTEGER PRIMARY KEY, product_category VARCHAR(15), mailshot_name VARCHAR(80), mailshot_start_date DATETIME, mailshot_end_date DATETIME ); CREATE TABLE Customer_Addresses ( customer_id INTEGER NOT NULL, premise_id INTEGER NOT NULL, date_address_from DATETIME NOT NULL, address_type_code VARCHAR(15) NOT NULL, date_address_to DATETIME, FOREIGN KEY (customer_id) REFERENCES Customers(customer_id), FOREIGN KEY (premise_id) REFERENCES Premises(premise_id) ); CREATE TABLE Customer_Orders ( order_id INTEGER PRIMARY KEY, customer_id INTEGER NOT NULL, order_status_code VARCHAR(15) NOT NULL, shipping_method_code VARCHAR(15) NOT NULL, order_placed_datetime DATETIME NOT NULL, order_delivered_datetime DATETIME, order_shipping_charges VARCHAR(255), FOREIGN KEY (customer_id) REFERENCES Customers(customer_id) ); CREATE TABLE Mailshot_Customers ( mailshot_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, outcome_code VARCHAR(15) NOT NULL, mailshot_customer_date DATETIME, FOREIGN KEY (mailshot_id) REFERENCES Mailshot_Campaigns(mailshot_id), FOREIGN KEY (customer_id) REFERENCES Customers(customer_id) ); CREATE TABLE Order_Items ( item_id INTEGER NOT NULL, order_item_status_code VARCHAR(15) NOT NULL, order_id INTEGER NOT NULL, product_id INTEGER NOT NULL, item_status_code VARCHAR(15), item_delivered_datetime DATETIME, item_order_quantity VARCHAR(80), FOREIGN KEY (order_id) REFERENCES Customer_Orders(order_id), FOREIGN KEY (product_id) REFERENCES Products(product_id) );
document_management
{"Roles": {"columns": [[0, "role_code", "VARCHAR(15)", 0, null, 1], [1, "role_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["role_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "role_code"]]], "check_constraints": []}, "Users": {"columns": [[0, "user_id", "INTEGER", 0, null, 1], [1, "role_code", "VARCHAR(15)", 1, null, 0], [2, "user_name", "VARCHAR(40)", 0, null, 0], [3, "user_login", "VARCHAR(40)", 0, null, 0], [4, "password", "VARCHAR(40)", 0, null, 0]], "primary_keys": ["user_id"], "foreign_keys": [[0, 0, "Roles", "role_code", "role_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Document_Structures": {"columns": [[0, "document_structure_code", "VARCHAR(15)", 0, null, 1], [1, "parent_document_structure_code", "VARCHAR(15)", 0, null, 0], [2, "document_structure_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["document_structure_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "document_structure_code"]]], "check_constraints": []}, "Functional_Areas": {"columns": [[0, "functional_area_code", "VARCHAR(15)", 0, null, 1], [1, "parent_functional_area_code", "VARCHAR(15)", 0, null, 0], [2, "functional_area_description", "VARCHAR(80)", 1, null, 0]], "primary_keys": ["functional_area_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "functional_area_code"]]], "check_constraints": []}, "Images": {"columns": [[0, "image_id", "INTEGER", 0, null, 1], [1, "image_alt_text", "VARCHAR(80)", 0, null, 0], [2, "image_name", "VARCHAR(40)", 0, null, 0], [3, "image_url", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["image_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Documents": {"columns": [[0, "document_code", "VARCHAR(15)", 0, null, 1], [1, "document_structure_code", "VARCHAR(15)", 1, null, 0], [2, "document_type_code", "VARCHAR(15)", 1, null, 0], [3, "access_count", "INTEGER", 0, null, 0], [4, "document_name", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["document_code"], "foreign_keys": [[0, 0, "Document_Structures", "document_structure_code", "document_structure_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "document_code"]]], "check_constraints": []}, "Document_Functional_Areas": {"columns": [[0, "document_code", "VARCHAR(15)", 1, null, 0], [1, "functional_area_code", "VARCHAR(15)", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Functional_Areas", "functional_area_code", "functional_area_code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Documents", "document_code", "document_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Document_Sections": {"columns": [[0, "section_id", "INTEGER", 0, null, 1], [1, "document_code", "VARCHAR(15)", 1, null, 0], [2, "section_sequence", "INTEGER", 0, null, 0], [3, "section_code", "VARCHAR(20)", 0, null, 0], [4, "section_title", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["section_id"], "foreign_keys": [[0, 0, "Documents", "document_code", "document_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Document_Sections_Images": {"columns": [[0, "section_id", "INTEGER", 1, null, 1], [1, "image_id", "INTEGER", 1, null, 2]], "primary_keys": ["section_id", "image_id"], "foreign_keys": [[0, 0, "Images", "image_id", "image_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Document_Sections", "section_id", "section_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "section_id"], [1, 1, "image_id"]]], "check_constraints": []}}
CREATE TABLE Roles ( role_code VARCHAR(15) PRIMARY KEY, role_description VARCHAR(80), UNIQUE (role_code) ); CREATE TABLE Users ( user_id INTEGER PRIMARY KEY, role_code VARCHAR(15) NOT NULL, user_name VARCHAR(40), user_login VARCHAR(40), password VARCHAR(40), FOREIGN KEY (role_code) REFERENCES Roles(role_code) ); CREATE TABLE Document_Structures ( document_structure_code VARCHAR(15) PRIMARY KEY, parent_document_structure_code VARCHAR(15), document_structure_description VARCHAR(80), UNIQUE (document_structure_code) ); CREATE TABLE Functional_Areas ( functional_area_code VARCHAR(15) PRIMARY KEY, parent_functional_area_code VARCHAR(15), functional_area_description VARCHAR(80) NOT NULL, UNIQUE (functional_area_code) ); CREATE TABLE Images ( image_id INTEGER PRIMARY KEY, image_alt_text VARCHAR(80), image_name VARCHAR(40), image_url VARCHAR(255) ); CREATE TABLE Documents ( document_code VARCHAR(15) PRIMARY KEY, document_structure_code VARCHAR(15) NOT NULL, document_type_code VARCHAR(15) NOT NULL, access_count INTEGER, document_name VARCHAR(80), UNIQUE (document_code), FOREIGN KEY (document_structure_code) REFERENCES Document_Structures(document_structure_code) ); CREATE TABLE Document_Functional_Areas ( document_code VARCHAR(15) NOT NULL, functional_area_code VARCHAR(15) NOT NULL, FOREIGN KEY (functional_area_code) REFERENCES Functional_Areas(functional_area_code), FOREIGN KEY (document_code) REFERENCES Documents(document_code) ); CREATE TABLE Document_Sections ( section_id INTEGER PRIMARY KEY, document_code VARCHAR(15) NOT NULL, section_sequence INTEGER, section_code VARCHAR(20), section_title VARCHAR(80), FOREIGN KEY (document_code) REFERENCES Documents(document_code) ); CREATE TABLE Document_Sections_Images ( section_id INTEGER NOT NULL PRIMARY KEY, image_id INTEGER NOT NULL PRIMARY KEY, PRIMARY KEY (section_id, image_id), UNIQUE (section_id, image_id), FOREIGN KEY (image_id) REFERENCES Images(image_id), FOREIGN KEY (section_id) REFERENCES Document_Sections(section_id) );
party_people
{"region": {"columns": [[0, "Region_ID", "INT", 0, null, 1], [1, "Region_name", "TEXT", 0, null, 0], [2, "Date", "TEXT", 0, null, 0], [3, "Label", "TEXT", 0, null, 0], [4, "Format", "TEXT", 0, null, 0], [5, "Catalogue", "TEXT", 0, null, 0]], "primary_keys": ["Region_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Region_ID"]]], "check_constraints": []}, "party": {"columns": [[0, "Party_ID", "INT", 0, null, 1], [1, "Minister", "TEXT", 0, null, 0], [2, "Took_office", "TEXT", 0, null, 0], [3, "Left_office", "TEXT", 0, null, 0], [4, "Region_ID", "INT", 0, null, 0], [5, "Party_name", "TEXT", 0, null, 0]], "primary_keys": ["Party_ID"], "foreign_keys": [[0, 0, "region", "Region_ID", "Region_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Party_ID"]]], "check_constraints": []}, "member": {"columns": [[0, "Member_ID", "INT", 0, null, 1], [1, "Member_Name", "TEXT", 0, null, 0], [2, "Party_ID", "TEXT", 0, null, 0], [3, "In_office", "TEXT", 0, null, 0]], "primary_keys": ["Member_ID"], "foreign_keys": [[0, 0, "party", "Party_ID", "Party_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Member_ID"]]], "check_constraints": []}, "party_events": {"columns": [[0, "Event_ID", "INT", 0, null, 1], [1, "Event_Name", "TEXT", 0, null, 0], [2, "Party_ID", "INT", 0, null, 0], [3, "Member_in_charge_ID", "INT", 0, null, 0]], "primary_keys": ["Event_ID"], "foreign_keys": [[0, 0, "member", "Member_in_charge_ID", "Member_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "party", "Party_ID", "Party_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Event_ID"]]], "check_constraints": []}}
CREATE TABLE region ( Region_ID INT PRIMARY KEY, Region_name TEXT, Date TEXT, Label TEXT, Format TEXT, Catalogue TEXT, UNIQUE (Region_ID) ); CREATE TABLE party ( Party_ID INT PRIMARY KEY, Minister TEXT, Took_office TEXT, Left_office TEXT, Region_ID INT, Party_name TEXT, UNIQUE (Party_ID), FOREIGN KEY (Region_ID) REFERENCES region(Region_ID) ); CREATE TABLE member ( Member_ID INT PRIMARY KEY, Member_Name TEXT, Party_ID TEXT, In_office TEXT, UNIQUE (Member_ID), FOREIGN KEY (Party_ID) REFERENCES party(Party_ID) ); CREATE TABLE party_events ( Event_ID INT PRIMARY KEY, Event_Name TEXT, Party_ID INT, Member_in_charge_ID INT, UNIQUE (Event_ID), FOREIGN KEY (Member_in_charge_ID) REFERENCES member(Member_ID), FOREIGN KEY (Party_ID) REFERENCES party(Party_ID) );
products_gen_characteristics
{"Ref_Characteristic_Types": {"columns": [[0, "characteristic_type_code", "VARCHAR(15)", 0, null, 1], [1, "characteristic_type_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["characteristic_type_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "characteristic_type_code"]]], "check_constraints": []}, "Ref_Colors": {"columns": [[0, "color_code", "VARCHAR(15)", 0, null, 1], [1, "color_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["color_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "color_code"]]], "check_constraints": []}, "Ref_Product_Categories": {"columns": [[0, "product_category_code", "VARCHAR(15)", 0, null, 1], [1, "product_category_description", "VARCHAR(80)", 0, null, 0], [2, "unit_of_measure", "VARCHAR(20)", 0, null, 0]], "primary_keys": ["product_category_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "product_category_code"]]], "check_constraints": []}, "Characteristics": {"columns": [[0, "characteristic_id", "INTEGER", 0, null, 1], [1, "characteristic_type_code", "VARCHAR(15)", 1, null, 0], [2, "characteristic_data_type", "VARCHAR(10)", 0, null, 0], [3, "characteristic_name", "VARCHAR(80)", 0, null, 0], [4, "other_characteristic_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["characteristic_id"], "foreign_keys": [[0, 0, "Ref_Characteristic_Types", "characteristic_type_code", "characteristic_type_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "product_id", "INTEGER", 0, null, 1], [1, "color_code", "VARCHAR(15)", 1, null, 0], [2, "product_category_code", "VARCHAR(15)", 1, null, 0], [3, "product_name", "VARCHAR(80)", 0, null, 0], [4, "typical_buying_price", "VARCHAR(20)", 0, null, 0], [5, "typical_selling_price", "VARCHAR(20)", 0, null, 0], [6, "product_description", "VARCHAR(255)", 0, null, 0], [7, "other_product_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["product_id"], "foreign_keys": [[0, 0, "Ref_Colors", "color_code", "color_code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ref_Product_Categories", "product_category_code", "product_category_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Product_Characteristics": {"columns": [[0, "product_id", "INTEGER", 1, null, 0], [1, "characteristic_id", "INTEGER", 1, null, 0], [2, "product_characteristic_value", "VARCHAR(50)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Products", "product_id", "product_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Characteristics", "characteristic_id", "characteristic_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Ref_Characteristic_Types ( characteristic_type_code VARCHAR(15) PRIMARY KEY, characteristic_type_description VARCHAR(80), UNIQUE (characteristic_type_code) ); CREATE TABLE Ref_Colors ( color_code VARCHAR(15) PRIMARY KEY, color_description VARCHAR(80), UNIQUE (color_code) ); CREATE TABLE Ref_Product_Categories ( product_category_code VARCHAR(15) PRIMARY KEY, product_category_description VARCHAR(80), unit_of_measure VARCHAR(20), UNIQUE (product_category_code) ); CREATE TABLE Characteristics ( characteristic_id INTEGER PRIMARY KEY, characteristic_type_code VARCHAR(15) NOT NULL, characteristic_data_type VARCHAR(10), characteristic_name VARCHAR(80), other_characteristic_details VARCHAR(255), FOREIGN KEY (characteristic_type_code) REFERENCES Ref_Characteristic_Types(characteristic_type_code) ); CREATE TABLE Products ( product_id INTEGER PRIMARY KEY, color_code VARCHAR(15) NOT NULL, product_category_code VARCHAR(15) NOT NULL, product_name VARCHAR(80), typical_buying_price VARCHAR(20), typical_selling_price VARCHAR(20), product_description VARCHAR(255), other_product_details VARCHAR(255), FOREIGN KEY (color_code) REFERENCES Ref_Colors(color_code), FOREIGN KEY (product_category_code) REFERENCES Ref_Product_Categories(product_category_code) ); CREATE TABLE Product_Characteristics ( product_id INTEGER NOT NULL, characteristic_id INTEGER NOT NULL, product_characteristic_value VARCHAR(50), FOREIGN KEY (product_id) REFERENCES Products(product_id), FOREIGN KEY (characteristic_id) REFERENCES Characteristics(characteristic_id) );
cre_Doc_Template_Mgt
{"Ref_Template_Types": {"columns": [[0, "Template_Type_Code", "CHAR(15)", 1, null, 1], [1, "Template_Type_Description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["Template_Type_Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Template_Type_Code"]]], "check_constraints": []}, "Templates": {"columns": [[0, "Template_ID", "INTEGER", 1, null, 1], [1, "Version_Number", "INTEGER", 1, null, 0], [2, "Template_Type_Code", "CHAR(15)", 1, null, 0], [3, "Date_Effective_From", "DATETIME", 0, null, 0], [4, "Date_Effective_To", "DATETIME", 0, null, 0], [5, "Template_Details", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["Template_ID"], "foreign_keys": [[0, 0, "Ref_Template_Types", "Template_Type_Code", "Template_Type_Code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Documents": {"columns": [[0, "Document_ID", "INTEGER", 1, null, 1], [1, "Template_ID", "INTEGER", 0, null, 0], [2, "Document_Name", "VARCHAR(255)", 0, null, 0], [3, "Document_Description", "VARCHAR(255)", 0, null, 0], [4, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Document_ID"], "foreign_keys": [[0, 0, "Templates", "Template_ID", "Template_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Paragraphs": {"columns": [[0, "Paragraph_ID", "INTEGER", 1, null, 1], [1, "Document_ID", "INTEGER", 1, null, 0], [2, "Paragraph_Text", "VARCHAR(255)", 0, null, 0], [3, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Paragraph_ID"], "foreign_keys": [[0, 0, "Documents", "Document_ID", "Document_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Ref_Template_Types ( Template_Type_Code CHAR(15) NOT NULL PRIMARY KEY, Template_Type_Description VARCHAR(255) NOT NULL, UNIQUE (Template_Type_Code) ); CREATE TABLE Templates ( Template_ID INTEGER NOT NULL PRIMARY KEY, Version_Number INTEGER NOT NULL, Template_Type_Code CHAR(15) NOT NULL, Date_Effective_From DATETIME, Date_Effective_To DATETIME, Template_Details VARCHAR(255) NOT NULL, FOREIGN KEY (Template_Type_Code) REFERENCES Ref_Template_Types(Template_Type_Code) ); CREATE TABLE Documents ( Document_ID INTEGER NOT NULL PRIMARY KEY, Template_ID INTEGER, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Other_Details VARCHAR(255), FOREIGN KEY (Template_ID) REFERENCES Templates(Template_ID) ); CREATE TABLE Paragraphs ( Paragraph_ID INTEGER NOT NULL PRIMARY KEY, Document_ID INTEGER NOT NULL, Paragraph_Text VARCHAR(255), Other_Details VARCHAR(255), FOREIGN KEY (Document_ID) REFERENCES Documents(Document_ID) );
scientist_1
{"Scientists": {"columns": [[0, "SSN", "INT", 0, null, 1], [1, "Name", "Char(30)", 1, null, 0]], "primary_keys": ["SSN"], "foreign_keys": [], "unique_constraints": [[[0, 0, "SSN"]]], "check_constraints": []}, "Projects": {"columns": [[0, "Code", "Char(4)", 0, null, 1], [1, "Name", "Char(50)", 1, null, 0], [2, "Hours", "INT", 0, null, 0]], "primary_keys": ["Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Code"]]], "check_constraints": []}, "AssignedTo": {"columns": [[0, "Scientist", "INT", 1, null, 1], [1, "Project", "char(4)", 1, null, 2]], "primary_keys": ["Scientist", "Project"], "foreign_keys": [[0, 0, "Projects", "Project", "Code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Scientists", "Scientist", "SSN", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Scientist"], [1, 1, "Project"]]], "check_constraints": []}}
CREATE TABLE Scientists ( SSN INT PRIMARY KEY, Name Char(30) NOT NULL, UNIQUE (SSN) ); CREATE TABLE Projects ( Code Char(4) PRIMARY KEY, Name Char(50) NOT NULL, Hours INT, UNIQUE (Code) ); CREATE TABLE AssignedTo ( Scientist INT NOT NULL PRIMARY KEY, Project char(4) NOT NULL PRIMARY KEY, PRIMARY KEY (Scientist, Project), UNIQUE (Scientist, Project), FOREIGN KEY (Project) REFERENCES Projects(Code), FOREIGN KEY (Scientist) REFERENCES Scientists(SSN) );
workshop_paper
{"workshop": {"columns": [[0, "Workshop_ID", "INT", 0, null, 1], [1, "Date", "TEXT", 0, null, 0], [2, "Venue", "TEXT", 0, null, 0], [3, "Name", "TEXT", 0, null, 0]], "primary_keys": ["Workshop_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Workshop_ID"]]], "check_constraints": []}, "submission": {"columns": [[0, "Submission_ID", "INT", 0, null, 1], [1, "Scores", "REAL", 0, null, 0], [2, "Author", "TEXT", 0, null, 0], [3, "College", "TEXT", 0, null, 0]], "primary_keys": ["Submission_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Submission_ID"]]], "check_constraints": []}, "Acceptance": {"columns": [[0, "Submission_ID", "INT", 0, null, 1], [1, "Workshop_ID", "INT", 0, null, 2], [2, "Result", "TEXT", 0, null, 0]], "primary_keys": ["Submission_ID", "Workshop_ID"], "foreign_keys": [[0, 0, "workshop", "Workshop_ID", "Workshop_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "submission", "Submission_ID", "Submission_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Submission_ID"], [1, 1, "Workshop_ID"]]], "check_constraints": []}}
CREATE TABLE workshop ( Workshop_ID INT PRIMARY KEY, Date TEXT, Venue TEXT, Name TEXT, UNIQUE (Workshop_ID) ); CREATE TABLE submission ( Submission_ID INT PRIMARY KEY, Scores REAL, Author TEXT, College TEXT, UNIQUE (Submission_ID) ); CREATE TABLE Acceptance ( Submission_ID INT PRIMARY KEY, Workshop_ID INT PRIMARY KEY, Result TEXT, PRIMARY KEY (Submission_ID, Workshop_ID), UNIQUE (Submission_ID, Workshop_ID), FOREIGN KEY (Workshop_ID) REFERENCES workshop(Workshop_ID), FOREIGN KEY (Submission_ID) REFERENCES submission(Submission_ID) );
apartment_rentals
{"Apartment_Buildings": {"columns": [[0, "building_id", "INTEGER", 1, null, 1], [1, "building_short_name", "CHAR(15)", 0, null, 0], [2, "building_full_name", "VARCHAR(80)", 0, null, 0], [3, "building_description", "VARCHAR(255)", 0, null, 0], [4, "building_address", "VARCHAR(255)", 0, null, 0], [5, "building_manager", "VARCHAR(50)", 0, null, 0], [6, "building_phone", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["building_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "building_id"]]], "check_constraints": []}, "Apartments": {"columns": [[0, "apt_id", "INTEGER", 1, null, 1], [1, "building_id", "INTEGER", 1, null, 0], [2, "apt_type_code", "CHAR(15)", 0, null, 0], [3, "apt_number", "CHAR(10)", 0, null, 0], [4, "bathroom_count", "INTEGER", 0, null, 0], [5, "bedroom_count", "INTEGER", 0, null, 0], [6, "room_count", "CHAR(5)", 0, null, 0]], "primary_keys": ["apt_id"], "foreign_keys": [[0, 0, "Apartment_Buildings", "building_id", "building_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "apt_id"]]], "check_constraints": []}, "Apartment_Facilities": {"columns": [[0, "apt_id", "INTEGER", 1, null, 1], [1, "facility_code", "CHAR(15)", 1, null, 2]], "primary_keys": ["apt_id", "facility_code"], "foreign_keys": [[0, 0, "Apartments", "apt_id", "apt_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "apt_id"], [1, 1, "facility_code"]]], "check_constraints": []}, "Guests": {"columns": [[0, "guest_id", "INTEGER", 1, null, 1], [1, "gender_code", "CHAR(1)", 0, null, 0], [2, "guest_first_name", "VARCHAR(80)", 0, null, 0], [3, "guest_last_name", "VARCHAR(80)", 0, null, 0], [4, "date_of_birth", "DATETIME", 0, null, 0]], "primary_keys": ["guest_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "guest_id"]]], "check_constraints": []}, "Apartment_Bookings": {"columns": [[0, "apt_booking_id", "INTEGER", 1, null, 1], [1, "apt_id", "INTEGER", 0, null, 0], [2, "guest_id", "INTEGER", 1, null, 0], [3, "booking_status_code", "CHAR(15)", 1, null, 0], [4, "booking_start_date", "DATETIME", 0, null, 0], [5, "booking_end_date", "DATETIME", 0, null, 0]], "primary_keys": ["apt_booking_id"], "foreign_keys": [[0, 0, "Guests", "guest_id", "guest_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Apartments", "apt_id", "apt_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "apt_booking_id"]]], "check_constraints": []}, "View_Unit_Status": {"columns": [[0, "apt_id", "INTEGER", 0, null, 0], [1, "apt_booking_id", "INTEGER", 0, null, 0], [2, "status_date", "DATETIME", 1, null, 1], [3, "available_yn", "BIT", 0, null, 0]], "primary_keys": ["status_date"], "foreign_keys": [[0, 0, "Apartment_Bookings", "apt_booking_id", "apt_booking_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Apartments", "apt_id", "apt_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 2, "status_date"]]], "check_constraints": []}}
CREATE TABLE Apartment_Buildings ( building_id INTEGER NOT NULL PRIMARY KEY, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80), UNIQUE (building_id) ); CREATE TABLE Apartments ( apt_id INTEGER NOT NULL PRIMARY KEY, building_id INTEGER NOT NULL, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5), UNIQUE (apt_id), FOREIGN KEY (building_id) REFERENCES Apartment_Buildings(building_id) ); CREATE TABLE Apartment_Facilities ( apt_id INTEGER NOT NULL PRIMARY KEY, facility_code CHAR(15) NOT NULL PRIMARY KEY, PRIMARY KEY (apt_id, facility_code), UNIQUE (apt_id, facility_code), FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id) ); CREATE TABLE Guests ( guest_id INTEGER NOT NULL PRIMARY KEY, gender_code CHAR(1), guest_first_name VARCHAR(80), guest_last_name VARCHAR(80), date_of_birth DATETIME, UNIQUE (guest_id) ); CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER NOT NULL PRIMARY KEY, apt_id INTEGER, guest_id INTEGER NOT NULL, booking_status_code CHAR(15) NOT NULL, booking_start_date DATETIME, booking_end_date DATETIME, UNIQUE (apt_booking_id), FOREIGN KEY (guest_id) REFERENCES Guests(guest_id), FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id) ); CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME NOT NULL PRIMARY KEY, available_yn BIT, UNIQUE (status_date), FOREIGN KEY (apt_booking_id) REFERENCES Apartment_Bookings(apt_booking_id), FOREIGN KEY (apt_id) REFERENCES Apartments(apt_id) );
department_store
{"Addresses": {"columns": [[0, "address_id", "INTEGER", 0, null, 1], [1, "address_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["address_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Staff": {"columns": [[0, "staff_id", "INTEGER", 0, null, 1], [1, "staff_gender", "VARCHAR(1)", 0, null, 0], [2, "staff_name", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["staff_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Suppliers": {"columns": [[0, "supplier_id", "INTEGER", 0, null, 1], [1, "supplier_name", "VARCHAR(80)", 0, null, 0], [2, "supplier_phone", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["supplier_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Department_Store_Chain": {"columns": [[0, "dept_store_chain_id", "INTEGER", 0, null, 1], [1, "dept_store_chain_name", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["dept_store_chain_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "payment_method_code", "VARCHAR(10)", 1, null, 0], [2, "customer_code", "VARCHAR(20)", 0, null, 0], [3, "customer_name", "VARCHAR(80)", 0, null, 0], [4, "customer_address", "VARCHAR(255)", 0, null, 0], [5, "customer_phone", "VARCHAR(80)", 0, null, 0], [6, "customer_email", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "product_id", "INTEGER", 0, null, 1], [1, "product_type_code", "VARCHAR(10)", 1, null, 0], [2, "product_name", "VARCHAR(80)", 0, null, 0], [3, "product_price", "DECIMAL(19,4)", 0, null, 0]], "primary_keys": ["product_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Supplier_Addresses": {"columns": [[0, "supplier_id", "INTEGER", 1, null, 1], [1, "address_id", "INTEGER", 1, null, 2], [2, "date_from", "DATETIME", 1, null, 0], [3, "date_to", "DATETIME", 0, null, 0]], "primary_keys": ["supplier_id", "address_id"], "foreign_keys": [[0, 0, "Suppliers", "supplier_id", "supplier_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Addresses", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "supplier_id"], [1, 1, "address_id"]]], "check_constraints": []}, "Customer_Addresses": {"columns": [[0, "customer_id", "INTEGER", 1, null, 1], [1, "address_id", "INTEGER", 1, null, 2], [2, "date_from", "DATETIME", 1, null, 0], [3, "date_to", "DATETIME", 0, null, 0]], "primary_keys": ["customer_id", "address_id"], "foreign_keys": [[0, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Addresses", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "customer_id"], [1, 1, "address_id"]]], "check_constraints": []}, "Customer_Orders": {"columns": [[0, "order_id", "INTEGER", 0, null, 1], [1, "customer_id", "INTEGER", 1, null, 0], [2, "order_status_code", "VARCHAR(10)", 1, null, 0], [3, "order_date", "DATETIME", 1, null, 0]], "primary_keys": ["order_id"], "foreign_keys": [[0, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Department_Stores": {"columns": [[0, "dept_store_id", "INTEGER", 0, null, 1], [1, "dept_store_chain_id", "INTEGER", 0, null, 0], [2, "store_name", "VARCHAR(80)", 0, null, 0], [3, "store_address", "VARCHAR(255)", 0, null, 0], [4, "store_phone", "VARCHAR(80)", 0, null, 0], [5, "store_email", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["dept_store_id"], "foreign_keys": [[0, 0, "Department_Store_Chain", "dept_store_chain_id", "dept_store_chain_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Departments": {"columns": [[0, "department_id", "INTEGER", 0, null, 1], [1, "dept_store_id", "INTEGER", 1, null, 0], [2, "department_name", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["department_id"], "foreign_keys": [[0, 0, "Department_Stores", "dept_store_id", "dept_store_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Order_Items": {"columns": [[0, "order_item_id", "INTEGER", 0, null, 1], [1, "order_id", "INTEGER", 1, null, 0], [2, "product_id", "INTEGER", 1, null, 0]], "primary_keys": ["order_item_id"], "foreign_keys": [[0, 0, "Products", "product_id", "product_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Customer_Orders", "order_id", "order_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Product_Suppliers": {"columns": [[0, "product_id", "INTEGER", 1, null, 1], [1, "supplier_id", "INTEGER", 1, null, 2], [2, "date_supplied_from", "DATETIME", 1, null, 0], [3, "date_supplied_to", "DATETIME", 0, null, 0], [4, "total_amount_purchased", "VARCHAR(80)", 0, null, 0], [5, "total_value_purchased", "DECIMAL(19,4)", 0, null, 0]], "primary_keys": ["product_id", "supplier_id"], "foreign_keys": [[0, 0, "Products", "product_id", "product_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Suppliers", "supplier_id", "supplier_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "product_id"], [1, 1, "supplier_id"]]], "check_constraints": []}, "Staff_Department_Assignments": {"columns": [[0, "staff_id", "INTEGER", 1, null, 1], [1, "department_id", "INTEGER", 1, null, 2], [2, "date_assigned_from", "DATETIME", 1, null, 0], [3, "job_title_code", "VARCHAR(10)", 1, null, 0], [4, "date_assigned_to", "DATETIME", 0, null, 0]], "primary_keys": ["staff_id", "department_id"], "foreign_keys": [[0, 0, "Staff", "staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Departments", "department_id", "department_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "staff_id"], [1, 1, "department_id"]]], "check_constraints": []}}
CREATE TABLE Addresses ( address_id INTEGER PRIMARY KEY, address_details VARCHAR(255) ); CREATE TABLE Staff ( staff_id INTEGER PRIMARY KEY, staff_gender VARCHAR(1), staff_name VARCHAR(80) ); CREATE TABLE Suppliers ( supplier_id INTEGER PRIMARY KEY, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ); CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER PRIMARY KEY, dept_store_chain_name VARCHAR(80) ); CREATE TABLE Customers ( customer_id INTEGER PRIMARY KEY, payment_method_code VARCHAR(10) NOT NULL, customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ); CREATE TABLE Products ( product_id INTEGER PRIMARY KEY, product_type_code VARCHAR(10) NOT NULL, product_name VARCHAR(80), product_price DECIMAL(19,4) ); CREATE TABLE Supplier_Addresses ( supplier_id INTEGER NOT NULL PRIMARY KEY, address_id INTEGER NOT NULL PRIMARY KEY, date_from DATETIME NOT NULL, date_to DATETIME, PRIMARY KEY (supplier_id, address_id), UNIQUE (supplier_id, address_id), FOREIGN KEY (supplier_id) REFERENCES Suppliers(supplier_id), FOREIGN KEY (address_id) REFERENCES Addresses(address_id) ); CREATE TABLE Customer_Addresses ( customer_id INTEGER NOT NULL PRIMARY KEY, address_id INTEGER NOT NULL PRIMARY KEY, date_from DATETIME NOT NULL, date_to DATETIME, PRIMARY KEY (customer_id, address_id), UNIQUE (customer_id, address_id), FOREIGN KEY (customer_id) REFERENCES Customers(customer_id), FOREIGN KEY (address_id) REFERENCES Addresses(address_id) ); CREATE TABLE Customer_Orders ( order_id INTEGER PRIMARY KEY, customer_id INTEGER NOT NULL, order_status_code VARCHAR(10) NOT NULL, order_date DATETIME NOT NULL, FOREIGN KEY (customer_id) REFERENCES Customers(customer_id) ); CREATE TABLE Department_Stores ( dept_store_id INTEGER PRIMARY KEY, dept_store_chain_id INTEGER, store_name VARCHAR(80), store_address VARCHAR(255), store_phone VARCHAR(80), store_email VARCHAR(80), FOREIGN KEY (dept_store_chain_id) REFERENCES Department_Store_Chain(dept_store_chain_id) ); CREATE TABLE Departments ( department_id INTEGER PRIMARY KEY, dept_store_id INTEGER NOT NULL, department_name VARCHAR(80), FOREIGN KEY (dept_store_id) REFERENCES Department_Stores(dept_store_id) ); CREATE TABLE Order_Items ( order_item_id INTEGER PRIMARY KEY, order_id INTEGER NOT NULL, product_id INTEGER NOT NULL, FOREIGN KEY (product_id) REFERENCES Products(product_id), FOREIGN KEY (order_id) REFERENCES Customer_Orders(order_id) ); CREATE TABLE Product_Suppliers ( product_id INTEGER NOT NULL PRIMARY KEY, supplier_id INTEGER NOT NULL PRIMARY KEY, date_supplied_from DATETIME NOT NULL, date_supplied_to DATETIME, total_amount_purchased VARCHAR(80), total_value_purchased DECIMAL(19,4), PRIMARY KEY (product_id, supplier_id), UNIQUE (product_id, supplier_id), FOREIGN KEY (product_id) REFERENCES Products(product_id), FOREIGN KEY (supplier_id) REFERENCES Suppliers(supplier_id) ); CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER NOT NULL PRIMARY KEY, department_id INTEGER NOT NULL PRIMARY KEY, date_assigned_from DATETIME NOT NULL, job_title_code VARCHAR(10) NOT NULL, date_assigned_to DATETIME, PRIMARY KEY (staff_id, department_id), UNIQUE (staff_id, department_id), FOREIGN KEY (staff_id) REFERENCES Staff(staff_id), FOREIGN KEY (department_id) REFERENCES Departments(department_id) );
university_basketball
{"basketball_match": {"columns": [[0, "Team_ID", "INT", 0, null, 1], [1, "School_ID", "INT", 0, null, 0], [2, "Team_Name", "TEXT", 0, null, 0], [3, "ACC_Regular_Season", "TEXT", 0, null, 0], [4, "ACC_Percent", "TEXT", 0, null, 0], [5, "ACC_Home", "TEXT", 0, null, 0], [6, "ACC_Road", "TEXT", 0, null, 0], [7, "All_Games", "TEXT", 0, null, 0], [8, "All_Games_Percent", "INT", 0, null, 0], [9, "All_Home", "TEXT", 0, null, 0], [10, "All_Road", "TEXT", 0, null, 0], [11, "All_Neutral", "TEXT", 0, null, 0]], "primary_keys": ["Team_ID"], "foreign_keys": [[0, 0, "university", "School_ID", "School_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Team_ID"]]], "check_constraints": []}, "university": {"columns": [[0, "School_ID", "INT", 0, null, 1], [1, "School", "TEXT", 0, null, 0], [2, "Location", "TEXT", 0, null, 0], [3, "Founded", "REAL", 0, null, 0], [4, "Affiliation", "TEXT", 0, null, 0], [5, "Enrollment", "REAL", 0, null, 0], [6, "Nickname", "TEXT", 0, null, 0], [7, "Primary_conference", "TEXT", 0, null, 0]], "primary_keys": ["School_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "School_ID"]]], "check_constraints": []}}
CREATE TABLE basketball_match ( Team_ID INT PRIMARY KEY, School_ID INT, Team_Name TEXT, ACC_Regular_Season TEXT, ACC_Percent TEXT, ACC_Home TEXT, ACC_Road TEXT, All_Games TEXT, All_Games_Percent INT, All_Home TEXT, All_Road TEXT, All_Neutral TEXT, UNIQUE (Team_ID), FOREIGN KEY (School_ID) REFERENCES university(School_ID) ); CREATE TABLE university ( School_ID INT PRIMARY KEY, School TEXT, Location TEXT, Founded REAL, Affiliation TEXT, Enrollment REAL, Nickname TEXT, Primary_conference TEXT, UNIQUE (School_ID) );
county_public_safety
{"county_public_safety": {"columns": [[0, "County_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Population", "INT", 0, null, 0], [3, "Police_officers", "INT", 0, null, 0], [4, "Residents_per_officer", "INT", 0, null, 0], [5, "Case_burden", "INT", 0, null, 0], [6, "Crime_rate", "REAL", 0, null, 0], [7, "Police_force", "TEXT", 0, null, 0], [8, "Location", "TEXT", 0, null, 0]], "primary_keys": ["County_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "County_ID"]]], "check_constraints": []}, "city": {"columns": [[0, "City_ID", "INT", 0, null, 1], [1, "County_ID", "INT", 0, null, 0], [2, "Name", "TEXT", 0, null, 0], [3, "White", "REAL", 0, null, 0], [4, "Black", "REAL", 0, null, 0], [5, "Amerindian", "REAL", 0, null, 0], [6, "Asian", "REAL", 0, null, 0], [7, "Multiracial", "REAL", 0, null, 0], [8, "Hispanic", "REAL", 0, null, 0]], "primary_keys": ["City_ID"], "foreign_keys": [[0, 0, "county_public_safety", "County_ID", "County_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "City_ID"]]], "check_constraints": []}}
CREATE TABLE county_public_safety ( County_ID INT PRIMARY KEY, Name TEXT, Population INT, Police_officers INT, Residents_per_officer INT, Case_burden INT, Crime_rate REAL, Police_force TEXT, Location TEXT, UNIQUE (County_ID) ); CREATE TABLE city ( City_ID INT PRIMARY KEY, County_ID INT, Name TEXT, White REAL, Black REAL, Amerindian REAL, Asian REAL, Multiracial REAL, Hispanic REAL, UNIQUE (City_ID), FOREIGN KEY (County_ID) REFERENCES county_public_safety(County_ID) );
assets_maintenance
{"Third_Party_Companies": {"columns": [[0, "company_id", "INTEGER", 0, null, 1], [1, "company_type", "VARCHAR(5)", 1, null, 0], [2, "company_name", "VARCHAR(255)", 0, null, 0], [3, "company_address", "VARCHAR(255)", 0, null, 0], [4, "other_company_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["company_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Maintenance_Contracts": {"columns": [[0, "maintenance_contract_id", "INTEGER", 0, null, 1], [1, "maintenance_contract_company_id", "INTEGER", 1, null, 0], [2, "contract_start_date", "DATETIME", 0, null, 0], [3, "contract_end_date", "DATETIME", 0, null, 0], [4, "other_contract_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["maintenance_contract_id"], "foreign_keys": [[0, 0, "Third_Party_Companies", "maintenance_contract_company_id", "company_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Parts": {"columns": [[0, "part_id", "INTEGER", 0, null, 1], [1, "part_name", "VARCHAR(255)", 0, null, 0], [2, "chargeable_yn", "VARCHAR(1)", 0, null, 0], [3, "chargeable_amount", "VARCHAR(20)", 0, null, 0], [4, "other_part_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["part_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Skills": {"columns": [[0, "skill_id", "INTEGER", 0, null, 1], [1, "skill_code", "VARCHAR(20)", 0, null, 0], [2, "skill_description", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["skill_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Staff": {"columns": [[0, "staff_id", "INTEGER", 0, null, 1], [1, "staff_name", "VARCHAR(255)", 0, null, 0], [2, "gender", "VARCHAR(1)", 0, null, 0], [3, "other_staff_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["staff_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Assets": {"columns": [[0, "asset_id", "INTEGER", 0, null, 1], [1, "maintenance_contract_id", "INTEGER", 1, null, 0], [2, "supplier_company_id", "INTEGER", 1, null, 0], [3, "asset_details", "VARCHAR(255)", 0, null, 0], [4, "asset_make", "VARCHAR(20)", 0, null, 0], [5, "asset_model", "VARCHAR(20)", 0, null, 0], [6, "asset_acquired_date", "DATETIME", 0, null, 0], [7, "asset_disposed_date", "DATETIME", 0, null, 0], [8, "other_asset_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["asset_id"], "foreign_keys": [[0, 0, "Third_Party_Companies", "supplier_company_id", "company_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Maintenance_Contracts", "maintenance_contract_id", "maintenance_contract_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Asset_Parts": {"columns": [[0, "asset_id", "INTEGER", 1, null, 0], [1, "part_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Assets", "asset_id", "asset_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Parts", "part_id", "part_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Maintenance_Engineers": {"columns": [[0, "engineer_id", "INTEGER", 0, null, 1], [1, "company_id", "INTEGER", 1, null, 0], [2, "first_name", "VARCHAR(50)", 0, null, 0], [3, "last_name", "VARCHAR(50)", 0, null, 0], [4, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["engineer_id"], "foreign_keys": [[0, 0, "Third_Party_Companies", "company_id", "company_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Engineer_Skills": {"columns": [[0, "engineer_id", "INTEGER", 1, null, 0], [1, "skill_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Skills", "skill_id", "skill_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Maintenance_Engineers", "engineer_id", "engineer_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Fault_Log": {"columns": [[0, "fault_log_entry_id", "INTEGER", 0, null, 1], [1, "asset_id", "INTEGER", 1, null, 0], [2, "recorded_by_staff_id", "INTEGER", 1, null, 0], [3, "fault_log_entry_datetime", "DATETIME", 0, null, 0], [4, "fault_description", "VARCHAR(255)", 0, null, 0], [5, "other_fault_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["fault_log_entry_id"], "foreign_keys": [[0, 0, "Staff", "recorded_by_staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Assets", "asset_id", "asset_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Engineer_Visits": {"columns": [[0, "engineer_visit_id", "INTEGER", 0, null, 1], [1, "contact_staff_id", "INTEGER", 0, null, 0], [2, "engineer_id", "INTEGER", 1, null, 0], [3, "fault_log_entry_id", "INTEGER", 1, null, 0], [4, "fault_status", "VARCHAR(10)", 1, null, 0], [5, "visit_start_datetime", "DATETIME", 0, null, 0], [6, "visit_end_datetime", "DATETIME", 0, null, 0], [7, "other_visit_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["engineer_visit_id"], "foreign_keys": [[0, 0, "Staff", "contact_staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Maintenance_Engineers", "engineer_id", "engineer_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Fault_Log", "fault_log_entry_id", "fault_log_entry_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Part_Faults": {"columns": [[0, "part_fault_id", "INTEGER", 0, null, 1], [1, "part_id", "INTEGER", 1, null, 0], [2, "fault_short_name", "VARCHAR(20)", 0, null, 0], [3, "fault_description", "VARCHAR(255)", 0, null, 0], [4, "other_fault_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["part_fault_id"], "foreign_keys": [[0, 0, "Parts", "part_id", "part_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Fault_Log_Parts": {"columns": [[0, "fault_log_entry_id", "INTEGER", 1, null, 0], [1, "part_fault_id", "INTEGER", 1, null, 0], [2, "fault_status", "VARCHAR(10)", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Fault_Log", "fault_log_entry_id", "fault_log_entry_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Part_Faults", "part_fault_id", "part_fault_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Skills_Required_To_Fix": {"columns": [[0, "part_fault_id", "INTEGER", 1, null, 0], [1, "skill_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Skills", "skill_id", "skill_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Part_Faults", "part_fault_id", "part_fault_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Third_Party_Companies ( company_id INTEGER PRIMARY KEY, company_type VARCHAR(5) NOT NULL, company_name VARCHAR(255), company_address VARCHAR(255), other_company_details VARCHAR(255) ); CREATE TABLE Maintenance_Contracts ( maintenance_contract_id INTEGER PRIMARY KEY, maintenance_contract_company_id INTEGER NOT NULL, contract_start_date DATETIME, contract_end_date DATETIME, other_contract_details VARCHAR(255), FOREIGN KEY (maintenance_contract_company_id) REFERENCES Third_Party_Companies(company_id) ); CREATE TABLE Parts ( part_id INTEGER PRIMARY KEY, part_name VARCHAR(255), chargeable_yn VARCHAR(1), chargeable_amount VARCHAR(20), other_part_details VARCHAR(255) ); CREATE TABLE Skills ( skill_id INTEGER PRIMARY KEY, skill_code VARCHAR(20), skill_description VARCHAR(255) ); CREATE TABLE Staff ( staff_id INTEGER PRIMARY KEY, staff_name VARCHAR(255), gender VARCHAR(1), other_staff_details VARCHAR(255) ); CREATE TABLE Assets ( asset_id INTEGER PRIMARY KEY, maintenance_contract_id INTEGER NOT NULL, supplier_company_id INTEGER NOT NULL, asset_details VARCHAR(255), asset_make VARCHAR(20), asset_model VARCHAR(20), asset_acquired_date DATETIME, asset_disposed_date DATETIME, other_asset_details VARCHAR(255), FOREIGN KEY (supplier_company_id) REFERENCES Third_Party_Companies(company_id), FOREIGN KEY (maintenance_contract_id) REFERENCES Maintenance_Contracts(maintenance_contract_id) ); CREATE TABLE Asset_Parts ( asset_id INTEGER NOT NULL, part_id INTEGER NOT NULL, FOREIGN KEY (asset_id) REFERENCES Assets(asset_id), FOREIGN KEY (part_id) REFERENCES Parts(part_id) ); CREATE TABLE Maintenance_Engineers ( engineer_id INTEGER PRIMARY KEY, company_id INTEGER NOT NULL, first_name VARCHAR(50), last_name VARCHAR(50), other_details VARCHAR(255), FOREIGN KEY (company_id) REFERENCES Third_Party_Companies(company_id) ); CREATE TABLE Engineer_Skills ( engineer_id INTEGER NOT NULL, skill_id INTEGER NOT NULL, FOREIGN KEY (skill_id) REFERENCES Skills(skill_id), FOREIGN KEY (engineer_id) REFERENCES Maintenance_Engineers(engineer_id) ); CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER PRIMARY KEY, asset_id INTEGER NOT NULL, recorded_by_staff_id INTEGER NOT NULL, fault_log_entry_datetime DATETIME, fault_description VARCHAR(255), other_fault_details VARCHAR(255), FOREIGN KEY (recorded_by_staff_id) REFERENCES Staff(staff_id), FOREIGN KEY (asset_id) REFERENCES Assets(asset_id) ); CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER PRIMARY KEY, contact_staff_id INTEGER, engineer_id INTEGER NOT NULL, fault_log_entry_id INTEGER NOT NULL, fault_status VARCHAR(10) NOT NULL, visit_start_datetime DATETIME, visit_end_datetime DATETIME, other_visit_details VARCHAR(255), FOREIGN KEY (contact_staff_id) REFERENCES Staff(staff_id), FOREIGN KEY (engineer_id) REFERENCES Maintenance_Engineers(engineer_id), FOREIGN KEY (fault_log_entry_id) REFERENCES Fault_Log(fault_log_entry_id) ); CREATE TABLE Part_Faults ( part_fault_id INTEGER PRIMARY KEY, part_id INTEGER NOT NULL, fault_short_name VARCHAR(20), fault_description VARCHAR(255), other_fault_details VARCHAR(255), FOREIGN KEY (part_id) REFERENCES Parts(part_id) ); CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER NOT NULL, part_fault_id INTEGER NOT NULL, fault_status VARCHAR(10) NOT NULL, FOREIGN KEY (fault_log_entry_id) REFERENCES Fault_Log(fault_log_entry_id), FOREIGN KEY (part_fault_id) REFERENCES Part_Faults(part_fault_id) ); CREATE TABLE Skills_Required_To_Fix ( part_fault_id INTEGER NOT NULL, skill_id INTEGER NOT NULL, FOREIGN KEY (skill_id) REFERENCES Skills(skill_id), FOREIGN KEY (part_fault_id) REFERENCES Part_Faults(part_fault_id) );
election
{"county": {"columns": [[0, "County_Id", "INT", 0, null, 1], [1, "County_name", "TEXT", 0, null, 0], [2, "Population", "REAL", 0, null, 0], [3, "Zip_code", "TEXT", 0, null, 0]], "primary_keys": ["County_Id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "County_Id"]]], "check_constraints": []}, "party": {"columns": [[0, "Party_ID", "INT", 0, null, 1], [1, "Year", "REAL", 0, null, 0], [2, "Party", "TEXT", 0, null, 0], [3, "Governor", "TEXT", 0, null, 0], [4, "Lieutenant_Governor", "TEXT", 0, null, 0], [5, "Comptroller", "TEXT", 0, null, 0], [6, "Attorney_General", "TEXT", 0, null, 0], [7, "US_Senate", "TEXT", 0, null, 0]], "primary_keys": ["Party_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Party_ID"]]], "check_constraints": []}, "election": {"columns": [[0, "Election_ID", "INT", 0, null, 1], [1, "Counties_Represented", "TEXT", 0, null, 0], [2, "District", "INT", 0, null, 0], [3, "Delegate", "TEXT", 0, null, 0], [4, "Party", "INT", 0, null, 0], [5, "First_Elected", "REAL", 0, null, 0], [6, "Committee", "TEXT", 0, null, 0]], "primary_keys": ["Election_ID"], "foreign_keys": [[0, 0, "county", "District", "County_Id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "party", "Party", "Party_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Election_ID"]]], "check_constraints": []}}
CREATE TABLE county ( County_Id INT PRIMARY KEY, County_name TEXT, Population REAL, Zip_code TEXT, UNIQUE (County_Id) ); CREATE TABLE party ( Party_ID INT PRIMARY KEY, Year REAL, Party TEXT, Governor TEXT, Lieutenant_Governor TEXT, Comptroller TEXT, Attorney_General TEXT, US_Senate TEXT, UNIQUE (Party_ID) ); CREATE TABLE election ( Election_ID INT PRIMARY KEY, Counties_Represented TEXT, District INT, Delegate TEXT, Party INT, First_Elected REAL, Committee TEXT, UNIQUE (Election_ID), FOREIGN KEY (District) REFERENCES county(County_Id), FOREIGN KEY (Party) REFERENCES party(Party_ID) );
tracking_orders
{"Customers": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "customer_name", "VARCHAR(80)", 0, null, 0], [2, "customer_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Invoices": {"columns": [[0, "invoice_number", "INTEGER", 0, null, 1], [1, "invoice_date", "DATETIME", 0, null, 0], [2, "invoice_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["invoice_number"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Orders": {"columns": [[0, "order_id", "INTEGER", 0, null, 1], [1, "customer_id", "INTEGER", 1, null, 0], [2, "order_status", "VARCHAR(10)", 1, null, 0], [3, "date_order_placed", "DATETIME", 1, null, 0], [4, "order_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["order_id"], "foreign_keys": [[0, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "product_id", "INTEGER", 0, null, 1], [1, "product_name", "VARCHAR(80)", 0, null, 0], [2, "product_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["product_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Order_Items": {"columns": [[0, "order_item_id", "INTEGER", 0, null, 1], [1, "product_id", "INTEGER", 1, null, 0], [2, "order_id", "INTEGER", 1, null, 0], [3, "order_item_status", "VARCHAR(10)", 1, null, 0], [4, "order_item_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["order_item_id"], "foreign_keys": [[0, 0, "Products", "product_id", "product_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Orders", "order_id", "order_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Shipments": {"columns": [[0, "shipment_id", "INTEGER", 0, null, 1], [1, "order_id", "INTEGER", 1, null, 0], [2, "invoice_number", "INTEGER", 1, null, 0], [3, "shipment_tracking_number", "VARCHAR(80)", 0, null, 0], [4, "shipment_date", "DATETIME", 0, null, 0], [5, "other_shipment_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["shipment_id"], "foreign_keys": [[0, 0, "Invoices", "invoice_number", "invoice_number", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Orders", "order_id", "order_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Shipment_Items": {"columns": [[0, "shipment_id", "INTEGER", 1, null, 0], [1, "order_item_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Shipments", "shipment_id", "shipment_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Order_Items", "order_item_id", "order_item_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Customers ( customer_id INTEGER PRIMARY KEY, customer_name VARCHAR(80), customer_details VARCHAR(255) ); CREATE TABLE Invoices ( invoice_number INTEGER PRIMARY KEY, invoice_date DATETIME, invoice_details VARCHAR(255) ); CREATE TABLE Orders ( order_id INTEGER PRIMARY KEY, customer_id INTEGER NOT NULL, order_status VARCHAR(10) NOT NULL, date_order_placed DATETIME NOT NULL, order_details VARCHAR(255), FOREIGN KEY (customer_id) REFERENCES Customers(customer_id) ); CREATE TABLE Products ( product_id INTEGER PRIMARY KEY, product_name VARCHAR(80), product_details VARCHAR(255) ); CREATE TABLE Order_Items ( order_item_id INTEGER PRIMARY KEY, product_id INTEGER NOT NULL, order_id INTEGER NOT NULL, order_item_status VARCHAR(10) NOT NULL, order_item_details VARCHAR(255), FOREIGN KEY (product_id) REFERENCES Products(product_id), FOREIGN KEY (order_id) REFERENCES Orders(order_id) ); CREATE TABLE Shipments ( shipment_id INTEGER PRIMARY KEY, order_id INTEGER NOT NULL, invoice_number INTEGER NOT NULL, shipment_tracking_number VARCHAR(80), shipment_date DATETIME, other_shipment_details VARCHAR(255), FOREIGN KEY (invoice_number) REFERENCES Invoices(invoice_number), FOREIGN KEY (order_id) REFERENCES Orders(order_id) ); CREATE TABLE Shipment_Items ( shipment_id INTEGER NOT NULL, order_item_id INTEGER NOT NULL, FOREIGN KEY (shipment_id) REFERENCES Shipments(shipment_id), FOREIGN KEY (order_item_id) REFERENCES Order_Items(order_item_id) );
student_1
{"list": {"columns": [[0, "LastName", "TEXT", 0, null, 1], [1, "FirstName", "TEXT", 0, null, 2], [2, "Grade", "INTEGER", 0, null, 0], [3, "Classroom", "INTEGER", 0, null, 0]], "primary_keys": ["LastName", "FirstName"], "foreign_keys": [], "unique_constraints": [[[0, 0, "LastName"], [1, 1, "FirstName"]]], "check_constraints": []}, "teachers": {"columns": [[0, "LastName", "TEXT", 0, null, 1], [1, "FirstName", "TEXT", 0, null, 2], [2, "Classroom", "INTEGER", 0, null, 0]], "primary_keys": ["LastName", "FirstName"], "foreign_keys": [], "unique_constraints": [[[0, 0, "LastName"], [1, 1, "FirstName"]]], "check_constraints": []}}
CREATE TABLE list ( LastName TEXT PRIMARY KEY, FirstName TEXT PRIMARY KEY, Grade INTEGER, Classroom INTEGER, PRIMARY KEY (LastName, FirstName), UNIQUE (LastName, FirstName) ); CREATE TABLE teachers ( LastName TEXT PRIMARY KEY, FirstName TEXT PRIMARY KEY, Classroom INTEGER, PRIMARY KEY (LastName, FirstName), UNIQUE (LastName, FirstName) );
entertainment_awards
{"festival_detail": {"columns": [[0, "Festival_ID", "INT", 0, null, 1], [1, "Festival_Name", "TEXT", 0, null, 0], [2, "Chair_Name", "TEXT", 0, null, 0], [3, "Location", "TEXT", 0, null, 0], [4, "Year", "INT", 0, null, 0], [5, "Num_of_Audience", "INT", 0, null, 0]], "primary_keys": ["Festival_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Festival_ID"]]], "check_constraints": []}, "artwork": {"columns": [[0, "Artwork_ID", "INT", 0, null, 1], [1, "Type", "TEXT", 0, null, 0], [2, "Name", "TEXT", 0, null, 0]], "primary_keys": ["Artwork_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Artwork_ID"]]], "check_constraints": []}, "nomination": {"columns": [[0, "Artwork_ID", "INT", 0, null, 1], [1, "Festival_ID", "INT", 0, null, 2], [2, "Result", "TEXT", 0, null, 0]], "primary_keys": ["Artwork_ID", "Festival_ID"], "foreign_keys": [[0, 0, "festival_detail", "Festival_ID", "Festival_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "artwork", "Artwork_ID", "Artwork_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Artwork_ID"], [1, 1, "Festival_ID"]]], "check_constraints": []}}
CREATE TABLE festival_detail ( Festival_ID INT PRIMARY KEY, Festival_Name TEXT, Chair_Name TEXT, Location TEXT, Year INT, Num_of_Audience INT, UNIQUE (Festival_ID) ); CREATE TABLE artwork ( Artwork_ID INT PRIMARY KEY, Type TEXT, Name TEXT, UNIQUE (Artwork_ID) ); CREATE TABLE nomination ( Artwork_ID INT PRIMARY KEY, Festival_ID INT PRIMARY KEY, Result TEXT, PRIMARY KEY (Artwork_ID, Festival_ID), UNIQUE (Artwork_ID, Festival_ID), FOREIGN KEY (Festival_ID) REFERENCES festival_detail(Festival_ID), FOREIGN KEY (Artwork_ID) REFERENCES artwork(Artwork_ID) );
customer_complaints
{"Staff": {"columns": [[0, "staff_id", "INTEGER", 0, null, 1], [1, "gender", "VARCHAR(1)", 0, null, 0], [2, "first_name", "VARCHAR(80)", 0, null, 0], [3, "last_name", "VARCHAR(80)", 0, null, 0], [4, "email_address", "VARCHAR(255)", 0, null, 0], [5, "phone_number", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["staff_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "customer_type_code", "VARCHAR(20)", 1, null, 0], [2, "address_line_1", "VARCHAR(80)", 0, null, 0], [3, "address_line_2", "VARCHAR(80)", 0, null, 0], [4, "town_city", "VARCHAR(80)", 0, null, 0], [5, "state", "VARCHAR(80)", 0, null, 0], [6, "email_address", "VARCHAR(255)", 0, null, 0], [7, "phone_number", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Products": {"columns": [[0, "product_id", "INTEGER", 0, null, 1], [1, "parent_product_id", "INTEGER", 0, null, 0], [2, "product_category_code", "VARCHAR(20)", 1, null, 0], [3, "date_product_first_available", "DATETIME", 0, null, 0], [4, "date_product_discontinued", "DATETIME", 0, null, 0], [5, "product_name", "VARCHAR(80)", 0, null, 0], [6, "product_description", "VARCHAR(255)", 0, null, 0], [7, "product_price", "DECIMAL(19,4)", 0, null, 0]], "primary_keys": ["product_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Complaints": {"columns": [[0, "complaint_id", "INTEGER", 1, null, 0], [1, "product_id", "INTEGER", 1, null, 0], [2, "customer_id", "INTEGER", 1, null, 0], [3, "complaint_outcome_code", "VARCHAR(20)", 1, null, 0], [4, "complaint_status_code", "VARCHAR(20)", 1, null, 0], [5, "complaint_type_code", "VARCHAR(20)", 1, null, 0], [6, "date_complaint_raised", "DATETIME", 0, null, 0], [7, "date_complaint_closed", "DATETIME", 0, null, 0], [8, "staff_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Customers", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Products", "product_id", "product_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Staff", "staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Staff ( staff_id INTEGER PRIMARY KEY, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ); CREATE TABLE Customers ( customer_id INTEGER PRIMARY KEY, customer_type_code VARCHAR(20) NOT NULL, address_line_1 VARCHAR(80), address_line_2 VARCHAR(80), town_city VARCHAR(80), state VARCHAR(80), email_address VARCHAR(255), phone_number VARCHAR(80) ); CREATE TABLE Products ( product_id INTEGER PRIMARY KEY, parent_product_id INTEGER, product_category_code VARCHAR(20) NOT NULL, date_product_first_available DATETIME, date_product_discontinued DATETIME, product_name VARCHAR(80), product_description VARCHAR(255), product_price DECIMAL(19,4) ); CREATE TABLE Complaints ( complaint_id INTEGER NOT NULL, product_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, complaint_outcome_code VARCHAR(20) NOT NULL, complaint_status_code VARCHAR(20) NOT NULL, complaint_type_code VARCHAR(20) NOT NULL, date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER NOT NULL, FOREIGN KEY (customer_id) REFERENCES Customers(customer_id), FOREIGN KEY (product_id) REFERENCES Products(product_id), FOREIGN KEY (staff_id) REFERENCES Staff(staff_id) );
music_1
{"genre": {"columns": [[0, "g_name", "varchar2(20)", 1, null, 1], [1, "rating", "varchar2(10)", 0, null, 0], [2, "most_popular_in", "varchar2(50)", 0, null, 0]], "primary_keys": ["g_name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "g_name"]]], "check_constraints": []}, "artist": {"columns": [[0, "artist_name", "varchar2(50)", 1, null, 1], [1, "country", "varchar2(20)", 0, null, 0], [2, "gender", "varchar2(20)", 0, null, 0], [3, "preferred_genre", "varchar2(50)", 0, null, 0]], "primary_keys": ["artist_name"], "foreign_keys": [[0, 0, "genre", "preferred_genre", "g_name", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "artist_name"]]], "check_constraints": []}, "files": {"columns": [[0, "f_id", "number(10)", 1, null, 1], [1, "artist_name", "varchar2(50)", 0, null, 0], [2, "file_size", "varchar2(20)", 0, null, 0], [3, "duration", "varchar2(20)", 0, null, 0], [4, "formats", "varchar2(20)", 0, null, 0]], "primary_keys": ["f_id"], "foreign_keys": [[0, 0, "artist", "artist_name", "artist_name", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "f_id"]]], "check_constraints": []}, "song": {"columns": [[0, "song_name", "varchar2(50)", 0, null, 1], [1, "artist_name", "varchar2(50)", 0, null, 0], [2, "country", "varchar2(20)", 0, null, 0], [3, "f_id", "number(10)", 0, null, 0], [4, "genre_is", "varchar2(20)", 0, null, 0], [5, "rating", "number(10)", 0, null, 0], [6, "languages", "varchar2(20)", 0, null, 0], [7, "releasedate", "Date", 0, null, 0], [8, "resolution", "number(10)", 1, null, 0]], "primary_keys": ["song_name"], "foreign_keys": [[0, 0, "genre", "genre_is", "g_name", "NO ACTION", "CASCADE", "NONE"], [1, 0, "files", "f_id", "f_id", "NO ACTION", "CASCADE", "NONE"], [2, 0, "artist", "artist_name", "artist_name", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "song_name"]]], "check_constraints": ["rating number(10) check(rating>0 and rating<11),"]}}
CREATE TABLE genre ( g_name varchar2(20) NOT NULL PRIMARY KEY, rating varchar2(10), most_popular_in varchar2(50), UNIQUE (g_name) ); CREATE TABLE artist ( artist_name varchar2(50) NOT NULL PRIMARY KEY, country varchar2(20), gender varchar2(20), preferred_genre varchar2(50), UNIQUE (artist_name), FOREIGN KEY (preferred_genre) REFERENCES genre(g_name) ); CREATE TABLE files ( f_id number(10) NOT NULL PRIMARY KEY, artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20), UNIQUE (f_id), FOREIGN KEY (artist_name) REFERENCES artist(artist_name) ); CREATE TABLE song ( song_name varchar2(50) PRIMARY KEY, artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating number(10), languages varchar2(20), releasedate Date, resolution number(10) NOT NULL, UNIQUE (song_name), FOREIGN KEY (genre_is) REFERENCES genre(g_name), FOREIGN KEY (f_id) REFERENCES files(f_id), FOREIGN KEY (artist_name) REFERENCES artist(artist_name), rating number(10) check(rating>0 and rating<11), );
film_rank
{"film": {"columns": [[0, "Film_ID", "INT", 0, null, 1], [1, "Title", "TEXT", 0, null, 0], [2, "Studio", "TEXT", 0, null, 0], [3, "Director", "TEXT", 0, null, 0], [4, "Gross_in_dollar", "INT", 0, null, 0]], "primary_keys": ["Film_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Film_ID"]]], "check_constraints": []}, "market": {"columns": [[0, "Market_ID", "INT", 0, null, 1], [1, "Country", "TEXT", 0, null, 0], [2, "Number_cities", "INT", 0, null, 0]], "primary_keys": ["Market_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Market_ID"]]], "check_constraints": []}, "film_market_estimation": {"columns": [[0, "Estimation_ID", "INT", 0, null, 1], [1, "Low_Estimate", "REAL", 0, null, 0], [2, "High_Estimate", "REAL", 0, null, 0], [3, "Film_ID", "INT", 0, null, 0], [4, "Type", "TEXT", 0, null, 0], [5, "Market_ID", "INT", 0, null, 0], [6, "Year", "INT", 0, null, 0]], "primary_keys": ["Estimation_ID"], "foreign_keys": [[0, 0, "market", "Market_ID", "Market_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "film", "Film_ID", "Film_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Estimation_ID"]]], "check_constraints": []}}
CREATE TABLE film ( Film_ID INT PRIMARY KEY, Title TEXT, Studio TEXT, Director TEXT, Gross_in_dollar INT, UNIQUE (Film_ID) ); CREATE TABLE market ( Market_ID INT PRIMARY KEY, Country TEXT, Number_cities INT, UNIQUE (Market_ID) ); CREATE TABLE film_market_estimation ( Estimation_ID INT PRIMARY KEY, Low_Estimate REAL, High_Estimate REAL, Film_ID INT, Type TEXT, Market_ID INT, Year INT, UNIQUE (Estimation_ID), FOREIGN KEY (Market_ID) REFERENCES market(Market_ID), FOREIGN KEY (Film_ID) REFERENCES film(Film_ID) );
station_weather
{"train": {"columns": [[0, "id", "INT", 0, null, 1], [1, "train_number", "INT", 0, null, 0], [2, "name", "TEXT", 0, null, 0], [3, "origin", "TEXT", 0, null, 0], [4, "destination", "TEXT", 0, null, 0], [5, "time", "TEXT", 0, null, 0], [6, "interval", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "station": {"columns": [[0, "id", "INT", 0, null, 1], [1, "network_name", "TEXT", 0, null, 0], [2, "services", "TEXT", 0, null, 0], [3, "local_authority", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "route": {"columns": [[0, "train_id", "INT", 0, null, 1], [1, "station_id", "INT", 0, null, 2]], "primary_keys": ["train_id", "station_id"], "foreign_keys": [[0, 0, "station", "station_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "train", "train_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "train_id"], [1, 1, "station_id"]]], "check_constraints": []}, "weekly_weather": {"columns": [[0, "station_id", "INT", 0, null, 1], [1, "day_of_week", "TEXT", 0, null, 2], [2, "high_temperature", "INT", 0, null, 0], [3, "low_temperature", "INT", 0, null, 0], [4, "precipitation", "REAL", 0, null, 0], [5, "wind_speed_mph", "INT", 0, null, 0]], "primary_keys": ["station_id", "day_of_week"], "foreign_keys": [[0, 0, "station", "station_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "station_id"], [1, 1, "day_of_week"]]], "check_constraints": []}}
CREATE TABLE train ( id INT PRIMARY KEY, train_number INT, name TEXT, origin TEXT, destination TEXT, time TEXT, interval TEXT, UNIQUE (id) ); CREATE TABLE station ( id INT PRIMARY KEY, network_name TEXT, services TEXT, local_authority TEXT, UNIQUE (id) ); CREATE TABLE route ( train_id INT PRIMARY KEY, station_id INT PRIMARY KEY, PRIMARY KEY (train_id, station_id), UNIQUE (train_id, station_id), FOREIGN KEY (station_id) REFERENCES station(id), FOREIGN KEY (train_id) REFERENCES train(id) ); CREATE TABLE weekly_weather ( station_id INT PRIMARY KEY, day_of_week TEXT PRIMARY KEY, high_temperature INT, low_temperature INT, precipitation REAL, wind_speed_mph INT, PRIMARY KEY (station_id, day_of_week), UNIQUE (station_id, day_of_week), FOREIGN KEY (station_id) REFERENCES station(id) );
voter_1
{"AREA_CODE_STATE": {"columns": [[0, "area_code", "INTEGER", 1, null, 1], [1, "state", "varchar(2)", 1, null, 0]], "primary_keys": ["area_code"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "CONTESTANTS": {"columns": [[0, "contestant_number", "INTEGER", 0, null, 1], [1, "contestant_name", "varchar(50)", 1, null, 0]], "primary_keys": ["contestant_number"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "VOTES": {"columns": [[0, "vote_id", "INTEGER", 1, null, 1], [1, "phone_number", "INTEGER", 1, null, 0], [2, "state", "varchar(2)", 1, null, 0], [3, "contestant_number", "INTEGER", 1, null, 0], [4, "created", "timestamp", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["vote_id"], "foreign_keys": [[0, 0, "CONTESTANTS", "contestant_number", "contestant_number", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "AREA_CODE_STATE", "state", "state", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE AREA_CODE_STATE ( area_code INTEGER NOT NULL PRIMARY KEY, state varchar(2) NOT NULL ); CREATE TABLE CONTESTANTS ( contestant_number INTEGER PRIMARY KEY, contestant_name varchar(50) NOT NULL ); CREATE TABLE VOTES ( vote_id INTEGER NOT NULL PRIMARY KEY, phone_number INTEGER NOT NULL, state varchar(2) NOT NULL, contestant_number INTEGER NOT NULL, created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (contestant_number) REFERENCES CONTESTANTS(contestant_number), FOREIGN KEY (state) REFERENCES AREA_CODE_STATE(state) );
school_finance
{"School": {"columns": [[0, "School_id", "TEXT", 0, null, 1], [1, "School_name", "TEXT", 0, null, 0], [2, "Location", "TEXT", 0, null, 0], [3, "Mascot", "TEXT", 0, null, 0], [4, "Enrollment", "INT", 0, null, 0], [5, "IHSAA_Class", "TEXT", 0, null, 0], [6, "IHSAA_Football_Class", "TEXT", 0, null, 0], [7, "County", "TEXT", 0, null, 0]], "primary_keys": ["School_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "School_id"]]], "check_constraints": []}, "budget": {"columns": [[0, "School_id", "INT", 0, null, 1], [1, "Year", "INT", 0, null, 2], [2, "Budgeted", "INT", 0, null, 0], [3, "total_budget_percent_budgeted", "REAL", 0, null, 0], [4, "Invested", "INT", 0, null, 0], [5, "total_budget_percent_invested", "REAL", 0, null, 0], [6, "Budget_invested_percent", "TEXT", 0, null, 0]], "primary_keys": ["School_id", "Year"], "foreign_keys": [[0, 0, "School", "School_id", "School_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "School_id"], [1, 1, "Year"]]], "check_constraints": []}, "endowment": {"columns": [[0, "endowment_id", "INT", 0, null, 1], [1, "School_id", "INT", 0, null, 0], [2, "donator_name", "TEXT", 0, null, 0], [3, "amount", "REAL", 0, null, 0]], "primary_keys": ["endowment_id"], "foreign_keys": [[0, 0, "School", "School_id", "School_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "endowment_id"]]], "check_constraints": []}}
CREATE TABLE School ( School_id TEXT PRIMARY KEY, School_name TEXT, Location TEXT, Mascot TEXT, Enrollment INT, IHSAA_Class TEXT, IHSAA_Football_Class TEXT, County TEXT, UNIQUE (School_id) ); CREATE TABLE budget ( School_id INT PRIMARY KEY, Year INT PRIMARY KEY, Budgeted INT, total_budget_percent_budgeted REAL, Invested INT, total_budget_percent_invested REAL, Budget_invested_percent TEXT, PRIMARY KEY (School_id, Year), UNIQUE (School_id, Year), FOREIGN KEY (School_id) REFERENCES School(School_id) ); CREATE TABLE endowment ( endowment_id INT PRIMARY KEY, School_id INT, donator_name TEXT, amount REAL, UNIQUE (endowment_id), FOREIGN KEY (School_id) REFERENCES School(School_id) );
voter_2
{"Student": {"columns": [[0, "StuID", "INTEGER", 0, null, 1], [1, "LName", "VARCHAR(12)", 0, null, 0], [2, "Fname", "VARCHAR(12)", 0, null, 0], [3, "Age", "INTEGER", 0, null, 0], [4, "Sex", "VARCHAR(1)", 0, null, 0], [5, "Major", "INTEGER", 0, null, 0], [6, "Advisor", "INTEGER", 0, null, 0], [7, "city_code", "VARCHAR(3)", 0, null, 0]], "primary_keys": ["StuID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Voting_record": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "Registration_Date", "VARCHAR(12)", 0, null, 0], [2, "Election_Cycle", "VARCHAR(12)", 0, null, 0], [3, "President_Vote", "INTEGER", 0, null, 0], [4, "Vice_President_Vote", "INTEGER", 0, null, 0], [5, "Secretary_Vote", "INTEGER", 0, null, 0], [6, "Treasurer_Vote", "INTEGER", 0, null, 0], [7, "Class_President_Vote", "INTEGER", 0, null, 0], [8, "Class_Senator_Vote", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Student", "Class_Senator_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Student", "Class_President_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Student", "Treasurer_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Student", "Secretary_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [4, 0, "Student", "Vice_President_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [5, 0, "Student", "President_Vote", "StuID", "NO ACTION", "NO ACTION", "NONE"], [6, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); CREATE TABLE Voting_record ( StuID INTEGER, Registration_Date VARCHAR(12), Election_Cycle VARCHAR(12), President_Vote INTEGER, Vice_President_Vote INTEGER, Secretary_Vote INTEGER, Treasurer_Vote INTEGER, Class_President_Vote INTEGER, Class_Senator_Vote INTEGER, FOREIGN KEY (Class_Senator_Vote) REFERENCES Student(StuID), FOREIGN KEY (Class_President_Vote) REFERENCES Student(StuID), FOREIGN KEY (Treasurer_Vote) REFERENCES Student(StuID), FOREIGN KEY (Secretary_Vote) REFERENCES Student(StuID), FOREIGN KEY (Vice_President_Vote) REFERENCES Student(StuID), FOREIGN KEY (President_Vote) REFERENCES Student(StuID), FOREIGN KEY (StuID) REFERENCES Student(StuID) );
musical
{"musical": {"columns": [[0, "Musical_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Year", "INT", 0, null, 0], [3, "Award", "TEXT", 0, null, 0], [4, "Category", "TEXT", 0, null, 0], [5, "Nominee", "TEXT", 0, null, 0], [6, "Result", "TEXT", 0, null, 0]], "primary_keys": ["Musical_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Musical_ID"]]], "check_constraints": []}, "actor": {"columns": [[0, "Actor_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Musical_ID", "INT", 0, null, 0], [3, "Character", "TEXT", 0, null, 0], [4, "Duration", "TEXT", 0, null, 0], [5, "age", "INT", 0, null, 0]], "primary_keys": ["Actor_ID"], "foreign_keys": [[0, 0, "actor", "Musical_ID", "Actor_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Actor_ID"]]], "check_constraints": []}}
CREATE TABLE musical ( Musical_ID INT PRIMARY KEY, Name TEXT, Year INT, Award TEXT, Category TEXT, Nominee TEXT, Result TEXT, UNIQUE (Musical_ID) ); CREATE TABLE actor ( Actor_ID INT PRIMARY KEY, Name TEXT, Musical_ID INT, Character TEXT, Duration TEXT, age INT, UNIQUE (Actor_ID), FOREIGN KEY (Musical_ID) REFERENCES actor(Actor_ID) );
mountain_photos
{"mountain": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "Height", "REAL", 0, null, 0], [3, "Prominence", "REAL", 0, null, 0], [4, "Range", "TEXT", 0, null, 0], [5, "Country", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "camera_lens": {"columns": [[0, "id", "INT", 0, null, 1], [1, "brand", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0], [3, "focal_length_mm", "REAL", 0, null, 0], [4, "max_aperture", "REAL", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "photos": {"columns": [[0, "id", "INT", 0, null, 1], [1, "camera_lens_id", "INT", 0, null, 0], [2, "mountain_id", "INT", 0, null, 0], [3, "color", "TEXT", 0, null, 0], [4, "name", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "mountain", "mountain_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "camera_lens", "camera_lens_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}}
CREATE TABLE mountain ( id INT PRIMARY KEY, name TEXT, Height REAL, Prominence REAL, Range TEXT, Country TEXT, UNIQUE (id) ); CREATE TABLE camera_lens ( id INT PRIMARY KEY, brand TEXT, name TEXT, focal_length_mm REAL, max_aperture REAL, UNIQUE (id) ); CREATE TABLE photos ( id INT PRIMARY KEY, camera_lens_id INT, mountain_id INT, color TEXT, name TEXT, UNIQUE (id), FOREIGN KEY (mountain_id) REFERENCES mountain(id), FOREIGN KEY (camera_lens_id) REFERENCES camera_lens(id) );
wrestler
{"wrestler": {"columns": [[0, "Wrestler_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Reign", "TEXT", 0, null, 0], [3, "Days_held", "TEXT", 0, null, 0], [4, "Location", "TEXT", 0, null, 0], [5, "Event", "TEXT", 0, null, 0]], "primary_keys": ["Wrestler_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Wrestler_ID"]]], "check_constraints": []}, "Elimination": {"columns": [[0, "Elimination_ID", "TEXT", 0, null, 1], [1, "Wrestler_ID", "TEXT", 0, null, 0], [2, "Team", "TEXT", 0, null, 0], [3, "Eliminated_By", "TEXT", 0, null, 0], [4, "Elimination_Move", "TEXT", 0, null, 0], [5, "Time", "TEXT", 0, null, 0]], "primary_keys": ["Elimination_ID"], "foreign_keys": [[0, 0, "wrestler", "Wrestler_ID", "Wrestler_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Elimination_ID"]]], "check_constraints": []}}
CREATE TABLE wrestler ( Wrestler_ID INT PRIMARY KEY, Name TEXT, Reign TEXT, Days_held TEXT, Location TEXT, Event TEXT, UNIQUE (Wrestler_ID) ); CREATE TABLE Elimination ( Elimination_ID TEXT PRIMARY KEY, Wrestler_ID TEXT, Team TEXT, Eliminated_By TEXT, Elimination_Move TEXT, Time TEXT, UNIQUE (Elimination_ID), FOREIGN KEY (Wrestler_ID) REFERENCES wrestler(Wrestler_ID) );
school_bus
{"driver": {"columns": [[0, "Driver_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Party", "TEXT", 0, null, 0], [3, "Home_city", "TEXT", 0, null, 0], [4, "Age", "INT", 0, null, 0]], "primary_keys": ["Driver_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Driver_ID"]]], "check_constraints": []}, "school": {"columns": [[0, "School_ID", "INT", 0, null, 1], [1, "Grade", "TEXT", 0, null, 0], [2, "School", "TEXT", 0, null, 0], [3, "Location", "TEXT", 0, null, 0], [4, "Type", "TEXT", 0, null, 0]], "primary_keys": ["School_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "School_ID"]]], "check_constraints": []}, "school_bus": {"columns": [[0, "School_ID", "INT", 0, null, 1], [1, "Driver_ID", "INT", 0, null, 2], [2, "Years_Working", "INT", 0, null, 0], [3, "If_full_time", "bool", 0, null, 0]], "primary_keys": ["School_ID", "Driver_ID"], "foreign_keys": [[0, 0, "driver", "Driver_ID", "Driver_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "school", "School_ID", "School_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "School_ID"], [1, 1, "Driver_ID"]]], "check_constraints": []}}
CREATE TABLE driver ( Driver_ID INT PRIMARY KEY, Name TEXT, Party TEXT, Home_city TEXT, Age INT, UNIQUE (Driver_ID) ); CREATE TABLE school ( School_ID INT PRIMARY KEY, Grade TEXT, School TEXT, Location TEXT, Type TEXT, UNIQUE (School_ID) ); CREATE TABLE school_bus ( School_ID INT PRIMARY KEY, Driver_ID INT PRIMARY KEY, Years_Working INT, If_full_time bool, PRIMARY KEY (School_ID, Driver_ID), UNIQUE (School_ID, Driver_ID), FOREIGN KEY (Driver_ID) REFERENCES driver(Driver_ID), FOREIGN KEY (School_ID) REFERENCES school(School_ID) );
gymnast
{"gymnast": {"columns": [[0, "Gymnast_ID", "INT", 0, null, 1], [1, "Floor_Exercise_Points", "REAL", 0, null, 0], [2, "Pommel_Horse_Points", "REAL", 0, null, 0], [3, "Rings_Points", "REAL", 0, null, 0], [4, "Vault_Points", "REAL", 0, null, 0], [5, "Parallel_Bars_Points", "REAL", 0, null, 0], [6, "Horizontal_Bar_Points", "REAL", 0, null, 0], [7, "Total_Points", "REAL", 0, null, 0]], "primary_keys": ["Gymnast_ID"], "foreign_keys": [[0, 0, "people", "Gymnast_ID", "People_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Gymnast_ID"]]], "check_constraints": []}, "people": {"columns": [[0, "People_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Age", "REAL", 0, null, 0], [3, "Height", "REAL", 0, null, 0], [4, "Hometown", "TEXT", 0, null, 0]], "primary_keys": ["People_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "People_ID"]]], "check_constraints": []}}
CREATE TABLE gymnast ( Gymnast_ID INT PRIMARY KEY, Floor_Exercise_Points REAL, Pommel_Horse_Points REAL, Rings_Points REAL, Vault_Points REAL, Parallel_Bars_Points REAL, Horizontal_Bar_Points REAL, Total_Points REAL, UNIQUE (Gymnast_ID), FOREIGN KEY (Gymnast_ID) REFERENCES people(People_ID) ); CREATE TABLE people ( People_ID INT PRIMARY KEY, Name TEXT, Age REAL, Height REAL, Hometown TEXT, UNIQUE (People_ID) );
theme_gallery
{"artist": {"columns": [[0, "Artist_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Country", "TEXT", 0, null, 0], [3, "Year_Join", "INT", 0, null, 0], [4, "Age", "INT", 0, null, 0]], "primary_keys": ["Artist_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Artist_ID"]]], "check_constraints": []}, "exhibition": {"columns": [[0, "Exhibition_ID", "INT", 0, null, 1], [1, "Year", "INT", 0, null, 0], [2, "Theme", "TEXT", 0, null, 0], [3, "Artist_ID", "INT", 0, null, 0], [4, "Ticket_Price", "REAL", 0, null, 0]], "primary_keys": ["Exhibition_ID"], "foreign_keys": [[0, 0, "artist", "Artist_ID", "Artist_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Exhibition_ID"]]], "check_constraints": []}, "exhibition_record": {"columns": [[0, "Exhibition_ID", "INT", 0, null, 1], [1, "Date", "TEXT", 0, null, 2], [2, "Attendance", "INT", 0, null, 0]], "primary_keys": ["Exhibition_ID", "Date"], "foreign_keys": [[0, 0, "exhibition", "Exhibition_ID", "Exhibition_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Exhibition_ID"], [1, 1, "Date"]]], "check_constraints": []}}
CREATE TABLE artist ( Artist_ID INT PRIMARY KEY, Name TEXT, Country TEXT, Year_Join INT, Age INT, UNIQUE (Artist_ID) ); CREATE TABLE exhibition ( Exhibition_ID INT PRIMARY KEY, Year INT, Theme TEXT, Artist_ID INT, Ticket_Price REAL, UNIQUE (Exhibition_ID), FOREIGN KEY (Artist_ID) REFERENCES artist(Artist_ID) ); CREATE TABLE exhibition_record ( Exhibition_ID INT PRIMARY KEY, Date TEXT PRIMARY KEY, Attendance INT, PRIMARY KEY (Exhibition_ID, Date), UNIQUE (Exhibition_ID, Date), FOREIGN KEY (Exhibition_ID) REFERENCES exhibition(Exhibition_ID) );
museum_visit
{"museum": {"columns": [[0, "Museum_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Num_of_Staff", "INT", 0, null, 0], [3, "Open_Year", "TEXT", 0, null, 0]], "primary_keys": ["Museum_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Museum_ID"]]], "check_constraints": []}, "visitor": {"columns": [[0, "ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Level_of_membership", "INT", 0, null, 0], [3, "Age", "INT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": []}, "visit": {"columns": [[0, "Museum_ID", "INT", 0, null, 1], [1, "visitor_ID", "TEXT", 0, null, 2], [2, "Num_of_Ticket", "INT", 0, null, 0], [3, "Total_spent", "REAL", 0, null, 0]], "primary_keys": ["Museum_ID", "visitor_ID"], "foreign_keys": [[0, 0, "visitor", "visitor_ID", "ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "museum", "Museum_ID", "Museum_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Museum_ID"], [1, 1, "visitor_ID"]]], "check_constraints": []}}
CREATE TABLE museum ( Museum_ID INT PRIMARY KEY, Name TEXT, Num_of_Staff INT, Open_Year TEXT, UNIQUE (Museum_ID) ); CREATE TABLE visitor ( ID INT PRIMARY KEY, Name TEXT, Level_of_membership INT, Age INT, UNIQUE (ID) ); CREATE TABLE visit ( Museum_ID INT PRIMARY KEY, visitor_ID TEXT PRIMARY KEY, Num_of_Ticket INT, Total_spent REAL, PRIMARY KEY (Museum_ID, visitor_ID), UNIQUE (Museum_ID, visitor_ID), FOREIGN KEY (visitor_ID) REFERENCES visitor(ID), FOREIGN KEY (Museum_ID) REFERENCES museum(Museum_ID) );
machine_repair
{"repair": {"columns": [[0, "repair_ID", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "Launch_Date", "TEXT", 0, null, 0], [3, "Notes", "TEXT", 0, null, 0]], "primary_keys": ["repair_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "repair_ID"]]], "check_constraints": []}, "machine": {"columns": [[0, "Machine_ID", "INT", 0, null, 1], [1, "Making_Year", "INT", 0, null, 0], [2, "Class", "TEXT", 0, null, 0], [3, "Team", "TEXT", 0, null, 0], [4, "Machine_series", "TEXT", 0, null, 0], [5, "value_points", "REAL", 0, null, 0], [6, "quality_rank", "INT", 0, null, 0]], "primary_keys": ["Machine_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Machine_ID"]]], "check_constraints": []}, "technician": {"columns": [[0, "technician_id", "REAL", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Team", "TEXT", 0, null, 0], [3, "Starting_Year", "REAL", 0, null, 0], [4, "Age", "INT", 0, null, 0]], "primary_keys": ["technician_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "technician_id"]]], "check_constraints": []}, "repair_assignment": {"columns": [[0, "technician_id", "INT", 0, null, 1], [1, "repair_ID", "INT", 0, null, 2], [2, "Machine_ID", "INT", 0, null, 3]], "primary_keys": ["technician_id", "repair_ID", "Machine_ID"], "foreign_keys": [[0, 0, "machine", "Machine_ID", "Machine_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "repair", "repair_ID", "repair_ID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "technician", "technician_id", "technician_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "technician_id"], [1, 1, "repair_ID"], [2, 2, "Machine_ID"]]], "check_constraints": []}}
CREATE TABLE repair ( repair_ID INT PRIMARY KEY, name TEXT, Launch_Date TEXT, Notes TEXT, UNIQUE (repair_ID) ); CREATE TABLE machine ( Machine_ID INT PRIMARY KEY, Making_Year INT, Class TEXT, Team TEXT, Machine_series TEXT, value_points REAL, quality_rank INT, UNIQUE (Machine_ID) ); CREATE TABLE technician ( technician_id REAL PRIMARY KEY, Name TEXT, Team TEXT, Starting_Year REAL, Age INT, UNIQUE (technician_id) ); CREATE TABLE repair_assignment ( technician_id INT PRIMARY KEY, repair_ID INT PRIMARY KEY, Machine_ID INT PRIMARY KEY, PRIMARY KEY (technician_id, repair_ID, Machine_ID), UNIQUE (technician_id, repair_ID, Machine_ID), FOREIGN KEY (Machine_ID) REFERENCES machine(Machine_ID), FOREIGN KEY (repair_ID) REFERENCES repair(repair_ID), FOREIGN KEY (technician_id) REFERENCES technician(technician_id) );
tvshow
{"TV_Channel": {"columns": [[0, "id", "TEXT", 0, null, 1], [1, "series_name", "TEXT", 0, null, 0], [2, "Country", "TEXT", 0, null, 0], [3, "Language", "TEXT", 0, null, 0], [4, "Content", "TEXT", 0, null, 0], [5, "Pixel_aspect_ratio_PAR", "TEXT", 0, null, 0], [6, "Hight_definition_TV", "TEXT", 0, null, 0], [7, "Pay_per_view_PPV", "TEXT", 0, null, 0], [8, "Package_Option", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "TV_series": {"columns": [[0, "id", "REAL", 0, null, 1], [1, "Episode", "TEXT", 0, null, 0], [2, "Air_Date", "TEXT", 0, null, 0], [3, "Rating", "TEXT", 0, null, 0], [4, "Share", "REAL", 0, null, 0], [5, "18_49_Rating_Share", "TEXT", 0, null, 0], [6, "Viewers_m", "TEXT", 0, null, 0], [7, "Weekly_Rank", "REAL", 0, null, 0], [8, "Channel", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "TV_Channel", "Channel", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "Cartoon": {"columns": [[0, "id", "REAL", 0, null, 1], [1, "Title", "TEXT", 0, null, 0], [2, "Directed_by", "TEXT", 0, null, 0], [3, "Written_by", "TEXT", 0, null, 0], [4, "Original_air_date", "TEXT", 0, null, 0], [5, "Production_code", "REAL", 0, null, 0], [6, "Channel", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "TV_Channel", "Channel", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}}
CREATE TABLE TV_Channel ( id TEXT PRIMARY KEY, series_name TEXT, Country TEXT, Language TEXT, Content TEXT, Pixel_aspect_ratio_PAR TEXT, Hight_definition_TV TEXT, Pay_per_view_PPV TEXT, Package_Option TEXT, UNIQUE (id) ); CREATE TABLE TV_series ( id REAL PRIMARY KEY, Episode TEXT, Air_Date TEXT, Rating TEXT, Share REAL, 18_49_Rating_Share TEXT, Viewers_m TEXT, Weekly_Rank REAL, Channel TEXT, UNIQUE (id), FOREIGN KEY (Channel) REFERENCES TV_Channel(id) ); CREATE TABLE Cartoon ( id REAL PRIMARY KEY, Title TEXT, Directed_by TEXT, Written_by TEXT, Original_air_date TEXT, Production_code REAL, Channel TEXT, UNIQUE (id), FOREIGN KEY (Channel) REFERENCES TV_Channel(id) );
poker_player
{"poker_player": {"columns": [[0, "Poker_Player_ID", "INT", 0, null, 1], [1, "People_ID", "INT", 0, null, 0], [2, "Final_Table_Made", "REAL", 0, null, 0], [3, "Best_Finish", "REAL", 0, null, 0], [4, "Money_Rank", "REAL", 0, null, 0], [5, "Earnings", "REAL", 0, null, 0]], "primary_keys": ["Poker_Player_ID"], "foreign_keys": [[0, 0, "people", "People_ID", "People_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Poker_Player_ID"]]], "check_constraints": []}, "people": {"columns": [[0, "People_ID", "INT", 0, null, 1], [1, "Nationality", "TEXT", 0, null, 0], [2, "Name", "TEXT", 0, null, 0], [3, "Birth_Date", "TEXT", 0, null, 0], [4, "Height", "REAL", 0, null, 0]], "primary_keys": ["People_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "People_ID"]]], "check_constraints": []}}
CREATE TABLE poker_player ( Poker_Player_ID INT PRIMARY KEY, People_ID INT, Final_Table_Made REAL, Best_Finish REAL, Money_Rank REAL, Earnings REAL, UNIQUE (Poker_Player_ID), FOREIGN KEY (People_ID) REFERENCES people(People_ID) ); CREATE TABLE people ( People_ID INT PRIMARY KEY, Nationality TEXT, Name TEXT, Birth_Date TEXT, Height REAL, UNIQUE (People_ID) );
student_assessment
{"Addresses": {"columns": [[0, "address_id", "INTEGER", 1, null, 1], [1, "line_1", "VARCHAR(80)", 0, null, 0], [2, "line_2", "VARCHAR(80)", 0, null, 0], [3, "city", "VARCHAR(50)", 0, null, 0], [4, "zip_postcode", "CHAR(20)", 0, null, 0], [5, "state_province_county", "VARCHAR(50)", 0, null, 0], [6, "country", "VARCHAR(50)", 0, null, 0]], "primary_keys": ["address_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "People": {"columns": [[0, "person_id", "INTEGER", 1, null, 1], [1, "first_name", "VARCHAR(255)", 0, null, 0], [2, "middle_name", "VARCHAR(255)", 0, null, 0], [3, "last_name", "VARCHAR(255)", 0, null, 0], [4, "cell_mobile_number", "VARCHAR(40)", 0, null, 0], [5, "email_address", "VARCHAR(40)", 0, null, 0], [6, "login_name", "VARCHAR(40)", 0, null, 0], [7, "password", "VARCHAR(40)", 0, null, 0]], "primary_keys": ["person_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Students": {"columns": [[0, "student_id", "INTEGER", 1, null, 1], [1, "student_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["student_id"], "foreign_keys": [[0, 0, "People", "student_id", "person_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Courses": {"columns": [[0, "course_id", "VARCHAR(100)", 1, null, 1], [1, "course_name", "VARCHAR(120)", 0, null, 0], [2, "course_description", "VARCHAR(255)", 0, null, 0], [3, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["course_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "course_id"]]], "check_constraints": []}, "People_Addresses": {"columns": [[0, "person_address_id", "INTEGER", 1, null, 1], [1, "person_id", "INTEGER", 1, null, 0], [2, "address_id", "INTEGER", 1, null, 0], [3, "date_from", "DATETIME", 0, null, 0], [4, "date_to", "DATETIME", 0, null, 0]], "primary_keys": ["person_address_id"], "foreign_keys": [[0, 0, "Addresses", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "People", "person_id", "person_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Student_Course_Registrations": {"columns": [[0, "student_id", "INTEGER", 1, null, 1], [1, "course_id", "INTEGER", 1, null, 2], [2, "registration_date", "DATETIME", 1, null, 0]], "primary_keys": ["student_id", "course_id"], "foreign_keys": [[0, 0, "Courses", "course_id", "course_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Students", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "student_id"], [1, 1, "course_id"]]], "check_constraints": []}, "Student_Course_Attendance": {"columns": [[0, "student_id", "INTEGER", 1, null, 1], [1, "course_id", "INTEGER", 1, null, 2], [2, "date_of_attendance", "DATETIME", 1, null, 0]], "primary_keys": ["student_id", "course_id"], "foreign_keys": [[0, 0, "Student_Course_Registrations", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "Student_Course_Registrations", "course_id", "course_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "student_id"], [1, 1, "course_id"]]], "check_constraints": []}, "Candidates": {"columns": [[0, "candidate_id", "INTEGER", 1, null, 1], [1, "candidate_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["candidate_id"], "foreign_keys": [[0, 0, "People", "candidate_id", "person_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Candidate_Assessments": {"columns": [[0, "candidate_id", "INTEGER", 1, null, 1], [1, "qualification", "CHAR(15)", 1, null, 2], [2, "assessment_date", "DATETIME", 1, null, 0], [3, "asessment_outcome_code", "CHAR(15)", 1, null, 0]], "primary_keys": ["candidate_id", "qualification"], "foreign_keys": [[0, 0, "Candidates", "candidate_id", "candidate_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "candidate_id"], [1, 1, "qualification"]]], "check_constraints": []}}
CREATE TABLE Addresses ( address_id INTEGER NOT NULL PRIMARY KEY, line_1 VARCHAR(80), line_2 VARCHAR(80), city VARCHAR(50), zip_postcode CHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ); CREATE TABLE People ( person_id INTEGER NOT NULL PRIMARY KEY, first_name VARCHAR(255), middle_name VARCHAR(255), last_name VARCHAR(255), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), login_name VARCHAR(40), password VARCHAR(40) ); CREATE TABLE Students ( student_id INTEGER NOT NULL PRIMARY KEY, student_details VARCHAR(255), FOREIGN KEY (student_id) REFERENCES People(person_id) ); CREATE TABLE Courses ( course_id VARCHAR(100) NOT NULL PRIMARY KEY, course_name VARCHAR(120), course_description VARCHAR(255), other_details VARCHAR(255), UNIQUE (course_id) ); CREATE TABLE People_Addresses ( person_address_id INTEGER NOT NULL PRIMARY KEY, person_id INTEGER NOT NULL, address_id INTEGER NOT NULL, date_from DATETIME, date_to DATETIME, FOREIGN KEY (address_id) REFERENCES Addresses(address_id), FOREIGN KEY (person_id) REFERENCES People(person_id) ); CREATE TABLE Student_Course_Registrations ( student_id INTEGER NOT NULL PRIMARY KEY, course_id INTEGER NOT NULL PRIMARY KEY, registration_date DATETIME NOT NULL, PRIMARY KEY (student_id, course_id), UNIQUE (student_id, course_id), FOREIGN KEY (course_id) REFERENCES Courses(course_id), FOREIGN KEY (student_id) REFERENCES Students(student_id) ); CREATE TABLE Student_Course_Attendance ( student_id INTEGER NOT NULL PRIMARY KEY, course_id INTEGER NOT NULL PRIMARY KEY, date_of_attendance DATETIME NOT NULL, PRIMARY KEY (student_id, course_id), UNIQUE (student_id, course_id), FOREIGN KEY (student_id) REFERENCES Student_Course_Registrations(student_id), FOREIGN KEY (course_id) REFERENCES Student_Course_Registrations(course_id) ); CREATE TABLE Candidates ( candidate_id INTEGER NOT NULL PRIMARY KEY, candidate_details VARCHAR(255), FOREIGN KEY (candidate_id) REFERENCES People(person_id) ); CREATE TABLE Candidate_Assessments ( candidate_id INTEGER NOT NULL PRIMARY KEY, qualification CHAR(15) NOT NULL PRIMARY KEY, assessment_date DATETIME NOT NULL, asessment_outcome_code CHAR(15) NOT NULL, PRIMARY KEY (candidate_id, qualification), UNIQUE (candidate_id, qualification), FOREIGN KEY (candidate_id) REFERENCES Candidates(candidate_id) );
match_season
{"country": {"columns": [[0, "Country_id", "INT", 0, null, 1], [1, "Country_name", "TEXT", 0, null, 0], [2, "Capital", "TEXT", 0, null, 0], [3, "Official_native_language", "TEXT", 0, null, 0]], "primary_keys": ["Country_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Country_id"]]], "check_constraints": []}, "team": {"columns": [[0, "Team_id", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0]], "primary_keys": ["Team_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Team_id"]]], "check_constraints": []}, "match_season": {"columns": [[0, "Season", "REAL", 0, null, 1], [1, "Player", "TEXT", 0, null, 0], [2, "Position", "TEXT", 0, null, 0], [3, "Country", "INT", 0, null, 0], [4, "Team", "INT", 0, null, 0], [5, "Draft_Pick_Number", "INT", 0, null, 0], [6, "Draft_Class", "TEXT", 0, null, 0], [7, "College", "TEXT", 0, null, 0]], "primary_keys": ["Season"], "foreign_keys": [[0, 0, "team", "Team", "Team_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "country", "Country", "Country_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Season"]]], "check_constraints": []}, "player": {"columns": [[0, "Player_ID", "INT", 0, null, 1], [1, "Player", "TEXT", 0, null, 0], [2, "Years_Played", "TEXT", 0, null, 0], [3, "Total_WL", "TEXT", 0, null, 0], [4, "Singles_WL", "TEXT", 0, null, 0], [5, "Doubles_WL", "TEXT", 0, null, 0], [6, "Team", "INT", 0, null, 0]], "primary_keys": ["Player_ID"], "foreign_keys": [[0, 0, "team", "Team", "Team_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Player_ID"]]], "check_constraints": []}}
CREATE TABLE country ( Country_id INT PRIMARY KEY, Country_name TEXT, Capital TEXT, Official_native_language TEXT, UNIQUE (Country_id) ); CREATE TABLE team ( Team_id INT PRIMARY KEY, Name TEXT, UNIQUE (Team_id) ); CREATE TABLE match_season ( Season REAL PRIMARY KEY, Player TEXT, Position TEXT, Country INT, Team INT, Draft_Pick_Number INT, Draft_Class TEXT, College TEXT, UNIQUE (Season), FOREIGN KEY (Team) REFERENCES team(Team_id), FOREIGN KEY (Country) REFERENCES country(Country_id) ); CREATE TABLE player ( Player_ID INT PRIMARY KEY, Player TEXT, Years_Played TEXT, Total_WL TEXT, Singles_WL TEXT, Doubles_WL TEXT, Team INT, UNIQUE (Player_ID), FOREIGN KEY (Team) REFERENCES team(Team_id) );
sakila_1
{"actor": {"columns": [[0, "actor_id", "SMALLINT UNSIGNED", 1, null, 1], [1, "first_name", "VARCHAR(45)", 1, null, 0], [2, "last_name", "VARCHAR(45)", 1, null, 0], [3, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["actor_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "actor_id"]]], "check_constraints": []}, "address": {"columns": [[0, "address_id", "SMALLINT UNSIGNED", 1, null, 1], [1, "address", "VARCHAR(50)", 1, null, 0], [2, "address2", "VARCHAR(50)", 0, "NULL", 0], [3, "district", "VARCHAR(20)", 1, null, 0], [4, "city_id", "SMALLINT UNSIGNED", 1, null, 0], [5, "postal_code", "VARCHAR(10)", 0, "NULL", 0], [6, "phone", "VARCHAR(20)", 1, null, 0], [7, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["address_id"], "foreign_keys": [[0, 0, "city", "city_id", "city_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "address_id"]]], "check_constraints": []}, "category": {"columns": [[0, "category_id", "TINYINT UNSIGNED", 1, null, 1], [1, "name", "VARCHAR(25)", 1, null, 0], [2, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["category_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "category_id"]]], "check_constraints": []}, "city": {"columns": [[0, "city_id", "SMALLINT UNSIGNED", 1, null, 1], [1, "city", "VARCHAR(50)", 1, null, 0], [2, "country_id", "SMALLINT UNSIGNED", 1, null, 0], [3, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["city_id"], "foreign_keys": [[0, 0, "country", "country_id", "country_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "city_id"]]], "check_constraints": []}, "country": {"columns": [[0, "country_id", "SMALLINT UNSIGNED", 1, null, 1], [1, "country", "VARCHAR(50)", 1, null, 0], [2, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["country_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "country_id"]]], "check_constraints": []}, "customer": {"columns": [[0, "customer_id", "SMALLINT UNSIGNED", 1, null, 1], [1, "store_id", "TINYINT UNSIGNED", 1, null, 0], [2, "first_name", "VARCHAR(45)", 1, null, 0], [3, "last_name", "VARCHAR(45)", 1, null, 0], [4, "email", "VARCHAR(50)", 0, "NULL", 0], [5, "address_id", "SMALLINT UNSIGNED", 1, null, 0], [6, "active", "BOOLEAN", 1, "TRUE", 0], [7, "create_date", "DATETIME", 1, null, 0], [8, "last_update", "TIMESTAMP", 0, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["customer_id"], "foreign_keys": [[0, 0, "store", "store_id", "store_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "address", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "customer_id"]]], "check_constraints": []}, "film": {"columns": [[0, "film_id", "SMALLINT UNSIGNED", 1, null, 1], [1, "title", "VARCHAR(255)", 1, null, 0], [2, "description", "TEXT", 0, "NULL", 0], [3, "release_year", "YEAR", 0, "NULL", 0], [4, "language_id", "TINYINT UNSIGNED", 1, null, 0], [5, "original_language_id", "TINYINT UNSIGNED", 0, "NULL", 0], [6, "rental_duration", "TINYINT UNSIGNED", 1, "3", 0], [7, "rental_rate", "DECIMAL(4,2)", 1, "4.99", 0], [8, "length", "SMALLINT UNSIGNED", 0, "NULL", 0], [9, "replacement_cost", "DECIMAL(5,2)", 1, "19.99", 0], [10, "rating", "", 0, "'G'", 0], [11, "special_features", "", 0, "NULL", 0], [12, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["film_id"], "foreign_keys": [[0, 0, "language", "original_language_id", "language_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "language", "language_id", "language_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "film_id"]]], "check_constraints": []}, "film_actor": {"columns": [[0, "actor_id", "SMALLINT UNSIGNED", 1, null, 1], [1, "film_id", "SMALLINT UNSIGNED", 1, null, 2], [2, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["actor_id", "film_id"], "foreign_keys": [[0, 0, "film", "film_id", "film_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "actor", "actor_id", "actor_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "actor_id"], [1, 1, "film_id"]]], "check_constraints": []}, "film_category": {"columns": [[0, "film_id", "SMALLINT UNSIGNED", 1, null, 1], [1, "category_id", "TINYINT UNSIGNED", 1, null, 2], [2, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["film_id", "category_id"], "foreign_keys": [[0, 0, "category", "category_id", "category_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "film", "film_id", "film_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "film_id"], [1, 1, "category_id"]]], "check_constraints": []}, "film_text": {"columns": [[0, "film_id", "SMALLINT", 1, null, 1], [1, "title", "VARCHAR(255)", 1, null, 0], [2, "description", "TEXT", 0, null, 0]], "primary_keys": ["film_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "film_id"]]], "check_constraints": []}, "inventory": {"columns": [[0, "inventory_id", "MEDIUMINT UNSIGNED", 1, null, 1], [1, "film_id", "SMALLINT UNSIGNED", 1, null, 0], [2, "store_id", "TINYINT UNSIGNED", 1, null, 0], [3, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["inventory_id"], "foreign_keys": [[0, 0, "film", "film_id", "film_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "store", "store_id", "store_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "inventory_id"]]], "check_constraints": []}, "language": {"columns": [[0, "language_id", "TINYINT UNSIGNED", 1, null, 1], [1, "name", "CHAR(20)", 1, null, 0], [2, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["language_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "language_id"]]], "check_constraints": []}, "payment": {"columns": [[0, "payment_id", "SMALLINT UNSIGNED", 1, null, 1], [1, "customer_id", "SMALLINT UNSIGNED", 1, null, 0], [2, "staff_id", "TINYINT UNSIGNED", 1, null, 0], [3, "rental_id", "INT", 0, "NULL", 0], [4, "amount", "DECIMAL(5,2)", 1, null, 0], [5, "payment_date", "DATETIME", 1, null, 0], [6, "last_update", "TIMESTAMP", 0, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["payment_id"], "foreign_keys": [[0, 0, "staff", "staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "customer", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "rental", "rental_id", "rental_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "payment_id"]]], "check_constraints": []}, "rental": {"columns": [[0, "rental_id", "INT", 1, null, 1], [1, "rental_date", "DATETIME", 1, null, 0], [2, "inventory_id", "MEDIUMINT UNSIGNED", 1, null, 0], [3, "customer_id", "SMALLINT UNSIGNED", 1, null, 0], [4, "return_date", "DATETIME", 0, "NULL", 0], [5, "staff_id", "TINYINT UNSIGNED", 1, null, 0], [6, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["rental_id"], "foreign_keys": [[0, 0, "customer", "customer_id", "customer_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "inventory", "inventory_id", "inventory_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "staff", "staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "rental_id"]]], "check_constraints": []}, "staff": {"columns": [[0, "staff_id", "TINYINT UNSIGNED", 1, null, 1], [1, "first_name", "VARCHAR(45)", 1, null, 0], [2, "last_name", "VARCHAR(45)", 1, null, 0], [3, "address_id", "SMALLINT UNSIGNED", 1, null, 0], [4, "picture", "BLOB", 0, "NULL", 0], [5, "email", "VARCHAR(50)", 0, "NULL", 0], [6, "store_id", "TINYINT UNSIGNED", 1, null, 0], [7, "active", "BOOLEAN", 1, "TRUE", 0], [8, "username", "VARCHAR(16)", 1, null, 0], [9, "password", "VARCHAR(40)", 0, "NULL", 0], [10, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["staff_id"], "foreign_keys": [[0, 0, "address", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "staff_id"]]], "check_constraints": []}, "store": {"columns": [[0, "store_id", "TINYINT UNSIGNED", 1, null, 1], [1, "manager_staff_id", "TINYINT UNSIGNED", 1, null, 0], [2, "address_id", "SMALLINT UNSIGNED", 1, null, 0], [3, "last_update", "TIMESTAMP", 1, "CURRENT_TIMESTAMP", 0]], "primary_keys": ["store_id"], "foreign_keys": [[0, 0, "address", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "staff", "manager_staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "store_id"]]], "check_constraints": []}}
CREATE TABLE actor ( actor_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (actor_id) ); CREATE TABLE address ( address_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, address VARCHAR(50) NOT NULL, address2 VARCHAR(50) DEFAULT NULL, district VARCHAR(20) NOT NULL, city_id SMALLINT UNSIGNED NOT NULL, postal_code VARCHAR(10) DEFAULT NULL, phone VARCHAR(20) NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (address_id), FOREIGN KEY (city_id) REFERENCES city(city_id) ); CREATE TABLE category ( category_id TINYINT UNSIGNED NOT NULL PRIMARY KEY, name VARCHAR(25) NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (category_id) ); CREATE TABLE city ( city_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, city VARCHAR(50) NOT NULL, country_id SMALLINT UNSIGNED NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (city_id), FOREIGN KEY (country_id) REFERENCES country(country_id) ); CREATE TABLE country ( country_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, country VARCHAR(50) NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (country_id) ); CREATE TABLE customer ( customer_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, store_id TINYINT UNSIGNED NOT NULL, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, email VARCHAR(50) DEFAULT NULL, address_id SMALLINT UNSIGNED NOT NULL, active BOOLEAN NOT NULL DEFAULT TRUE, create_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, UNIQUE (customer_id), FOREIGN KEY (store_id) REFERENCES store(store_id), FOREIGN KEY (address_id) REFERENCES address(address_id) ); CREATE TABLE film ( film_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, title VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, release_year YEAR DEFAULT NULL, language_id TINYINT UNSIGNED NOT NULL, original_language_id TINYINT UNSIGNED DEFAULT NULL, rental_duration TINYINT UNSIGNED NOT NULL DEFAULT 3, rental_rate DECIMAL(4,2) NOT NULL DEFAULT 4.99, length SMALLINT UNSIGNED DEFAULT NULL, replacement_cost DECIMAL(5,2) NOT NULL DEFAULT 19.99, rating DEFAULT 'G', special_features DEFAULT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (film_id), FOREIGN KEY (original_language_id) REFERENCES language(language_id), FOREIGN KEY (language_id) REFERENCES language(language_id) ); CREATE TABLE film_actor ( actor_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, film_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (actor_id, film_id), UNIQUE (actor_id, film_id), FOREIGN KEY (film_id) REFERENCES film(film_id), FOREIGN KEY (actor_id) REFERENCES actor(actor_id) ); CREATE TABLE film_category ( film_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, category_id TINYINT UNSIGNED NOT NULL PRIMARY KEY, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (film_id, category_id), UNIQUE (film_id, category_id), FOREIGN KEY (category_id) REFERENCES category(category_id), FOREIGN KEY (film_id) REFERENCES film(film_id) ); CREATE TABLE film_text ( film_id SMALLINT NOT NULL PRIMARY KEY, title VARCHAR(255) NOT NULL, description TEXT, UNIQUE (film_id) ); CREATE TABLE inventory ( inventory_id MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, film_id SMALLINT UNSIGNED NOT NULL, store_id TINYINT UNSIGNED NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (inventory_id), FOREIGN KEY (film_id) REFERENCES film(film_id), FOREIGN KEY (store_id) REFERENCES store(store_id) ); CREATE TABLE language ( language_id TINYINT UNSIGNED NOT NULL PRIMARY KEY, name CHAR(20) NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (language_id) ); CREATE TABLE payment ( payment_id SMALLINT UNSIGNED NOT NULL PRIMARY KEY, customer_id SMALLINT UNSIGNED NOT NULL, staff_id TINYINT UNSIGNED NOT NULL, rental_id INT DEFAULT NULL, amount DECIMAL(5,2) NOT NULL, payment_date DATETIME NOT NULL, last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP, UNIQUE (payment_id), FOREIGN KEY (staff_id) REFERENCES staff(staff_id), FOREIGN KEY (customer_id) REFERENCES customer(customer_id), FOREIGN KEY (rental_id) REFERENCES rental(rental_id) ); CREATE TABLE rental ( rental_id INT NOT NULL PRIMARY KEY, rental_date DATETIME NOT NULL, inventory_id MEDIUMINT UNSIGNED NOT NULL, customer_id SMALLINT UNSIGNED NOT NULL, return_date DATETIME DEFAULT NULL, staff_id TINYINT UNSIGNED NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (rental_id), FOREIGN KEY (customer_id) REFERENCES customer(customer_id), FOREIGN KEY (inventory_id) REFERENCES inventory(inventory_id), FOREIGN KEY (staff_id) REFERENCES staff(staff_id) ); CREATE TABLE staff ( staff_id TINYINT UNSIGNED NOT NULL PRIMARY KEY, first_name VARCHAR(45) NOT NULL, last_name VARCHAR(45) NOT NULL, address_id SMALLINT UNSIGNED NOT NULL, picture BLOB DEFAULT NULL, email VARCHAR(50) DEFAULT NULL, store_id TINYINT UNSIGNED NOT NULL, active BOOLEAN NOT NULL DEFAULT TRUE, username VARCHAR(16) NOT NULL, password VARCHAR(40) DEFAULT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (staff_id), FOREIGN KEY (address_id) REFERENCES address(address_id) ); CREATE TABLE store ( store_id TINYINT UNSIGNED NOT NULL PRIMARY KEY, manager_staff_id TINYINT UNSIGNED NOT NULL, address_id SMALLINT UNSIGNED NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (store_id), FOREIGN KEY (address_id) REFERENCES address(address_id), FOREIGN KEY (manager_staff_id) REFERENCES staff(staff_id) );
music_4
{"artist": {"columns": [[0, "Artist_ID", "INT", 0, null, 1], [1, "Artist", "TEXT", 0, null, 0], [2, "Age", "INT", 0, null, 0], [3, "Famous_Title", "TEXT", 0, null, 0], [4, "Famous_Release_date", "TEXT", 0, null, 0]], "primary_keys": ["Artist_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Artist_ID"]]], "check_constraints": []}, "volume": {"columns": [[0, "Volume_ID", "INT", 0, null, 1], [1, "Volume_Issue", "TEXT", 0, null, 0], [2, "Issue_Date", "TEXT", 0, null, 0], [3, "Weeks_on_Top", "REAL", 0, null, 0], [4, "Song", "TEXT", 0, null, 0], [5, "Artist_ID", "INT", 0, null, 0]], "primary_keys": ["Volume_ID"], "foreign_keys": [[0, 0, "artist", "Artist_ID", "Artist_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Volume_ID"]]], "check_constraints": []}, "music_festival": {"columns": [[0, "ID", "INT", 0, null, 1], [1, "Music_Festival", "TEXT", 0, null, 0], [2, "Date_of_ceremony", "TEXT", 0, null, 0], [3, "Category", "TEXT", 0, null, 0], [4, "Volume", "INT", 0, null, 0], [5, "Result", "TEXT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [[0, 0, "volume", "Volume", "Volume_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": []}}
CREATE TABLE artist ( Artist_ID INT PRIMARY KEY, Artist TEXT, Age INT, Famous_Title TEXT, Famous_Release_date TEXT, UNIQUE (Artist_ID) ); CREATE TABLE volume ( Volume_ID INT PRIMARY KEY, Volume_Issue TEXT, Issue_Date TEXT, Weeks_on_Top REAL, Song TEXT, Artist_ID INT, UNIQUE (Volume_ID), FOREIGN KEY (Artist_ID) REFERENCES artist(Artist_ID) ); CREATE TABLE music_festival ( ID INT PRIMARY KEY, Music_Festival TEXT, Date_of_ceremony TEXT, Category TEXT, Volume INT, Result TEXT, UNIQUE (ID), FOREIGN KEY (Volume) REFERENCES volume(Volume_ID) );
cinema
{"film": {"columns": [[0, "Film_ID", "INT", 0, null, 1], [1, "Rank_in_series", "INT", 0, null, 0], [2, "Number_in_season", "INT", 0, null, 0], [3, "Title", "TEXT", 0, null, 0], [4, "Directed_by", "TEXT", 0, null, 0], [5, "Original_air_date", "TEXT", 0, null, 0], [6, "Production_code", "TEXT", 0, null, 0]], "primary_keys": ["Film_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Film_ID"]]], "check_constraints": []}, "cinema": {"columns": [[0, "Cinema_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Openning_year", "INT", 0, null, 0], [3, "Capacity", "INT", 0, null, 0], [4, "Location", "TEXT", 0, null, 0]], "primary_keys": ["Cinema_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Cinema_ID"]]], "check_constraints": []}, "schedule": {"columns": [[0, "Cinema_ID", "INT", 0, null, 1], [1, "Film_ID", "INT", 0, null, 2], [2, "Date", "TEXT", 0, null, 0], [3, "Show_times_per_day", "INT", 0, null, 0], [4, "Price", "float", 0, null, 0]], "primary_keys": ["Cinema_ID", "Film_ID"], "foreign_keys": [[0, 0, "cinema", "Cinema_ID", "Cinema_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "film", "Film_ID", "Film_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Cinema_ID"], [1, 1, "Film_ID"]]], "check_constraints": []}}
CREATE TABLE film ( Film_ID INT PRIMARY KEY, Rank_in_series INT, Number_in_season INT, Title TEXT, Directed_by TEXT, Original_air_date TEXT, Production_code TEXT, UNIQUE (Film_ID) ); CREATE TABLE cinema ( Cinema_ID INT PRIMARY KEY, Name TEXT, Openning_year INT, Capacity INT, Location TEXT, UNIQUE (Cinema_ID) ); CREATE TABLE schedule ( Cinema_ID INT PRIMARY KEY, Film_ID INT PRIMARY KEY, Date TEXT, Show_times_per_day INT, Price float, PRIMARY KEY (Cinema_ID, Film_ID), UNIQUE (Cinema_ID, Film_ID), FOREIGN KEY (Cinema_ID) REFERENCES cinema(Cinema_ID), FOREIGN KEY (Film_ID) REFERENCES film(Film_ID) );
program_share
{"program": {"columns": [[0, "Program_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Origin", "TEXT", 0, null, 0], [3, "Launch", "REAL", 0, null, 0], [4, "Owner", "TEXT", 0, null, 0]], "primary_keys": ["Program_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Program_ID"]]], "check_constraints": []}, "channel": {"columns": [[0, "Channel_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Owner", "TEXT", 0, null, 0], [3, "Share_in_percent", "REAL", 0, null, 0], [4, "Rating_in_percent", "REAL", 0, null, 0]], "primary_keys": ["Channel_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Channel_ID"]]], "check_constraints": []}, "broadcast": {"columns": [[0, "Channel_ID", "INT", 0, null, 1], [1, "Program_ID", "INT", 0, null, 2], [2, "Time_of_day", "TEXT", 0, null, 0]], "primary_keys": ["Channel_ID", "Program_ID"], "foreign_keys": [[0, 0, "program", "Program_ID", "Program_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "channel", "Channel_ID", "Channel_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Channel_ID"], [1, 1, "Program_ID"]]], "check_constraints": []}, "broadcast_share": {"columns": [[0, "Channel_ID", "INT", 0, null, 1], [1, "Program_ID", "INT", 0, null, 2], [2, "Date", "TEXT", 0, null, 0], [3, "Share_in_percent", "REAL", 0, null, 0]], "primary_keys": ["Channel_ID", "Program_ID"], "foreign_keys": [[0, 0, "program", "Program_ID", "Program_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "channel", "Channel_ID", "Channel_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Channel_ID"], [1, 1, "Program_ID"]]], "check_constraints": []}}
CREATE TABLE program ( Program_ID INT PRIMARY KEY, Name TEXT, Origin TEXT, Launch REAL, Owner TEXT, UNIQUE (Program_ID) ); CREATE TABLE channel ( Channel_ID INT PRIMARY KEY, Name TEXT, Owner TEXT, Share_in_percent REAL, Rating_in_percent REAL, UNIQUE (Channel_ID) ); CREATE TABLE broadcast ( Channel_ID INT PRIMARY KEY, Program_ID INT PRIMARY KEY, Time_of_day TEXT, PRIMARY KEY (Channel_ID, Program_ID), UNIQUE (Channel_ID, Program_ID), FOREIGN KEY (Program_ID) REFERENCES program(Program_ID), FOREIGN KEY (Channel_ID) REFERENCES channel(Channel_ID) ); CREATE TABLE broadcast_share ( Channel_ID INT PRIMARY KEY, Program_ID INT PRIMARY KEY, Date TEXT, Share_in_percent REAL, PRIMARY KEY (Channel_ID, Program_ID), UNIQUE (Channel_ID, Program_ID), FOREIGN KEY (Program_ID) REFERENCES program(Program_ID), FOREIGN KEY (Channel_ID) REFERENCES channel(Channel_ID) );
world_1
{"city": {"columns": [[0, "ID", "INTEGER", 1, null, 1], [1, "Name", "char(35)", 1, "''", 0], [2, "CountryCode", "char(3)", 1, "''", 0], [3, "District", "char(20)", 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": []}, "sqlite_sequence": {"columns": [[0, "name", "", 0, null, 0], [1, "seq", "", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "country": {"columns": [[0, "Code", "char(3)", 1, "''", 1], [1, "Name", "char(52)", 1, "''", 0], [2, "Continent", "TEXT", 1, "'Asia'", 0], [3, "Region", "char(26)", 1, "''", 0], [4, "SurfaceArea", "float(10,2)", 1, "'0.00'", 0], [5, "IndepYear", "INTEGER", 0, "NULL", 0], [6, "Population", "INTEGER", 1, "'0'", 0], [7, "LifeExpectancy", "float(3,1)", 0, "NULL", 0], [8, "GNP", "float(10,2)", 0, "NULL", 0], [9, "GNPOld", "float(10,2)", 0, "NULL", 0], [10, "LocalName", "char(45)", 1, "''", 0], [11, "GovernmentForm", "char(45)", 1, "''", 0], [12, "HeadOfState", "char(60)", 0, "NULL", 0], [13, "Capital", "INTEGER", 0, "NULL", 0], [14, "Code2", "char(2)", 1, "''", 0]], "primary_keys": ["Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Code"]]], "check_constraints": []}, "countrylanguage": {"columns": [[0, "CountryCode", "char(3)", 1, "''", 1], [1, "Language", "char(30)", 1, "''", 2], [2, "IsOfficial", "TEXT", 1, "'F'", 0], [3, "Percentage", "float(4,1)", 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 city ( ID INTEGER NOT NULL PRIMARY KEY, Name char(35) NOT NULL DEFAULT '', CountryCode char(3) NOT NULL DEFAULT '', District char(20) NOT NULL DEFAULT '', Population INTEGER NOT NULL DEFAULT '0', FOREIGN KEY (CountryCode) REFERENCES country(Code) ); CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE country ( Code char(3) NOT NULL DEFAULT '' PRIMARY KEY, Name char(52) NOT NULL DEFAULT '', Continent TEXT NOT NULL DEFAULT 'Asia', Region char(26) NOT NULL DEFAULT '', SurfaceArea float(10,2) NOT NULL DEFAULT '0.00', IndepYear INTEGER DEFAULT NULL, Population INTEGER NOT NULL DEFAULT '0', LifeExpectancy float(3,1) DEFAULT NULL, GNP float(10,2) DEFAULT NULL, GNPOld float(10,2) DEFAULT NULL, LocalName char(45) NOT NULL DEFAULT '', GovernmentForm char(45) NOT NULL DEFAULT '', HeadOfState char(60) DEFAULT NULL, Capital INTEGER DEFAULT NULL, Code2 char(2) NOT NULL DEFAULT '', UNIQUE (Code) ); CREATE TABLE countrylanguage ( CountryCode char(3) NOT NULL DEFAULT '' PRIMARY KEY, Language char(30) NOT NULL DEFAULT '' PRIMARY KEY, IsOfficial TEXT NOT NULL DEFAULT 'F', Percentage float(4,1) NOT NULL DEFAULT '0.0', PRIMARY KEY (CountryCode, Language), UNIQUE (CountryCode, Language), FOREIGN KEY (CountryCode) REFERENCES country(Code) );
hr_1
{"regions": {"columns": [[0, "REGION_ID", "decimal(5,0)", 1, null, 1], [1, "REGION_NAME", "varchar(25)", 0, "NULL", 0]], "primary_keys": ["REGION_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "REGION_ID"]]], "check_constraints": []}, "countries": {"columns": [[0, "COUNTRY_ID", "varchar(2)", 1, null, 1], [1, "COUNTRY_NAME", "varchar(40)", 0, "NULL", 0], [2, "REGION_ID", "decimal(10,0)", 0, "NULL", 0]], "primary_keys": ["COUNTRY_ID"], "foreign_keys": [[0, 0, "regions", "REGION_ID", "REGION_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "COUNTRY_ID"]]], "check_constraints": []}, "departments": {"columns": [[0, "DEPARTMENT_ID", "decimal(4,0)", 1, "'0'", 1], [1, "DEPARTMENT_NAME", "varchar(30)", 1, null, 0], [2, "MANAGER_ID", "decimal(6,0)", 0, "NULL", 0], [3, "LOCATION_ID", "decimal(4,0)", 0, "NULL", 0]], "primary_keys": ["DEPARTMENT_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "DEPARTMENT_ID"]]], "check_constraints": []}, "jobs": {"columns": [[0, "JOB_ID", "varchar(10)", 1, "''", 1], [1, "JOB_TITLE", "varchar(35)", 1, null, 0], [2, "MIN_SALARY", "decimal(6,0)", 0, "NULL", 0], [3, "MAX_SALARY", "decimal(6,0)", 0, "NULL", 0]], "primary_keys": ["JOB_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "JOB_ID"]]], "check_constraints": []}, "employees": {"columns": [[0, "EMPLOYEE_ID", "decimal(6,0)", 1, "'0'", 1], [1, "FIRST_NAME", "varchar(20)", 0, "NULL", 0], [2, "LAST_NAME", "varchar(25)", 1, null, 0], [3, "EMAIL", "varchar(25)", 1, null, 0], [4, "PHONE_NUMBER", "varchar(20)", 0, "NULL", 0], [5, "HIRE_DATE", "date", 1, null, 0], [6, "JOB_ID", "varchar(10)", 1, null, 0], [7, "SALARY", "decimal(8,2)", 0, "NULL", 0], [8, "COMMISSION_PCT", "decimal(2,2)", 0, "NULL", 0], [9, "MANAGER_ID", "decimal(6,0)", 0, "NULL", 0], [10, "DEPARTMENT_ID", "decimal(4,0)", 0, "NULL", 0]], "primary_keys": ["EMPLOYEE_ID"], "foreign_keys": [[0, 0, "jobs", "JOB_ID", "JOB_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "departments", "DEPARTMENT_ID", "DEPARTMENT_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "EMPLOYEE_ID"]]], "check_constraints": []}, "job_history": {"columns": [[0, "EMPLOYEE_ID", "decimal(6,0)", 1, null, 1], [1, "START_DATE", "date", 1, null, 2], [2, "END_DATE", "date", 1, null, 0], [3, "JOB_ID", "varchar(10)", 1, null, 0], [4, "DEPARTMENT_ID", "decimal(4,0)", 0, "NULL", 0]], "primary_keys": ["EMPLOYEE_ID", "START_DATE"], "foreign_keys": [[0, 0, "jobs", "JOB_ID", "JOB_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "departments", "DEPARTMENT_ID", "DEPARTMENT_ID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "employees", "EMPLOYEE_ID", "EMPLOYEE_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "EMPLOYEE_ID"], [1, 1, "START_DATE"]]], "check_constraints": []}, "locations": {"columns": [[0, "LOCATION_ID", "decimal(4,0)", 1, "'0'", 1], [1, "STREET_ADDRESS", "varchar(40)", 0, "NULL", 0], [2, "POSTAL_CODE", "varchar(12)", 0, "NULL", 0], [3, "CITY", "varchar(30)", 1, null, 0], [4, "STATE_PROVINCE", "varchar(25)", 0, "NULL", 0], [5, "COUNTRY_ID", "varchar(2)", 0, "NULL", 0]], "primary_keys": ["LOCATION_ID"], "foreign_keys": [[0, 0, "countries", "COUNTRY_ID", "COUNTRY_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "LOCATION_ID"]]], "check_constraints": []}}
CREATE TABLE regions ( REGION_ID decimal(5,0) NOT NULL PRIMARY KEY, REGION_NAME varchar(25) DEFAULT NULL, UNIQUE (REGION_ID) ); CREATE TABLE countries ( COUNTRY_ID varchar(2) NOT NULL PRIMARY KEY, COUNTRY_NAME varchar(40) DEFAULT NULL, REGION_ID decimal(10,0) DEFAULT NULL, UNIQUE (COUNTRY_ID), FOREIGN KEY (REGION_ID) REFERENCES regions(REGION_ID) ); CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0) NOT NULL DEFAULT '0' PRIMARY KEY, DEPARTMENT_NAME varchar(30) NOT NULL, MANAGER_ID decimal(6,0) DEFAULT NULL, LOCATION_ID decimal(4,0) DEFAULT NULL, UNIQUE (DEPARTMENT_ID) ); CREATE TABLE jobs ( JOB_ID varchar(10) NOT NULL DEFAULT '' PRIMARY KEY, JOB_TITLE varchar(35) NOT NULL, MIN_SALARY decimal(6,0) DEFAULT NULL, MAX_SALARY decimal(6,0) DEFAULT NULL, UNIQUE (JOB_ID) ); CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0) NOT NULL DEFAULT '0' PRIMARY KEY, FIRST_NAME varchar(20) DEFAULT NULL, LAST_NAME varchar(25) NOT NULL, EMAIL varchar(25) NOT NULL, PHONE_NUMBER varchar(20) DEFAULT NULL, HIRE_DATE date NOT NULL, JOB_ID varchar(10) NOT NULL, SALARY decimal(8,2) DEFAULT NULL, COMMISSION_PCT decimal(2,2) DEFAULT NULL, MANAGER_ID decimal(6,0) DEFAULT NULL, DEPARTMENT_ID decimal(4,0) DEFAULT NULL, UNIQUE (EMPLOYEE_ID), FOREIGN KEY (JOB_ID) REFERENCES jobs(JOB_ID), FOREIGN KEY (DEPARTMENT_ID) REFERENCES departments(DEPARTMENT_ID) ); CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0) NOT NULL PRIMARY KEY, START_DATE date NOT NULL PRIMARY KEY, END_DATE date NOT NULL, JOB_ID varchar(10) NOT NULL, DEPARTMENT_ID decimal(4,0) DEFAULT NULL, PRIMARY KEY (EMPLOYEE_ID, START_DATE), UNIQUE (EMPLOYEE_ID, START_DATE), FOREIGN KEY (JOB_ID) REFERENCES jobs(JOB_ID), FOREIGN KEY (DEPARTMENT_ID) REFERENCES departments(DEPARTMENT_ID), FOREIGN KEY (EMPLOYEE_ID) REFERENCES employees(EMPLOYEE_ID) ); CREATE TABLE locations ( LOCATION_ID decimal(4,0) NOT NULL DEFAULT '0' PRIMARY KEY, STREET_ADDRESS varchar(40) DEFAULT NULL, POSTAL_CODE varchar(12) DEFAULT NULL, CITY varchar(30) NOT NULL, STATE_PROVINCE varchar(25) DEFAULT NULL, COUNTRY_ID varchar(2) DEFAULT NULL, UNIQUE (LOCATION_ID), FOREIGN KEY (COUNTRY_ID) REFERENCES countries(COUNTRY_ID) );
e_learning
{"Course_Authors_and_Tutors": {"columns": [[0, "author_id", "INTEGER", 0, null, 1], [1, "author_tutor_ATB", "VARCHAR(3)", 0, null, 0], [2, "login_name", "VARCHAR(40)", 0, null, 0], [3, "password", "VARCHAR(40)", 0, null, 0], [4, "personal_name", "VARCHAR(80)", 0, null, 0], [5, "middle_name", "VARCHAR(80)", 0, null, 0], [6, "family_name", "VARCHAR(80)", 0, null, 0], [7, "gender_mf", "VARCHAR(1)", 0, null, 0], [8, "address_line_1", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["author_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Students": {"columns": [[0, "student_id", "INTEGER", 0, null, 1], [1, "date_of_registration", "DATETIME", 0, null, 0], [2, "date_of_latest_logon", "DATETIME", 0, null, 0], [3, "login_name", "VARCHAR(40)", 0, null, 0], [4, "password", "VARCHAR(10)", 0, null, 0], [5, "personal_name", "VARCHAR(40)", 0, null, 0], [6, "middle_name", "VARCHAR(40)", 0, null, 0], [7, "family_name", "VARCHAR(40)", 0, null, 0]], "primary_keys": ["student_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Subjects": {"columns": [[0, "subject_id", "INTEGER", 0, null, 1], [1, "subject_name", "VARCHAR(120)", 0, null, 0]], "primary_keys": ["subject_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Courses": {"columns": [[0, "course_id", "INTEGER", 0, null, 1], [1, "author_id", "INTEGER", 1, null, 0], [2, "subject_id", "INTEGER", 1, null, 0], [3, "course_name", "VARCHAR(120)", 0, null, 0], [4, "course_description", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["course_id"], "foreign_keys": [[0, 0, "Subjects", "subject_id", "subject_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Course_Authors_and_Tutors", "author_id", "author_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Student_Course_Enrolment": {"columns": [[0, "registration_id", "INTEGER", 0, null, 1], [1, "student_id", "INTEGER", 1, null, 0], [2, "course_id", "INTEGER", 1, null, 0], [3, "date_of_enrolment", "DATETIME", 1, null, 0], [4, "date_of_completion", "DATETIME", 1, null, 0]], "primary_keys": ["registration_id"], "foreign_keys": [[0, 0, "Students", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Courses", "course_id", "course_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Student_Tests_Taken": {"columns": [[0, "registration_id", "INTEGER", 1, null, 0], [1, "date_test_taken", "DATETIME", 1, null, 0], [2, "test_result", "VARCHAR(255)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Student_Course_Enrolment", "registration_id", "registration_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER PRIMARY KEY, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ); CREATE TABLE Students ( student_id INTEGER PRIMARY KEY, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ); CREATE TABLE Subjects ( subject_id INTEGER PRIMARY KEY, subject_name VARCHAR(120) ); CREATE TABLE Courses ( course_id INTEGER PRIMARY KEY, author_id INTEGER NOT NULL, subject_id INTEGER NOT NULL, course_name VARCHAR(120), course_description VARCHAR(255), FOREIGN KEY (subject_id) REFERENCES Subjects(subject_id), FOREIGN KEY (author_id) REFERENCES Course_Authors_and_Tutors(author_id) ); CREATE TABLE Student_Course_Enrolment ( registration_id INTEGER PRIMARY KEY, student_id INTEGER NOT NULL, course_id INTEGER NOT NULL, date_of_enrolment DATETIME NOT NULL, date_of_completion DATETIME NOT NULL, FOREIGN KEY (student_id) REFERENCES Students(student_id), FOREIGN KEY (course_id) REFERENCES Courses(course_id) ); CREATE TABLE Student_Tests_Taken ( registration_id INTEGER NOT NULL, date_test_taken DATETIME NOT NULL, test_result VARCHAR(255), FOREIGN KEY (registration_id) REFERENCES Student_Course_Enrolment(registration_id) );
icfp_1
{"Inst": {"columns": [[0, "instID", "INTEGER", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "country", "TEXT", 0, null, 0]], "primary_keys": ["instID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Authors": {"columns": [[0, "authID", "INTEGER", 0, null, 1], [1, "lname", "TEXT", 0, null, 0], [2, "fname", "TEXT", 0, null, 0]], "primary_keys": ["authID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Papers": {"columns": [[0, "paperID", "INTEGER", 0, null, 1], [1, "title", "TEXT", 0, null, 0]], "primary_keys": ["paperID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Authorship": {"columns": [[0, "authID", "INTEGER", 0, null, 1], [1, "instID", "INTEGER", 0, null, 2], [2, "paperID", "INTEGER", 0, null, 3], [3, "authOrder", "INTEGER", 0, null, 0]], "primary_keys": ["authID", "instID", "paperID"], "foreign_keys": [[0, 0, "Papers", "paperID", "paperID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Inst", "instID", "instID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Authors", "authID", "authID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "authID"], [1, 1, "instID"], [2, 2, "paperID"]]], "check_constraints": []}}
CREATE TABLE Inst ( instID INTEGER PRIMARY KEY, name TEXT, country TEXT ); CREATE TABLE Authors ( authID INTEGER PRIMARY KEY, lname TEXT, fname TEXT ); CREATE TABLE Papers ( paperID INTEGER PRIMARY KEY, title TEXT ); CREATE TABLE Authorship ( authID INTEGER PRIMARY KEY, instID INTEGER PRIMARY KEY, paperID INTEGER PRIMARY KEY, authOrder INTEGER, PRIMARY KEY (authID, instID, paperID), UNIQUE (authID, instID, paperID), FOREIGN KEY (paperID) REFERENCES Papers(paperID), FOREIGN KEY (instID) REFERENCES Inst(instID), FOREIGN KEY (authID) REFERENCES Authors(authID) );
customers_card_transactions
{"Accounts": {"columns": [[0, "account_id", "INTEGER", 0, null, 1], [1, "customer_id", "INTEGER", 1, null, 0], [2, "account_name", "VARCHAR(50)", 0, null, 0], [3, "other_account_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["account_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers": {"columns": [[0, "customer_id", "INTEGER", 0, null, 1], [1, "customer_first_name", "VARCHAR(20)", 0, null, 0], [2, "customer_last_name", "VARCHAR(20)", 0, null, 0], [3, "customer_address", "VARCHAR(255)", 0, null, 0], [4, "customer_phone", "VARCHAR(255)", 0, null, 0], [5, "customer_email", "VARCHAR(255)", 0, null, 0], [6, "other_customer_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["customer_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Customers_Cards": {"columns": [[0, "card_id", "INTEGER", 0, null, 1], [1, "customer_id", "INTEGER", 1, null, 0], [2, "card_type_code", "VARCHAR(15)", 1, null, 0], [3, "card_number", "VARCHAR(80)", 0, null, 0], [4, "date_valid_from", "DATETIME", 0, null, 0], [5, "date_valid_to", "DATETIME", 0, null, 0], [6, "other_card_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["card_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Financial_Transactions": {"columns": [[0, "transaction_id", "INTEGER", 1, null, 0], [1, "previous_transaction_id", "INTEGER", 0, null, 0], [2, "account_id", "INTEGER", 1, null, 0], [3, "card_id", "INTEGER", 1, null, 0], [4, "transaction_type", "VARCHAR(15)", 1, null, 0], [5, "transaction_date", "DATETIME", 0, null, 0], [6, "transaction_amount", "DOUBLE", 0, null, 0], [7, "transaction_comment", "VARCHAR(255)", 0, null, 0], [8, "other_transaction_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Accounts", "account_id", "account_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Customers_Cards", "card_id", "card_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Accounts ( account_id INTEGER PRIMARY KEY, customer_id INTEGER NOT NULL, account_name VARCHAR(50), other_account_details VARCHAR(255) ); CREATE TABLE Customers ( customer_id INTEGER PRIMARY KEY, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ); CREATE TABLE Customers_Cards ( card_id INTEGER PRIMARY KEY, customer_id INTEGER NOT NULL, card_type_code VARCHAR(15) NOT NULL, card_number VARCHAR(80), date_valid_from DATETIME, date_valid_to DATETIME, other_card_details VARCHAR(255) ); CREATE TABLE Financial_Transactions ( transaction_id INTEGER NOT NULL, previous_transaction_id INTEGER, account_id INTEGER NOT NULL, card_id INTEGER NOT NULL, transaction_type VARCHAR(15) NOT NULL, transaction_date DATETIME, transaction_amount DOUBLE, transaction_comment VARCHAR(255), other_transaction_details VARCHAR(255), FOREIGN KEY (account_id) REFERENCES Accounts(account_id), FOREIGN KEY (card_id) REFERENCES Customers_Cards(card_id) );
behavior_monitoring
{"Ref_Address_Types": {"columns": [[0, "address_type_code", "VARCHAR(15)", 0, null, 1], [1, "address_type_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["address_type_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "address_type_code"]]], "check_constraints": []}, "Ref_Detention_Type": {"columns": [[0, "detention_type_code", "VARCHAR(10)", 0, null, 1], [1, "detention_type_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["detention_type_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "detention_type_code"]]], "check_constraints": []}, "Ref_Incident_Type": {"columns": [[0, "incident_type_code", "VARCHAR(10)", 0, null, 1], [1, "incident_type_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["incident_type_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "incident_type_code"]]], "check_constraints": []}, "Addresses": {"columns": [[0, "address_id", "INTEGER", 0, null, 1], [1, "line_1", "VARCHAR(120)", 0, null, 0], [2, "line_2", "VARCHAR(120)", 0, null, 0], [3, "line_3", "VARCHAR(120)", 0, null, 0], [4, "city", "VARCHAR(80)", 0, null, 0], [5, "zip_postcode", "VARCHAR(20)", 0, null, 0], [6, "state_province_county", "VARCHAR(50)", 0, null, 0], [7, "country", "VARCHAR(50)", 0, null, 0], [8, "other_address_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["address_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Students": {"columns": [[0, "student_id", "INTEGER", 0, null, 1], [1, "address_id", "INTEGER", 1, null, 0], [2, "first_name", "VARCHAR(80)", 0, null, 0], [3, "middle_name", "VARCHAR(40)", 0, null, 0], [4, "last_name", "VARCHAR(40)", 0, null, 0], [5, "cell_mobile_number", "VARCHAR(40)", 0, null, 0], [6, "email_address", "VARCHAR(40)", 0, null, 0], [7, "date_first_rental", "DATETIME", 0, null, 0], [8, "date_left_university", "DATETIME", 0, null, 0], [9, "other_student_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["student_id"], "foreign_keys": [[0, 0, "Addresses", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Teachers": {"columns": [[0, "teacher_id", "INTEGER", 0, null, 1], [1, "address_id", "INTEGER", 1, null, 0], [2, "first_name", "VARCHAR(80)", 0, null, 0], [3, "middle_name", "VARCHAR(80)", 0, null, 0], [4, "last_name", "VARCHAR(80)", 0, null, 0], [5, "gender", "VARCHAR(1)", 0, null, 0], [6, "cell_mobile_number", "VARCHAR(40)", 0, null, 0], [7, "email_address", "VARCHAR(40)", 0, null, 0], [8, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["teacher_id"], "foreign_keys": [[0, 0, "Addresses", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Assessment_Notes": {"columns": [[0, "notes_id", "INTEGER", 1, null, 0], [1, "student_id", "INTEGER", 0, null, 0], [2, "teacher_id", "INTEGER", 1, null, 0], [3, "date_of_notes", "DATETIME", 0, null, 0], [4, "text_of_notes", "VARCHAR(255)", 0, null, 0], [5, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Teachers", "teacher_id", "teacher_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Students", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Behavior_Incident": {"columns": [[0, "incident_id", "INTEGER", 0, null, 1], [1, "incident_type_code", "VARCHAR(10)", 1, null, 0], [2, "student_id", "INTEGER", 1, null, 0], [3, "date_incident_start", "DATETIME", 0, null, 0], [4, "date_incident_end", "DATETIME", 0, null, 0], [5, "incident_summary", "VARCHAR(255)", 0, null, 0], [6, "recommendations", "VARCHAR(255)", 0, null, 0], [7, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["incident_id"], "foreign_keys": [[0, 0, "Students", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ref_Incident_Type", "incident_type_code", "incident_type_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Detention": {"columns": [[0, "detention_id", "INTEGER", 0, null, 1], [1, "detention_type_code", "VARCHAR(10)", 1, null, 0], [2, "teacher_id", "INTEGER", 0, null, 0], [3, "datetime_detention_start", "DATETIME", 0, null, 0], [4, "datetime_detention_end", "DATETIME", 0, null, 0], [5, "detention_summary", "VARCHAR(255)", 0, null, 0], [6, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["detention_id"], "foreign_keys": [[0, 0, "Teachers", "teacher_id", "teacher_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ref_Detention_Type", "detention_type_code", "detention_type_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Student_Addresses": {"columns": [[0, "student_id", "INTEGER", 1, null, 0], [1, "address_id", "INTEGER", 1, null, 0], [2, "date_address_from", "DATETIME", 1, null, 0], [3, "date_address_to", "DATETIME", 0, null, 0], [4, "monthly_rental", "DECIMAL(19,4)", 0, null, 0], [5, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Students", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Addresses", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Students_in_Detention": {"columns": [[0, "student_id", "INTEGER", 1, null, 0], [1, "detention_id", "INTEGER", 1, null, 0], [2, "incident_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Students", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Detention", "detention_id", "detention_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Behavior_Incident", "incident_id", "incident_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Ref_Address_Types ( address_type_code VARCHAR(15) PRIMARY KEY, address_type_description VARCHAR(80), UNIQUE (address_type_code) ); CREATE TABLE Ref_Detention_Type ( detention_type_code VARCHAR(10) PRIMARY KEY, detention_type_description VARCHAR(80), UNIQUE (detention_type_code) ); CREATE TABLE Ref_Incident_Type ( incident_type_code VARCHAR(10) PRIMARY KEY, incident_type_description VARCHAR(80), UNIQUE (incident_type_code) ); CREATE TABLE Addresses ( address_id INTEGER PRIMARY KEY, line_1 VARCHAR(120), line_2 VARCHAR(120), line_3 VARCHAR(120), city VARCHAR(80), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50), other_address_details VARCHAR(255) ); CREATE TABLE Students ( student_id INTEGER PRIMARY KEY, address_id INTEGER NOT NULL, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), date_first_rental DATETIME, date_left_university DATETIME, other_student_details VARCHAR(255), FOREIGN KEY (address_id) REFERENCES Addresses(address_id) ); CREATE TABLE Teachers ( teacher_id INTEGER PRIMARY KEY, address_id INTEGER NOT NULL, first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), gender VARCHAR(1), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), other_details VARCHAR(255), FOREIGN KEY (address_id) REFERENCES Addresses(address_id) ); CREATE TABLE Assessment_Notes ( notes_id INTEGER NOT NULL, student_id INTEGER, teacher_id INTEGER NOT NULL, date_of_notes DATETIME, text_of_notes VARCHAR(255), other_details VARCHAR(255), FOREIGN KEY (teacher_id) REFERENCES Teachers(teacher_id), FOREIGN KEY (student_id) REFERENCES Students(student_id) ); CREATE TABLE Behavior_Incident ( incident_id INTEGER PRIMARY KEY, incident_type_code VARCHAR(10) NOT NULL, student_id INTEGER NOT NULL, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255), FOREIGN KEY (student_id) REFERENCES Students(student_id), FOREIGN KEY (incident_type_code) REFERENCES Ref_Incident_Type(incident_type_code) ); CREATE TABLE Detention ( detention_id INTEGER PRIMARY KEY, detention_type_code VARCHAR(10) NOT NULL, teacher_id INTEGER, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary VARCHAR(255), other_details VARCHAR(255), FOREIGN KEY (teacher_id) REFERENCES Teachers(teacher_id), FOREIGN KEY (detention_type_code) REFERENCES Ref_Detention_Type(detention_type_code) ); CREATE TABLE Student_Addresses ( student_id INTEGER NOT NULL, address_id INTEGER NOT NULL, date_address_from DATETIME NOT NULL, date_address_to DATETIME, monthly_rental DECIMAL(19,4), other_details VARCHAR(255), FOREIGN KEY (student_id) REFERENCES Students(student_id), FOREIGN KEY (address_id) REFERENCES Addresses(address_id) ); CREATE TABLE Students_in_Detention ( student_id INTEGER NOT NULL, detention_id INTEGER NOT NULL, incident_id INTEGER NOT NULL, FOREIGN KEY (student_id) REFERENCES Students(student_id), FOREIGN KEY (detention_id) REFERENCES Detention(detention_id), FOREIGN KEY (incident_id) REFERENCES Behavior_Incident(incident_id) );
protein_institute
{"building": {"columns": [[0, "building_id", "TEXT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Street_address", "TEXT", 0, null, 0], [3, "Years_as_tallest", "TEXT", 0, null, 0], [4, "Height_feet", "INT", 0, null, 0], [5, "Floors", "INT", 0, null, 0]], "primary_keys": ["building_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "building_id"]]], "check_constraints": []}, "Institution": {"columns": [[0, "Institution_id", "TEXT", 0, null, 1], [1, "Institution", "TEXT", 0, null, 0], [2, "Location", "TEXT", 0, null, 0], [3, "Founded", "REAL", 0, null, 0], [4, "Type", "TEXT", 0, null, 0], [5, "Enrollment", "INT", 0, null, 0], [6, "Team", "TEXT", 0, null, 0], [7, "Primary_Conference", "TEXT", 0, null, 0], [8, "building_id", "TEXT", 0, null, 0]], "primary_keys": ["Institution_id"], "foreign_keys": [[0, 0, "building", "building_id", "building_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Institution_id"]]], "check_constraints": []}, "protein": {"columns": [[0, "common_name", "TEXT", 0, null, 1], [1, "protein_name", "TEXT", 0, null, 0], [2, "divergence_from_human_lineage", "REAL", 0, null, 0], [3, "accession_number", "TEXT", 0, null, 0], [4, "sequence_length", "REAL", 0, null, 0], [5, "sequence_identity_to_human_protein", "TEXT", 0, null, 0], [6, "Institution_id", "TEXT", 0, null, 0]], "primary_keys": ["common_name"], "foreign_keys": [[0, 0, "Institution", "Institution_id", "Institution_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "common_name"]]], "check_constraints": []}}
CREATE TABLE building ( building_id TEXT PRIMARY KEY, Name TEXT, Street_address TEXT, Years_as_tallest TEXT, Height_feet INT, Floors INT, UNIQUE (building_id) ); CREATE TABLE Institution ( Institution_id TEXT PRIMARY KEY, Institution TEXT, Location TEXT, Founded REAL, Type TEXT, Enrollment INT, Team TEXT, Primary_Conference TEXT, building_id TEXT, UNIQUE (Institution_id), FOREIGN KEY (building_id) REFERENCES building(building_id) ); CREATE TABLE protein ( common_name TEXT PRIMARY KEY, protein_name TEXT, divergence_from_human_lineage REAL, accession_number TEXT, sequence_length REAL, sequence_identity_to_human_protein TEXT, Institution_id TEXT, UNIQUE (common_name), FOREIGN KEY (Institution_id) REFERENCES Institution(Institution_id) );
e_government
{"Addresses": {"columns": [[0, "address_id", "INTEGER", 0, null, 1], [1, "line_1_number_building", "VARCHAR(80)", 0, null, 0], [2, "town_city", "VARCHAR(50)", 0, null, 0], [3, "zip_postcode", "VARCHAR(20)", 0, null, 0], [4, "state_province_county", "VARCHAR(50)", 0, null, 0], [5, "country", "VARCHAR(50)", 0, null, 0]], "primary_keys": ["address_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Services": {"columns": [[0, "service_id", "INTEGER", 0, null, 1], [1, "service_type_code", "VARCHAR(15)", 1, null, 0], [2, "service_name", "VARCHAR(80)", 0, null, 0], [3, "service_descriptio", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["service_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Forms": {"columns": [[0, "form_id", "INTEGER", 0, null, 1], [1, "form_type_code", "VARCHAR(15)", 1, null, 0], [2, "service_id", "INTEGER", 0, null, 0], [3, "form_number", "VARCHAR(50)", 0, null, 0], [4, "form_name", "VARCHAR(80)", 0, null, 0], [5, "form_description", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["form_id"], "foreign_keys": [[0, 0, "Services", "service_id", "service_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Individuals": {"columns": [[0, "individual_id", "INTEGER", 0, null, 1], [1, "individual_first_name", "VARCHAR(80)", 0, null, 0], [2, "individual_middle_name", "VARCHAR(80)", 0, null, 0], [3, "inidividual_phone", "VARCHAR(80)", 0, null, 0], [4, "individual_email", "VARCHAR(80)", 0, null, 0], [5, "individual_address", "VARCHAR(255)", 0, null, 0], [6, "individual_last_name", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["individual_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Organizations": {"columns": [[0, "organization_id", "INTEGER", 0, null, 1], [1, "date_formed", "DATETIME", 0, null, 0], [2, "organization_name", "VARCHAR(255)", 0, null, 0], [3, "uk_vat_number", "VARCHAR(20)", 0, null, 0]], "primary_keys": ["organization_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Parties": {"columns": [[0, "party_id", "INTEGER", 0, null, 1], [1, "payment_method_code", "VARCHAR(15)", 1, null, 0], [2, "party_phone", "VARCHAR(80)", 0, null, 0], [3, "party_email", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["party_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Organization_Contact_Individuals": {"columns": [[0, "individual_id", "INTEGER", 1, null, 1], [1, "organization_id", "INTEGER", 1, null, 2], [2, "date_contact_from", "DATETIME", 1, null, 0], [3, "date_contact_to", "DATETIME", 0, null, 0]], "primary_keys": ["individual_id", "organization_id"], "foreign_keys": [[0, 0, "Individuals", "individual_id", "individual_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Organizations", "organization_id", "organization_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "individual_id"], [1, 1, "organization_id"]]], "check_constraints": []}, "Party_Addresses": {"columns": [[0, "party_id", "INTEGER", 1, null, 1], [1, "address_id", "INTEGER", 1, null, 2], [2, "date_address_from", "DATETIME", 1, null, 0], [3, "address_type_code", "VARCHAR(15)", 1, null, 0], [4, "date_address_to", "DATETIME", 0, null, 0]], "primary_keys": ["party_id", "address_id"], "foreign_keys": [[0, 0, "Parties", "party_id", "party_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Addresses", "address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "party_id"], [1, 1, "address_id"]]], "check_constraints": []}, "Party_Forms": {"columns": [[0, "party_id", "INTEGER", 1, null, 1], [1, "form_id", "INTEGER", 1, null, 2], [2, "date_completion_started", "DATETIME", 1, null, 0], [3, "form_status_code", "VARCHAR(15)", 1, null, 0], [4, "date_fully_completed", "DATETIME", 0, null, 0]], "primary_keys": ["party_id", "form_id"], "foreign_keys": [[0, 0, "Forms", "form_id", "form_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Parties", "party_id", "party_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "party_id"], [1, 1, "form_id"]]], "check_constraints": []}, "Party_Services": {"columns": [[0, "booking_id", "INTEGER", 1, null, 0], [1, "customer_id", "INTEGER", 1, null, 0], [2, "service_id", "INTEGER", 1, null, 0], [3, "service_datetime", "DATETIME", 1, null, 0], [4, "booking_made_date", "DATETIME", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Parties", "customer_id", "party_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Services", "service_id", "service_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Addresses ( address_id INTEGER PRIMARY KEY, line_1_number_building VARCHAR(80), town_city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ); CREATE TABLE Services ( service_id INTEGER PRIMARY KEY, service_type_code VARCHAR(15) NOT NULL, service_name VARCHAR(80), service_descriptio VARCHAR(255) ); CREATE TABLE Forms ( form_id INTEGER PRIMARY KEY, form_type_code VARCHAR(15) NOT NULL, service_id INTEGER, form_number VARCHAR(50), form_name VARCHAR(80), form_description VARCHAR(255), FOREIGN KEY (service_id) REFERENCES Services(service_id) ); CREATE TABLE Individuals ( individual_id INTEGER PRIMARY KEY, individual_first_name VARCHAR(80), individual_middle_name VARCHAR(80), inidividual_phone VARCHAR(80), individual_email VARCHAR(80), individual_address VARCHAR(255), individual_last_name VARCHAR(80) ); CREATE TABLE Organizations ( organization_id INTEGER PRIMARY KEY, date_formed DATETIME, organization_name VARCHAR(255), uk_vat_number VARCHAR(20) ); CREATE TABLE Parties ( party_id INTEGER PRIMARY KEY, payment_method_code VARCHAR(15) NOT NULL, party_phone VARCHAR(80), party_email VARCHAR(80) ); CREATE TABLE Organization_Contact_Individuals ( individual_id INTEGER NOT NULL PRIMARY KEY, organization_id INTEGER NOT NULL PRIMARY KEY, date_contact_from DATETIME NOT NULL, date_contact_to DATETIME, PRIMARY KEY (individual_id, organization_id), UNIQUE (individual_id, organization_id), FOREIGN KEY (individual_id) REFERENCES Individuals(individual_id), FOREIGN KEY (organization_id) REFERENCES Organizations(organization_id) ); CREATE TABLE Party_Addresses ( party_id INTEGER NOT NULL PRIMARY KEY, address_id INTEGER NOT NULL PRIMARY KEY, date_address_from DATETIME NOT NULL, address_type_code VARCHAR(15) NOT NULL, date_address_to DATETIME, PRIMARY KEY (party_id, address_id), UNIQUE (party_id, address_id), FOREIGN KEY (party_id) REFERENCES Parties(party_id), FOREIGN KEY (address_id) REFERENCES Addresses(address_id) ); CREATE TABLE Party_Forms ( party_id INTEGER NOT NULL PRIMARY KEY, form_id INTEGER NOT NULL PRIMARY KEY, date_completion_started DATETIME NOT NULL, form_status_code VARCHAR(15) NOT NULL, date_fully_completed DATETIME, PRIMARY KEY (party_id, form_id), UNIQUE (party_id, form_id), FOREIGN KEY (form_id) REFERENCES Forms(form_id), FOREIGN KEY (party_id) REFERENCES Parties(party_id) ); CREATE TABLE Party_Services ( booking_id INTEGER NOT NULL, customer_id INTEGER NOT NULL, service_id INTEGER NOT NULL, service_datetime DATETIME NOT NULL, booking_made_date DATETIME, FOREIGN KEY (customer_id) REFERENCES Parties(party_id), FOREIGN KEY (service_id) REFERENCES Services(service_id) );
storm_record
{"storm": {"columns": [[0, "Storm_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Dates_active", "TEXT", 0, null, 0], [3, "Max_speed", "INT", 0, null, 0], [4, "Damage_millions_USD", "REAL", 0, null, 0], [5, "Number_Deaths", "INT", 0, null, 0]], "primary_keys": ["Storm_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Storm_ID"]]], "check_constraints": []}, "region": {"columns": [[0, "Region_id", "INT", 0, null, 1], [1, "Region_code", "TEXT", 0, null, 0], [2, "Region_name", "TEXT", 0, null, 0]], "primary_keys": ["Region_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Region_id"]]], "check_constraints": []}, "affected_region": {"columns": [[0, "Region_id", "INT", 0, null, 1], [1, "Storm_ID", "INT", 0, null, 2], [2, "Number_city_affected", "REAL", 0, null, 0]], "primary_keys": ["Region_id", "Storm_ID"], "foreign_keys": [[0, 0, "storm", "Storm_ID", "Storm_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "region", "Region_id", "Region_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Region_id"], [1, 1, "Storm_ID"]]], "check_constraints": []}}
CREATE TABLE storm ( Storm_ID INT PRIMARY KEY, Name TEXT, Dates_active TEXT, Max_speed INT, Damage_millions_USD REAL, Number_Deaths INT, UNIQUE (Storm_ID) ); CREATE TABLE region ( Region_id INT PRIMARY KEY, Region_code TEXT, Region_name TEXT, UNIQUE (Region_id) ); CREATE TABLE affected_region ( Region_id INT PRIMARY KEY, Storm_ID INT PRIMARY KEY, Number_city_affected REAL, PRIMARY KEY (Region_id, Storm_ID), UNIQUE (Region_id, Storm_ID), FOREIGN KEY (Storm_ID) REFERENCES storm(Storm_ID), FOREIGN KEY (Region_id) REFERENCES region(Region_id) );
wedding
{"people": {"columns": [[0, "People_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Country", "TEXT", 0, null, 0], [3, "Is_Male", "TEXT", 0, null, 0], [4, "Age", "INT", 0, null, 0]], "primary_keys": ["People_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "People_ID"]]], "check_constraints": []}, "church": {"columns": [[0, "Church_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Organized_by", "TEXT", 0, null, 0], [3, "Open_Date", "INT", 0, null, 0], [4, "Continuation_of", "TEXT", 0, null, 0]], "primary_keys": ["Church_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Church_ID"]]], "check_constraints": []}, "wedding": {"columns": [[0, "Church_ID", "INT", 0, null, 1], [1, "Male_ID", "INT", 0, null, 2], [2, "Female_ID", "INT", 0, null, 3], [3, "Year", "INT", 0, null, 0]], "primary_keys": ["Church_ID", "Male_ID", "Female_ID"], "foreign_keys": [[0, 0, "people", "Female_ID", "People_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "people", "Male_ID", "People_ID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "church", "Church_ID", "Church_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Church_ID"], [1, 1, "Male_ID"], [2, 2, "Female_ID"]]], "check_constraints": []}}
CREATE TABLE people ( People_ID INT PRIMARY KEY, Name TEXT, Country TEXT, Is_Male TEXT, Age INT, UNIQUE (People_ID) ); CREATE TABLE church ( Church_ID INT PRIMARY KEY, Name TEXT, Organized_by TEXT, Open_Date INT, Continuation_of TEXT, UNIQUE (Church_ID) ); CREATE TABLE wedding ( Church_ID INT PRIMARY KEY, Male_ID INT PRIMARY KEY, Female_ID INT PRIMARY KEY, Year INT, PRIMARY KEY (Church_ID, Male_ID, Female_ID), UNIQUE (Church_ID, Male_ID, Female_ID), FOREIGN KEY (Female_ID) REFERENCES people(People_ID), FOREIGN KEY (Male_ID) REFERENCES people(People_ID), FOREIGN KEY (Church_ID) REFERENCES church(Church_ID) );
gas_company
{"company": {"columns": [[0, "Company_ID", "INT", 0, null, 1], [1, "Rank", "INT", 0, null, 0], [2, "Company", "TEXT", 0, null, 0], [3, "Headquarters", "TEXT", 0, null, 0], [4, "Main_Industry", "TEXT", 0, null, 0], [5, "Sales_billion", "REAL", 0, null, 0], [6, "Profits_billion", "REAL", 0, null, 0], [7, "Assets_billion", "REAL", 0, null, 0], [8, "Market_Value", "REAL", 0, null, 0]], "primary_keys": ["Company_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Company_ID"]]], "check_constraints": []}, "gas_station": {"columns": [[0, "Station_ID", "INT", 0, null, 1], [1, "Open_Year", "INT", 0, null, 0], [2, "Location", "TEXT", 0, null, 0], [3, "Manager_Name", "TEXT", 0, null, 0], [4, "Vice_Manager_Name", "TEXT", 0, null, 0], [5, "Representative_Name", "TEXT", 0, null, 0]], "primary_keys": ["Station_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Station_ID"]]], "check_constraints": []}, "station_company": {"columns": [[0, "Station_ID", "INT", 0, null, 1], [1, "Company_ID", "INT", 0, null, 2], [2, "Rank_of_the_Year", "INT", 0, null, 0]], "primary_keys": ["Station_ID", "Company_ID"], "foreign_keys": [[0, 0, "company", "Company_ID", "Company_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "gas_station", "Station_ID", "Station_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Station_ID"], [1, 1, "Company_ID"]]], "check_constraints": []}}
CREATE TABLE company ( Company_ID INT PRIMARY KEY, Rank INT, Company TEXT, Headquarters TEXT, Main_Industry TEXT, Sales_billion REAL, Profits_billion REAL, Assets_billion REAL, Market_Value REAL, UNIQUE (Company_ID) ); CREATE TABLE gas_station ( Station_ID INT PRIMARY KEY, Open_Year INT, Location TEXT, Manager_Name TEXT, Vice_Manager_Name TEXT, Representative_Name TEXT, UNIQUE (Station_ID) ); CREATE TABLE station_company ( Station_ID INT PRIMARY KEY, Company_ID INT PRIMARY KEY, Rank_of_the_Year INT, PRIMARY KEY (Station_ID, Company_ID), UNIQUE (Station_ID, Company_ID), FOREIGN KEY (Company_ID) REFERENCES company(Company_ID), FOREIGN KEY (Station_ID) REFERENCES gas_station(Station_ID) );
entrepreneur
{"entrepreneur": {"columns": [[0, "Entrepreneur_ID", "INT", 0, null, 1], [1, "People_ID", "INT", 0, null, 0], [2, "Company", "TEXT", 0, null, 0], [3, "Money_Requested", "REAL", 0, null, 0], [4, "Investor", "TEXT", 0, null, 0]], "primary_keys": ["Entrepreneur_ID"], "foreign_keys": [[0, 0, "people", "People_ID", "People_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Entrepreneur_ID"]]], "check_constraints": []}, "people": {"columns": [[0, "People_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Height", "REAL", 0, null, 0], [3, "Weight", "REAL", 0, null, 0], [4, "Date_of_Birth", "TEXT", 0, null, 0]], "primary_keys": ["People_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "People_ID"]]], "check_constraints": []}}
CREATE TABLE entrepreneur ( Entrepreneur_ID INT PRIMARY KEY, People_ID INT, Company TEXT, Money_Requested REAL, Investor TEXT, UNIQUE (Entrepreneur_ID), FOREIGN KEY (People_ID) REFERENCES people(People_ID) ); CREATE TABLE people ( People_ID INT PRIMARY KEY, Name TEXT, Height REAL, Weight REAL, Date_of_Birth TEXT, UNIQUE (People_ID) );
climbing
{"mountain": {"columns": [[0, "Mountain_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Height", "REAL", 0, null, 0], [3, "Prominence", "REAL", 0, null, 0], [4, "Range", "TEXT", 0, null, 0], [5, "Country", "TEXT", 0, null, 0]], "primary_keys": ["Mountain_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Mountain_ID"]]], "check_constraints": []}, "climber": {"columns": [[0, "Climber_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Country", "TEXT", 0, null, 0], [3, "Time", "TEXT", 0, null, 0], [4, "Points", "REAL", 0, null, 0], [5, "Mountain_ID", "INT", 0, null, 0]], "primary_keys": ["Climber_ID"], "foreign_keys": [[0, 0, "mountain", "Mountain_ID", "Mountain_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Climber_ID"]]], "check_constraints": []}}
CREATE TABLE mountain ( Mountain_ID INT PRIMARY KEY, Name TEXT, Height REAL, Prominence REAL, Range TEXT, Country TEXT, UNIQUE (Mountain_ID) ); CREATE TABLE climber ( Climber_ID INT PRIMARY KEY, Name TEXT, Country TEXT, Time TEXT, Points REAL, Mountain_ID INT, UNIQUE (Climber_ID), FOREIGN KEY (Mountain_ID) REFERENCES mountain(Mountain_ID) );
cre_Doc_Tracking_DB
{"Ref_Document_Types": {"columns": [[0, "Document_Type_Code", "CHAR(15)", 1, null, 1], [1, "Document_Type_Name", "VARCHAR(255)", 1, null, 0], [2, "Document_Type_Description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["Document_Type_Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Document_Type_Code"]]], "check_constraints": []}, "Ref_Calendar": {"columns": [[0, "Calendar_Date", "DATETIME", 1, null, 1], [1, "Day_Number", "INTEGER", 0, null, 0]], "primary_keys": ["Calendar_Date"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Calendar_Date"]]], "check_constraints": []}, "Ref_Locations": {"columns": [[0, "Location_Code", "CHAR(15)", 1, null, 1], [1, "Location_Name", "VARCHAR(255)", 1, null, 0], [2, "Location_Description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["Location_Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Location_Code"]]], "check_constraints": []}, "Roles": {"columns": [[0, "Role_Code", "CHAR(15)", 1, null, 1], [1, "Role_Name", "VARCHAR(255)", 0, null, 0], [2, "Role_Description", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Role_Code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Role_Code"]]], "check_constraints": []}, "All_Documents": {"columns": [[0, "Document_ID", "INTEGER", 1, null, 1], [1, "Date_Stored", "DATETIME", 0, null, 0], [2, "Document_Type_Code", "CHAR(15)", 1, null, 0], [3, "Document_Name", "CHAR(255)", 0, null, 0], [4, "Document_Description", "CHAR(255)", 0, null, 0], [5, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Document_ID"], "foreign_keys": [[0, 0, "Ref_Calendar", "Date_Stored", "Calendar_Date", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ref_Document_Types", "Document_Type_Code", "Document_Type_Code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Employees": {"columns": [[0, "Employee_ID", "INTEGER", 1, null, 1], [1, "Role_Code", "CHAR(15)", 1, null, 0], [2, "Employee_Name", "VARCHAR(255)", 0, null, 0], [3, "Gender_MFU", "CHAR(1)", 1, null, 0], [4, "Date_of_Birth", "DATETIME", 1, null, 0], [5, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Employee_ID"], "foreign_keys": [[0, 0, "Roles", "Role_Code", "Role_Code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Document_Locations": {"columns": [[0, "Document_ID", "INTEGER", 1, null, 1], [1, "Location_Code", "CHAR(15)", 1, null, 2], [2, "Date_in_Location_From", "DATETIME", 1, null, 3], [3, "Date_in_Locaton_To", "DATETIME", 0, null, 0]], "primary_keys": ["Document_ID", "Location_Code", "Date_in_Location_From"], "foreign_keys": [[0, 0, "All_Documents", "Document_ID", "Document_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ref_Calendar", "Date_in_Locaton_To", "Calendar_Date", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Ref_Calendar", "Date_in_Location_From", "Calendar_Date", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Ref_Locations", "Location_Code", "Location_Code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Document_ID"], [1, 1, "Location_Code"], [2, 2, "Date_in_Location_From"]]], "check_constraints": []}, "Documents_to_be_Destroyed": {"columns": [[0, "Document_ID", "INTEGER", 1, null, 1], [1, "Destruction_Authorised_by_Employee_ID", "INTEGER", 0, null, 0], [2, "Destroyed_by_Employee_ID", "INTEGER", 0, null, 0], [3, "Planned_Destruction_Date", "DATETIME", 0, null, 0], [4, "Actual_Destruction_Date", "DATETIME", 0, null, 0], [5, "Other_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Document_ID"], "foreign_keys": [[0, 0, "All_Documents", "Document_ID", "Document_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ref_Calendar", "Actual_Destruction_Date", "Calendar_Date", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Ref_Calendar", "Planned_Destruction_Date", "Calendar_Date", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Employees", "Destruction_Authorised_by_Employee_ID", "Employee_ID", "NO ACTION", "NO ACTION", "NONE"], [4, 0, "Employees", "Destroyed_by_Employee_ID", "Employee_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15) NOT NULL PRIMARY KEY, Document_Type_Name VARCHAR(255) NOT NULL, Document_Type_Description VARCHAR(255) NOT NULL, UNIQUE (Document_Type_Code) ); CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME NOT NULL PRIMARY KEY, Day_Number INTEGER, UNIQUE (Calendar_Date) ); CREATE TABLE Ref_Locations ( Location_Code CHAR(15) NOT NULL PRIMARY KEY, Location_Name VARCHAR(255) NOT NULL, Location_Description VARCHAR(255) NOT NULL, UNIQUE (Location_Code) ); CREATE TABLE Roles ( Role_Code CHAR(15) NOT NULL PRIMARY KEY, Role_Name VARCHAR(255), Role_Description VARCHAR(255), UNIQUE (Role_Code) ); CREATE TABLE All_Documents ( Document_ID INTEGER NOT NULL PRIMARY KEY, Date_Stored DATETIME, Document_Type_Code CHAR(15) NOT NULL, Document_Name CHAR(255), Document_Description CHAR(255), Other_Details VARCHAR(255), FOREIGN KEY (Date_Stored) REFERENCES Ref_Calendar(Calendar_Date), FOREIGN KEY (Document_Type_Code) REFERENCES Ref_Document_Types(Document_Type_Code) ); CREATE TABLE Employees ( Employee_ID INTEGER NOT NULL PRIMARY KEY, Role_Code CHAR(15) NOT NULL, Employee_Name VARCHAR(255), Gender_MFU CHAR(1) NOT NULL, Date_of_Birth DATETIME NOT NULL, Other_Details VARCHAR(255), FOREIGN KEY (Role_Code) REFERENCES Roles(Role_Code) ); CREATE TABLE Document_Locations ( Document_ID INTEGER NOT NULL PRIMARY KEY, Location_Code CHAR(15) NOT NULL PRIMARY KEY, Date_in_Location_From DATETIME NOT NULL PRIMARY KEY, Date_in_Locaton_To DATETIME, PRIMARY KEY (Document_ID, Location_Code, Date_in_Location_From), UNIQUE (Document_ID, Location_Code, Date_in_Location_From), FOREIGN KEY (Document_ID) REFERENCES All_Documents(Document_ID), FOREIGN KEY (Date_in_Locaton_To) REFERENCES Ref_Calendar(Calendar_Date), FOREIGN KEY (Date_in_Location_From) REFERENCES Ref_Calendar(Calendar_Date), FOREIGN KEY (Location_Code) REFERENCES Ref_Locations(Location_Code) ); CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER NOT NULL PRIMARY KEY, Destruction_Authorised_by_Employee_ID INTEGER, Destroyed_by_Employee_ID INTEGER, Planned_Destruction_Date DATETIME, Actual_Destruction_Date DATETIME, Other_Details VARCHAR(255), FOREIGN KEY (Document_ID) REFERENCES All_Documents(Document_ID), FOREIGN KEY (Actual_Destruction_Date) REFERENCES Ref_Calendar(Calendar_Date), FOREIGN KEY (Planned_Destruction_Date) REFERENCES Ref_Calendar(Calendar_Date), FOREIGN KEY (Destruction_Authorised_by_Employee_ID) REFERENCES Employees(Employee_ID), FOREIGN KEY (Destroyed_by_Employee_ID) REFERENCES Employees(Employee_ID) );
inn_1
{"Rooms": {"columns": [[0, "RoomId", "TEXT", 0, null, 1], [1, "roomName", "TEXT", 0, null, 0], [2, "beds", "INTEGER", 0, null, 0], [3, "bedType", "TEXT", 0, null, 0], [4, "maxOccupancy", "INTEGER", 0, null, 0], [5, "basePrice", "INTEGER", 0, null, 0], [6, "decor", "TEXT", 0, null, 0]], "primary_keys": ["RoomId"], "foreign_keys": [], "unique_constraints": [[[0, 0, "RoomId"]]], "check_constraints": []}, "Reservations": {"columns": [[0, "Code", "INTEGER", 0, null, 1], [1, "Room", "TEXT", 0, null, 0], [2, "CheckIn", "TEXT", 0, null, 0], [3, "CheckOut", "TEXT", 0, null, 0], [4, "Rate", "REAL", 0, null, 0], [5, "LastName", "TEXT", 0, null, 0], [6, "FirstName", "TEXT", 0, null, 0], [7, "Adults", "INTEGER", 0, null, 0], [8, "Kids", "INTEGER", 0, null, 0]], "primary_keys": ["Code"], "foreign_keys": [[0, 0, "Rooms", "Room", "RoomId", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": ["\"CheckIn\" TEXT,", "\"CheckOut\" TEXT,"]}}
CREATE TABLE Rooms ( RoomId TEXT PRIMARY KEY, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT, UNIQUE (RoomId) ); CREATE TABLE Reservations ( Code INTEGER PRIMARY KEY, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER, FOREIGN KEY (Room) REFERENCES Rooms(RoomId), "CheckIn" TEXT,, "CheckOut" TEXT, );
csu_1
{"Campuses": {"columns": [[0, "Id", "INTEGER", 0, null, 1], [1, "Campus", "TEXT", 0, null, 0], [2, "Location", "TEXT", 0, null, 0], [3, "County", "TEXT", 0, null, 0], [4, "Year", "INTEGER", 0, null, 0]], "primary_keys": ["Id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "csu_fees": {"columns": [[0, "Campus", "INTEGER", 0, null, 1], [1, "Year", "INTEGER", 0, null, 0], [2, "CampusFee", "INTEGER", 0, null, 0]], "primary_keys": ["Campus"], "foreign_keys": [[0, 0, "Campuses", "Campus", "Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "degrees": {"columns": [[0, "Year", "INTEGER", 0, null, 1], [1, "Campus", "INTEGER", 0, null, 2], [2, "Degrees", "INTEGER", 0, null, 0]], "primary_keys": ["Year", "Campus"], "foreign_keys": [[0, 0, "Campuses", "Campus", "Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Year"], [1, 1, "Campus"]]], "check_constraints": []}, "discipline_enrollments": {"columns": [[0, "Campus", "INTEGER", 0, null, 1], [1, "Discipline", "INTEGER", 0, null, 2], [2, "Year", "INTEGER", 0, null, 0], [3, "Undergraduate", "INTEGER", 0, null, 0], [4, "Graduate", "INTEGER", 0, null, 0]], "primary_keys": ["Campus", "Discipline"], "foreign_keys": [[0, 0, "Campuses", "Campus", "Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Campus"], [1, 1, "Discipline"]]], "check_constraints": []}, "enrollments": {"columns": [[0, "Campus", "INTEGER", 0, null, 1], [1, "Year", "INTEGER", 0, null, 2], [2, "TotalEnrollment_AY", "INTEGER", 0, null, 0], [3, "FTE_AY", "INTEGER", 0, null, 0]], "primary_keys": ["Campus", "Year"], "foreign_keys": [[0, 0, "Campuses", "Campus", "Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Campus"], [1, 1, "Year"]]], "check_constraints": []}, "faculty": {"columns": [[0, "Campus", "INTEGER", 0, null, 0], [1, "Year", "INTEGER", 0, null, 0], [2, "Faculty", "REAL", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Campuses", "Campus", "Id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Campuses ( Id INTEGER PRIMARY KEY, Campus TEXT, Location TEXT, County TEXT, Year INTEGER ); CREATE TABLE csu_fees ( Campus INTEGER PRIMARY KEY, Year INTEGER, CampusFee INTEGER, FOREIGN KEY (Campus) REFERENCES Campuses(Id) ); CREATE TABLE degrees ( Year INTEGER PRIMARY KEY, Campus INTEGER PRIMARY KEY, Degrees INTEGER, PRIMARY KEY (Year, Campus), UNIQUE (Year, Campus), FOREIGN KEY (Campus) REFERENCES Campuses(Id) ); CREATE TABLE discipline_enrollments ( Campus INTEGER PRIMARY KEY, Discipline INTEGER PRIMARY KEY, Year INTEGER, Undergraduate INTEGER, Graduate INTEGER, PRIMARY KEY (Campus, Discipline), UNIQUE (Campus, Discipline), FOREIGN KEY (Campus) REFERENCES Campuses(Id) ); CREATE TABLE enrollments ( Campus INTEGER PRIMARY KEY, Year INTEGER PRIMARY KEY, TotalEnrollment_AY INTEGER, FTE_AY INTEGER, PRIMARY KEY (Campus, Year), UNIQUE (Campus, Year), FOREIGN KEY (Campus) REFERENCES Campuses(Id) ); CREATE TABLE faculty ( Campus INTEGER, Year INTEGER, Faculty REAL, FOREIGN KEY (Campus) REFERENCES Campuses(Id) );
ship_mission
{"mission": {"columns": [[0, "Mission_ID", "INT", 0, null, 1], [1, "Ship_ID", "INT", 0, null, 0], [2, "Code", "TEXT", 0, null, 0], [3, "Launched_Year", "INT", 0, null, 0], [4, "Location", "TEXT", 0, null, 0], [5, "Speed_knots", "INT", 0, null, 0], [6, "Fate", "TEXT", 0, null, 0]], "primary_keys": ["Mission_ID"], "foreign_keys": [[0, 0, "ship", "Ship_ID", "Ship_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Mission_ID"]]], "check_constraints": []}, "ship": {"columns": [[0, "Ship_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Type", "TEXT", 0, null, 0], [3, "Nationality", "TEXT", 0, null, 0], [4, "Tonnage", "INT", 0, null, 0]], "primary_keys": ["Ship_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Ship_ID"]]], "check_constraints": []}}
CREATE TABLE mission ( Mission_ID INT PRIMARY KEY, Ship_ID INT, Code TEXT, Launched_Year INT, Location TEXT, Speed_knots INT, Fate TEXT, UNIQUE (Mission_ID), FOREIGN KEY (Ship_ID) REFERENCES ship(Ship_ID) ); CREATE TABLE ship ( Ship_ID INT PRIMARY KEY, Name TEXT, Type TEXT, Nationality TEXT, Tonnage INT, UNIQUE (Ship_ID) );
student_transcripts_tracking
{"Addresses": {"columns": [[0, "address_id", "INTEGER", 0, null, 1], [1, "line_1", "VARCHAR(255)", 0, null, 0], [2, "line_2", "VARCHAR(255)", 0, null, 0], [3, "line_3", "VARCHAR(255)", 0, null, 0], [4, "city", "VARCHAR(255)", 0, null, 0], [5, "zip_postcode", "VARCHAR(20)", 0, null, 0], [6, "state_province_county", "VARCHAR(255)", 0, null, 0], [7, "country", "VARCHAR(255)", 0, null, 0], [8, "other_address_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["address_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Courses": {"columns": [[0, "course_id", "INTEGER", 0, null, 1], [1, "course_name", "VARCHAR(255)", 0, null, 0], [2, "course_description", "VARCHAR(255)", 0, null, 0], [3, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["course_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Departments": {"columns": [[0, "department_id", "INTEGER", 0, null, 1], [1, "department_name", "VARCHAR(255)", 0, null, 0], [2, "department_description", "VARCHAR(255)", 0, null, 0], [3, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["department_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Degree_Programs": {"columns": [[0, "degree_program_id", "INTEGER", 0, null, 1], [1, "department_id", "INTEGER", 1, null, 0], [2, "degree_summary_name", "VARCHAR(255)", 0, null, 0], [3, "degree_summary_description", "VARCHAR(255)", 0, null, 0], [4, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["degree_program_id"], "foreign_keys": [[0, 0, "Departments", "department_id", "department_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Sections": {"columns": [[0, "section_id", "INTEGER", 0, null, 1], [1, "course_id", "INTEGER", 1, null, 0], [2, "section_name", "VARCHAR(255)", 0, null, 0], [3, "section_description", "VARCHAR(255)", 0, null, 0], [4, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["section_id"], "foreign_keys": [[0, 0, "Courses", "course_id", "course_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Semesters": {"columns": [[0, "semester_id", "INTEGER", 0, null, 1], [1, "semester_name", "VARCHAR(255)", 0, null, 0], [2, "semester_description", "VARCHAR(255)", 0, null, 0], [3, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["semester_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Students": {"columns": [[0, "student_id", "INTEGER", 0, null, 1], [1, "current_address_id", "INTEGER", 1, null, 0], [2, "permanent_address_id", "INTEGER", 1, null, 0], [3, "first_name", "VARCHAR(80)", 0, null, 0], [4, "middle_name", "VARCHAR(40)", 0, null, 0], [5, "last_name", "VARCHAR(40)", 0, null, 0], [6, "cell_mobile_number", "VARCHAR(40)", 0, null, 0], [7, "email_address", "VARCHAR(40)", 0, null, 0], [8, "ssn", "VARCHAR(40)", 0, null, 0], [9, "date_first_registered", "DATETIME", 0, null, 0], [10, "date_left", "DATETIME", 0, null, 0], [11, "other_student_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["student_id"], "foreign_keys": [[0, 0, "Addresses", "permanent_address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Addresses", "current_address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Student_Enrolment": {"columns": [[0, "student_enrolment_id", "INTEGER", 0, null, 1], [1, "degree_program_id", "INTEGER", 1, null, 0], [2, "semester_id", "INTEGER", 1, null, 0], [3, "student_id", "INTEGER", 1, null, 0], [4, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["student_enrolment_id"], "foreign_keys": [[0, 0, "Students", "student_id", "student_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Semesters", "semester_id", "semester_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Degree_Programs", "degree_program_id", "degree_program_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Student_Enrolment_Courses": {"columns": [[0, "student_course_id", "INTEGER", 0, null, 1], [1, "course_id", "INTEGER", 1, null, 0], [2, "student_enrolment_id", "INTEGER", 1, null, 0]], "primary_keys": ["student_course_id"], "foreign_keys": [[0, 0, "Student_Enrolment", "student_enrolment_id", "student_enrolment_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Courses", "course_id", "course_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Transcripts": {"columns": [[0, "transcript_id", "INTEGER", 0, null, 1], [1, "transcript_date", "DATETIME", 0, null, 0], [2, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["transcript_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Transcript_Contents": {"columns": [[0, "student_course_id", "INTEGER", 1, null, 0], [1, "transcript_id", "INTEGER", 1, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Transcripts", "transcript_id", "transcript_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Student_Enrolment_Courses", "student_course_id", "student_course_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Addresses ( address_id INTEGER PRIMARY KEY, line_1 VARCHAR(255), line_2 VARCHAR(255), line_3 VARCHAR(255), city VARCHAR(255), zip_postcode VARCHAR(20), state_province_county VARCHAR(255), country VARCHAR(255), other_address_details VARCHAR(255) ); CREATE TABLE Courses ( course_id INTEGER PRIMARY KEY, course_name VARCHAR(255), course_description VARCHAR(255), other_details VARCHAR(255) ); CREATE TABLE Departments ( department_id INTEGER PRIMARY KEY, department_name VARCHAR(255), department_description VARCHAR(255), other_details VARCHAR(255) ); CREATE TABLE Degree_Programs ( degree_program_id INTEGER PRIMARY KEY, department_id INTEGER NOT NULL, degree_summary_name VARCHAR(255), degree_summary_description VARCHAR(255), other_details VARCHAR(255), FOREIGN KEY (department_id) REFERENCES Departments(department_id) ); CREATE TABLE Sections ( section_id INTEGER PRIMARY KEY, course_id INTEGER NOT NULL, section_name VARCHAR(255), section_description VARCHAR(255), other_details VARCHAR(255), FOREIGN KEY (course_id) REFERENCES Courses(course_id) ); CREATE TABLE Semesters ( semester_id INTEGER PRIMARY KEY, semester_name VARCHAR(255), semester_description VARCHAR(255), other_details VARCHAR(255) ); CREATE TABLE Students ( student_id INTEGER PRIMARY KEY, current_address_id INTEGER NOT NULL, permanent_address_id INTEGER NOT NULL, first_name VARCHAR(80), middle_name VARCHAR(40), last_name VARCHAR(40), cell_mobile_number VARCHAR(40), email_address VARCHAR(40), ssn VARCHAR(40), date_first_registered DATETIME, date_left DATETIME, other_student_details VARCHAR(255), FOREIGN KEY (permanent_address_id) REFERENCES Addresses(address_id), FOREIGN KEY (current_address_id) REFERENCES Addresses(address_id) ); CREATE TABLE Student_Enrolment ( student_enrolment_id INTEGER PRIMARY KEY, degree_program_id INTEGER NOT NULL, semester_id INTEGER NOT NULL, student_id INTEGER NOT NULL, other_details VARCHAR(255), FOREIGN KEY (student_id) REFERENCES Students(student_id), FOREIGN KEY (semester_id) REFERENCES Semesters(semester_id), FOREIGN KEY (degree_program_id) REFERENCES Degree_Programs(degree_program_id) ); CREATE TABLE Student_Enrolment_Courses ( student_course_id INTEGER PRIMARY KEY, course_id INTEGER NOT NULL, student_enrolment_id INTEGER NOT NULL, FOREIGN KEY (student_enrolment_id) REFERENCES Student_Enrolment(student_enrolment_id), FOREIGN KEY (course_id) REFERENCES Courses(course_id) ); CREATE TABLE Transcripts ( transcript_id INTEGER PRIMARY KEY, transcript_date DATETIME, other_details VARCHAR(255) ); CREATE TABLE Transcript_Contents ( student_course_id INTEGER NOT NULL, transcript_id INTEGER NOT NULL, FOREIGN KEY (transcript_id) REFERENCES Transcripts(transcript_id), FOREIGN KEY (student_course_id) REFERENCES Student_Enrolment_Courses(student_course_id) );
soccer_2
{"College": {"columns": [[0, "cName", "varchar(20)", 1, null, 1], [1, "state", "varchar(2)", 0, null, 0], [2, "enr", "numeric(5,0)", 0, null, 0]], "primary_keys": ["cName"], "foreign_keys": [], "unique_constraints": [[[0, 0, "cName"]]], "check_constraints": []}, "Player": {"columns": [[0, "pID", "numeric(5,0)", 1, null, 1], [1, "pName", "varchar(20)", 0, null, 0], [2, "yCard", "varchar(3)", 0, null, 0], [3, "HS", "numeric(5,0)", 0, null, 0]], "primary_keys": ["pID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "pID"]]], "check_constraints": []}, "Tryout": {"columns": [[0, "pID", "numeric(5,0)", 0, null, 1], [1, "cName", "varchar(20)", 0, null, 2], [2, "pPos", "varchar(8)", 0, null, 0], [3, "decision", "varchar(3)", 0, null, 0]], "primary_keys": ["pID", "cName"], "foreign_keys": [[0, 0, "College", "cName", "cName", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Player", "pID", "pID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "pID"], [1, 1, "cName"]]], "check_constraints": []}}
CREATE TABLE College ( cName varchar(20) NOT NULL PRIMARY KEY, state varchar(2), enr numeric(5,0), UNIQUE (cName) ); CREATE TABLE Player ( pID numeric(5,0) NOT NULL PRIMARY KEY, pName varchar(20), yCard varchar(3), HS numeric(5,0), UNIQUE (pID) ); CREATE TABLE Tryout ( pID numeric(5,0) PRIMARY KEY, cName varchar(20) PRIMARY KEY, pPos varchar(8), decision varchar(3), PRIMARY KEY (pID, cName), UNIQUE (pID, cName), FOREIGN KEY (cName) REFERENCES College(cName), FOREIGN KEY (pID) REFERENCES Player(pID) );
tracking_software_problems
{"Problem_Category_Codes": {"columns": [[0, "problem_category_code", "VARCHAR(20)", 0, null, 1], [1, "problem_category_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["problem_category_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "problem_category_code"]]], "check_constraints": []}, "Problem_Log": {"columns": [[0, "problem_log_id", "INTEGER", 0, null, 1], [1, "assigned_to_staff_id", "INTEGER", 1, null, 0], [2, "problem_id", "INTEGER", 1, null, 0], [3, "problem_category_code", "VARCHAR(20)", 1, null, 0], [4, "problem_status_code", "VARCHAR(20)", 1, null, 0], [5, "log_entry_date", "DATETIME", 0, null, 0], [6, "log_entry_description", "VARCHAR(255)", 0, null, 0], [7, "log_entry_fix", "VARCHAR(255)", 0, null, 0], [8, "other_log_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["problem_log_id"], "foreign_keys": [[0, 0, "Problem_Status_Codes", "problem_status_code", "problem_status_code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Problems", "problem_id", "problem_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Staff", "assigned_to_staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"], [3, 0, "Problem_Category_Codes", "problem_category_code", "problem_category_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Problem_Status_Codes": {"columns": [[0, "problem_status_code", "VARCHAR(20)", 0, null, 1], [1, "problem_status_description", "VARCHAR(80)", 0, null, 0]], "primary_keys": ["problem_status_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "problem_status_code"]]], "check_constraints": []}, "Product": {"columns": [[0, "product_id", "INTEGER", 0, null, 1], [1, "product_name", "VARCHAR(80)", 0, null, 0], [2, "product_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["product_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Staff": {"columns": [[0, "staff_id", "INTEGER", 0, null, 1], [1, "staff_first_name", "VARCHAR(80)", 0, null, 0], [2, "staff_last_name", "VARCHAR(80)", 0, null, 0], [3, "other_staff_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["staff_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Problems": {"columns": [[0, "problem_id", "INTEGER", 0, null, 1], [1, "product_id", "INTEGER", 1, null, 0], [2, "closure_authorised_by_staff_id", "INTEGER", 1, null, 0], [3, "reported_by_staff_id", "INTEGER", 1, null, 0], [4, "date_problem_reported", "DATETIME", 1, null, 0], [5, "date_problem_closed", "DATETIME", 0, null, 0], [6, "problem_description", "VARCHAR(255)", 0, null, 0], [7, "other_problem_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["problem_id"], "foreign_keys": [[0, 0, "Staff", "reported_by_staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Product", "product_id", "product_id", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Staff", "closure_authorised_by_staff_id", "staff_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Problem_Category_Codes ( problem_category_code VARCHAR(20) PRIMARY KEY, problem_category_description VARCHAR(80), UNIQUE (problem_category_code) ); CREATE TABLE Problem_Log ( problem_log_id INTEGER PRIMARY KEY, assigned_to_staff_id INTEGER NOT NULL, problem_id INTEGER NOT NULL, problem_category_code VARCHAR(20) NOT NULL, problem_status_code VARCHAR(20) NOT NULL, log_entry_date DATETIME, log_entry_description VARCHAR(255), log_entry_fix VARCHAR(255), other_log_details VARCHAR(255), FOREIGN KEY (problem_status_code) REFERENCES Problem_Status_Codes(problem_status_code), FOREIGN KEY (problem_id) REFERENCES Problems(problem_id), FOREIGN KEY (assigned_to_staff_id) REFERENCES Staff(staff_id), FOREIGN KEY (problem_category_code) REFERENCES Problem_Category_Codes(problem_category_code) ); CREATE TABLE Problem_Status_Codes ( problem_status_code VARCHAR(20) PRIMARY KEY, problem_status_description VARCHAR(80), UNIQUE (problem_status_code) ); CREATE TABLE Product ( product_id INTEGER PRIMARY KEY, product_name VARCHAR(80), product_details VARCHAR(255) ); CREATE TABLE Staff ( staff_id INTEGER PRIMARY KEY, staff_first_name VARCHAR(80), staff_last_name VARCHAR(80), other_staff_details VARCHAR(255) ); CREATE TABLE Problems ( problem_id INTEGER PRIMARY KEY, product_id INTEGER NOT NULL, closure_authorised_by_staff_id INTEGER NOT NULL, reported_by_staff_id INTEGER NOT NULL, date_problem_reported DATETIME NOT NULL, date_problem_closed DATETIME, problem_description VARCHAR(255), other_problem_details VARCHAR(255), FOREIGN KEY (reported_by_staff_id) REFERENCES Staff(staff_id), FOREIGN KEY (product_id) REFERENCES Product(product_id), FOREIGN KEY (closure_authorised_by_staff_id) REFERENCES Staff(staff_id) );
soccer_1
{"Player_Attributes": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "player_fifa_api_id", "INTEGER", 0, null, 0], [2, "player_api_id", "INTEGER", 0, null, 0], [3, "date", "TEXT", 0, null, 0], [4, "overall_rating", "INTEGER", 0, null, 0], [5, "potential", "INTEGER", 0, null, 0], [6, "preferred_foot", "TEXT", 0, null, 0], [7, "attacking_work_rate", "TEXT", 0, null, 0], [8, "defensive_work_rate", "TEXT", 0, null, 0], [9, "crossing", "INTEGER", 0, null, 0], [10, "finishing", "INTEGER", 0, null, 0], [11, "heading_accuracy", "INTEGER", 0, null, 0], [12, "short_passing", "INTEGER", 0, null, 0], [13, "volleys", "INTEGER", 0, null, 0], [14, "dribbling", "INTEGER", 0, null, 0], [15, "curve", "INTEGER", 0, null, 0], [16, "free_kick_accuracy", "INTEGER", 0, null, 0], [17, "long_passing", "INTEGER", 0, null, 0], [18, "ball_control", "INTEGER", 0, null, 0], [19, "acceleration", "INTEGER", 0, null, 0], [20, "sprint_speed", "INTEGER", 0, null, 0], [21, "agility", "INTEGER", 0, null, 0], [22, "reactions", "INTEGER", 0, null, 0], [23, "balance", "INTEGER", 0, null, 0], [24, "shot_power", "INTEGER", 0, null, 0], [25, "jumping", "INTEGER", 0, null, 0], [26, "stamina", "INTEGER", 0, null, 0], [27, "strength", "INTEGER", 0, null, 0], [28, "long_shots", "INTEGER", 0, null, 0], [29, "aggression", "INTEGER", 0, null, 0], [30, "interceptions", "INTEGER", 0, null, 0], [31, "positioning", "INTEGER", 0, null, 0], [32, "vision", "INTEGER", 0, null, 0], [33, "penalties", "INTEGER", 0, null, 0], [34, "marking", "INTEGER", 0, null, 0], [35, "standing_tackle", "INTEGER", 0, null, 0], [36, "sliding_tackle", "INTEGER", 0, null, 0], [37, "gk_diving", "INTEGER", 0, null, 0], [38, "gk_handling", "INTEGER", 0, null, 0], [39, "gk_kicking", "INTEGER", 0, null, 0], [40, "gk_positioning", "INTEGER", 0, null, 0], [41, "gk_reflexes", "INTEGER", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "Player", "player_api_id", "player_api_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Player", "player_fifa_api_id", "player_fifa_api_id", "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": []}, "Player": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "player_api_id", "INTEGER", 0, null, 0], [2, "player_name", "TEXT", 0, null, 0], [3, "player_fifa_api_id", "INTEGER", 0, null, 0], [4, "birthday", "TEXT", 0, null, 0], [5, "height", "INTEGER", 0, null, 0], [6, "weight", "INTEGER", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 3, "player_fifa_api_id"]], [[0, 1, "player_api_id"]]], "check_constraints": []}, "League": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "country_id", "INTEGER", 0, null, 0], [2, "name", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "Country", "country_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 2, "name"]]], "check_constraints": []}, "Country": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "name", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 1, "name"]]], "check_constraints": []}, "Team": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "team_api_id", "INTEGER", 0, null, 0], [2, "team_fifa_api_id", "INTEGER", 0, null, 0], [3, "team_long_name", "TEXT", 0, null, 0], [4, "team_short_name", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 1, "team_api_id"]]], "check_constraints": []}, "Team_Attributes": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "team_fifa_api_id", "INTEGER", 0, null, 0], [2, "team_api_id", "INTEGER", 0, null, 0], [3, "date", "TEXT", 0, null, 0], [4, "buildUpPlaySpeed", "INTEGER", 0, null, 0], [5, "buildUpPlaySpeedClass", "TEXT", 0, null, 0], [6, "buildUpPlayDribbling", "INTEGER", 0, null, 0], [7, "buildUpPlayDribblingClass", "TEXT", 0, null, 0], [8, "buildUpPlayPassing", "INTEGER", 0, null, 0], [9, "buildUpPlayPassingClass", "TEXT", 0, null, 0], [10, "buildUpPlayPositioningClass", "TEXT", 0, null, 0], [11, "chanceCreationPassing", "INTEGER", 0, null, 0], [12, "chanceCreationPassingClass", "TEXT", 0, null, 0], [13, "chanceCreationCrossing", "INTEGER", 0, null, 0], [14, "chanceCreationCrossingClass", "TEXT", 0, null, 0], [15, "chanceCreationShooting", "INTEGER", 0, null, 0], [16, "chanceCreationShootingClass", "TEXT", 0, null, 0], [17, "chanceCreationPositioningClass", "TEXT", 0, null, 0], [18, "defencePressure", "INTEGER", 0, null, 0], [19, "defencePressureClass", "TEXT", 0, null, 0], [20, "defenceAggression", "INTEGER", 0, null, 0], [21, "defenceAggressionClass", "TEXT", 0, null, 0], [22, "defenceTeamWidth", "INTEGER", 0, null, 0], [23, "defenceTeamWidthClass", "TEXT", 0, null, 0], [24, "defenceDefenderLineClass", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "Team", "team_api_id", "team_api_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Team", "team_fifa_api_id", "team_fifa_api_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Player_Attributes ( id INTEGER PRIMARY KEY, player_fifa_api_id INTEGER, player_api_id INTEGER, date TEXT, overall_rating INTEGER, potential INTEGER, preferred_foot TEXT, attacking_work_rate TEXT, defensive_work_rate TEXT, crossing INTEGER, finishing INTEGER, heading_accuracy INTEGER, short_passing INTEGER, volleys INTEGER, dribbling INTEGER, curve INTEGER, free_kick_accuracy INTEGER, long_passing INTEGER, ball_control INTEGER, acceleration INTEGER, sprint_speed INTEGER, agility INTEGER, reactions INTEGER, balance INTEGER, shot_power INTEGER, jumping INTEGER, stamina INTEGER, strength INTEGER, long_shots INTEGER, aggression INTEGER, interceptions INTEGER, positioning INTEGER, vision INTEGER, penalties INTEGER, marking INTEGER, standing_tackle INTEGER, sliding_tackle INTEGER, gk_diving INTEGER, gk_handling INTEGER, gk_kicking INTEGER, gk_positioning INTEGER, gk_reflexes INTEGER, FOREIGN KEY (player_api_id) REFERENCES Player(player_api_id), FOREIGN KEY (player_fifa_api_id) REFERENCES Player(player_fifa_api_id) ); CREATE TABLE sqlite_sequence ( name, seq ); CREATE TABLE Player ( id INTEGER PRIMARY KEY, player_api_id INTEGER, player_name TEXT, player_fifa_api_id INTEGER, birthday TEXT, height INTEGER, weight INTEGER, UNIQUE (player_fifa_api_id), UNIQUE (player_api_id) ); CREATE TABLE League ( id INTEGER PRIMARY KEY, country_id INTEGER, name TEXT, UNIQUE (name), FOREIGN KEY (country_id) REFERENCES Country(id) ); CREATE TABLE Country ( id INTEGER PRIMARY KEY, name TEXT, UNIQUE (name) ); CREATE TABLE Team ( id INTEGER PRIMARY KEY, team_api_id INTEGER, team_fifa_api_id INTEGER, team_long_name TEXT, team_short_name TEXT, UNIQUE (team_api_id) ); CREATE TABLE Team_Attributes ( id INTEGER PRIMARY KEY, team_fifa_api_id INTEGER, team_api_id INTEGER, date TEXT, buildUpPlaySpeed INTEGER, buildUpPlaySpeedClass TEXT, buildUpPlayDribbling INTEGER, buildUpPlayDribblingClass TEXT, buildUpPlayPassing INTEGER, buildUpPlayPassingClass TEXT, buildUpPlayPositioningClass TEXT, chanceCreationPassing INTEGER, chanceCreationPassingClass TEXT, chanceCreationCrossing INTEGER, chanceCreationCrossingClass TEXT, chanceCreationShooting INTEGER, chanceCreationShootingClass TEXT, chanceCreationPositioningClass TEXT, defencePressure INTEGER, defencePressureClass TEXT, defenceAggression INTEGER, defenceAggressionClass TEXT, defenceTeamWidth INTEGER, defenceTeamWidthClass TEXT, defenceDefenderLineClass TEXT, FOREIGN KEY (team_api_id) REFERENCES Team(team_api_id), FOREIGN KEY (team_fifa_api_id) REFERENCES Team(team_fifa_api_id) );
restaurant_1
{"Student": {"columns": [[0, "StuID", "INTEGER", 0, null, 1], [1, "LName", "VARCHAR(12)", 0, null, 0], [2, "Fname", "VARCHAR(12)", 0, null, 0], [3, "Age", "INTEGER", 0, null, 0], [4, "Sex", "VARCHAR(1)", 0, null, 0], [5, "Major", "INTEGER", 0, null, 0], [6, "Advisor", "INTEGER", 0, null, 0], [7, "city_code", "VARCHAR(3)", 0, null, 0]], "primary_keys": ["StuID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Restaurant": {"columns": [[0, "ResID", "INTEGER", 0, null, 1], [1, "ResName", "VARCHAR(100)", 0, null, 0], [2, "Address", "VARCHAR(100)", 0, null, 0], [3, "Rating", "INTEGER", 0, null, 0]], "primary_keys": ["ResID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Type_Of_Restaurant": {"columns": [[0, "ResID", "INTEGER", 0, null, 0], [1, "ResTypeID", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Restaurant_Type", "ResTypeID", "ResTypeID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Restaurant", "ResID", "ResID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Restaurant_Type": {"columns": [[0, "ResTypeID", "INTEGER", 0, null, 1], [1, "ResTypeName", "VARCHAR(40)", 0, null, 0], [2, "ResTypeDescription", "VARCHAR(100)", 0, null, 0]], "primary_keys": ["ResTypeID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Visits_Restaurant": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "ResID", "INTEGER", 0, null, 0], [2, "Time", "TIMESTAMP", 0, null, 0], [3, "Spent", "FLOAT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Restaurant", "ResID", "ResID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); CREATE TABLE Restaurant ( ResID INTEGER PRIMARY KEY, ResName VARCHAR(100), Address VARCHAR(100), Rating INTEGER ); CREATE TABLE Type_Of_Restaurant ( ResID INTEGER, ResTypeID INTEGER, FOREIGN KEY (ResTypeID) REFERENCES Restaurant_Type(ResTypeID), FOREIGN KEY (ResID) REFERENCES Restaurant(ResID) ); CREATE TABLE Restaurant_Type ( ResTypeID INTEGER PRIMARY KEY, ResTypeName VARCHAR(40), ResTypeDescription VARCHAR(100) ); CREATE TABLE Visits_Restaurant ( StuID INTEGER, ResID INTEGER, Time TIMESTAMP, Spent FLOAT, FOREIGN KEY (ResID) REFERENCES Restaurant(ResID), FOREIGN KEY (StuID) REFERENCES Student(StuID) );
election_representative
{"election": {"columns": [[0, "Election_ID", "INT", 0, null, 1], [1, "Representative_ID", "INT", 0, null, 0], [2, "Date", "TEXT", 0, null, 0], [3, "Votes", "REAL", 0, null, 0], [4, "Vote_Percent", "REAL", 0, null, 0], [5, "Seats", "REAL", 0, null, 0], [6, "Place", "REAL", 0, null, 0]], "primary_keys": ["Election_ID"], "foreign_keys": [[0, 0, "representative", "Representative_ID", "Representative_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Election_ID"]]], "check_constraints": []}, "representative": {"columns": [[0, "Representative_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "State", "TEXT", 0, null, 0], [3, "Party", "TEXT", 0, null, 0], [4, "Lifespan", "TEXT", 0, null, 0]], "primary_keys": ["Representative_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Representative_ID"]]], "check_constraints": []}}
CREATE TABLE election ( Election_ID INT PRIMARY KEY, Representative_ID INT, Date TEXT, Votes REAL, Vote_Percent REAL, Seats REAL, Place REAL, UNIQUE (Election_ID), FOREIGN KEY (Representative_ID) REFERENCES representative(Representative_ID) ); CREATE TABLE representative ( Representative_ID INT PRIMARY KEY, Name TEXT, State TEXT, Party TEXT, Lifespan TEXT, UNIQUE (Representative_ID) );
academic
{"author": {"columns": [[0, "aid", "INT", 0, null, 1], [1, "homepage", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0], [3, "oid", "INT", 0, null, 0]], "primary_keys": ["aid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "aid"]]], "check_constraints": []}, "conference": {"columns": [[0, "cid", "INT", 0, null, 1], [1, "homepage", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0]], "primary_keys": ["cid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "cid"]]], "check_constraints": []}, "domain": {"columns": [[0, "did", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0]], "primary_keys": ["did"], "foreign_keys": [], "unique_constraints": [[[0, 0, "did"]]], "check_constraints": []}, "domain_author": {"columns": [[0, "aid", "INT", 0, null, 2], [1, "did", "INT", 0, null, 1]], "primary_keys": ["aid", "did"], "foreign_keys": [[0, 0, "domain", "did", "did", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "author", "aid", "aid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "did"], [1, 0, "aid"]]], "check_constraints": []}, "domain_conference": {"columns": [[0, "cid", "INT", 0, null, 2], [1, "did", "INT", 0, null, 1]], "primary_keys": ["cid", "did"], "foreign_keys": [[0, 0, "domain", "did", "did", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "conference", "cid", "cid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "did"], [1, 0, "cid"]]], "check_constraints": []}, "journal": {"columns": [[0, "homepage", "TEXT", 0, null, 0], [1, "jid", "INT", 0, null, 1], [2, "name", "TEXT", 0, null, 0]], "primary_keys": ["jid"], "foreign_keys": [], "unique_constraints": [[[0, 1, "jid"]]], "check_constraints": []}, "domain_journal": {"columns": [[0, "did", "INT", 0, null, 1], [1, "jid", "INT", 0, null, 2]], "primary_keys": ["did", "jid"], "foreign_keys": [[0, 0, "domain", "did", "did", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "journal", "jid", "jid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "did"], [1, 1, "jid"]]], "check_constraints": []}, "keyword": {"columns": [[0, "keyword", "TEXT", 0, null, 0], [1, "kid", "INT", 0, null, 1]], "primary_keys": ["kid"], "foreign_keys": [], "unique_constraints": [[[0, 1, "kid"]]], "check_constraints": []}, "domain_keyword": {"columns": [[0, "did", "INT", 0, null, 1], [1, "kid", "INT", 0, null, 2]], "primary_keys": ["did", "kid"], "foreign_keys": [[0, 0, "domain", "did", "did", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "keyword", "kid", "kid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "did"], [1, 1, "kid"]]], "check_constraints": []}, "publication": {"columns": [[0, "abstract", "TEXT", 0, null, 0], [1, "cid", "TEXT", 0, null, 0], [2, "citation_num", "INT", 0, null, 0], [3, "jid", "INT", 0, null, 0], [4, "pid", "INT", 0, null, 1], [5, "reference_num", "INT", 0, null, 0], [6, "title", "TEXT", 0, null, 0], [7, "year", "INT", 0, null, 0]], "primary_keys": ["pid"], "foreign_keys": [[0, 0, "conference", "cid", "cid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "journal", "jid", "jid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 4, "pid"]]], "check_constraints": []}, "domain_publication": {"columns": [[0, "did", "INT", 0, null, 1], [1, "pid", "INT", 0, null, 2]], "primary_keys": ["did", "pid"], "foreign_keys": [[0, 0, "domain", "did", "did", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "publication", "pid", "pid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "did"], [1, 1, "pid"]]], "check_constraints": []}, "organization": {"columns": [[0, "continent", "TEXT", 0, null, 0], [1, "homepage", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0], [3, "oid", "INT", 0, null, 1]], "primary_keys": ["oid"], "foreign_keys": [], "unique_constraints": [[[0, 3, "oid"]]], "check_constraints": []}, "publication_keyword": {"columns": [[0, "pid", "INT", 0, null, 2], [1, "kid", "INT", 0, null, 1]], "primary_keys": ["pid", "kid"], "foreign_keys": [[0, 0, "keyword", "kid", "kid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "publication", "pid", "pid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "kid"], [1, 0, "pid"]]], "check_constraints": []}, "writes": {"columns": [[0, "aid", "INT", 0, null, 1], [1, "pid", "INT", 0, null, 2]], "primary_keys": ["aid", "pid"], "foreign_keys": [[0, 0, "author", "aid", "aid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "publication", "pid", "pid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "aid"], [1, 1, "pid"]]], "check_constraints": []}, "cite": {"columns": [[0, "cited", "INT", 0, null, 0], [1, "citing", "INT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "publication", "citing", "pid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "publication", "cited", "pid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE author ( aid INT PRIMARY KEY, homepage TEXT, name TEXT, oid INT, UNIQUE (aid) ); CREATE TABLE conference ( cid INT PRIMARY KEY, homepage TEXT, name TEXT, UNIQUE (cid) ); CREATE TABLE domain ( did INT PRIMARY KEY, name TEXT, UNIQUE (did) ); CREATE TABLE domain_author ( aid INT PRIMARY KEY, did INT PRIMARY KEY, PRIMARY KEY (aid, did), UNIQUE (did, aid), FOREIGN KEY (did) REFERENCES domain(did), FOREIGN KEY (aid) REFERENCES author(aid) ); CREATE TABLE domain_conference ( cid INT PRIMARY KEY, did INT PRIMARY KEY, PRIMARY KEY (cid, did), UNIQUE (did, cid), FOREIGN KEY (did) REFERENCES domain(did), FOREIGN KEY (cid) REFERENCES conference(cid) ); CREATE TABLE journal ( homepage TEXT, jid INT PRIMARY KEY, name TEXT, UNIQUE (jid) ); CREATE TABLE domain_journal ( did INT PRIMARY KEY, jid INT PRIMARY KEY, PRIMARY KEY (did, jid), UNIQUE (did, jid), FOREIGN KEY (did) REFERENCES domain(did), FOREIGN KEY (jid) REFERENCES journal(jid) ); CREATE TABLE keyword ( keyword TEXT, kid INT PRIMARY KEY, UNIQUE (kid) ); CREATE TABLE domain_keyword ( did INT PRIMARY KEY, kid INT PRIMARY KEY, PRIMARY KEY (did, kid), UNIQUE (did, kid), FOREIGN KEY (did) REFERENCES domain(did), FOREIGN KEY (kid) REFERENCES keyword(kid) ); CREATE TABLE publication ( abstract TEXT, cid TEXT, citation_num INT, jid INT, pid INT PRIMARY KEY, reference_num INT, title TEXT, year INT, UNIQUE (pid), FOREIGN KEY (cid) REFERENCES conference(cid), FOREIGN KEY (jid) REFERENCES journal(jid) ); CREATE TABLE domain_publication ( did INT PRIMARY KEY, pid INT PRIMARY KEY, PRIMARY KEY (did, pid), UNIQUE (did, pid), FOREIGN KEY (did) REFERENCES domain(did), FOREIGN KEY (pid) REFERENCES publication(pid) ); CREATE TABLE organization ( continent TEXT, homepage TEXT, name TEXT, oid INT PRIMARY KEY, UNIQUE (oid) ); CREATE TABLE publication_keyword ( pid INT PRIMARY KEY, kid INT PRIMARY KEY, PRIMARY KEY (pid, kid), UNIQUE (kid, pid), FOREIGN KEY (kid) REFERENCES keyword(kid), FOREIGN KEY (pid) REFERENCES publication(pid) ); CREATE TABLE writes ( aid INT PRIMARY KEY, pid INT PRIMARY KEY, PRIMARY KEY (aid, pid), UNIQUE (aid, pid), FOREIGN KEY (aid) REFERENCES author(aid), FOREIGN KEY (pid) REFERENCES publication(pid) ); CREATE TABLE cite ( cited INT, citing INT, FOREIGN KEY (citing) REFERENCES publication(pid), FOREIGN KEY (cited) REFERENCES publication(pid) );
flight_1
{"flight": {"columns": [[0, "flno", "number(4,0)", 0, null, 1], [1, "origin", "varchar2(20)", 0, null, 0], [2, "destination", "varchar2(20)", 0, null, 0], [3, "distance", "number(6,0)", 0, null, 0], [4, "departure_date", "date", 0, null, 0], [5, "arrival_date", "date", 0, null, 0], [6, "price", "number(7,2)", 0, null, 0], [7, "aid", "number(9,0)", 0, null, 0]], "primary_keys": ["flno"], "foreign_keys": [[0, 0, "aircraft", "aid", "aid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "flno"]]], "check_constraints": []}, "aircraft": {"columns": [[0, "aid", "number(9,0)", 0, null, 1], [1, "name", "varchar2(30)", 0, null, 0], [2, "distance", "number(6,0)", 0, null, 0]], "primary_keys": ["aid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "aid"]]], "check_constraints": []}, "employee": {"columns": [[0, "eid", "number(9,0)", 0, null, 1], [1, "name", "varchar2(30)", 0, null, 0], [2, "salary", "number(10,2)", 0, null, 0]], "primary_keys": ["eid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "eid"]]], "check_constraints": []}, "certificate": {"columns": [[0, "eid", "number(9,0)", 0, null, 1], [1, "aid", "number(9,0)", 0, null, 2]], "primary_keys": ["eid", "aid"], "foreign_keys": [[0, 0, "aircraft", "aid", "aid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "employee", "eid", "eid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "eid"], [1, 1, "aid"]]], "check_constraints": []}}
CREATE TABLE flight ( flno number(4,0) PRIMARY KEY, origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, arrival_date date, price number(7,2), aid number(9,0), UNIQUE (flno), FOREIGN KEY (aid) REFERENCES aircraft(aid) ); CREATE TABLE aircraft ( aid number(9,0) PRIMARY KEY, name varchar2(30), distance number(6,0), UNIQUE (aid) ); CREATE TABLE employee ( eid number(9,0) PRIMARY KEY, name varchar2(30), salary number(10,2), UNIQUE (eid) ); CREATE TABLE certificate ( eid number(9,0) PRIMARY KEY, aid number(9,0) PRIMARY KEY, PRIMARY KEY (eid, aid), UNIQUE (eid, aid), FOREIGN KEY (aid) REFERENCES aircraft(aid), FOREIGN KEY (eid) REFERENCES employee(eid) );
wine_1
{"grapes": {"columns": [[0, "ID", "INTEGER", 0, null, 1], [1, "Grape", "TEXT", 0, null, 0], [2, "Color", "TEXT", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Grape"]]], "check_constraints": []}, "appellations": {"columns": [[0, "No", "INTEGER", 0, null, 1], [1, "Appelation", "TEXT", 0, null, 0], [2, "County", "TEXT", 0, null, 0], [3, "State", "TEXT", 0, null, 0], [4, "Area", "TEXT", 0, null, 0], [5, "isAVA", "TEXT", 0, null, 0]], "primary_keys": ["No"], "foreign_keys": [], "unique_constraints": [[[0, 1, "Appelation"]]], "check_constraints": []}, "wine": {"columns": [[0, "No", "INTEGER", 0, null, 0], [1, "Grape", "TEXT", 0, null, 0], [2, "Winery", "TEXT", 0, null, 0], [3, "Appelation", "TEXT", 0, null, 0], [4, "State", "TEXT", 0, null, 0], [5, "Name", "TEXT", 0, null, 0], [6, "Year", "INTEGER", 0, null, 0], [7, "Price", "INTEGER", 0, null, 0], [8, "Score", "INTEGER", 0, null, 0], [9, "Cases", "INTEGER", 0, null, 0], [10, "Drink", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "appellations", "Appelation", "Appelation", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "grapes", "Grape", "Grape", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE grapes ( ID INTEGER PRIMARY KEY, Grape TEXT, Color TEXT, UNIQUE (Grape) ); CREATE TABLE appellations ( No INTEGER PRIMARY KEY, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT, UNIQUE (Appelation) ); CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT, FOREIGN KEY (Appelation) REFERENCES appellations(Appelation), FOREIGN KEY (Grape) REFERENCES grapes(Grape) );
bike_1
{"station": {"columns": [[0, "id", "INTEGER", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "lat", "NUMERIC", 0, null, 0], [3, "long", "NUMERIC", 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": [[0, 0, "station", "station_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "trip": {"columns": [[0, "id", "INTEGER", 0, 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", "NUMERIC", 0, null, 0], [11, "mean_sea_level_pressure_inches", "NUMERIC", 0, null, 0], [12, "min_sea_level_pressure_inches", "NUMERIC", 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", "INTEGER", 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", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE station ( id INTEGER PRIMARY KEY, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ); CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT, FOREIGN KEY (station_id) REFERENCES station(id) ); CREATE TABLE trip ( id INTEGER 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 NUMERIC, mean_sea_level_pressure_inches NUMERIC, min_sea_level_pressure_inches NUMERIC, 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 INTEGER, cloud_cover INTEGER, events TEXT, wind_dir_degrees INTEGER, zip_code INTEGER );
tracking_grants_for_research
{"Document_Types": {"columns": [[0, "document_type_code", "VARCHAR(10)", 0, null, 1], [1, "document_description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["document_type_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "document_type_code"]]], "check_constraints": []}, "Documents": {"columns": [[0, "document_id", "INTEGER", 0, null, 1], [1, "document_type_code", "VARCHAR(10)", 0, null, 0], [2, "grant_id", "INTEGER", 1, null, 0], [3, "sent_date", "DATETIME", 1, null, 0], [4, "response_received_date", "DATETIME", 1, null, 0], [5, "other_details", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["document_id"], "foreign_keys": [[0, 0, "Grants", "grant_id", "grant_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Document_Types", "document_type_code", "document_type_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Grants": {"columns": [[0, "grant_id", "INTEGER", 0, null, 1], [1, "organisation_id", "INTEGER", 1, null, 0], [2, "grant_amount", "DECIMAL(19,4)", 1, "0", 0], [3, "grant_start_date", "DATETIME", 1, null, 0], [4, "grant_end_date", "DATETIME", 1, null, 0], [5, "other_details", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["grant_id"], "foreign_keys": [[0, 0, "Organisations", "organisation_id", "organisation_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Organisation_Types": {"columns": [[0, "organisation_type", "VARCHAR(10)", 0, null, 1], [1, "organisation_type_description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["organisation_type"], "foreign_keys": [], "unique_constraints": [[[0, 0, "organisation_type"]]], "check_constraints": []}, "Organisations": {"columns": [[0, "organisation_id", "INTEGER", 0, null, 1], [1, "organisation_type", "VARCHAR(10)", 1, null, 0], [2, "organisation_details", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["organisation_id"], "foreign_keys": [[0, 0, "Organisation_Types", "organisation_type", "organisation_type", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Project_Outcomes": {"columns": [[0, "project_id", "INTEGER", 1, null, 0], [1, "outcome_code", "VARCHAR(10)", 1, null, 0], [2, "outcome_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Research_Outcomes", "outcome_code", "outcome_code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Projects", "project_id", "project_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Project_Staff": {"columns": [[0, "staff_id", "DOUBLE", 0, null, 1], [1, "project_id", "INTEGER", 1, null, 0], [2, "role_code", "VARCHAR(10)", 1, null, 0], [3, "date_from", "DATETIME", 0, null, 0], [4, "date_to", "DATETIME", 0, null, 0], [5, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["staff_id"], "foreign_keys": [[0, 0, "Staff_Roles", "role_code", "role_code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Projects", "project_id", "project_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "staff_id"]]], "check_constraints": []}, "Projects": {"columns": [[0, "project_id", "INTEGER", 0, null, 1], [1, "organisation_id", "INTEGER", 1, null, 0], [2, "project_details", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["project_id"], "foreign_keys": [[0, 0, "Organisations", "organisation_id", "organisation_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Research_Outcomes": {"columns": [[0, "outcome_code", "VARCHAR(10)", 0, null, 1], [1, "outcome_description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["outcome_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "outcome_code"]]], "check_constraints": []}, "Research_Staff": {"columns": [[0, "staff_id", "INTEGER", 0, null, 1], [1, "employer_organisation_id", "INTEGER", 1, null, 0], [2, "staff_details", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["staff_id"], "foreign_keys": [[0, 0, "Organisations", "employer_organisation_id", "organisation_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Staff_Roles": {"columns": [[0, "role_code", "VARCHAR(10)", 0, null, 1], [1, "role_description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["role_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "role_code"]]], "check_constraints": []}, "Tasks": {"columns": [[0, "task_id", "INTEGER", 0, null, 1], [1, "project_id", "INTEGER", 1, null, 0], [2, "task_details", "VARCHAR(255)", 1, null, 0], [3, "eg Agree Objectives", "VARCHAR(1)", 0, null, 0]], "primary_keys": ["task_id"], "foreign_keys": [[0, 0, "Projects", "project_id", "project_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Document_Types ( document_type_code VARCHAR(10) PRIMARY KEY, document_description VARCHAR(255) NOT NULL, UNIQUE (document_type_code) ); CREATE TABLE Documents ( document_id INTEGER PRIMARY KEY, document_type_code VARCHAR(10), grant_id INTEGER NOT NULL, sent_date DATETIME NOT NULL, response_received_date DATETIME NOT NULL, other_details VARCHAR(255) NOT NULL, FOREIGN KEY (grant_id) REFERENCES Grants(grant_id), FOREIGN KEY (document_type_code) REFERENCES Document_Types(document_type_code) ); CREATE TABLE Grants ( grant_id INTEGER PRIMARY KEY, organisation_id INTEGER NOT NULL, grant_amount DECIMAL(19,4) NOT NULL DEFAULT 0, grant_start_date DATETIME NOT NULL, grant_end_date DATETIME NOT NULL, other_details VARCHAR(255) NOT NULL, FOREIGN KEY (organisation_id) REFERENCES Organisations(organisation_id) ); CREATE TABLE Organisation_Types ( organisation_type VARCHAR(10) PRIMARY KEY, organisation_type_description VARCHAR(255) NOT NULL, UNIQUE (organisation_type) ); CREATE TABLE Organisations ( organisation_id INTEGER PRIMARY KEY, organisation_type VARCHAR(10) NOT NULL, organisation_details VARCHAR(255) NOT NULL, FOREIGN KEY (organisation_type) REFERENCES Organisation_Types(organisation_type) ); CREATE TABLE Project_Outcomes ( project_id INTEGER NOT NULL, outcome_code VARCHAR(10) NOT NULL, outcome_details VARCHAR(255), FOREIGN KEY (outcome_code) REFERENCES Research_Outcomes(outcome_code), FOREIGN KEY (project_id) REFERENCES Projects(project_id) ); CREATE TABLE Project_Staff ( staff_id DOUBLE PRIMARY KEY, project_id INTEGER NOT NULL, role_code VARCHAR(10) NOT NULL, date_from DATETIME, date_to DATETIME, other_details VARCHAR(255), UNIQUE (staff_id), FOREIGN KEY (role_code) REFERENCES Staff_Roles(role_code), FOREIGN KEY (project_id) REFERENCES Projects(project_id) ); CREATE TABLE Projects ( project_id INTEGER PRIMARY KEY, organisation_id INTEGER NOT NULL, project_details VARCHAR(255) NOT NULL, FOREIGN KEY (organisation_id) REFERENCES Organisations(organisation_id) ); CREATE TABLE Research_Outcomes ( outcome_code VARCHAR(10) PRIMARY KEY, outcome_description VARCHAR(255) NOT NULL, UNIQUE (outcome_code) ); CREATE TABLE Research_Staff ( staff_id INTEGER PRIMARY KEY, employer_organisation_id INTEGER NOT NULL, staff_details VARCHAR(255) NOT NULL, FOREIGN KEY (employer_organisation_id) REFERENCES Organisations(organisation_id) ); CREATE TABLE Staff_Roles ( role_code VARCHAR(10) PRIMARY KEY, role_description VARCHAR(255) NOT NULL, UNIQUE (role_code) ); CREATE TABLE Tasks ( task_id INTEGER PRIMARY KEY, project_id INTEGER NOT NULL, task_details VARCHAR(255) NOT NULL, eg Agree Objectives VARCHAR(1), FOREIGN KEY (project_id) REFERENCES Projects(project_id) );
local_govt_in_alabama
{"Services": {"columns": [[0, "Service_ID", "INTEGER", 1, null, 1], [1, "Service_Type_Code", "CHAR(15)", 1, null, 0]], "primary_keys": ["Service_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Participants": {"columns": [[0, "Participant_ID", "INTEGER", 1, null, 1], [1, "Participant_Type_Code", "CHAR(15)", 1, null, 0], [2, "Participant_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Participant_ID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Events": {"columns": [[0, "Event_ID", "INTEGER", 1, null, 1], [1, "Service_ID", "INTEGER", 1, null, 0], [2, "Event_Details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["Event_ID"], "foreign_keys": [[0, 0, "Services", "Service_ID", "Service_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Participants_in_Events": {"columns": [[0, "Event_ID", "INTEGER", 1, null, 1], [1, "Participant_ID", "INTEGER", 1, null, 2]], "primary_keys": ["Event_ID", "Participant_ID"], "foreign_keys": [[0, 0, "Events", "Event_ID", "Event_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Participants", "Participant_ID", "Participant_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Event_ID"], [1, 1, "Participant_ID"]]], "check_constraints": []}}
CREATE TABLE Services ( Service_ID INTEGER NOT NULL PRIMARY KEY, Service_Type_Code CHAR(15) NOT NULL ); CREATE TABLE Participants ( Participant_ID INTEGER NOT NULL PRIMARY KEY, Participant_Type_Code CHAR(15) NOT NULL, Participant_Details VARCHAR(255) ); CREATE TABLE Events ( Event_ID INTEGER NOT NULL PRIMARY KEY, Service_ID INTEGER NOT NULL, Event_Details VARCHAR(255), FOREIGN KEY (Service_ID) REFERENCES Services(Service_ID) ); CREATE TABLE Participants_in_Events ( Event_ID INTEGER NOT NULL PRIMARY KEY, Participant_ID INTEGER NOT NULL PRIMARY KEY, PRIMARY KEY (Event_ID, Participant_ID), UNIQUE (Event_ID, Participant_ID), FOREIGN KEY (Event_ID) REFERENCES Events(Event_ID), FOREIGN KEY (Participant_ID) REFERENCES Participants(Participant_ID) );
game_injury
{"stadium": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "Home_Games", "INT", 0, null, 0], [3, "Average_Attendance", "REAL", 0, null, 0], [4, "Total_Attendance", "REAL", 0, null, 0], [5, "Capacity_Percentage", "REAL", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "game": {"columns": [[0, "stadium_id", "INT", 0, null, 0], [1, "id", "INT", 0, null, 1], [2, "Season", "INT", 0, null, 0], [3, "Date", "TEXT", 0, null, 0], [4, "Home_team", "TEXT", 0, null, 0], [5, "Away_team", "TEXT", 0, null, 0], [6, "Score", "TEXT", 0, null, 0], [7, "Competition", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "stadium", "stadium_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "id"]]], "check_constraints": []}, "injury_accident": {"columns": [[0, "game_id", "INT", 0, null, 0], [1, "id", "INT", 0, null, 1], [2, "Player", "TEXT", 0, null, 0], [3, "Injury", "TEXT", 0, null, 0], [4, "Number_of_matches", "TEXT", 0, null, 0], [5, "Source", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "game", "game_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "id"]]], "check_constraints": []}}
CREATE TABLE stadium ( id INT PRIMARY KEY, name TEXT, Home_Games INT, Average_Attendance REAL, Total_Attendance REAL, Capacity_Percentage REAL, UNIQUE (id) ); CREATE TABLE game ( stadium_id INT, id INT PRIMARY KEY, Season INT, Date TEXT, Home_team TEXT, Away_team TEXT, Score TEXT, Competition TEXT, UNIQUE (id), FOREIGN KEY (stadium_id) REFERENCES stadium(id) ); CREATE TABLE injury_accident ( game_id INT, id INT PRIMARY KEY, Player TEXT, Injury TEXT, Number_of_matches TEXT, Source TEXT, UNIQUE (id), FOREIGN KEY (game_id) REFERENCES game(id) );
coffee_shop
{"shop": {"columns": [[0, "Shop_ID", "INT", 0, null, 1], [1, "Address", "TEXT", 0, null, 0], [2, "Num_of_staff", "TEXT", 0, null, 0], [3, "Score", "REAL", 0, null, 0], [4, "Open_Year", "TEXT", 0, null, 0]], "primary_keys": ["Shop_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Shop_ID"]]], "check_constraints": []}, "member": {"columns": [[0, "Member_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Membership_card", "TEXT", 0, null, 0], [3, "Age", "INT", 0, null, 0], [4, "Time_of_purchase", "INT", 0, null, 0], [5, "Level_of_membership", "INT", 0, null, 0], [6, "Address", "TEXT", 0, null, 0]], "primary_keys": ["Member_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Member_ID"]]], "check_constraints": []}, "happy_hour": {"columns": [[0, "HH_ID", "INT", 0, null, 1], [1, "Shop_ID", "INT", 0, null, 2], [2, "Month", "TEXT", 0, null, 3], [3, "Num_of_shaff_in_charge", "INT", 0, null, 0]], "primary_keys": ["HH_ID", "Shop_ID", "Month"], "foreign_keys": [[0, 0, "shop", "Shop_ID", "Shop_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "HH_ID"], [1, 1, "Shop_ID"], [2, 2, "Month"]]], "check_constraints": []}, "happy_hour_member": {"columns": [[0, "HH_ID", "INT", 0, null, 1], [1, "Member_ID", "INT", 0, null, 2], [2, "Total_amount", "REAL", 0, null, 0]], "primary_keys": ["HH_ID", "Member_ID"], "foreign_keys": [[0, 0, "member", "Member_ID", "Member_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "HH_ID"], [1, 1, "Member_ID"]]], "check_constraints": []}}
CREATE TABLE shop ( Shop_ID INT PRIMARY KEY, Address TEXT, Num_of_staff TEXT, Score REAL, Open_Year TEXT, UNIQUE (Shop_ID) ); CREATE TABLE member ( Member_ID INT PRIMARY KEY, Name TEXT, Membership_card TEXT, Age INT, Time_of_purchase INT, Level_of_membership INT, Address TEXT, UNIQUE (Member_ID) ); CREATE TABLE happy_hour ( HH_ID INT PRIMARY KEY, Shop_ID INT PRIMARY KEY, Month TEXT PRIMARY KEY, Num_of_shaff_in_charge INT, PRIMARY KEY (HH_ID, Shop_ID, Month), UNIQUE (HH_ID, Shop_ID, Month), FOREIGN KEY (Shop_ID) REFERENCES shop(Shop_ID) ); CREATE TABLE happy_hour_member ( HH_ID INT PRIMARY KEY, Member_ID INT PRIMARY KEY, Total_amount REAL, PRIMARY KEY (HH_ID, Member_ID), UNIQUE (HH_ID, Member_ID), FOREIGN KEY (Member_ID) REFERENCES member(Member_ID) );
perpetrator
{"perpetrator": {"columns": [[0, "Perpetrator_ID", "INT", 0, null, 1], [1, "People_ID", "INT", 0, null, 0], [2, "Date", "TEXT", 0, null, 0], [3, "Year", "REAL", 0, null, 0], [4, "Location", "TEXT", 0, null, 0], [5, "Country", "TEXT", 0, null, 0], [6, "Killed", "INT", 0, null, 0], [7, "Injured", "INT", 0, null, 0]], "primary_keys": ["Perpetrator_ID"], "foreign_keys": [[0, 0, "people", "People_ID", "People_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Perpetrator_ID"]]], "check_constraints": []}, "people": {"columns": [[0, "People_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Height", "REAL", 0, null, 0], [3, "Weight", "REAL", 0, null, 0], [4, "Home Town", "TEXT", 0, null, 0]], "primary_keys": ["People_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "People_ID"]]], "check_constraints": []}}
CREATE TABLE perpetrator ( Perpetrator_ID INT PRIMARY KEY, People_ID INT, Date TEXT, Year REAL, Location TEXT, Country TEXT, Killed INT, Injured INT, UNIQUE (Perpetrator_ID), FOREIGN KEY (People_ID) REFERENCES people(People_ID) ); CREATE TABLE people ( People_ID INT PRIMARY KEY, Name TEXT, Height REAL, Weight REAL, Home Town TEXT, UNIQUE (People_ID) );
browser_web
{"Web_client_accelerator": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "Operating_system", "TEXT", 0, null, 0], [3, "Client", "TEXT", 0, null, 0], [4, "Connection", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "browser": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "market_share", "REAL", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "accelerator_compatible_browser": {"columns": [[0, "accelerator_id", "INT", 0, null, 1], [1, "browser_id", "INT", 0, null, 2], [2, "compatible_since_year", "INT", 0, null, 0]], "primary_keys": ["accelerator_id", "browser_id"], "foreign_keys": [[0, 0, "browser", "browser_id", "id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Web_client_accelerator", "accelerator_id", "id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "accelerator_id"], [1, 1, "browser_id"]]], "check_constraints": []}}
CREATE TABLE Web_client_accelerator ( id INT PRIMARY KEY, name TEXT, Operating_system TEXT, Client TEXT, Connection TEXT, UNIQUE (id) ); CREATE TABLE browser ( id INT PRIMARY KEY, name TEXT, market_share REAL, UNIQUE (id) ); CREATE TABLE accelerator_compatible_browser ( accelerator_id INT PRIMARY KEY, browser_id INT PRIMARY KEY, compatible_since_year INT, PRIMARY KEY (accelerator_id, browser_id), UNIQUE (accelerator_id, browser_id), FOREIGN KEY (browser_id) REFERENCES browser(id), FOREIGN KEY (accelerator_id) REFERENCES Web_client_accelerator(id) );
decoration_competition
{"college": {"columns": [[0, "College_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Leader_Name", "TEXT", 0, null, 0], [3, "College_Location", "TEXT", 0, null, 0]], "primary_keys": ["College_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "College_ID"]]], "check_constraints": []}, "member": {"columns": [[0, "Member_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Country", "TEXT", 0, null, 0], [3, "College_ID", "INT", 0, null, 0]], "primary_keys": ["Member_ID"], "foreign_keys": [[0, 0, "college", "College_ID", "College_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Member_ID"]]], "check_constraints": []}, "round": {"columns": [[0, "Round_ID", "INT", 0, null, 2], [1, "Member_ID", "INT", 0, null, 1], [2, "Decoration_Theme", "TEXT", 0, null, 0], [3, "Rank_in_Round", "INT", 0, null, 0]], "primary_keys": ["Round_ID", "Member_ID"], "foreign_keys": [[0, 0, "member", "Member_ID", "Member_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "Member_ID"], [1, 0, "Round_ID"]]], "check_constraints": []}}
CREATE TABLE college ( College_ID INT PRIMARY KEY, Name TEXT, Leader_Name TEXT, College_Location TEXT, UNIQUE (College_ID) ); CREATE TABLE member ( Member_ID INT PRIMARY KEY, Name TEXT, Country TEXT, College_ID INT, UNIQUE (Member_ID), FOREIGN KEY (College_ID) REFERENCES college(College_ID) ); CREATE TABLE round ( Round_ID INT PRIMARY KEY, Member_ID INT PRIMARY KEY, Decoration_Theme TEXT, Rank_in_Round INT, PRIMARY KEY (Round_ID, Member_ID), UNIQUE (Member_ID, Round_ID), FOREIGN KEY (Member_ID) REFERENCES member(Member_ID) );
candidate_poll
{"candidate": {"columns": [[0, "Candidate_ID", "INT", 0, null, 1], [1, "People_ID", "INT", 0, null, 0], [2, "Poll_Source", "TEXT", 0, null, 0], [3, "Date", "TEXT", 0, null, 0], [4, "Support_rate", "REAL", 0, null, 0], [5, "Consider_rate", "REAL", 0, null, 0], [6, "Oppose_rate", "REAL", 0, null, 0], [7, "Unsure_rate", "REAL", 0, null, 0]], "primary_keys": ["Candidate_ID"], "foreign_keys": [[0, 0, "people", "People_ID", "People_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Candidate_ID"]]], "check_constraints": []}, "people": {"columns": [[0, "People_ID", "INT", 0, null, 1], [1, "Sex", "TEXT", 0, null, 0], [2, "Name", "TEXT", 0, null, 0], [3, "Date_of_Birth", "TEXT", 0, null, 0], [4, "Height", "REAL", 0, null, 0], [5, "Weight", "REAL", 0, null, 0]], "primary_keys": ["People_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "People_ID"]]], "check_constraints": []}}
CREATE TABLE candidate ( Candidate_ID INT PRIMARY KEY, People_ID INT, Poll_Source TEXT, Date TEXT, Support_rate REAL, Consider_rate REAL, Oppose_rate REAL, Unsure_rate REAL, UNIQUE (Candidate_ID), FOREIGN KEY (People_ID) REFERENCES people(People_ID) ); CREATE TABLE people ( People_ID INT PRIMARY KEY, Sex TEXT, Name TEXT, Date_of_Birth TEXT, Height REAL, Weight REAL, UNIQUE (People_ID) );
performance_attendance
{"member": {"columns": [[0, "Member_ID", "TEXT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Nationality", "TEXT", 0, null, 0], [3, "Role", "TEXT", 0, null, 0]], "primary_keys": ["Member_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Member_ID"]]], "check_constraints": []}, "performance": {"columns": [[0, "Performance_ID", "REAL", 0, null, 1], [1, "Date", "TEXT", 0, null, 0], [2, "Host", "TEXT", 0, null, 0], [3, "Location", "TEXT", 0, null, 0], [4, "Attendance", "INT", 0, null, 0]], "primary_keys": ["Performance_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Performance_ID"]]], "check_constraints": []}, "member_attendance": {"columns": [[0, "Member_ID", "INT", 0, null, 1], [1, "Performance_ID", "INT", 0, null, 2], [2, "Num_of_Pieces", "INT", 0, null, 0]], "primary_keys": ["Member_ID", "Performance_ID"], "foreign_keys": [[0, 0, "performance", "Performance_ID", "Performance_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "member", "Member_ID", "Member_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Member_ID"], [1, 1, "Performance_ID"]]], "check_constraints": []}}
CREATE TABLE member ( Member_ID TEXT PRIMARY KEY, Name TEXT, Nationality TEXT, Role TEXT, UNIQUE (Member_ID) ); CREATE TABLE performance ( Performance_ID REAL PRIMARY KEY, Date TEXT, Host TEXT, Location TEXT, Attendance INT, UNIQUE (Performance_ID) ); CREATE TABLE member_attendance ( Member_ID INT PRIMARY KEY, Performance_ID INT PRIMARY KEY, Num_of_Pieces INT, PRIMARY KEY (Member_ID, Performance_ID), UNIQUE (Member_ID, Performance_ID), FOREIGN KEY (Performance_ID) REFERENCES performance(Performance_ID), FOREIGN KEY (Member_ID) REFERENCES member(Member_ID) );
phone_1
{"chip_model": {"columns": [[0, "Model_name", "TEXT", 0, null, 1], [1, "Launch_year", "REAL", 0, null, 0], [2, "RAM_MiB", "REAL", 0, null, 0], [3, "ROM_MiB", "REAL", 0, null, 0], [4, "Slots", "TEXT", 0, null, 0], [5, "WiFi", "TEXT", 0, null, 0], [6, "Bluetooth", "TEXT", 0, null, 0]], "primary_keys": ["Model_name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Model_name"]]], "check_constraints": []}, "screen_mode": {"columns": [[0, "Graphics_mode", "REAL", 0, null, 1], [1, "Char_cells", "TEXT", 0, null, 0], [2, "Pixels", "TEXT", 0, null, 0], [3, "Hardware_colours", "REAL", 0, null, 0], [4, "used_kb", "REAL", 0, null, 0], [5, "map", "TEXT", 0, null, 0], [6, "Type", "TEXT", 0, null, 0]], "primary_keys": ["Graphics_mode"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Graphics_mode"]]], "check_constraints": []}, "phone": {"columns": [[0, "Company_name", "TEXT", 0, null, 0], [1, "Hardware_Model_name", "TEXT", 0, null, 1], [2, "Accreditation_type", "TEXT", 0, null, 0], [3, "Accreditation_level", "TEXT", 0, null, 0], [4, "Date", "TEXT", 0, null, 0], [5, "chip_model", "TEXT", 0, null, 0], [6, "screen_mode", "TEXT", 0, null, 0]], "primary_keys": ["Hardware_Model_name"], "foreign_keys": [[0, 0, "chip_model", "chip_model", "Model_name", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "screen_mode", "screen_mode", "Graphics_mode", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "Hardware_Model_name"]]], "check_constraints": []}}
CREATE TABLE chip_model ( Model_name TEXT PRIMARY KEY, Launch_year REAL, RAM_MiB REAL, ROM_MiB REAL, Slots TEXT, WiFi TEXT, Bluetooth TEXT, UNIQUE (Model_name) ); CREATE TABLE screen_mode ( Graphics_mode REAL PRIMARY KEY, Char_cells TEXT, Pixels TEXT, Hardware_colours REAL, used_kb REAL, map TEXT, Type TEXT, UNIQUE (Graphics_mode) ); CREATE TABLE phone ( Company_name TEXT, Hardware_Model_name TEXT PRIMARY KEY, Accreditation_type TEXT, Accreditation_level TEXT, Date TEXT, chip_model TEXT, screen_mode TEXT, UNIQUE (Hardware_Model_name), FOREIGN KEY (chip_model) REFERENCES chip_model(Model_name), FOREIGN KEY (screen_mode) REFERENCES screen_mode(Graphics_mode) );
wta_1
{"players": {"columns": [[0, "player_id", "INT", 0, null, 1], [1, "first_name", "TEXT", 0, null, 0], [2, "last_name", "TEXT", 0, null, 0], [3, "hand", "TEXT", 0, null, 0], [4, "birth_date", "DATE", 0, null, 0], [5, "country_code", "TEXT", 0, null, 0]], "primary_keys": ["player_id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "player_id"]]], "check_constraints": []}, "matches": {"columns": [[0, "best_of", "INT", 0, null, 0], [1, "draw_size", "INT", 0, null, 0], [2, "loser_age", "FLOAT", 0, null, 0], [3, "loser_entry", "TEXT", 0, null, 0], [4, "loser_hand", "TEXT", 0, null, 0], [5, "loser_ht", "INT", 0, null, 0], [6, "loser_id", "INT", 0, null, 0], [7, "loser_ioc", "TEXT", 0, null, 0], [8, "loser_name", "TEXT", 0, null, 0], [9, "loser_rank", "INT", 0, null, 0], [10, "loser_rank_points", "INT", 0, null, 0], [11, "loser_seed", "INT", 0, null, 0], [12, "match_num", "INT", 0, null, 0], [13, "minutes", "INT", 0, null, 0], [14, "round", "TEXT", 0, null, 0], [15, "score", "TEXT", 0, null, 0], [16, "surface", "TEXT", 0, null, 0], [17, "tourney_date", "DATE", 0, null, 0], [18, "tourney_id", "TEXT", 0, null, 0], [19, "tourney_level", "TEXT", 0, null, 0], [20, "tourney_name", "TEXT", 0, null, 0], [21, "winner_age", "FLOAT", 0, null, 0], [22, "winner_entry", "TEXT", 0, null, 0], [23, "winner_hand", "TEXT", 0, null, 0], [24, "winner_ht", "INT", 0, null, 0], [25, "winner_id", "INT", 0, null, 0], [26, "winner_ioc", "TEXT", 0, null, 0], [27, "winner_name", "TEXT", 0, null, 0], [28, "winner_rank", "INT", 0, null, 0], [29, "winner_rank_points", "INT", 0, null, 0], [30, "winner_seed", "INT", 0, null, 0], [31, "year", "INT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "players", "winner_id", "player_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "players", "loser_id", "player_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "rankings": {"columns": [[0, "ranking_date", "DATE", 0, null, 0], [1, "ranking", "INT", 0, null, 0], [2, "player_id", "INT", 0, null, 0], [3, "ranking_points", "INT", 0, null, 0], [4, "tours", "INT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "players", "player_id", "player_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE players ( player_id INT PRIMARY KEY, first_name TEXT, last_name TEXT, hand TEXT, birth_date DATE, country_code TEXT, UNIQUE (player_id) ); CREATE TABLE matches ( best_of INT, draw_size INT, loser_age FLOAT, loser_entry TEXT, loser_hand TEXT, loser_ht INT, loser_id INT, loser_ioc TEXT, loser_name TEXT, loser_rank INT, loser_rank_points INT, loser_seed INT, match_num INT, minutes INT, round TEXT, score TEXT, surface TEXT, tourney_date DATE, tourney_id TEXT, tourney_level TEXT, tourney_name TEXT, winner_age FLOAT, winner_entry TEXT, winner_hand TEXT, winner_ht INT, winner_id INT, winner_ioc TEXT, winner_name TEXT, winner_rank INT, winner_rank_points INT, winner_seed INT, year INT, FOREIGN KEY (winner_id) REFERENCES players(player_id), FOREIGN KEY (loser_id) REFERENCES players(player_id) ); CREATE TABLE rankings ( ranking_date DATE, ranking INT, player_id INT, ranking_points INT, tours INT, FOREIGN KEY (player_id) REFERENCES players(player_id) );
college_1
{"CLASS": {"columns": [[0, "CLASS_CODE", "varchar(5)", 0, null, 1], [1, "CRS_CODE", "varchar(10)", 0, null, 0], [2, "CLASS_SECTION", "varchar(2)", 0, null, 0], [3, "CLASS_TIME", "varchar(20)", 0, null, 0], [4, "CLASS_ROOM", "varchar(8)", 0, null, 0], [5, "PROF_NUM", "INT", 0, null, 0]], "primary_keys": ["CLASS_CODE"], "foreign_keys": [[0, 0, "EMPLOYEE", "PROF_NUM", "EMP_NUM", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "COURSE", "CRS_CODE", "CRS_CODE", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "CLASS_CODE"]]], "check_constraints": []}, "COURSE": {"columns": [[0, "CRS_CODE", "varchar(10)", 0, null, 1], [1, "DEPT_CODE", "varchar(10)", 0, null, 0], [2, "CRS_DESCRIPTION", "varchar(35)", 0, null, 0], [3, "CRS_CREDIT", "float(8)", 0, null, 0]], "primary_keys": ["CRS_CODE"], "foreign_keys": [[0, 0, "DEPARTMENT", "DEPT_CODE", "DEPT_CODE", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "CRS_CODE"]]], "check_constraints": []}, "DEPARTMENT": {"columns": [[0, "DEPT_CODE", "varchar(10)", 0, null, 1], [1, "DEPT_NAME", "varchar(30)", 0, null, 0], [2, "SCHOOL_CODE", "varchar(8)", 0, null, 0], [3, "EMP_NUM", "INT", 0, null, 0], [4, "DEPT_ADDRESS", "varchar(20)", 0, null, 0], [5, "DEPT_EXTENSION", "varchar(4)", 0, null, 0]], "primary_keys": ["DEPT_CODE"], "foreign_keys": [[0, 0, "EMPLOYEE", "EMP_NUM", "EMP_NUM", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "DEPT_CODE"]]], "check_constraints": []}, "EMPLOYEE": {"columns": [[0, "EMP_NUM", "INT", 0, null, 1], [1, "EMP_LNAME", "varchar(15)", 0, null, 0], [2, "EMP_FNAME", "varchar(12)", 0, null, 0], [3, "EMP_INITIAL", "varchar(1)", 0, null, 0], [4, "EMP_JOBCODE", "varchar(5)", 0, null, 0], [5, "EMP_HIREDATE", "datetime", 0, null, 0], [6, "EMP_DOB", "datetime", 0, null, 0]], "primary_keys": ["EMP_NUM"], "foreign_keys": [], "unique_constraints": [[[0, 0, "EMP_NUM"]]], "check_constraints": []}, "ENROLL": {"columns": [[0, "CLASS_CODE", "varchar(5)", 0, null, 0], [1, "STU_NUM", "INT", 0, null, 0], [2, "ENROLL_GRADE", "varchar(50)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "STUDENT", "STU_NUM", "STU_NUM", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "CLASS", "CLASS_CODE", "CLASS_CODE", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "PROFESSOR": {"columns": [[0, "EMP_NUM", "INT", 0, null, 0], [1, "DEPT_CODE", "varchar(10)", 0, null, 0], [2, "PROF_OFFICE", "varchar(50)", 0, null, 0], [3, "PROF_EXTENSION", "varchar(4)", 0, null, 0], [4, "PROF_HIGH_DEGREE", "varchar(5)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "DEPARTMENT", "DEPT_CODE", "DEPT_CODE", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "EMPLOYEE", "EMP_NUM", "EMP_NUM", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "STUDENT": {"columns": [[0, "STU_NUM", "INT", 0, null, 1], [1, "STU_LNAME", "varchar(15)", 0, null, 0], [2, "STU_FNAME", "varchar(15)", 0, null, 0], [3, "STU_INIT", "varchar(1)", 0, null, 0], [4, "STU_DOB", "datetime", 0, null, 0], [5, "STU_HRS", "INT", 0, null, 0], [6, "STU_CLASS", "varchar(2)", 0, null, 0], [7, "STU_GPA", "float(8)", 0, null, 0], [8, "STU_TRANSFER", "numeric", 0, null, 0], [9, "DEPT_CODE", "varchar(18)", 0, null, 0], [10, "STU_PHONE", "varchar(4)", 0, null, 0], [11, "PROF_NUM", "INT", 0, null, 0]], "primary_keys": ["STU_NUM"], "foreign_keys": [[0, 0, "DEPARTMENT", "DEPT_CODE", "DEPT_CODE", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "STU_NUM"]]], "check_constraints": []}}
CREATE TABLE CLASS ( CLASS_CODE varchar(5) PRIMARY KEY, CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM INT, UNIQUE (CLASS_CODE), FOREIGN KEY (PROF_NUM) REFERENCES EMPLOYEE(EMP_NUM), FOREIGN KEY (CRS_CODE) REFERENCES COURSE(CRS_CODE) ); CREATE TABLE COURSE ( CRS_CODE varchar(10) PRIMARY KEY, DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8), UNIQUE (CRS_CODE), FOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE) ); CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10) PRIMARY KEY, DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM INT, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4), UNIQUE (DEPT_CODE), FOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM) ); CREATE TABLE EMPLOYEE ( EMP_NUM INT PRIMARY KEY, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime, UNIQUE (EMP_NUM) ); CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM INT, ENROLL_GRADE varchar(50), FOREIGN KEY (STU_NUM) REFERENCES STUDENT(STU_NUM), FOREIGN KEY (CLASS_CODE) REFERENCES CLASS(CLASS_CODE) ); CREATE TABLE PROFESSOR ( EMP_NUM INT, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5), FOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE), FOREIGN KEY (EMP_NUM) REFERENCES EMPLOYEE(EMP_NUM) ); CREATE TABLE STUDENT ( STU_NUM INT PRIMARY KEY, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS INT, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER numeric, DEPT_CODE varchar(18), STU_PHONE varchar(4), PROF_NUM INT, UNIQUE (STU_NUM), FOREIGN KEY (DEPT_CODE) REFERENCES DEPARTMENT(DEPT_CODE) );
book_2
{"publication": {"columns": [[0, "Publication_ID", "INT", 0, null, 1], [1, "Book_ID", "INT", 0, null, 0], [2, "Publisher", "TEXT", 0, null, 0], [3, "Publication_Date", "TEXT", 0, null, 0], [4, "Price", "REAL", 0, null, 0]], "primary_keys": ["Publication_ID"], "foreign_keys": [[0, 0, "book", "Book_ID", "Book_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Publication_ID"]]], "check_constraints": []}, "book": {"columns": [[0, "Book_ID", "INT", 0, null, 1], [1, "Title", "TEXT", 0, null, 0], [2, "Issues", "REAL", 0, null, 0], [3, "Writer", "TEXT", 0, null, 0]], "primary_keys": ["Book_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Book_ID"]]], "check_constraints": []}}
CREATE TABLE publication ( Publication_ID INT PRIMARY KEY, Book_ID INT, Publisher TEXT, Publication_Date TEXT, Price REAL, UNIQUE (Publication_ID), FOREIGN KEY (Book_ID) REFERENCES book(Book_ID) ); CREATE TABLE book ( Book_ID INT PRIMARY KEY, Title TEXT, Issues REAL, Writer TEXT, UNIQUE (Book_ID) );
orchestra
{"conductor": {"columns": [[0, "Conductor_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Age", "INT", 0, null, 0], [3, "Nationality", "TEXT", 0, null, 0], [4, "Year_of_Work", "INT", 0, null, 0]], "primary_keys": ["Conductor_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Conductor_ID"]]], "check_constraints": []}, "orchestra": {"columns": [[0, "Orchestra_ID", "INT", 0, null, 1], [1, "Orchestra", "TEXT", 0, null, 0], [2, "Conductor_ID", "INT", 0, null, 0], [3, "Record_Company", "TEXT", 0, null, 0], [4, "Year_of_Founded", "REAL", 0, null, 0], [5, "Major_Record_Format", "TEXT", 0, null, 0]], "primary_keys": ["Orchestra_ID"], "foreign_keys": [[0, 0, "conductor", "Conductor_ID", "Conductor_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Orchestra_ID"]]], "check_constraints": []}, "performance": {"columns": [[0, "Performance_ID", "INT", 0, null, 1], [1, "Orchestra_ID", "INT", 0, null, 0], [2, "Type", "TEXT", 0, null, 0], [3, "Date", "TEXT", 0, null, 0], [4, "Official_ratings_(millions)", "REAL", 0, null, 0], [5, "Weekly_rank", "TEXT", 0, null, 0], [6, "Share", "TEXT", 0, null, 0]], "primary_keys": ["Performance_ID"], "foreign_keys": [[0, 0, "orchestra", "Orchestra_ID", "Orchestra_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Performance_ID"]]], "check_constraints": []}, "show": {"columns": [[0, "Show_ID", "INT", 0, null, 0], [1, "Performance_ID", "INT", 0, null, 0], [2, "If_first_show", "bool", 0, null, 0], [3, "Result", "TEXT", 0, null, 0], [4, "Attendance", "REAL", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "performance", "Performance_ID", "Performance_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE conductor ( Conductor_ID INT PRIMARY KEY, Name TEXT, Age INT, Nationality TEXT, Year_of_Work INT, UNIQUE (Conductor_ID) ); CREATE TABLE orchestra ( Orchestra_ID INT PRIMARY KEY, Orchestra TEXT, Conductor_ID INT, Record_Company TEXT, Year_of_Founded REAL, Major_Record_Format TEXT, UNIQUE (Orchestra_ID), FOREIGN KEY (Conductor_ID) REFERENCES conductor(Conductor_ID) ); CREATE TABLE performance ( Performance_ID INT PRIMARY KEY, Orchestra_ID INT, Type TEXT, Date TEXT, Official_ratings_(millions) REAL, Weekly_rank TEXT, Share TEXT, UNIQUE (Performance_ID), FOREIGN KEY (Orchestra_ID) REFERENCES orchestra(Orchestra_ID) ); CREATE TABLE show ( Show_ID INT, Performance_ID INT, If_first_show bool, Result TEXT, Attendance REAL, FOREIGN KEY (Performance_ID) REFERENCES performance(Performance_ID) );
course_teach
{"course": {"columns": [[0, "Course_ID", "INT", 0, null, 1], [1, "Staring_Date", "TEXT", 0, null, 0], [2, "Course", "TEXT", 0, null, 0]], "primary_keys": ["Course_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Course_ID"]]], "check_constraints": []}, "teacher": {"columns": [[0, "Teacher_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Age", "TEXT", 0, null, 0], [3, "Hometown", "TEXT", 0, null, 0]], "primary_keys": ["Teacher_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Teacher_ID"]]], "check_constraints": []}, "course_arrange": {"columns": [[0, "Course_ID", "INT", 0, null, 1], [1, "Teacher_ID", "INT", 0, null, 2], [2, "Grade", "INT", 0, null, 3]], "primary_keys": ["Course_ID", "Teacher_ID", "Grade"], "foreign_keys": [[0, 0, "teacher", "Teacher_ID", "Teacher_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, "Teacher_ID"], [2, 2, "Grade"]]], "check_constraints": []}}
CREATE TABLE course ( Course_ID INT PRIMARY KEY, Staring_Date TEXT, Course TEXT, UNIQUE (Course_ID) ); CREATE TABLE teacher ( Teacher_ID INT PRIMARY KEY, Name TEXT, Age TEXT, Hometown TEXT, UNIQUE (Teacher_ID) ); CREATE TABLE course_arrange ( Course_ID INT PRIMARY KEY, Teacher_ID INT PRIMARY KEY, Grade INT PRIMARY KEY, PRIMARY KEY (Course_ID, Teacher_ID, Grade), UNIQUE (Course_ID, Teacher_ID, Grade), FOREIGN KEY (Teacher_ID) REFERENCES teacher(Teacher_ID), FOREIGN KEY (Course_ID) REFERENCES course(Course_ID) );
pilot_record
{"aircraft": {"columns": [[0, "Aircraft_ID", "INT", 0, null, 1], [1, "Order_Year", "INT", 0, null, 0], [2, "Manufacturer", "TEXT", 0, null, 0], [3, "Model", "TEXT", 0, null, 0], [4, "Fleet_Series", "TEXT", 0, null, 0], [5, "Powertrain", "TEXT", 0, null, 0], [6, "Fuel_Propulsion", "TEXT", 0, null, 0]], "primary_keys": ["Aircraft_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Aircraft_ID"]]], "check_constraints": []}, "pilot": {"columns": [[0, "Pilot_ID", "INT", 0, null, 1], [1, "Pilot_name", "TEXT", 0, null, 0], [2, "Rank", "INT", 0, null, 0], [3, "Age", "INT", 0, null, 0], [4, "Nationality", "TEXT", 0, null, 0], [5, "Position", "TEXT", 0, null, 0], [6, "Join_Year", "INT", 0, null, 0], [7, "Team", "TEXT", 0, null, 0]], "primary_keys": ["Pilot_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Pilot_ID"]]], "check_constraints": []}, "pilot_record": {"columns": [[0, "Record_ID", "INT", 0, null, 0], [1, "Pilot_ID", "INT", 0, null, 1], [2, "Aircraft_ID", "INT", 0, null, 2], [3, "Date", "TEXT", 0, null, 3]], "primary_keys": ["Pilot_ID", "Aircraft_ID", "Date"], "foreign_keys": [[0, 0, "aircraft", "Aircraft_ID", "Aircraft_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "pilot", "Pilot_ID", "Pilot_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "Pilot_ID"], [1, 2, "Aircraft_ID"], [2, 3, "Date"]]], "check_constraints": []}}
CREATE TABLE aircraft ( Aircraft_ID INT PRIMARY KEY, Order_Year INT, Manufacturer TEXT, Model TEXT, Fleet_Series TEXT, Powertrain TEXT, Fuel_Propulsion TEXT, UNIQUE (Aircraft_ID) ); CREATE TABLE pilot ( Pilot_ID INT PRIMARY KEY, Pilot_name TEXT, Rank INT, Age INT, Nationality TEXT, Position TEXT, Join_Year INT, Team TEXT, UNIQUE (Pilot_ID) ); CREATE TABLE pilot_record ( Record_ID INT, Pilot_ID INT PRIMARY KEY, Aircraft_ID INT PRIMARY KEY, Date TEXT PRIMARY KEY, PRIMARY KEY (Pilot_ID, Aircraft_ID, Date), UNIQUE (Pilot_ID, Aircraft_ID, Date), FOREIGN KEY (Aircraft_ID) REFERENCES aircraft(Aircraft_ID), FOREIGN KEY (Pilot_ID) REFERENCES pilot(Pilot_ID) );
small_bank_1
{"ACCOUNTS": {"columns": [[0, "custid", "BIGINT", 1, null, 1], [1, "name", "VARCHAR(64)", 1, null, 0]], "primary_keys": ["custid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "custid"]]], "check_constraints": []}, "SAVINGS": {"columns": [[0, "custid", "BIGINT", 1, null, 1], [1, "balance", "FLOAT", 1, null, 0]], "primary_keys": ["custid"], "foreign_keys": [[0, 0, "ACCOUNTS", "custid", "custid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "custid"]]], "check_constraints": []}, "CHECKING": {"columns": [[0, "custid", "BIGINT", 1, null, 1], [1, "balance", "FLOAT", 1, null, 0]], "primary_keys": ["custid"], "foreign_keys": [[0, 0, "ACCOUNTS", "custid", "custid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "custid"]]], "check_constraints": ["CREATE TABLE CHECKING ("]}}
CREATE TABLE ACCOUNTS ( custid BIGINT NOT NULL PRIMARY KEY, name VARCHAR(64) NOT NULL, UNIQUE (custid) ); CREATE TABLE SAVINGS ( custid BIGINT NOT NULL PRIMARY KEY, balance FLOAT NOT NULL, UNIQUE (custid), FOREIGN KEY (custid) REFERENCES ACCOUNTS(custid) ); CREATE TABLE CHECKING ( custid BIGINT NOT NULL PRIMARY KEY, balance FLOAT NOT NULL, UNIQUE (custid), FOREIGN KEY (custid) REFERENCES ACCOUNTS(custid), CREATE TABLE CHECKING ( );
pets_1
{"Student": {"columns": [[0, "StuID", "INTEGER", 0, null, 1], [1, "LName", "VARCHAR(12)", 0, null, 0], [2, "Fname", "VARCHAR(12)", 0, null, 0], [3, "Age", "INTEGER", 0, null, 0], [4, "Sex", "VARCHAR(1)", 0, null, 0], [5, "Major", "INTEGER", 0, null, 0], [6, "Advisor", "INTEGER", 0, null, 0], [7, "city_code", "VARCHAR(3)", 0, null, 0]], "primary_keys": ["StuID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Has_Pet": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "PetID", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Pets", "PetID", "PetID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Pets": {"columns": [[0, "PetID", "INTEGER", 0, null, 1], [1, "PetType", "VARCHAR(20)", 0, null, 0], [2, "pet_age", "INTEGER", 0, null, 0], [3, "weight", "REAL", 0, null, 0]], "primary_keys": ["PetID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); CREATE TABLE Has_Pet ( StuID INTEGER, PetID INTEGER, FOREIGN KEY (StuID) REFERENCES Student(StuID), FOREIGN KEY (PetID) REFERENCES Pets(PetID) ); CREATE TABLE Pets ( PetID INTEGER PRIMARY KEY, PetType VARCHAR(20), pet_age INTEGER, weight REAL );
roller_coaster
{"roller_coaster": {"columns": [[0, "Roller_Coaster_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Park", "TEXT", 0, null, 0], [3, "Country_ID", "INT", 0, null, 0], [4, "Length", "REAL", 0, null, 0], [5, "Height", "REAL", 0, null, 0], [6, "Speed", "TEXT", 0, null, 0], [7, "Opened", "TEXT", 0, null, 0], [8, "Status", "TEXT", 0, null, 0]], "primary_keys": ["Roller_Coaster_ID"], "foreign_keys": [[0, 0, "country", "Country_ID", "Country_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Roller_Coaster_ID"]]], "check_constraints": []}, "country": {"columns": [[0, "Country_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Population", "INT", 0, null, 0], [3, "Area", "INT", 0, null, 0], [4, "Languages", "TEXT", 0, null, 0]], "primary_keys": ["Country_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Country_ID"]]], "check_constraints": []}}
CREATE TABLE roller_coaster ( Roller_Coaster_ID INT PRIMARY KEY, Name TEXT, Park TEXT, Country_ID INT, Length REAL, Height REAL, Speed TEXT, Opened TEXT, Status TEXT, UNIQUE (Roller_Coaster_ID), FOREIGN KEY (Country_ID) REFERENCES country(Country_ID) ); CREATE TABLE country ( Country_ID INT PRIMARY KEY, Name TEXT, Population INT, Area INT, Languages TEXT, UNIQUE (Country_ID) );
college_2
{"classroom": {"columns": [[0, "building", "varchar(15)", 0, null, 1], [1, "room_number", "varchar(7)", 0, null, 2], [2, "capacity", "numeric(4,0)", 0, null, 0]], "primary_keys": ["building", "room_number"], "foreign_keys": [], "unique_constraints": [[[0, 0, "building"], [1, 1, "room_number"]]], "check_constraints": []}, "department": {"columns": [[0, "dept_name", "varchar(20)", 0, null, 1], [1, "building", "varchar(15)", 0, null, 0], [2, "budget", "numeric(12,2)", 0, null, 0]], "primary_keys": ["dept_name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "dept_name"]]], "check_constraints": ["budget\t\t numeric(12,2) check (budget > 0),"]}, "course": {"columns": [[0, "course_id", "varchar(8)", 0, null, 1], [1, "title", "varchar(50)", 0, null, 0], [2, "dept_name", "varchar(20)", 0, null, 0], [3, "credits", "numeric(2,0)", 0, null, 0]], "primary_keys": ["course_id"], "foreign_keys": [[0, 0, "department", "dept_name", "dept_name", "NO ACTION", "SET NULL", "NONE"]], "unique_constraints": [[[0, 0, "course_id"]]], "check_constraints": ["credits\t\tnumeric(2,0) check (credits > 0),"]}, "instructor": {"columns": [[0, "ID", "varchar(5)", 0, null, 1], [1, "name", "varchar(20)", 1, null, 0], [2, "dept_name", "varchar(20)", 0, null, 0], [3, "salary", "numeric(8,2)", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [[0, 0, "department", "dept_name", "dept_name", "NO ACTION", "SET NULL", "NONE"]], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": ["salary\t\t\tnumeric(8,2) check (salary > 29000),"]}, "section": {"columns": [[0, "course_id", "varchar(8)", 0, null, 1], [1, "sec_id", "varchar(8)", 0, null, 2], [2, "semester", "varchar(6)", 0, null, 3], [3, "year", "numeric(4,0)", 0, null, 4], [4, "building", "varchar(15)", 0, null, 0], [5, "room_number", "varchar(7)", 0, null, 0], [6, "time_slot_id", "varchar(4)", 0, null, 0]], "primary_keys": ["course_id", "sec_id", "semester", "year"], "foreign_keys": [[0, 0, "classroom", "building", "building", "NO ACTION", "SET NULL", "NONE"], [0, 1, "classroom", "room_number", "room_number", "NO ACTION", "SET NULL", "NONE"], [1, 0, "course", "course_id", "course_id", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "course_id"], [1, 1, "sec_id"], [2, 2, "semester"], [3, 3, "year"]]], "check_constraints": ["check (semester in ('Fall', 'Winter', 'Spring', 'Summer')),", "year\t\t\tnumeric(4,0) check (year > 1701 and year < 2100),"]}, "teaches": {"columns": [[0, "ID", "varchar(5)", 0, null, 1], [1, "course_id", "varchar(8)", 0, null, 2], [2, "sec_id", "varchar(8)", 0, null, 3], [3, "semester", "varchar(6)", 0, null, 4], [4, "year", "numeric(4,0)", 0, null, 5]], "primary_keys": ["ID", "course_id", "sec_id", "semester", "year"], "foreign_keys": [[0, 0, "instructor", "ID", "ID", "NO ACTION", "CASCADE", "NONE"], [1, 0, "section", "course_id", "course_id", "NO ACTION", "CASCADE", "NONE"], [1, 1, "section", "sec_id", "sec_id", "NO ACTION", "CASCADE", "NONE"], [1, 2, "section", "semester", "semester", "NO ACTION", "CASCADE", "NONE"], [1, 3, "section", "year", "year", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "ID"], [1, 1, "course_id"], [2, 2, "sec_id"], [3, 3, "semester"], [4, 4, "year"]]], "check_constraints": []}, "student": {"columns": [[0, "ID", "varchar(5)", 0, null, 1], [1, "name", "varchar(20)", 1, null, 0], [2, "dept_name", "varchar(20)", 0, null, 0], [3, "tot_cred", "numeric(3,0)", 0, null, 0]], "primary_keys": ["ID"], "foreign_keys": [[0, 0, "department", "dept_name", "dept_name", "NO ACTION", "SET NULL", "NONE"]], "unique_constraints": [[[0, 0, "ID"]]], "check_constraints": ["tot_cred\t\tnumeric(3,0) check (tot_cred >= 0),"]}, "takes": {"columns": [[0, "ID", "varchar(5)", 0, null, 1], [1, "course_id", "varchar(8)", 0, null, 2], [2, "sec_id", "varchar(8)", 0, null, 3], [3, "semester", "varchar(6)", 0, null, 4], [4, "year", "numeric(4,0)", 0, null, 5], [5, "grade", "varchar(2)", 0, null, 0]], "primary_keys": ["ID", "course_id", "sec_id", "semester", "year"], "foreign_keys": [[0, 0, "student", "ID", "ID", "NO ACTION", "CASCADE", "NONE"], [1, 0, "section", "course_id", "course_id", "NO ACTION", "CASCADE", "NONE"], [1, 1, "section", "sec_id", "sec_id", "NO ACTION", "CASCADE", "NONE"], [1, 2, "section", "semester", "semester", "NO ACTION", "CASCADE", "NONE"], [1, 3, "section", "year", "year", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "ID"], [1, 1, "course_id"], [2, 2, "sec_id"], [3, 3, "semester"], [4, 4, "year"]]], "check_constraints": []}, "advisor": {"columns": [[0, "s_ID", "varchar(5)", 0, null, 1], [1, "i_ID", "varchar(5)", 0, null, 0]], "primary_keys": ["s_ID"], "foreign_keys": [[0, 0, "student", "s_ID", "ID", "NO ACTION", "CASCADE", "NONE"], [1, 0, "instructor", "i_ID", "ID", "NO ACTION", "SET NULL", "NONE"]], "unique_constraints": [[[0, 0, "s_ID"]]], "check_constraints": []}, "time_slot": {"columns": [[0, "time_slot_id", "varchar(4)", 0, null, 1], [1, "day", "varchar(1)", 0, null, 2], [2, "start_hr", "numeric(2)", 0, null, 3], [3, "start_min", "numeric(2)", 0, null, 4], [4, "end_hr", "numeric(2)", 0, null, 0], [5, "end_min", "numeric(2)", 0, null, 0]], "primary_keys": ["time_slot_id", "day", "start_hr", "start_min"], "foreign_keys": [], "unique_constraints": [[[0, 0, "time_slot_id"], [1, 1, "day"], [2, 2, "start_hr"], [3, 3, "start_min"]]], "check_constraints": ["start_hr\t\tnumeric(2) check (start_hr >= 0 and start_hr < 24),", "start_min\t\tnumeric(2) check (start_min >= 0 and start_min < 60),", "end_hr\t\t\tnumeric(2) check (end_hr >= 0 and end_hr < 24),", "end_min\t\tnumeric(2) check (end_min >= 0 and end_min < 60),"]}, "prereq": {"columns": [[0, "course_id", "varchar(8)", 0, null, 1], [1, "prereq_id", "varchar(8)", 0, null, 2]], "primary_keys": ["course_id", "prereq_id"], "foreign_keys": [[0, 0, "course", "prereq_id", "course_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "course", "course_id", "course_id", "NO ACTION", "CASCADE", "NONE"]], "unique_constraints": [[[0, 0, "course_id"], [1, 1, "prereq_id"]]], "check_constraints": []}}
CREATE TABLE classroom ( building varchar(15) PRIMARY KEY, room_number varchar(7) PRIMARY KEY, capacity numeric(4,0), PRIMARY KEY (building, room_number), UNIQUE (building, room_number) ); CREATE TABLE department ( dept_name varchar(20) PRIMARY KEY, building varchar(15), budget numeric(12,2), UNIQUE (dept_name), budget numeric(12,2) check (budget > 0), ); CREATE TABLE course ( course_id varchar(8) PRIMARY KEY, title varchar(50), dept_name varchar(20), credits numeric(2,0), UNIQUE (course_id), FOREIGN KEY (dept_name) REFERENCES department(dept_name), credits numeric(2,0) check (credits > 0), ); CREATE TABLE instructor ( ID varchar(5) PRIMARY KEY, name varchar(20) NOT NULL, dept_name varchar(20), salary numeric(8,2), UNIQUE (ID), FOREIGN KEY (dept_name) REFERENCES department(dept_name), salary numeric(8,2) check (salary > 29000), ); CREATE TABLE section ( course_id varchar(8) PRIMARY KEY, sec_id varchar(8) PRIMARY KEY, semester varchar(6) PRIMARY KEY, year numeric(4,0) PRIMARY KEY, building varchar(15), room_number varchar(7), time_slot_id varchar(4), PRIMARY KEY (course_id, sec_id, semester, year), UNIQUE (course_id, sec_id, semester, year), FOREIGN KEY (building) REFERENCES classroom(building), FOREIGN KEY (room_number) REFERENCES classroom(room_number), FOREIGN KEY (course_id) REFERENCES course(course_id), check (semester in ('Fall', 'Winter', 'Spring', 'Summer')),, year numeric(4,0) check (year > 1701 and year < 2100), ); CREATE TABLE teaches ( ID varchar(5) PRIMARY KEY, course_id varchar(8) PRIMARY KEY, sec_id varchar(8) PRIMARY KEY, semester varchar(6) PRIMARY KEY, year numeric(4,0) PRIMARY KEY, PRIMARY KEY (ID, course_id, sec_id, semester, year), UNIQUE (ID, course_id, sec_id, semester, year), FOREIGN KEY (ID) REFERENCES instructor(ID), FOREIGN KEY (course_id) REFERENCES section(course_id), FOREIGN KEY (sec_id) REFERENCES section(sec_id), FOREIGN KEY (semester) REFERENCES section(semester), FOREIGN KEY (year) REFERENCES section(year) ); CREATE TABLE student ( ID varchar(5) PRIMARY KEY, name varchar(20) NOT NULL, dept_name varchar(20), tot_cred numeric(3,0), UNIQUE (ID), FOREIGN KEY (dept_name) REFERENCES department(dept_name), tot_cred numeric(3,0) check (tot_cred >= 0), ); CREATE TABLE takes ( ID varchar(5) PRIMARY KEY, course_id varchar(8) PRIMARY KEY, sec_id varchar(8) PRIMARY KEY, semester varchar(6) PRIMARY KEY, year numeric(4,0) PRIMARY KEY, grade varchar(2), PRIMARY KEY (ID, course_id, sec_id, semester, year), UNIQUE (ID, course_id, sec_id, semester, year), FOREIGN KEY (ID) REFERENCES student(ID), FOREIGN KEY (course_id) REFERENCES section(course_id), FOREIGN KEY (sec_id) REFERENCES section(sec_id), FOREIGN KEY (semester) REFERENCES section(semester), FOREIGN KEY (year) REFERENCES section(year) ); CREATE TABLE advisor ( s_ID varchar(5) PRIMARY KEY, i_ID varchar(5), UNIQUE (s_ID), FOREIGN KEY (s_ID) REFERENCES student(ID), FOREIGN KEY (i_ID) REFERENCES instructor(ID) ); CREATE TABLE time_slot ( time_slot_id varchar(4) PRIMARY KEY, day varchar(1) PRIMARY KEY, start_hr numeric(2) PRIMARY KEY, start_min numeric(2) PRIMARY KEY, end_hr numeric(2), end_min numeric(2), PRIMARY KEY (time_slot_id, day, start_hr, start_min), UNIQUE (time_slot_id, day, start_hr, start_min), start_hr numeric(2) check (start_hr >= 0 and start_hr < 24),, start_min numeric(2) check (start_min >= 0 and start_min < 60),, end_hr numeric(2) check (end_hr >= 0 and end_hr < 24),, end_min numeric(2) check (end_min >= 0 and end_min < 60), ); CREATE TABLE prereq ( course_id varchar(8) PRIMARY KEY, prereq_id varchar(8) PRIMARY KEY, PRIMARY KEY (course_id, prereq_id), UNIQUE (course_id, prereq_id), FOREIGN KEY (prereq_id) REFERENCES course(course_id), FOREIGN KEY (course_id) REFERENCES course(course_id) );
city_record
{"city": {"columns": [[0, "City_ID", "INT", 0, null, 1], [1, "City", "TEXT", 0, null, 0], [2, "Hanzi", "TEXT", 0, null, 0], [3, "Hanyu_Pinyin", "TEXT", 0, null, 0], [4, "Regional_Population", "INT", 0, null, 0], [5, "GDP", "REAL", 0, null, 0]], "primary_keys": ["City_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "City_ID"]]], "check_constraints": []}, "match": {"columns": [[0, "Match_ID", "INT", 0, null, 1], [1, "Date", "TEXT", 0, null, 0], [2, "Venue", "TEXT", 0, null, 0], [3, "Score", "TEXT", 0, null, 0], [4, "Result", "TEXT", 0, null, 0], [5, "Competition", "TEXT", 0, null, 0]], "primary_keys": ["Match_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Match_ID"]]], "check_constraints": []}, "temperature": {"columns": [[0, "City_ID", "INT", 0, null, 1], [1, "Jan", "REAL", 0, null, 0], [2, "Feb", "REAL", 0, null, 0], [3, "Mar", "REAL", 0, null, 0], [4, "Apr", "REAL", 0, null, 0], [5, "Jun", "REAL", 0, null, 0], [6, "Jul", "REAL", 0, null, 0], [7, "Aug", "REAL", 0, null, 0], [8, "Sep", "REAL", 0, null, 0], [9, "Oct", "REAL", 0, null, 0], [10, "Nov", "REAL", 0, null, 0], [11, "Dec", "REAL", 0, null, 0]], "primary_keys": ["City_ID"], "foreign_keys": [[0, 0, "city", "City_ID", "City_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "City_ID"]]], "check_constraints": []}, "hosting_city": {"columns": [[0, "Year", "INT", 0, null, 1], [1, "Match_ID", "INT", 0, null, 0], [2, "Host_City", "TEXT", 0, null, 0]], "primary_keys": ["Year"], "foreign_keys": [[0, 0, "match", "Match_ID", "Match_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "city", "Host_City", "City_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Year"]]], "check_constraints": []}}
CREATE TABLE city ( City_ID INT PRIMARY KEY, City TEXT, Hanzi TEXT, Hanyu_Pinyin TEXT, Regional_Population INT, GDP REAL, UNIQUE (City_ID) ); CREATE TABLE match ( Match_ID INT PRIMARY KEY, Date TEXT, Venue TEXT, Score TEXT, Result TEXT, Competition TEXT, UNIQUE (Match_ID) ); CREATE TABLE temperature ( City_ID INT PRIMARY KEY, Jan REAL, Feb REAL, Mar REAL, Apr REAL, Jun REAL, Jul REAL, Aug REAL, Sep REAL, Oct REAL, Nov REAL, Dec REAL, UNIQUE (City_ID), FOREIGN KEY (City_ID) REFERENCES city(City_ID) ); CREATE TABLE hosting_city ( Year INT PRIMARY KEY, Match_ID INT, Host_City TEXT, UNIQUE (Year), FOREIGN KEY (Match_ID) REFERENCES match(Match_ID), FOREIGN KEY (Host_City) REFERENCES city(City_ID) );
imdb
{"actor": {"columns": [[0, "aid", "INT", 0, null, 1], [1, "gender", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0], [3, "nationality", "TEXT", 0, null, 0], [4, "birth_city", "TEXT", 0, null, 0], [5, "birth_year", "INT", 0, null, 0]], "primary_keys": ["aid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "aid"]]], "check_constraints": []}, "copyright": {"columns": [[0, "id", "INT", 0, null, 1], [1, "msid", "INT", 0, null, 0], [2, "cid", "INT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "cast": {"columns": [[0, "id", "INT", 0, null, 1], [1, "msid", "INT", 0, null, 0], [2, "aid", "INT", 0, null, 0], [3, "role", "INT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "copyright", "msid", "msid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "actor", "aid", "aid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "genre": {"columns": [[0, "gid", "INT", 0, null, 1], [1, "genre", "TEXT", 0, null, 0]], "primary_keys": ["gid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "gid"]]], "check_constraints": []}, "classification": {"columns": [[0, "id", "INT", 0, null, 1], [1, "msid", "INT", 0, null, 0], [2, "gid", "INT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "copyright", "msid", "msid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "genre", "gid", "gid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "company": {"columns": [[0, "id", "INT", 0, null, 1], [1, "name", "TEXT", 0, null, 0], [2, "country_code", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "director": {"columns": [[0, "did", "INT", 0, null, 1], [1, "gender", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0], [3, "nationality", "TEXT", 0, null, 0], [4, "birth_city", "TEXT", 0, null, 0], [5, "birth_year", "INT", 0, null, 0]], "primary_keys": ["did"], "foreign_keys": [], "unique_constraints": [[[0, 0, "did"]]], "check_constraints": []}, "producer": {"columns": [[0, "pid", "INT", 0, null, 1], [1, "gender", "TEXT", 0, null, 0], [2, "name", "TEXT", 0, null, 0], [3, "nationality", "TEXT", 0, null, 0], [4, "birth_city", "TEXT", 0, null, 0], [5, "birth_year", "INT", 0, null, 0]], "primary_keys": ["pid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "pid"]]], "check_constraints": []}, "directed_by": {"columns": [[0, "id", "INT", 0, null, 1], [1, "msid", "INT", 0, null, 0], [2, "did", "INT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "director", "did", "did", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "copyright", "msid", "msid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "keyword": {"columns": [[0, "id", "INT", 0, null, 1], [1, "keyword", "TEXT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "made_by": {"columns": [[0, "id", "INT", 0, null, 1], [1, "msid", "INT", 0, null, 0], [2, "pid", "INT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "producer", "pid", "pid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "copyright", "msid", "msid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "movie": {"columns": [[0, "mid", "INT", 0, null, 1], [1, "title", "TEXT", 0, null, 0], [2, "release_year", "INT", 0, null, 0], [3, "title_aka", "TEXT", 0, null, 0], [4, "budget", "TEXT", 0, null, 0]], "primary_keys": ["mid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "mid"]]], "check_constraints": []}, "tags": {"columns": [[0, "id", "INT", 0, null, 1], [1, "msid", "INT", 0, null, 0], [2, "kid", "INT", 0, null, 0]], "primary_keys": ["id"], "foreign_keys": [[0, 0, "keyword", "kid", "kid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "copyright", "msid", "msid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "id"]]], "check_constraints": []}, "tv_series": {"columns": [[0, "sid", "INT", 0, null, 1], [1, "title", "TEXT", 0, null, 0], [2, "release_year", "INT", 0, null, 0], [3, "num_of_seasons", "INT", 0, null, 0], [4, "num_of_episodes", "INT", 0, null, 0], [5, "title_aka", "TEXT", 0, null, 0], [6, "budget", "TEXT", 0, null, 0]], "primary_keys": ["sid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "sid"]]], "check_constraints": []}, "writer": {"columns": [[0, "wid", "INT", 0, null, 1], [1, "gender", "TEXT", 0, null, 0], [2, "name", "INT", 0, null, 0], [3, "nationality", "INT", 0, null, 0], [4, "num_of_episodes", "INT", 0, null, 0], [5, "birth_city", "TEXT", 0, null, 0], [6, "birth_year", "INT", 0, null, 0]], "primary_keys": ["wid"], "foreign_keys": [], "unique_constraints": [[[0, 0, "wid"]]], "check_constraints": []}, "written_by": {"columns": [[0, "id", "INT", 0, null, 0], [1, "msid", "INT", 0, null, 0], [2, "wid", "INT", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "writer", "wid", "wid", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "copyright", "msid", "msid", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}}
CREATE TABLE actor ( aid INT PRIMARY KEY, gender TEXT, name TEXT, nationality TEXT, birth_city TEXT, birth_year INT, UNIQUE (aid) ); CREATE TABLE copyright ( id INT PRIMARY KEY, msid INT, cid INT, UNIQUE (id) ); CREATE TABLE cast ( id INT PRIMARY KEY, msid INT, aid INT, role INT, UNIQUE (id), FOREIGN KEY (msid) REFERENCES copyright(msid), FOREIGN KEY (aid) REFERENCES actor(aid) ); CREATE TABLE genre ( gid INT PRIMARY KEY, genre TEXT, UNIQUE (gid) ); CREATE TABLE classification ( id INT PRIMARY KEY, msid INT, gid INT, UNIQUE (id), FOREIGN KEY (msid) REFERENCES copyright(msid), FOREIGN KEY (gid) REFERENCES genre(gid) ); CREATE TABLE company ( id INT PRIMARY KEY, name TEXT, country_code TEXT, UNIQUE (id) ); CREATE TABLE director ( did INT PRIMARY KEY, gender TEXT, name TEXT, nationality TEXT, birth_city TEXT, birth_year INT, UNIQUE (did) ); CREATE TABLE producer ( pid INT PRIMARY KEY, gender TEXT, name TEXT, nationality TEXT, birth_city TEXT, birth_year INT, UNIQUE (pid) ); CREATE TABLE directed_by ( id INT PRIMARY KEY, msid INT, did INT, UNIQUE (id), FOREIGN KEY (did) REFERENCES director(did), FOREIGN KEY (msid) REFERENCES copyright(msid) ); CREATE TABLE keyword ( id INT PRIMARY KEY, keyword TEXT, UNIQUE (id) ); CREATE TABLE made_by ( id INT PRIMARY KEY, msid INT, pid INT, UNIQUE (id), FOREIGN KEY (pid) REFERENCES producer(pid), FOREIGN KEY (msid) REFERENCES copyright(msid) ); CREATE TABLE movie ( mid INT PRIMARY KEY, title TEXT, release_year INT, title_aka TEXT, budget TEXT, UNIQUE (mid) ); CREATE TABLE tags ( id INT PRIMARY KEY, msid INT, kid INT, UNIQUE (id), FOREIGN KEY (kid) REFERENCES keyword(kid), FOREIGN KEY (msid) REFERENCES copyright(msid) ); CREATE TABLE tv_series ( sid INT PRIMARY KEY, title TEXT, release_year INT, num_of_seasons INT, num_of_episodes INT, title_aka TEXT, budget TEXT, UNIQUE (sid) ); CREATE TABLE writer ( wid INT PRIMARY KEY, gender TEXT, name INT, nationality INT, num_of_episodes INT, birth_city TEXT, birth_year INT, UNIQUE (wid) ); CREATE TABLE written_by ( id INT, msid INT, wid INT, FOREIGN KEY (wid) REFERENCES writer(wid), FOREIGN KEY (msid) REFERENCES copyright(msid) );
geo
{"state": {"columns": [[0, "state_name", "TEXT", 0, null, 1], [1, "population", "INTEGER", 0, "NULL", 0], [2, "area", "double", 0, "NULL", 0], [3, "country_name", "varchar(3)", 1, "''", 0], [4, "capital", "TEXT", 0, null, 0], [5, "density", "double", 0, "NULL", 0]], "primary_keys": ["state_name"], "foreign_keys": [], "unique_constraints": [[[0, 0, "state_name"]]], "check_constraints": []}, "city": {"columns": [[0, "city_name", "TEXT", 0, null, 1], [1, "population", "INTEGER", 0, "NULL", 0], [2, "country_name", "varchar(3)", 1, "''", 0], [3, "state_name", "TEXT", 0, null, 2]], "primary_keys": ["city_name", "state_name"], "foreign_keys": [[0, 0, "state", "state_name", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "city_name"], [1, 3, "state_name"]]], "check_constraints": []}, "border_info": {"columns": [[0, "state_name", "TEXT", 0, null, 2], [1, "border", "TEXT", 0, null, 1]], "primary_keys": ["state_name", "border"], "foreign_keys": [[0, 0, "state", "border", "state_name", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "state", "state_name", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 1, "border"], [1, 0, "state_name"]]], "check_constraints": []}, "highlow": {"columns": [[0, "state_name", "TEXT", 0, null, 1], [1, "highest_elevation", "TEXT", 0, null, 0], [2, "lowest_point", "TEXT", 0, null, 0], [3, "highest_point", "TEXT", 0, null, 0], [4, "lowest_elevation", "TEXT", 0, null, 0]], "primary_keys": ["state_name"], "foreign_keys": [[0, 0, "state", "state_name", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "state_name"]]], "check_constraints": []}, "lake": {"columns": [[0, "lake_name", "TEXT", 0, null, 0], [1, "area", "double", 0, "NULL", 0], [2, "country_name", "varchar(3)", 1, "''", 0], [3, "state_name", "TEXT", 0, null, 0]], "primary_keys": [], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "mountain": {"columns": [[0, "mountain_name", "TEXT", 0, null, 1], [1, "mountain_altitude", "INTEGER", 0, "NULL", 0], [2, "country_name", "varchar(3)", 1, "''", 0], [3, "state_name", "TEXT", 0, null, 2]], "primary_keys": ["mountain_name", "state_name"], "foreign_keys": [[0, 0, "state", "state_name", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "mountain_name"], [1, 3, "state_name"]]], "check_constraints": []}, "river": {"columns": [[0, "river_name", "TEXT", 0, null, 1], [1, "length", "INTEGER", 0, "NULL", 0], [2, "country_name", "varchar(3)", 1, "''", 0], [3, "traverse", "TEXT", 0, null, 0]], "primary_keys": ["river_name"], "foreign_keys": [[0, 0, "state", "traverse", "state_name", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "river_name"]]], "check_constraints": []}}
CREATE TABLE state ( state_name TEXT PRIMARY KEY, population INTEGER DEFAULT NULL, area double DEFAULT NULL, country_name varchar(3) NOT NULL DEFAULT '', capital TEXT, density double DEFAULT NULL, UNIQUE (state_name) ); CREATE TABLE city ( city_name TEXT PRIMARY KEY, population INTEGER DEFAULT NULL, country_name varchar(3) NOT NULL DEFAULT '', state_name TEXT PRIMARY KEY, PRIMARY KEY (city_name, state_name), UNIQUE (city_name, state_name), FOREIGN KEY (state_name) REFERENCES state(state_name) ); CREATE TABLE border_info ( state_name TEXT PRIMARY KEY, border TEXT PRIMARY KEY, PRIMARY KEY (state_name, border), UNIQUE (border, state_name), FOREIGN KEY (border) REFERENCES state(state_name), FOREIGN KEY (state_name) REFERENCES state(state_name) ); CREATE TABLE highlow ( state_name TEXT PRIMARY KEY, highest_elevation TEXT, lowest_point TEXT, highest_point TEXT, lowest_elevation TEXT, UNIQUE (state_name), FOREIGN KEY (state_name) REFERENCES state(state_name) ); CREATE TABLE lake ( lake_name TEXT, area double DEFAULT NULL, country_name varchar(3) NOT NULL DEFAULT '', state_name TEXT ); CREATE TABLE mountain ( mountain_name TEXT PRIMARY KEY, mountain_altitude INTEGER DEFAULT NULL, country_name varchar(3) NOT NULL DEFAULT '', state_name TEXT PRIMARY KEY, PRIMARY KEY (mountain_name, state_name), UNIQUE (mountain_name, state_name), FOREIGN KEY (state_name) REFERENCES state(state_name) ); CREATE TABLE river ( river_name TEXT PRIMARY KEY, length INTEGER DEFAULT NULL, country_name varchar(3) NOT NULL DEFAULT '', traverse TEXT, UNIQUE (river_name), FOREIGN KEY (traverse) REFERENCES state(state_name) );
farm
{"city": {"columns": [[0, "City_ID", "INT", 0, null, 1], [1, "Official_Name", "TEXT", 0, null, 0], [2, "Status", "TEXT", 0, null, 0], [3, "Area_km_2", "REAL", 0, null, 0], [4, "Population", "REAL", 0, null, 0], [5, "Census_Ranking", "TEXT", 0, null, 0]], "primary_keys": ["City_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "City_ID"]]], "check_constraints": []}, "farm": {"columns": [[0, "Farm_ID", "INT", 0, null, 1], [1, "Year", "INT", 0, null, 0], [2, "Total_Horses", "REAL", 0, null, 0], [3, "Working_Horses", "REAL", 0, null, 0], [4, "Total_Cattle", "REAL", 0, null, 0], [5, "Oxen", "REAL", 0, null, 0], [6, "Bulls", "REAL", 0, null, 0], [7, "Cows", "REAL", 0, null, 0], [8, "Pigs", "REAL", 0, null, 0], [9, "Sheep_and_Goats", "REAL", 0, null, 0]], "primary_keys": ["Farm_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Farm_ID"]]], "check_constraints": []}, "farm_competition": {"columns": [[0, "Competition_ID", "INT", 0, null, 1], [1, "Year", "INT", 0, null, 0], [2, "Theme", "TEXT", 0, null, 0], [3, "Host_city_ID", "INT", 0, null, 0], [4, "Hosts", "TEXT", 0, null, 0]], "primary_keys": ["Competition_ID"], "foreign_keys": [[0, 0, "city", "Host_city_ID", "City_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Competition_ID"]]], "check_constraints": []}, "competition_record": {"columns": [[0, "Competition_ID", "INT", 0, null, 1], [1, "Farm_ID", "INT", 0, null, 2], [2, "Rank", "INT", 0, null, 0]], "primary_keys": ["Competition_ID", "Farm_ID"], "foreign_keys": [[0, 0, "farm", "Farm_ID", "Farm_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "farm_competition", "Competition_ID", "Competition_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Competition_ID"], [1, 1, "Farm_ID"]]], "check_constraints": []}}
CREATE TABLE city ( City_ID INT PRIMARY KEY, Official_Name TEXT, Status TEXT, Area_km_2 REAL, Population REAL, Census_Ranking TEXT, UNIQUE (City_ID) ); CREATE TABLE farm ( Farm_ID INT PRIMARY KEY, Year INT, Total_Horses REAL, Working_Horses REAL, Total_Cattle REAL, Oxen REAL, Bulls REAL, Cows REAL, Pigs REAL, Sheep_and_Goats REAL, UNIQUE (Farm_ID) ); CREATE TABLE farm_competition ( Competition_ID INT PRIMARY KEY, Year INT, Theme TEXT, Host_city_ID INT, Hosts TEXT, UNIQUE (Competition_ID), FOREIGN KEY (Host_city_ID) REFERENCES city(City_ID) ); CREATE TABLE competition_record ( Competition_ID INT PRIMARY KEY, Farm_ID INT PRIMARY KEY, Rank INT, PRIMARY KEY (Competition_ID, Farm_ID), UNIQUE (Competition_ID, Farm_ID), FOREIGN KEY (Farm_ID) REFERENCES farm(Farm_ID), FOREIGN KEY (Competition_ID) REFERENCES farm_competition(Competition_ID) );
singer
{"singer": {"columns": [[0, "Singer_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Birth_Year", "REAL", 0, null, 0], [3, "Net_Worth_Millions", "REAL", 0, null, 0], [4, "Citizenship", "TEXT", 0, null, 0]], "primary_keys": ["Singer_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Singer_ID"]]], "check_constraints": []}, "song": {"columns": [[0, "Song_ID", "INT", 0, null, 1], [1, "Title", "TEXT", 0, null, 0], [2, "Singer_ID", "INT", 0, null, 0], [3, "Sales", "REAL", 0, null, 0], [4, "Highest_Position", "REAL", 0, null, 0]], "primary_keys": ["Song_ID"], "foreign_keys": [[0, 0, "singer", "Singer_ID", "Singer_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Song_ID"]]], "check_constraints": []}}
CREATE TABLE singer ( Singer_ID INT PRIMARY KEY, Name TEXT, Birth_Year REAL, Net_Worth_Millions REAL, Citizenship TEXT, UNIQUE (Singer_ID) ); CREATE TABLE song ( Song_ID INT PRIMARY KEY, Title TEXT, Singer_ID INT, Sales REAL, Highest_Position REAL, UNIQUE (Song_ID), FOREIGN KEY (Singer_ID) REFERENCES singer(Singer_ID) );
train_station
{"station": {"columns": [[0, "Station_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Annual_entry_exit", "REAL", 0, null, 0], [3, "Annual_interchanges", "REAL", 0, null, 0], [4, "Total_Passengers", "REAL", 0, null, 0], [5, "Location", "TEXT", 0, null, 0], [6, "Main_Services", "TEXT", 0, null, 0], [7, "Number_of_Platforms", "INT", 0, null, 0]], "primary_keys": ["Station_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Station_ID"]]], "check_constraints": []}, "train": {"columns": [[0, "Train_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Time", "TEXT", 0, null, 0], [3, "Service", "TEXT", 0, null, 0]], "primary_keys": ["Train_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Train_ID"]]], "check_constraints": []}, "train_station": {"columns": [[0, "Train_ID", "INT", 0, null, 1], [1, "Station_ID", "INT", 0, null, 2]], "primary_keys": ["Train_ID", "Station_ID"], "foreign_keys": [[0, 0, "station", "Station_ID", "Station_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "train", "Train_ID", "Train_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Train_ID"], [1, 1, "Station_ID"]]], "check_constraints": []}}
CREATE TABLE station ( Station_ID INT PRIMARY KEY, Name TEXT, Annual_entry_exit REAL, Annual_interchanges REAL, Total_Passengers REAL, Location TEXT, Main_Services TEXT, Number_of_Platforms INT, UNIQUE (Station_ID) ); CREATE TABLE train ( Train_ID INT PRIMARY KEY, Name TEXT, Time TEXT, Service TEXT, UNIQUE (Train_ID) ); CREATE TABLE train_station ( Train_ID INT PRIMARY KEY, Station_ID INT PRIMARY KEY, PRIMARY KEY (Train_ID, Station_ID), UNIQUE (Train_ID, Station_ID), FOREIGN KEY (Station_ID) REFERENCES station(Station_ID), FOREIGN KEY (Train_ID) REFERENCES train(Train_ID) );
railway
{"railway": {"columns": [[0, "Railway_ID", "INT", 0, null, 1], [1, "Railway", "TEXT", 0, null, 0], [2, "Builder", "TEXT", 0, null, 0], [3, "Built", "TEXT", 0, null, 0], [4, "Wheels", "TEXT", 0, null, 0], [5, "Location", "TEXT", 0, null, 0], [6, "ObjectNumber", "TEXT", 0, null, 0]], "primary_keys": ["Railway_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Railway_ID"]]], "check_constraints": []}, "train": {"columns": [[0, "Train_ID", "INT", 0, null, 1], [1, "Train_Num", "TEXT", 0, null, 0], [2, "Name", "TEXT", 0, null, 0], [3, "From", "TEXT", 0, null, 0], [4, "Arrival", "TEXT", 0, null, 0], [5, "Railway_ID", "INT", 0, null, 0]], "primary_keys": ["Train_ID"], "foreign_keys": [[0, 0, "railway", "Railway_ID", "Railway_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Train_ID"]]], "check_constraints": []}, "manager": {"columns": [[0, "Manager_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Country", "TEXT", 0, null, 0], [3, "Working_year_starts", "TEXT", 0, null, 0], [4, "Age", "INT", 0, null, 0], [5, "Level", "INT", 0, null, 0]], "primary_keys": ["Manager_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Manager_ID"]]], "check_constraints": []}, "railway_manage": {"columns": [[0, "Railway_ID", "INT", 0, null, 1], [1, "Manager_ID", "INT", 0, null, 2], [2, "From_Year", "TEXT", 0, null, 0]], "primary_keys": ["Railway_ID", "Manager_ID"], "foreign_keys": [[0, 0, "railway", "Railway_ID", "Railway_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "manager", "Manager_ID", "Manager_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Railway_ID"], [1, 1, "Manager_ID"]]], "check_constraints": []}}
CREATE TABLE railway ( Railway_ID INT PRIMARY KEY, Railway TEXT, Builder TEXT, Built TEXT, Wheels TEXT, Location TEXT, ObjectNumber TEXT, UNIQUE (Railway_ID) ); CREATE TABLE train ( Train_ID INT PRIMARY KEY, Train_Num TEXT, Name TEXT, From TEXT, Arrival TEXT, Railway_ID INT, UNIQUE (Train_ID), FOREIGN KEY (Railway_ID) REFERENCES railway(Railway_ID) ); CREATE TABLE manager ( Manager_ID INT PRIMARY KEY, Name TEXT, Country TEXT, Working_year_starts TEXT, Age INT, Level INT, UNIQUE (Manager_ID) ); CREATE TABLE railway_manage ( Railway_ID INT PRIMARY KEY, Manager_ID INT PRIMARY KEY, From_Year TEXT, PRIMARY KEY (Railway_ID, Manager_ID), UNIQUE (Railway_ID, Manager_ID), FOREIGN KEY (Railway_ID) REFERENCES railway(Railway_ID), FOREIGN KEY (Manager_ID) REFERENCES manager(Manager_ID) );
manufacturer
{"manufacturer": {"columns": [[0, "Manufacturer_ID", "INT", 0, null, 1], [1, "Open_Year", "REAL", 0, null, 0], [2, "Name", "TEXT", 0, null, 0], [3, "Num_of_Factories", "INT", 0, null, 0], [4, "Num_of_Shops", "INT", 0, null, 0]], "primary_keys": ["Manufacturer_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Manufacturer_ID"]]], "check_constraints": []}, "furniture": {"columns": [[0, "Furniture_ID", "INT", 0, null, 1], [1, "Name", "TEXT", 0, null, 0], [2, "Num_of_Component", "INT", 0, null, 0], [3, "Market_Rate", "REAL", 0, null, 0]], "primary_keys": ["Furniture_ID"], "foreign_keys": [], "unique_constraints": [[[0, 0, "Furniture_ID"]]], "check_constraints": []}, "furniture_manufacte": {"columns": [[0, "Manufacturer_ID", "INT", 0, null, 1], [1, "Furniture_ID", "INT", 0, null, 2], [2, "Price_in_Dollar", "REAL", 0, null, 0]], "primary_keys": ["Manufacturer_ID", "Furniture_ID"], "foreign_keys": [[0, 0, "furniture", "Furniture_ID", "Furniture_ID", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "manufacturer", "Manufacturer_ID", "Manufacturer_ID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "Manufacturer_ID"], [1, 1, "Furniture_ID"]]], "check_constraints": []}}
CREATE TABLE manufacturer ( Manufacturer_ID INT PRIMARY KEY, Open_Year REAL, Name TEXT, Num_of_Factories INT, Num_of_Shops INT, UNIQUE (Manufacturer_ID) ); CREATE TABLE furniture ( Furniture_ID INT PRIMARY KEY, Name TEXT, Num_of_Component INT, Market_Rate REAL, UNIQUE (Furniture_ID) ); CREATE TABLE furniture_manufacte ( Manufacturer_ID INT PRIMARY KEY, Furniture_ID INT PRIMARY KEY, Price_in_Dollar REAL, PRIMARY KEY (Manufacturer_ID, Furniture_ID), UNIQUE (Manufacturer_ID, Furniture_ID), FOREIGN KEY (Furniture_ID) REFERENCES furniture(Furniture_ID), FOREIGN KEY (Manufacturer_ID) REFERENCES manufacturer(Manufacturer_ID) );
cre_Doc_Control_Systems
{"Ref_Document_Types": {"columns": [[0, "document_type_code", "CHAR(15)", 1, null, 1], [1, "document_type_description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["document_type_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "document_type_code"]]], "check_constraints": []}, "Roles": {"columns": [[0, "role_code", "CHAR(15)", 1, null, 1], [1, "role_description", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["role_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "role_code"]]], "check_constraints": []}, "Addresses": {"columns": [[0, "address_id", "INTEGER", 1, null, 1], [1, "address_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["address_id"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Ref_Document_Status": {"columns": [[0, "document_status_code", "CHAR(15)", 1, null, 1], [1, "document_status_description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["document_status_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "document_status_code"]]], "check_constraints": []}, "Ref_Shipping_Agents": {"columns": [[0, "shipping_agent_code", "CHAR(15)", 1, null, 1], [1, "shipping_agent_name", "VARCHAR(255)", 1, null, 0], [2, "shipping_agent_description", "VARCHAR(255)", 1, null, 0]], "primary_keys": ["shipping_agent_code"], "foreign_keys": [], "unique_constraints": [[[0, 0, "shipping_agent_code"]]], "check_constraints": []}, "Documents": {"columns": [[0, "document_id", "INTEGER", 1, null, 1], [1, "document_status_code", "CHAR(15)", 1, null, 0], [2, "document_type_code", "CHAR(15)", 1, null, 0], [3, "shipping_agent_code", "CHAR(15)", 0, null, 0], [4, "receipt_date", "DATETIME", 0, null, 0], [5, "receipt_number", "VARCHAR(255)", 0, null, 0], [6, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["document_id"], "foreign_keys": [[0, 0, "Ref_Shipping_Agents", "shipping_agent_code", "shipping_agent_code", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Ref_Document_Status", "document_status_code", "document_status_code", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Ref_Document_Types", "document_type_code", "document_type_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Employees": {"columns": [[0, "employee_id", "INTEGER", 1, null, 1], [1, "role_code", "CHAR(15)", 1, null, 0], [2, "employee_name", "VARCHAR(255)", 0, null, 0], [3, "other_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["employee_id"], "foreign_keys": [[0, 0, "Roles", "role_code", "role_code", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Document_Drafts": {"columns": [[0, "document_id", "INTEGER", 1, null, 1], [1, "draft_number", "INTEGER", 1, null, 2], [2, "draft_details", "VARCHAR(255)", 0, null, 0]], "primary_keys": ["document_id", "draft_number"], "foreign_keys": [[0, 0, "Documents", "document_id", "document_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "document_id"], [1, 1, "draft_number"]]], "check_constraints": []}, "Draft_Copies": {"columns": [[0, "document_id", "INTEGER", 1, null, 1], [1, "draft_number", "INTEGER", 1, null, 2], [2, "copy_number", "INTEGER", 1, null, 3]], "primary_keys": ["document_id", "draft_number", "copy_number"], "foreign_keys": [[0, 0, "Document_Drafts", "document_id", "document_id", "NO ACTION", "NO ACTION", "NONE"], [0, 1, "Document_Drafts", "draft_number", "draft_number", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "document_id"], [1, 1, "draft_number"], [2, 2, "copy_number"]]], "check_constraints": []}, "Circulation_History": {"columns": [[0, "document_id", "INTEGER", 1, null, 1], [1, "draft_number", "INTEGER", 1, null, 2], [2, "copy_number", "INTEGER", 1, null, 3], [3, "employee_id", "INTEGER", 1, null, 4]], "primary_keys": ["document_id", "draft_number", "copy_number", "employee_id"], "foreign_keys": [[0, 0, "Employees", "employee_id", "employee_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Draft_Copies", "document_id", "document_id", "NO ACTION", "NO ACTION", "NONE"], [1, 1, "Draft_Copies", "draft_number", "draft_number", "NO ACTION", "NO ACTION", "NONE"], [1, 2, "Draft_Copies", "copy_number", "copy_number", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "document_id"], [1, 1, "draft_number"], [2, 2, "copy_number"], [3, 3, "employee_id"]]], "check_constraints": []}, "Documents_Mailed": {"columns": [[0, "document_id", "INTEGER", 1, null, 1], [1, "mailed_to_address_id", "INTEGER", 1, null, 2], [2, "mailing_date", "DATETIME", 0, null, 0]], "primary_keys": ["document_id", "mailed_to_address_id"], "foreign_keys": [[0, 0, "Addresses", "mailed_to_address_id", "address_id", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Documents", "document_id", "document_id", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "document_id"], [1, 1, "mailed_to_address_id"]]], "check_constraints": []}}
CREATE TABLE Ref_Document_Types ( document_type_code CHAR(15) NOT NULL PRIMARY KEY, document_type_description VARCHAR(255) NOT NULL, UNIQUE (document_type_code) ); CREATE TABLE Roles ( role_code CHAR(15) NOT NULL PRIMARY KEY, role_description VARCHAR(255), UNIQUE (role_code) ); CREATE TABLE Addresses ( address_id INTEGER NOT NULL PRIMARY KEY, address_details VARCHAR(255) ); CREATE TABLE Ref_Document_Status ( document_status_code CHAR(15) NOT NULL PRIMARY KEY, document_status_description VARCHAR(255) NOT NULL, UNIQUE (document_status_code) ); CREATE TABLE Ref_Shipping_Agents ( shipping_agent_code CHAR(15) NOT NULL PRIMARY KEY, shipping_agent_name VARCHAR(255) NOT NULL, shipping_agent_description VARCHAR(255) NOT NULL, UNIQUE (shipping_agent_code) ); CREATE TABLE Documents ( document_id INTEGER NOT NULL PRIMARY KEY, document_status_code CHAR(15) NOT NULL, document_type_code CHAR(15) NOT NULL, shipping_agent_code CHAR(15), receipt_date DATETIME, receipt_number VARCHAR(255), other_details VARCHAR(255), FOREIGN KEY (shipping_agent_code) REFERENCES Ref_Shipping_Agents(shipping_agent_code), FOREIGN KEY (document_status_code) REFERENCES Ref_Document_Status(document_status_code), FOREIGN KEY (document_type_code) REFERENCES Ref_Document_Types(document_type_code) ); CREATE TABLE Employees ( employee_id INTEGER NOT NULL PRIMARY KEY, role_code CHAR(15) NOT NULL, employee_name VARCHAR(255), other_details VARCHAR(255), FOREIGN KEY (role_code) REFERENCES Roles(role_code) ); CREATE TABLE Document_Drafts ( document_id INTEGER NOT NULL PRIMARY KEY, draft_number INTEGER NOT NULL PRIMARY KEY, draft_details VARCHAR(255), PRIMARY KEY (document_id, draft_number), UNIQUE (document_id, draft_number), FOREIGN KEY (document_id) REFERENCES Documents(document_id) ); CREATE TABLE Draft_Copies ( document_id INTEGER NOT NULL PRIMARY KEY, draft_number INTEGER NOT NULL PRIMARY KEY, copy_number INTEGER NOT NULL PRIMARY KEY, PRIMARY KEY (document_id, draft_number, copy_number), UNIQUE (document_id, draft_number, copy_number), FOREIGN KEY (document_id) REFERENCES Document_Drafts(document_id), FOREIGN KEY (draft_number) REFERENCES Document_Drafts(draft_number) ); CREATE TABLE Circulation_History ( document_id INTEGER NOT NULL PRIMARY KEY, draft_number INTEGER NOT NULL PRIMARY KEY, copy_number INTEGER NOT NULL PRIMARY KEY, employee_id INTEGER NOT NULL PRIMARY KEY, PRIMARY KEY (document_id, draft_number, copy_number, employee_id), UNIQUE (document_id, draft_number, copy_number, employee_id), FOREIGN KEY (employee_id) REFERENCES Employees(employee_id), FOREIGN KEY (document_id) REFERENCES Draft_Copies(document_id), FOREIGN KEY (draft_number) REFERENCES Draft_Copies(draft_number), FOREIGN KEY (copy_number) REFERENCES Draft_Copies(copy_number) ); CREATE TABLE Documents_Mailed ( document_id INTEGER NOT NULL PRIMARY KEY, mailed_to_address_id INTEGER NOT NULL PRIMARY KEY, mailing_date DATETIME, PRIMARY KEY (document_id, mailed_to_address_id), UNIQUE (document_id, mailed_to_address_id), FOREIGN KEY (mailed_to_address_id) REFERENCES Addresses(address_id), FOREIGN KEY (document_id) REFERENCES Documents(document_id) );
college_3
{"Student": {"columns": [[0, "StuID", "INTEGER", 0, null, 1], [1, "LName", "VARCHAR(12)", 0, null, 0], [2, "Fname", "VARCHAR(12)", 0, null, 0], [3, "Age", "INTEGER", 0, null, 0], [4, "Sex", "VARCHAR(1)", 0, null, 0], [5, "Major", "INTEGER", 0, null, 0], [6, "Advisor", "INTEGER", 0, null, 0], [7, "city_code", "VARCHAR(3)", 0, null, 0]], "primary_keys": ["StuID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Faculty": {"columns": [[0, "FacID", "INTEGER", 0, null, 1], [1, "Lname", "VARCHAR(15)", 0, null, 0], [2, "Fname", "VARCHAR(15)", 0, null, 0], [3, "Rank", "VARCHAR(15)", 0, null, 0], [4, "Sex", "VARCHAR(1)", 0, null, 0], [5, "Phone", "INTEGER", 0, null, 0], [6, "Room", "VARCHAR(5)", 0, null, 0], [7, "Building", "VARCHAR(13)", 0, null, 0]], "primary_keys": ["FacID"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Department": {"columns": [[0, "DNO", "INTEGER", 0, null, 1], [1, "Division", "VARCHAR(2)", 0, null, 0], [2, "DName", "VARCHAR(25)", 0, null, 0], [3, "Room", "VARCHAR(5)", 0, null, 0], [4, "Building", "VARCHAR(13)", 0, null, 0], [5, "DPhone", "INTEGER", 0, null, 0]], "primary_keys": ["DNO"], "foreign_keys": [], "unique_constraints": [], "check_constraints": []}, "Member_of": {"columns": [[0, "FacID", "INTEGER", 0, null, 0], [1, "DNO", "INTEGER", 0, null, 0], [2, "Appt_Type", "VARCHAR(15)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Department", "DNO", "DNO", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Faculty", "FacID", "FacID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Course": {"columns": [[0, "CID", "VARCHAR(7)", 0, null, 1], [1, "CName", "VARCHAR(40)", 0, null, 0], [2, "Credits", "INTEGER", 0, null, 0], [3, "Instructor", "INTEGER", 0, null, 0], [4, "Days", "VARCHAR(5)", 0, null, 0], [5, "Hours", "VARCHAR(11)", 0, null, 0], [6, "DNO", "INTEGER", 0, null, 0]], "primary_keys": ["CID"], "foreign_keys": [[0, 0, "Department", "DNO", "DNO", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Faculty", "Instructor", "FacID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [[[0, 0, "CID"]]], "check_constraints": []}, "Minor_in": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "DNO", "INTEGER", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Department", "DNO", "DNO", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Enrolled_in": {"columns": [[0, "StuID", "INTEGER", 0, null, 0], [1, "CID", "VARCHAR(7)", 0, null, 0], [2, "Grade", "VARCHAR(2)", 0, null, 0]], "primary_keys": [], "foreign_keys": [[0, 0, "Gradeconversion", "Grade", "lettergrade", "NO ACTION", "NO ACTION", "NONE"], [1, 0, "Course", "CID", "CID", "NO ACTION", "NO ACTION", "NONE"], [2, 0, "Student", "StuID", "StuID", "NO ACTION", "NO ACTION", "NONE"]], "unique_constraints": [], "check_constraints": []}, "Gradeconversion": {"columns": [[0, "lettergrade", "VARCHAR(2)", 0, null, 1], [1, "gradepoint", "FLOAT", 0, null, 0]], "primary_keys": ["lettergrade"], "foreign_keys": [], "unique_constraints": [[[0, 0, "lettergrade"]]], "check_constraints": []}}
CREATE TABLE Student ( StuID INTEGER PRIMARY KEY, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ); CREATE TABLE Faculty ( FacID INTEGER PRIMARY KEY, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ); CREATE TABLE Department ( DNO INTEGER PRIMARY KEY, Division VARCHAR(2), DName VARCHAR(25), Room VARCHAR(5), Building VARCHAR(13), DPhone INTEGER ); CREATE TABLE Member_of ( FacID INTEGER, DNO INTEGER, Appt_Type VARCHAR(15), FOREIGN KEY (DNO) REFERENCES Department(DNO), FOREIGN KEY (FacID) REFERENCES Faculty(FacID) ); CREATE TABLE Course ( CID VARCHAR(7) PRIMARY KEY, CName VARCHAR(40), Credits INTEGER, Instructor INTEGER, Days VARCHAR(5), Hours VARCHAR(11), DNO INTEGER, UNIQUE (CID), FOREIGN KEY (DNO) REFERENCES Department(DNO), FOREIGN KEY (Instructor) REFERENCES Faculty(FacID) ); CREATE TABLE Minor_in ( StuID INTEGER, DNO INTEGER, FOREIGN KEY (DNO) REFERENCES Department(DNO), FOREIGN KEY (StuID) REFERENCES Student(StuID) ); CREATE TABLE Enrolled_in ( StuID INTEGER, CID VARCHAR(7), Grade VARCHAR(2), FOREIGN KEY (Grade) REFERENCES Gradeconversion(lettergrade), FOREIGN KEY (CID) REFERENCES Course(CID), FOREIGN KEY (StuID) REFERENCES Student(StuID) ); CREATE TABLE Gradeconversion ( lettergrade VARCHAR(2) PRIMARY KEY, gradepoint FLOAT, UNIQUE (lettergrade) );