context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_36654 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What is the NHL team that had pick number 32?
SELECT "NHL team" FROM table_36654 WHERE "Pick #" = '32'
wikisql
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_nu...
could i have a listing of flights leaving BOSTON going to BALTIMORE leaving wednesday after 2100
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, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
atis
CREATE TABLE player ( School_ID VARCHAR ) CREATE TABLE school ( Denomination VARCHAR, School_ID VARCHAR )
Show the denomination of the school that has the most players.
SELECT T2.Denomination FROM player AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T1.School_ID ORDER BY COUNT(*) DESC LIMIT 1
sql_create_context
CREATE TABLE table_name_6 ( title VARCHAR, written_by VARCHAR )
What is the title of the episode written by David J. Burke?
SELECT title FROM table_name_6 WHERE written_by = "david j. burke"
sql_create_context
CREATE TABLE table_name_40 ( manufacturer VARCHAR, type VARCHAR )
Which manufacturer made a locomotive with a type of 4-6-4t?
SELECT manufacturer FROM table_name_40 WHERE type = "4-6-4t"
sql_create_context
CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), Building VARCHAR(13) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, acti...
How many faculty members do we have for each rank? render a bar chart, and sort from high to low by the Y.
SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY COUNT(Rank) DESC
nvbench
CREATE TABLE catalog_structure ( catalog_level_number number, catalog_id number, catalog_level_name text ) CREATE TABLE catalogs ( catalog_id number, catalog_name text, catalog_publisher text, date_of_publication time, date_of_latest_revision time ) CREATE TABLE catalog_contents_additi...
What are the attribute data types with more than 3 attribute definitions?
SELECT attribute_data_type FROM attribute_definitions GROUP BY attribute_data_type HAVING COUNT(*) > 3
spider
CREATE TABLE table_26996293_2 ( player VARCHAR, cfl_team VARCHAR )
where cfl team is winnipeg (3) via hamilton what are all the player
SELECT player FROM table_26996293_2 WHERE cfl_team = "Winnipeg (3) via Hamilton"
sql_create_context
CREATE TABLE table_204_568 ( id number, "pennant" text, "name" text, "hull builder" text, "ordered" text, "laid down" text, "launched" text, "accepted into service" text, "commissioned" text, "est. building cost" text, "fate" text )
what is the next pennant after f172 ?
SELECT "pennant" FROM table_204_568 WHERE id = (SELECT id FROM table_204_568 WHERE "pennant" = 'f172') + 1
squall
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, ...
在15年1月24号到17年7月1号期间医疗机构6950309住院时长超过27天的住院就诊记录数是多少?
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '69...
css
CREATE TABLE table_name_39 ( leagues_entering_at_this_round VARCHAR, clubs_remaining VARCHAR )
What league is entering this round with 24 clubs remaining?
SELECT leagues_entering_at_this_round FROM table_name_39 WHERE clubs_remaining = 24
sql_create_context
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 d_labitems ( row_id number, itemid number, label text ) CREATE TABLE microbiologyevents...
how much is the cost of a accid punc/op lac dura diagnosis?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'accid punc/op lac dura'))
mimic_iii
CREATE TABLE county_public_safety ( county_id number, name text, population number, police_officers number, residents_per_officer number, case_burden number, crime_rate number, police_force text, location text ) CREATE TABLE city ( city_id number, county_id number, name ...
How many counties correspond to each police force?
SELECT police_force, COUNT(*) FROM county_public_safety GROUP BY police_force
spider
CREATE TABLE table_36961 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 2004" text )
Which venue has a capacity over 41,040 for Darida?
SELECT "Venue" FROM table_36961 WHERE "Capacity" > '41,040' AND "Team" = 'darida'
wikisql
CREATE TABLE table_48953 ( "Date" text, "Venue" text, "Opponents" text, "Score" text, "Round" text, "Djurg\u00e5rden scorers" text, "Attendance" text )
What is the Score that has a Date of 2005-10-29?
SELECT "Score" FROM table_48953 WHERE "Date" = '2005-10-29'
wikisql
CREATE TABLE table_60401 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
What is Game, when Road Team is 'Syracuse', and when Result is '96-89'?
SELECT "Game" FROM table_60401 WHERE "Road Team" = 'syracuse' AND "Result" = '96-89'
wikisql
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 )
Find the total revenue for each manufacturer Plot them as bar chart, could you display by the y-axis in descending please?
SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY SUM(Revenue) DESC
nvbench
CREATE TABLE table_name_69 ( country VARCHAR, team VARCHAR )
What country is the Eurasia Astana team from?
SELECT country FROM table_name_69 WHERE team = "eurasia astana"
sql_create_context
CREATE TABLE table_13789 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Which opponent has September 14, 2003 as the date?
SELECT "Opponent" FROM table_13789 WHERE "Date" = 'september 14, 2003'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
what were the names of the output that patient 030-42006 had first on this month/25?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006')) AND intakeoutput.cellpath LIKE '%output%' AND D...
eicu
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREAT...
What is the oldest age for each gender of student? Return a bar chart, could you order by the Y in asc?
SELECT Sex, MAX(Age) FROM Student GROUP BY Sex ORDER BY MAX(Age)
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
How many patients diagnosed with paroxysmal ventricular tachycardia have a hematology lab test category?
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.long_title = "Paroxysmal ventricular tachycardia" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
how many patients were prescribed with propofol in the same month in this year after the procedure of hemodialysis?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'hemodialysi...
mimic_iii
CREATE TABLE table_7741 ( "Region" text, "Date" real, "Label" text, "Format" text, "Catalog" text )
What Region was the Catalog magik muzik 805-5 released in?
SELECT "Region" FROM table_7741 WHERE "Catalog" = 'magik muzik 805-5'
wikisql
CREATE TABLE table_name_69 ( tries_for INTEGER, points_diff VARCHAR, points_against VARCHAR, tries_against VARCHAR )
Which Tries for has Points against larger than 87, and Tries against smaller than 28, and Points diff of +63?
SELECT AVG(tries_for) FROM table_name_69 WHERE points_against > 87 AND tries_against < 28 AND points_diff = "+63"
sql_create_context
CREATE TABLE table_name_1 ( date VARCHAR, attendance VARCHAR, week VARCHAR, venue VARCHAR )
Which date's week was more than 4 with the venue being City Stadium and where the attendance was more than 14,297?
SELECT date FROM table_name_1 WHERE week > 4 AND venue = "city stadium" AND attendance > 14 OFFSET 297
sql_create_context
CREATE TABLE table_225205_3 ( vacator VARCHAR, reason_for_change VARCHAR )
Name the vacator for failure to elect
SELECT vacator FROM table_225205_3 WHERE reason_for_change = "Failure to elect"
sql_create_context
CREATE TABLE table_38978 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which December has a Record of 21 7 2, and a Game larger than 30?
SELECT MAX("December") FROM table_38978 WHERE "Record" = '21–7–2' AND "Game" > '30'
wikisql
CREATE TABLE table_1473672_2 ( nhl_team VARCHAR, player VARCHAR )
What nhl team does dwight bialowas play for?
SELECT nhl_team FROM table_1473672_2 WHERE player = "Dwight Bialowas"
sql_create_context
CREATE TABLE table_50711 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text )
What is College, when Pick is less than 145, and when Player is Jeff Wilkins?
SELECT "College" FROM table_50711 WHERE "Pick" < '145' AND "Player" = 'jeff wilkins'
wikisql
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,...
病患许智勇有哪些病是在11年1月29日到18年6月1日间主要看的?
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_NM = '许智勇' AND IN_HOSP_DATE BETWEEN '2011-01-29' AND '2018-06-01' GROUP BY IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1
css
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_prerequisite ( pre_cour...
588 has a lab ?
SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 588
advising
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, sort total number of salary from high to low order please.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(SALARY) DESC
nvbench
CREATE TABLE table_75771 ( "County" text, "Population (2011)" real, "Population (2006)" real, "Change (%)" real, "Area (km\u00b2)" real, "Population density" real )
In the County of Prince, what was the highest Population density when the Area (km ) was larger than 3.02, and the Population (2006) was larger than 786, and the Population (2011) was smaller than 1135?
SELECT MAX("Population density") FROM table_75771 WHERE "County" = 'prince' AND "Area (km\u00b2)" > '3.02' AND "Population (2006)" > '786' AND "Population (2011)" < '1135'
wikisql
CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text ) CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int )
Bar chart x axis type y axis the total number, and show names from high to low order please.
SELECT Type, COUNT(*) FROM ship GROUP BY Type ORDER BY Type DESC
nvbench
CREATE TABLE table_3731 ( "Country" text, "Total Drivers" real, "Champions" text, "Championships" text, "Current 3 November 2013" real, "First driver(s)" text, "Last/Current driver(s) 3 November 2013" text )
How many times is last/current driver(s) 3 november 2013 is adderly fong ( 2013 )?
SELECT COUNT("Country") FROM table_3731 WHERE "Last/Current driver(s) 3 November 2013" = 'Adderly Fong ( 2013 )'
wikisql
CREATE TABLE table_77519 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real )
what is the highest goals against when the wins is less than 1?
SELECT MAX("Goals Against") FROM table_77519 WHERE "Wins" < '1'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, ...
what is the four year survival rate of patients who have been diagnosed with allrgic gastro & colitis?
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
mimic_iii
CREATE TABLE gyb ( 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...
患者85618311被开出的药品均不超过2746.51元在哪几次医疗记录中?医疗就诊编号是多少?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_ID = '85618311' AND NOT qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2746.51) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_ID = '85618311' AND NOT gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_k...
css
CREATE TABLE table_34771 ( "Event" text, "Gold" text, "Silver" text, "Bronze" text, "4th place" text )
Who won the gold when Jules van Dyk Belgium won bronze?
SELECT "Gold" FROM table_34771 WHERE "Bronze" = 'jules van dyk belgium'
wikisql
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 products with a price between 60 and 120, draw a bar chart about the distribution of name and code , I want to order Y-axis in descending order.
SELECT Name, Code FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Code DESC
nvbench
CREATE TABLE table_12310814_1 ( result VARCHAR, episode VARCHAR )
What was the result of the Top 3 episode?
SELECT result FROM table_12310814_1 WHERE episode = "Top 3"
sql_create_context
CREATE TABLE table_name_31 ( time INTEGER, athlete VARCHAR, rank VARCHAR )
What is the highest time for athlete torri edwards, and a rank larger than 6?
SELECT MAX(time) FROM table_name_31 WHERE athlete = "torri edwards" AND rank > 6
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 those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the average of department_id bin hire_date by weekday, and visualize them by a bar chart, could you show in ascending by the total number?
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE table_name_62 ( silver INTEGER, gold VARCHAR )
How many silver medals did the country that won 20 gold medals win in the 1955 Pan American Games?
SELECT SUM(silver) FROM table_name_62 WHERE gold = 20
sql_create_context
CREATE TABLE table_name_42 ( points INTEGER, year VARCHAR, class VARCHAR )
What is the sum of Points, when Year is after 1959, and when Class is 250cc?
SELECT SUM(points) FROM table_name_42 WHERE year > 1959 AND class = "250cc"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
which patients have been hospitalized for more than 5 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "5"
mimicsql_data
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...
自一二年三月十九日起到一三年五月二十三日的这段时间里,7349327这个医疗机构一共有多少检查费
SELECT SUM(t_kc22.AMOUNT) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '7349327' AND t_kc22.STA_DATE BETWEEN '2012-03-19' AND '2013-05-23' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT SUM(t_kc22.AMOUNT) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID ...
css
CREATE TABLE table_name_85 ( att_cmp_int VARCHAR, effic VARCHAR )
what was the att-cmp-int for the qb with an effic of 127.89?
SELECT att_cmp_int FROM table_name_85 WHERE effic = 127.89
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGui...
Gieco Max Number of Comments for a Single Post.
SELECT Id, CommentCount FROM Posts ORDER BY CommentCount DESC LIMIT 1
sede
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
what is the daily minimum value of wbc x 1000 of patient 010-9767 in 03/2105?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-9767')) AND lab.labname = 'wbc x 1000' AND STRFTIME('%y-%m', lab.labresulttime...
eicu
CREATE TABLE table_name_25 ( lost INTEGER, points VARCHAR, games VARCHAR )
What is the fewest losses associated with more than 13 points and fewer than 8 games?
SELECT MIN(lost) FROM table_name_25 WHERE points > 13 AND games < 8
sql_create_context
CREATE TABLE table_19297 ( "Celebrity" text, "Famous for" text, "Entered" text, "Exited" text, "Finished" text )
Who is the famous for that finished 2nd?
SELECT "Famous for" FROM table_19297 WHERE "Finished" = '2nd'
wikisql
CREATE TABLE table_name_52 ( _percentage_2006 INTEGER, _percentage_2001 INTEGER )
What is the %2006 when the %2001 was more than 62.5?
SELECT AVG(_percentage_2006) FROM table_name_52 WHERE _percentage_2001 > 62.5
sql_create_context
CREATE TABLE table_1342331_43 ( candidates VARCHAR, incumbent VARCHAR )
What is the name of the candidate where the incumbent is named James P. Buchanan?
SELECT candidates FROM table_1342331_43 WHERE incumbent = "James P. Buchanan"
sql_create_context
CREATE TABLE mzjzjlb ( YLJGDM text, JZLSH text, KH text, KLX number, MJZH text, HZXM text, NLS number, NLY number, ZSEBZ number, JZZTDM number, JZZTMC text, JZJSSJ time, TXBZ number, ZZBZ number, WDBZ number, JZKSBM text, JZKSMC text, JZKSRQ time, ...
凤雨筠这位患者之前会有哪些异常反应
(SELECT * 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 jybgb.YLJGDM = jyjgzbb.YLJGD...
css
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...
病人在医疗就诊43577084038中被开出的所有药物的编码和名称及其金额需要列出来,这些药品中金额最低的给去除后按金额降序排列
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 = '43577084038' 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_48067 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Silver has a Total of 7, and a Gold larger than 1?
SELECT AVG("Silver") FROM table_48067 WHERE "Total" = '7' AND "Gold" > '1'
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...
这位患者00768748号在医院6769443出院时姓马的医生为其出院诊断出院结果是哪次?
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '00768748' AND qtb.MED_SER_ORG_NO = '6769443' AND qtb.OUT_DIAG_DOC_NM LIKE '马%' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '00768748' AND gyb.MED_SER_ORG_NO = '6769443' AND gyb.OUT_DIAG_DOC_NM LIKE '...
css
CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE albums ( aid number, title text, year number, label text, type text ) CREATE TABLE instruments ( songid number, bandmateid ...
What are the names of the songs without a lead vocal?
SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE type = "lead"
spider
CREATE TABLE table_72379 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the party for jack thomas brinkley
SELECT "Party" FROM table_72379 WHERE "Incumbent" = 'Jack Thomas Brinkley'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location 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 varchar, state varchar, countr...
Does every upper-level class have an examination ?
SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%'
advising
CREATE TABLE table_25677 ( "Stage" real, "Winner" text, "General classification" text, "Mountains classification" text, "Points classification" text, "Youth classification" text, "Team Classification" text )
Who was the Youth Classification in the race with Kenneth Hanson as Mountains Classification and Lucas Sebastian Haedo as winner?
SELECT "Youth classification" FROM table_25677 WHERE "Mountains classification" = 'Kenneth Hanson' AND "Winner" = 'Lucas Sebastian Haedo'
wikisql
CREATE TABLE table_name_95 ( winner VARCHAR, circuit VARCHAR, series VARCHAR )
What is Winner, when Circuit is Mallala Motor Sport Park, and when Series is ASTC Round 6?
SELECT winner FROM table_name_95 WHERE circuit = "mallala motor sport park" AND series = "astc round 6"
sql_create_context
CREATE TABLE table_46685 ( "Player" text, "Games Played" real, "Minutes Played" real, "Minutes Played Per Game" real, "Rebounds" real, "Rebounds Per Game" real, "Assists" real, "Assists Per Game" real, "Field Goal %" real, "Free Throw %" real, "Points" real, "Points Per G...
What is the lowest Minutes Played Per Game, when Rebounds is less than 347, when Assists is greater than 5, and when Minutes Played is less than 301?
SELECT MIN("Minutes Played Per Game") FROM table_46685 WHERE "Rebounds" < '347' AND "Assists" > '5' AND "Minutes Played" < '301'
wikisql
CREATE TABLE table_17990 ( "Year" real, "Competition" text, "Location" text, "Event" text, "Final-Rank" text, "Final-Score" text, "Qualifying Rank" real, "Qualifying Score" text )
what is the year where the qualifying score was 15.150?
SELECT "Year" FROM table_17990 WHERE "Qualifying Score" = '15.150'
wikisql
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, ...
what planes are used by TW
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, equipment_sequence, flight WHERE equipment_sequence.aircraft_code = aircraft.aircraft_code AND flight.aircraft_code_sequence = equipment_sequence.aircraft_code_sequence AND flight.airline_code = 'TW'
atis
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
住院就诊的患者中谁的检验报告单的编号是94625262145?
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zyjzjlb JOIN jybgb JOIN zyjzjlb_jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND zyjzjlb.YLJGDM = zyjzjlb_jybgb.YLJGDM_ZYJZJLB AND zyjzjlb.JZLSH = jybgb.JZLSH_ZYJZJLB AND zy...
css
CREATE TABLE table_12584173_1 ( population__stanthorpe_ INTEGER, population__rosenthal_ VARCHAR )
What was the population in Stanthorpe in the year when the population in Rosenthal was 1548?
SELECT MAX(population__stanthorpe_) FROM table_12584173_1 WHERE population__rosenthal_ = 1548
sql_create_context
CREATE TABLE table_52573 ( "Player" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text, "Venue" text, "Date" text )
Which player has 2 tries and 0 drops?
SELECT "Player" FROM table_52573 WHERE "Drop" = '0' AND "Tries" = '2'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give me the number of patients whose days of hospital stay is greater than 29 and drug route is nu?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "29" AND prescriptions.route = "NU"
mimicsql_data
CREATE TABLE table_43680 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text )
What is the rank of the film directed by danny devito?
SELECT "Rank" FROM table_43680 WHERE "Director" = 'danny devito'
wikisql
CREATE TABLE Timed_Status_of_Things ( Status_of_Thing_Code VARCHAR )
How many different status codes of things are there?
SELECT COUNT(DISTINCT Status_of_Thing_Code) FROM Timed_Status_of_Things
sql_create_context
CREATE TABLE table_name_20 ( total INTEGER, club VARCHAR, fa_cup_goals VARCHAR, league_goals VARCHAR )
What is the average Total, when FA Cup Goals is 1, when League Goals is 10, and when Club is Crystal Palace?
SELECT AVG(total) FROM table_name_20 WHERE fa_cup_goals = "1" AND league_goals = "10" AND club = "crystal palace"
sql_create_context
CREATE TABLE table_40559 ( "Country" text, "Laws against homosexuality" text, "Penalty" text, "Same-sex Unions" text, "Laws against discrimination" text )
What are the laws against homosexuality in Malaysia?
SELECT "Laws against homosexuality" FROM table_40559 WHERE "Country" = 'malaysia'
wikisql
CREATE TABLE roles ( role_code text, role_description text ) CREATE TABLE images ( image_id number, image_alt_text text, image_name text, image_url text ) CREATE TABLE users ( user_id number, role_code text, user_name text, user_login text, password text ) CREATE TABLE doc...
Return the structure description of the document that has been accessed the fewest number of times.
SELECT t2.document_structure_description FROM documents AS t1 JOIN document_structures AS t2 ON t1.document_structure_code = t2.document_structure_code GROUP BY t1.document_structure_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
排出对于王志尚病人就医记录中医疗费总额不少于5598.78元的入院诊断疾病序号是什么和名称叫什么?
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '王志尚' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 5598.78)
css
CREATE TABLE table_25024 ( "Year" real, "1st Venue" text, "2nd Venue" text, "3rd Venue" text, "4th Venue" text, "5th Venue" text )
What city was in the 3rd venue when Mexico City was in the 2nd?
SELECT "3rd Venue" FROM table_25024 WHERE "2nd Venue" = 'Mexico City'
wikisql
CREATE TABLE table_name_60 ( points INTEGER, engine VARCHAR, year VARCHAR, entrant VARCHAR )
What's the total points that Scuderia Ferrari with a Ferrari V12 engine have before 1971?
SELECT SUM(points) FROM table_name_60 WHERE year < 1971 AND entrant = "scuderia ferrari" AND engine = "ferrari v12"
sql_create_context
CREATE TABLE table_35395 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
What Position has a Round that's larger than 21?
SELECT "Position" FROM table_35395 WHERE "Round" > '21'
wikisql
CREATE TABLE table_name_11 ( type VARCHAR, e_coli VARCHAR )
What is the type of glycosylase that has an E. coli of Muty?
SELECT type FROM table_name_11 WHERE e_coli = "muty"
sql_create_context
CREATE TABLE table_1342292_4 ( candidates VARCHAR, incumbent VARCHAR )
What candidates ran in the election when the incumbent was william j. driver?
SELECT candidates FROM table_1342292_4 WHERE incumbent = "William J. Driver"
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...
how many patients aged below 85 years are black/haitian?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.age < "85"
mimicsql_data
CREATE TABLE table_46060 ( "Fin. Pos" text, "Car No." text, "Driver" text, "Team" text, "Laps" text, "Time/Retired" text, "Grid" text, "Laps Led" text, "Points" text )
What team does Dan Wheldon drive for when he led 0 laps?
SELECT "Team" FROM table_46060 WHERE "Laps Led" = '0' AND "Driver" = 'dan wheldon'
wikisql
CREATE TABLE table_55748 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the home team score at North Melbourne's away game?
SELECT "Home team score" FROM table_55748 WHERE "Away team" = 'north melbourne'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
let me know the procedure icd9 code for patient stephanie suchan.
SELECT procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Stephanie Suchan"
mimicsql_data
CREATE TABLE table_name_98 ( venue VARCHAR, away_team VARCHAR )
Can you tell me the Venue that has the Away team of south dragons?
SELECT venue FROM table_name_98 WHERE away_team = "south dragons"
sql_create_context
CREATE TABLE table_61492 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real )
What is the to par for the score 64-73-74-69=280?
SELECT "To par" FROM table_61492 WHERE "Score" = '64-73-74-69=280'
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...
what is drug route and drug dose of drug name neo*po*ferrous sulfate elixir?
SELECT prescriptions.route, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "NEO*PO*Ferrous Sulfate Elixir"
mimicsql_data
CREATE TABLE table_32857 ( "Sanctioning" text, "Race Name" text, "Circuit" text, "City/Location" text, "Date" text )
What is the date for the race that has a circuit of Milwaukee Mile and the sanctioning of cart?
SELECT "Date" FROM table_32857 WHERE "Circuit" = 'milwaukee mile' AND "Sanctioning" = 'cart'
wikisql
CREATE TABLE table_name_45 ( avg VARCHAR, long VARCHAR, rec VARCHAR, player VARCHAR )
How many averages have recs smaller than 26, and a Player of reggie brown, and a Long smaller than 40?
SELECT COUNT(avg) FROM table_name_45 WHERE rec < 26 AND player = "reggie brown" AND long < 40
sql_create_context
CREATE TABLE table_name_68 ( home VARCHAR, date VARCHAR )
Who was the home team on February 3?
SELECT home FROM table_name_68 WHERE date = "february 3"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, ic...
since 2 years ago, what were the top five most frequent microbiological tests ordered for patients in the same month after monitor vital capacities for deterioration?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'monitor vital capacities for deterioration' ...
eicu
CREATE TABLE table_25682 ( "Autonomous Community" text, "Organization" text, "Television Channels" text, "Radio Stations" text, "Foundation" real )
If the radio stations is radio nou si radio radio nou m sica; what were the total number of television channels?
SELECT COUNT("Television Channels") FROM table_25682 WHERE "Radio Stations" = 'Radio Nou Si Radio Radio Nou Música'
wikisql
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, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time, and could you list by the y axis from low to high?
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
名叫王清妍的病人有哪些检验报告单的报告日期在零四年六月十九日之后?这些报告单所对应的门诊就诊的流水号是什么
SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '王清妍' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2004-06-19')
css
CREATE TABLE table_27740 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" text )
How many joined Manchester University?
SELECT "Joined" FROM table_27740 WHERE "Institution" = 'Manchester University'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
Show the average age for male and female students with a bar chart, and could you list bar from high to low order?
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex DESC
nvbench
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
Rollback Done By A User. This shows rollbacks that a particular user has performed. Enter the user ID. Results will be all rollback edits that that user has done.
SELECT h.UserId AS "user_link", h.PostId AS "post_link", h.CreationDate AS Date, h.PostHistoryTypeId AS Type, h.Comment, h.Text FROM PostHistory AS h WHERE UserId = 285587 AND PostHistoryTypeId IN (7, 8, 9) ORDER BY h.CreationDate DESC
sede
CREATE TABLE table_204_433 ( id number, "rank" number, "name" text, "nationality" text, "time" text )
who is ranked first ?
SELECT "name" FROM table_204_433 WHERE id = 1
squall