context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE T...
Top 30 Users with most upvotes. Top 20 Users with most upvotes/day to their answers to non-CW posts in the last 30 days
SELECT SUM(UpVotes) AS upv, SUM(DownVotes) AS downv FROM Users ORDER BY upv DESC LIMIT 30
sede
CREATE TABLE table_16799784_3 ( latitude VARCHAR, longitude VARCHAR )
At a longitude of 321.9e, what is the latitude of the features found?
SELECT latitude FROM table_16799784_3 WHERE longitude = "321.9E"
sql_create_context
CREATE TABLE table_name_52 ( year VARCHAR, distance VARCHAR )
In what year saw a total distance of 1,870.23 km?
SELECT year FROM table_name_52 WHERE distance = "1,870.23 km"
sql_create_context
CREATE TABLE table_name_52 ( date VARCHAR, home_team VARCHAR )
When did the Wolverhampton Wanderers play at home?
SELECT date FROM table_name_52 WHERE home_team = "wolverhampton wanderers"
sql_create_context
CREATE TABLE table_933 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" real )
what is the minimum attendance with record being 4 6
SELECT MIN("Attendance") FROM table_933 WHERE "Record" = '4–6'
wikisql
CREATE TABLE table_63139 ( "Position" real, "Team" text, "Played" real, "Wins" real, "Draws P.K. Wins / P.K. Losses" text, "Losses" real, "Scored" real, "Conceded" real, "Points" real )
How many Points have a Position larger than 4, and Losses larger than 5, and a Conceded of 15, and a Scored larger than 11?
SELECT COUNT("Points") FROM table_63139 WHERE "Position" > '4' AND "Losses" > '5' AND "Conceded" = '15' AND "Scored" > '11'
wikisql
CREATE TABLE table_name_92 ( points VARCHAR, tries_against VARCHAR )
When the tries against is 90 how many points are there?
SELECT points FROM table_name_92 WHERE tries_against = "90"
sql_create_context
CREATE TABLE table_10665 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the Time/Retired for Grid 6?
SELECT "Time/Retired" FROM table_10665 WHERE "Grid" = '6'
wikisql
CREATE TABLE table_37259 ( "Name" text, "Number" real, "From" text, "Length (km)" real, "Length (mi)" real )
What's the shortest length from north klondike highway that has a length less than 326?
SELECT MIN("Length (km)") FROM table_37259 WHERE "Name" = 'north klondike highway' AND "Length (mi)" < '326'
wikisql
CREATE TABLE table_9582 ( "Year" real, "Lijsttrekker" text, "Fractievoorzitter" text, "Cabinet" text, "Chair" text )
What is Fractievoorzitter, when Lijsttrekker is 'No Elections', and when Year is after 2005?
SELECT "Fractievoorzitter" FROM table_9582 WHERE "Lijsttrekker" = 'no elections' AND "Year" > '2005'
wikisql
CREATE TABLE table_23486853_7 ( score VARCHAR, date VARCHAR )
What scores happened on February 9?
SELECT score FROM table_23486853_7 WHERE date = "February 9"
sql_create_context
CREATE TABLE table_25529 ( "Name" text, "Platform" text, "License" text, "Windows builders" text, "Java builders" text, "Other builders" text, "SCM system" text, "Notification" text, "IDE Integration" text, "Other Integration" text )
Name the windows builders for apache gump
SELECT "Windows builders" FROM table_25529 WHERE "Name" = 'Apache Gump'
wikisql
CREATE TABLE table_203_420 ( id number, "#" number, "stadium" text, "capacity" number, "city" text, "home team" text )
which stadium can hold more people than ballymena showgrounds , but less than windsor park ?
SELECT "stadium" FROM table_203_420 WHERE "capacity" > (SELECT "capacity" FROM table_203_420 WHERE "stadium" = 'ballymena showgrounds') AND "capacity" < (SELECT "capacity" FROM table_203_420 WHERE "stadium" = 'windsor park')
squall
CREATE TABLE table_name_90 ( college VARCHAR, name VARCHAR, round VARCHAR, overall VARCHAR )
Which college's round is more than 4, when the overall is less than 237 and Ted Cottrell was the name?
SELECT college FROM table_name_90 WHERE round > 4 AND overall < 237 AND name = "ted cottrell"
sql_create_context
CREATE TABLE district ( district_id number, district_name text, headquartered_city text, city_population number, city_area number ) CREATE TABLE product ( product_id number, product text, dimensions text, dpi number, pages_per_minute_color number, max_page_size text, int...
What city is the headquarter of the store Blackville?
SELECT t3.headquartered_city FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.store_name = "Blackville"
spider
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 ftxmzjzjlb ( HXPLC number, HZ...
在2007年7月16日到2020年8月1日内,医院5860255有几个科室在门诊就诊中开出不超过19张检验报告单?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM txmzjzjlb JOIN jybgb ON txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE txmzjzjlb.YLJGDM = '5860255' AND jybgb.BGRQ BETWEEN '2007-07-16' AND '2020-08-01' GROUP BY jybgb.KSBM HAVING COUNT(*) < 19 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb ...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugsto...
what is the name of the allergy which patient 003-17096 has in 12/this year?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-17096')) AND DATETIME(allergy.allergytime, 'start of year') = DATETIM...
eicu
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
How many of the patients with icd9 code 3761 have an unspecified death status?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3761"
mimicsql_data
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, what is the relationship between code and manufacturer , and group by attribute name?
SELECT T1.Code, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
检验报告单36585431258是哪个患者住院就诊中开出的
SELECT hz_info.person_info_XM FROM hz_info JOIN zyjzjlb JOIN jybgb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB WHERE jybgb.BGDH = '36585431258'
css
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 ...
查查胸腹水白蛋白(白蛋白)数值的平均值以及最值,是针对门诊诊断为疾病C89.828的患者的
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) 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.YLJ...
css
CREATE TABLE table_name_21 ( place VARCHAR, money___$__ VARCHAR )
What place did the player that took won $350 finish in?
SELECT place FROM table_name_21 WHERE money___$__ = 350
sql_create_context
CREATE TABLE table_name_68 ( result VARCHAR, date VARCHAR )
Tell me the result of july 16, 2000
SELECT result FROM table_name_68 WHERE date = "july 16, 2000"
sql_create_context
CREATE TABLE table_name_53 ( name VARCHAR, games VARCHAR )
Which Name has Games of 105?
SELECT name FROM table_name_53 WHERE games = 105
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
在医院3470456中科室名有变态反应这几个字的就诊科室的门诊中,有哪些是病患范秀逸的就诊记录流水号
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '范秀逸' AND hz_info.YLJGDM = '3470456' AND mzjzjlb.JZKSMC LIKE '%变态反应%'
css
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description...
Top 300 users from Romania.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%arad%romania%' ORDER BY Reputation DESC LIMIT 300
sede
CREATE TABLE table_35859 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Name the top-10 with top-5 less than 1
SELECT "Top-10" FROM table_35859 WHERE "Top-5" < '1'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give me the number of patients whose admission location is emergency room admit and diagnoses icd9 code is 52809?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.icd9_code = "52809"
mimicsql_data
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_cit...
For all storms with at least 1 death, compare the number of deaths by name.
SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1
nvbench
CREATE TABLE table_41253 ( "Class" text, "Quantity" real, "Manufacturer" text, "Motor" text, "Seats" real )
Which motor's class was bs 1910?
SELECT "Motor" FROM table_41253 WHERE "Class" = 'bs 1910'
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 demographic (...
provide the number of patients whose procedure icd9 code is 4610 and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4610" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_58735 ( "Name" text, "Total" real, "First" text, "Last" text, "Highest rank" text )
What rank is Takat riki?
SELECT "Highest rank" FROM table_58735 WHERE "Name" = 'takatōriki'
wikisql
CREATE TABLE table_name_96 ( safari VARCHAR, firefox VARCHAR )
What percentage of users were using Safari during the period in which 30.82% were using Firefox?
SELECT safari FROM table_name_96 WHERE firefox = "30.82%"
sql_create_context
CREATE TABLE table_25942 ( "SF Round" real, "Country" text, "Location" text, "Date" text, "Driver" text, "Race 1(pts)" real, "Race 2(pts)" real, "Race Total(pts)" real )
Who is every driver for the location of Estoril Circuit?
SELECT "Driver" FROM table_25942 WHERE "Location" = 'Estoril Circuit'
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...
Create a bar chart showing all_games_percent across all neutral, sort by the y axis from high to low.
SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC
nvbench
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
what are the three most frequently given diagnoses for patients who have been diagnosed with cellulitis - abdomen/pelvis before in the same month, since 2105?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cellulitis - abdomen/pelvis' AND STRFTIM...
eicu
CREATE TABLE table_71177 ( "Player" text, "Country" text, "Caps" real, "Goals" text, "Years Active" text, "Years at Club" text )
What is the greatest number of caps for Bruce Djite?
SELECT MAX("Caps") FROM table_71177 WHERE "Player" = 'bruce djite'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose admission type is emergency and ethnicity is american indian/alaska native?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE"
mimicsql_data
CREATE TABLE table_26411 ( "Season" text, "Name" text, "Teams" real, "Relegated to league" text, "Promoted to league" text, "Promoted from league" text, "Relegated from league" text )
Who was promoted to the league when Coventry was relegated to the league?
SELECT "Promoted to league" FROM table_26411 WHERE "Relegated to league" = 'Coventry'
wikisql
CREATE TABLE table_59758 ( "Player" text, "Draft" text, "Round" real, "Pick" real, "Position" text, "NFL Club" text )
Which NFL Club has a Player of sam tidmore, and a Pick of 81?
SELECT "NFL Club" FROM table_59758 WHERE "Player" = 'sam tidmore' AND "Pick" = '81'
wikisql
CREATE TABLE table_43572 ( "Result" text, "TUF Competitor" text, "Opponent" text, "Method" text, "Event" text, "Date" text )
when is the opponent lyoto machida?
SELECT "Date" FROM table_43572 WHERE "Opponent" = 'lyoto machida'
wikisql
CREATE TABLE table_38756 ( "Couple" text, "Score" text, "Style" text, "Music" text, "Result" text )
Which music is jive?
SELECT "Music" FROM table_38756 WHERE "Style" = 'jive'
wikisql
CREATE TABLE table_name_79 ( frequency VARCHAR, sspec_number VARCHAR )
What is the frequency of the processor with an sSpec number of sl3bn(kc0)sl3e9(kc0)?
SELECT frequency FROM table_name_79 WHERE sspec_number = "sl3bn(kc0)sl3e9(kc0)"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
不低于10岁的病患的医疗记录的医疗费总额是多少?计算出平均值
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE >= 10 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE >= 10 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE >= 10 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PER...
css
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...
医院1343392给54049149这个病人开过单价最高的药是什么?查一下药品名称、编码及单价
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '54049149' AND gwyjzb.MED_SER_ORG_NO = '1343392' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '54049149' AND fg...
css
CREATE TABLE table_22638 ( "Years covered" text, "All bills sponsored" real, "All amendments sponsored" real, "All bills cosponsored" real, "All amendments cosponsored" real, "Bills originally cosponsored" real, "Amendments originally cosponsored" real )
How many bill cosponsored during those years where bills originally cosponsored is 113?
SELECT "All bills cosponsored" FROM table_22638 WHERE "Bills originally cosponsored" = '113'
wikisql
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
What is the number of countries in the artist table?, and I want to rank how many country in descending order.
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY COUNT(Country) DESC
nvbench
CREATE TABLE table_name_82 ( year_signed VARCHAR, year_separated VARCHAR, chinese_name VARCHAR )
What was the signed year for the Chinese name who separated in 1987?
SELECT year_signed FROM table_name_82 WHERE year_separated = "1987" AND chinese_name = "蘇永康"
sql_create_context
CREATE TABLE table_2026548_1 ( explanation VARCHAR, vice_president VARCHAR )
Name the explanation for alben w. barkley
SELECT explanation FROM table_2026548_1 WHERE vice_president = "Alben W. Barkley"
sql_create_context
CREATE TABLE table_204_451 ( id number, "component" text, "model 01" text, "model 01+" text, "model 02" text, "model e2" text, "model 2+ (pre-production)" text, "model 03 (china copy)" text )
what component comes after bluetooth ?
SELECT "component" FROM table_204_451 WHERE id = (SELECT id FROM table_204_451 WHERE "component" = 'bluetooth') + 1
squall
CREATE TABLE table_71392 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the lowest rank of Jens Kruppa in a lane larger than 2?
SELECT MIN("Rank") FROM table_71392 WHERE "Name" = 'jens kruppa' AND "Lane" > '2'
wikisql
CREATE TABLE table_18516 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
For the Republican party what are the names of the incumbents?
SELECT "Incumbent" FROM table_18516 WHERE "Party" = 'Republican'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospita...
when they visited the hospital last time, has patient 033-250 received any medication?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-250' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho...
eicu
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jo...
Are there any courses on UM Chemistry Program at Peking University , Beijing for 17 credits ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%UM Chemistry Program at Peking University , Beijing%' OR name LIKE '%UM Chemistry Program at Peking University , Beijing%') AND credits = 17
advising
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, find founder and the sum of price , and group by attribute founder, and visualize them by a bar chart, and order by the y-axis in descending.
SELECT Founder, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Price) DESC
nvbench
CREATE TABLE table_46821 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the to par of player john buczek, who has a t9 place and is from the United States?
SELECT "To par" FROM table_46821 WHERE "Place" = 't9' AND "Country" = 'united states' AND "Player" = 'john buczek'
wikisql
CREATE TABLE table_37185 ( "Ship" text, "Hull No." text, "Builder" text, "Home Port" text, "Commissioned\u2013 Decommissioned" text, "NVR page" text )
Name the ship with hull number of aor-6
SELECT "Ship" FROM table_37185 WHERE "Hull No." = 'aor-6'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
how many patients whose admission type is newborn and admission location is transfer from hosp/extram?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM"
mimicsql_data
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
List the Human Physiology-Laboratory courses worth 3 credits .
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Human Physiology-Laboratory%' OR name LIKE '%Human Physiology-Laboratory%') AND credits = 3
advising
CREATE TABLE table_76607 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is stanford's average overall?
SELECT AVG("Overall") FROM table_76607 WHERE "College" = 'stanford'
wikisql
CREATE TABLE table_name_90 ( venue VARCHAR, winner VARCHAR )
where did marie-laure taya win?
SELECT venue FROM table_name_90 WHERE winner = "marie-laure taya"
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...
氟哌啶醇片(糖衣)卖出的总数量及总金额分别有多少,在07年10月4日到2014年10月3日期间?
SELECT SUM(t_kc22.QTY), SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '氟哌啶醇片(糖衣)' AND t_kc22.STA_DATE BETWEEN '2007-10-04' AND '2014-10-03'
css
CREATE TABLE table_25276528_2 ( title VARCHAR, directed_by VARCHAR )
What title did Bill Foster direct ?
SELECT title FROM table_25276528_2 WHERE directed_by = "Bill Foster"
sql_create_context
CREATE TABLE table_75454 ( "Round" text, "Date" text, "Matches" real, "Clubs" text, "New entries this round" text, "Prize money" text )
How many new entries this round have clubs 2 1?
SELECT "New entries this round" FROM table_75454 WHERE "Clubs" = '2 → 1'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is the number of patients whose ethnicity is american indian/alaska native and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
炙远志颗粒在医疗就诊46764459204中的医疗机构三大目录编码及名称分别是是什么?
SELECT MED_DIRE_CD, MED_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '46764459204' AND SOC_SRT_DIRE_NM = '炙远志颗粒'
css
CREATE TABLE table_204_582 ( id number, "model" text, "launch" text, "code name" text, "fab (nm)" number, "bus interface" text, "memory (mib)" text, "core clock (mhz)" number, "memory clock (mhz)" number, "config core1" text, "fillrate\nmoperations/s" number, "fillrate\nm...
what is the last model ?
SELECT "model" FROM table_204_582 ORDER BY id 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...
list the top four most frequent medications that patients have been prescribed in the same hospital encounter after being diagnosed with upper urinary tract infection since 2100.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'upper urinary t...
eicu
CREATE TABLE actor ( last_name VARCHAR )
How many different last names do the actors and actresses have?
SELECT COUNT(DISTINCT last_name) FROM actor
sql_create_context
CREATE TABLE table_204_111 ( id number, "name" text, "animal type" text, "introduced" number, "reintroduced" text, "retired" number, "beanie baby resembled" text )
how many total pillow pals were both reintroduced and retired in 1999 ?
SELECT COUNT("name") FROM table_204_111 WHERE "reintroduced" = 1999 AND "retired" = 1999
squall
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, m...
what LIMOUSINE service in TORONTO
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'TORONTO' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'LIMOUSINE'
atis
CREATE TABLE table_68544 ( "2001" text, "2004" text, "2009" text, "2013" text, "Total" real )
What is the year 2001 with a total larger than 1, and 2009 with 8?
SELECT "2001" FROM table_68544 WHERE "Total" > '1' AND "2009" = '8'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREA...
How much reputation would we get in commie SO?.
SELECT SUM(Reputation) / COUNT(*) AS Average_rep FROM Users WHERE Reputation > 100
sede
CREATE TABLE table_name_87 ( country VARCHAR, finish VARCHAR )
Which country has a finish of t22?
SELECT country FROM table_name_87 WHERE finish = "t22"
sql_create_context
CREATE TABLE table_29583818_3 ( place VARCHAR, couple VARCHAR )
How many times is the couple laura and colin?
SELECT COUNT(place) FROM table_29583818_3 WHERE couple = "Laura and Colin"
sql_create_context
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB 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...
在2001年7月25日到2011年5月8日内患者41398120就诊医生有多少个?
SELECT COUNT(mzjzjlb.ZZYSGH) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '41398120' AND mzjzjlb.JZKSRQ BETWEEN '2001-07-25' AND '2011-05-08'
css
CREATE TABLE table_name_29 ( draws INTEGER, losses VARCHAR, club VARCHAR, against VARCHAR, wins VARCHAR )
What's the smallest draw of Warrnambool when the against was less than 1299, more than 7 wins, and less than 2 losses?
SELECT MIN(draws) FROM table_name_29 WHERE against < 1299 AND wins > 7 AND club = "warrnambool" AND losses < 2
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...
what is date of birth and admission time of subject name fernando wontor?
SELECT demographic.dob, demographic.admittime FROM demographic WHERE demographic.name = "Fernando Wontor"
mimicsql_data
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 ...
门诊诊断患者吕华美患有复发性抑郁障碍,548921检测指标的结果定量是什么?对应的单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND...
css
CREATE TABLE table_79722 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What are the most bronze medals in a rank more than 1 with a total larger than 3?
SELECT MAX("Bronze") FROM table_79722 WHERE "Total" > '3' AND "Rank" > '1'
wikisql
CREATE TABLE table_52239 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the method for the resolution of nc where the fight lasted less than 3 rounds?
SELECT "Method" FROM table_52239 WHERE "Round" < '3' AND "Res." = 'nc'
wikisql
CREATE TABLE table_name_98 ( score VARCHAR, date VARCHAR )
What is the score on december 10?
SELECT score FROM table_name_98 WHERE date = "december 10"
sql_create_context
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
编号17340163122的医疗就诊需要住院多久
SELECT IN_HOSP_DAYS FROM t_kc21 WHERE MED_CLINIC_ID = '17340163122'
css
CREATE TABLE table_28914 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Which party experienced a result of lost re-election democratic-republican hold?
SELECT "Party" FROM table_28914 WHERE "Result" = 'Lost re-election Democratic-Republican hold'
wikisql
CREATE TABLE table_44157 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text )
Which player went to Wake Forest and was selected with a pick after 145?
SELECT "Player" FROM table_44157 WHERE "Pick" > '145' AND "College" = 'wake forest'
wikisql
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 diagnoses ( ...
How many of the patients with colangitis as their primary disease died in or before the year 2186?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COLANGITIS" AND demographic.dod_year <= "2186.0"
mimicsql_data
CREATE TABLE table_16185956_1 ( district VARCHAR )
Who are the candidates in Washington 1 district?
SELECT 2008 AS _candidates FROM table_16185956_1 WHERE district = "Washington 1"
sql_create_context
CREATE TABLE table_15463188_7 ( name VARCHAR, school_club_team VARCHAR )
Name the name of the state
SELECT name FROM table_15463188_7 WHERE school_club_team = "State"
sql_create_context
CREATE TABLE table_name_26 ( venue VARCHAR, home_team VARCHAR )
What is the venue where the melbourne tigers play their home games?
SELECT venue FROM table_name_26 WHERE home_team = "melbourne tigers"
sql_create_context
CREATE TABLE table_name_54 ( front_side_bus VARCHAR, model_number VARCHAR )
What is the Front Side Bus for Model Number c3 850?
SELECT front_side_bus FROM table_name_54 WHERE model_number = "c3 850"
sql_create_context
CREATE TABLE table_name_35 ( score INTEGER, country VARCHAR, player VARCHAR )
What was Craig Stadler's lowest score for United states?
SELECT MIN(score) FROM table_name_35 WHERE country = "united states" AND player = "craig stadler"
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 diagnoses ( ...
count the number of patients whose discharge location is disc-tran cancer/chldrn h and procedure icd9 code is 8604?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" AND procedures.icd9_code = "8604"
mimicsql_data
CREATE TABLE screen_mode ( graphics_mode number, char_cells text, pixels text, hardware_colours number, used_kb number, map text, type text ) CREATE TABLE chip_model ( model_name text, launch_year number, ram_mib number, rom_mib number, slots text, wifi text, blu...
What is maximum and minimum RAM size of phone produced by company named 'Nokia Corporation'?
SELECT MAX(T1.ram_mib), MIN(T1.ram_mib) FROM chip_model AS T1 JOIN phone AS T2 ON T1.model_name = T2.chip_model WHERE T2.company_name = "Nokia Corporation"
spider
CREATE TABLE table_16078390_2 ( primary_conference VARCHAR, institution VARCHAR )
What conference does Gonzaga University play in?
SELECT primary_conference FROM table_16078390_2 WHERE institution = "Gonzaga University"
sql_create_context
CREATE TABLE table_35183 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text )
March of 26 has what lowest game?
SELECT MIN("Game") FROM table_35183 WHERE "March" = '26'
wikisql
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paper ( pape...
Papers written by daniel a. epstein
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'daniel a. epstein' AND writes.authorid = author.authorid
scholar
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,...
自二零零二年十月九日开始,截止到二零一一年八月一日,患者53365571的主治医生是哪位
SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '53365571' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-10-09' AND '2011-08-01' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE table_20704243_6 ( title VARCHAR, original_air_date VARCHAR )
Which episode aired on august19,2012?
SELECT title FROM table_20704243_6 WHERE original_air_date = "August19,2012"
sql_create_context
CREATE TABLE table_27721131_2 ( high_rebounds VARCHAR, location_attendance VARCHAR )
Who's in the high rebounds in the verizon center 9,263 location attendance?
SELECT high_rebounds FROM table_27721131_2 WHERE location_attendance = "Verizon Center 9,263"
sql_create_context
CREATE TABLE table_train_26 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "allergy_to_penicillin" bool, "active_infection" bool, "allergy_to_cephalosporin" bool, "receiving_anticoagulants" bool, "age" float, "NOUSE" float )
known allergy or sensitivity to penicillin or cephalosporin
SELECT * FROM table_train_26 WHERE allergy_to_penicillin = 1 OR allergy_to_cephalosporin = 1
criteria2sql