context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_39 (
total INTEGER,
finish VARCHAR
) | What is the average of the total when t11 is the finish? | SELECT AVG(total) FROM table_name_39 WHERE finish = "t11" | sql_create_context |
CREATE TABLE table_53705 (
"Week" real,
"Partner" text,
"Style" text,
"Choreographer(s)" text,
"Results" text
) | Who choreographed the smooth waltz with lacey schwimmer? | SELECT "Choreographer(s)" FROM table_53705 WHERE "Style" = 'smooth waltz' AND "Partner" = 'lacey schwimmer' | wikisql |
CREATE TABLE table_10565 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"Attendance" text,
"Record" text
) | Which date did 64,443 people attend a game? | SELECT "Date" FROM table_10565 WHERE "Attendance" = '64,443' | wikisql |
CREATE TABLE table_204_115 (
id number,
"year" number,
"track" text,
"number" number,
"team" text,
"car" text,
"round result" text
) | number of rounds in which murphy placed above 4th | SELECT COUNT(*) FROM table_204_115 WHERE "round result" < 4 | squall |
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... | give me the number of patients whose primary disease is liver transplant and age is less than 79? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.age < "79" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | in 06/2103, how much did patient 011-23004 weigh for the first time? | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-23004') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) = '2103-06' ORDER BY patient.unitadmittime LIMIT 1 | eicu |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | what is the name of patient 016-6134's last intake on the last intensive care unit visit? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6134') AND NOT patient.unitdischargetime IS NULL ORDER B... | eicu |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperio... | count the number of patients that have been diagnosed with bacteremia but did not return to the hospital during the same month since 2103. | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bacteremia' AND STRFTIME('%y', diagnosis.diagnosistime) >= '2103') AS t1) - (SELECT COUNT(DISTINCT t... | eicu |
CREATE TABLE table_63432 (
"Contestant Name" text,
"Episode #" text,
"Date Premiered (2009)" text,
"Winning Amount" text,
"Eliminated Contestant" text
) | What episode # has govinda & david dhawan as the eliminated contestant? | SELECT "Episode #" FROM table_63432 WHERE "Eliminated Contestant" = 'govinda & david dhawan' | wikisql |
CREATE TABLE table_203_222 (
id number,
"category" text,
"#" number,
"name" text,
"hanzi" text,
"hanyu pinyin" text,
"population (2010 census)" number,
"area (km2)" number,
"density (/km2)" number
) | is enping more/less dense than kaiping ? | SELECT (SELECT "density (/km2)" FROM table_203_222 WHERE "name" = 'enping') > (SELECT "density (/km2)" FROM table_203_222 WHERE "name" = 'kaiping') | squall |
CREATE TABLE table_16741821_8 (
result VARCHAR,
surface VARCHAR,
against VARCHAR
) | WHAT WERE ALL OF THE RESULTS WHEN THEY PLAYED AGAINST LITHUANIA AND THE SURFACE WAS MADE OF CLAY? | SELECT result FROM table_16741821_8 WHERE surface = "Clay" AND against = "Lithuania" | sql_create_context |
CREATE TABLE table_77089 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Nets points" real,
"Opponents" real,
"Record" text,
"Streak" text
) | How many games had fewer than 118 opponents and more than 109 net points with an opponent of Washington? | SELECT COUNT("Game") FROM table_77089 WHERE "Opponents" < '118' AND "Nets points" > '109' AND "Opponent" = 'washington' | wikisql |
CREATE TABLE table_53881 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the crowd size when the home team was Hawthorn? | SELECT "Crowd" FROM table_53881 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_name_5 (
operates VARCHAR,
terminus VARCHAR,
name VARCHAR
) | Where does the Bayou Blvd./12th Avenue route that has a terminus at the downtown transit center operate? | SELECT operates FROM table_name_5 WHERE terminus = "downtown transit center" AND name = "bayou blvd./12th avenue" | sql_create_context |
CREATE TABLE table_3399 (
"Player" text,
"Touchdowns (5 points)" real,
"Extra points 1 point" real,
"Field goals (4 points)" real,
"Safeties (2 points)" real,
"Total Points" real
) | How many field goals were scored by the player that got 7 touchdowns? | SELECT "Field goals (4 points)" FROM table_3399 WHERE "Touchdowns (5 points)" = '7' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
ro... | what was the last perc ins carotid stent time of patient 88409? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'perc ins carotid stent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88409) ORDER... | mimic_iii |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Getting a user's most popular tags in order. | WITH UserPosts AS (SELECT * FROM Posts WHERE OwnerUserId = '##UserId##'), TagCount AS (SELECT COUNT(*) AS Cnt, TagId FROM PostTags WHERE PostId IN (SELECT Id FROM UserPosts WHERE PostTypeId = 1 UNION ALL SELECT ParentId FROM UserPosts WHERE PostTypeId = 2) GROUP BY TagId) SELECT TagName, Cnt FROM TagCount AS TC JOIN Ta... | sede |
CREATE TABLE table_6374 (
"Year" text,
"Team" text,
"Attempts" text,
"Completions" text,
"Completion %" text,
"Yards" text
) | Which Completions has Yards of 10,098? | SELECT "Completions" FROM table_6374 WHERE "Yards" = '10,098' | wikisql |
CREATE TABLE table_26698 (
"Episode" real,
"Airdate" text,
"Reward" text,
"Immunity" text,
"Eliminated" text,
"Vote" text,
"Finish" text
) | Name the eliminated 7th voted out day 21 | SELECT "Eliminated" FROM table_26698 WHERE "Finish" = '7th Voted Out Day 21' | wikisql |
CREATE TABLE table_54559 (
"Rank" real,
"Name" text,
"Nation" text,
"Points" real,
"Places" real
) | What is the lowest number of places for Sherri Baier / Robin Cowan when ranked lower than 1? | SELECT MIN("Places") FROM table_54559 WHERE "Name" = 'sherri baier / robin cowan' AND "Rank" < '1' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | what is the maximum total hospital cost which involves s/p thrombectomy until 3 years ago? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p thrombectomy')) AND DATETIME(cost.charge... | eicu |
CREATE TABLE table_76145 (
"Title" text,
"Season" text,
"Winner" text,
"Score" text,
"Runner-up" text,
"Venue" text,
"Attendance" text
) | What is the Score when the winner was sanyo wild knights, and a Runner-up of suntory sungoliath? | SELECT "Score" FROM table_76145 WHERE "Winner" = 'sanyo wild knights' AND "Runner-up" = 'suntory sungoliath' | wikisql |
CREATE TABLE table_204_958 (
id number,
"episode" number,
"original broadcast date" text,
"average" number,
"rank" number,
"remarks" text
) | which was the first episode to drop the average below 0.60 ? | SELECT MIN("episode") FROM table_204_958 WHERE "average" < 0.6 | squall |
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE EMPLOYEE... | How many departments are in each school. Show bar chart. | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_NAME) FROM DEPARTMENT | nvbench |
CREATE TABLE table_name_67 (
rank INTEGER,
name VARCHAR
) | What is the lowest rank of Citigroup? | SELECT MIN(rank) FROM table_name_67 WHERE name = "citigroup" | sql_create_context |
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 swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_40... | Visualize a bar chart about the distribution of meter_700 and meter_100 , display x axis in desc order. | SELECT meter_700, meter_100 FROM swimmer ORDER BY meter_700 DESC | nvbench |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense... | Top Comments of all time. | SELECT Score, Text FROM Comments ORDER BY Score DESC | sede |
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... | give me the total amount of chest tubes cticu ct 2 that patient 65582 has produced on 12/08/this year. | SELECT SUM(outputevents.value) 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 = 65582)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'che... | mimic_iii |
CREATE TABLE table_40183 (
"Rank" real,
"Prev" real,
"Player" text,
"Rating" real,
"Chng" text
) | What chng has a rank greater than 6, with 12 as a prev? | SELECT "Chng" FROM table_40183 WHERE "Rank" > '6' AND "Prev" = '12' | wikisql |
CREATE TABLE table_7427 (
"Player" text,
"FG Pct" real,
"3FGM" real,
"3FGA" real,
"3FG Pct" real,
"FT Pct" real,
"Off Reb" real,
"Def Reb" real,
"Total Reb" real,
"Asst" real
) | What is the lowest total reb of player Mcalarney, who has a 3FGM less than 103? | SELECT MIN("Total Reb") FROM table_7427 WHERE "Player" = 'mcalarney' AND "3FGM" < '103' | wikisql |
CREATE TABLE table_name_58 (
record VARCHAR,
date VARCHAR
) | What was the record on July 1? | SELECT record FROM table_name_58 WHERE date = "july 1" | 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
)
... | count the number of patients whose insurance is government and procedure short title is skin closure nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Skin closure NEC" | mimicsql_data |
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE faculty_participates_in (
facid number,
actid number
)
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE studen... | What are the first name and last name of Linda Smith's advisor? | SELECT T1.fname, T1.lname FROM faculty AS T1 JOIN student AS T2 ON T1.facid = T2.advisor WHERE T2.fname = "Linda" AND T2.lname = "Smith" | spider |
CREATE TABLE table_name_56 (
metal VARCHAR,
size VARCHAR
) | Which metal has a size that is 26mm (across scallops)? | SELECT metal FROM table_name_56 WHERE size = "26mm (across scallops)" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of headquarter and the amount of headquarter , and group by attribute headquarter, display by the X from low to high please. | SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter | nvbench |
CREATE TABLE table_16439 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What episode in the season was directed by Jeff Melman? | SELECT MIN("No. in season") FROM table_16439 WHERE "Directed by" = 'Jeff Melman' | wikisql |
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
) | Bar chart x axis duration y axis how many duration, I want to sort in desc by the bar please. | SELECT Duration, COUNT(Duration) FROM actor GROUP BY Duration ORDER BY Duration DESC | nvbench |
CREATE TABLE table_67317 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Time" text,
"Att." text,
"Record" text
) | What was the loss of the game when the record was 14 8? | SELECT "Loss" FROM table_67317 WHERE "Record" = '14–8' | 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 (
... | Calculate the minimum days for which patients aged 89 years or more stay in hospital. | SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.age >= "89" | mimicsql_data |
CREATE TABLE table_12919003_3 (
writer VARCHAR,
episode VARCHAR
) | What's the writer of Episode 1? | SELECT writer FROM table_12919003_3 WHERE episode = "episode 1" | sql_create_context |
CREATE TABLE table_57632 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the home team that played against hawthorn? | SELECT "Home team" FROM table_57632 WHERE "Away team" = 'hawthorn' | wikisql |
CREATE TABLE table_56539 (
"Club" text,
"Wins" text,
"Last win" text,
"Runners-up" text,
"Last final lost" text
) | How many wins did the club have with the last win in 2000? | SELECT "Wins" FROM table_56539 WHERE "Last win" = '2000' | wikisql |
CREATE TABLE table_1939367_1 (
arabs_2001 INTEGER,
province VARCHAR
) | If the province is Manitoba, what is the Arabs 2001 number? | SELECT MAX(arabs_2001) FROM table_1939367_1 WHERE province = "Manitoba" | sql_create_context |
CREATE TABLE table_name_17 (
away_team VARCHAR,
venue VARCHAR
) | What was the away team that played at Princes Park? | SELECT away_team FROM table_name_17 WHERE venue = "princes park" | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | How many patients born in or before 2111 are tested for cerebrospinal fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2111.0" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_... | what stops does DL 838 make from SAN FRANCISCO to ATLANTA | SELECT DISTINCT flight_stop.stop_airport FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.flight_number = 838 AND flight.to_airport = AIR... | atis |
CREATE TABLE table_203_545 (
id number,
"single/ep" text,
"release date" text,
"label" text,
"format(s)" text,
"uk singles chart position" number,
"notes" text
) | what was the release date of the first single ? | SELECT "release date" FROM table_203_545 ORDER BY "release date" LIMIT 1 | squall |
CREATE TABLE table_46225 (
"Club" text,
"Head Coach" text,
"City" text,
"Stadium" text,
"2007 season" text
) | What city is Gwang-Yang stadium in? | SELECT "City" FROM table_46225 WHERE "Stadium" = 'gwang-yang stadium' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | what is the difference in mchc value in patient 005-87465 second measured on the current hospital visit compared to the first value measured on the current hospital visit? | 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 = '005-87465' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'mchc'... | eicu |
CREATE TABLE table_name_50 (
week_14_nov_30 VARCHAR,
week_10_nov_2 VARCHAR
) | What was the week 14 opponent for the year with a week 10 opponent of Michigan State (8-2)? | SELECT week_14_nov_30 FROM table_name_50 WHERE week_10_nov_2 = "michigan state (8-2)" | sql_create_context |
CREATE TABLE table_14345690_15 (
main_presenter VARCHAR,
series VARCHAR
) | Who is the main presenter of the series Twelve (2012)? | SELECT main_presenter FROM table_14345690_15 WHERE series = "Twelve (2012)" | sql_create_context |
CREATE TABLE table_3128 (
"Episode Number" real,
"Location" text,
"Original Airdate" text,
"Challenge Winner" text,
"Challenge" text
) | What is the original airdate of the episode where the challenge is a '7-pound monster breakfast burrito'? | SELECT "Original Airdate" FROM table_3128 WHERE "Challenge" = '7-pound monster breakfast burrito' | wikisql |
CREATE TABLE table_40491 (
"Rank" real,
"City" text,
"Airport" text,
"Passengers" real,
"Carriers" text
) | What was the number of passengers going to MCO with a rank larger than 9? | SELECT COUNT("Passengers") FROM table_40491 WHERE "Airport" = 'mco' AND "Rank" > '9' | wikisql |
CREATE TABLE table_13655 (
"Year" real,
"Champion" text,
"Score" text,
"Runner-up" text,
"Coach" text
) | Name the Score of the Year larger than 2004 and a Runner-up of northeastern? | SELECT "Score" FROM table_13655 WHERE "Year" > '2004' AND "Runner-up" = 'northeastern' | wikisql |
CREATE TABLE table_8676 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | What was the total attendance for the 3:1 game? | SELECT SUM("Attendance") FROM table_8676 WHERE "Score" = '3:1' | wikisql |
CREATE TABLE table_name_82 (
first_party VARCHAR,
year VARCHAR,
first_member VARCHAR
) | What is the first party for Lord John Hay earlier than 1857? | SELECT first_party FROM table_name_82 WHERE year < 1857 AND first_member = "lord john hay" | sql_create_context |
CREATE TABLE table_25648 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | Name the year for avg start being 22.4 | SELECT "Year" FROM table_25648 WHERE "Avg. Start" = '22.4' | wikisql |
CREATE TABLE table_64788 (
"Draw" real,
"Song" text,
"Artist" text,
"Points" real,
"Place" text
) | Which artist has a draw higher than 4 and fewer than 5 points? | SELECT "Artist" FROM table_64788 WHERE "Draw" > '4' AND "Points" < '5' | wikisql |
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... | 编号为39193636的病人在哪几次医疗记录中被开出过金额不少于7889.23元的药?把医疗就诊编号列出来即可 | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '39193636' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 7889.23) | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
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,... | 患者87197835在2013-01-25以前的检验报告单是在哪些门诊就诊的?列出门诊就诊流水号 | 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.RYBH = '87197835' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2013-01-25') | css |
CREATE TABLE table_name_98 (
top_5 INTEGER,
tournament VARCHAR,
top_10 VARCHAR
) | What is the average Top-5 for the open championship, and a Top-10 smaller than 2? | SELECT AVG(top_5) FROM table_name_98 WHERE tournament = "the open championship" AND top_10 < 2 | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the sum of department_id bin hire_date by weekday in a bar chart. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | 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... | 在零九年九月二十号直到一六年十月三十号之中患者李雅蕊被开出药品255778471-s总数是多少? | SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '李雅蕊' AND t_kc22.STA_DATE BETWEEN '2009-09-20' AND '2016-10-30' AND t_kc22.SOC_SRT_DIRE_CD = '255778471-s' | css |
CREATE TABLE table_name_6 (
record VARCHAR,
date VARCHAR,
round VARCHAR
) | What is the record for the date 15 december, and a round of final? | SELECT record FROM table_name_6 WHERE date = "15 december" AND round = "final" | sql_create_context |
CREATE TABLE table_176529_2 (
census_ranking VARCHAR,
population VARCHAR
) | What is the census ranking of the location with population of 959? | SELECT census_ranking FROM table_176529_2 WHERE population = 959 | sql_create_context |
CREATE TABLE table_name_32 (
record VARCHAR,
date VARCHAR
) | On the date of June 8 what was the record? | SELECT record FROM table_name_32 WHERE date = "june 8" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | give me the number of patients whose diagnoses icd9 code is 431 and lab test category is chemistry? | 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.icd9_code = "431" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE table_37439 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
) | What is the length of the 6 Hours of Talladega? | SELECT "Length" FROM table_37439 WHERE "Race" = '6 hours of talladega' | wikisql |
CREATE TABLE csu_fees (
campus number,
year number,
campusfee number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE campuses (
id number,
campus text,
location text,
county text,
year number
)
CREATE TAB... | What campuses are located in Northridge, Los Angeles or in San Francisco, San Francisco? | SELECT campus FROM campuses WHERE location = "Northridge" AND county = "Los Angeles" UNION SELECT campus FROM campuses WHERE location = "San Francisco" AND county = "San Francisco" | spider |
CREATE TABLE table_203_249 (
id number,
"position" number,
"song title" text,
"artist" text,
"sales" number,
"highest position" number
) | how many songs reached position 1 at their highest point ? | SELECT COUNT("song title") FROM table_203_249 WHERE "highest position" = 1 | squall |
CREATE TABLE table_46650 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | What is the total number of positions having points over 2, more than 4 losses, and under 10 matches played? | SELECT COUNT("Position") FROM table_46650 WHERE "Points" > '2' AND "Lost" > '4' AND "Played" < '10' | wikisql |
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... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the sum of employee_id bin hire_date by weekday, sort by the total number in desc. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 从2016年2月15日到2018年4月16日,患者15906206,685363这个指标怎么样 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, display by the Y-axis in descending. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numb... | what are the five most commonly ordered tests in 2101 for patients aged 30s? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 30 AND 39) AND STRFTIME('%y', labevents.c... | mimic_iii |
CREATE TABLE table_name_27 (
type VARCHAR,
eu_council_presidency VARCHAR,
president_in_office VARCHAR
) | What is the type for EU Council Presidency of UK and John Major as President-in-Office? | SELECT type FROM table_name_27 WHERE eu_council_presidency = "uk" AND president_in_office = "john major" | sql_create_context |
CREATE TABLE table_name_37 (
tie_no VARCHAR,
away_team VARCHAR
) | What is the Tie no when Crystal Palace is the Away team? | SELECT tie_no FROM table_name_37 WHERE away_team = "crystal palace" | sql_create_context |
CREATE TABLE table_52652 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | On what date did the away team score 14.4 (88)? | SELECT "Date" FROM table_52652 WHERE "Away team score" = '14.4 (88)' | wikisql |
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,
... | tell me the intake method for potassium chloride tab? | SELECT DISTINCT medication.routeadmin FROM medication WHERE medication.drugname = 'potassium chloride tab' | eicu |
CREATE TABLE Customers (
customer_id INTEGER,
customer_name VARCHAR(80),
customer_details VARCHAR(255)
)
CREATE TABLE Shipments (
shipment_id INTEGER,
order_id INTEGER,
invoice_number INTEGER,
shipment_tracking_number VARCHAR(80),
shipment_date DATETIME,
other_shipment_details VARCH... | Find the status of orders which belong to the customer named 'Jeramie', group by order status, and count them. Show the result with a bar chart. | SELECT T2.order_status, COUNT(T2.order_status) FROM Customers AS T1 JOIN Orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" GROUP BY order_status | nvbench |
CREATE TABLE table_name_75 (
tournament VARCHAR
) | What is the 2009 value with a q1 in 2006 in the French Open? | SELECT 2009 FROM table_name_75 WHERE 2006 = "q1" AND tournament = "french open" | sql_create_context |
CREATE TABLE table_name_93 (
round INTEGER,
college VARCHAR,
overall VARCHAR
) | In what Round was the draft pick from Florida with an Overall less than 166? | SELECT AVG(round) FROM table_name_93 WHERE college = "florida" AND overall < 166 | sql_create_context |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 门诊诊断患者彭清婉为疾病D12.586时其甲状腺素的结果定量及其单位都是什么呢? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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 = j... | css |
CREATE TABLE apartment_bookings (
apt_booking_id number,
apt_id number,
guest_id number,
booking_status_code text,
booking_start_date time,
booking_end_date time
)
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code text,
apt_number text,
bathroom_coun... | Sort the gender codes in descending order of their corresponding number of guests. Return both the gender codes and counts. | SELECT gender_code, COUNT(*) FROM guests GROUP BY gender_code ORDER BY COUNT(*) DESC | spider |
CREATE TABLE table_52824 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What Nationality is the Iowa State team? | SELECT "Nationality" FROM table_52824 WHERE "School/Club Team" = 'iowa state' | wikisql |
CREATE TABLE table_name_35 (
venue VARCHAR,
result VARCHAR,
score VARCHAR
) | What is the Venue with a Result that is win, and a Score that is 5-0? | SELECT venue FROM table_name_35 WHERE result = "win" AND score = "5-0" | sql_create_context |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
hi... | how many people fit on a 73S | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = '73S' | atis |
CREATE TABLE table_name_37 (
laps INTEGER,
rider VARCHAR,
grid VARCHAR
) | What was the highest number of laps for rider Shuhei Aoyama in a grid higher than 24? | SELECT MAX(laps) FROM table_name_37 WHERE rider = "shuhei aoyama" AND grid > 24 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 患有沙眼的患者在门诊诊断的甘油三酯数值的平均值以及最值各是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM txmzjzjlb JOIN jybgb JOIN jyjgzbb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE txmzjzjlb.JZZDSM = '沙眼' AND jyjgzbb.JCZBMC = '甘油三酯'... | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE T... | Top viewed questions of 2015. | SELECT Title, ViewCount, Score FROM Posts WHERE CreationDate >= '20150101' ORDER BY ViewCount DESC | sede |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,... | how many patients received a bronchoscopy thru stoma two or more times until 2104? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'bronchoscopy thru sto... | mimic_iii |
CREATE TABLE table_27229 (
"Season" text,
"Date" text,
"Home team" text,
"Result" text,
"Away team" text,
"Stadium" text
) | What was the stadium for the home team of shamrock rovers and result of 3 0? | SELECT "Stadium" FROM table_27229 WHERE "Home team" = 'Shamrock Rovers' AND "Result" = '3–0' | wikisql |
CREATE TABLE table_41677 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | How many games were played where exactly 15 points were scored? | SELECT SUM("Played") FROM table_41677 WHERE "Points" = '15' | wikisql |
CREATE TABLE table_204_800 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | who won more gold medals between jamaica and mexico ? | SELECT "nation" FROM table_204_800 WHERE "nation" IN ('jamaica', 'mexico') ORDER BY "gold" DESC LIMIT 1 | squall |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
Pos... | post count for deleted users. | SELECT COUNT(*) FROM Posts WHERE NOT OwnerDisplayName IS NULL AND PostTypeId = 1 | sede |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
) | Visualize the average smallest rating of different movie title using a bar chart, and I want to sort by the stars) in ascending please. | SELECT T2.title, AVG(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY AVG(MIN(T1.stars)) | nvbench |
CREATE TABLE table_47021 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | On what date was the result a draw? | SELECT "Date" FROM table_47021 WHERE "Result" = 'draw' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 患者沈鸿风的检测指标721371的情况,在16年7月25日到17年10月2日期间怎么样? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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_MZJZ... | css |
CREATE TABLE city (
City_ID int,
Official_Name text,
Status text,
Area_km_2 real,
Population real,
Census_Ranking text
)
CREATE TABLE farm (
Farm_ID int,
Year int,
Total_Horses real,
Working_Horses real,
Total_Cattle real,
Oxen real,
Bulls real,
Cows real,
Pi... | What are the statuses and average populations of each city. | SELECT Status, AVG(Population) FROM city GROUP BY Status | nvbench |
CREATE TABLE table_name_42 (
almaty_ VARCHAR,
_kazakhstan VARCHAR,
sergey_filimonov___kaz__ VARCHAR
) | What is the Almaty, Kazakhstan when the Sergey Filimonov (KAZ) is 210kg? | SELECT almaty_, _kazakhstan FROM table_name_42 WHERE sergey_filimonov___kaz__ = "210kg" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.