instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_34393 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the winner when the Score was 274 ( 14) in tennessee?
| SELECT "Winner" FROM table_34393 WHERE "Score" = '274 (–14)' AND "Location" = 'tennessee' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE microlab (
microl... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '005-48105' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_name_79 (
player VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is from South Africa?
| SELECT player FROM table_name_79 WHERE country = "south africa" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
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
)
CREATE TABLE university (
Scho... | SELECT All_Games, School_ID FROM basketball_match | nvbench |
CREATE TABLE table_17001 (
"Season" real,
"Position" real,
"Win/Loss" text,
"Coach" text,
"Captain" text,
"Dudley Tuckey Medal" text,
"Leading goalkicker" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are all the win/loss where season ... | SELECT "Win/Loss" FROM table_17001 WHERE "Season" = '2009' | wikisql |
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 jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '46219280257' | css |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAc... | SELECT COUNT(question.Id) FROM Posts AS question INNER JOIN Posts AS answer ON question.Id = answer.ParentId AND question.Tags LIKE '%##TagName1##%' | sede |
CREATE TABLE table_train_19 (
"id" int,
"white_blood_cell_count_wbc" int,
"active_infection" bool,
"heart_disease" bool,
"temperature" float,
"skin_lesion" bool,
"heart_rate" int,
"paco2" float,
"immature_form" int,
"respiratory_rate" int,
"age" float,
"NOUSE" float
)
-... | SELECT * FROM table_train_19 WHERE active_infection = 1 | criteria2sql |
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
-- Using valid SQLite, answer the following que... | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_name_52 (
place INTEGER,
total VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the smallest place number when the total is 16 and average is less than 16?
| SELECT MIN(place) FROM table_name_52 WHERE total = 16 AND average < 16 | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | SELECT HIRE_DATE, AVG(SALARY) FROM employees ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_17058226_10 (
date VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On how many dates did the Timberwolves play Phoenix?
| SELECT COUNT(date) FROM table_17058226_10 WHERE team = "Phoenix" | sql_create_context |
CREATE TABLE table_name_67 (
date VARCHAR,
venue VARCHAR,
goal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What day is miami the venue with 38 goals?
| SELECT date FROM table_name_67 WHERE venue = "miami" AND goal = 38 | sql_create_context |
CREATE TABLE table_58716 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the venue for the game on 18/03/2006?
| SELECT "Venue" FROM table_58716 WHERE "Date" = '18/03/2006' | wikisql |
CREATE TABLE table_62368 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what City/State did the ATCC Round 4 series take place?
| SELECT "City / State" FROM table_62368 WHERE "Series" = 'atcc round 4' | wikisql |
CREATE TABLE table_52925 (
"Class" text,
"Wheels" text,
"Date" text,
"No. built" real,
"Loco Nos." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many were built with a locomotive number of 11-20?
| SELECT "No. built" FROM table_52925 WHERE "Loco Nos." = '11-20' | wikisql |
CREATE TABLE table_7289 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the opponent of the Bye result?
| SELECT "Opponent" FROM table_7289 WHERE "Result" = 'bye' | wikisql |
CREATE TABLE table_name_56 (
height VARCHAR,
name VARCHAR,
position VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How tall is the freshman guard Cetera Degraffenreid?
| SELECT height FROM table_name_56 WHERE position = "guard" AND year = "freshman" AND name = "cetera degraffenreid" | sql_create_context |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZ... | css |
CREATE TABLE table_204_864 (
id number,
"pos" number,
"class" text,
"no" number,
"team" text,
"drivers" text,
"chassis" text,
"engine" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what type of engine did drivers use the most in this ra... | SELECT "engine" FROM table_204_864 GROUP BY "engine" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_name_93 (
races VARCHAR,
position VARCHAR,
podiums VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the number of races associated with 7 podiums and a position of 4th?
| SELECT races FROM table_name_93 WHERE position = "4th" AND podiums = "7" | sql_create_context |
CREATE TABLE table_train_1 (
"id" int,
"sinusal_rhythm" bool,
"severe_sepsis" bool,
"hemodynamic_instability" bool,
"social_security" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- minors
| SELECT * FROM table_train_1 WHERE age >= 18 | criteria2sql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.age < "51" | mimicsql_data |
CREATE TABLE table_4602 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What venue featured north melbourne as the away s... | SELECT "Venue" FROM table_4602 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE club (
Club_ID int,
... | SELECT Country, COUNT(Country) FROM competition GROUP BY Country ORDER BY Country | nvbench |
CREATE TABLE table_name_1 (
riaa_sales_certification VARCHAR,
billboard_200_peak VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What RIAA Sales Certification was awarded to the song that had a Billboard 200 Peak of 21?
| SELECT riaa_sales_certification FROM table_name_1 WHERE billboard_200_peak = 21 | sql_create_context |
CREATE TABLE table_13484 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score when To par was 3, in South Africa, for Richard Sterne?
| SELECT AVG("Score") FROM table_13484 WHERE "To par" = '−3' AND "Country" = 'south africa' AND "Player" = 'richard sterne' | wikisql |
CREATE TABLE table_3073 (
"Country" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot %" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT "Skip" FROM table_3073 WHERE "Ends Lost" = '46' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '窦德水' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2000-04-27' AND '2009-12-29' | css |
CREATE TABLE table_42766 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Venue is Melbourne Cricket Ground, and when Result is Eng By Inns&225 Runs?
| SELECT "Date" FROM table_42766 WHERE "Venue" = 'melbourne cricket ground' AND "Result" = 'eng by inns&225 runs' | wikisql |
CREATE TABLE table_66011 (
"Ship" text,
"Year" real,
"Dates" text,
"Line" text,
"From" text,
"Distance" text,
"Days, hours, minutes" text,
"Speed" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Days, hours, minutes for the GW... | SELECT "Days, hours, minutes" FROM table_66011 WHERE "Line" = 'gw' AND "From" = 'liverpool' | wikisql |
CREATE TABLE table_name_72 (
date VARCHAR,
result_f_a VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Result F A of 5 0 had what date?
| SELECT date FROM table_name_72 WHERE result_f_a = "5–0" | sql_create_context |
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 diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "V202" | mimicsql_data |
CREATE TABLE table_55149 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average crowd size for an away team ... | SELECT AVG("Crowd") FROM table_55149 WHERE "Away team score" = '14.19 (103)' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480') AND patient.unitdischargetime IS N... | eicu |
CREATE TABLE table_72717 (
"City/town" text,
"Municipality" text,
"County" text,
"City/town status" real,
"Population" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total population in the city/town of Arendal?
| SELECT COUNT("Population") FROM table_72717 WHERE "City/town" = 'Arendal' | wikisql |
CREATE TABLE Staff (
staff_id INTEGER,
staff_address_id INTEGER,
nickname VARCHAR(80),
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_name VARCHAR(80),
date_of_birth DATETIME,
date_joined_staff DATETIME,
date_left_staff DATETIME
)
CREATE TABLE Lessons (
lesson_id INTEGER,... | SELECT date_of_birth, COUNT(date_of_birth) FROM Customers WHERE customer_status_code = 'Good Customer' | nvbench |
CREATE TABLE table_203_541 (
id number,
"games" text,
"host city" text,
"dates" text,
"nations" number,
"participants" number,
"events" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which olympics had the most participants ?
| SELECT "games" FROM table_203_541 ORDER BY "participants" DESC LIMIT 1 | squall |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End... | SELECT T1.Customer_Details, T1.Customer_ID FROM Customers AS T1 JOIN Customer_Policies AS T2 ON T1.Customer_ID = T2.Customer_ID ORDER BY T1.Customer_Details DESC | nvbench |
CREATE TABLE table_64526 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is t... | SELECT "Date of vacancy" FROM table_64526 WHERE "Date of appointment" = '1 january 2009' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT CHA_ITEM_LEV FROM t_kc22 WHERE MED_CLINIC_ID = '97296432367' AND SOC_SRT_DIRE_CD = '704404350' | css |
CREATE TABLE table_79593 (
"Rank" real,
"Total Population (2010)" real,
"Indian American Population (2010)" real,
"% Indian American" real,
"Asian American Population (2010)" real,
"% Asian American" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-... | SELECT MIN("Total Population (2010)") FROM table_79593 WHERE "% Asian American" = '5.7' AND "Asian American Population (2010)" < '126,965' | wikisql |
CREATE TABLE table_21532 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When t... | SELECT "High rebounds" FROM table_21532 WHERE "High assists" = 'Shawn Marion (6)' | wikisql |
CREATE TABLE table_name_72 (
margin_of_victory VARCHAR,
winning_score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the Winning score is 74-68-67-75=284, what was the Margin of victory?
| SELECT margin_of_victory FROM table_name_72 WHERE winning_score = 74 - 68 - 67 - 75 = 284 | sql_create_context |
CREATE TABLE table_name_61 (
gold VARCHAR,
bronze VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the Gold that also has Bronze of Kim Sun-Bin?
| SELECT gold FROM table_name_61 WHERE bronze = "kim sun-bin" | sql_create_context |
CREATE TABLE table_name_57 (
high_assists VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had the most assists in the game against Indiana?
| SELECT high_assists FROM table_name_57 WHERE team = "indiana" | sql_create_context |
CREATE TABLE table_name_51 (
position VARCHAR,
college VARCHAR,
pick VARCHAR,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the position when the pick is more than 2, the overall is more than 28 and the college is nebraska?
| SELECT position FROM table_name_51 WHERE pick > 2 AND overall > 28 AND college = "nebraska" | sql_create_context |
CREATE TABLE table_44229 (
"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 the first week when there was an attendance over 75,00... | SELECT MIN("Week") FROM table_44229 WHERE "Game site" = 'mile high stadium' AND "Attendance" > '75,007' | wikisql |
CREATE TABLE table_name_22 (
issue VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Issue number was released on August 17, 2011?
| SELECT issue FROM table_name_22 WHERE date = "august 17, 2011" | sql_create_context |
CREATE TABLE table_1603 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had... | SELECT "High assists" FROM table_1603 WHERE "Date" = 'March 15' | wikisql |
CREATE TABLE table_44473 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the date of the game where the NY Islanders are the home team?
| SELECT "Date" FROM table_44473 WHERE "Home" = 'ny islanders' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS va... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
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 MAX(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2049" | mimicsql_data |
CREATE TABLE table_66855 (
"Round" text,
"Fixtures" real,
"Clubs" text,
"New entries" text,
"Leagues entering" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the value for New entries, when the value for Fixtures is 2?
| SELECT "New entries" FROM table_66855 WHERE "Fixtures" = '2' | wikisql |
CREATE TABLE table_name_73 (
result VARCHAR,
road_team VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the result for Boston's road team in game 4?
| SELECT result FROM table_name_73 WHERE road_team = "boston" AND game = "game 4" | sql_create_context |
CREATE TABLE table_27366772_3 (
population__2001_ INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest population in 2001?
| SELECT MAX(population__2001_) FROM table_27366772_3 | sql_create_context |
CREATE TABLE table_25557556_5 (
couple VARCHAR,
average VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What couple averaged 21.0?
| SELECT couple FROM table_25557556_5 WHERE average = "21.0" | sql_create_context |
CREATE TABLE table_203_288 (
id number,
"season" text,
"premiere date" text,
"the winner" text,
"runner-up" text,
"finalists" text,
"contestants in order of elimination" text,
"number of contestants" text,
"number of concerts" number
)
-- Using valid SQLite, answer the following qu... | SELECT "season" FROM table_203_288 WHERE "the winner" = 'zani (v6)' | squall |
CREATE TABLE table_204_398 (
id number,
"title" text,
"year" number,
"publisher" text,
"developer" text,
"platforms" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what lord of the rings game was previously released before lego the lord of the r... | SELECT "title" FROM table_204_398 WHERE id = (SELECT id FROM table_204_398 WHERE "title" = 'lego the lord of the rings') - 1 | squall |
CREATE TABLE table_301 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What offensive line player hailed from Baton Rouge, Louisiana?
| SELECT "Player" FROM table_301 WHERE "Position" = 'Offensive line' AND "Hometown" = 'Baton Rouge, Louisiana' | wikisql |
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 procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Radical neck dissection, unilateral" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_name_96 (
score VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was John Fought's score?
| SELECT score FROM table_name_96 WHERE player = "john fought" | sql_create_context |
CREATE TABLE table_204_74 (
id number,
"#" number,
"title" text,
"producers" text,
"guest performers" text,
"length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long is the longest track on the album ?
| SELECT MAX("length") FROM table_204_74 | squall |
CREATE TABLE table_name_94 (
winner VARCHAR,
runner_up VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the winner in the game that had Teikyo as the runner-up?
| SELECT winner FROM table_name_94 WHERE runner_up = "teikyo" | sql_create_context |
CREATE TABLE table_27516 (
"Supply sector (% of GDP in current prices)" text,
"1993-2001" text,
"2002-2005" text,
"2006-2009" text,
"2010-2012" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What sector had a 1.4 GDP for 2006-2009?
| SELECT "Supply sector (% of GDP in current prices)" FROM table_27516 WHERE "2006-2009" = '1.4' | wikisql |
CREATE TABLE table_25200461_9 (
city VARCHAR,
democratic VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If Democratic is 42.5%, what is the city?
| SELECT city FROM table_25200461_9 WHERE democratic = "42.5%" | sql_create_context |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_... | advising |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodici... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-203413' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'pao2... | eicu |
CREATE TABLE table_35486 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won by 2 or more goals difference" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- W... | SELECT MIN("Played") FROM table_35486 WHERE "Position" = '6' AND "Drawn" < '1' | wikisql |
CREATE TABLE Residents_Services (
resident_id INTEGER,
service_id INTEGER,
date_moved_in DATETIME,
property_id INTEGER,
date_requested DATETIME,
date_provided DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_details VARCHAR(255)
)
CREATE... | SELECT date_moved_in, COUNT(date_moved_in) FROM Customers AS T1 JOIN Customer_Events AS T2 ON T1.customer_id = T2.customer_id GROUP BY date_moved_in ORDER BY date_moved_in DESC | nvbench |
CREATE TABLE table_22107 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who is the incumbent democratic party in district florida 11?
| SELECT "Incumbent" FROM table_22107 WHERE "Party" = 'Democratic' AND "District" = 'Florida 11' | wikisql |
CREATE TABLE table_10812938_5 (
player VARCHAR,
cfl_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player is on the Montreal Alouettes CFl team?
| SELECT player FROM table_10812938_5 WHERE cfl_team = "Montreal Alouettes" | sql_create_context |
CREATE TABLE table_203_455 (
id number,
"round" number,
"#" number,
"player" text,
"nationality" text,
"college/junior/club team (league)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what were the total number of players selected in the secon... | SELECT COUNT("player") FROM table_203_455 WHERE "round" = 2 | squall |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE table_25988 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions... | SELECT COUNT("Blocks") FROM table_25988 WHERE "Points" = '4' | 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 MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.days_stay = "27" | mimicsql_data |
CREATE TABLE table_1137696_3 (
winning_driver VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the winning driver of round 7?
| SELECT winning_driver FROM table_1137696_3 WHERE round = 7 | sql_create_context |
CREATE TABLE table_name_61 (
venue VARCHAR,
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of the match with a w result on 3 March 2010?
| SELECT venue FROM table_name_61 WHERE result = "w" AND date = "3 march 2010" | sql_create_context |
CREATE TABLE table_7817 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What wa... | SELECT "Record" FROM table_7817 WHERE "Game" < '7' AND "Date" = 'november 7' | wikisql |
CREATE TABLE table_203_309 (
id number,
"team" text,
"winners" number,
"runners-up" number,
"years won" text,
"years lost" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which team or teams had five winners total ?
| SELECT "team" FROM table_203_309 WHERE "winners" = 5 | squall |
CREATE TABLE table_77484 (
"Actor in London, 2002" text,
"Actor in New York, 2006" text,
"Actor in Moscow, 2007" text,
"Voyage" text,
"Shipwreck" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the Actor in the New York production in 2006 for... | SELECT "Actor in New York, 2006" FROM table_77484 WHERE "Actor in Moscow, 2007" = 'ramilya iskander' | wikisql |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra... | advising |
CREATE TABLE table_7228 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest against when the lost is 3 w... | SELECT MAX("Against") FROM table_7228 WHERE "Lost" = '3' AND "Points" < '30' | wikisql |
CREATE TABLE table_204_888 (
id number,
"location" text,
"mile" number,
"destinations" text,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what destination is after the national pike ?
| SELECT "destinations" FROM table_204_888 WHERE id = (SELECT id FROM table_204_888 WHERE "destinations" = 'us 40 scenic west (national pike)') + 1 | squall |
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.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '王清俊' AND NOT ... | css |
CREATE TABLE table_name_6 (
builder VARCHAR,
locomotive VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Builder of Locomotive 2?
| SELECT builder FROM table_name_6 WHERE locomotive = "2" | sql_create_context |
CREATE TABLE table_39262 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Earnings ($) is the lowest one that has a Rank smaller than 1?
| SELECT MIN("Earnings ( $ )") FROM table_39262 WHERE "Rank" < '1' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
... | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate dehydrogenase (ld)') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHE... | mimic_iii |
CREATE TABLE table_name_72 (
attendance VARCHAR,
tie_no VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the attendance for No. 15 tie?
| SELECT attendance FROM table_name_72 WHERE tie_no = "15" | sql_create_context |
CREATE TABLE table_60056 (
"Team" text,
"Wins" text,
"Losses" text,
"Points" text,
"WPct." text,
"G.F." text,
"G.A." text,
"Assists" text,
"Penalties" text,
"P.I.M." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What assists has... | SELECT "Assists" FROM table_60056 WHERE "Points" = '10' | wikisql |
CREATE TABLE authors (
fname VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Find the first names of all the authors ordered in alphabetical order.
| SELECT fname FROM authors ORDER BY fname | sql_create_context |
CREATE TABLE table_3292 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many wins d... | SELECT "Wins" FROM table_3292 WHERE "Team" = 'Prema Powerteam' AND "Points" = '240' | wikisql |
CREATE TABLE table_29371 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT "Title" FROM table_29371 WHERE "No. in season" = '16' | wikisql |
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 procedures (
... | SELECT demographic.discharge_location, demographic.diagnosis FROM demographic WHERE demographic.subject_id = "91588" | mimicsql_data |
CREATE TABLE table_6592 (
"Locomotive" text,
"Delivered as" text,
"Entered service" text,
"Owner" text,
"Status" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Owner Delivered the T415?
| SELECT "Owner" FROM table_6592 WHERE "Delivered as" = 't415' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-227292')) AND vitalperiodic.respiration > 21.0 AND NOT vitalperi... | eicu |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oxyge... | eicu |
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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM... | css |
CREATE TABLE table_46039 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the lowest total when there's less than 16 bronze and more than 6 silver?
| SELECT MIN("Total") FROM table_46039 WHERE "Bronze" < '16' AND "Silver" > '6' | wikisql |
CREATE TABLE table_615 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Area" real,
"Population" real,
"Density" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the capital of the district who's simplified... | SELECT COUNT("Pinyin") FROM table_615 WHERE "Simplified" = '信州区' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.