context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_47819 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the attendance of week 8? | SELECT COUNT("Attendance") FROM table_47819 WHERE "Week" = '8' | wikisql |
CREATE TABLE table_203_268 (
id number,
"date" text,
"name" text,
"nationality" text,
"tonnage\n(grt)" number,
"fate" text
) | what where the only two submarines that where only damaged ? | SELECT "name" FROM table_203_268 WHERE "fate" = 'damaged' | squall |
CREATE TABLE table_9405 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | Which Label has a Catalog of 7243 8 49494 2 6? | SELECT "Label" FROM table_9405 WHERE "Catalog" = '7243 8 49494 2 6' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | count the number of patients whose year of birth is less than 1846 and procedure short title is coronary arteriogram nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "1846" AND procedures.short_title = "Coronary arteriogram NEC" | mimicsql_data |
CREATE TABLE table_48293 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which Country has a Place of t9, and a Score of 71-71-72=214, and a Player of ernie els? | SELECT "Country" FROM table_48293 WHERE "Place" = 't9' AND "Score" = '71-71-72=214' AND "Player" = 'ernie els' | wikisql |
CREATE TABLE table_name_72 (
visitor VARCHAR,
date VARCHAR
) | What team was the visitor on 3/2? | SELECT visitor FROM table_name_72 WHERE date = "3/2" | sql_create_context |
CREATE TABLE table_name_65 (
time_retired VARCHAR,
grid VARCHAR,
driver VARCHAR
) | What time/retired has a Grid larger than 3, and a Driver of kimi r ikk nen? | SELECT time_retired FROM table_name_65 WHERE grid > 3 AND driver = "kimi räikkönen" | sql_create_context |
CREATE TABLE table_27403436_1 (
us_viewers__million_ VARCHAR,
written_by VARCHAR
) | How many viewers watched the episode written by shana goldberg-meehan & greg malins? | SELECT us_viewers__million_ FROM table_27403436_1 WHERE written_by = "Shana Goldberg-Meehan & Greg Malins" | sql_create_context |
CREATE TABLE table_name_32 (
away_team VARCHAR
) | What is south melbourne's scores when they are the away team? | SELECT away_team AS score FROM table_name_32 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE table_13934 (
"Date" text,
"Type" text,
"Time (greatest)" text,
"Saros" real,
"Member" real,
"Gamma" real,
"Magnitude" real
) | what is the date when saros is more than 124, the type is total, the magnitude is more than 1.0535 and the time (greatest) is 20:55:28? | SELECT "Date" FROM table_13934 WHERE "Saros" > '124' AND "Type" = 'total' AND "Magnitude" > '1.0535' AND "Time (greatest)" = '20:55:28' | wikisql |
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
) | Draw a bar chart of name versus age, and I want to rank by the y-axis in descending. | SELECT Name, Age FROM editor ORDER BY Age DESC | nvbench |
CREATE TABLE table_64215 (
"Position" real,
"Gymnast" text,
"Floor" text,
"Pommel Horse" text,
"Rings" text,
"Vault" text,
"Parallel Bars" text,
"Horizontal Bar" text,
"Total" real
) | With a parallel bars score of 14.625 what is the average total? | SELECT AVG("Total") FROM table_64215 WHERE "Parallel Bars" = '14.625' | wikisql |
CREATE TABLE table_name_9 (
vertical_drop__m_ INTEGER,
length__m_ VARCHAR
) | What is the highest vertical drop among the 1,200 meter long tracks? | SELECT MAX(vertical_drop__m_) FROM table_name_9 WHERE length__m_ = 1 OFFSET 200 | sql_create_context |
CREATE TABLE table_name_25 (
american VARCHAR
) | What is 17th c., when American is ' '? | SELECT 17 AS th_c FROM table_name_25 WHERE american = "ə" | 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... | how many patients were diagnosed with an unspecified disorder of kidney and ureter and treated with a main drug type? | 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.long_title = "Unspecified disorder of kidney and ureter" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | has patient 006-171217 until 2104 received a test of -bands? | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-171217')) AND lab.labname = '-bands' AND STRFTIME('%y', lab.labresulttime) <= '2104' | eicu |
CREATE TABLE table_name_66 (
location VARCHAR,
opponent VARCHAR
) | What was the location of the fight when Gassaway fought kevin knabjian? | SELECT location FROM table_name_66 WHERE opponent = "kevin knabjian" | sql_create_context |
CREATE TABLE table_14778650_1 (
writer VARCHAR,
length VARCHAR
) | Who was the writer for the song 4:29 in length? | SELECT writer FROM table_14778650_1 WHERE length = "4:29" | 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... | Give me a pie chart to reflect the proportion of All_Home and the sum of Team_ID. | SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE table_name_28 (
platform VARCHAR,
latest_stable_release VARCHAR
) | What is the platform for the latest release 8.4? | SELECT platform FROM table_name_28 WHERE latest_stable_release = "8.4" | sql_create_context |
CREATE TABLE table_16339 (
"Model" text,
"RU" real,
"Max processors" text,
"Processor frequency" text,
"Max memory" text,
"Max disk capacity" text,
"GA Date" text
) | What is the max memory of the t5120 model? | SELECT "Max memory" FROM table_16339 WHERE "Model" = 'T5120' | wikisql |
CREATE TABLE table_name_54 (
venue VARCHAR,
state VARCHAR,
host VARCHAR
) | What venue is located in Indiana and hosted at Purdue University? | SELECT venue FROM table_name_54 WHERE state = "indiana" AND host = "purdue university" | 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... | 从两千年八月二十四日到两千零一年三月十一日期间,在0936106医院接受治疗的吴姓患者详细记录 | SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0936106' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-08-24' AND '2001-03-11' AND gwyjzb.PERSON_NM LIKE '吴%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '0936106' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2000-08-24' AND '2001-03-11' AND fgwyjzb.PERSON_NM LIKE '吴%' | css |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE... | what ground transportation is available from LGA airport into NEW YORK | SELECT DISTINCT transport_type FROM ground_service WHERE (airport_code IN (SELECT AIRPORTalias0.airport_code FROM airport AS AIRPORTalias0 WHERE AIRPORTalias0.airport_code = 'LGA') AND city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.city_name = 'NEW YORK')) | atis |
CREATE TABLE table_47244 (
"Name" text,
"Club" text,
"Date of departure" text,
"Replacement" text,
"Date of appointment" text
) | When did Brendan Rodgers depart his position? | SELECT "Date of departure" FROM table_47244 WHERE "Name" = 'brendan rodgers' | wikisql |
CREATE TABLE Functional_Areas (
functional_area_code VARCHAR(15),
parent_functional_area_code VARCHAR(15),
functional_area_description VARCHAR(80)
)
CREATE TABLE Images (
image_id INTEGER,
image_alt_text VARCHAR(80),
image_name VARCHAR(40),
image_url VARCHAR(255)
)
CREATE TABLE Document_Se... | Find the number of users in each role. Visualize by pie chart. | SELECT role_code, COUNT(*) FROM Users GROUP BY role_code | nvbench |
CREATE TABLE table_38287 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) | What is the Tries against when lost shows 12 for pontycymmer rfc? | SELECT "Tries against" FROM table_38287 WHERE "Lost" = '12' AND "Club" = 'pontycymmer rfc' | wikisql |
CREATE TABLE table_204_655 (
id number,
"year" number,
"winner" text,
"album" text,
"other finalists" text
) | what album won before borrowed time did in 2006 ? | SELECT "album" FROM table_204_655 WHERE "year" < (SELECT "year" FROM table_204_655 WHERE "album" = 'borrowed time') ORDER BY "year" DESC LIMIT 1 | squall |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX num... | 患者77448008在2009年8月4日到2021年6月15日内都做了什么检查把检验报告单号列出来 | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info ON 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 AND person_info_hz_info.KH = hz_info.KH AND pers... | css |
CREATE TABLE table_name_51 (
away_team VARCHAR,
venue VARCHAR
) | What team played at lake oval while away? | SELECT away_team FROM table_name_51 WHERE venue = "lake oval" | sql_create_context |
CREATE TABLE table_name_23 (
main_span_metres VARCHAR,
main_span_feet VARCHAR,
year_to_open VARCHAR,
country VARCHAR
) | What is the Main span of the bridge from China with a Year to open of 2013 and Main span feet of 2,585? | SELECT main_span_metres FROM table_name_23 WHERE year_to_open = 2013 AND country = "china" AND main_span_feet = "2,585" | sql_create_context |
CREATE TABLE table_name_63 (
attendance INTEGER,
week VARCHAR
) | What is the attendance of week 12? | SELECT MIN(attendance) FROM table_name_63 WHERE week = 12 | sql_create_context |
CREATE TABLE table_name_26 (
points INTEGER,
drawn VARCHAR,
games VARCHAR
) | What was the highest points where there were less than 2 drawn and the games were less than 6? | SELECT MAX(points) FROM table_name_26 WHERE drawn < 2 AND games < 6 | sql_create_context |
CREATE TABLE table_name_53 (
grid INTEGER,
car_no VARCHAR
) | What is Car number 98's lowest grid? | SELECT MIN(grid) FROM table_name_53 WHERE car_no = 98 | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
... | what is the number of patients who died after diagnosis of hx-ven thrombosis/embols within 2 months until 2104? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
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,
... | provide the number of patients whose insurance is government and procedure long title is drug detoxification? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Drug detoxification" | mimicsql_data |
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... | what is the number of patients whose admission type is urgent and primary disease is pneumonia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.diagnosis = "PNEUMONIA" | mimicsql_data |
CREATE TABLE table_name_77 (
years_at_club VARCHAR,
debut_year VARCHAR,
games VARCHAR,
goals VARCHAR
) | What is the number of Years at Club for the player who has had more games than 28, more Goals than 225, and his Debut year was after 1950? | SELECT years_at_club FROM table_name_77 WHERE games > 28 AND goals > 225 AND debut_year > 1950 | sql_create_context |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
... | tell me patient 20000's length of stay of the last stay in the icu. | SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20000) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_2 (
away_team VARCHAR,
home_team VARCHAR
) | Which Away team has the Home team of Carlton? | SELECT away_team FROM table_name_2 WHERE home_team = "carlton" | sql_create_context |
CREATE TABLE table_69181 (
"Date" text,
"Opponent" text,
"Result" text,
"Game Site" text,
"Attendance" text
) | Who was the opponent on the game on April 14, 2007? | SELECT "Opponent" FROM table_69181 WHERE "Date" = 'april 14, 2007' | wikisql |
CREATE TABLE table_21550870_1 (
production_code VARCHAR,
written_by VARCHAR
) | Name the total number of production code for episode by steve cohen & andrew dettman | SELECT COUNT(production_code) FROM table_21550870_1 WHERE written_by = "Steve Cohen & Andrew Dettman" | sql_create_context |
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 patient (
uniquep... | how much difference does patient 031-4987 have in heartrate measured at 2104-12-30 22:20:00 compared to the value measured at 2104-12-30 22:15:00? | SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4987')) AND NOT vitalperiodic.heartrate IS NU... | eicu |
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... | for patient id 94762, specify the time of admission and discharge | SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "94762" | mimicsql_data |
CREATE TABLE table_76618 (
"Fin. Pos" text,
"Car No." text,
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
) | How many points does driver kosuke matsuura have? | SELECT "Points" FROM table_76618 WHERE "Driver" = 'kosuke matsuura' | wikisql |
CREATE TABLE table_name_21 (
time VARCHAR,
nationality VARCHAR,
heat VARCHAR
) | What is Russia's time with a heat higher than 3? | SELECT time FROM table_name_21 WHERE nationality = "russia" AND heat > 3 | sql_create_context |
CREATE TABLE table_26015 (
"Branding" text,
"Callsign" text,
"Ch. #" text,
"Power kW" text,
"Station Type" text,
"Location (Transmitter site)" text
) | When dwhr-tv is the call sign how many station types are there? | SELECT COUNT("Station Type") FROM table_26015 WHERE "Callsign" = 'DWHR-TV' | wikisql |
CREATE TABLE table_171236_1 (
census_ranking VARCHAR,
area_km_2 VARCHAR
) | If the area is 34.73, what is the census ranking? | SELECT census_ranking FROM table_171236_1 WHERE area_km_2 = "34.73" | sql_create_context |
CREATE TABLE table_name_44 (
decile INTEGER,
roll VARCHAR,
authority VARCHAR,
name VARCHAR
) | What is the total amount of decile with the authority of state around the Pokuru School and a roll smaller than 109? | SELECT SUM(decile) FROM table_name_44 WHERE authority = "state" AND name = "pokuru school" AND roll < 109 | sql_create_context |
CREATE TABLE table_name_91 (
week INTEGER,
result VARCHAR
) | In what week was the Result L 15-13? | SELECT AVG(week) FROM table_name_91 WHERE result = "l 15-13" | sql_create_context |
CREATE TABLE table_name_24 (
player VARCHAR,
school VARCHAR
) | What player is from Seton Hall University? | SELECT player FROM table_name_24 WHERE school = "seton hall university" | sql_create_context |
CREATE TABLE table_name_48 (
place VARCHAR,
score VARCHAR
) | what is the place when the score is 70-72=142? | SELECT place FROM table_name_48 WHERE score = 70 - 72 = 142 | sql_create_context |
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... | how many patients whose days of hospital stay is greater than 15 and diagnoses short title is acute pancreatitis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "15" AND diagnoses.short_title = "Acute pancreatitis" | 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 d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm... | what were the top four frequently prescribed drugs that were prescribed to patients in the same hospital visit after they had been prescribed doxorubicin since 2101? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate, admissions.hadm_id FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'doxorubicin' AND STRFTIME('%y', prescriptions... | mimic_iii |
CREATE TABLE table_46041 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Gold has a Rank of 7, a Nation of italy, and a Silver smaller than 0? | SELECT COUNT("Gold") FROM table_46041 WHERE "Rank" = '7' AND "Nation" = 'italy' AND "Silver" < '0' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 从03年5月3日开始到09年5月24日结束患者45065975被开出的所有检验报告单的检验报告单号能否列出来? | SELECT jybgb.BGDH FROM hz_info JOIN zzmzjzjlb JOIN jybgb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '45065975' AND jybgb.BGRQ BETWEEN '2003-05-03' AND '2009-... | css |
CREATE TABLE table_name_21 (
score VARCHAR,
venue VARCHAR,
champion VARCHAR
) | What is the score of the match won by Willie Hunter at the Royal Liverpool Golf Club? | SELECT score FROM table_name_21 WHERE venue = "royal liverpool golf club" AND champion = "willie hunter" | sql_create_context |
CREATE TABLE tasks (
task_id number,
project_id number,
task_details text,
eg agree objectives text
)
CREATE TABLE organisations (
organisation_id number,
organisation_type text,
organisation_details text
)
CREATE TABLE documents (
document_id number,
document_type_code text,
g... | Which document type is described with the prefix 'Initial'? | SELECT document_type_code FROM document_types WHERE document_description LIKE 'Initial%' | spider |
CREATE TABLE table_7098 (
"Year" real,
"Album" text,
"U.S." text,
"U.S. Christian" text,
"U.S. Indie" text
) | What is the lowest Year with an Album that is live love in London? | SELECT MIN("Year") FROM table_7098 WHERE "Album" = 'live love in london' | wikisql |
CREATE TABLE table_28576 (
"Country" text,
"Area (km\u00b2) 2010" real,
"Population 2011" real,
"GDP (PPP) ( Intl. $ ) 2011" text,
"GDP (PPP) per capita ( Intl. $ ) 2011" text,
"Income inequality 1992-2010 (latest available)" text,
"HDI 2012" text,
"FSI 2012" text,
"CPI 2012" text,
... | Name the fsi 2012 for 42.7 cpi | SELECT "FSI 2012" FROM table_28576 WHERE "CPI 2012" = '42.7' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE out... | what was the name of the output, which patient 8888 had first in a day before? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888)) AND DATETIME(outputevents.charttime... | mimic_iii |
CREATE TABLE table_name_84 (
surface VARCHAR,
opponent_in_the_final VARCHAR
) | On which surface did Mathieu play against Antonio Vei ? | SELECT surface FROM table_name_84 WHERE opponent_in_the_final = "antonio veić" | sql_create_context |
CREATE TABLE table_210279_2 (
area__km_2__ VARCHAR,
barangay VARCHAR
) | what is the area where barangay is guadalupe viejo? | SELECT area__km_2__ FROM table_210279_2 WHERE barangay = "Guadalupe Viejo" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid... | whats the first height of patient 032-9230 on their current hospital visit? | SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionheight IS NULL ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 经过门诊就诊的病号97338418415用的卡的卡号以及卡类型是什么呢? | SELECT KH, KLX FROM mzjzjlb WHERE JZLSH = '97338418415' | css |
CREATE TABLE table_27679 (
"Position" text,
"Number" real,
"Horse" text,
"Jockey" text,
"Age" real,
"Handicap" text,
"SP" text,
"Distance" text
) | what is the handicap where the distance is 9 lengths? | SELECT "Handicap" FROM table_27679 WHERE "Distance" = '9 lengths' | wikisql |
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(10),
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Shipments (
shipment_id INTEGER,
order_id INTEGER,
invoice_number INTEGER,
shipment_tracking_number VARCHAR(80),
shipment_... | A bar chart for what are the number of the dates of the orders made by the customer named 'Jeramie'? | SELECT date_order_placed, COUNT(date_order_placed) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" | nvbench |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM ... | 病患何嘉悦在02年4月18日到2020年5月25日内所有的检验结果指标记录中检测人是冯婉娜时检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ... | css |
CREATE TABLE table_39914 (
"Game" real,
"March" real,
"Opponent" text,
"Score" text,
"Record" text
) | Which record's march was 26? | SELECT "Record" FROM table_39914 WHERE "March" = '26' | wikisql |
CREATE TABLE table_52911 (
"Name" text,
"Height" text,
"Weight" text,
"Spike" text,
"2008 club" text
) | Who was in the 2008 club of gabeca montichiari? | SELECT "Name" FROM table_52911 WHERE "2008 club" = 'gabeca montichiari' | wikisql |
CREATE TABLE table_26032940_2 (
network_tv_run_time VARCHAR,
episode__number VARCHAR
) | How many runtimes does episode 53 have? | SELECT COUNT(network_tv_run_time) FROM table_26032940_2 WHERE episode__number = 53 | sql_create_context |
CREATE TABLE table_68881 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What was the result of the fight with Tony Halme? | SELECT "Res." FROM table_68881 WHERE "Opponent" = 'tony halme' | wikisql |
CREATE TABLE table_201_14 (
id number,
"crossing" text,
"carries" text,
"location" text,
"coordinates" text
) | which bridge is in delaware and carries de 9 ? | SELECT "crossing" FROM table_201_14 WHERE "location" = 'delaware' AND "carries" = 'de 9' | squall |
CREATE TABLE table_46711 (
"Name of System" text,
"Location" text,
"Traction Type" text,
"Date (From)" text,
"Date (To)" text
) | Which date has date started from 30 Sep 1913? | SELECT "Date (To)" FROM table_46711 WHERE "Date (From)" = '30 sep 1913' | wikisql |
CREATE TABLE table_name_41 (
Id VARCHAR
) | What is the average 2001 value with a 2010 value greater than 414, a 2011 value of 7192, and a 2005 value larger than 7340? | SELECT AVG(2001) FROM table_name_41 WHERE 2010 > 414 AND 2011 = 7192 AND 2005 > 7340 | sql_create_context |
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,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
... | tell me the number of times retrograde pyelogram is done until 1 year ago? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'retrograde pyelogram') AND DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') | mimic_iii |
CREATE TABLE table_45615 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | What was the date of appointment for javier aguirre's replacement? | SELECT "Date of appointment" FROM table_45615 WHERE "Outgoing manager" = 'javier aguirre' | 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... | how many patients whose death status is 0 and diagnoses short title is chordae tendinae rupture? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Chordae tendinae rupture" | mimicsql_data |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 列一下医院1996297全部就诊记录中,不同科室编码与入院时诊断疾病编码下民政补助的金额与总医疗费用比值最大是多少,然后按照降序的顺序排序 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1996297' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC | css |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name ... | ground transportation BALTIMORE | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'BALTIMORE' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_name_90 (
year INTEGER,
binibining_pilipinas_international VARCHAR
) | What is the smallest Year with a Binibining Pilipinas-International of jessie alice salones dixson? | SELECT MIN(year) FROM table_name_90 WHERE binibining_pilipinas_international = "jessie alice salones dixson" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | Show each employee's salary using a bar chart, note that use the last name of each employee, and sort by the X-axis in ascending. | SELECT LAST_NAME, SALARY FROM employees ORDER BY LAST_NAME | nvbench |
CREATE TABLE table_name_23 (
years_in_office VARCHAR,
assumed_office VARCHAR
) | How many years in office were served by the person who assumed the office on October 4, 1886? | SELECT years_in_office FROM table_name_23 WHERE assumed_office = "october 4, 1886" | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGD... | 患者的哪个部位给检验报告单33508848033做采集标本的 | SELECT BBCJBW FROM jybgb WHERE BGDH = '33508848033' | css |
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
GType VARCHAR(40)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
... | Visualize a bar chart for how many students play each sport?, and sort bar in ascending order. | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY SportName | 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_CLINIC_ID text,
MED_DIRE_CD tex... | 在编码为7282757的医院名叫窦绍钧患者入院诊断疾病名称包含脑血管病的医疗就诊记录编号? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '窦绍钧' AND gwyjzb.MED_SER_ORG_NO = '7282757' AND gwyjzb.IN_DIAG_DIS_NM LIKE '%脑血管病%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '窦绍钧' AND fgwyjzb.MED_SER_ORG_NO = '7282757' AND fgwyjzb.IN_DIAG_DIS_NM LIKE '%脑血管病%' | css |
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... | give me the number of patients whose age is less than 68 and lab test name is sodium? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "68" AND lab.label = "Sodium" | mimicsql_data |
CREATE TABLE table_44186 (
"Club" text,
"Location" text,
"Stadium" text,
"Capacity" real,
"Manager" text
) | What is the Location of the Tapiolan Urheilupuisto Stadium with a Capacity or more than 15,000? | SELECT "Location" FROM table_44186 WHERE "Capacity" > '15,000' AND "Stadium" = 'tapiolan urheilupuisto' | wikisql |
CREATE TABLE table_name_86 (
college VARCHAR,
pick VARCHAR
) | Which college's pick was 14? | SELECT college FROM table_name_86 WHERE pick = "14" | sql_create_context |
CREATE TABLE table_26267849_11 (
performance_order VARCHAR,
artist VARCHAR
) | Name the performance order of the velasco brothers | SELECT performance_order FROM table_26267849_11 WHERE artist = "Velasco Brothers" | sql_create_context |
CREATE TABLE table_name_9 (
away_team VARCHAR,
home_team VARCHAR
) | What is the Away team when the home team was wycombe wanderers? | SELECT away_team FROM table_name_9 WHERE home_team = "wycombe wanderers" | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide the number of patients whose diagnosis short title is atrial fibrillation and lab test name is prostate specific antigen. | 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 = "Atrial fibrillation" AND lab.label = "Prostate Specific Antigen" | mimicsql_data |
CREATE TABLE table_64855 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
) | Which School has a Mascot of squires? | SELECT "School" FROM table_64855 WHERE "Mascot" = 'squires' | wikisql |
CREATE TABLE table_62048 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Competition" text
) | What was the venue on the 20th? | SELECT "Venue" FROM table_62048 WHERE "Date" = '20th' | wikisql |
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
) | For those records from the products and each product's manufacturer, show me about the distribution of founder and the average of code , and group by attribute founder in a bar chart, rank by the X in descending please. | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC | nvbench |
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,
... | 在2006-05-29之后,患者韦文心有哪些门诊就诊的检验报告单?看一下门诊就诊的流水号 | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '韦文心' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-05-29') | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | count the number of patients whose drug code is zinc220 and lab test fluid is blood? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "ZINC220" AND lab.fluid = "Blood" | mimicsql_data |
CREATE TABLE table_name_59 (
chassis VARCHAR,
year VARCHAR,
points VARCHAR,
entrant VARCHAR
) | Which chassis has fewer than 2 points, entrants of Goulds' Garage (Bristol), in 1954? | SELECT chassis FROM table_name_59 WHERE points < 2 AND entrant = "goulds' garage (bristol)" AND year = 1954 | sql_create_context |
CREATE TABLE table_name_16 (
region VARCHAR,
venue VARCHAR
) | In which region is the Thompson-Boling arena located? | SELECT region FROM table_name_16 WHERE venue = "thompson-boling arena" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | what is the minimum age of widow patients who have a medicaid insurance? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.insurance = "Medicaid" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.