context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_20 ( total_assists VARCHAR, games VARCHAR, rank VARCHAR )
How many assists for player(s) with over 107 games and ranked less than 2?
SELECT COUNT(total_assists) FROM table_name_20 WHERE games > 107 AND rank < 2
sql_create_context
CREATE TABLE table_36601 ( "Date" text, "Home Team" text, "Score" text, "Visiting Team" text, "Stadium" text )
Which home team played on January 5, 2008?
SELECT "Home Team" FROM table_36601 WHERE "Date" = 'january 5, 2008'
wikisql
CREATE TABLE table_name_89 ( neon VARCHAR, argon VARCHAR )
What neon has an Argon of 4.203?
SELECT neon FROM table_name_89 WHERE argon = "4.203"
sql_create_context
CREATE TABLE Parties_in_Events ( Party_ID INTEGER, Event_ID INTEGER, Role_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance_ID INTEGER, Location_ID INTEGER ) CREATE TABLE Products ( Product_ID INTEG...
List the number of the names of products that are not in any event, I want to display in ascending by the X-axis.
SELECT Product_Name, COUNT(Product_Name) FROM Products WHERE NOT Product_ID IN (SELECT Product_ID FROM Products_in_Events) GROUP BY Product_Name ORDER BY Product_Name
nvbench
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...
编号为98899980007的患者看病时就诊的科室编码和名称都是什么啊?
SELECT zzmzjzjlb.JZKSBM, zzmzjzjlb.JZKSMC FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '98899980007' UNION SELECT fzzmzjzjlb.JZKSBM, fzzmzjzjlb.JZKSMC FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '98899980007'
css
CREATE TABLE table_name_60 ( winning_score VARCHAR, tournament VARCHAR )
What was the winning score for the Andy Williams-San Diego Open Invitational tournament?
SELECT winning_score FROM table_name_60 WHERE tournament = "andy williams-san diego open invitational"
sql_create_context
CREATE TABLE table_204_756 ( id number, "year" number, "team" text, "games" number, "combined tackles" number, "tackles" number, "assisted tackles" number, "sacks" number, "forced fumbles" number, "fumble recoveries" number, "fumble return yards" number, "interceptions" n...
how many years did he play where he did not recover a fumble ?
SELECT COUNT("year") FROM table_204_756 WHERE "fumble recoveries" = 0
squall
CREATE TABLE table_name_58 ( japanese_title VARCHAR, tv_station VARCHAR, romaji_title VARCHAR )
Which Japanese Title has a TV Station of tbs, and a Romaji Title of hana yori dango?
SELECT japanese_title FROM table_name_58 WHERE tv_station = "tbs" AND romaji_title = "hana yori dango"
sql_create_context
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,...
编号是81127906647的医疗就诊所对应的门诊号或住院号都是多少呢?
SELECT CLINIC_ID FROM t_kc21 WHERE MED_CLINIC_ID = '81127906647'
css
CREATE TABLE table_27926 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
How many yes votes did the measure that got 60.39% yes votes get?
SELECT "YES votes" FROM table_27926 WHERE "% YES" = '60.39%'
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 maximum age of patients whose primary disease is bowel obstruction and admission year is greater than or equal to 2133?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.admityear >= "2133"
mimicsql_data
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
For a course in which a student minoring in CMPLXSYS has gotten a C+ , which professor has taught it ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec...
advising
CREATE TABLE table_12197 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What is the total for a to par bigger than 7 and a player of al geiberger?
SELECT COUNT("Total") FROM table_12197 WHERE "Player" = 'al geiberger' AND "To par" > '7'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
what are the three most frequent drugs prescribed to the seizures - suspected female patients 30s within 2 months after having been diagnosed with seizures - suspected until 2103?
SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'seizures - suspected' AND STRFTIME('%y', diagnosis...
eicu
CREATE TABLE artist ( artist_name varchar2(50), country varchar2(20), gender varchar2(20), preferred_genre varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist_name varchar2(50), country varchar2(20), f_id number(10), genre_is varchar2(20), rating number(10), la...
how many songs were released for each format?, and could you order by the y-axis in asc please?
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY COUNT(*)
nvbench
CREATE TABLE table_54607 ( "Player" text, "Tackles" real, "Asst." real, "TotalTK" real, "Sack" real, "Yards" real, "FumR" real )
what is the total sack when totaltk is 1 and asst. is more than 0?
SELECT SUM("Sack") FROM table_54607 WHERE "TotalTK" = '1' AND "Asst." > '0'
wikisql
CREATE TABLE table_76052 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the event average for a top-25 smaller than 0?
SELECT AVG("Events") FROM table_76052 WHERE "Top-25" < '0'
wikisql
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 is the number of patients whose insurance is medicaid and procedure long title is (aorto)coronary bypass of three coronary arteries?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "(Aorto)coronary bypass of three coronary arteries"
mimicsql_data
CREATE TABLE table_40005 ( "Name" text, "Date of Birth" text, "Height" real, "Weight" real, "Spike" real, "Block" real )
What is Average Height, when Weight is less than 93, when Spike is less than 336, and when Block is 305?
SELECT AVG("Height") FROM table_40005 WHERE "Weight" < '93' AND "Spike" < '336' AND "Block" = '305'
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...
how many patients died in or before the year 2155 and procedured with icd9 code 45?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2155.0" AND procedures.icd9_code = "45"
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,...
78850813555的医疗就诊中病人总共开出的药品编码和名称,以及金额请一一列出来,把金额最少的药品删掉,其余按金额从高到低排列
SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, AMOUNT FROM t_kc22 WHERE MED_CLINIC_ID = '78850813555' AND AMOUNT > (SELECT MIN(AMOUNT) FROM t_kc22 WHERE MED_CLINIC_ID = '78850813555') ORDER BY AMOUNT DESC
css
CREATE TABLE table_name_47 ( birth VARCHAR, ceased_to_be_queen VARCHAR )
What is the birth date of the woman who ceased to be Queen on 18 Jun 1297?
SELECT birth FROM table_name_47 WHERE ceased_to_be_queen = "18 jun 1297"
sql_create_context
CREATE TABLE table_12663 ( "Club" text, "League" text, "Sport" text, "Established" text, "Championships" real )
Which Established has a Club of guelph rangers?
SELECT "Established" FROM table_12663 WHERE "Club" = 'guelph rangers'
wikisql
CREATE TABLE table_9868 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Points" real )
What score had a record of 17 18 6?
SELECT "Score" FROM table_9868 WHERE "Record" = '17–18–6'
wikisql
CREATE TABLE t ( Id VARCHAR )
What college did the T who was pick after 13 go to?
SELECT college FROM t AS able_name_20 WHERE pick__number > 13 AND position = "t"
sql_create_context
CREATE TABLE table_59152 ( "Aircraft" text, "1990" real, "destroyed" real, "damaged" real, "to Iran" real, "survived" real )
What's the to Iran with fewer than 9 survivors, more than 3 damaged, and an ussr an-26 aircraft?
SELECT AVG("to Iran") FROM table_59152 WHERE "survived" < '9' AND "Aircraft" = 'ussr an-26' AND "damaged" > '3'
wikisql
CREATE TABLE table_204_51 ( id number, "week #" text, "theme" text, "song choice" text, "original artist" text, "order #" number, "result" text )
is the order # of top 10 more than that of top 7 ?
SELECT (SELECT "order #" FROM table_204_51 WHERE "week #" = 'top 10') > (SELECT "order #" FROM table_204_51 WHERE "week #" = 'top 7')
squall
CREATE TABLE table_71635 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
How many tries for does waunarlwydd rfc have ?
SELECT "Tries for" FROM table_71635 WHERE "Club" = 'waunarlwydd rfc'
wikisql
CREATE TABLE table_2226817_2 ( original_air_date VARCHAR, production_code VARCHAR )
What is the original air date for the production code of 1.12?
SELECT original_air_date FROM table_2226817_2 WHERE production_code = "1.12"
sql_create_context
CREATE TABLE table_8808 ( "Class" text, "Wheel arrangement" text, "Fleet number(s)" text, "Manufacturer" text, "Year made" text, "Quantity made" text, "Quantity preserved" text )
How many did alco -schenectady preserve of class b-3?
SELECT "Quantity preserved" FROM table_8808 WHERE "Manufacturer" = 'alco -schenectady' AND "Class" = 'b-3'
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, ...
在21年8月25日到21年9月5日期间,患者马璇珠曾到医院看过几次病
SELECT (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 '2021-08-25' AND '2021-09-05' UNION SELECT COUNT(*) FROM p...
css
CREATE TABLE table_18410 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
what's incumbent with district being tennessee 5
SELECT "Incumbent" FROM table_18410 WHERE "District" = 'Tennessee 5'
wikisql
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...
为韩飞双这个患者在05年4月12日到12年6月12日内检测过尿素的医务人员工号及姓名分别是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jy...
css
CREATE TABLE table_1342233_5 ( incumbent VARCHAR, district VARCHAR )
How many incumbents had a district of Arkansas 3?
SELECT COUNT(incumbent) FROM table_1342233_5 WHERE district = "Arkansas 3"
sql_create_context
CREATE TABLE table_62753 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What nationality has 1:55.35 as the time?
SELECT "Nationality" FROM table_62753 WHERE "Time" = '1:55.35'
wikisql
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
Votes on pending tags synonyms.
SELECT ts.CreationDate, tt.TagName, st.TagName, v.VoteTypeId, v.UserId AS "user_link", v.CreationDate, ts.Score FROM TagSynonyms AS ts INNER JOIN Votes AS v ON v.PostId = ts.Id INNER JOIN Tags AS st ON st.TagName = ts.SourceTagName INNER JOIN Tags AS tt ON tt.TagName = ts.TargetTagName WHERE ts.ApprovalDate IS NULL ORD...
sede
CREATE TABLE person_info_hz_info ( RYBH text, KH number, KLX number, YLJGDM number ) 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, JSB...
列出在医院0319489中患者43810325名称不包含关节的出院科室住院就诊记录有什么?
SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND person_info_hz_i...
css
CREATE TABLE table_name_11 ( year VARCHAR, label VARCHAR )
what year was cryptogramophon released
SELECT year FROM table_name_11 WHERE label = "cryptogramophon"
sql_create_context
CREATE TABLE news_report ( Name VARCHAR, journalist_ID VARCHAR ) CREATE TABLE journalist ( Name VARCHAR, journalist_ID VARCHAR )
List the names of journalists who have not reported any event.
SELECT Name FROM journalist WHERE NOT journalist_ID IN (SELECT journalist_ID FROM news_report)
sql_create_context
CREATE TABLE table_8710 ( "Developer(s)" text, "Release date" text, "Required OS" text, "Payment" text, "Type" text )
Which Release date has a Type of 2d?
SELECT "Release date" FROM table_8710 WHERE "Type" = '2d'
wikisql
CREATE TABLE store_product ( store_id number, product_id number ) 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...
For each type of store, how many of them are there?
SELECT type, COUNT(*) FROM store GROUP BY type
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
what is maximum age of patients whose death status is 0 and discharge location is dead/expired?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "DEAD/EXPIRED"
mimicsql_data
CREATE TABLE Genre ( GenreId integer, Name varchar(120) ) CREATE TABLE Album ( AlbumId integer, Title varchar(160), ArtistId integer ) CREATE TABLE InvoiceLine ( InvoiceLineId integer, InvoiceId integer, TrackId integer, UnitPrice decimal(10,2), Quantity integer ) CREATE TABLE...
What are the first names and support rep ids for employees serving 10 or more customers.
SELECT T1.FirstName, T1.SupportRepId FROM Customer AS T1 JOIN Employee AS T2 ON T1.SupportRepId = T2.EmployeeId
nvbench
CREATE TABLE roles ( role_code text, role_name text, role_description text ) CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employee_id number, planned_destruction_date time, actual_destruction_date time, other...
What is the code of each role and the number of employees in each role?
SELECT role_code, COUNT(*) FROM employees GROUP BY role_code
spider
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
看看在02年7月20日到12年4月8日期间,医院8578851的购药医疗记录合计数
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8578851' AND t_kc21.IN_HOSP_DATE BETWEEN '2002-07-20' AND '2012-04-08' AND t_kc21.CLINIC_TYPE = '购药'
css
CREATE TABLE table_name_63 ( region VARCHAR, catalog VARCHAR )
In what Region is Catalog number 885 380-1?
SELECT region FROM table_name_63 WHERE catalog = "885 380-1"
sql_create_context
CREATE TABLE table_name_45 ( attendance INTEGER, date VARCHAR, week VARCHAR )
What is the highest attendance for the game before week 13 on December 9, 1973?
SELECT MAX(attendance) FROM table_name_45 WHERE date = "december 9, 1973" AND week < 13
sql_create_context
CREATE TABLE table_name_93 ( races INTEGER, pole VARCHAR, season VARCHAR )
WHAT ARE THE RACES WITH A POLE SMALLER THAN 2 IN 2007?
SELECT MIN(races) FROM table_name_93 WHERE pole < 2 AND season = "2007"
sql_create_context
CREATE TABLE txmzjzjlb ( 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, MZZYZDZ...
哪位患者在门诊就诊中开出编码为04680290185检验报告单?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb 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 AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '0...
css
CREATE TABLE table_name_79 ( year INTEGER, entrant VARCHAR )
How many years has Sasol Jordan Yamaha as an Entrant?
SELECT AVG(year) FROM table_name_79 WHERE entrant = "sasol jordan yamaha"
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...
患者葛星光医保的个人账户总共被花了多少,时间是从11年4月5日到20年7月4日
SELECT SUM(t_kc24.PER_ACC_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '葛星光' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-04-05' AND '2020-07-04'
css
CREATE TABLE table_name_49 ( builder VARCHAR, ship VARCHAR )
The Zeehond was built by whom?
SELECT builder FROM table_name_49 WHERE ship = "zeehond"
sql_create_context
CREATE TABLE table_name_83 ( total_receipts VARCHAR, candidate VARCHAR )
How many receipts does Mike Gravel have?
SELECT total_receipts FROM table_name_83 WHERE candidate = "mike gravel"
sql_create_context
CREATE TABLE table_name_7 ( team VARCHAR, run_4 VARCHAR )
Which team had a run 4 of 1:24.4?
SELECT team FROM table_name_7 WHERE run_4 = "1:24.4"
sql_create_context
CREATE TABLE table_name_28 ( bronze INTEGER, nation VARCHAR, silver VARCHAR )
Which Bronze has a Nation of argentina, and a Silver smaller than 0?
SELECT AVG(bronze) FROM table_name_28 WHERE nation = "argentina" AND silver < 0
sql_create_context
CREATE TABLE table_204_62 ( id number, "year" number, "winner" text, "second" text, "third" text, "starters" number )
who won after arazi ?
SELECT "winner" FROM table_204_62 WHERE "year" > (SELECT "year" FROM table_204_62 WHERE "winner" = 'arazi') ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_38272 ( "NTFA Div 2" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
Which Byes have an Against smaller than 1647, and an NTFA Div 2 of fingal valley, and Wins smaller than 14?
SELECT MAX("Byes") FROM table_38272 WHERE "Against" < '1647' AND "NTFA Div 2" = 'fingal valley' AND "Wins" < '14'
wikisql
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Return a bar chart about the distribution of Name and Height , list from high to low by the bars.
SELECT Name, Height FROM people ORDER BY Name DESC
nvbench
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, ...
ground transportation in DALLAS and BOSTON
SELECT DISTINCT ground_service.transport_type FROM city AS CITY_0, city AS CITY_1, ground_service WHERE (ground_service.city_code = CITY_0.city_code AND CITY_0.city_name = 'DALLAS') OR (ground_service.city_code = CITY_1.city_code AND CITY_1.city_name = 'BOSTON')
atis
CREATE TABLE table_55021 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
How many Reg GP does daniel rahimi have with a rd # greater than 3?
SELECT COUNT("Reg GP") FROM table_55021 WHERE "Player" = 'daniel rahimi' AND "Rd #" > '3'
wikisql
CREATE TABLE table_27293285_4 ( points VARCHAR, tries_for VARCHAR )
Name the total number of points for 46 tries for
SELECT COUNT(points) FROM table_27293285_4 WHERE tries_for = "46"
sql_create_context
CREATE TABLE table_53099 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
Who was the home team at the Nuggets game that had a score of 116 105?
SELECT "Home" FROM table_53099 WHERE "Score" = '116–105'
wikisql
CREATE TABLE table_24081 ( "Medal of Honor" text, "Coast Guard Cross" text, "Navy Cross" text, "Distinguished Service Cross" text, "Air Force Cross" text, "Homeland Security Distinguished Service Medal" text )
WHat is the Homeland security distinguished service medal when the medal of honor is Coast guard Medal?
SELECT "Homeland Security Distinguished Service Medal" FROM table_24081 WHERE "Medal of Honor" = 'Coast Guard Medal'
wikisql
CREATE TABLE table_18106841_1 ( year INTEGER, winners__percentage_votes VARCHAR )
What year was the winners vote 55.99%?
SELECT MIN(year) FROM table_18106841_1 WHERE winners__percentage_votes = "55.99%"
sql_create_context
CREATE TABLE table_61919 ( "Rank:" real, "Prime Minister:" text, "Party:" text, "Assumed Office:" text, "Left Office:" text, "TOTAL Time in Office:" text )
What is the total time in office of the prime minister from the liberal party and left office in 19 December 1967?
SELECT "TOTAL Time in Office:" FROM table_61919 WHERE "Party:" = 'liberal' AND "Left Office:" = '19 december 1967'
wikisql
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 ...
Who in the past has taught ARTDES 223 ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
advising
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
number of active users er month.
SELECT Week, COUNT(n_posts) FROM (SELECT COUNT(Id) AS n_posts, 1.000 * TIME_TO_STR(CreationDate, '%Y') + 1.000 * TIME_TO_STR(CreationDate, '%W') / 52 AS Week, OwnerUserId FROM Posts WHERE PostTypeId = 2 AND (1.000 * TIME_TO_STR(CreationDate, '%Y') + 1.000 * TIME_TO_STR(CreationDate, '%W') / 52 < 1.000 * TIME_TO_STR(CUR...
sede
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 drug type of subject name jerry deberry?
SELECT demographic.dob, prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Jerry Deberry"
mimicsql_data
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...
how many patients whose diagnoses short title is subendo infarct, initial and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Subendo infarct, initial" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_34341 ( "Score" text, "Opposition" text, "Venue" text, "City" text, "Year" real )
What city has riverside ground as the venue, with a year prior to 1998?
SELECT "City" FROM table_34341 WHERE "Venue" = 'riverside ground' AND "Year" < '1998'
wikisql
CREATE TABLE table_2260452_1 ( date VARCHAR, driver VARCHAR )
What was the date if the driver was Robert Pressley?
SELECT date FROM table_2260452_1 WHERE driver = "Robert Pressley"
sql_create_context
CREATE TABLE table_27366772_3 ( district VARCHAR, armenian VARCHAR )
What district is known in Armenian as - ?
SELECT district FROM table_27366772_3 WHERE armenian = "Քանաքեր-Զեյթուն"
sql_create_context
CREATE TABLE table_10875694_11 ( publisher VARCHAR, product_no VARCHAR )
What publishers produce product number SLUS-20265?
SELECT publisher FROM table_10875694_11 WHERE product_no = "SLUS-20265"
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...
医疗记录中医院0869256的出院诊断,统计其急性支气管炎的最低和最高医疗费总数目都是多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '0869256' AND t_kc21.OUT_DIAG_DIS_NM = '急性支气管炎')
css
CREATE TABLE table_name_13 ( score VARCHAR, time VARCHAR )
Which Score has a Time of 5:00pm?
SELECT score FROM table_name_13 WHERE time = "5:00pm"
sql_create_context
CREATE TABLE table_name_77 ( lane INTEGER, heat VARCHAR, name VARCHAR )
How many lanes have 2 as the heat, and susanna kallur as the name?
SELECT SUM(lane) FROM table_name_77 WHERE heat = 2 AND name = "susanna kallur"
sql_create_context
CREATE TABLE table_1507852_5 ( attribute VARCHAR, cancelable VARCHAR )
what's the attribute with cancelable being yes
SELECT attribute FROM table_1507852_5 WHERE cancelable = "Yes"
sql_create_context
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
知道62013127这个病人住了多少次院吗?在2000年3月7日到2015年6月1日的这段时间里
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_NM = '62013127' AND zyb.IN_HOSP_DAYS BETWEEN '2000-03-07' AND '2015-06-01'
css
CREATE TABLE table_name_31 ( airport VARCHAR, iata VARCHAR )
Which airport's IATA is pen?
SELECT airport FROM table_name_31 WHERE iata = "pen"
sql_create_context
CREATE TABLE table_21258_1 ( natural_increase VARCHAR, births VARCHAR )
where births is 388 000 how many number is natural increase
SELECT COUNT(natural_increase) FROM table_21258_1 WHERE births = "388 000"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE diagnoses_icd ( ...
for the last time during this year, when did patient 31306 get admitted via emergency room admit to the hospital?
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 31306 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number...
what was the three most frequent specimen test performed until 2102?
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents WHERE STRFTIME('%y', microbiologyevents.charttime) <= '2102' GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 3
mimic_iii
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varch...
Find the relationship between minimum and average gpa of all students in each department with a scatter chart grouping by department code.
SELECT AVG(STU_GPA), MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE
nvbench
CREATE TABLE table_59959 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What status has 15/04/1967 as the date?
SELECT "Status" FROM table_59959 WHERE "Date" = '15/04/1967'
wikisql
CREATE TABLE table_12024 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the name of the away team when the home team score is 7.12 (54)?
SELECT "Away team" FROM table_12024 WHERE "Home team score" = '7.12 (54)'
wikisql
CREATE TABLE table_50233 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the score of player bill rogers?
SELECT "Score" FROM table_50233 WHERE "Player" = 'bill rogers'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
what is the number of patients whose insurance is private and admission year is less than 2165?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admityear < "2165"
mimicsql_data
CREATE TABLE table_name_2 ( home VARCHAR, points VARCHAR )
What home has 46 points?
SELECT home FROM table_name_2 WHERE points = 46
sql_create_context
CREATE TABLE table_name_61 ( duration VARCHAR, end_time VARCHAR )
What is the duration of the flight with end time of 21:06?
SELECT duration FROM table_name_61 WHERE end_time = "21:06"
sql_create_context
CREATE TABLE table_42996 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
Which Position has a Years in Orlando of 1997 1998?
SELECT "Position" FROM table_42996 WHERE "Years in Orlando" = '1997–1998'
wikisql
CREATE TABLE table_32462 ( "Name" text, "City" text, "Years as tallest" text, "Metres" real, "Feet" real, "Floors" real )
How many metres tall is the building that is larger than 850 feet tall?
SELECT "Metres" FROM table_32462 WHERE "Feet" > '850'
wikisql
CREATE TABLE table_name_18 ( attendance INTEGER, date VARCHAR )
What was the total attendance October 22, 1972?
SELECT SUM(attendance) FROM table_name_18 WHERE date = "october 22, 1972"
sql_create_context
CREATE TABLE table_name_95 ( record VARCHAR, week VARCHAR )
What is the Record for week 12?
SELECT record FROM table_name_95 WHERE week = 12
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
从零七年三月十六号到四月二十八这段时间内医院3795332所有的医疗记录里个人账户的花费比上总的医疗费用的平均比值
SELECT AVG(t_kc24.PER_ACC_PAY / t_kc24.MED_AMOUT) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '3795332' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2007-03-16' AND '2007-04-28'
css
CREATE TABLE table_42153 ( "Location" text, "Aircraft" text, "Tail number" text, "Aircraft damage" text, "Fatalities" text )
What type of aircraft was the plane with a tail number of ya-bao?
SELECT "Aircraft" FROM table_42153 WHERE "Tail number" = 'ya-bao'
wikisql
CREATE TABLE table_39226 ( "Year" real, "Dates" text, "Champion" text, "Country" text, "Score" text, "To par" text, "Margin of victory" text )
Which To par has a Year of 1994?
SELECT "To par" FROM table_39226 WHERE "Year" = '1994'
wikisql
CREATE TABLE table_22675 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
What was the record on the game played on July 1?
SELECT "Record" FROM table_22675 WHERE "Date" = 'July 1'
wikisql
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Draw a bar chart for what is minimum age for different job title?, and display job in asc order.
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY job
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( ...
what were the four most frequent drugs that were prescribed in the same month to the pneumonia - aspiration female patients aged 30s after having been diagnosed with pneumonia - aspiration, since 2103.
SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'pneumonia - aspiration' AND STRFTIME('%y', diagnos...
eicu
CREATE TABLE table_name_13 ( date VARCHAR, opponent VARCHAR, game_site VARCHAR, week VARCHAR )
Game site of shea stadium, and a Week smaller than 10, and a Opponent of baltimore colts happened on what date?
SELECT date FROM table_name_13 WHERE game_site = "shea stadium" AND week < 10 AND opponent = "baltimore colts"
sql_create_context