context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_64660 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total for Austria when there is less than 1 bronze?
SELECT AVG("Total") FROM table_64660 WHERE "Nation" = 'austria' AND "Bronze" < '1'
wikisql
CREATE TABLE table_train_79 ( "id" int, "fasting_triglycerides" int, "fasting_total_cholesterol" int, "fasting_glucose" int, "age" float, "NOUSE" float )
laboratory findings of fasting glucose greater than or equal to 126 mg / dl
SELECT * FROM table_train_79 WHERE fasting_glucose >= 126
criteria2sql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) 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), ...
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 commission_pct in a bar chart, and I want to rank by the bar in desc.
SELECT FIRST_NAME, COMMISSION_PCT 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 table_name_76 ( points INTEGER, tyres VARCHAR, year VARCHAR )
What is the total points listed that includes P listed Tyres after 1986?
SELECT SUM(points) FROM table_name_76 WHERE tyres = "p" AND year > 1986
sql_create_context
CREATE TABLE customers ( customer_id number, customer_first_name text, customer_last_name text, customer_address text, customer_phone text, customer_email text, other_customer_details text ) CREATE TABLE accounts ( account_id number, customer_id number, account_name text, ot...
Show distinct first and last names for all customers with an account.
SELECT DISTINCT T1.customer_first_name, T1.customer_last_name FROM customers AS T1 JOIN accounts AS T2 ON T1.customer_id = T2.customer_id
spider
CREATE TABLE table_name_53 ( opponent VARCHAR, attendance VARCHAR )
Which Opponent has Attendance of 71,740?
SELECT opponent FROM table_name_53 WHERE attendance = "71,740"
sql_create_context
CREATE TABLE table_1841901_1 ( english VARCHAR, french VARCHAR )
Name the english for j'avais entendu
SELECT english FROM table_1841901_1 WHERE french = "j'avais entendu"
sql_create_context
CREATE TABLE table_36559 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the average week for the gaime against the philadelphia eagles with less than 31,066 in attendance?
SELECT AVG("Week") FROM table_36559 WHERE "Opponent" = 'philadelphia eagles' AND "Attendance" < '31,066'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Find my posts with YouTube links in.
SELECT Id AS "post_link" FROM Posts WHERE OwnerUserId = '##UserId##' AND (Body LIKE '##SearchLink##')
sede
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
先列出医疗就诊69328004439中患者被开出的所有药品编码和名称及其金额,然后把金额最低的药品去除,剩下的按金额降序排列
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 WHERE t_kc21_t_kc22.MED_CLINIC_ID = '69328004439' AND t_kc22.AMOUNT > (SELECT MIN(t_kc22.AMOUNT) FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.ME...
css
CREATE TABLE table_2846320_4 ( au_won INTEGER, games_played VARCHAR )
what was the lowest number that auburn triumphed where the activities took part was 92
SELECT MIN(au_won) FROM table_2846320_4 WHERE games_played = 92
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restr...
show all flights from DENVER 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE table_44170 ( "Rank" real, "City" text, "Province" text, "Date of Official Foundation of Municipality" real, "2006" real )
What is the sum of Rank, when Province is G l n, when Date of Official Foundation of Municipality is after 1922, and when 2006 is greater than 557366?
SELECT SUM("Rank") FROM table_44170 WHERE "Province" = 'gīlān' AND "Date of Official Foundation of Municipality" > '1922' AND "2006" > '557366'
wikisql
CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Supplier_Addresses ( supplier_id INTEGER, address_id INTEGER, date_from DATETIME, date_to D...
Return the average price for each product type by a bar chart, order by the total number in ascending please.
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price)
nvbench
CREATE TABLE table_27614571_1 ( song_choice VARCHAR, original_artist VARCHAR )
What was Barreto's song choice where the original artist was Patricia Marx?
SELECT song_choice FROM table_27614571_1 WHERE original_artist = "Patricia Marx"
sql_create_context
CREATE TABLE table_name_47 ( air_date VARCHAR )
What is the total number of ratings among the 18 to 49 group that was aired on January 7, 2009?
SELECT COUNT(18 AS _49) FROM table_name_47 WHERE air_date = "january 7, 2009"
sql_create_context
CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE author ( aid int, homepage varchar, name varchar, oid int ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE domain_publication ( did int, pid int ) CREATE TABLE domain_journal ...
return me the total citations of the papers containing keyword ' Natural Language
SELECT SUM(publication.citation_num) FROM keyword, publication, publication_keyword WHERE keyword.keyword = 'Natural Language' AND publication_keyword.kid = keyword.kid AND publication.pid = publication_keyword.pid
academic
CREATE TABLE table_name_92 ( date VARCHAR, opponent VARCHAR )
what day was the game in argentina
SELECT date FROM table_name_92 WHERE opponent = "argentina"
sql_create_context
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, ...
44482194患者在门诊诊断为龈乳头炎的超敏肌钙蛋白T的结果定量还有单位咋样?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM...
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...
在以前这个患者戚智纯有得过哪些疾病呢?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '戚智纯'
css
CREATE TABLE table_25812 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How did the game number 50 end?
SELECT "Score" FROM table_25812 WHERE "Game" = '50'
wikisql
CREATE TABLE table_45985 ( "Gatchaman" text, "Battle of the Planets" text, "G-Force" text, "Eagle Riders" text, "OVA (Harmony Gold Dub)" text, "Rank" text, "Bird Uniform" text, "Weapon" text, "Mecha" text, "Japanese voice actor" text, "Voice actor (BOTP)" text, "Voice act...
What is the Eagle Riders character voiced by Japanese voice actor Katsuji Mori?
SELECT "Eagle Riders" FROM table_45985 WHERE "Japanese voice actor" = 'katsuji mori'
wikisql
CREATE TABLE table_38885 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
When was there a record of 13 17 3?
SELECT "Date" FROM table_38885 WHERE "Record" = '13–17–3'
wikisql
CREATE TABLE table_name_94 ( rank VARCHAR, bronze VARCHAR )
Which Rank has a Bronze of 3?
SELECT rank FROM table_name_94 WHERE bronze = 3
sql_create_context
CREATE TABLE table_43035 ( "Season" text, "Team" text, "Country" text, "League" text, "Level" real, "Apps" real, "Goals" real )
What is the average Apps for the team Kairat with level larger than 1?
SELECT AVG("Apps") FROM table_43035 WHERE "Team" = 'kairat' AND "Level" > '1'
wikisql
CREATE TABLE table_name_78 ( silver INTEGER, bronze VARCHAR, total VARCHAR, gold VARCHAR )
What is the most silver medals won among nations that won more than 40 medals total, less than 25 of them being gold, and more than 15 of them being bronze?
SELECT MAX(silver) FROM table_name_78 WHERE total > 40 AND gold < 25 AND bronze > 15
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...
provide the number of patients whose death status is 1 and drug name is citalopram hydrobromide?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Citalopram Hydrobromide"
mimicsql_data
CREATE TABLE table_name_9 ( losses INTEGER, goals_against INTEGER )
for a Goals Against greater than 42 what is the number of losses?
SELECT AVG(losses) FROM table_name_9 WHERE goals_against > 42
sql_create_context
CREATE TABLE table_name_89 ( venue VARCHAR, past_season VARCHAR )
What Venue has a Past Season of 2nd?
SELECT venue FROM table_name_89 WHERE past_season = "2nd"
sql_create_context
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_na...
display types of aircraft departing from CLEVELAND to DALLAS before 1200
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND flight.departure_time < 1200 AND flight.t...
atis
CREATE TABLE table_62034 ( "Year" text, "Car number" text, "Start" text, "Qual. speed" text, "Speed rank" text, "Finish" text, "Laps completed" real, "Laps led" real )
What's the speed rank in 1963?
SELECT "Speed rank" FROM table_62034 WHERE "Year" = '1963'
wikisql
CREATE TABLE projects ( project_id number, organisation_id number, project_details text ) CREATE TABLE tasks ( task_id number, project_id number, task_details text, eg agree objectives text ) CREATE TABLE project_outcomes ( project_id number, outcome_code text, outcome_details ...
Which project made the most number of outcomes? List the project details and the project id.
SELECT T1.project_details, T1.project_id FROM projects AS T1 JOIN project_outcomes AS T2 ON T1.project_id = T2.project_id GROUP BY T1.project_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_29039942_1 ( title VARCHAR, director VARCHAR )
What episode did tomoyuki furumaya
SELECT title FROM table_29039942_1 WHERE director = "Tomoyuki Furumaya"
sql_create_context
CREATE TABLE table_name_26 ( cardiff_win VARCHAR, draw INTEGER )
How many cardiff wins have a draw greater than 27?
SELECT COUNT(cardiff_win) FROM table_name_26 WHERE draw > 27
sql_create_context
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(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and manager_id in a bar chart, and could you show by the total number in desc?
SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC
nvbench
CREATE TABLE hall_of_fame ( player_id text, yearid number, votedby text, ballots number, needed number, votes number, inducted text, category text, needed_note text ) CREATE TABLE pitching ( player_id text, year number, stint number, team_id text, league_id text,...
Find the name and id of the team that won the most times in 2008 postseason.
SELECT T2.name, T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_25563 ( "R" real, "Player" text, "Position" text, "League" real, "Champions League" real, "Copa del Rey" real, "Total" real )
Name the least total for sergio ramos
SELECT MIN("Total") FROM table_25563 WHERE "Player" = 'Sergio Ramos'
wikisql
CREATE TABLE table_13237 ( "Position" text, "Player" text, "Loaned to" text, "Date" text, "Loan expires" text )
What date has a loan expires date of end of the season, and a Position of mf?
SELECT "Date" FROM table_13237 WHERE "Loan expires" = 'end of the season' AND "Position" = 'mf'
wikisql
CREATE TABLE table_64900 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
What are the total apps that have 41 as the League apps, with total goals greater than 1?
SELECT "Total Apps" FROM table_64900 WHERE "League Apps" = '41' AND "Total Goals" > '1'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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 varc...
For those employees who was hired before 2002-06-21, return a scatter chart about the correlation between employee_id and commission_pct .
SELECT EMPLOYEE_ID, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_53011 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Trofeo Fast Team" text )
Who had the general classification when the trofeo fast team was Mapei-Bricobi, the points classification went to Mariano Piccoli and the mountains classification went to Marco Pantani in stage 22?
SELECT "General classification" FROM table_53011 WHERE "Trofeo Fast Team" = 'mapei-bricobi' AND "Points classification" = 'mariano piccoli' AND "Mountains classification" = 'marco pantani' AND "Stage" = '22'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
哪些医务人员为患者何莹琇在12年2月15日到17年2月23日期间进行过检测指标048093的检查姓名和工号都是什么?
(SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND j...
css
CREATE TABLE table_41000 ( "Name" text, "Number" real, "Position" text, "Year" text, "Hometown" text )
What is the lowest number of the player with a hometown of Bellwood, IL?
SELECT MIN("Number") FROM table_41000 WHERE "Hometown" = 'bellwood, il'
wikisql
CREATE TABLE albums ( id INTEGER, title VARCHAR(160), artist_id INTEGER ) CREATE TABLE playlist_tracks ( playlist_id INTEGER, track_id INTEGER ) CREATE TABLE tracks ( id INTEGER, name VARCHAR(200), album_id INTEGER, media_type_id INTEGER, genre_id INTEGER, composer VARCHAR(...
Return a histogram on how many invoices were billed from each state?
SELECT billing_state, COUNT(*) FROM invoices WHERE billing_country = "USA" GROUP BY billing_state
nvbench
CREATE TABLE table_51052 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
What is Date, when Winner is 'Murilo Figueiredo'?
SELECT "Date" FROM table_51052 WHERE "Winner" = 'murilo figueiredo'
wikisql
CREATE TABLE table_15652 ( "Date" text, "Round" text, "Opponents" text, "Result F\u2013A" text, "Attendance" real )
Name the most attendance for 19 february 2005
SELECT MAX("Attendance") FROM table_15652 WHERE "Date" = '19 february 2005'
wikisql
CREATE TABLE table_name_66 ( year INTEGER, start VARCHAR )
Which Year has a Start of 14?
SELECT AVG(year) FROM table_name_66 WHERE start = "14"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
how many patients during this year were staying in the ward 425?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 425 AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
eicu
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...
姓名是吕经艺的患者的哪些检验报告单上的检验结论指标都正常的?具体的检验报告单号是啥?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 hz_info.person_info_XM = '吕经艺' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgz...
css
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
Who is teaching MICRBIOL 320 in the Spring ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
advising
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Comments ( Id number, PostId number, Score num...
All queries with tag 'pandas'.
SELECT * FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'pandas'
sede
CREATE TABLE table_25128 ( "Best Male MC" text, "Best Female MC" text, "Best Male Artist" text, "Best Female Artist" text, "Best Male Lyricist" text, "Best Female Lyricist" text, "Best Male Record" text )
Who got the best male record when best female mc is tino baby & 5'6'?
SELECT "Best Male Record" FROM table_25128 WHERE "Best Female MC" = 'Tino Baby & 5''6'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
医疗记录中年龄低于23岁的患者的医疗费平均金额是多少
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE < 23)
css
CREATE TABLE table_21320 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
What was the location and where did the team play game number 32?
SELECT "Location/Attendance" FROM table_21320 WHERE "Game" = '32'
wikisql
CREATE TABLE table_22429 ( "Position" real, "Sail Number" text, "Yacht" text, "State/Country" text, "Yacht Type" text, "LOA (Metres)" text, "Skipper" text, "Corrected Time d:hh:mm:ss" text )
What was the loa when the corrected time was 2:12:36:23?
SELECT "LOA (Metres)" FROM table_22429 WHERE "Corrected Time d:hh:mm:ss" = '2:12:36:23'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
what was the name of the drugs that patient 99647 was prescribed last in the current hospital visit.
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99647 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_60697 ( "Season" text, "League" text, "Teams" text, "Home" text, "Away" text )
What is the home for league 3rd liga, and an away of 4-0?
SELECT "Home" FROM table_60697 WHERE "League" = '3rd liga' AND "Away" = '4-0'
wikisql
CREATE TABLE TRACK ( Milliseconds INTEGER )
What are the durations of the longest and the shortest tracks in milliseconds?
SELECT MAX(Milliseconds), MIN(Milliseconds) FROM TRACK
sql_create_context
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 all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by time, and list Y in asc order please.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY COUNT(HIRE_DATE)
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) ...
what did patient 005-19985 receive for his or her first procedure during this year?
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-19985')) AND DATETIME(treatment.treatmenttime, 'start of year...
eicu
CREATE TABLE table_34145 ( "Rank" text, "Common of" text, "Population" real, "Area (km 2 )" real, "Density (inhabitants/km 2 )" real, "Altitude (mslm)" real )
Which Altitude (mslm) has a Density (inhabitants/km 2) smaller than 1233, and a Rank of 9th?
SELECT SUM("Altitude (mslm)") FROM table_34145 WHERE "Density (inhabitants/km 2 )" < '1233' AND "Rank" = '9th'
wikisql
CREATE TABLE table_204_275 ( id number, "date" text, "city" text, "opponent" text, "results" text, "scorers" text, "type of game" text )
what game had the most total goals scored ?
SELECT "date" FROM table_204_275 ORDER BY "results" DESC LIMIT 1
squall
CREATE TABLE table_203_354 ( id number, "party" text, "candidate(s)" text, "votes" number, "percentage" number )
how many different parties are listed ?
SELECT COUNT(DISTINCT "party") FROM table_203_354
squall
CREATE TABLE table_1939 ( "Athlete" text, "Class" text, "Event" text, "Round 1" text, "Round 2" text, "Round 3" text, "1/8 Finals" text, "Quarterfinals" text, "Semifinals" text, "Final/ Bronze medal contest" text )
Name the total number of round 3 for class tt1
SELECT COUNT("Round 3") FROM table_1939 WHERE "Class" = 'TT1'
wikisql
CREATE TABLE table_name_51 ( country VARCHAR, date VARCHAR, sign VARCHAR )
Name the country for the 9th and sign of g e
SELECT country FROM table_name_51 WHERE date = "9th" AND sign = "g e"
sql_create_context
CREATE TABLE table_10922 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
What's the hometown of the player who is 6-4?
SELECT "Hometown" FROM table_10922 WHERE "Height" = '6-4'
wikisql
CREATE TABLE table_26200084_1 ( title VARCHAR, directed_by VARCHAR )
What was the title of the episode directed by David Mamet?
SELECT title FROM table_26200084_1 WHERE directed_by = "David Mamet"
sql_create_context
CREATE TABLE table_31731 ( "Hangul" text, "Hanja" text, "Revised" text, "McCune-Reischauer" text, "Estimated distribution (2000)*" real )
Tell me the hanja of eum
SELECT "Hanja" FROM table_31731 WHERE "Revised" = 'eum'
wikisql
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, ...
What is the number of divorced patients for whom a troponin t lab test was ordered?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Troponin T"
mimicsql_data
CREATE TABLE table_21082 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" text, "Year named" real, "Name origin" text )
What is every year named for the latitude of 66.5N?
SELECT "Year named" FROM table_21082 WHERE "Latitude" = '66.5N'
wikisql
CREATE TABLE table_29392 ( "Province" text, "Registered voters" real, "People voted" real, "Valid votes" real, "Invalid votes" real, "Yes" real, "Yes (%)" text, "No" real, "No (%)" text, "Turnout (%)" text )
What was the turnout percentage when the percentage of people that voted no was 36.51?
SELECT "Turnout (%)" FROM table_29392 WHERE "No (%)" = '36.51'
wikisql
CREATE TABLE table_44434 ( "Year" real, "Date held" text, "Winner" text, "Events won by KCL" real, "Events won by KCLMS" real )
How many years were the events won by KCLMS less than 7?
SELECT COUNT("Year") FROM table_44434 WHERE "Events won by KCLMS" < '7'
wikisql
CREATE TABLE table_78378 ( "Season" text, "1st Division" text, "Relegated" text, "2nd Division" text, "Promoted" text )
What was relegated in the 2006 season?
SELECT "Relegated" FROM table_78378 WHERE "Season" = '2006'
wikisql
CREATE TABLE table_79459 ( "Title" text, "Series" text, "Director" text, "Production Number" real, "Release date" text )
What is the title with the production number greater than 1334 released on 1955-08-27?
SELECT "Title" FROM table_79459 WHERE "Production Number" > '1334' AND "Release date" = '1955-08-27'
wikisql
CREATE TABLE table_name_89 ( result VARCHAR, competition VARCHAR, date VARCHAR )
What is the result of the International Friendly competition on May 15, 1966?
SELECT result FROM table_name_89 WHERE competition = "international friendly" AND date = "may 15, 1966"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients under the age of 27 had the lab test called human chorionic gonadotropin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "27" AND lab.label = "Human Chorionic Gonadotropin"
mimicsql_data
CREATE TABLE table_1357052_6 ( grsecurity VARCHAR, distribution VARCHAR )
what's the grsecurity with dbeingtribution being debian / ubuntu
SELECT grsecurity FROM table_1357052_6 WHERE distribution = "Debian / Ubuntu"
sql_create_context
CREATE TABLE table_name_9 ( frequency_mhz INTEGER, program VARCHAR )
What is the average MHz Frequency of radio rezonans?
SELECT AVG(frequency_mhz) FROM table_name_9 WHERE program = "radio rezonans"
sql_create_context
CREATE TABLE table_24431264_18 ( player VARCHAR, new_points VARCHAR )
List the players with 1285 new points?
SELECT player FROM table_24431264_18 WHERE new_points = 1285
sql_create_context
CREATE TABLE table_38854 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text )
What is the day in December of the game against the Boston Bruins?
SELECT COUNT("December") FROM table_38854 WHERE "Opponent" = 'boston bruins'
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 number of patients diagnosed with primary disease as congestive heart failure had the drug route as pb?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "CONGESTIVE HEART FAILURE" AND prescriptions.route = "PB"
mimicsql_data
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Owners of the most closed questions.
SELECT OwnerUserId AS "user_link", COUNT(*) AS Count FROM Posts WHERE NOT ClosedDate IS NULL GROUP BY OwnerUserId ORDER BY Count DESC, OwnerUserId LIMIT 100
sede
CREATE TABLE table_56378 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the score when there were more than 14,381 in attendance and Phoenix was the visitor and Chicago was home?
SELECT "Score" FROM table_56378 WHERE "Attendance" > '14,381' AND "Visitor" = 'phoenix' AND "Home" = 'chicago'
wikisql
CREATE TABLE table_name_89 ( opponent_in_the_final VARCHAR, surface VARCHAR, score VARCHAR )
Who was the opponent in the final in which the court surface was hard and the score was 6 3, 3 6, 7 5?
SELECT opponent_in_the_final FROM table_name_89 WHERE surface = "hard" AND score = "6–3, 3–6, 7–5"
sql_create_context
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE month ( month_number int, month_name text ) CREATE TA...
all flights from PITTSBURGH to DALLAS round trip after 12pm less than 100
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, fare AS FARE_0, fare AS FARE_1, flight, flight_fare AS FLIGHT_FARE_0, flight_fare AS FLIGHT_FARE_1 WHERE ((FARE_1.round_trip_cost < 100 AND FLIGHT_FARE_1.fare_id = FARE_1.far...
atis
CREATE TABLE table_36771 ( "Call sign" text, "Frequency" text, "City of license" text, "Facility ID" real, "ERP / Power W" real, "Height m ( ft )" text, "Class" text )
Which Facility ID has a City of license of springfield, ma, and a ERP / Power W smaller than 230?
SELECT MAX("Facility ID") FROM table_36771 WHERE "City of license" = 'springfield, ma' AND "ERP / Power W" < '230'
wikisql
CREATE TABLE table_name_54 ( pct INTEGER, independent VARCHAR, years VARCHAR )
What is the lowest PCT when Old Dominion is the independent and the years is more than 4?
SELECT MIN(pct) FROM table_name_54 WHERE independent = "old dominion" AND years > 4
sql_create_context
CREATE TABLE table_204_780 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
how many times did he compete in the european championships ?
SELECT COUNT(*) FROM table_204_780 WHERE "competition" = 'european championships'
squall
CREATE TABLE table_name_1 ( original_title VARCHAR, film_title_used_in_nomination VARCHAR )
What's the original title of the nomination title, 'brecha en el silencio'?
SELECT original_title FROM table_name_1 WHERE film_title_used_in_nomination = "brecha en el silencio"
sql_create_context
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, return a bar chart about the distribution of name and the sum of manufacturer , and group by attribute name.
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 table_17675675_2 ( tries_for VARCHAR, lost VARCHAR )
With the given loss of 4, what was the number of tries?
SELECT COUNT(tries_for) FROM table_17675675_2 WHERE lost = "4"
sql_create_context
CREATE TABLE table_40975 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Set 4" text, "Set 5" text, "Total" text )
What is the set 2 with a 25-23 set 1 and a 17-19 set 5?
SELECT "Set 2" FROM table_40975 WHERE "Set 1" = '25-23' AND "Set 5" = '17-19'
wikisql
CREATE TABLE table_542 ( "Team" text, "Car(s)" text, "#" real, "Driver(s)" text, "Primary Sponsor(s)" text, "Owner(s)" text, "Crew Chief" text, "Rounds" real )
What is the largest number of rounds for the team that hired Donnie Wingo as crew chief?
SELECT MAX("Rounds") FROM table_542 WHERE "Crew Chief" = 'Donnie Wingo'
wikisql
CREATE TABLE table_28621 ( "Year" real, "Under-11" text, "Under-13" text, "Under-15" text, "Under-17" text, "Under-19" text )
What is every value for Under-11 if Under-19 is Leong Siu Lynn?
SELECT "Under-11" FROM table_28621 WHERE "Under-19" = 'Leong Siu Lynn'
wikisql
CREATE TABLE table_37752 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School" text )
What is the average pick for clarence mason?
SELECT AVG("Pick") FROM table_37752 WHERE "Player" = 'clarence mason'
wikisql
CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ) CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ...
List the venues of debates in ascending order of the number of audience, and count them by a bar chart
SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue ORDER BY Num_of_Audience
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 subject name and insurance of subject id 2560?
SELECT demographic.name, demographic.insurance FROM demographic WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt ...
what is the earliest flight between BOS and BWI
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (AIRPORT_0.airport_code = 'BOS' AND AIRPORT_1.airport_code = 'BWI' AND flight.from_airport = AIRPORT_0.airport_code AND flight.to_airport = AIRPORT_1.airport_code) AND flight.departure_time = (SELECT MIN(FLIGHTalias1.departur...
atis
CREATE TABLE table_16736 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
what's the date with rnd 1
SELECT "Date" FROM table_16736 WHERE "Rnd" = '1'
wikisql
CREATE TABLE table_71713 ( "Model/Engine" text, "Capacity" text, "Cylinders/Valves" text, "Power/rpm" text, "Torque (Nm)/rpm" text )
Name the power for 1.8 duratorq
SELECT "Power/rpm" FROM table_71713 WHERE "Model/Engine" = '1.8 duratorq'
wikisql