context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_42 (
owner VARCHAR,
re_entered_service__p_ VARCHAR,
pre_conversion VARCHAR
) | Who owns the item that was a T326 before conversion and re-entered service on 11 September 1985? | SELECT owner FROM table_name_42 WHERE re_entered_service__p_ = "11 september 1985" AND pre_conversion = "t326" | sql_create_context |
CREATE TABLE table_203_424 (
id number,
"year" number,
"starts" number,
"wins" number,
"top 5" number,
"top 10" number,
"poles" number,
"avg. start" number,
"avg. finish" number,
"winnings" text,
"position" text,
"team(s)" text
) | what was his greatest number of wins in a year ? | SELECT MAX("wins") FROM table_203_424 | squall |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 患者的门诊诊断为急性支气管炎的触珠蛋白的参考值范围有哪些下限和上限? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.... | css |
CREATE TABLE table_62120 (
"Season" text,
"Competition" text,
"Round" text,
"Opponent" text,
"Home" text,
"Away" text,
"Aggregate" text
) | What season has roma as the opponent? | SELECT "Season" FROM table_62120 WHERE "Opponent" = 'roma' | wikisql |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | Show the number of delegates in each committee with a bar chart. | SELECT Committee, COUNT(Committee) FROM election GROUP BY Committee | nvbench |
CREATE TABLE table_5741 (
"Records" text,
"Pct." real,
"MRC Championships" real,
"Solo" real,
"Co-Champions" real,
"State Champions" real
) | What was the co-champions value when solo was 3 and MRC Championships is greater than 3? | SELECT "Co-Champions" FROM table_5741 WHERE "Solo" = '3' AND "MRC Championships" > '3' | wikisql |
CREATE TABLE table_20047 (
"2000 :" text,
"January" text,
"February" text,
"March" text,
"April" text,
"May" text,
"June" text,
"July" text,
"August" text,
"September" text,
"October" text,
"November" text,
"December" text
) | Name the junes | SELECT "June" FROM table_20047 | wikisql |
CREATE TABLE table_5750 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Round of 11 had waht sum of pick? | SELECT SUM("Pick") FROM table_5750 WHERE "Round" = '11' | wikisql |
CREATE TABLE table_79178 (
"Rank" real,
"Club" text,
"Season" text,
"Goals" real,
"Apps" real
) | What season was Barcelona ranked higher than 12, had more than 96 goals and had more than 26 apps? | SELECT "Season" FROM table_79178 WHERE "Apps" > '26' AND "Club" = 'barcelona' AND "Goals" > '96' AND "Rank" > '12' | wikisql |
CREATE TABLE royal_family (
royal_family_id number,
royal_family_details text
)
CREATE TABLE visits (
visit_id number,
tourist_attraction_id number,
tourist_id number,
visit_date time,
visit_details text
)
CREATE TABLE locations (
location_id number,
location_name text,
address... | Which transportation method is used the most often to get to tourist attractions? | SELECT how_to_get_there FROM tourist_attractions GROUP BY how_to_get_there ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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... | 列出患者曹安卉门诊诊断名称包含人格障碍在医院4269180中的门诊就诊记录是哪些呢? | SELECT * 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 hz_info.YLJGDM = '4269180' AND wdmzjzjlb.JZZDSM LIKE '%人格障碍%' UNION SELECT * FROM person_info JOIN... | css |
CREATE TABLE table_204_102 (
id number,
"name" text,
"location served" text,
"governorate" text,
"utilization" text,
"helipads" number,
"runways" number,
"shelters" number,
"squadrons" text,
"coordinates" text
) | does the second name have above or below 20 shelters ? | SELECT (SELECT "shelters" FROM table_204_102 WHERE id = 2) > 20 | squall |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | Does PHARMSCI 570 get taught in the Winter only ? | SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'PHARMSCI' AND course.number = 570 AND semester.semester <> 'Winter' | advising |
CREATE TABLE table_50641 (
"Rank" real,
"Company" text,
"Country" text,
"Industry" text,
"Revenue in USD" text
) | What is the rank of the petroleum company who has a revenue of $481.7 billion? | SELECT MIN("Rank") FROM table_50641 WHERE "Industry" = 'petroleum' AND "Revenue in USD" = '$481.7 billion' | wikisql |
CREATE TABLE table_2259502_2 (
partner VARCHAR,
year VARCHAR
) | Who were the partners in 2012? | SELECT partner FROM table_2259502_2 WHERE year = 2012 | sql_create_context |
CREATE TABLE table_name_53 (
programming VARCHAR,
channel VARCHAR,
psip_short_name VARCHAR
) | Which Programming has a Channel greater than 51.2 and a PSIP Short Name of kyaz-5? | SELECT programming FROM table_name_53 WHERE channel > 51.2 AND psip_short_name = "kyaz-5" | sql_create_context |
CREATE TABLE table_2916 (
"Artist" text,
"Song (English translation)" text,
"Songwriter(s)" text,
"Position" real,
"Date Eliminated" text
) | What is the position of the song that adam sandahl wrote? | SELECT "Position" FROM table_2916 WHERE "Songwriter(s)" = 'Adam Sandahl' | wikisql |
CREATE TABLE table_8157 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | Which Team 1 had a 1st leg of 0 2? | SELECT "Team 1" FROM table_8157 WHERE "1st leg" = '0–2' | 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,
... | has patient 18866 received during this hospital visit a laboratory test? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE table_204_364 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | her best time for the 1500 m was 4:04.06 in 2013 . what was her previous best time ? | SELECT MIN("notes") FROM table_204_364 WHERE "event" = 1500 AND "year" < 2013 | squall |
CREATE TABLE table_38689 (
"Career Card" text,
"Starting career/salary" text,
"2nd career/salary" text,
"3rd career/salary" text,
"4th career/salary" text,
"5th career/salary" text,
"6th career/salary" text
) | 4th career/salary of navigator ($90,000-degree) involves what 3rd career/salary? | SELECT "3rd career/salary" FROM table_38689 WHERE "4th career/salary" = 'navigator ($90,000-degree)' | wikisql |
CREATE TABLE table_76345 (
"Draw" real,
"Language" text,
"Artist" text,
"Song" text,
"English translation" text,
"Place" real,
"Points" real
) | What was the average place for the song that had 69 points and a draw smaller than 13? | SELECT AVG("Place") FROM table_76345 WHERE "Points" = '69' AND "Draw" < '13' | wikisql |
CREATE TABLE table_35824 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | what results are dated december 19? | SELECT "Results\u00b9" FROM table_35824 WHERE "Date" = 'december 19' | wikisql |
CREATE TABLE table_24108789_6 (
points VARCHAR,
reset_points VARCHAR
) | Name the total number of points for 800 reset | SELECT COUNT(points) FROM table_24108789_6 WHERE reset_points = 800 | sql_create_context |
CREATE TABLE table_16190 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | Who replaced when team is wigan athletic? | SELECT "Replaced by" FROM table_16190 WHERE "Team" = 'Wigan Athletic' | wikisql |
CREATE TABLE table_name_20 (
score VARCHAR,
high_points VARCHAR
) | What is the Score when Donyell Marshall (26) had the high points? | SELECT score FROM table_name_20 WHERE high_points = "donyell marshall (26)" | sql_create_context |
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 ... | 检验项目在检验报告单92893885398上有什么代码以及名称? | SELECT JYXMDM, JYXMMC FROM jybgb WHERE BGDH = '92893885398' | css |
CREATE TABLE table_name_37 (
total INTEGER,
silver VARCHAR,
gold VARCHAR,
bronze VARCHAR
) | How many totals have golds of 3, silvers of 3, and bronzes under 3? | SELECT SUM(total) FROM table_name_37 WHERE gold = "3" AND bronze < "3" AND silver = "3" | sql_create_context |
CREATE TABLE table_14306 (
"Rank by average" real,
"Competition finish" real,
"Couple" text,
"Total" real,
"Number of dances" real,
"Average" real
) | Name the least rank by average for number of dances less than 9 and competition finish of 5 | SELECT MIN("Rank by average") FROM table_14306 WHERE "Competition finish" = '5' AND "Number of dances" < '9' | wikisql |
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
tempor... | List the budget of each department in a bar chart, and list by the X-axis in descending. | SELECT Name, Budget_in_Billions FROM department ORDER BY Name DESC | nvbench |
CREATE TABLE table_41043 (
"Place" real,
"Rider" text,
"Country" text,
"Machine" text,
"Speed" text,
"Time" text,
"Points" real
) | What is Country , when Rider is Lindsay Porter? | SELECT "Country" FROM table_41043 WHERE "Rider" = 'lindsay porter' | wikisql |
CREATE TABLE table_65582 (
"Party" text,
"Burnley" real,
"Chorley" real,
"Fylde" real,
"Hyndburn" real,
"Lancaster" real,
"Pendle" real,
"Preston" real,
"Ribble Valley" real,
"Rossendale" real,
"South Ribble" real,
"West Lancashire" real,
"Wyre" real,
"Total" real... | How much Rossendale has a Fylde smaller than 0? | SELECT COUNT("Rossendale") FROM table_65582 WHERE "Fylde" < '0' | wikisql |
CREATE TABLE table_203_257 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number
) | what team played the last game of the 1981 season ? | SELECT "opponent" FROM table_203_257 ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_204_511 (
id number,
"number" number,
"driver" text,
"entrant" text,
"chassis" text,
"engine" text,
"tyre" text
) | who is the only driver to use a ferrari chassis ? | SELECT "driver" FROM table_204_511 WHERE "chassis" = 'ferrari' | squall |
CREATE TABLE table_name_95 (
country VARCHAR,
label VARCHAR,
catalog VARCHAR
) | Which Country has a Label of Toshiba-emi and a Catalog of vjcp-68403? | SELECT country FROM table_name_95 WHERE label = "toshiba-emi" AND catalog = "vjcp-68403" | sql_create_context |
CREATE TABLE table_27294107_11 (
semifinals VARCHAR,
athlete VARCHAR
) | How many semifinals did ferhat pehlivan attend? | SELECT COUNT(semifinals) FROM table_27294107_11 WHERE athlete = "Ferhat Pehlivan" | sql_create_context |
CREATE TABLE table_46937 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest Bronze, when Total is greater than 10, when Silver is greater than 0, and when Rank is 'Total'? | SELECT MIN("Bronze") FROM table_46937 WHERE "Total" > '10' AND "Silver" > '0' AND "Rank" = 'total' | wikisql |
CREATE TABLE table_53061 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | I want the total number of Laps for Rubens Barrichello | SELECT COUNT("Laps") FROM table_53061 WHERE "Driver" = 'rubens barrichello' | wikisql |
CREATE TABLE table_52567 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many laps were there with #9 grid? | SELECT COUNT("Laps") FROM table_52567 WHERE "Grid" = '9' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 依照科室的不同编码以及入院诊断疾病编码的区别算算医院1120246所有的记录里有民政补助的部分与总的医疗费用之比的最大值并把算出的数值由高到低来排列 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1120246' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC | css |
CREATE TABLE table_27841 (
"Settlement" text,
"Cyrillic Name Other Names" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What is the dominate religion in the location with a population of 4831? | SELECT "Dominant religion (2002)" FROM table_27841 WHERE "Population (2011)" = '4831' | wikisql |
CREATE TABLE table_204_42 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
) | when was the first season that the team was in tier 6 ? | SELECT "season" FROM table_204_42 WHERE "level" = 'tier 6' ORDER BY "season" LIMIT 1 | squall |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Participates_in (
stuid INTEGER,
... | Create a bar chart showing the total number across sex, and order by the Y-axis in desc please. | SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_36041 (
"m/v ft/s" real,
"Shell (lb)" real,
"Time to ft (m) at 25\u00b0 (seconds)" text,
"Time to ft (m) at 40\u00b0 (seconds)" real,
"Time to ft (m) at 55\u00b0 (seconds)" real,
"Max. height (ft)" real
) | What is the weight of the shell that reached its maximum height at 40 in 12.6 seconds? | SELECT "Shell (lb)" FROM table_36041 WHERE "Time to ft (m) at 40\u00b0 (seconds)" = '12.6' | wikisql |
CREATE TABLE diagnoses (
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
)
C... | provide the discharge location of edward schafer. | SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Edward Schafer" | mimicsql_data |
CREATE TABLE table_170969_2 (
census_ranking VARCHAR,
area_km_2 VARCHAR
) | What is the census ranking when the area is 78.67 ? | SELECT census_ranking FROM table_170969_2 WHERE area_km_2 = "78.67" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH te... | 门诊诊断为疾病Y80.333的病人的检测指标145181数值的平均值是多少?最值是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'Y80.333' AND jyjgzbb.JCZBDM =... | css |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
) | Visualize a bar chart for what are the different classes of races, and how many races correspond to each?, order x axis in asc order. | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class | nvbench |
CREATE TABLE table_name_34 (
haat VARCHAR,
facility_id VARCHAR
) | Which HAAT has 65944? | SELECT haat FROM table_name_34 WHERE facility_id = 65944 | sql_create_context |
CREATE TABLE enroll (
class_code text,
stu_num number,
enroll_grade text
)
CREATE TABLE professor (
emp_num number,
dept_code text,
prof_office text,
prof_extension text,
prof_high_degree text
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
... | What are the first names of the professors who do not teach a class. | SELECT emp_fname FROM employee WHERE emp_jobcode = 'PROF' EXCEPT SELECT T1.emp_fname FROM employee AS T1 JOIN class AS T2 ON T1.emp_num = T2.prof_num | spider |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | the arterial bp [systolic] of patient 12775 last measured on the current intensive care unit visit is greater than the value first measured on the current intensive care unit visit? | 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 = 12775) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... | mimic_iii |
CREATE TABLE ftxmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 在08年5月15日到08年10月14日内患者67621156所有检验结果指标记录中的检测方法是什么? | SELECT jyjgzbb.JCFF FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH... | css |
CREATE TABLE table_name_19 (
country VARCHAR,
player VARCHAR
) | What country is Adam Scott from? | SELECT country FROM table_name_19 WHERE player = "adam scott" | sql_create_context |
CREATE TABLE table_name_16 (
railway VARCHAR,
objectnumber VARCHAR
) | What is the UK Railway with an ObjectNumber of 1975-7023? | SELECT railway FROM table_name_16 WHERE objectnumber = "1975-7023" | sql_create_context |
CREATE TABLE table_70265 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Which gender has an Authority of state, Years of 1 8, and a Decile smaller than 10, and a Roll of 36? | SELECT "Gender" FROM table_70265 WHERE "Authority" = 'state' AND "Years" = '1–8' AND "Decile" < '10' AND "Roll" = '36' | wikisql |
CREATE TABLE table_name_94 (
event VARCHAR,
location VARCHAR
) | Which event is located in Northfield, Mn? | SELECT event FROM table_name_94 WHERE location = "northfield, mn" | sql_create_context |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 查询13423195病患的检验报告单中结果指标均正常的检验报告单号,需要检验报告的单号 | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '13423195' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH... | css |
CREATE TABLE table_name_62 (
car__number INTEGER,
points VARCHAR,
laps VARCHAR,
make VARCHAR
) | What is the car number that has less than 369 laps for a Dodge with more than 49 points? | SELECT SUM(car__number) FROM table_name_62 WHERE laps < 369 AND make = "dodge" AND points > 49 | sql_create_context |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
... | please list all flights on UA out of DENVER before 1200 | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE (city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND flight.departure_time < 1200 AND flight.from_airport = airport_service.airport_code) AND flight.airline_code = 'UA' | atis |
CREATE TABLE table_10470082_4 (
director VARCHAR,
writer VARCHAR
) | Who is the director of the episode whom Scott Peters is the writer? | SELECT director FROM table_10470082_4 WHERE writer = "Scott Peters" | sql_create_context |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Is Dr. Jennifer Hardacker teaching any classes next semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Jennifer Hardacker%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructo... | advising |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport... | show me flights from SAN FRANCISCO to MINNEAPOLIS | 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_name_95 (
country VARCHAR,
place VARCHAR,
score VARCHAR
) | What county placed t2 and scored 68-69-68-72=277? | SELECT country FROM table_name_95 WHERE place = "t2" AND score = 68 - 69 - 68 - 72 = 277 | sql_create_context |
CREATE TABLE table_name_68 (
loss VARCHAR,
record VARCHAR
) | Which loss has a Record of 54-39? | SELECT loss FROM table_name_68 WHERE record = "54-39" | sql_create_context |
CREATE TABLE table_44322 (
"Position" real,
"Driver / Passenger" text,
"Equipment" text,
"Bike No" real,
"Points" real
) | What were highest points received from someone using a zabel-wsp with a position greater than 7? | SELECT MAX("Points") FROM table_44322 WHERE "Equipment" = 'zabel-wsp' AND "Position" > '7' | wikisql |
CREATE TABLE happy_hour (
HH_ID int,
Shop_ID int,
Month text,
Num_of_shaff_in_charge int
)
CREATE TABLE shop (
Shop_ID int,
Address text,
Num_of_staff text,
Score real,
Open_Year text
)
CREATE TABLE member (
Member_ID int,
Name text,
Membership_card text,
Age int,
... | Find the address and staff number of the shops that do not have any happy hour Visualize by bar chart, and order by the X-axis in desc. | SELECT Address, Num_of_staff FROM shop WHERE NOT Shop_ID IN (SELECT Shop_ID FROM happy_hour) ORDER BY Address DESC | nvbench |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | What are the NAVSCI classes needed to graduate as a CS major ? | SELECT DISTINCT course.department, course.name, course.number FROM program_course INNER JOIN course ON program_course.course_id = course.course_id WHERE course.department = 'NAVSCI' | advising |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose drug name is repaglinide? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Repaglinide" | mimicsql_data |
CREATE TABLE table_25711913_2 (
touchdowns INTEGER,
position VARCHAR
) | How many touchdowns did the left guard took? | SELECT MAX(touchdowns) FROM table_25711913_2 WHERE position = "Left guard" | sql_create_context |
CREATE TABLE table_44400 (
"Rnd." text,
"Pick #" real,
"NFL team" text,
"Pos." text,
"College" text,
"Conf." text
) | What draft pick number attended syracuse and was drafted by the Carolina panthers? | SELECT SUM("Pick #") FROM table_44400 WHERE "NFL team" = 'carolina panthers' AND "College" = 'syracuse' | wikisql |
CREATE TABLE table_20745746_1 (
attendance INTEGER,
date VARCHAR
) | What was attendance on March 11, 1995? | SELECT MIN(attendance) FROM table_20745746_1 WHERE date = "March 11, 1995" | sql_create_context |
CREATE TABLE table_63805 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the rank when the time is 6:50.48? | SELECT "Rank" FROM table_63805 WHERE "Time" = '6:50.48' | wikisql |
CREATE TABLE table_26122 (
"Represent" text,
"Contestant" text,
"Age" real,
"Height (ft.)" text,
"Height (mtr.)" text,
"Hometown" text
) | How many contestants where from mitteldeutschland? | SELECT COUNT("Age") FROM table_26122 WHERE "Represent" = 'Mitteldeutschland' | wikisql |
CREATE TABLE table_name_97 (
name VARCHAR,
roll VARCHAR
) | Which name has a Roll of 270? | SELECT name FROM table_name_97 WHERE roll = 270 | sql_create_context |
CREATE TABLE table_name_90 (
player VARCHAR,
position VARCHAR,
school_club_team VARCHAR
) | Who was the center from Washington State? | SELECT player FROM table_name_90 WHERE position = "center" AND school_club_team = "washington state" | sql_create_context |
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
) | Return a bar chart showing how many members have visited for each college location, and could you sort bar in desc order? | SELECT College_Location, COUNT(College_Location) FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID GROUP BY College_Location ORDER BY College_Location DESC | nvbench |
CREATE TABLE table_35160 (
"Congress" text,
"Bill number(s)" text,
"Date introduced" text,
"Sponsor(s)" text,
"# of cosponsors" real,
"Latest status" text
) | What Congress had less than 23 cosponsors and had June 30, 2005 as the date of introduction of the bill? | SELECT "Congress" FROM table_35160 WHERE "# of cosponsors" < '23' AND "Date introduced" = 'june 30, 2005' | wikisql |
CREATE TABLE table_name_6 (
points INTEGER,
match INTEGER
) | What is the smallest number of points for a match less than 12? | SELECT MIN(points) FROM table_name_6 WHERE match < 12 | sql_create_context |
CREATE TABLE table_64217 (
"Rank" real,
"Athletes" text,
"Country" text,
"Time" text,
"Notes" text
) | What are the Notes of the Athletes from Germany? | SELECT "Notes" FROM table_64217 WHERE "Country" = 'germany' | wikisql |
CREATE TABLE device (
device_id number,
device text,
carrier text,
package_version text,
applications text,
software_platform text
)
CREATE TABLE stock (
shop_id number,
device_id number,
quantity number
)
CREATE TABLE shop (
shop_id number,
shop_name text,
location tex... | Show names of shops and the carriers of devices they have in stock. | SELECT T3.shop_name, T2.carrier FROM stock AS T1 JOIN device AS T2 ON T1.device_id = T2.device_id JOIN shop AS T3 ON T1.shop_id = T3.shop_id | spider |
CREATE TABLE table_8859 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | WHAT PICK HAD STEVE HAMILTON IN ROUND LARGER THAN 2? | SELECT COUNT("Pick") FROM table_8859 WHERE "Name" = 'steve hamilton' AND "Round" > '2' | wikisql |
CREATE TABLE table_57892 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | What is the Score with a Home with hornets? | SELECT "Score" FROM table_57892 WHERE "Home" = 'hornets' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX num... | 在门诊诊断为疾病T69.925的这些患者的籍贯代码、名称都是什么以及相应人数是多少? | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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 ... | css |
CREATE TABLE table_53448 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score of the away team when hawthorn was the home team? | SELECT "Away team score" FROM table_53448 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_name_9 (
to_par VARCHAR,
player VARCHAR
) | What was Todd Hamilton's to par? | SELECT to_par FROM table_name_9 WHERE player = "todd hamilton" | sql_create_context |
CREATE TABLE table_53081 (
"Height (m.)" text,
"No. of times visited" real,
"No. of HC climbs" real,
"First time as HC climb" real,
"Most recent" real
) | When was the first HC climb which, more recently than 2012, had more than 1 HC climbs, more than 29 times visited? | SELECT SUM("First time as HC climb") FROM table_53081 WHERE "No. of HC climbs" > '1' AND "No. of times visited" > '29' AND "Most recent" > '2012' | wikisql |
CREATE TABLE table_1231892_4 (
production_code VARCHAR,
us_air_date VARCHAR
) | what's the total number of episodes with a US air date of january 15, 2005? | SELECT COUNT(production_code) FROM table_1231892_4 WHERE us_air_date = "January 15, 2005" | sql_create_context |
CREATE TABLE table_71435 (
"Name" text,
"Species/Authority" text,
"Order" text,
"Family" text,
"Red List" real
) | which order of bat belongs to the family of vespertilionidae and includes the northern long-eared myotis? | SELECT "Order" FROM table_71435 WHERE "Family" = 'vespertilionidae' AND "Name" = 'northern long-eared myotis' | wikisql |
CREATE TABLE table_36696 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text,
"TV Time" text
) | What was the TV time for Chicago's road game against Phoenix on June 18? | SELECT "TV Time" FROM table_36696 WHERE "Road Team" = 'phoenix' AND "Date" = 'june 18' | wikisql |
CREATE TABLE table_17178 (
"Name of ground" text,
"Location" text,
"Year" text,
"FC matches" real,
"LA matches" real,
"T20 matches" real,
"Total" real
) | What is the maximum fc matches? | SELECT MAX("FC matches") FROM table_17178 | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 门诊给患者67854437诊断为疾病N63.585,那检测指标342923的结果定量及单位是什么 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON 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_MZJZJLB AND jybgb.YLJGDM = jyjgzbb... | css |
CREATE TABLE table_name_55 (
matches INTEGER,
points VARCHAR,
goals VARCHAR
) | What are the highest matches that have points less than 88, and goals less than 0? | SELECT MAX(matches) FROM table_name_55 WHERE points < 88 AND goals < 0 | sql_create_context |
CREATE TABLE table_14921 (
"Station" text,
"Frequency" real,
"Network Affiliation" text,
"Format" text,
"City of License" text,
"Status" text
) | Which format has a Station of klok? | SELECT "Format" FROM table_14921 WHERE "Station" = 'klok' | wikisql |
CREATE TABLE table_72775 (
"Season" text,
"Air date" real,
"Winner" text,
"Runner-up" text,
"Third place" text,
"Host(s)" text,
"Judges" text,
"Winning mentor" text
) | Who was the runner-up in season five? | SELECT "Runner-up" FROM table_72775 WHERE "Season" = 'Five' | wikisql |
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 * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE table_70665 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | what is the engine that saw a Chassis of porsche 718, and 0 points, prior to 1964? | SELECT "Engine" FROM table_70665 WHERE "Chassis" = 'porsche 718' AND "Points" = '0' AND "Year" < '1964' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inpute... | what are the five most common microbiology tests for patients that received lt heart angiocardiogram previously within 2 months? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | give the maximum age for patients who speak english and were diagnosed with morbid obesity/sda. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "MORBID OBESITY/SDA" | mimicsql_data |
CREATE TABLE table_60808 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text
) | What is the average first elected for the district South Carolina 2? | SELECT AVG("First elected") FROM table_60808 WHERE "District" = 'south carolina 2' | wikisql |
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 prescriptions... | count the number of patients whose admission type is emergency and lab test name is lymphs? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Lymphs" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.