context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_68632 ( "Year" text, "Record" text, "Finish" text, "Manager" text, "Playoffs" text )
Name the record for 1997
SELECT "Record" FROM table_68632 WHERE "Year" = '1997'
wikisql
CREATE TABLE table_2331549_1 ( second_place VARCHAR, champion VARCHAR )
Who came in second place when the champion was south dakota school of mines & technology?
SELECT second_place FROM table_2331549_1 WHERE champion = "South Dakota School of Mines & Technology"
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...
科室31515因疾病W23.015产生的住院平均费用有多少在2008年6月11日至2013年3月29日之间?
SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_ORG_DEPT_NM = '31515' AND zyb.IN_HOSP_DAYS BETWEEN '2008-06-11' AND '2013-03-29' AND zyb.IN_DIAG_DIS_NM = 'W23.015'
css
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,...
医疗就诊16196458812诊断的疾病编号是什么?名称是什么?
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '16196458812'
css
CREATE TABLE table_1886270_1 ( built VARCHAR, withdrawn VARCHAR )
When 2/1939 is the withdrawn when was it built?
SELECT built FROM table_1886270_1 WHERE withdrawn = "2/1939"
sql_create_context
CREATE TABLE table_name_74 ( husband VARCHAR, image VARCHAR )
Who was the husband of marie of baden-sponheim?
SELECT husband FROM table_name_74 WHERE image = "marie of baden-sponheim"
sql_create_context
CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, Region_name text ) CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Nu...
How many regions were affected by each storm Visualize by bar chart, and rank from high to low by the y-axis.
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_59479 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
Who was the away team at the game attended by 81?
SELECT "Away team" FROM table_59479 WHERE "Attendance" = '81'
wikisql
CREATE TABLE table_name_25 ( winners VARCHAR, venue VARCHAR )
Who won at Kr ko?
SELECT winners FROM table_name_25 WHERE venue = "krško"
sql_create_context
CREATE TABLE table_37036 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real, "Finish" text )
Total larger than 285, and a Finish of t30 belongs to what player?
SELECT "Player" FROM table_37036 WHERE "Total" > '285' AND "Finish" = 't30'
wikisql
CREATE TABLE accounts ( account_id number, customer_id number, account_name text, other_account_details text ) CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date ...
What are the valid from and valid to dates for the card with the number 4560596484842?
SELECT date_valid_from, date_valid_to FROM customers_cards WHERE card_number = "4560596484842"
spider
CREATE TABLE table_204_743 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
what was jenson button 's time ?
SELECT "time/retired" FROM table_204_743 WHERE "driver" = 'jenson button'
squall
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 Course ( CID VARCHAR(7), CName VARCHAR(40), Credits INTEGER, Instructor INTEGER, Days VARCHAR(...
A bar chart for finding the number of the last name of female (sex is F) students in the descending order of age.
SELECT LName, COUNT(LName) FROM Student WHERE Sex = "F" GROUP BY LName ORDER BY Age DESC
nvbench
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 aged below 61 had hypothyroidism nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "61" AND diagnoses.short_title = "Hypothyroidism NOS"
mimicsql_data
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
what is the cheapest one way fare from PITTSBURGH to ATLANTA traveling on tuesday august twentieth
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
atis
CREATE TABLE table_name_44 ( chassis VARCHAR, engine VARCHAR, year VARCHAR )
What chassis did the porsche flat-4 use before 1958?
SELECT chassis FROM table_name_44 WHERE engine = "porsche flat-4" AND year < 1958
sql_create_context
CREATE TABLE table_256286_61 ( _percentage_yes VARCHAR, yes_votes VARCHAR )
What is the percentage of yes when there were 218846 yes votes
SELECT _percentage_yes FROM table_256286_61 WHERE yes_votes = 218846
sql_create_context
CREATE TABLE table_77965 ( "Rank" real, "Rmax Rpeak ( Pflops )" text, "Name" text, "Vendor" text, "Operating system" text )
What is the rank of Rmax Rpeak ( Pflops ) of 17.173 20.133?
SELECT AVG("Rank") FROM table_77965 WHERE "Rmax Rpeak ( Pflops )" = '17.173 20.133'
wikisql
CREATE TABLE table_name_65 ( location VARCHAR, school VARCHAR )
WHere is the friends' school?
SELECT location FROM table_name_65 WHERE school = "the friends' school"
sql_create_context
CREATE TABLE procedures ( 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, ...
count the number of patients whose diagnosis icd9 code is 53081 and lab test category is hematology.
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.icd9_code = "53081" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_76715 ( "Week" text, "Theme" text, "Artist" text, "Order sung" text, "Status" text )
What order was the performance of a Richard Marx song?
SELECT "Order sung" FROM table_76715 WHERE "Artist" = 'richard marx'
wikisql
CREATE TABLE table_63261 ( "HR Number" real, "Name" text, "LMS Number" real, "BR number" text, "Withdrawn" text )
Which BR number has an LMS number over 14768?
SELECT "BR number" FROM table_63261 WHERE "LMS Number" > '14768'
wikisql
CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text ) CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int )
Compare each editors' ages using a bar chart, sort by the x axis in ascending.
SELECT Name, Age FROM editor ORDER BY Name
nvbench
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 death status is 0 and procedure short title is regional lymph node exc?
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.short_title = "Regional lymph node exc"
mimicsql_data
CREATE TABLE table_51537 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What was the score on August 8?
SELECT "Score" FROM table_51537 WHERE "Date" = 'august 8'
wikisql
CREATE TABLE table_name_47 ( icb_sector VARCHAR, ticker_symbol VARCHAR )
Which ICB Sector had a ticker symbol of pp?
SELECT icb_sector FROM table_name_47 WHERE ticker_symbol = "pp"
sql_create_context
CREATE TABLE table_name_62 ( rank VARCHAR, time VARCHAR )
What rank did the time of 7:31.90 receive?
SELECT COUNT(rank) FROM table_name_62 WHERE time = "7:31.90"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_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 ti...
on their last hospital visit what was the marital status of patient 25461?
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 25461 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_72 ( director VARCHAR, title VARCHAR, platform_s_ VARCHAR, year VARCHAR )
Who was the director of Battalion Wars 2 which was released on GCN after 2004?
SELECT director FROM table_name_72 WHERE platform_s_ = "gcn" AND year > 2004 AND title = "battalion wars 2"
sql_create_context
CREATE TABLE table_17143 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years for Rockets" text, "School/Club Team/Country" text )
What is the position for the player that played in 2006?
SELECT "Position" FROM table_17143 WHERE "Years for Rockets" = '2006'
wikisql
CREATE TABLE table_27700530_15 ( location_attendance VARCHAR, game VARCHAR )
What was the location and attendance for game 2?
SELECT location_attendance FROM table_27700530_15 WHERE game = 2
sql_create_context
CREATE TABLE table_28298589_4 ( result VARCHAR, home_team VARCHAR )
What was the final score of Washington's home game?
SELECT result FROM table_28298589_4 WHERE home_team = "Washington"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
on the current hospital encounter, count the number of drugs that patient 032-9230 had been prescribed.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230' AND patient.hospitaldischargetime IS NULL))
eicu
CREATE TABLE table_name_22 ( record VARCHAR, attendance VARCHAR )
What was the team's record at the game attended by 30,452?
SELECT record FROM table_name_22 WHERE attendance = "30,452"
sql_create_context
CREATE TABLE personfriend ( name text, friend text, year number ) CREATE TABLE person ( name text, age number, city text, gender text, job text )
What are the different names and ages of every friend of either Dan or alice?
SELECT DISTINCT T1.name, T1.age FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice'
spider
CREATE TABLE table_name_55 ( winner VARCHAR, trofeo_fast_team VARCHAR, stage VARCHAR )
who is the winner when the trofeo fast team is carrera jeans-vagabond in stage 5?
SELECT winner FROM table_name_55 WHERE trofeo_fast_team = "carrera jeans-vagabond" AND stage = "5"
sql_create_context
CREATE TABLE table_26434 ( "No. by series" real, "No. by season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production number" real, "U.S. viewers (in millions)" text )
What episode was watched by 10.81 million US viewers?
SELECT MIN("No. by season") FROM table_26434 WHERE "U.S. viewers (in millions)" = '10.81'
wikisql
CREATE TABLE table_name_53 ( date VARCHAR, result VARCHAR )
What is the date of the game with a result of W 13-10?
SELECT date FROM table_name_53 WHERE result = "w 13-10"
sql_create_context
CREATE TABLE table_name_89 ( stolen_ends INTEGER, ends_lost INTEGER )
Name the average Stolen Ends which has an Ends Lost smaller than 35?
SELECT AVG(stolen_ends) FROM table_name_89 WHERE ends_lost < 35
sql_create_context
CREATE TABLE table_11589522_3 ( title VARCHAR, original_air_date VARCHAR )
what's the title where original air date is january18,2009
SELECT title FROM table_11589522_3 WHERE original_air_date = "January18,2009"
sql_create_context
CREATE TABLE table_name_91 ( country VARCHAR, to_par VARCHAR )
For the player finishing at +8, what is his nationality?
SELECT country FROM table_name_91 WHERE to_par = "+8"
sql_create_context
CREATE TABLE table_27277284_28 ( model_number VARCHAR, order_part_number VARCHAR )
What is the model number for the order part numbered tmrm75dam22gg?
SELECT model_number FROM table_27277284_28 WHERE order_part_number = "TMRM75DAM22GG"
sql_create_context
CREATE TABLE table_68201 ( "Team" text, "City" text, "Stadium" text, "Manager" text, "Past season" text )
what city has a past season of n/a?
SELECT "City" FROM table_68201 WHERE "Past season" = 'n/a'
wikisql
CREATE TABLE table_name_11 ( performer_3 VARCHAR, performer_4 VARCHAR )
Who was the 3rd performer when Rory Bremner was the 4th performer?
SELECT performer_3 FROM table_name_11 WHERE performer_4 = "rory bremner"
sql_create_context
CREATE TABLE table_name_76 ( company VARCHAR, release_date VARCHAR )
Who is the company that released the album on 2008-09-18 18 September 2008?
SELECT company FROM table_name_76 WHERE release_date = "2008-09-18 18 september 2008"
sql_create_context
CREATE TABLE table_204_13 ( id number, "finished" text, "post" number, "horse" text, "jockey" text, "trainer" text, "owner" text, "time / behind" text )
name of horse that finished first in the 1997 kentucky derby
SELECT "horse" FROM table_204_13 WHERE "finished" = 1
squall
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, ...
what is patient 19428's maximum arterial bp [systolic] at on this month/27?
SELECT MAX(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 = 19428)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE table_name_39 ( mecha VARCHAR, japanese_voice_actor VARCHAR )
What is the Mecha of the Japanese voice actor Shingo Kanemoto?
SELECT mecha FROM table_name_39 WHERE japanese_voice_actor = "shingo kanemoto"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
列出在08年4月2日到10年8月17日内患者云文石全部检验结果指标记录中的仪器名称以及编号都是什么啊?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHE...
css
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id...
what tests are the four most frequently ordered lab tests in this year?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY labevents.itemid) AS t1...
mimic_iii
CREATE TABLE table_51901 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
Which school has a Player of donte greene?
SELECT "School" FROM table_51901 WHERE "Player" = 'donte greene'
wikisql
CREATE TABLE table_204_73 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text )
number of games in which the starzz scored at most 59 points
SELECT COUNT(*) FROM table_204_73 WHERE "score" <= 59
squall
CREATE TABLE table_16304 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
Who directed El Nido?
SELECT "Director" FROM table_16304 WHERE "Original title" = 'El nido'
wikisql
CREATE TABLE table_name_41 ( year_born__age_ VARCHAR, current_club VARCHAR, position VARCHAR )
Which Year born (Age) has a Current Club of sporting al riyadi beirut, and a Position of pf?
SELECT year_born__age_ FROM table_name_41 WHERE current_club = "sporting al riyadi beirut" AND position = "pf"
sql_create_context
CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE game ( ...
Show me a scatter chart for how many games has each stadium held?
SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id
nvbench
CREATE TABLE fzzmzjzjlb ( 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...
曹斌蔚这个病人在2013年12月22日以前在哪些门诊做过检验报告?查一下这些门诊就诊的流水号
SELECT zzmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '曹斌蔚' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2013-12-2...
css
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE month ( ...
show me the flights from PITTSBURGH to SAN FRANCISCO
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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN...
atis
CREATE TABLE table_28268 ( "Model" text, "Launch" text, "Code name" text, "Transistors (million)" real, "Die size (mm 2 )" real, "Bus interface" text, "Memory ( MB )" text, "SM count" real, "Core config 1,3" text, "Core ( MHz )" real, "Shader ( MHz )" real, "Memory ( MHz ...
How many die sizes have a texture of exactly 34?
SELECT COUNT("Die size (mm 2 )") FROM table_28268 WHERE "Texture ( GT /s)" = '34'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
看看医院0889574有多少科室在门诊就诊中开出不少于15张检验报告单,时间为2000年11月3日到2012年11月14日
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 = '0889574' AND jybgb.BGRQ BETWEEN '2000-11-03' AND '2012-11-14' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 15 UNION SELECT jybgb.KSBM FROM ftxmzjzjlb...
css
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...
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Road, and show from high to low by the x axis.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC
nvbench
CREATE TABLE table_46935 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" text )
Name the Team which has a Time/Retired of contact, and a Grid smaller than 17?
SELECT "Team" FROM table_46935 WHERE "Time/Retired" = 'contact' AND "Grid" < '17'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
User and count of answers on closed questions.
SELECT a.OwnerUserId, COUNT(*) AS "total" FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE NOT q.ClosedDate IS NULL GROUP BY a.OwnerUserId ORDER BY total DESC
sede
CREATE TABLE editor ( Editor_ID int, Name text, Age real ) CREATE TABLE journal ( Journal_ID int, Date text, Theme text, Sales int ) CREATE TABLE journal_committee ( Editor_ID int, Journal_ID int, Work_Type text )
Show the number of the names of editors that are on the committee of journals with sales bigger than 3000, sort Name from high to low order.
SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY Name DESC
nvbench
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 mzjzjlb ( HXPLC number, HZXM ...
医疗机构5099708的胸部肿瘤外科的记录里,在09年1月5日到20年10月20日期间内,共有多少住院的患者
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '50...
css
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...
在零六年五月十一日一四年二月三日期间,ID为0036659的医疗机构的总金额数和统筹总金额数怎么样
SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '0036659' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-05-11' AND '2014-02-03'
css
CREATE TABLE table_name_93 ( points INTEGER, engine VARCHAR, chassis VARCHAR )
What is the average number of points for an Offenhauser L4 engine with a Trevis chassis?
SELECT AVG(points) FROM table_name_93 WHERE engine = "offenhauser l4" AND chassis = "trevis"
sql_create_context
CREATE TABLE table_54123 ( "Player" text, "Car." real, "Yards" real, "Avg." real, "TD's" real, "Long" real )
How many TDs for the player with a long of less than 4 and under 8 yards?
SELECT SUM("TD's") FROM table_54123 WHERE "Long" < '4' AND "Yards" < '8'
wikisql
CREATE TABLE table_20141 ( "Ecozone" text, "Area (km\u00b2)" real, "Percentage of total area" text, "Percentage of land area" text, "Percentage protected" text )
What is the percentage of land area in the ecozone that the percentage protected is 15.28?
SELECT "Percentage of land area" FROM table_20141 WHERE "Percentage protected" = '15.28'
wikisql
CREATE TABLE services ( service_id number, service_type_code text, workshop_group_id number, product_description text, product_name text, product_price number, other_product_service_details text ) CREATE TABLE marketing_regions ( marketing_region_code text, marketing_region_name tex...
What is the description of the service type which offers both the photo product and the film product?
SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product_name = 'photo' INTERSECT SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product...
spider
CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
For each director, return the director's name together with the value of that rating and ignore movies whose director is NULL Could you plot the result with a bar chart?, I want to list by the director in desc.
SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY director DESC
nvbench
CREATE TABLE table_11400 ( "Year" real, "Chassis" text, "Engine(s)" text, "Tyres" text, "Points" real )
What engines have the year 1992?
SELECT "Engine(s)" FROM table_11400 WHERE "Year" = '1992'
wikisql
CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of_Factories int, Num_of_Shops int ) CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of...
Give me the names and prices of furnitures which some companies are manufacturing with a bar chart, display y axis from low to high order.
SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID ORDER BY Price_in_Dollar
nvbench
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what is the difference in the weight of patient 594's last measured on the last hospital visit compared to the value first measured on the last hospital 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 = 594 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND char...
mimic_iii
CREATE TABLE table_75694 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the number of totals that have silvers under 2, bronzes over 0, and golds over 1?
SELECT COUNT("Total") FROM table_75694 WHERE "Silver" < '2' AND "Bronze" > '0' AND "Gold" > '1'
wikisql
CREATE TABLE table_593 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text )
What's Yotam Halperin's position?
SELECT "Position" FROM table_593 WHERE "Player" = 'Yotam Halperin'
wikisql
CREATE TABLE table_53594 ( "Date" text, "Tournament" text, "Round" text, "Ground" text, "Opponent" text, "Score 1" text )
Which date's opponent was Dender when the tournament was in the Jupiler League and the ground was a?
SELECT "Date" FROM table_53594 WHERE "Opponent" = 'dender' AND "Tournament" = 'jupiler league' AND "Ground" = 'a'
wikisql
CREATE TABLE table_38000 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What position did the team finish in with a Difference of - 6, 3 losses, and over 4 draws?
SELECT COUNT("Position") FROM table_38000 WHERE "Difference" = '- 6' AND "Lost" = '3' AND "Drawn" > '4'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
how many times patient 002-4486 has taken per iv flush: forearm r 18 gauge in the previous day?
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.cel...
eicu
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 are admitted before the year 2158 and followed the procedure inject ca chemother nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2158" AND procedures.short_title = "Inject ca chemother NEC"
mimicsql_data
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid...
in 2105, what are the top four most frequent drugs prescribed to patients in the same month after the prescription of desipramine hcl?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'desipramine hcl' AND STRFTIME('%y', prescriptions.startdate) = '2...
mimic_iii
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, ...
give me the number of patients whose age is less than 50 and diagnoses long title is coronary atherosclerosis of native coronary artery?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.long_title = "Coronary atherosclerosis of native coronary artery"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
what was the daily minimum amount of colostomy given to patient 006-80884 during this hospital visit?
SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884' AND patient.hospitaldischargetime IS ...
eicu
CREATE TABLE table_203_89 ( id number, "#" number, "name\n(birth-death)" text, "took office" text, "left office" text, "monarch" text, "prime minister" text )
how many governors did the union of south africa go through during the reign of george v ?
SELECT COUNT("name\n(birth-death)") FROM table_203_89 WHERE "monarch" = 'george v'
squall
CREATE TABLE table_74328 ( "Team" text, "Stadium" text, "Home Games" real, "Average Attendance" real, "Total Attendance" real, "Capacity Percentage" text )
What is the name of the team when the stadium is listed as Edward Jones Dome?
SELECT "Team" FROM table_74328 WHERE "Stadium" = 'Edward Jones Dome'
wikisql
CREATE TABLE table_name_91 ( winning_score VARCHAR, runner_s__up VARCHAR )
What is the winning score of the tournament with Charles Coody as the runner-up?
SELECT winning_score FROM table_name_91 WHERE runner_s__up = "charles coody"
sql_create_context
CREATE TABLE table_name_62 ( skip VARCHAR, third VARCHAR )
WHAT IS THE SKIP WITH A THIRD OF DEANNA DOIG?
SELECT skip FROM table_name_62 WHERE third = "deanna doig"
sql_create_context
CREATE TABLE table_47951 ( "Date" text, "Region" text, "Label" text, "Catalogue" text, "Format" text )
What is Label, when Date is 1987?
SELECT "Label" FROM table_47951 WHERE "Date" = '1987'
wikisql
CREATE TABLE table_57107 ( "NGC number" real, "Object type" text, "Constellation" text, "Right ascension ( J2000 )" text, "Declination ( J2000 )" text )
What constellation has a Declination ( J2000 ) of 32 39 ?
SELECT "Constellation" FROM table_57107 WHERE "Declination ( J2000 )" = '°32′39″'
wikisql
CREATE TABLE entrepreneur ( Investor VARCHAR )
What are the investors that have invested in at least two entrepreneurs?
SELECT Investor FROM entrepreneur GROUP BY Investor HAVING COUNT(*) >= 2
sql_create_context
CREATE TABLE table_19131921_1 ( branding VARCHAR, format VARCHAR )
Which branding has the format of southern country?
SELECT branding FROM table_19131921_1 WHERE format = "Southern Country"
sql_create_context
CREATE TABLE table_25294 ( "Station" text, "Extension" text, "City/Neighborhood" text, "Projected opening" real, "Transit Connections" text, "Park and ride?" text )
Name the least projected opening
SELECT MIN("Projected opening") FROM table_25294
wikisql
CREATE TABLE table_1708050_1 ( poles VARCHAR, position VARCHAR )
Name the poles for 25th position
SELECT poles FROM table_1708050_1 WHERE position = "25th"
sql_create_context
CREATE TABLE table_58510 ( "Round" text, "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Crowd" real, "Stadium" text, "Match Details" text )
What was the score of the match that took place in the playoff round?
SELECT "Score" FROM table_58510 WHERE "Round" = 'playoff'
wikisql
CREATE TABLE table_6194 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the 1st leg of cs sfaxien?
SELECT "1st leg" FROM table_6194 WHERE "Team 2" = 'cs sfaxien'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
has patient 26777 had any surgery since 6 years ago?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26777) AND DATETIME(procedures_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year')
mimic_iii
CREATE TABLE table_713 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the result for barney frank?
SELECT "Result" FROM table_713 WHERE "Incumbent" = 'Barney Frank'
wikisql
CREATE TABLE table_23014476_1 ( gore__number VARCHAR, others__percentage VARCHAR )
Name the gore number for others % being 5.3%
SELECT gore__number FROM table_23014476_1 WHERE others__percentage = "5.3%"
sql_create_context
CREATE TABLE table_43425 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which nations have more than 1 gold medal and 4 silver medals?
SELECT "Nation" FROM table_43425 WHERE "Gold" > '1' AND "Silver" = '4'
wikisql
CREATE TABLE table_55909 ( "Year" text, "Language" text, "Title" text, "Translator" text, "Company" text, "Pages" real )
What is the language for translators ritah meltser and amatsyah porat?
SELECT "Language" FROM table_55909 WHERE "Translator" = 'ritah meltser and amatsyah porat'
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...
count the number of patients whose primary disease is angioedema and lab test category is blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ANGIOEDEMA" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data