context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_69 (
points VARCHAR,
games_played INTEGER
) | What is the number of points of the match with less than 22 games played? | SELECT COUNT(points) FROM table_name_69 WHERE games_played < 22 | sql_create_context |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE T... | SELECT count(*) FROM Posts. | SELECT COUNT(*) FROM VoteTypes | sede |
CREATE TABLE table_name_82 (
date VARCHAR,
promotor VARCHAR,
opponent VARCHAR
) | Which date has the promoter Frank Moloney and the opponent Georgi Iliev? | SELECT date FROM table_name_82 WHERE promotor = "frank moloney" AND opponent = "georgi iliev" | sql_create_context |
CREATE TABLE table_name_56 (
event VARCHAR,
rider VARCHAR
) | What event was Rob Vine riding? | SELECT event FROM table_name_56 WHERE rider = "rob vine" | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id... | what 's a flight that goes from BALTIMORE to SEATTLE | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEAT... | atis |
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE field (
fie... | how many papers has Mirella Lapata cited ? | SELECT DISTINCT COUNT(cite.citedpaperid) FROM author, cite, writes WHERE author.authorname = 'Mirella Lapata' AND writes.authorid = author.authorid AND writes.paperid = cite.citingpaperid | scholar |
CREATE TABLE table_35141 (
"Position" text,
"Number" real,
"Name" text,
"Height" text,
"Weight" text,
"Class" text,
"Hometown" text,
"Games\u2191" real
) | What is the games number when the Position was wr, and a Number larger than 17? | SELECT COUNT("Games\u2191") FROM table_35141 WHERE "Position" = 'wr' AND "Number" > '17' | wikisql |
CREATE TABLE table_59205 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | How many Grid has a Rider of ryuichi kiyonari? | SELECT SUM("Grid") FROM table_59205 WHERE "Rider" = 'ryuichi kiyonari' | wikisql |
CREATE TABLE table_5305 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | Which Overall is the lowest one that has a Round of 3? | SELECT MIN("Overall") FROM table_5305 WHERE "Round" = '3' | wikisql |
CREATE TABLE table_name_43 (
rider VARCHAR,
time_retired VARCHAR
) | Who is the rider whose time/retired is accident? | SELECT rider FROM table_name_43 WHERE time_retired = "accident" | sql_create_context |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Which prerequisites have I completed for FILMVID 309 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'FILMVID' AND COURSE_1.number... | advising |
CREATE TABLE table_21436373_7 (
attendance VARCHAR,
date_year VARCHAR
) | When 2005 is the date/year how many measurements of attendance are there? | SELECT COUNT(attendance) FROM table_21436373_7 WHERE date_year = "2005" | sql_create_context |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | How many MILSCI 202 lectures are there each week ? | SELECT (SELECT SUM(CASE WHEN DERIVED_TABLEalias0.FRIDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalias0.MONDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalias0.SATURDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalias0.SUNDAY = 'Y' THEN 1 ELSE 0 END) + SUM(CASE WHEN DERIVED_TABLEalia... | advising |
CREATE TABLE table_27495117_3 (
manner_of_departure VARCHAR,
date_of_appointment VARCHAR
) | What was the manner of departure for the appointment date of 21 september 2010 | SELECT manner_of_departure FROM table_27495117_3 WHERE date_of_appointment = "21 September 2010" | sql_create_context |
CREATE TABLE table_name_4 (
result VARCHAR,
date VARCHAR
) | What was the result on july 16, 1992? | SELECT result FROM table_name_4 WHERE date = "july 16, 1992" | sql_create_context |
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... | 列出患者赵宏义的所有检验结果指标记录在2014-02-10到2019-02-10内的检测人为56821852的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_... | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | For how many patients with coronary atherosclerosis of native coronary artery was the ethnic origin unknown/unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "UNKNOWN/NOT SPECIFIED" AND diagnoses.long_title = "Coronary atherosclerosis of native coronary artery" | mimicsql_data |
CREATE TABLE table_44948 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Crowd" real,
"Date" text
) | What is Home Team, when Away Team Score is 10.8 (64)? | SELECT "Home team" FROM table_44948 WHERE "Away team score" = '10.8 (64)' | wikisql |
CREATE TABLE table_5437 (
"Rank" real,
"Name" text,
"Headquarters" text,
"Primary industry" text,
"Market value ( USD million)" real
) | what is the name of the netherlands head quarters | SELECT "Name" FROM table_5437 WHERE "Headquarters" = 'the netherlands' | wikisql |
CREATE TABLE table_55343 (
"Name" text,
"Date of Birth (Age)" text,
"Club" text,
"Caps" text,
"Goals" text
) | What is the date of birth and age of Gabriel Quak Jun Yi with 3 caps? | SELECT "Date of Birth (Age)" FROM table_55343 WHERE "Caps" = '3' AND "Name" = 'gabriel quak jun yi' | wikisql |
CREATE TABLE table_name_86 (
money___ INTEGER,
score VARCHAR
) | How much money has 76-70-68-73=287 as a score? | SELECT SUM(money___) AS $__ FROM table_name_86 WHERE score = 76 - 70 - 68 - 73 = 287 | sql_create_context |
CREATE TABLE exhibition_record (
exhibition_id number,
date text,
attendance number
)
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id numbe... | Show the average, minimum, and maximum ticket prices for exhibitions for all years before 2009. | SELECT AVG(ticket_price), MIN(ticket_price), MAX(ticket_price) FROM exhibition WHERE year < 2009 | spider |
CREATE TABLE table_20524090_1 (
obama_percentage VARCHAR,
county VARCHAR
) | What was Obama's percentage in the county of Surry? | SELECT obama_percentage FROM table_20524090_1 WHERE county = "Surry" | sql_create_context |
CREATE TABLE table_72874 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the record on November 7? | SELECT COUNT("Record") FROM table_72874 WHERE "Date" = 'November 7' | wikisql |
CREATE TABLE table_1147701_5 (
torque__nm VARCHAR,
engine_code VARCHAR
) | Name the torque of the engine is d5244 t5 | SELECT torque__nm AS @rpm_ FROM table_1147701_5 WHERE engine_code = "D5244 T5" | sql_create_context |
CREATE TABLE table_68335 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | Name the distance for Course of vittorio veneto to marina romea | SELECT "Distance" FROM table_68335 WHERE "Course" = 'vittorio veneto to marina romea' | 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... | 医院1409067所有医疗记录的个人账户支出与医疗费总额的平均比值在2010-02-01到2011-06-01内有多大? | SELECT AVG(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '1409067' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-02-01' AND '2011-06-01' UNION SELECT AVG(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_OR... | css |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | did patient 003-42706 receive a thrombolytics procedure from other hospitals in 2105? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-42706' AND patient.hospitalid <> (SELECT DISTINCT patient.hospitalid FROM patient WHERE patient.uniquepid = '003-42706' AND patient.hospitaldischargetime IS NULL)) AND tr... | eicu |
CREATE TABLE table_name_6 (
name VARCHAR,
longitude VARCHAR
) | What name has a longitude of 213.0e? | SELECT name FROM table_name_6 WHERE longitude = "213.0e" | sql_create_context |
CREATE TABLE table_44608 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is Opponent, when Championship is P tange? | SELECT "Opponent" FROM table_44608 WHERE "Championship" = 'pétange' | wikisql |
CREATE TABLE table_203_561 (
id number,
"pos" number,
"team" text,
"total" number,
"high" number,
"low" number,
"average" number,
"change" text
) | list the top 5 teams within highest total . | SELECT "team" FROM table_203_561 ORDER BY "total" DESC LIMIT 5 | squall |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConce... | attempting to measure votiness over time. | SELECT CAST(FLOOR(CAST(p.CreationDate AS FLOAT) / 7.0) * 7 AS DATETIME) AS postweek, SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) * 1.0 / COUNT(DISTINCT PostId) AS upvotes_per_question FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId AND FLOOR(CAST(v.CreationDate AS FLOAT) / 7.0) = FLOOR(CAST(p.CreationDat... | sede |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | what was the top five most frequent procedures for patients 20s until 2101? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND STRFTIME('%y', treatment.treatmenttime) <= '2101' GROUP BY treatment.... | eicu |
CREATE TABLE table_33136 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What result had a score of 3 0? | SELECT "Result" FROM table_33136 WHERE "Score" = '3–0' | wikisql |
CREATE TABLE zyjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
... | 之前,患者22973171有哪些异常情况? | SELECT * FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE hz_inf... | css |
CREATE TABLE table_15736385_1 (
location VARCHAR,
driver VARCHAR
) | At which location did Rick Mears drive? | SELECT location FROM table_15736385_1 WHERE driver = "Rick Mears" | sql_create_context |
CREATE TABLE table_21373283_3 (
winning_team VARCHAR,
pole_position VARCHAR,
circuit VARCHAR
) | What is the winning team at Oulton Park when Max Chilton held the pole position? | SELECT winning_team FROM table_21373283_3 WHERE pole_position = "Max Chilton" AND circuit = "Oulton Park" | sql_create_context |
CREATE TABLE table_name_80 (
date VARCHAR,
loss VARCHAR
) | What date shows a Loss of lilly (2 2)? | SELECT date FROM table_name_80 WHERE loss = "lilly (2–2)" | sql_create_context |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE station (
id INTEG... | Please give me a bar chart that bins the installation date of stations into Year interval as the X-axis, and count for showing how many stations are installed each year, and sort y-axis from low to high order please. | SELECT installation_date, COUNT(installation_date) FROM station ORDER BY COUNT(installation_date) | nvbench |
CREATE TABLE table_203_383 (
id number,
"week" number,
"date" text,
"opponent" text,
"time" text,
"game site" text,
"tv" text,
"result/score" text,
"record" text,
"bye" text
) | which opponent was the last opponent to play at the soldier field ? | SELECT "opponent" FROM table_203_383 WHERE "game site" = 'soldier field' ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | has patient 025-5947 received a hemolysis - hus diagnosis until 1 year ago? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-5947')) AND diagnosis.diagnosisname = 'hemolysis - hus' AND DATETIME(dia... | eicu |
CREATE TABLE table_204_13 (
id number,
"finished" text,
"post" number,
"horse" text,
"jockey" text,
"trainer" text,
"owner" text,
"time / behind" text
) | name of horse that came in last in the 1997 kentucky derby | SELECT "horse" FROM table_204_13 ORDER BY "finished" DESC LIMIT 1 | squall |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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 n... | 检验报告单编号为81389511365的报告组织号码以及名字是什么? | SELECT jybgb.BGJGDM, jybgb.BGJGMC FROM jybgb WHERE jybgb.BGDH = '81389511365' | css |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | People who asked more than one question. | SELECT COUNT(*) FROM Posts JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Posts.PostTypeId = 1 GROUP BY Users.Id HAVING COUNT(Posts.Id) > 1 | sede |
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 txmzjzjlb (
HXPLC number,
HZX... | 那位在门诊就诊的84220777179号病人的中医诊断编号以及名字分别是什么? | SELECT txmzjzjlb.MZZYZDZZBM, txmzjzjlb.MZZYZDZZMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '84220777179' UNION SELECT ftxmzjzjlb.MZZYZDZZBM, ftxmzjzjlb.MZZYZDZZMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '84220777179' | css |
CREATE TABLE table_19816 (
"Ido" text,
"English" text,
"Italian" text,
"French" text,
"German" text,
"Russian" text,
"Spanish" text
) | What is the Spanish word for the French word filtrer? | SELECT "Spanish" FROM table_19816 WHERE "French" = 'filtrer' | wikisql |
CREATE TABLE table_49810 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What finish has a total of more than 289 and won in 1979? | SELECT "Finish" FROM table_49810 WHERE "Total" > '289' AND "Year(s) won" = '1979' | wikisql |
CREATE TABLE table_name_87 (
points INTEGER,
engine VARCHAR,
year VARCHAR
) | What is the smallest number of points with an Engine of climax v8, and a Year of 1966? | SELECT MIN(points) FROM table_name_87 WHERE engine = "climax v8" AND year = 1966 | sql_create_context |
CREATE TABLE competition_record (
Competition_ID int,
Farm_ID int,
Rank int
)
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,
Worki... | Give the years and official names of the cities of each competition. | SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID | nvbench |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | show me the number of female patients who underwent atrial cardioversion. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.long_title = "Atrial cardioversion" | mimicsql_data |
CREATE TABLE table_42529 (
"Season" real,
"Division" text,
"Wins" real,
"Losses" real,
"Ties" real,
"Final Position" text,
"Notes" text
) | What's the average amount of ties had when a team wins 6 and it's past the 2004 season? | SELECT AVG("Ties") FROM table_42529 WHERE "Wins" = '6' AND "Season" > '2004' | wikisql |
CREATE TABLE table_name_49 (
land___sqmi__ INTEGER,
geo_id INTEGER
) | Which Land (sqmi) has a GEO ID smaller than 3800587900? | SELECT MIN(land___sqmi__) FROM table_name_49 WHERE geo_id < 3800587900 | sql_create_context |
CREATE TABLE table_11283 (
"Season Number" text,
"Premiere Date" text,
"Winner" text,
"Runner Up" text,
"2nd Runner-up" text,
"3rd Runner-up" text
) | Name the 2nd runner-up for season 7 | SELECT "2nd Runner-up" FROM table_11283 WHERE "Season Number" = 'season 7' | wikisql |
CREATE TABLE table_77597 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What game showed a home team score of 8.11 (59)? | SELECT "Date" FROM table_77597 WHERE "Home team score" = '8.11 (59)' | wikisql |
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 zyjzjlb (
CYBQDM text,
CYBQMC... | 列一下水凯复这名患者在0439258这家医院的门诊就诊记录里面被医生下的诊断不带酒精的记录 | SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '水凯复' AND hz_info.YLJGDM = '0439258' AND NOT txmzjzjlb.JZZDSM LIKE '%酒精%' UNION SELECT * FROM person_info JO... | css |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
) | How old is each student and how many students are each age? | SELECT age, COUNT(*) FROM student GROUP BY age | spider |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medication... | when has patient 027-28154 last received a procedure in 2102? | 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-28154')) AND STRFTIME('%y', treatment.treatmenttime) = '2102'... | eicu |
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, find headquarter and the average of manufacturer , and group by attribute headquarter, and visualize them by a bar chart, and order X-axis in ascending order. | SELECT Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter | nvbench |
CREATE TABLE table_name_96 (
award VARCHAR,
category VARCHAR
) | What was the award for the excellence in tamil category? | SELECT award FROM table_name_96 WHERE category = "excellence in tamil" | sql_create_context |
CREATE TABLE table_58444 (
"Date of Issue" text,
"Denomination" text,
"Design" text,
"Paper Type" text,
"First Day Cover Cancellation" text
) | What is the denomination for the stamp issued 8 January 2009? | SELECT "Denomination" FROM table_58444 WHERE "Date of Issue" = '8 january 2009' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
r... | what is the variation in the heart rate of patient 29540 measured at 2101-04-21 16:00:00 compared to the value measured at 2101-04-21 15:00:00? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29540)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'h... | mimic_iii |
CREATE TABLE table_17634 (
"State" text,
"Preliminaries" text,
"Interview" text,
"Swimsuit" text,
"Evening Gown" text,
"Average" text
) | What is the preliminary score associated with the interview score of 8.488? | SELECT COUNT("Preliminaries") FROM table_17634 WHERE "Interview" = '8.488' | wikisql |
CREATE TABLE table_79704 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
) | What's Russia's lane when they were ranked before 1? | SELECT MAX("Lane") FROM table_79704 WHERE "Nationality" = 'russia' AND "Rank" < '1' | wikisql |
CREATE TABLE table_name_58 (
record VARCHAR,
high_rebounds VARCHAR
) | What is the record when George Hill (11) had the high rebounds? | SELECT record FROM table_name_58 WHERE high_rebounds = "george hill (11)" | sql_create_context |
CREATE TABLE table_17521 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | Who was the mens doubles when womens singles is mette s rensen? | SELECT "Mens doubles" FROM table_17521 WHERE "Womens singles" = 'Mette Sørensen' | wikisql |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname... | which papers use WordNet or Dbpedia ? | SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname IN ('WordNet', 'Dbpedia') AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid GROUP BY paper.paperid | scholar |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationD... | Total Number Questions Per Tag. | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE PostTypes.Name =... | sede |
CREATE TABLE table_77290 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School" text
) | What position did a. j. feeley play who was picked in round 5? | SELECT "Position" FROM table_77290 WHERE "Round" = '5' AND "Player" = 'a. j. feeley' | wikisql |
CREATE TABLE table_25193 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the high points for mo williams , lebron james , j.j. hickson (6) | SELECT COUNT("High points") FROM table_25193 WHERE "High rebounds" = 'Mo Williams , LeBron James , J.J. Hickson (6)' | wikisql |
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... | flights from MONTREAL to LAS VEGAS | 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 = 'MONTREAL' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS V... | atis |
CREATE TABLE table_name_45 (
venue VARCHAR,
group VARCHAR
) | What venue has g1 as the group? | SELECT venue FROM table_name_45 WHERE group = "g1" | sql_create_context |
CREATE TABLE table_204_477 (
id number,
"pos" number,
"no" number,
"driver" text,
"team" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | what is the total number of drivers who did not finish the race ? | SELECT COUNT("driver") FROM table_204_477 WHERE "laps" < (SELECT MAX("laps") FROM table_204_477) | squall |
CREATE TABLE table_train_272 (
"id" int,
"fasting_plasma_glucose_fpg" float,
"creatinine_clearance_cl" float,
"baseline_hemoglobin_hgb" float,
"sensitization_on_pra" bool,
"age" float,
"NOUSE" float
) | patients must have fasting plasma glucose ( fpg ) concentrations between 7.8 mm ( 140 mg / dl ) and 15 mm ( 270 mg / dl ) on day _ 2 | SELECT * FROM table_train_272 WHERE fasting_plasma_glucose_fpg >= 7.8 AND fasting_plasma_glucose_fpg <= 15 | criteria2sql |
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
)
... | provide the number of patients whose primary disease is congestive heart failure and days of hospital stay is greater than 13? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CONGESTIVE HEART FAILURE" AND demographic.days_stay > "13" | mimicsql_data |
CREATE TABLE table_71262 (
"Rural municipality (RM)" text,
"RM No." text,
"SARM Div. No." text,
"Census Div. No." text,
"Population (2011)" real,
"Population (2006)" real,
"Change (%)" real,
"Land area (km\u00b2)" real,
"Population density (per km\u00b2)" real
) | What is the average change to have a land area of 546.74 and a population density greater than 0.5? | SELECT AVG("Change (%)") FROM table_71262 WHERE "Land area (km\u00b2)" = '546.74' AND "Population density (per km\u00b2)" > '0.5' | wikisql |
CREATE TABLE table_203_699 (
id number,
"name" text,
"parentage" text,
"size" text,
"flower colour" text,
"flower type" text
) | what is the total number of cultivars listed on the table ? | SELECT COUNT("name") FROM table_203_699 | squall |
CREATE TABLE table_name_47 (
new_zealand INTEGER,
hong_kong INTEGER
) | What is the highest New Zealand value with a Hong Kong value less than 0? | SELECT MAX(new_zealand) FROM table_name_47 WHERE hong_kong < 0 | sql_create_context |
CREATE TABLE table_70182 (
"Year" real,
"Chassis" text,
"Engine(s)" text,
"Tyres" text,
"Points" real
) | How many points were awarded to the Ford DFZ 3.5 V8? | SELECT SUM("Points") FROM table_70182 WHERE "Engine(s)" = 'ford dfz 3.5 v8' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | count the number of times patient 31880 has had a void output on 01/07/last year. | SELECT COUNT(*) 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 = 31880)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'void' AND d_items.... | mimic_iii |
CREATE TABLE table_name_10 (
episode VARCHAR,
original_artist VARCHAR,
result VARCHAR,
order__number VARCHAR
) | Which episode had Hoagy carmichael safe with an order of 5? | SELECT episode FROM table_name_10 WHERE result = "safe" AND order__number = "5" AND original_artist = "hoagy carmichael" | sql_create_context |
CREATE TABLE table_24908692_5 (
minutes INTEGER,
field_goals VARCHAR
) | What is the maximum number of minutes associated with exactly 70 field goals? | SELECT MAX(minutes) FROM table_24908692_5 WHERE field_goals = 70 | sql_create_context |
CREATE TABLE table_54532 (
"Pts Rank" text,
"Club" text,
"Appearances vs Seasons" text,
"Appearances Percetages" text,
"PPG Rank" text
) | What is the points ranking of Chicago Fire? | SELECT "Pts Rank" FROM table_54532 WHERE "Club" = 'chicago fire' | wikisql |
CREATE TABLE table_name_49 (
headquarter VARCHAR,
type VARCHAR
) | What is Headquarter, when Type is Independent Online News Portal? | SELECT headquarter FROM table_name_49 WHERE type = "independent online news portal" | sql_create_context |
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... | 根据入院诊断疾病名称,列出不同疾病的平均患者在医院4327288中年龄是多少? | SELECT t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4327288' GROUP BY t_kc21.IN_DIAG_DIS_NM | css |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 从01年4月21日至2019年8月21日之内袁雅云患者在医疗机构3211067的门诊共就诊的次数是多少? | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '袁雅云' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-04-21' AND '2019-08-21' AND wdmzjzjlb.YLJGDM = '3211067' UNI... | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what number of patients born before the the year 2056 had lab test fluid as ascites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Ascites" | mimicsql_data |
CREATE TABLE table_1045 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | Name the starter for schulte | SELECT "Starter" FROM table_1045 WHERE "Player" = 'Schulte' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId ... | Questions with accepted answer. | SELECT COUNT(Questions.Id) FROM Posts AS Questions WHERE Questions.CreationDate BETWEEN '2016-11-14' AND '2016-12-14' | sede |
CREATE TABLE table_name_47 (
club VARCHAR,
wins VARCHAR,
losses VARCHAR,
goals_for VARCHAR
) | What club has less than 10 losses, less than 55 goals, and 13 wins? | SELECT club FROM table_name_47 WHERE losses < 10 AND goals_for < 55 AND wins = 13 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | give me the number of patients whose admission type is elective and lab test name is chloride? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Chloride" | mimicsql_data |
CREATE TABLE table_1193568_1 (
election_date VARCHAR,
electorate VARCHAR
) | what's the election date where electorate is omata | SELECT election_date FROM table_1193568_1 WHERE electorate = "Omata" | sql_create_context |
CREATE TABLE table_26735 (
"Series No." real,
"Episode No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"UK Ratings (BBC2 Rank)" text,
"Original air date" text
) | Name the total number directed by for ' france : cap gris-nez to mont-saint-michel | SELECT COUNT("Directed by") FROM table_26735 WHERE "Title" = ' France : Cap Gris-Nez to Mont-Saint-Michel ' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A bar chart shows the distribution of ACC_Road and the average of School_ID , and group by attribute ACC_Road, and rank from high to low by the total number. | SELECT ACC_Road, AVG(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY AVG(School_ID) DESC | nvbench |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | what is your earliest morning flight from INDIANAPOLIS to CHARLOTTE | 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 (((flight.departure_time BETWEEN 0 AND 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND flight.to_airport = AIRPOR... | atis |
CREATE TABLE table_203_562 (
id number,
"state" text,
"no. of candidates" number,
"no. of elected" number,
"total no. of seats in assembly" number,
"year of election" number
) | who elected 17 ? | SELECT "state" FROM table_203_562 WHERE "no. of elected" = 17 | squall |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | what was the name of the drug prescribed to patient 030-53416 after having been diagnosed with hypovolemic shock in 05/2105 in the same day? | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416') AND diagnosis.diagnos... | eicu |
CREATE TABLE table_name_93 (
record VARCHAR,
score VARCHAR
) | Score of 3 - 2 had what record? | SELECT record FROM table_name_93 WHERE score = "3 - 2" | sql_create_context |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | How old is the youngest person for each job. Show the proportion. | SELECT job, MIN(age) FROM Person GROUP BY job | nvbench |
CREATE TABLE table_5054 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | On what date was Game 3? | SELECT "Date" FROM table_5054 WHERE "Game" = 'game 3' | wikisql |
CREATE TABLE table_39432 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | Who had high rebounds on May 1? | SELECT "High rebounds" FROM table_39432 WHERE "Date" = 'may 1' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.