context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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...
自2003.1.20日起,至2013.3.8日止,把患者范慧捷这段期间被开出的所有药品的详细信息列出来,包括编码、名称、数量、单价和金额
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '范慧捷' AND t_kc22.t_kc21_IN_HOSP_DATE BETWEEN '2003-01-20' AND '2013-03-08'
css
CREATE TABLE table_68892 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Name the loss with record of 14-19
SELECT "Loss" FROM table_68892 WHERE "Record" = '14-19'
wikisql
CREATE TABLE table_1300 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
Name the pictorials when the interview subject is steve jobs
SELECT "Pictorials" FROM table_1300 WHERE "Interview subject" = 'Steve Jobs'
wikisql
CREATE TABLE table_12962773_16 ( current_club VARCHAR, height VARCHAR )
What club does the player who is 1.97 m tall play for?
SELECT current_club FROM table_12962773_16 WHERE height = "1.97"
sql_create_context
CREATE TABLE table_43067 ( "Position" text, "Jersey #" real, "Name" text, "Height (cm)" real, "Weight (kg)" real, "Birthdate" text, "Birthplace" text, "1990\u20131991 Team" text )
What is the 1990 1991 Team when the Birthplace shows as new york?
SELECT "1990\u20131991 Team" FROM table_43067 WHERE "Birthplace" = 'new york'
wikisql
CREATE TABLE table_14409 ( "Year" real, "Team" text, "Wins" real, "Points" real, "Championship Finish" text )
What is the lowest win number of the competitor who had 90 points before 1994?
SELECT MIN("Wins") FROM table_14409 WHERE "Points" = '90' AND "Year" < '1994'
wikisql
CREATE TABLE table_name_31 ( overall INTEGER, college VARCHAR, round VARCHAR )
Which highest overall has a College of idaho, and a Round smaller than 1?
SELECT MAX(overall) FROM table_name_31 WHERE college = "idaho" AND round < 1
sql_create_context
CREATE TABLE table_69071 ( "Season" text, "Team" text, "Country" text, "Division" text, "Apps" real, "Goals" real )
How many apps does Uzbekistan have in 2003?
SELECT "Apps" FROM table_69071 WHERE "Country" = 'uzbekistan' AND "Season" = '2003'
wikisql
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, ...
患者潘德运在09年8月4日到21年6月15日内都做了什么检查把检验报告单号列出来
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '潘德运' AND jybg...
css
CREATE TABLE table_name_24 ( attendance VARCHAR, game_site VARCHAR, week VARCHAR )
What is the attendance that has fedex field as the game site with 3 as the week?
SELECT attendance FROM table_name_24 WHERE game_site = "fedex field" AND week = 3
sql_create_context
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin varchar2(20), destination varchar2(20), distance number(6,0), departure_date date, ...
What are the names and distances for all airplanes. Visualize by bar chart.
SELECT name, distance FROM aircraft
nvbench
CREATE TABLE railway_manage ( Railway_ID int, Manager_ID int, From_Year text ) CREATE TABLE manager ( Manager_ID int, Name text, Country text, Working_year_starts text, Age int, Level int ) CREATE TABLE train ( Train_ID int, Train_Num text, Name text, From text, ...
Show different builders of railways, along with the corresponding number of railways using each builder Show bar chart, and display x-axis in asc order.
SELECT Builder, COUNT(*) FROM railway GROUP BY Builder ORDER BY Builder
nvbench
CREATE TABLE table_name_18 ( school VARCHAR, year_left VARCHAR )
what is the school that left in 1966?
SELECT school FROM table_name_18 WHERE year_left = 1966
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
What is the easiest class I can do to meet the MDE requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
advising
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...
经过门诊诊断后确定为慢性牙周炎的患者的检测指标261843的参考值范围下限还有上限能达到多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '慢性牙周炎' AND jyjgzbb.JCZBDM = '261843'
css
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
检验技师在检验报告单84803528320上有什么工号和姓名?
SELECT zyjybgb.JYJSGH, zyjybgb.JYJSQM FROM zyjybgb WHERE zyjybgb.BGDH = '84803528320' UNION SELECT mzjybgb.JYJSGH, mzjybgb.JYJSQM FROM mzjybgb WHERE mzjybgb.BGDH = '84803528320'
css
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Pr...
Show the number of gas stations for each manager in a bar chart, and I want to show by the X in desc.
SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY Manager_Name DESC
nvbench
CREATE TABLE table_38003 ( "Unit" text, "Russian" text, "Ratio" text, "Metric value" text, "Avoirdupois value" text )
What Metric value has a Unit of dolia?
SELECT "Metric value" FROM table_38003 WHERE "Unit" = 'dolia'
wikisql
CREATE TABLE table_name_91 ( pick VARCHAR, college VARCHAR )
What is the pick for West Virginia college?
SELECT pick FROM table_name_91 WHERE college = "west virginia"
sql_create_context
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE restriction ( restriction_c...
flights from DENVER to BALTIMORE between 1000 and 1400
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.departure_time <= 1400 AND flight.departure_time >= 1000) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flig...
atis
CREATE TABLE table_75195 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
What is the smallest number of field goals for players with 4 touchdowns and less than 9 extra points?
SELECT MIN("Field goals") FROM table_75195 WHERE "Touchdowns" = '4' AND "Extra points" < '9'
wikisql
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, ...
从01年4月21日至2019年8月21日之内袁雅云患者在医疗机构3211067的门诊共就诊的次数是多少?
SELECT COUNT(*) 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.person_info_XM = '袁雅云' AND mzjzjlb.JZKSRQ BETWEEN '2001-04-21' AND '2019-08-21' AND mzjzjlb.YLJGDM = '3211067'
css
CREATE TABLE table_204_438 ( id number, "year" number, "title" text, "album" text, "us r&b" number, "us pop" number, "us dance" number )
which album was the next one to end up on the us dance list after new jack city ?
SELECT "album" FROM table_204_438 ORDER BY "us dance" DESC LIMIT 1
squall
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
what is the number of divorced patients who were admitted before 2120?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.admityear < "2120"
mimicsql_data
CREATE TABLE table_79550 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College/junior/club team" text )
Which Round has a Player of dan chicoine, and a Pick larger than 23?
SELECT AVG("Round") FROM table_79550 WHERE "Player" = 'dan chicoine' AND "Pick" > '23'
wikisql
CREATE TABLE table_1974782_1 ( institution VARCHAR, location VARCHAR )
What school is located in Worcester, Massachusetts?
SELECT institution FROM table_1974782_1 WHERE location = "Worcester, Massachusetts"
sql_create_context
CREATE TABLE table_47469 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
How many rounds did the match last with Sam Sotello as the opponent?
SELECT AVG("Round") FROM table_47469 WHERE "Opponent" = 'sam sotello'
wikisql
CREATE TABLE table_1430913_1 ( height_from_sea_level_in_meters VARCHAR, category VARCHAR )
picturesque and trekking route is the category what is the height from sea level in meters?
SELECT height_from_sea_level_in_meters FROM table_1430913_1 WHERE category = "Picturesque and trekking_route"
sql_create_context
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 jyjgzbb ( BGDH text, BGRQ tim...
患者赵思美所有检验报告单的审核日期时间从01年8月29日至14年11月21日期间内都是哪天吗?
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '赵思美' AND jybg...
css
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescription...
what are the prices for sodiu?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'sodiu')
mimic_iii
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE days ( d...
what is restriction AP/55
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/55'
atis
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE T...
Find 'me too' (so-called) answers. Finds the answers to questions that appear to be the 'me too' style of answers that contribute absolutely nothiing to the question and should either be removed or converted to a comment by a mod.
SELECT Id AS "post_link", SUBSTRING(Body, STR_POSITION(Body, 'me too') - 15, 45) AS "occurrence" FROM Posts WHERE PostTypeId = 2 AND (Body LIKE 'me too%' OR Body LIKE '% me too%') AND NOT Body LIKE '%affects me too%' AND NOT Body LIKE '%fixed it%' AND NOT Body LIKE '%resolved%'
sede
CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARC...
For each distinct test result, find the number of students who got the result.
SELECT test_result, COUNT(*) FROM Student_Tests_Taken GROUP BY test_result ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Most upvoted questions tagged with 'tensorflow'.
SELECT COUNT(v.PostId) AS "Vote count", v.PostId AS "post_link", p.Body FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE p.Tags LIKE '%tensorflow%' GROUP BY v.PostId, p.Body ORDER BY 'Vote count' DESC LIMIT 100
sede
CREATE TABLE table_203_69 ( id number, "representative" text, "title" text, "from" number, "to" number, "appointed by" text )
how many years has does this table cover ?
SELECT MAX("to") - MIN("from") FROM table_203_69
squall
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL v...
Provide the frequency of the last names of employees earning more than the employee with id 163 using a bar chart, and order Y in asc order.
SELECT LAST_NAME, COUNT(LAST_NAME) FROM employees WHERE SALARY > (SELECT SALARY FROM employees WHERE EMPLOYEE_ID = 163) GROUP BY LAST_NAME ORDER BY COUNT(LAST_NAME)
nvbench
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, show me about the distribution of name and the average of manufacturer , and group by attribute name in a bar chart.
SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
nvbench
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, ...
what is minimum age of patients whose ethnicity is white - russian and days of hospital stay is 69?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.days_stay = "69"
mimicsql_data
CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Na...
Create a bar chart showing the number of date in locaton to across date in locaton to, could you display by the y axis from low to high?
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations ORDER BY COUNT(Date_in_Locaton_To)
nvbench
CREATE TABLE table_47930 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
What was the score when the opponent was irena pavlovic and the surface was hard?
SELECT "Score" FROM table_47930 WHERE "Surface" = 'hard' AND "Opponent in the final" = 'irena pavlovic'
wikisql
CREATE TABLE table_204_217 ( id number, "camp" text, "div sec\ndivision" text, "admin\ndistrict" text, "9 feb" number, "11 feb" number, "16 feb" number, "25 feb" number, "27 feb" number, "2 mar" number, "4 mar" number, "6 mar" number, "11 mar" number, "13 mar" num...
which camp is the least amount on mar. 30
SELECT "camp" FROM table_204_217 ORDER BY "30 mar" LIMIT 1
squall
CREATE TABLE table_train_249 ( "id" int, "gender" string, "allergy_to_dapagliflozin" bool, "body_weight" float, "estimated_glomerular_filtration_rate_egfr" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
known or suspected allergy to dapagliflozin
SELECT * FROM table_train_249 WHERE allergy_to_dapagliflozin = 1
criteria2sql
CREATE TABLE table_16276 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
Who wrote episode 94?
SELECT "Written by" FROM table_16276 WHERE "No. in series" = '94'
wikisql
CREATE TABLE table_20825 ( "Gun" text, "m/v ft/s" real, "Shell (lb)" text, "Time to ft (m) at 25\u00b0 (seconds)" text, "Time to ft (m) at 40\u00b0 (seconds)" text, "Time to ft (m) at 55\u00b0 (seconds)" text, "Max. height (ft)" real )
What is the foot per second speed where time to feet ratio is 9.2 at 25 degrees?
SELECT "m/v ft/s" FROM table_20825 WHERE "Time to ft (m) at 25\u00b0 (seconds)" = '9.2'
wikisql
CREATE TABLE table_12454156_1 ( losing_hand VARCHAR, winning_hand VARCHAR )
What was the losing hand where the winning hand was 7h 7s?
SELECT losing_hand FROM table_12454156_1 WHERE winning_hand = "7h 7s"
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...
医疗记录中年龄低于23岁的患者的医疗费平均金额是多少
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 < 23 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE < 23 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE < 23 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PERSON...
css
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar...
Ben Craig took EARTH 586 , taught by which professor ?
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 INNER JOIN course_...
advising
CREATE TABLE table_23186738_9 ( game INTEGER, date VARCHAR )
Name the least game for march 20
SELECT MIN(game) FROM table_23186738_9 WHERE date = "March 20"
sql_create_context
CREATE TABLE table_name_34 ( winner VARCHAR, fis_nordic_world_ski_championships VARCHAR )
Who won the men's ski jump when the FIS Nordic World Ski Championships was 1980?
SELECT winner FROM table_name_34 WHERE fis_nordic_world_ski_championships = "1980"
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number...
what was the name of the last lab test that patient 25050 had since 105 months ago?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25050) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-105 month') ORDER BY labevents.charttime D...
mimic_iii
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE...
search in comments / all.
SELECT Id AS "comment_link", CreationDate, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') ORDER BY CreationDate DESC
sede
CREATE TABLE table_4929 ( "Round" real, "Pick" real, "Player" text, "Position" text, "College" text )
What school did the punter picked after 101 attend?
SELECT "College" FROM table_4929 WHERE "Pick" > '101' AND "Position" = 'punter'
wikisql
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) ...
Bar chart of how many headquarters from each headquarters
SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters
nvbench
CREATE TABLE table_39866 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the smallest number of losses for a position greater than 2 with 4 points and more than 2 draws?
SELECT MIN("Lost") FROM table_39866 WHERE "Position" > '2' AND "Points" = '4' AND "Drawn" > '2'
wikisql
CREATE TABLE mzb ( 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...
凤红艳这位参保人住院费金额正好是证书的次数有多少
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '凤红艳' AND MOD(zyb.MED_CLINIC_ID, 1) = 0
css
CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time...
Show the party and the number of drivers in each party with a bar chart, and I want to order in desc by the the total number please.
SELECT Party, COUNT(*) FROM driver GROUP BY Party ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_203_788 ( id number, "year" number, "author" text, "illustrator" text, "title" text, "publisher" text )
which illustrator was responsible for the last award winner ?
SELECT "illustrator" FROM table_203_788 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_68253 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Name the least total for 1978 years won
SELECT MIN("Total") FROM table_68253 WHERE "Year(s) won" = '1978'
wikisql
CREATE TABLE table_56335 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "School/Club Team/Country" text )
Name the position for the player that is from valparaiso
SELECT "Position" FROM table_56335 WHERE "School/Club Team/Country" = 'valparaiso'
wikisql
CREATE TABLE Organisations ( organisation_id INTEGER, organisation_type VARCHAR(10), organisation_details VARCHAR(255) ) CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(255) ) CREATE TABLE Document_Types ( document_type_code VARCHAR(10), document_description VARC...
Find the organisation ids and details of the organisations which are involved i Visualize by bar chart, list by the x axis in descending.
SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details 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...
Give me the number of patients whose admission location is transfer from hosp/extram lab test item id is 50935.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND lab.itemid = "50935"
mimicsql_data
CREATE TABLE film ( film_id number, rank_in_series number, number_in_season number, title text, directed_by text, original_air_date text, production_code text ) CREATE TABLE cinema ( cinema_id number, name text, openning_year number, capacity number, location text ) CRE...
Show cinema name, film title, date, and price for each record in schedule.
SELECT T3.name, T2.title, T1.date, T1.price FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id JOIN cinema AS T3 ON T1.cinema_id = T3.cinema_id
spider
CREATE TABLE table_181892_4 ( year VARCHAR, race_status VARCHAR )
What year(s) was the race status piston?
SELECT year FROM table_181892_4 WHERE race_status = "Piston"
sql_create_context
CREATE TABLE table_76502 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Attendance" real, "Record" text, "Points" real )
What is the lowest amount of points of the game with toronto as the home team?
SELECT MIN("Points") FROM table_76502 WHERE "Home" = 'toronto'
wikisql
CREATE TABLE table_62830 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
Who is the pick from the Purdue College?
SELECT "Pick" FROM table_62830 WHERE "College" = 'purdue'
wikisql
CREATE TABLE table_67045 ( "Ship" text, "Pennant number" text, "Laid down" text, "Launched" text, "Commissioned" text )
Which ship has a Pennant number of h.69?
SELECT "Ship" FROM table_67045 WHERE "Pennant number" = 'h.69'
wikisql
CREATE TABLE table_18600760_12 ( land___sqmi__ VARCHAR, township VARCHAR )
What is the land (sqmi) in lansing township?
SELECT land___sqmi__ FROM table_18600760_12 WHERE township = "Lansing"
sql_create_context
CREATE TABLE table_36598 ( "Date" text, "Home Team" text, "Score" text, "Visiting Team" text, "Stadium" text )
What was Saskatoon Accelerators score on January 6, 2008?
SELECT "Score" FROM table_36598 WHERE "Home Team" = 'saskatoon accelerators' AND "Date" = 'january 6, 2008'
wikisql
CREATE TABLE table_31597 ( "Year" real, "Date" text, "Event" text, "Days" text, "Stages" text, "Acts" text )
Tell me the event for 6 bands
SELECT "Event" FROM table_31597 WHERE "Acts" = '6 bands'
wikisql
CREATE TABLE table_31455 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the location and it's corresponding attendance during the game against Los Angeles?
SELECT "Location Attendance" FROM table_31455 WHERE "Team" = 'Los Angeles'
wikisql
CREATE TABLE table_1555308_1 ( bleeding_time VARCHAR, prothrombin_time VARCHAR, platelet_count VARCHAR )
What are all the possible bleeding time results where prothrombin time and platelet count are both unaffected?
SELECT bleeding_time FROM table_1555308_1 WHERE prothrombin_time = "Unaffected" AND platelet_count = "Unaffected"
sql_create_context
CREATE TABLE table_12032893_1 ( year VARCHAR, weight VARCHAR )
In which year was the Weight 170?
SELECT year FROM table_12032893_1 WHERE weight = 170
sql_create_context
CREATE TABLE table_29660 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Prod. code" real, "U.S. viewers (millions)" text )
Who wrote the episode with the production code 211?
SELECT "Written by" FROM table_29660 WHERE "Prod. code" = '211'
wikisql
CREATE TABLE table_203_459 ( id number, "township" text, "fips" number, "population\ncenter" text, "population" number, "population\ndensity\n/km2 (/sq mi)" text, "land area\nkm2 (sq mi)" text, "water area\nkm2 (sq mi)" text, "water %" text, "geographic coordinates" text )
which township has the least in population ?
SELECT "township" FROM table_203_459 ORDER BY "population" LIMIT 1
squall
CREATE TABLE table_name_86 ( score VARCHAR, record VARCHAR )
What was the score of the game when the Blue Jays were 55-39?
SELECT score FROM table_name_86 WHERE record = "55-39"
sql_create_context
CREATE TABLE table_61353 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the location of fightfest 2, which has 3 rounds?
SELECT "Location" FROM table_61353 WHERE "Round" = '3' AND "Event" = 'fightfest 2'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
what is drug code of drug name simethicone?
SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Simethicone"
mimicsql_data
CREATE TABLE Ref_Document_Status ( document_status_code CHAR(15), document_status_description VARCHAR(255) ) CREATE TABLE Documents ( document_id INTEGER, document_status_code CHAR(15), document_type_code CHAR(15), shipping_agent_code CHAR(15), receipt_date DATETIME, receipt_number VARC...
List the number of documents for each receipt date and bin by weekday in a bar chart, sort y axis from high to low order.
SELECT receipt_date, COUNT(receipt_date) FROM Documents ORDER BY COUNT(receipt_date) DESC
nvbench
CREATE TABLE table_26950 ( "Name" text, "Position" text, "Period" text, "Appearances\u00b9" real, "Goals\u00b9" real, "Nationality\u00b2" text )
Name the nationality for defender 201
SELECT "Nationality\u00b2" FROM table_26950 WHERE "Position" = 'Defender' AND "Appearances\u00b9" = '201'
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 acc regular season, rank X-axis in desc order.
SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY ACC_Regular_Season DESC
nvbench
CREATE TABLE table_32470 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text )
Which championship had a margin of 10 strokes?
SELECT "Championship" FROM table_32470 WHERE "Margin" = '10 strokes'
wikisql
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
1714876这个医院涉及医疗费总额超过6282.3元的科室有多少?时间范围是2004-06-08到2016-11-26
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD 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 = '1714876' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-06-08' AND '2016-11-26' GROUP B...
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who was hired before 2002-06-21, return a line chart about the change of department_id over hire_date .
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, ...
find me a flight from BOSTON to SAN FRANCISCO with a layover in DENVER
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE useracct ( u_id number, name text ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE item ( i_id number, title text )
List all information in the item table.
SELECT * FROM item
spider
CREATE TABLE table_16581695_4 ( production_code VARCHAR, no_in_season VARCHAR )
What is the production code for episode 15 in season 3?
SELECT production_code FROM table_16581695_4 WHERE no_in_season = "15"
sql_create_context
CREATE TABLE table_61405 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
What is the Film title used in nomination of Cilv ka B rns?
SELECT "Film title used in nomination" FROM table_61405 WHERE "Original title" = 'cilvēka bērns'
wikisql
CREATE TABLE table_name_18 ( date VARCHAR, week VARCHAR, opponent VARCHAR )
What is the date for a week before 9, and a opponent of dallas cowboys?
SELECT date FROM table_name_18 WHERE week < 9 AND opponent = "dallas cowboys"
sql_create_context
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 number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ...
what was the first thing patient 99883 had as output on the current intensive care unit visit?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99883) AND icustays.outtime IS NULL) ORDER...
mimic_iii
CREATE TABLE table_45206 ( "Name" text, "Location" text, "Height (m)" real, "Stories" real, "Year of completion" real )
What is the largest number of stories in Recife completed later than 2007 with a height less than 135 meters?
SELECT MAX("Stories") FROM table_45206 WHERE "Location" = 'recife' AND "Year of completion" > '2007' AND "Height (m)" < '135'
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 unmarried patients have diagnoses icd9 code 496?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.icd9_code = "496"
mimicsql_data
CREATE TABLE table_64008 ( "Serial No." real, "District" text, "Headquartered City" text, "City Population (2009)" real, "City Area(km 2 )" real )
What was the total city area for vehari city with a serial number bigger than 36?
SELECT COUNT("City Area(km 2 )") FROM table_64008 WHERE "Headquartered City" = 'vehari city' AND "Serial No." > '36'
wikisql
CREATE TABLE table_name_2 ( goal_difference INTEGER, draw VARCHAR, played VARCHAR )
Name the average goal difference for draw of 7 and played more than 18
SELECT AVG(goal_difference) FROM table_name_2 WHERE draw = 7 AND played > 18
sql_create_context
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text )
how many unique entries are by the same Artist/group?
SELECT COUNT(*), artist FROM torrents GROUP BY artist
whatcdhiphop
CREATE TABLE table_21940 ( "Season" text, "The Mole" text, "Winner" text, "Runner-up" text, "International destination" text )
How many won the prize when Regina was the runner-up?
SELECT COUNT("Winner") FROM table_21940 WHERE "Runner-up" = 'Regina'
wikisql
CREATE TABLE table_64094 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
Where is the IHSAA Class of aaa school with more than 590 enrolled?
SELECT "Location" FROM table_64094 WHERE "IHSAA Class" = 'aaa' AND "Enrollment" > '590'
wikisql
CREATE TABLE table_24565004_22 ( appearances¹ INTEGER, name VARCHAR )
at least how many times was Pierre Vermeulen at a game?
SELECT MIN(appearances¹) FROM table_24565004_22 WHERE name = "Pierre Vermeulen"
sql_create_context
CREATE TABLE table_30853 ( "Series" real, "Premiere" text, "Finale" text, "Runners-up" text, "Winner" text )
Who won the season for which Brendan Lynch is the runner-up?
SELECT "Winner" FROM table_30853 WHERE "Runners-up" = 'Brendan Lynch'
wikisql
CREATE TABLE table_19304764_2 ( total_seats VARCHAR, discipline VARCHAR )
Name the total seats for otorhinolaryngology
SELECT total_seats FROM table_19304764_2 WHERE discipline = "Otorhinolaryngology"
sql_create_context
CREATE TABLE table_name_14 ( tournament VARCHAR )
What is the 1994 finish for the Miami tournament?
SELECT 1994 FROM table_name_14 WHERE tournament = "miami"
sql_create_context