context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TAB...
in this year, how many patients had been diagnosed with dvt - right lower extremity?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'dvt - right lower extremity' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year'))
eicu
CREATE TABLE table_24334163_1 ( Winners VARCHAR, total_money_won VARCHAR )
How many play-off legs were won when the prize money was 10,300?
SELECT COUNT(Winners) AS play_off_legs_won FROM table_24334163_1 WHERE total_money_won = "£10,300"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
give me the number of patients whose age is less than 89 and admission year is less than 2195?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "89" AND demographic.admityear < "2195"
mimicsql_data
CREATE TABLE table_name_54 ( series INTEGER, sixth_place VARCHAR )
What series had Joan Tena in sixth place?
SELECT SUM(series) FROM table_name_54 WHERE sixth_place = "joan tena"
sql_create_context
CREATE TABLE table_31401 ( "Rank" real, "Country/Territory" text, "Miss International" real, "1st Runner-up" real, "2nd Runner-up" real, "3rd Runner-up" real, "4th Runner-up" real, "Semifinalists" real, "Total" real )
What is the lowest value in the miss international column?
SELECT MIN("Miss International") FROM table_31401
wikisql
CREATE TABLE table_50021 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the country of player lee trevino, who has a to par of +2?
SELECT "Country" FROM table_50021 WHERE "To par" = '+2' AND "Player" = 'lee trevino'
wikisql
CREATE TABLE table_name_26 ( date VARCHAR, performer_4 VARCHAR, performer_2 VARCHAR, performer_3 VARCHAR )
What is the date of the episode with Ryan Stiles as performer 2, Colin Mochrie as performer 3, and Tony Slattery as performer 4?
SELECT date FROM table_name_26 WHERE performer_2 = "ryan stiles" AND performer_3 = "colin mochrie" AND performer_4 = "tony slattery"
sql_create_context
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...
名叫彭书萱的病人在被门诊诊断为疾病U20.085的时候茶碱的结果定量及其单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_18574 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the candidates for ellsworth b. buck
SELECT "Candidates" FROM table_18574 WHERE "Incumbent" = 'Ellsworth B. Buck'
wikisql
CREATE TABLE table_69213 ( "Rank (CSA)" text, "State(s)" text, "2007 Estimate" text, "2000 Population" text, "Percent Change (1990\u20132000)" text )
What is the 2000 population in OK with a 1990-2000 percent change of A078 +17.22%?
SELECT "2000 Population" FROM table_69213 WHERE "State(s)" = 'ok' AND "Percent Change (1990\u20132000)" = 'a078 +17.22%'
wikisql
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...
病人尤静逸在医院0738891的门诊中,诊断涉及神经衰弱的门诊就诊记录列一下
SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '尤静逸' AND hz_info.YLJGDM = '0738891' AND wdmzjzjlb.JZZDSM LIKE '%神经衰弱%' UNION SELECT * FROM person_info JOIN...
css
CREATE TABLE addresses ( city VARCHAR, zip_postcode VARCHAR )
Find the city with post code 255.
SELECT city FROM addresses WHERE zip_postcode = 255
sql_create_context
CREATE TABLE table_24276 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What college did the player for the Hamilton Tiger-Cats go to?
SELECT "College" FROM table_24276 WHERE "CFL Team" = 'Hamilton Tiger-Cats'
wikisql
CREATE TABLE table_name_70 ( club_team VARCHAR, overall VARCHAR )
What club team has 216 overall?
SELECT club_team FROM table_name_70 WHERE overall = 216
sql_create_context
CREATE TABLE table_name_38 ( studio_host VARCHAR, play_by_play VARCHAR, colour_commentator_s_ VARCHAR )
Who is the studio host that has a play-by-play announcer of Bob Cole and a colour commentator of Harry Neale?
SELECT studio_host FROM table_name_38 WHERE play_by_play = "bob cole" AND colour_commentator_s_ = "harry neale"
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...
出院时诊断的疾病编号及名称,在医疗就诊78262122998中是什么?
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '78262122998'
css
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 maximum age of patients whose gender is m and discharge location is home?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.discharge_location = "HOME"
mimicsql_data
CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_id INTEGER, thing_id INTEGER ) CREATE TABLE Organizations ( organization_id INTEGER, parent_organization_id INTEGER, organization_details VARCHAR(255)...
Draw a bar chart of date moved in versus how many date moved in, and order in desc by the Y please.
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events GROUP BY date_moved_in ORDER BY COUNT(date_moved_in) DESC
nvbench
CREATE TABLE table_48705 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Which Home Team has a Game of game 1?
SELECT "Home Team" FROM table_48705 WHERE "Game" = 'game 1'
wikisql
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
count the number of patients that have been admitted to the hospital during this year.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
for patients who were given heart countershock nec during the last year, what are the top four most frequent lab tests that followed afterwards during the same hospital encounter?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
mimic_iii
CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABLE song ( song_name text, artist_name text, country text, f_id number, genre_is text, rating num...
What are the names of all songs that have a lower rating than some song of blues genre?
SELECT song_name FROM song WHERE rating < (SELECT MAX(rating) FROM song WHERE genre_is = "blues")
spider
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, ...
Rolling 30 day > 30 question user count.
WITH DayPosts AS (SELECT OwnerUserId, CreationDate, COUNT(*) AS PostCount, ROW_NUMBER() OVER (PARTITION BY OwnerUserId ORDER BY CreationDate) AS Num FROM Posts WHERE PostTypeId = 1 GROUP BY OwnerUserId, CreationDate), UserMonths AS (SELECT OwnerUserId, CreationDate, PostCount, Num FROM DayPosts UNION ALL SELECT DayPost...
sede
CREATE TABLE table_name_63 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on September 17, 1995?
SELECT opponent FROM table_name_63 WHERE date = "september 17, 1995"
sql_create_context
CREATE TABLE table_23958944_2 ( title VARCHAR, production_number VARCHAR )
What's the title of the episode with production number 103?
SELECT title FROM table_23958944_2 WHERE production_number = 103
sql_create_context
CREATE TABLE bdmzjzjlb ( 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...
这个被门诊诊断为脑梗死后遗症的病人朱文彬,查询他做的罗马指数(绝经前)的检测结果定量及单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
among patients who had a lab test for human chorionic gonadotropin, calculate the number of ones' who have unspecified death status.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Human Chorionic Gonadotropin"
mimicsql_data
CREATE TABLE table_name_94 ( introduced INTEGER, retired VARCHAR, manufacturer VARCHAR, quantity VARCHAR )
How many in the introduced section had Fokker as a manufacturer, a quantity of 5, and retired later than 1999?
SELECT SUM(introduced) FROM table_name_94 WHERE manufacturer = "fokker" AND quantity = 5 AND retired > 1999
sql_create_context
CREATE TABLE table_name_80 ( total_goals VARCHAR, total_apps VARCHAR, league_goals VARCHAR )
How many total goals have 0 (3) as total apps, with league goals less than 0?
SELECT COUNT(total_goals) FROM table_name_80 WHERE total_apps = "0 (3)" AND league_goals < 0
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) 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 T...
show me all fares between PHILADELPHIA and SAN FRANCISCO that are less than 200 dollars one way
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, fare WHERE ((fare.one_direction_cost < 200 AND fare.round_trip_required = 'NO') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare...
atis
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, find headquarter and the amount of headquarter , and group by attribute headquarter, and visualize them by a bar chart, and sort in asc by the X-axis.
SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
nvbench
CREATE TABLE Apartment_Bookings ( apt_booking_id INTEGER, apt_id INTEGER, guest_id INTEGER, booking_status_code CHAR(15), booking_start_date DATETIME, booking_end_date DATETIME ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CH...
What is the number of start date of each apartment booking for each year? Return a bar chart, rank by the Y in descending.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id ORDER BY COUNT(booking_start_date) DESC
nvbench
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number...
when patient 31615 was first discharged from the hospital since 1 year ago?
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 31615 AND DATETIME(admissions.dischtime) >= DATETIME(CURRENT_TIME(), '-1 year') ORDER BY admissions.dischtime LIMIT 1
mimic_iii
CREATE TABLE table_79931 ( "Film" text, "Director(s)" text, "Recipient" text, "Date" text, "Award" text )
What award did the film Ozone win?
SELECT "Award" FROM table_79931 WHERE "Film" = 'ozone'
wikisql
CREATE TABLE table_67270 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the record for November 26, with the decision made by Prusek?
SELECT "Record" FROM table_67270 WHERE "Decision" = 'prusek' AND "Date" = 'november 26'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Top stackoverflow users from Lebanon.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC), Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Lubnan%' ORDER BY Reputation DESC
sede
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, ...
Rep gained by asking a duplicate. http://meta.stackexchange.com/questions/237286/how-to-find-data-on-dupes-in-sp
SELECT * FROM Tags WHERE TagName LIKE 'reg%'
sede
CREATE TABLE table_name_81 ( outcome VARCHAR, opponent VARCHAR )
What was the outcome when Jing-Jing Lu was the opponent?
SELECT outcome FROM table_name_81 WHERE opponent = "jing-jing lu"
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is the number of patients whose admission year is less than 2144 and diagnoses short title is hypoxemia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.short_title = "Hypoxemia"
mimicsql_data
CREATE TABLE table_name_52 ( competition VARCHAR, attendance VARCHAR, opponent VARCHAR )
What kind of competition had an attendance of more than 914 people and the Wightlink Raiders as an opponent?
SELECT competition FROM table_name_52 WHERE attendance > 914 AND opponent = "wightlink raiders"
sql_create_context
CREATE TABLE table_name_22 ( birthplace VARCHAR )
What was the 1980-1981 team of the player born in Warroad, Minnesota?
SELECT 1980 AS _1981_team FROM table_name_22 WHERE birthplace = "warroad, minnesota"
sql_create_context
CREATE TABLE table_68605 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What is the score of the game that was a loss to Dotson (2-3)?
SELECT "Score" FROM table_68605 WHERE "Loss" = 'dotson (2-3)'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid numbe...
what was the last value of the temperature c (calc) of patient 2518 today?
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 = 2518)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperatur...
mimic_iii
CREATE TABLE table_name_99 ( winning_score VARCHAR, tournament VARCHAR )
What was the winning score of the Valero Texas Open?
SELECT winning_score FROM table_name_99 WHERE tournament = "valero texas open"
sql_create_context
CREATE TABLE table_72909 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What is the part 3 of the word in class 7a?
SELECT "Part 3" FROM table_72909 WHERE "Class" = '7a'
wikisql
CREATE TABLE table_38206 ( "Place" real, "Nation" text, "5 Hoops" real, "3 Balls, 2 Ribbons" real, "Total" real )
5 Hoops larger than 19.325, and a Total of 39.4, and a Place larger than 2 had what total number of 3 balls and 2 ribbons?
SELECT COUNT("3 Balls, 2 Ribbons") FROM table_38206 WHERE "5 Hoops" > '19.325' AND "Total" = '39.4' AND "Place" > '2'
wikisql
CREATE TABLE table_18704 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
who is the incumbent for district mississippi 4
SELECT "Incumbent" FROM table_18704 WHERE "District" = 'Mississippi 4'
wikisql
CREATE TABLE table_name_78 ( team VARCHAR, points INTEGER )
Which team scored less than 35 points?
SELECT team FROM table_name_78 WHERE points < 35
sql_create_context
CREATE TABLE table_41825 ( "Week" real, "Date" text, "Time (CST)" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "NFL Recap" text )
What is the lowest week that has 7:15 p.m. as the time (cst) and fedexfield as the game site?
SELECT MIN("Week") FROM table_41825 WHERE "Time (CST)" = '7:15 p.m.' AND "Game site" = 'fedexfield'
wikisql
CREATE TABLE table_57348 ( "Constructor" text, "Chassis" text, "Engine" text, "Tyres" text, "Driver" text, "Rounds" text )
What engine has g tyres and is driven by elio de angelis?
SELECT "Engine" FROM table_57348 WHERE "Tyres" = 'g' AND "Driver" = 'elio de angelis'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Find Nationality and the sum of meter_100 , and group by attribute Nationality, and visualize them by a bar chart, and rank from low to high by the Y-axis.
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100)
nvbench
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 company name with the number of gas station Show bar chart, rank in descending by the y-axis please.
SELECT Company, COUNT(*) FROM station_company AS T1 JOIN company AS T2 ON T1.Company_ID = T2.Company_ID GROUP BY T1.Company_ID ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_12828723_5 ( points_against VARCHAR )
What was the points againt when played is played?
SELECT points_against FROM table_12828723_5 WHERE "played" = "played"
sql_create_context
CREATE TABLE table_name_58 ( iata VARCHAR, country VARCHAR )
What is China's IATA?
SELECT iata FROM table_name_58 WHERE country = "china"
sql_create_context
CREATE TABLE table_61914 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is Score, when Player is 'David Toms'?
SELECT "Score" FROM table_61914 WHERE "Player" = 'david toms'
wikisql
CREATE TABLE table_7554 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What s the format for the catalog nebcd058?
SELECT "Format" FROM table_7554 WHERE "Catalog" = 'nebcd058'
wikisql
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
when is the hire date for those employees whose first name does not containing the letter M, and count them by a bar chart, rank from high to low by the total number.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY COUNT(HIRE_DATE) DESC
nvbench
CREATE TABLE table_65784 ( "Mother Tongue" text, "Population (2006)" real, "Percentage (2006)" text, "Population (2011)" real, "Percentage (2011)" text )
What percentage of people in 2011 had a mother tongue that was shared by less than 8,085 in 2006 and less than 145 in 2011?
SELECT "Percentage (2011)" FROM table_65784 WHERE "Population (2006)" < '8,085' AND "Population (2011)" < '145'
wikisql
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, find name and revenue , and group by attribute headquarter, and visualize them by a bar chart.
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name
nvbench
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
针对医疗费总额高于8259.58元的鲁清馨患者的就医记录,在其出院的诊断里患了什么编号和名称的疾病?
SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '鲁清馨' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 8259.58)
css
CREATE TABLE table_17634290_7 ( p VARCHAR, type VARCHAR )
What is listed in p when the type is listed as free agent 1?
SELECT p FROM table_17634290_7 WHERE type = "Free agent 1"
sql_create_context
CREATE TABLE table_name_96 ( target VARCHAR, brand_name VARCHAR )
What's the target for the brand mylotarg?
SELECT target FROM table_name_96 WHERE brand_name = "mylotarg"
sql_create_context
CREATE TABLE table_204_214 ( id number, "pos" text, "no." number, "rider" text, "manufacturer" text, "laps" number, "time/retired" text, "grid" number, "points" number )
what was the total number of positions in the 125cc classification ?
SELECT COUNT("pos") FROM table_204_214
squall
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Users who post longest answers. Statistical summary of users who like to post long answers. Filters for users above a minimal post count. (Fixed to have user links and shorter column names.)
SELECT Rank = ROW_NUMBER() OVER (ORDER BY AVG(LENGTH(p.Body)) DESC), 'user_link' = p.OwnerUserId, Posts = COUNT(*), LengthAvg = AVG(LENGTH(p.Body)), LengthMax = MAX(LENGTH(p.Body)), LengthStDev = CAST(STDEV(LENGTH(p.Body)) AS INT), LengthTotal = SUM(LENGTH(p.Body)), Reputation = MIN(u.Reputation), RepPer1000Char = CAST...
sede
CREATE TABLE table_2889300_6 ( tom_tom_pads VARCHAR, drum_module VARCHAR )
in the drum module td-5 what are the tom-tom pads
SELECT tom_tom_pads FROM table_2889300_6 WHERE drum_module = "TD-5"
sql_create_context
CREATE TABLE table_16279520_1 ( release VARCHAR, timeline VARCHAR )
What is the releases number under Season 2?
SELECT release FROM table_16279520_1 WHERE timeline = "Season 2"
sql_create_context
CREATE TABLE table_29302 ( "Frequency" text, "Call sign" text, "Name" text, "Format" text, "Owner" text, "Target city/ market" text, "City of license" text )
What is the format for the station owned by Dakota Broadcasting?
SELECT "Format" FROM table_29302 WHERE "Owner" = 'Dakota Broadcasting'
wikisql
CREATE TABLE Document_Sections ( section_id INTEGER, document_code VARCHAR(15), section_sequence INTEGER, section_code VARCHAR(20), section_title VARCHAR(80) ) CREATE TABLE Images ( image_id INTEGER, image_alt_text VARCHAR(80), image_name VARCHAR(40), image_url VARCHAR(255) ) CREAT...
Return a histogram on what are the different role codes for users, and how many users have each?, and show y-axis from high to low order.
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_22982552_9 ( class_year INTEGER, player VARCHAR )
What class year was Vencie Glenn from?
SELECT MIN(class_year) FROM table_22982552_9 WHERE player = "Vencie Glenn"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
provide the number of patients whose diagnosis short title is dmi keto nt st uncontrolled and lab test category is blood gas.
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 = "DMI keto nt st uncntrld" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_name_43 ( total__kg_ INTEGER, bodyweight VARCHAR, clean_ VARCHAR, _jerk VARCHAR )
Which weightlifter, who had a bodyweight of less than 136.16 and a clean and jerk larger than 135, had the highest Total?
SELECT MAX(total__kg_) FROM table_name_43 WHERE bodyweight < 136.16 AND clean_ & _jerk > 135
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and department_id in a bar chart, and could you show by the names from high to low?
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Will next semester 's offerings include DENT 753 ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'DENT' AND course.number = 753 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) ...
Show me about the distribution of name and meter_100 in a bar chart, show by the X-axis in desc.
SELECT name, meter_100 FROM swimmer ORDER BY name DESC
nvbench
CREATE TABLE table_27622417_1 ( directed_by VARCHAR, no_in_season VARCHAR )
who were the director of the episode whose number in the season is 17?
SELECT directed_by FROM table_27622417_1 WHERE no_in_season = 17
sql_create_context
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 job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of first_name and department_id , and show in descending by the DEPARTMENT_ID.
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
nvbench
CREATE TABLE table_78729 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real )
On what date was the Record 41 32 6?
SELECT "Date" FROM table_78729 WHERE "Record" = '41–32–6'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is drug type and drug code of drug name vial?
SELECT prescriptions.drug_type, prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Vial"
mimicsql_data
CREATE TABLE table_name_31 ( competition VARCHAR, date VARCHAR )
What competition was held 1 March 1909?
SELECT competition FROM table_name_31 WHERE date = "1 march 1909"
sql_create_context
CREATE TABLE table_name_95 ( home_team VARCHAR, venue VARCHAR )
Which team played at VFL Park?
SELECT home_team FROM table_name_95 WHERE venue = "vfl park"
sql_create_context
CREATE TABLE table_29492 ( "Club" text, "Location" text, "Ground" text, "Manager" text, "Titles" real, "Last title" text )
Where is lootospark from?
SELECT "Location" FROM table_29492 WHERE "Ground" = 'Lootospark'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_i...
what is the minimum amount of hospital cost that includes macrophages until 2103?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'macrophages')) AND STRFTIME('%y', cost.chargetime) <= '2103' GROUP BY cost.hadm_id) AS t1
mimic_iii
CREATE TABLE table_50717 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the highest rank when the nation is united states (usa) and bronze is more than 1?
SELECT MAX("Rank") FROM table_50717 WHERE "Nation" = 'united states (usa)' AND "Bronze" > '1'
wikisql
CREATE TABLE table_67767 ( "Film" text, "Director(s)" text, "Producer(s)" text, "Recipient" text, "Date" text, "Award" text )
Who directed the film Antonio's Breakfast?
SELECT "Director(s)" FROM table_67767 WHERE "Film" = 'antonio''s breakfast'
wikisql
CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE advisor ( s_ID varchar(5), i_ID varchar(5) ) CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), bui...
Find the average of credits of courses that have more than one prerequisite for each department with a bar chart.
SELECT dept_name, AVG(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name
nvbench
CREATE TABLE table_45966 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Record" text )
What date had a record of 15-14-4?
SELECT "Date" FROM table_45966 WHERE "Record" = '15-14-4'
wikisql
CREATE TABLE table_45517 ( "Rank" text, "Team" text, "Athletes" text, "Run 1" text, "Run 2" text, "Run 3" text, "Run 4" text, "Final" text )
Which Athletes have a Run 2 of 2:21.82?
SELECT "Athletes" FROM table_45517 WHERE "Run 2" = '2:21.82'
wikisql
CREATE TABLE table_22742 ( "Mother Tongue" text, "Population (2006)" real, "Percentage (2006)" text, "Population (2011)" real, "Percentage (2011)" text )
How many values for population(2011) correspond to a 1.40% in 2006?
SELECT COUNT("Population (2011)") FROM table_22742 WHERE "Percentage (2006)" = '1.40%'
wikisql
CREATE TABLE Courses ( course_id VARCHAR(100), course_name VARCHAR(120), course_description VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Student_Course_Registrations ( student_id INTEGER, course_id INTEGER, registration_date DATETIME ) CREATE TABLE People ( person_id INTEGER...
How many registed students do each course have? List course name and the number of their registered students, display X in descending order.
SELECT course_name, COUNT(*) FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id JOIN Courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id ORDER BY course_name DESC
nvbench
CREATE TABLE table_44619 ( "Event" text, "Date" text, "Round" text, "Name" text, "Nationality" text, "Time" text, "Record" text )
What is the date for the name ryan lochte?
SELECT "Date" FROM table_44619 WHERE "Name" = 'ryan lochte'
wikisql
CREATE TABLE table_76286 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
who had the high points on june 8?
SELECT "High points" FROM table_76286 WHERE "Date" = 'june 8'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, ...
what was the number of patients who received a lactate dehydrogenase, ascites test since 2105?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'lactate dehydrogenase, ascites') AND STRFTIME('%y', labevents.charttime) >= '2105')
mimic_iii
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) 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, depart...
is TW flight 497 766 from ST. PETERSBURG to MILWAUKEE with 1 stop available tomorrow morning
SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight AS FLIGHT_0, flight AS FLIGHT_1, flight AS FLIGHT_2, flight_leg AS FLIGHT_LEG_0, flight_leg AS FLIGHT_LEG_1 WHERE ((((((date_day.day_number = 20 AND ...
atis
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( ...
until 2104 what were the four most commonly ordered drugs for patients of age 30s?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', medication.drugstarttime) <= '2104' GROUP BY medication.drugn...
eicu
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, visualize a bar chart about the distribution of name and the average of price , and group by attribute name, show by the X in desc please.
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is the number of patients whose insurance is self pay and diagnoses icd9 code is 5761?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Self Pay" AND diagnoses.icd9_code = "5761"
mimicsql_data
CREATE TABLE manager_half ( player_id TEXT, year INTEGER, team_id TEXT, league_id TEXT, inseason INTEGER, half INTEGER, g INTEGER, w INTEGER, l INTEGER, rank INTEGER ) CREATE TABLE team_half ( year INTEGER, league_id TEXT, team_id TEXT, half INTEGER, div_id T...
Show the trend about the total average number of attendance at home games change over the years, bin year into year interval.
SELECT year, AVG(attendance) FROM home_game GROUP BY year
nvbench
CREATE TABLE table_14562722_2 ( discs INTEGER )
Name the maximum discs
SELECT MAX(discs) FROM table_14562722_2
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id...
People with top reputation in your city.
WITH citywiderep AS (SELECT Id, DisplayName, Reputation, Location, SUM(Reputation) OVER () AS "total_stackoverflow_reputation_in_your_city" FROM Users WHERE LOWER(Location) LIKE '%visakhapatnam%') SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS rowno, *, SUM(Reputation) OVER () AS "total_stackoverflow_reputation...
sede
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,...
统计出院诊断为S71.183的在医院8274481的医疗记录中最低和最高医疗费总额分别是?
SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '8274481' AND OUT_DIAG_DIS_CD = 'S71.183')
css