instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_50459 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Gold medals did the Nation with less than 8 Total medals including 1 Bronze and 0 S... | SELECT MIN("Gold") FROM table_50459 WHERE "Total" < '8' AND "Bronze" < '1' AND "Silver" < '1' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND prescriptions.route = "PB" | mimicsql_data |
CREATE TABLE procedures (
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 procedures.short_title, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Heather Vineyard" | mimicsql_data |
CREATE TABLE table_75918 (
"Name" text,
"Height" text,
"Position" text,
"Year" text,
"Home Town" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What position does the 5-8 player from Grottoes, VA play?
| SELECT "Position" FROM table_75918 WHERE "Height" = '5-8' AND "Home Town" = 'grottoes, va' | wikisql |
CREATE TABLE table_name_16 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What shows for 2005 when 2002 shows 0 1?
| SELECT 2005 FROM table_name_16 WHERE 2002 = "0–1" | sql_create_context |
CREATE TABLE table_77645 (
"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.
-- Which team won when the visitor was Carolina?
| SELECT "Decision" FROM table_77645 WHERE "Visitor" = 'carolina' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe... | mimic_iii |
CREATE TABLE table_45106 (
"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 driven 134 laps?
| SELECT "Team" FROM table_45106 WHERE "Laps" = '134' | wikisql |
CREATE TABLE table_14260 (
"Rank" real,
"Heat" real,
"Cyclist" text,
"Nation" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the rank when heat is 9 and the nation is great britain?
| SELECT SUM("Rank") FROM table_14260 WHERE "Heat" = '9' AND "Nation" = 'great britain' | wikisql |
CREATE TABLE Addresses (
address_id INTEGER,
address_details VARCHAR(255)
)
CREATE TABLE Suppliers (
supplier_id INTEGER,
supplier_name VARCHAR(80),
supplier_phone VARCHAR(80)
)
CREATE TABLE Department_Store_Chain (
dept_store_chain_id INTEGER,
dept_store_chain_name VARCHAR(80)
)
CREATE T... | SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code | nvbench |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
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 COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'administration of electrolytes - potassium' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME()... | eicu |
CREATE TABLE table_50776 (
"Circuit" text,
"Location / State" text,
"Date" text,
"Winner" text,
"Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- The winner, Craig Lowndes, was in what location/state?
| SELECT "Location / State" FROM table_50776 WHERE "Winner" = 'craig lowndes' | wikisql |
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 demographic (
subject_id text,
hadm_id t... | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.insurance = "Medicare" | mimicsql_data |
CREATE TABLE table_203_716 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many more bronze medals did canada earn than venezuela ?
| SELECT (SELECT "bronze" FROM table_203_716 WHERE "nation" = 'canada') - (SELECT "bronze" FROM table_203_716 WHERE "nation" = 'venezuela') | squall |
CREATE TABLE table_name_22 (
attendance INTEGER,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average attendance when Chicago Bears were the home team?
| SELECT AVG(attendance) FROM table_name_22 WHERE home = "chicago bears" | sql_create_context |
CREATE TABLE table_28178595_2 (
platform VARCHAR,
character VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many platforms have nanaly fletch as the character?
| SELECT COUNT(platform) FROM table_28178595_2 WHERE character = "Nanaly Fletch" | sql_create_context |
CREATE TABLE table_41266 (
"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 is the package/option for the calcio content?
| SELECT "Package/Option" FROM table_41266 WHERE "Content" = 'calcio' | wikisql |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID ORDER BY Name | nvbench |
CREATE TABLE table_name_98 (
overall VARCHAR,
player VARCHAR,
round VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total overall when Kenny Lewis is the player in a round after 5?
| SELECT COUNT(overall) FROM table_name_98 WHERE player = "kenny lewis" AND round > 5 | sql_create_context |
CREATE TABLE table_34567 (
"Episode No." text,
"Episode Title" text,
"UK Broadcast Date" text,
"Presenter" text,
"Countries Visited" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the UK broadcast date of the episode where Chris Bonington wa... | SELECT "UK Broadcast Date" FROM table_34567 WHERE "Presenter" = 'chris bonington' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 DESC | nvbench |
CREATE TABLE table_name_39 (
series VARCHAR,
editor VARCHAR,
albums VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which series with a total of 27 albums did Dargaud edit?
| SELECT series FROM table_name_39 WHERE editor = "dargaud" AND albums = "27" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 16572 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-4 year') | mimic_iii |
CREATE TABLE table_name_10 (
pujehun INTEGER,
measure VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average pjehun measured by female enrollment?
| SELECT AVG(pujehun) FROM table_name_10 WHERE measure = "female enrollment" | sql_create_context |
CREATE TABLE table_name_65 (
school VARCHAR,
nationality VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school's nationality was United States when its pick was 595?
| SELECT school FROM table_name_65 WHERE nationality = "united states" AND pick = "595" | sql_create_context |
CREATE TABLE table_6066 (
"Year" text,
"League" text,
"Season" text,
"Play-Off" text,
"Baltic" text,
"Events" text,
"European" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which European has a Play-Off of relegated?
| SELECT "European" FROM table_6066 WHERE "Play-Off" = 'relegated' | wikisql |
CREATE TABLE Grants (
grant_id INTEGER,
organisation_id INTEGER,
grant_amount DECIMAL(19,4),
grant_start_date DATETIME,
grant_end_date DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Document_Types (
document_type_code VARCHAR(10),
document_description VARCHAR(255)
)
CREATE TABLE R... | SELECT date_from, COUNT(date_from) FROM Project_Staff ORDER BY COUNT(date_from) DESC | nvbench |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Subarachnoid hemorrhage" AND prescriptions.route = "IM" | mimicsql_data |
CREATE TABLE party (
party_id number,
party_theme text,
location text,
first_year text,
last_year text,
number_of_hosts number
)
CREATE TABLE host (
host_id number,
name text,
nationality text,
age text
)
CREATE TABLE party_host (
party_id number,
host_id number,
is... | SELECT nationality FROM host GROUP BY nationality ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_11354 (
"Rd #" real,
"Pick #" real,
"Player" text,
"Team (League)" text,
"Reg GP" real,
"Pl GP" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rd number where the reg GP is 0 and the pick is 150?
| SELECT COUNT("Rd #") FROM table_11354 WHERE "Reg GP" = '0' AND "Pick #" = '150' | wikisql |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT AVG(age), MIN(age) FROM captain GROUP BY Class | nvbench |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '84027429' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_203_145 (
id number,
"position" number,
"club" text,
"played" number,
"points" text,
"wins" number,
"draws" number,
"losses" number,
"goals for" number,
"goals against" number,
"goal difference" number
)
-- Using valid SQLite, answer the following questio... | SELECT COUNT("club") FROM table_203_145 WHERE "wins" >= 15 | squall |
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 microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'urine, catheter specimen' ORDER ... | eicu |
CREATE TABLE table_name_34 (
round VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of rounds that Joe Barnes was picked?
| SELECT COUNT(round) FROM table_name_34 WHERE player = "joe barnes" | sql_create_context |
CREATE TABLE table_name_25 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Date, when Record is '1-1'?
| SELECT date FROM table_name_25 WHERE record = "1-1" | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id... | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10278)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'a... | mimic_iii |
CREATE TABLE table_name_82 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Result on the Date of 25th?
| SELECT result FROM table_name_82 WHERE date = "25th" | sql_create_context |
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 SUM(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.PERSON_ID = '85454377' AND t_kc21.CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_63691 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"React" real,
"Time" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average react of bryan barnett, who has a lane less than 2?
| SELECT AVG("React") FROM table_63691 WHERE "Name" = 'bryan barnett' AND "Lane" < '2' | wikisql |
CREATE TABLE table_name_45 (
crowd VARCHAR,
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total crowd of the Carlton game?
| SELECT COUNT(crowd) FROM table_name_45 WHERE home_team = "carlton" | sql_create_context |
CREATE TABLE table_69920 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many points did Connaught Type A chassis earn on average before 1955?
| SELECT AVG("Points") FROM table_69920 WHERE "Year" < '1955' AND "Chassis" = 'connaught type a' | wikisql |
CREATE TABLE table_name_83 (
company_or_product_name VARCHAR,
episode VARCHAR,
investing_dragon_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the Company or Product that is Episode 3 and is suppoted by Investing Dragon Deborah Mea... | SELECT company_or_product_name FROM table_name_83 WHERE episode = "episode 3" AND investing_dragon_s_ = "deborah meaden" | sql_create_context |
CREATE TABLE table_203_17 (
id number,
"name" text,
"date of death" text,
"ceremony" text,
"year" text,
"academy award" text,
"film" text,
"winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who has been nominated for the most posthu... | SELECT "name" FROM table_203_17 WHERE "date of death" <= "year" GROUP BY "name" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_51339 (
"Wicket Partnership" text,
"Runs" text,
"Batsmen" text,
"Opponents" text,
"Venue" text,
"Season" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which runs had james bryant graeme welch as Batsmen?
| SELECT "Runs" FROM table_51339 WHERE "Batsmen" = 'james bryant graeme welch' | wikisql |
CREATE TABLE table_name_93 (
debut_album VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which album debuted in season 2 (2005)?
| SELECT debut_album FROM table_name_93 WHERE season = "season 2 (2005)" | sql_create_context |
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 qtb.OUT_DIAG_DOC_CD, qtb.OUT_DIAG_DOC_NM FROM qtb WHERE qtb.PERSON_ID = '40870332' GROUP BY qtb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT gyb.OUT_DIAG_DOC_CD, gyb.OUT_DIAG_DOC_NM FROM gyb WHERE gyb.PERSON_ID = '40870332' GROUP BY gyb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC UNION SELECT zyb.OUT_DIAG_DOC_... | css |
CREATE TABLE table_5013 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many field goals were there, where the points where less than 45 and there were less tha... | SELECT AVG("Field goals") FROM table_5013 WHERE "Touchdowns" < '15' AND "Points" < '45' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_i... | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 ... | mimic_iii |
CREATE TABLE table_56332 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number of ties when goals against is l... | SELECT AVG("Ties") FROM table_56332 WHERE "Goals Against" < '56' AND "Team" = 'ottawa hockey club' AND "Goals For" > '47' | wikisql |
CREATE TABLE table_24285393_1 (
highest_point VARCHAR,
country_or_region VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the highest point in latvia
| SELECT highest_point FROM table_24285393_1 WHERE country_or_region = "Latvia" | sql_create_context |
CREATE TABLE table_name_17 (
country VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is Jack Nicklaus from?
| SELECT country FROM table_name_17 WHERE player = "jack nicklaus" | sql_create_context |
CREATE TABLE table_77601 (
"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 was the home teams score while playing the ... | SELECT "Home team score" FROM table_77601 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE people (
Birth_Place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List each birth place along with the number of people from there.
| SELECT Birth_Place, COUNT(*) FROM people GROUP BY Birth_Place | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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,
H... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.IN_DIAG_DIS_CD = 'L29.482' | css |
CREATE TABLE table_203_141 (
id number,
"sr. no." number,
"name" text,
"from" text,
"till" text,
"occupation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who was the director immediately before b. n. yugandhar ?
| SELECT "name" FROM table_203_141 WHERE "sr. no." = (SELECT "sr. no." FROM table_203_141 WHERE "name" = 'b.n. yugandhar') + 1 | squall |
CREATE TABLE table_10171 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the highest laps for time/retired of engine and grid of 5
| SELECT MAX("Laps") FROM table_10171 WHERE "Time/Retired" = 'engine' AND "Grid" = '5' | wikisql |
CREATE TABLE gwyjzb (
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 gwyjzb.IN_DIAG_DIS_CD, gwyjzb.IN_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '苗秀曼' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 7265.59) UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, fgwyjzb.IN_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '苗秀曼' AND fgwyjzb.MED_... | css |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number... | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 2482 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | SELECT DISTINCT course.department, course.name, course.number, program_course.category FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category IN ('PreMajor', 'MDE') AND program_course.course_id = course.course_id AND semester.semester = 'Fal... | advising |
CREATE TABLE table_name_71 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is 1987 Grand Slam Tournament if 1989 is also grand slam tournaments?
| SELECT 1987 FROM table_name_71 WHERE 1989 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_name_30 (
population VARCHAR,
height__m_ VARCHAR,
area___ha__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Population of the group that has a Height (m) of 15 and an Area (ha) of 00017 17?
| SELECT population FROM table_name_30 WHERE height__m_ = 15 AND area___ha__ = "00017 17" | sql_create_context |
CREATE TABLE table_28597 (
"Location" text,
"Date" real,
"Denomination" text,
"Coinage metal" text,
"Mintage" real,
"KM number" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the coinage metal for KM numbers of S45?
| SELECT "Coinage metal" FROM table_28597 WHERE "KM number" = 'S45' | wikisql |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | SELECT prescriptions.drug_type, prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NTG100PB" | mimicsql_data |
CREATE TABLE table_49413 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Surface has a Score in the final of 2 6, 6 7?
| SELECT "Surface" FROM table_49413 WHERE "Score in the final" = '2–6, 6–7' | wikisql |
CREATE TABLE qtb (
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 COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '94029364' AND t_kc22.STA_DATE BETWEEN '2007-08-25' AND '2013-06-24' AND qtb.MED_SER_ORG_NO = '4819372' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_61163 (
"Lince" text,
"Leopard 2A4" text,
"Leclerc" text,
"M1A1 Abrams" text,
"M60A3 Patton" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the M1A1 when the Lince was T (Short Tons)?
| SELECT "M1A1 Abrams" FROM table_61163 WHERE "Lince" = 't (short tons)' | wikisql |
CREATE TABLE table_name_27 (
d_48_√ VARCHAR,
d_49_√ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the D 48 with a D 49 with r 9?
| SELECT d_48_√ FROM table_name_27 WHERE d_49_√ = "r 9" | sql_create_context |
CREATE TABLE table_11677691_9 (
player VARCHAR,
college VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player is from Ohio State college?
| SELECT player FROM table_11677691_9 WHERE college = "Ohio State" | sql_create_context |
CREATE TABLE table_61776 (
"Date(s)" text,
"City, state" text,
"Ticket price(s)" text,
"Ticket sold / available" text,
"Ticket grossing" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much were tickets for the show in Hartford, Connecticut?
| SELECT "Ticket price(s)" FROM table_61776 WHERE "City, state" = 'hartford, connecticut' | wikisql |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE reviewer (
rid number,
name text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
-- Using valid SQLite, answer the following questions for the tables provide... | SELECT COUNT(*) FROM reviewer | spider |
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 (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '2795059' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-04-20' AND '2016-08-16' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) <= 7541.4) AS T | css |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
)
-- Using valid SQLite, answer the following que... | SELECT Nominee, COUNT(*) FROM musical GROUP BY Nominee ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_41382 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result of the Award of Drama desk award nominee Tom Hewitt.
| SELECT "Result" FROM table_41382 WHERE "Award" = 'drama desk award' AND "Nominee" = 'tom hewitt' | wikisql |
CREATE TABLE table_name_26 (
avg_seek_time_ VARCHAR,
ms VARCHAR,
device INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the avg seek time for a device that is less than 3231?
| SELECT avg_seek_time_ AS "ms" FROM table_name_26 WHERE device < 3231 | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
descript... | SELECT DISTINCT airline.airline_code FROM airline, 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... | atis |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state v... | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%intel... | advising |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND DATETIME(microlab.culturetakentime) >= DATETIME(... | eicu |
CREATE TABLE table_56038 (
"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.
-- Where did the home team play when they scored 18... | SELECT "Venue" FROM table_56038 WHERE "Home team score" = '18.20 (128)' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%PhD Dissertation-Pre-Candidate%' OR name LIKE '%PhD Dissertation-Pre-Candidate%') AND department = 'EECS' | advising |
CREATE TABLE table_33426 (
"Rank" real,
"Player" text,
"Nation" text,
"Caps" real,
"Goals" real,
"Years" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the sum of caps for players with less than 9 goals ranked below 8?
| SELECT SUM("Caps") FROM table_33426 WHERE "Goals" < '9' AND "Rank" > '8' | wikisql |
CREATE TABLE table_name_37 (
assembled VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the 2nd member of the parliament that was assembled on 3 november 1529?
| SELECT 2 AS nd_member FROM table_name_37 WHERE assembled = "3 november 1529" | sql_create_context |
CREATE TABLE table_33498 (
"Draw" real,
"Dancers" text,
"Dance Styles" text,
"Place" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which dance style had a draw smaller than 15 and 18 points?
| SELECT "Dance Styles" FROM table_33498 WHERE "Draw" < '15' AND "Points" = '18' | wikisql |
CREATE TABLE table_name_58 (
competition VARCHAR,
round VARCHAR,
club VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which competition features the 1st round of Club Union Luxembourg?
| SELECT competition FROM table_name_58 WHERE round = "1st round" AND club = "union luxembourg" | sql_create_context |
CREATE TABLE table_train_92 (
"id" int,
"thyroid_disease" bool,
"heart_disease" bool,
"global_deterioration_scale" int,
"rosen_modified_hachinski_ischemic_score" int,
"hypertension" bool,
"NOUSE" float
)
-- Using valid SQLite, answer the following questions for the tables provided above.
... | SELECT * FROM table_train_92 WHERE thyroid_disease = 1 | criteria2sql |
CREATE TABLE table_55266 (
"English" text,
"Space Crusade" text,
"Aliens" text,
"Chaos Marines" text,
"Genestealers" text,
"Imperial Fists" text,
"Ultramarines" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the space crusade when the e... | SELECT "Space Crusade" FROM table_55266 WHERE "English" = 'finnish' | wikisql |
CREATE TABLE table_51155 (
"Institution" text,
"Location" text,
"Nickname" text,
"Enrollment" real,
"Established" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which institution is located in Reading, PA?
| SELECT "Institution" FROM table_51155 WHERE "Location" = 'reading, pa' | wikisql |
CREATE TABLE table_name_22 (
played INTEGER,
team VARCHAR,
lost VARCHAR,
drawn VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Played has a Lost larger than 14, and Drawn of 8, and a Team of ipatinga?
| SELECT SUM(played) FROM table_name_22 WHERE lost > 14 AND drawn = 8 AND team = "ipatinga" | sql_create_context |
CREATE TABLE table_name_70 (
russian VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Russian word for the Greek word greek?
| SELECT russian FROM table_name_70 WHERE "greek" = "greek" | sql_create_context |
CREATE TABLE table_30044 (
"City" text,
"State or Territory" text,
"Station call sign" text,
"Network" text,
"Channel number" real,
"Programs Aired" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which network was located in Illinois?
| SELECT "Network" FROM table_30044 WHERE "State or Territory" = 'Illinois' | wikisql |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_100 | nvbench |
CREATE TABLE table_name_41 (
right_ascension___j2000__ VARCHAR,
ngc_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the right ascension (j2000) when the ngc number is 3576?
| SELECT right_ascension___j2000__ FROM table_name_41 WHERE ngc_number = 3576 | sql_create_context |
CREATE TABLE table_name_4 (
title VARCHAR,
genre VARCHAR,
year VARCHAR,
network VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the title when the genre is drama and network of KBS2 happening before 2011?
| SELECT title FROM table_name_4 WHERE year < 2011 AND network = "kbs2" AND genre = "drama" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.days_stay > "29" | mimicsql_data |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 10278 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_93 (
gold VARCHAR,
bronze VARCHAR,
silver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of gold medals when the team got 2 bronze and more than 5 silver medals?
| SELECT COUNT(gold) FROM table_name_93 WHERE bronze = 2 AND silver > 5 | sql_create_context |
CREATE TABLE table_204_516 (
id number,
"date" text,
"opponents" text,
"h / a" text,
"result\nf - a" text,
"scorers" text,
"attendance" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who did manchester tie with before they tied bradford ci... | SELECT "opponents" FROM table_204_516 WHERE "result\nf - a" = "result\nf - a" AND "date" < (SELECT "date" FROM table_204_516 WHERE "opponents" = 'bradford city') | squall |
CREATE TABLE table_2979789_1 (
division VARCHAR,
fa_cup_apps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of division for fa cups being 9
| SELECT COUNT(division) FROM table_2979789_1 WHERE fa_cup_apps = 9 | sql_create_context |
CREATE TABLE table_name_29 (
player VARCHAR,
to_par VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What player has +2 to par?
| SELECT player FROM table_name_29 WHERE to_par = "+2" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.