context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_20997 (
"Year" real,
"Mens Open" text,
"Womens Open" text,
"Mixed Open" text,
"Mens u20" text,
"Womens u20" text,
"Senior Mixed" text,
"Mens 30" text,
"Womens 30" text,
"Mens 35" text,
"Womens 35" text,
"Mens 40" text,
"Womens 40" text,
"Mens 45... | What were the results of the womens u20 when the mens 45 was Sunwest Razorbacks def Northern Eagles? | SELECT "Womens u20" FROM table_20997 WHERE "Mens 45" = 'SunWest Razorbacks def Northern Eagles' | wikisql |
CREATE TABLE table_256286_39 (
meas_num INTEGER
) | What is the highest measure number? | SELECT MAX(meas_num) FROM table_256286_39 | sql_create_context |
CREATE TABLE table_63381 (
"Model" text,
"Years" text,
"Engine code" text,
"Power" text,
"Torque" text
) | What is the engine code for the model xdrive35i? | SELECT "Engine code" FROM table_63381 WHERE "Model" = 'xdrive35i' | wikisql |
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 class_of_service (
booking_class varchar,
rank i... | i want to book a flight from SALT LAKE CITY to WESTCHESTER COUNTY | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SALT LAKE CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... | atis |
CREATE TABLE table_48139 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | what is the iata when the city is leipzig? | SELECT "IATA" FROM table_48139 WHERE "City" = 'leipzig' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
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,
JSBBSJ time,
... | 在21年8月25日到21年9月5日期间,患者马璇珠曾到医院看过几次病 | SELECT (SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND p... | css |
CREATE TABLE table_11677691_12 (
player VARCHAR,
school VARCHAR
) | who are all the players for mission viejo high school | SELECT player FROM table_11677691_12 WHERE school = "Mission Viejo High school" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departu... | i would like to fly from PITTSBURGH to ATLANTA on US | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTS... | atis |
CREATE TABLE table_18303 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Election results of 1976 | SELECT "Result" FROM table_18303 WHERE "First elected" = '1976' | wikisql |
CREATE TABLE table_name_80 (
points INTEGER,
against VARCHAR,
played VARCHAR
) | What is the lowest Points when against is 50, and there are less than 20 played? | SELECT MIN(points) FROM table_name_80 WHERE against = 50 AND played < 20 | sql_create_context |
CREATE TABLE table_name_39 (
grid INTEGER,
driver VARCHAR,
laps VARCHAR
) | what is the grid when the driver is mario andretti and the laps is less than 54? | SELECT MAX(grid) FROM table_name_39 WHERE driver = "mario andretti" AND laps < 54 | sql_create_context |
CREATE TABLE table_27931 (
"meas. num." real,
"passed" text,
"YES votes" real,
"NO votes" real,
"% YES" text,
"Const. Amd.?" text,
"type" text,
"description" text
) | How many measures had a yes vote of 216545? | SELECT COUNT("passed") FROM table_27931 WHERE "YES votes" = '216545' | wikisql |
CREATE TABLE table_5297 (
"Year" real,
"Location" text,
"Gold" text,
"Silver" text,
"Bronze" text
) | What is the location of the Asian Games after 2002 when Kim Hyun-soo won the gold? | SELECT "Location" FROM table_5297 WHERE "Year" > '2002' AND "Gold" = 'kim hyun-soo' | 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,
... | provide the number of patients whose primary disease is morbid obesity/sda and age is less than 62? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND demographic.age < "62" | mimicsql_data |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
g... | what are the top four most frequent procedures given to patients in the same month after the diagnosis of hypotension nec this year? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... | mimic_iii |
CREATE TABLE table_35670 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | Which team scored less than 35 points? | SELECT "Team" FROM table_35670 WHERE "Points" < '35' | wikisql |
CREATE TABLE table_name_91 (
date VARCHAR,
winning_driver VARCHAR,
race_name VARCHAR
) | What is the date that the winner driver is Stirling Moss in the race named vi grand prix de caen? | SELECT date FROM table_name_91 WHERE winning_driver = "stirling moss" AND race_name = "vi grand prix de caen" | sql_create_context |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
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 te... | 列出在08年4月2日到10年8月17日内患者云文石全部检验结果指标记录中的仪器名称以及编号都是什么啊? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC 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 jybg... | css |
CREATE TABLE table_29718 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Table" text,
"Incoming manager" text,
"Date of appointment" text
) | What is the table when the team is slovan bratislava? | SELECT "Table" FROM table_29718 WHERE "Team" = 'Slovan Bratislava' | wikisql |
CREATE TABLE table_name_79 (
round INTEGER,
overall VARCHAR,
position VARCHAR,
college VARCHAR
) | What is the average round of the s position player from the college of Mississippi and has an overall less than 214? | SELECT AVG(round) FROM table_name_79 WHERE position = "s" AND college = "mississippi" AND overall < 214 | sql_create_context |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | Show me about the distribution of Sex and the amount of Sex , and group by attribute Sex in a bar chart, list by the bars in ascending. | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_35801 (
"Date" text,
"Tournament" text,
"Location" text,
"Winner" text,
"Score" text,
"1st prize ( $ )" real
) | what is the 1st prize for may 21 | SELECT SUM("1st prize ( $ )") FROM table_35801 WHERE "Date" = 'may 21' | wikisql |
CREATE TABLE table_name_48 (
name VARCHAR,
dates_active VARCHAR
) | What is the name of the storm active during season aggregates? | SELECT name FROM table_name_48 WHERE dates_active = "season aggregates" | sql_create_context |
CREATE TABLE table_14031 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | Which Competition has a Year smaller than 2009, and Notes of 56.16 m? | SELECT "Competition" FROM table_14031 WHERE "Year" < '2009' AND "Notes" = '56.16 m' | wikisql |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | What courses are worth 10 credits ? | SELECT DISTINCT name, number FROM course WHERE credits = 10 AND department = 'EECS' | advising |
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | Show sum of budget in different year and group by department creation time with a line chart, and order x axis from high to low order. | SELECT Creation, SUM(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation DESC | nvbench |
CREATE TABLE table_19681 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | Who won mens singles the year sveinn logi s lvason tryggvi nilsen won mens doubles and elsa nielsen won womens singles | SELECT "Mens singles" FROM table_19681 WHERE "Mens doubles" = 'Sveinn Logi Sölvason Tryggvi Nilsen' AND "Womens singles" = 'Elsa Nielsen' | wikisql |
CREATE TABLE table_10318 (
"Year" real,
"Premier" text,
"Runner Up" text,
"Scores" text,
"Venue" text,
"Crowd" real,
"Margin" real,
"Winner Season" text,
"Runner Up Season" text
) | Who won the season of 1998? | SELECT "Winner Season" FROM table_10318 WHERE "Year" = '1998' | wikisql |
CREATE TABLE table_name_70 (
grid INTEGER,
driver VARCHAR
) | What is the average grid for giorgio pantano? | SELECT AVG(grid) FROM table_name_70 WHERE driver = "giorgio pantano" | sql_create_context |
CREATE TABLE table_name_40 (
record VARCHAR,
opponent VARCHAR
) | What is the Record when Evangelista Cyborg was the opponent? | SELECT record FROM table_name_40 WHERE opponent = "evangelista cyborg" | sql_create_context |
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,
... | what is first weight of patient 006-158338 in this month. | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-158338') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month',... | eicu |
CREATE TABLE table_63630 (
"Rank" real,
"Canton" text,
"Highest point" text,
"Highest elevation" text,
"Lowest point" text,
"Lowest elevation" text
) | What is the Canton of Vaud's highest point? | SELECT "Highest point" FROM table_63630 WHERE "Canton" = 'vaud' | wikisql |
CREATE TABLE appearances (
year INTEGER,
team_id TEXT,
league_id TEXT,
player_id TEXT,
g_all NUMERIC,
gs NUMERIC,
g_batting INTEGER,
g_defense NUMERIC,
g_p INTEGER,
g_c INTEGER,
g_1b INTEGER,
g_2b INTEGER,
g_3b INTEGER,
g_ss INTEGER,
g_lf INTEGER,
g_cf INT... | Return me a line chart to show the frequency of the year attribute by binning into a weekday interval, list by the x-axis in desc. | SELECT year, COUNT(year) FROM home_game ORDER BY year DESC | nvbench |
CREATE TABLE exhibition (
theme VARCHAR,
exhibition_id VARCHAR
)
CREATE TABLE exhibition_record (
exhibition_id VARCHAR,
attendance INTEGER
) | Show the theme for exhibitions with both records of an attendance below 100 and above 500. | SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance < 100 INTERSECT SELECT T2.theme FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.exhibition_id = T2.exhibition_id WHERE T1.attendance > 500 | sql_create_context |
CREATE TABLE table_54945 (
"Year" real,
"Artist" text,
"Composition" text,
"Mintage" real,
"Issue Price" text
) | What is the average Year for the Royal Canadian Mint Engravers Artist when the Mintage is under 200? | SELECT AVG("Year") FROM table_54945 WHERE "Artist" = 'royal canadian mint engravers' AND "Mintage" < '200' | wikisql |
CREATE TABLE table_32355 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What the date of the game of the team that plays in princes park? | SELECT "Date" FROM table_32355 WHERE "Venue" = 'princes park' | wikisql |
CREATE TABLE table_64817 (
"Ref#" real,
"Name" text,
"Built" real,
"Location" text,
"Construction" text
) | What is the name of the mill constructed of red brick in 1910 with a reference number lower than 55? | SELECT "Name" FROM table_64817 WHERE "Ref#" < '55' AND "Built" = '1910' AND "Construction" = 'red brick' | wikisql |
CREATE TABLE table_name_83 (
outcome VARCHAR,
opponent VARCHAR
) | Which Outcome has a Opponent of lindsay lee-waters? | SELECT outcome FROM table_name_83 WHERE opponent = "lindsay lee-waters" | sql_create_context |
CREATE TABLE table_name_63 (
result VARCHAR,
artist VARCHAR
) | Name the result for linn nyg rd | SELECT result FROM table_name_63 WHERE artist = "linn nygård" | sql_create_context |
CREATE TABLE table_30314 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | How many years did lin gaoyuan wu jiaji play mens doubles? | SELECT COUNT("Year Location") FROM table_30314 WHERE "Mens Doubles" = 'Lin Gaoyuan Wu Jiaji' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
O... | Number of posts in recent 1 month. | SELECT COUNT(*) FROM Posts WHERE CreationDate > '2020-08-21' AND Body LIKE '%http%' | sede |
CREATE TABLE table_23014923_1 (
season VARCHAR,
intermediate__south__winners VARCHAR
) | What is the year of the season if the intermediate (South) winners is Southmead Athletic? | SELECT season FROM table_23014923_1 WHERE intermediate__south__winners = "Southmead Athletic" | sql_create_context |
CREATE TABLE table_42379 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | What 1st leg has 52-70 as the agg.? | SELECT "1st leg" FROM table_42379 WHERE "Agg." = '52-70' | wikisql |
CREATE TABLE table_33670 (
"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 HOME TEAM SCORE 12.16 (88)? | SELECT "Date" FROM table_33670 WHERE "Home team score" = '12.16 (88)' | wikisql |
CREATE TABLE table_63732 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the player when the team is oakland raiders? | SELECT "Player" FROM table_63732 WHERE "Team" = 'oakland raiders' | wikisql |
CREATE TABLE table_203_734 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | what competition is lorenzo 's top position in ? | SELECT "competition" FROM table_203_734 ORDER BY "position" LIMIT 1 | squall |
CREATE TABLE table_26275503_2 (
kickoff VARCHAR,
opponent VARCHAR
) | How many different kickoffs happened when the oppenent was at Rhein Fire? | SELECT COUNT(kickoff) FROM table_26275503_2 WHERE opponent = "at Rhein Fire" | sql_create_context |
CREATE TABLE table_61469 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | When Lincoln City was the away team what is the tie number? | SELECT "Tie no" FROM table_61469 WHERE "Away team" = 'lincoln city' | wikisql |
CREATE TABLE table_name_86 (
points INTEGER,
place VARCHAR
) | Name the fewest points of 5 place | SELECT MIN(points) FROM table_name_86 WHERE place = 5 | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate tim... | Users with the lowest rep to total posts ratio. | SELECT u.Id, u.DisplayName, u.Reputation, COUNT(*) AS "total_number_of_posts", CAST(u.Reputation AS FLOAT) / COUNT(*) AS Ratio FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id WHERE p.PostTypeId IN (1, 2) AND u.Reputation > 100 GROUP BY u.Id, u.DisplayName, u.Reputation ORDER BY Ratio LIMIT 1000 | sede |
CREATE TABLE table_name_98 (
club_team VARCHAR,
player VARCHAR
) | What was the club team for Kyle de Coste? | SELECT club_team FROM table_name_98 WHERE player = "kyle de coste" | sql_create_context |
CREATE TABLE table_203_689 (
id number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"record" text
) | how many games did the mercury play in june ? | SELECT COUNT(*) FROM table_203_689 WHERE "date" = 6 | squall |
CREATE TABLE table_2902 (
"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
) | Who directed the episode titled 'Redemptio'? | SELECT "Directed by" FROM table_2902 WHERE "Title" = 'Redemptio' | wikisql |
CREATE TABLE table_59048 (
"Name" text,
"Location" text,
"Years as tallest" text,
"Height metres / ft" text,
"Floors" text
) | Name the Years as tallest has a Height metres / ft of 07.0 150 / 493 [b ]? | SELECT "Years as tallest" FROM table_59048 WHERE "Height metres / ft" = '07.0 150 / 493 [b ]' | wikisql |
CREATE TABLE table_23975 (
"Model Type" text,
"Model Designation" text,
"Engine" text,
"Wheelbase (mm/inch)" text,
"GVW (kg/ton)" text,
"Axle Ratio" text
) | What type of engine does the model with model designation 97100 have? | SELECT "Engine" FROM table_23975 WHERE "Model Designation" = '97100' | wikisql |
CREATE TABLE table_4717 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What position and school/club team of Oklahoma state has an overall less than 410 and a round smaller than 5? | SELECT "Position" FROM table_4717 WHERE "Overall" < '410' AND "Round" < '5' AND "School/Club Team" = 'oklahoma state' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
... | tell me the total amount of input that patient 5310 has received on last month/01? | 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 = 5310)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(),... | mimic_iii |
CREATE TABLE table_68909 (
"Round" text,
"Name" text,
"Song" text,
"Score" real,
"Status" text
) | Which round is a lower score than 21.5? | SELECT "Round" FROM table_68909 WHERE "Score" < '21.5' | wikisql |
CREATE TABLE table_65587 (
"Actor" text,
"Character" text,
"Soap Opera" text,
"Years" text,
"Duration" text
) | What are the years that have a duration of 15 years and giulia poggi as the character? | SELECT "Years" FROM table_65587 WHERE "Duration" = '15 years' AND "Character" = 'giulia poggi' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | when was the last time that patient 027-136480 received the bronchodilator - metered dose procedure since 2105? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-136480')) AND treatment.treatmentname = 'bronchodilator - met... | eicu |
CREATE TABLE table_name_34 (
decile VARCHAR,
area VARCHAR,
authority VARCHAR,
roll VARCHAR
) | Which Decile has an Authority of state, a Roll smaller than 61, and an Area of kotemaori? | SELECT decile FROM table_name_34 WHERE authority = "state" AND roll < 61 AND area = "kotemaori" | sql_create_context |
CREATE TABLE table_name_28 (
year INTEGER,
competition VARCHAR,
club VARCHAR
) | What is the average Year when the Competition was friendly, and a Club of everton? | SELECT AVG(year) FROM table_name_28 WHERE competition = "friendly" AND club = "everton" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 在2010年6月14到2013年12月7日内医院8996226开出的检验报告单中在不同检测指标名称以及不同检测指标结果定量单位下,保留平均值最小的26项里检测指标结果定量的平均值都是多少? | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '8996226' AND BGRQ BETWEEN '2010-06-14' AND '2013-12-07' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) LIMIT 26 | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | How many patients aged below 43 years old are diagnosed with prob-head/neck/trunk nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "43" AND diagnoses.short_title = "Prob-head/neck/trunk NOS" | mimicsql_data |
CREATE TABLE table_64004 (
"Wimmera FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What's the total losses when there are 8 wins and less than 2 byes? | SELECT SUM("Losses") FROM table_64004 WHERE "Wins" = '8' AND "Byes" < '2' | wikisql |
CREATE TABLE table_name_41 (
college VARCHAR,
overall VARCHAR,
round VARCHAR
) | Which college had an overall smaller than 315 in round 17? | SELECT college FROM table_name_41 WHERE overall < 315 AND round = 17 | sql_create_context |
CREATE TABLE table_23257 (
"School" text,
"Baseball stadium" text,
"Softball stadium" text,
"Basketball arena" text,
"Capacity" text
) | What is the name of the baseball stadium for the school with the Murray Center basketball arena? | SELECT "Baseball stadium" FROM table_23257 WHERE "Basketball arena" = 'The Murray Center' | wikisql |
CREATE TABLE table_name_40 (
location VARCHAR,
tournament VARCHAR
) | What is the Location for the buick-goodwrench open? | SELECT location FROM table_name_40 WHERE tournament = "buick-goodwrench open" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,... | what flights are available from DENVER to PHILADELPHIA with stopover in PITTSBURGH | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND CITY... | atis |
CREATE TABLE table_30447 (
"Episode" text,
"Date Aired" text,
"Timeslot" text,
"Rating" text,
"Nightly Rank" real,
"Weekly Rank" text
) | What is the rating of episode 1.04? | SELECT "Rating" FROM table_30447 WHERE "Episode" = '1.04' | wikisql |
CREATE TABLE table_name_69 (
rank INTEGER,
city VARCHAR,
population VARCHAR
) | What is the average rank of the city of el paso, which has a population greater than 672,538? | SELECT AVG(rank) FROM table_name_69 WHERE city = "el paso" AND population > 672 OFFSET 538 | sql_create_context |
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... | Find the number of the names of stadiums that some Australian swimmers have been to, I want to show by the y-axis from high to low. | SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name ORDER BY COUNT(T4.Name) DESC | nvbench |
CREATE TABLE table_22581 (
"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
) | How many poles in the year 2000 | SELECT MAX("Poles") FROM table_22581 WHERE "Year" = '2000' | wikisql |
CREATE TABLE table_15726 (
"State" text,
"Name" text,
"Hometown" text,
"Age 1" real,
"Height" text
) | Which state's delegate is from Lexington, Ky and is 5'4' tall? | SELECT "State" FROM table_15726 WHERE "Height" = '5''4' AND "Hometown" = 'lexington, ky' | wikisql |
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... | Draw a bar chart about the distribution of All_Home and Team_ID , and group by attribute ACC_Road, and could you rank by the Y in asc? | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY Team_ID | nvbench |
CREATE TABLE table_45056 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | What surface did hayley ericksen play on? | SELECT "Surface" FROM table_45056 WHERE "Partner" = 'hayley ericksen' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 89956655081的患者卡号以及卡类型在门诊就诊里分别是什么? | SELECT KH, KLX FROM mzjzjlb WHERE JZLSH = '89956655081' | css |
CREATE TABLE table_26647 (
"State (class)" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date of successors formal installation" text
) | Who was the successor that was formally installed on March 30, 1870? | SELECT "Successor" FROM table_26647 WHERE "Date of successors formal installation" = 'March 30, 1870' | wikisql |
CREATE TABLE table_28742659_2 (
eliminated VARCHAR,
finish VARCHAR
) | What is listed in eliminated when the finish is 15th voted out 9th jury Member Day 46? | SELECT eliminated FROM table_28742659_2 WHERE finish = "15th voted Out 9th Jury Member Day 46" | sql_create_context |
CREATE TABLE table_name_2 (
chief_judge VARCHAR,
appointed_by VARCHAR
) | Who did Clinton appoint as a Chief Judge? | SELECT chief_judge FROM table_name_2 WHERE appointed_by = "clinton" | sql_create_context |
CREATE TABLE table_name_24 (
title_rank VARCHAR,
series VARCHAR,
character VARCHAR
) | What is the title rank of the actor who played the character of arthur hastings during series 1-8, 13? | SELECT title_rank FROM table_name_24 WHERE series = "1-8, 13" AND character = "arthur hastings" | sql_create_context |
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE Undergoes (
Patient INTEGER,
Procedures IN... | List the name of physicians who took some appointment, and count them by a bar chart, sort Y-axis in ascending order. | SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Physician AS T2 ON T1.Physician = T2.EmployeeID GROUP BY Name ORDER BY COUNT(Name) | nvbench |
CREATE TABLE table_15313204_1 (
records VARCHAR,
pct VARCHAR
) | What are the record(s) for the team with a winning percentage of .464? | SELECT records FROM table_15313204_1 WHERE pct = ".464" | sql_create_context |
CREATE TABLE table_18257 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the result with candidates being billy tauzin (d) unopposed | SELECT "Result" FROM table_18257 WHERE "Candidates" = 'Billy Tauzin (D) Unopposed' | wikisql |
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 diagnosed with syncope and collapse. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Syncope and collapse" | mimicsql_data |
CREATE TABLE table_name_57 (
result VARCHAR,
week VARCHAR
) | what's the results of week 12? | SELECT result FROM table_name_57 WHERE week = 12 | sql_create_context |
CREATE TABLE table_name_85 (
nationality VARCHAR,
position_s_ VARCHAR,
season_s_ VARCHAR
) | What is the nationality of the player who played guard in 2006? | SELECT nationality FROM table_name_85 WHERE position_s_ = "guard" AND season_s_ = "2006" | sql_create_context |
CREATE TABLE table_10408617_5 (
tariff_code VARCHAR,
bts_retail_price__regulated_ VARCHAR
) | How many tariff codes have a bts retail price of 2.553p/min? | SELECT COUNT(tariff_code) FROM table_10408617_5 WHERE bts_retail_price__regulated_ = "2.553p/min" | sql_create_context |
CREATE TABLE table_21563298_1 (
roll INTEGER,
school VARCHAR
) | How many kids go to Brechin High School? | SELECT MAX(roll) FROM table_21563298_1 WHERE school = "Brechin High school" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | when did patient 016-12011 last take an intake on 12/31/last year? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-12011')) AND intakeoutput.cellpath LIKE '%intake%... | eicu |
CREATE TABLE table_204_522 (
id number,
"boat #" text,
"name" text,
"builder" text,
"laid down" text,
"launched" text,
"completed" text,
"fate" text
) | which was scuttled earlier , ha-206 or ha-208 ? | SELECT "name" FROM table_204_522 WHERE "name" IN ('ha-206', 'ha-208') ORDER BY "launched" LIMIT 1 | squall |
CREATE TABLE table_name_56 (
fa_cup INTEGER,
malaysia_cup VARCHAR,
league VARCHAR,
player VARCHAR
) | What is the average FA cup that has a league of 0, fahmi hatta as the player, with a Malaysia cup less than 0? | SELECT AVG(fa_cup) FROM table_name_56 WHERE league = 0 AND player = "fahmi hatta" AND malaysia_cup < 0 | sql_create_context |
CREATE TABLE table_name_27 (
overall VARCHAR,
position VARCHAR,
round VARCHAR
) | WHAT WAS THE OVERALL NUMBER WITH A POSITON OF DB, AND ROUND GREATER THAN 8? | SELECT COUNT(overall) FROM table_name_27 WHERE position = "db" AND round > 8 | sql_create_context |
CREATE TABLE table_25356350_3 (
original_air_date VARCHAR,
written_by VARCHAR
) | What is the air date of the episode written by Itamar Moses? | SELECT original_air_date FROM table_25356350_3 WHERE written_by = "Itamar Moses" | sql_create_context |
CREATE TABLE table_name_54 (
top_fives INTEGER,
poles VARCHAR,
top_tens VARCHAR
) | What is the total number of top fives when casey mears had more than 1 poles and top tens less than 9? | SELECT SUM(top_fives) FROM table_name_54 WHERE poles > 1 AND top_tens < 9 | sql_create_context |
CREATE TABLE Employee (
EmployeeId integer,
LastName varchar(20),
FirstName varchar(20),
Title varchar(30),
ReportsTo integer,
BirthDate datetime,
HireDate datetime,
Address varchar(70),
City varchar(40),
State varchar(40),
Country varchar(40),
PostalCode varchar(10),
... | What are the phone numbers for each employee, and count them by a bar chart, and sort in descending by the names. | SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY Phone DESC | nvbench |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Highest ranked SO users from Armenia. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE (LOWER(Location) LIKE '%yerevan%' OR LOWER(Location) LIKE '%armenia%') ORDER BY Reputation DESC | sede |
CREATE TABLE table_name_20 (
city_of_license VARCHAR,
frequency VARCHAR
) | What is City of License, when Frequency is 101.1? | SELECT city_of_license FROM table_name_20 WHERE frequency = "101.1" | 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... | give me the number of patients whose diagnoses short title is pseudomonas infect nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Pseudomonas infect NOS" | mimicsql_data |
CREATE TABLE table_44009 (
"Round" real,
"Pick" real,
"Name" text,
"Position" text,
"College" text,
"AAFC Team" text
) | Which College has a Name of hardy brown? | SELECT "College" FROM table_44009 WHERE "Name" = 'hardy brown' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.