instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_11214772_1 (
runner_up VARCHAR,
year VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the runner-up where year is 2004 and champion is north carolina state
| SELECT runner_up FROM table_11214772_1 WHERE year = "2004" AND champion = "North Carolina State" | sql_create_context |
CREATE TABLE table_21062353_1 (
opponent VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the the opponents of the Wildcats for game 8 of the season?
| SELECT opponent FROM table_21062353_1 WHERE game = 8 | sql_create_context |
CREATE TABLE table_4343 (
"Country/Region" text,
"Name" text,
"Host" text,
"Network" text,
"Premiere" text,
"Prize" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the 13 january 2009 host
| SELECT "Host" FROM table_4343 WHERE "Premiere" = '13 january 2009' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.dob FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Na... | SELECT Destroyed_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destroyed_by_Employee_ID | nvbench |
CREATE TABLE table_26748 (
"Position" text,
"Name" text,
"Nationality" text,
"Event 1 Medley" text,
"Event 2 Truck Pull" text,
"Event 3 Dead Lift" text,
"Event 4 Fingals Fingers" text,
"Event 5 Keg Toss" text,
"Event 6 Atlas Stones" text
)
-- Using valid SQLite, answer the followin... | SELECT COUNT("Event 6 Atlas Stones") FROM table_26748 WHERE "Event 3 Dead Lift" = '2 (6 in 30.89s)' | wikisql |
CREATE TABLE table_name_26 (
school_club_team VARCHAR,
pick INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the school/club team of the player with a pick larger than 83?
| SELECT school_club_team FROM table_name_26 WHERE pick > 83 | sql_create_context |
CREATE TABLE table_51328 (
"CERCLIS ID" text,
"Name" text,
"Municipality" text,
"Proposed" text,
"Listed" text,
"Construction completed" text,
"Partially deleted" text,
"Deleted" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What site i... | SELECT "Deleted" FROM table_51328 WHERE "Name" = 'rca del caribe' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '1833407' AND IN_HOSP_DATE BETWEEN '2010-07-26' AND '2011-07-21' | css |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
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)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.ethnicity = "WHITE - RUSSIAN" | mimicsql_data |
CREATE TABLE table_2292 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directedby" text,
"Writtenby" text,
"Originalairdate" text,
"Production code" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT "Directedby" FROM table_2292 WHERE "Production code" = '4WAB04' | wikisql |
CREATE TABLE table_204_235 (
id number,
"season" text,
"team" text,
"country" text,
"competition" text,
"matches" number,
"goals" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the number of goals he scored in 2005 ?
| SELECT "goals" FROM table_204_235 WHERE "season" = 2005 | squall |
CREATE TABLE table_60263 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was their record when they played at Riverfront Stadium?
| SELECT "Record" FROM table_60263 WHERE "Game site" = 'riverfront stadium' | wikisql |
CREATE TABLE table_name_13 (
week_10_nov_5 VARCHAR,
week_9_oct_29 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the week 10 result where the week 9 result was Dropped: Maryland South Carolina?
| SELECT week_10_nov_5 FROM table_name_13 WHERE week_9_oct_29 = "dropped: maryland south carolina" | sql_create_context |
CREATE TABLE table_name_25 (
record VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the record for kazuhiro nakamura
| SELECT record FROM table_name_25 WHERE opponent = "kazuhiro nakamura" | sql_create_context |
CREATE TABLE table_67904 (
"Match" real,
"Date" text,
"Tournament" text,
"Location" text,
"Opponent team" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What match number took place on August 3, 2007?
| SELECT MAX("Match") FROM table_67904 WHERE "Date" = 'august 3, 2007' | wikisql |
CREATE TABLE table_42238 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What language is used when the service is sky primafila 10 and th... | SELECT "Language" FROM table_42238 WHERE "Package/Option" = 'qualsiasi' AND "Television service" = 'sky primafila 10' | wikisql |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY MIN(basePrice) DESC | nvbench |
CREATE TABLE table_204_70 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the first player chosen by the cincinnati bengals , in round seven ?
| SELECT "player" FROM table_204_70 WHERE "nfl team" = 'cincinnati bengals' ORDER BY "pick #" LIMIT 1 | squall |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | SELECT wdmzjzjlb.JZLSH FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '35540831' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2012-12-15') UNION SELECT bdmzjzjlb.JZLSH FROM hz_info JOIN... | css |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE reviewer (
rid number,
name text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT T2.title, T1.mid FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid GROUP BY T1.mid ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT demographic.language FROM demographic WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE table_name_14 (
week VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What week number did November 19, 1989 games fall on?
| SELECT week FROM table_name_14 WHERE date = "november 19, 1989" | sql_create_context |
CREATE TABLE table_31486 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which CFL team got pick 34?
| SELECT "CFL Team" FROM table_31486 WHERE "Pick #" = '34' | wikisql |
CREATE TABLE table_15872814_3 (
team VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the team for november 9
| SELECT team FROM table_15872814_3 WHERE date = "November 9" | sql_create_context |
CREATE TABLE table_67473 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the callsign of the 5kW Sonshine Radio Cotabato?
| SELECT "Callsign" FROM table_67473 WHERE "Power (kW)" = '5kw' AND "Branding" = 'sonshine radio cotabato' | wikisql |
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
-- Using valid SQLite, answer the following questions for the ... | SELECT Name, Age FROM editor | nvbench |
CREATE TABLE table_24574438_1 (
indian_tamil INTEGER,
population_density___km_2__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the least indian tamil for population density being 240
| SELECT MIN(indian_tamil) FROM table_24574438_1 WHERE population_density___km_2__ = 240 | sql_create_context |
CREATE TABLE table_name_26 (
year INTEGER,
position VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year is center Ann Wauters?
| SELECT SUM(year) FROM table_name_26 WHERE position = "center" AND player = "ann wauters" | sql_create_context |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | SELECT Year, MAX(Score) FROM wine GROUP BY Year ORDER BY Year DESC | nvbench |
CREATE TABLE table_70740 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the game that had a record of 26 13 4 2 and ... | SELECT "Score" FROM table_70740 WHERE "Decision" = 'joseph' AND "Record" = '26–13–4–2' | wikisql |
CREATE TABLE table_256286_40 (
passed VARCHAR,
description VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What vote passed for the measure with the description, authorizing state acceptance of certain gifts?
| SELECT passed FROM table_256286_40 WHERE description = "Authorizing State Acceptance of Certain Gifts" | sql_create_context |
CREATE TABLE table_203_741 (
id number,
"season" text,
"competition" text,
"round" text,
"opponent" text,
"home" text,
"away" text,
"aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was their 1qr opponent in 2010-2011 ?
| SELECT "opponent" FROM table_203_741 WHERE "round" = '1qr' AND "season" = '2010-11' | squall |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varc... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 23 AND date_day.month_number = 4 AN... | atis |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT wdmzjzjlb.SG, wdmzjzjlb.TZ, wdmzjzjlb.TW, wdmzjzjlb.SSY, wdmzjzjlb.SZY, wdmzjzjlb.XL, wdmzjzjlb.HXPLC, wdmzjzjlb.ML FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '50197380603' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ, bdmzjzjlb.TW, bdmzjzjlb.SSY, bdmzjzjlb.SZY, bdmzjzjlb.XL, bdmzjzjlb.HXPLC, bdmzjzjlb.ML FROM bdmzjzjlb ... | css |
CREATE TABLE table_name_25 (
event_place VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where did someone run a 58:33?
| SELECT event_place FROM table_name_25 WHERE time = "58:33" | sql_create_context |
CREATE TABLE Courses (
course_id INTEGER,
author_id INTEGER,
subject_id INTEGER,
course_name VARCHAR(120),
course_description VARCHAR(255)
)
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password... | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" ORDER BY COUNT(date_of_completion) | nvbench |
CREATE TABLE table_203_166 (
id number,
"pos" text,
"no" number,
"rider" text,
"manufacturer" text,
"laps" number,
"time" text,
"grid" number,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many honda motorcycles compl... | SELECT COUNT(*) FROM table_203_166 WHERE "manufacturer" = 'honda' | squall |
CREATE TABLE table_69512 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the opponent with attendance of 31,777
| SELECT "Opponent" FROM table_69512 WHERE "Attendance" = '31,777' | wikisql |
CREATE TABLE table_33935 (
"Year" real,
"Team" text,
"Wins" real,
"Points" real,
"Championship Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Points have a Year larger than 1998, and Wins of 1?
| SELECT AVG("Points") FROM table_33935 WHERE "Year" > '1998' AND "Wins" = '1' | wikisql |
CREATE TABLE table_68737 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Pts." real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which chassis has a year later than 1964, a Ford engine, and 13 points?
| SELECT "Chassis" FROM table_68737 WHERE "Year" > '1964' AND "Engine" = 'ford' AND "Pts." = '13' | wikisql |
CREATE TABLE table_name_7 (
opponent VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Opponent, when Date is December 18, 1988?
| SELECT opponent FROM table_name_7 WHERE date = "december 18, 1988" | sql_create_context |
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state text
)
CREATE TABLE ... | SELECT DISTINCT T1.cust_name, T1.credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id | spider |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '90373128811' | css |
CREATE TABLE table_name_45 (
production_company VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which production company has the year of 2005 listed?
| SELECT production_company FROM table_name_45 WHERE year = "2005" | sql_create_context |
CREATE TABLE wdmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | SELECT wdmzjzjlb.YLJGDM FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '64287856' UNION SELECT bdmzjzjlb.YLJGDM FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_info.KH = bdmzjzjlb.KH AND hz_info.... | css |
CREATE TABLE Draft_Copies (
document_id INTEGER,
draft_number INTEGER,
copy_number INTEGER
)
CREATE TABLE Employees (
employee_id INTEGER,
role_code CHAR(15),
employee_name VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Documents (
document_id INTEGER,
document_status_code... | SELECT receipt_date, COUNT(receipt_date) FROM Documents ORDER BY receipt_date DESC | nvbench |
CREATE TABLE table_name_27 (
date VARCHAR,
goal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game with a goal of 7?
| SELECT date FROM table_name_27 WHERE goal = 7 | sql_create_context |
CREATE TABLE table_name_83 (
game_site VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the game site of the game with the san diego chargers as the opponent?
| SELECT game_site FROM table_name_83 WHERE opponent = "san diego chargers" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug = "Prochlorperazine" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '戚玉树' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_41960 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the tournament played on Sep 20, 1981, ending with a margin ... | SELECT "Tournament" FROM table_41960 WHERE "Margin of victory" = '2 strokes' AND "Date" = 'sep 20, 1981' | wikisql |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY AVG(age) DESC | nvbench |
CREATE TABLE table_23662272_4 (
couple VARCHAR,
number_of_dances VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the name of the couple if the number of dances is 6?
| SELECT couple FROM table_23662272_4 WHERE number_of_dances = 6 | sql_create_context |
CREATE TABLE table_203_877 (
id number,
"year" number,
"single" text,
"us cashbox" number,
"us hot 100" number,
"uk singles" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which single spent the least amount of time on the us hot 100 ?
| SELECT "single" FROM table_203_877 ORDER BY "us hot 100" LIMIT 1 | squall |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT demographic.dob, demographic.discharge_location FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE table_31074 (
"Train Number" real,
"Train Name" text,
"Departure Pune" text,
"Arrival Lonavla" text,
"Frequency" text,
"Origin" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many trains have the number 99808
| SELECT COUNT("Train Name") FROM table_31074 WHERE "Train Number" = '99808' | wikisql |
CREATE TABLE table_12459 (
"year" text,
"opus" text,
"town" text,
"kind" text,
"manuals" text,
"stops" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What manuals have the opus of 135?
| SELECT "manuals" FROM table_12459 WHERE "opus" = '135' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Dermatitis NOS" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_name_14 (
state VARCHAR,
electorate VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which State has an Electorate of Barton?
| SELECT state FROM table_name_14 WHERE electorate = "barton" | sql_create_context |
CREATE TABLE table_name_64 (
pos VARCHAR,
name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Eftychia Karagianni Pos.?
| SELECT pos FROM table_name_64 WHERE name = "eftychia karagianni" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.short_title = "Prim cardiomyopathy NEC" | mimicsql_data |
CREATE TABLE table_10191 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who did the cubs play on june 3?
| SELECT "Opponent" FROM table_10191 WHERE "Date" = 'june 3' | wikisql |
CREATE TABLE table_name_50 (
style VARCHAR,
first_performance VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Style of the First Performance of Billy Elliot on 15 November 2007?
| SELECT style FROM table_name_50 WHERE first_performance = "15 november 2007" | sql_create_context |
CREATE TABLE table_58249 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Date has a Record of 6-9?
| SELECT "Date" FROM table_58249 WHERE "Record" = '6-9' | wikisql |
CREATE TABLE table_name_54 (
margin_of_victory VARCHAR,
tournament VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Margin of victory at the Bob Hope Desert Classic Tournament?
| SELECT margin_of_victory FROM table_name_54 WHERE tournament = "bob hope desert classic" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.itemid = "50801" | mimicsql_data |
CREATE TABLE table_name_20 (
league VARCHAR,
fa_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value for the League Cup when the FA Cup value is 0 13 0 (49)?
| SELECT league AS Cup FROM table_name_20 WHERE fa_cup = "0 13 0 (49)" | sql_create_context |
CREATE TABLE table_15222 (
"Team" text,
"Car(s)" text,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Owner(s)" text,
"Crew Chief" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What primary sponsor has the owner Rick Hendrick and their crew chie... | SELECT "Primary Sponsor(s)" FROM table_15222 WHERE "Owner(s)" = 'rick hendrick' AND "Crew Chief" = 'alan gustafson' | wikisql |
CREATE TABLE table_203_365 (
id number,
"released" text,
"video title" text,
"company" text,
"director" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- name the first pornographic film listed on the table .
| SELECT "video title" FROM table_203_365 ORDER BY id LIMIT 1 | squall |
CREATE TABLE table_203_523 (
id number,
"state" text,
"swimsuit" number,
"interview" number,
"evening gown" number,
"average" number,
"finalists" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the difference in points between the f... | SELECT "finalists" - "average" FROM table_203_523 WHERE "state" = 'iowa' | squall |
CREATE TABLE field (
fieldid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE dataset ... | SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'NELL' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid | scholar |
CREATE TABLE table_name_90 (
cultural_and_educational_panel INTEGER,
industrial_and_commercial_panel VARCHAR,
agricultural_panel VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total of the cultural and educational panel when the industrial an... | SELECT SUM(cultural_and_educational_panel) FROM table_name_90 WHERE industrial_and_commercial_panel = 0 AND agricultural_panel > 0 | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_14069 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Rank of 6 has what time?
| SELECT "Time" FROM table_14069 WHERE "Rank" = '6' | wikisql |
CREATE TABLE table_name_31 (
college_junior_club_team__league_ VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What College team has 8 rounds?
| SELECT college_junior_club_team__league_ FROM table_name_31 WHERE round = 8 | sql_create_context |
CREATE TABLE table_69893 (
"Date" text,
"Bowl" text,
"Result" text,
"Points For" real,
"Points Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final result when the Mountaineers scored less than 13 and their opponents scored 26?... | SELECT "Result" FROM table_69893 WHERE "Points For" < '13' AND "Points Against" = '26' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
la... | SELECT lab.labname FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-4428')) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), '... | eicu |
CREATE TABLE table_50504 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team has finished in 1st place in 2011?
| SELECT "Team" FROM table_50504 WHERE "Pos." = '1st' AND "Year" = '2011' | wikisql |
CREATE TABLE table_71337 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total attendance for the August 8 game?
| SELECT SUM("Attendance") FROM table_71337 WHERE "Date" = 'august 8' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "74032" | mimicsql_data |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_60921 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what place(s) did the player(s) with a total less than 282 finish?
| SELECT "Finish" FROM table_60921 WHERE "Total" < '282' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name | nvbench |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '喻秀敏' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 8393.94) | css |
CREATE TABLE table_name_34 (
callsign VARCHAR,
commenced_operations VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What callsign has commenced operations in 2011?
| SELECT callsign FROM table_name_34 WHERE commenced_operations = 2011 | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name | nvbench |
CREATE TABLE table_name_77 (
date VARCHAR,
loss VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the Mariners game that had a loss of Segui (0-5)?
| SELECT date FROM table_name_77 WHERE loss = "segui (0-5)" | sql_create_context |
CREATE TABLE table_38901 (
"Pos." real,
"Car #" real,
"Driver" text,
"Make" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Pos have a Driver of todd bodine, and a Car # larger than 30?
| SELECT COUNT("Pos.") FROM table_38901 WHERE "Driver" = 'todd bodine' AND "Car #" > '30' | wikisql |
CREATE TABLE table_204_867 (
id number,
"number" number,
"date" text,
"name" text,
"age\n(at execution)" number,
"age\n(at offense)" number,
"race" text,
"state" text,
"method" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many ... | SELECT COUNT(*) FROM table_204_867 WHERE "age\n(at execution)" > 45 | squall |
CREATE TABLE table_5020 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is recorded as the lowest Round for the Player Jim Thompson?
| SELECT MIN("Round") FROM table_5020 WHERE "Player" = 'jim thompson' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" AND demographic.admityear >= "2166" | mimicsql_data |
CREATE TABLE table_15763 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.... | SELECT MIN("Goals for") FROM table_15763 WHERE "Position" > '4' AND "Draws" > '11' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'calcium chloride' AND STRFTIME('%y', medication.dru... | eicu |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE table_name_75 (
pole VARCHAR,
class VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many poles had a moto2 class?
| SELECT pole FROM table_name_75 WHERE class = "moto2" | sql_create_context |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | SELECT AVG(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '8773150' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-06-09' AND '2006-02-24' UNION SELECT AVG(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_OR... | css |
CREATE TABLE table_name_54 (
rank INTEGER,
time___sec__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank for the person with time 11.14?
| SELECT AVG(rank) FROM table_name_54 WHERE time___sec__ = 11.14 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2124" AND diagnoses.icd9_code = "29634" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.