context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_203_137 ( id number, "title" text, "album details" text, "peak chart positions\nus" number, "peak chart positions\nus r&b" number, "certifications" text )
what was the top position an album reached on either chart ?
SELECT MIN(MIN("peak chart positions\nus"), MIN("peak chart positions\nus r&b")) FROM table_203_137
squall
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
把患者70117479在编号为2870578的医院中就诊科室名称中包含泌尿科的所有医疗就诊记录列出来
SELECT * FROM t_kc21 WHERE PERSON_ID = '70117479' AND MED_SER_ORG_NO = '2870578' AND MED_ORG_DEPT_NM LIKE '%泌尿科%'
css
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
From all the WRITING upper-level classes , which ones are being provided this Spring-Summer ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'WRITING' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spr...
advising
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...
count the number of patients whose ethnicity is black/haitian and procedure short title is dx ultrasound-heart?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND procedures.short_title = "Dx ultrasound-heart"
mimicsql_data
CREATE TABLE ReviewTaskStates ( 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 PendingFlags ( Id nu...
Gini coefficient for number of posts.
WITH a AS (SELECT COUNT(Id) AS n_posts, OwnerUserId FROM Posts WHERE PostTypeId = 2 AND TIME_TO_STR(CreationDate, '%Y') = 2019 GROUP BY OwnerUserId, TIME_TO_STR(CreationDate, '%m')), b AS (SELECT COUNT(n_posts) OVER (ORDER BY n_posts + 0.000000001 * OwnerUserId DESC) AS users_quantile, SUM(n_posts) OVER (ORDER BY n_pos...
sede
CREATE TABLE table_2472711_32 ( hosted VARCHAR, highest VARCHAR )
How many values of hosted have a highest value of 42659?
SELECT COUNT(hosted) FROM table_2472711_32 WHERE highest = 42659
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
Is there any section between 11:00 and 6:00 for ASIANPAM 310 ?
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.end_time <= '6:00' AND course_offering.start_time >= '11:00' AND course.course_id = course_offering.course_id AND course.department = 'ASIANPAM' AND course.nu...
advising
CREATE TABLE table_76991 ( "Title" text, "Lyricist(s)" text, "Composer(s)" text, "Arranger(s)" text, "Length" text )
Who was the arranger for the song that had a lyricist of Sirapatara Kalayapanid?
SELECT "Arranger(s)" FROM table_76991 WHERE "Lyricist(s)" = 'sirapatara kalayapanid'
wikisql
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name te...
what was the name of the lab test patient 18316 last had since 147 months ago?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18316) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-147 month') ORDER BY labevents.charttime D...
mimic_iii
CREATE TABLE hz_info_zyjzjlb ( JZLSH number, YLJGDM number, zyjzjlb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, ...
在医院9057855中就诊科室名称包含男科的所有门诊中,患者64012281的就诊记录的流水号是哪些
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '64012281' AND hz_info.YLJGDM = '9057855' AND mzjzjlb.JZKSMC LIKE '%男科%'
css
CREATE TABLE table_168274_1 ( index_weighting___percentage__at_17_january_2013 VARCHAR, ticker_symbol VARCHAR )
Name the index weighting % for 17 januaary 2013 for rno
SELECT index_weighting___percentage__at_17_january_2013 FROM table_168274_1 WHERE ticker_symbol = "RNO"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info_zyjzjlb ( JZLSH number, ...
科室903的住院量在11年5月15日到19年1月20日期间是多少?
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSDM = '903' AND zyjzjlb.RYDJSJ BETWEEN '2011-05-15' AND '2019-01-20'
css
CREATE TABLE table_2279413_1 ( pct_route_available VARCHAR, type_of_protection VARCHAR )
For small patent type of protections, what type of PCT route is available?
SELECT pct_route_available FROM table_2279413_1 WHERE type_of_protection = "small patent"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
患者24804917曾在医院就诊从2006年6月9日开始直到2010年8月30日结束次数有多少次?
SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb 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.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_...
css
CREATE TABLE table_204_324 ( id number, "team 1" text, "agg." text, "team 2" text, "1st leg" text, "2nd leg" text )
what is the total number of teams in team 1 column ?
SELECT COUNT("team 1") FROM table_204_324
squall
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...
provide the number of patients whose religion is protestant quaker and lab test name is methemoglobin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "PROTESTANT QUAKER" AND lab.label = "Methemoglobin"
mimicsql_data
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...
有多少次10元以内小金额结算是参保人任飞烟在04年12月27日到20年7月15日内支付的?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '任飞烟' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-12-27' AND '2020-07-15' AND t_kc24.MED_AMOUT <= 10
css
CREATE TABLE table_77432 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" real, "Avg. Finish" real, "Winnings" text, "Position" text, "Team(s)" text )
How many top 10s belong to the team with a start of 7 and an average finish less than 16.7?
SELECT COUNT("Top 10") FROM table_77432 WHERE "Starts" = '7' AND "Avg. Finish" < '16.7'
wikisql
CREATE TABLE table_name_17 ( player VARCHAR, place VARCHAR )
What player placed t10?
SELECT player FROM table_name_17 WHERE place = "t10"
sql_create_context
CREATE TABLE table_37717 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real )
What is the largest number for earnings for tom watson when ranked more than 2?
SELECT MAX("Earnings ( $ )") FROM table_37717 WHERE "Player" = 'tom watson' AND "Rank" > '2'
wikisql
CREATE TABLE table_11926114_1 ( rank INTEGER, peak VARCHAR )
What numbr on the list had a peak rating of 42?
SELECT MIN(rank) FROM table_11926114_1 WHERE peak = 42
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
总计医疗记录中医院6353786的出院诊断为胆囊炎的最高和最低医疗费总额分别有多少钱?
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 = '6353786' AND OUT_DIAG_DIS_NM = '胆囊炎')
css
CREATE TABLE table_12164707_1 ( mens_doubles VARCHAR, womens_singles VARCHAR )
Who won the Men's Doubles when Karina de Wit won the Women's Singles?
SELECT mens_doubles FROM table_12164707_1 WHERE womens_singles = "Karina de Wit"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
依据科室编码和入院诊断疾病编码的不同,查出医院1830315全部医疗就诊记录中患者的平均年龄是多少
SELECT qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1830315' GROUP BY qtb.MED_ORG_DEPT_CD, qtb.IN_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_CD, gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1830315' GROUP BY gyb.MED_ORG_DEPT_CD, gyb.IN_...
css
CREATE TABLE Products_Booked ( booking_id INTEGER, product_id INTEGER, returned_yn VARCHAR(1), returned_late_yn VARCHAR(1), booked_count INTEGER, booked_amount FLOAT ) CREATE TABLE Customers ( customer_id INTEGER, coupon_id INTEGER, good_or_bad_customer VARCHAR(4), first_name VA...
How many bookings did each customer make? List the first name as the X-axis, and the count as the Y-axis in the bar chart, could you order by the total number in descending please?
SELECT first_name, COUNT(*) FROM Customers AS T1 JOIN Bookings AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info ( KH text, KLX number...
门诊诊断的患者患有急性支气管炎的籍贯代码是多少、籍贯名称叫啥和相应人数有多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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 wdmzjzjlb.JZZDSM = '急性支气管炎' GROUP BY person_info.JGDM UNION SELECT ...
css
CREATE TABLE table_65326 ( "Year" real, "Artist" text, "Song" text, "UK Chart" text, "At Eurovision" text )
Where did the song by Michael Ball, which placed 2nd in Eurovision prior to 1961, place on the UK charts?
SELECT "UK Chart" FROM table_65326 WHERE "Year" > '1961' AND "At Eurovision" = '2nd' AND "Artist" = 'michael ball'
wikisql
CREATE TABLE table_64129 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the number of silver when the total is less than 1?
SELECT COUNT("Silver") FROM table_64129 WHERE "Total" < '1'
wikisql
CREATE TABLE table_48635 ( "Title" text, "Writer" text, "Format" text, "Company" text, "release date" text )
What is the release date of the album written by Ford, Phil Phil Ford under BBC Audio?
SELECT "release date" FROM table_48635 WHERE "Company" = 'bbc audio' AND "Writer" = 'ford, phil phil ford'
wikisql
CREATE TABLE events ( event_id number, service_id number, event_details text ) CREATE TABLE participants_in_events ( event_id number, participant_id number ) CREATE TABLE services ( service_id number, service_type_code text ) CREATE TABLE participants ( participant_id number, part...
How many participants belong to the type 'Organizer'?
SELECT COUNT(*) FROM participants WHERE participant_type_code = 'Organizer'
spider
CREATE TABLE table_10404 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
How many were in attendance for the loss of rekar (4 5)?
SELECT SUM("Attendance") FROM table_10404 WHERE "Loss" = 'rekar (4–5)'
wikisql
CREATE TABLE table_79903 ( "Ride name" text, "Type" text, "Opened in" real, "Themed land" text, "Manufacturer" text )
What ride was manufactured by Zierer?
SELECT "Ride name" FROM table_79903 WHERE "Manufacturer" = 'zierer'
wikisql
CREATE TABLE table_23285849_6 ( high_points VARCHAR, team VARCHAR )
How many players has the highest points in the game against the Heat?
SELECT COUNT(high_points) FROM table_23285849_6 WHERE team = "Heat"
sql_create_context
CREATE TABLE table_name_83 ( status VARCHAR, name VARCHAR )
What is the Status of Mexborough?
SELECT status FROM table_name_83 WHERE name = "mexborough"
sql_create_context
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, ...
give me a list of flights between DENVER and OAKLAND
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 = 'OAKLAND...
atis
CREATE TABLE table_34877 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
what score was on february 21
SELECT "Score" FROM table_34877 WHERE "February" = '21'
wikisql
CREATE TABLE table_name_27 ( score VARCHAR, set_2 VARCHAR, total VARCHAR )
What is the Score when Set 2 shows 25-20, and a Total of 75 - 49?
SELECT score FROM table_name_27 WHERE set_2 = "25-20" AND total = "75 - 49"
sql_create_context
CREATE TABLE table_name_23 ( date VARCHAR, goals VARCHAR, result VARCHAR )
Which date had less than 3 goals and a result of (w) 2-0?
SELECT date FROM table_name_23 WHERE goals < 3 AND result = "(w) 2-0"
sql_create_context
CREATE TABLE table_11938 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Which decile features Mayfield School?
SELECT "Decile" FROM table_11938 WHERE "Name" = 'mayfield school'
wikisql
CREATE TABLE table_10860 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What was the attendance on November 3, 1968, that was a week smaller than 8?
SELECT COUNT("Attendance") FROM table_10860 WHERE "Date" = 'november 3, 1968' AND "Week" < '8'
wikisql
CREATE TABLE table_29487895_2 ( title_in_country VARCHAR, country___region VARCHAR )
What is the title in Canada?
SELECT title_in_country FROM table_29487895_2 WHERE country___region = "Canada"
sql_create_context
CREATE TABLE table_487 ( "Season #" real, "Series #" real, "Title" text, "Canadian airdate" text, "U.S. airdate" text, "Production code" real )
what are the u.s. air dates with a Canadian air date of may 4, 2009
SELECT "U.S. airdate" FROM table_487 WHERE "Canadian airdate" = 'May 4, 2009'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title te...
what is the minimum total cost of the hospital which include hemogloblin s in this year?
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 = 'hemogloblin s')) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of ...
mimic_iii
CREATE TABLE table_6119 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was his record when he went over 1 round?
SELECT "Record" FROM table_6119 WHERE "Round" > '1'
wikisql
CREATE TABLE table_name_71 ( Id VARCHAR )
How many 2007s have 0.2 as a 2006, with a 2010 less than 0.1?
SELECT SUM(2007) FROM table_name_71 WHERE 2006 = 0.2 AND 2010 < 0.1
sql_create_context
CREATE TABLE table_41775 ( "Built" real, "Number" real, "Type" text, "SLM Number" real, "Wheel arrangement" text, "Location" text, "Notes" text )
What is the first locomotive that has a SLM number lower than 924?
SELECT MIN("Number") FROM table_41775 WHERE "SLM Number" < '924'
wikisql
CREATE TABLE table_31448 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the game for l 111 126
SELECT "Game" FROM table_31448 WHERE "Score" = 'L 111–126'
wikisql
CREATE TABLE table_43725 ( "Draw" real, "Song" text, "Performer" text, "Points" real, "Rank" text )
Which Draw has a Performer of jenny newman, and Points smaller than 77?
SELECT AVG("Draw") FROM table_43725 WHERE "Performer" = 'jenny newman' AND "Points" < '77'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
沈元纬这个病人做的脸部检验的各项指标结果如何
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, show me about the distribution of founder and the sum of manufacturer , and group by attribute founder in a bar chart, show by the bars from low to high please.
SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
nvbench
CREATE TABLE table_name_29 ( displacement VARCHAR, redline__rpm_ VARCHAR, year VARCHAR )
What is the displacement of the engine that has a Redline rpm higher than 4750, from 2005?
SELECT displacement FROM table_name_29 WHERE redline__rpm_ > 4750 AND year = 2005
sql_create_context
CREATE TABLE table_name_6 ( week INTEGER, transition VARCHAR )
What was the first week that had a transition with Pat Mccready?
SELECT MIN(week) FROM table_name_6 WHERE transition = "pat mccready"
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit...
what was the first height of patient 3242 on their first hospital encounter.
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 = 3242 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.item...
mimic_iii
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
what was the first value of respiration patient 030-80604 had on the last intensive care unit visit.
SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-80604') AND NOT patient.unitdischargetime IS NULL O...
eicu
CREATE TABLE table_70434 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What is the year when kurtis kraft 500f was the chassis?
SELECT SUM("Year") FROM table_70434 WHERE "Chassis" = 'kurtis kraft 500f'
wikisql
CREATE TABLE table_1341453_11 ( party VARCHAR, incumbent VARCHAR )
What party does Bill McCollum belong to?
SELECT party FROM table_1341453_11 WHERE incumbent = "Bill McCollum"
sql_create_context
CREATE TABLE table_train_280 ( "id" int, "fpg" float, "hemoglobin_a1c_hba1c" float, "heart_disease" bool, "renal_disease" bool, "hba1c" float, "body_mass_index_bmi" float, "NOUSE" float )
body mass index ( bmi ) < 30 kg / m2
SELECT * FROM table_train_280 WHERE body_mass_index_bmi < 30
criteria2sql
CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUndergoes DATETIME, Physician INTEGER, AssistingNurse INTEGER ) CREATE TABLE Appointment ( AppointmentID INTEGER, Patient INTEGER, PrepNurse INTEGER, Physician INTEGER, Start DATETIME, End DA...
What are the name and primarily affiliated department name of each physician?, and I want to display in ascending by the x-axis please.
SELECT T3.Name, COUNT(T3.Name) FROM Physician AS T1 JOIN Affiliated_With AS T2 ON T1.EmployeeID = T2.Physician JOIN Department AS T3 ON T2.Department = T3.DepartmentID WHERE T2.PrimaryAffiliation = 1 GROUP BY T3.Name ORDER BY T3.Name
nvbench
CREATE TABLE table_74823 ( "Rank" real, "Name" text, "Location" text, "Height Metres / feet" text, "Floors" text )
Which Height Metres / feet has a Rank of 8, and Floors of 3x17?
SELECT "Height Metres / feet" FROM table_74823 WHERE "Rank" = '8' AND "Floors" = '3x17'
wikisql
CREATE TABLE table_41373 ( "Place" real, "Rider" text, "Country" text, "Machine" text, "Speed" text, "Time" text, "Points" real )
How fast does the BMW with 6 points go?
SELECT "Speed" FROM table_41373 WHERE "Machine" = 'bmw' AND "Points" = '6'
wikisql
CREATE TABLE table_7295 ( "Place (Posici\u00f3n)" real, "Team (Equipo)" text, "Played (PJ)" real, "Won (PG)" real, "Draw (PE)" real, "Lost (PP)" real, "Goals Scored (GF)" real, "Goals Conceded (GC)" real, "+/- (Dif.)" real, "Points (Pts.)" real )
What is the largest number of points for Orion with more than 4 losses?
SELECT MAX("Points (Pts.)") FROM table_7295 WHERE "Team (Equipo)" = 'orion' AND "Lost (PP)" > '4'
wikisql
CREATE TABLE table_4506 ( "Religious group" text, "Population % 1961" text, "Population % 1971" text, "Population % 1981" text, "Population % 1991" text, "Population % 2001" text )
For the group with 1.79% population in 1961, what was their percentage of the population in 1971?
SELECT "Population % 1971" FROM table_4506 WHERE "Population % 1961" = '1.79%'
wikisql
CREATE TABLE table_64761 ( "Rank" real, "Rower" text, "Country" text, "Time" text, "Notes" text )
What is Lee Ka Man's Time?
SELECT "Time" FROM table_64761 WHERE "Rower" = 'lee ka man'
wikisql
CREATE TABLE table_59720 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
Which label has the catalog CDZAP22?
SELECT "Label" FROM table_59720 WHERE "Catalog" = 'cdzap22'
wikisql
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airline ( airline_code varchar, airline_name text, ...
show me the flights from NEW YORK to LOS ANGELES with stop in MILWAUKEE
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LOS ANGELES' AND CITY_...
atis
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ...
Top 10 users Stack Overflow users from Morocco.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%Bournemouth%' ORDER BY Reputation DESC LIMIT 10
sede
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
provide the number of patients whose lab test name is parathyroid hormone and lab test result is delta.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.flag = "delta" AND lab.label = "Parathyroid Hormone"
mimicsql_data
CREATE TABLE table_30506 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
When Yale is listed as the regular season winner, what tournament venue is given?
SELECT "Tournament Venue (City)" FROM table_30506 WHERE "Regular Season Winner" = 'Yale'
wikisql
CREATE TABLE table_27666856_3 ( manner_of_departure VARCHAR, outgoing_manager VARCHAR )
Name the manner of departure for luis enrique
SELECT manner_of_departure FROM table_27666856_3 WHERE outgoing_manager = "Luis Enrique"
sql_create_context
CREATE TABLE table_name_98 ( points INTEGER, player VARCHAR, assists VARCHAR )
How many total points does Mike Hyndman have with more than 119 assists?
SELECT SUM(points) FROM table_name_98 WHERE player = "mike hyndman" AND assists > 119
sql_create_context
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime t...
what was the last test that patient 27465 had received since 100 months ago?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27465) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-100 month') ORDER BY labevents.charttime D...
mimic_iii
CREATE TABLE airport_aircraft ( ID int, Airport_ID int, Aircraft_ID int ) CREATE TABLE aircraft ( Aircraft_ID int(11), Aircraft varchar(50), Description varchar(50), Max_Gross_Weight varchar(50), Total_disk_area varchar(50), Max_disk_Loading varchar(50) ) CREATE TABLE match ( R...
Please list the proportion number of each winning aircraft.
SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft
nvbench
CREATE TABLE table_name_21 ( date VARCHAR )
Which Date has Notes of notes?
SELECT date FROM table_name_21 WHERE "notes" = "notes"
sql_create_context
CREATE TABLE table_2562572_53 ( type VARCHAR, settlement VARCHAR )
How many different types of settlements does Nova Pazova fall into?
SELECT COUNT(type) FROM table_2562572_53 WHERE settlement = "Nova Pazova"
sql_create_context
CREATE TABLE table_21933 ( "Name or route" text, "type" text, "elevation groundstation" real, "elevation mountainstation" real, "slope length" real, "capacity in persons/hour" real, "construction year(s)" text )
Name the slope length for 1966 groundstation
SELECT COUNT("slope length") FROM table_21933 WHERE "elevation groundstation" = '1966'
wikisql
CREATE TABLE list ( lastname text, firstname text, grade number, classroom number ) CREATE TABLE teachers ( lastname text, firstname text, classroom number )
For each grade, return the grade number, the number of classrooms used for the grade, and the total number of students enrolled in the grade.
SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade
spider
CREATE TABLE table_47527 ( "Name" text, "Born-Died" text, "Term start" text, "Term end" text, "Political Party" text )
When did the term end for the person who started their term on 28 November 1912?
SELECT "Term end" FROM table_47527 WHERE "Term start" = '28 november 1912'
wikisql
CREATE TABLE table_56560 ( "Year" text, "League" text, "Record" text, "Reg. Season" text, "Playoffs" text )
What is the regular season info that had a record of 20-10?
SELECT "Reg. Season" FROM table_56560 WHERE "Record" = '20-10'
wikisql
CREATE TABLE table_19586 ( "Number of episode" real, "Number of season" real, "Title (original)" text, "Title (English)" text, "Original air date" text )
What is the episode number where the English title is Pilot?
SELECT "Number of episode" FROM table_19586 WHERE "Title (English)" = 'Pilot'
wikisql
CREATE TABLE table_22597626_17 ( partner VARCHAR, opponents_in_the_final VARCHAR )
What was the partner count when the opponents in the final was forget leconte?
SELECT COUNT(partner) FROM table_22597626_17 WHERE opponents_in_the_final = "Forget Leconte"
sql_create_context
CREATE TABLE mountain ( id number, name text, height number, prominence number, range text, country text ) CREATE TABLE camera_lens ( id number, brand text, name text, focal_length_mm number, max_aperture number ) CREATE TABLE photos ( id number, camera_lens_id numb...
Show the name and prominence of the mountains whose picture is not taken by a lens of brand 'Sigma'.
SELECT name, prominence FROM mountain EXCEPT SELECT T1.name, T1.prominence FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id JOIN camera_lens AS T3 ON T2.camera_lens_id = T3.id WHERE T3.brand = 'Sigma'
spider
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ...
Out of the total number of patients admitted before the year 2131, calculate the number of those who remained admitted in hospital for more than 23 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.days_stay > "23" AND demographic.admityear < "2131"
mimicsql_data
CREATE TABLE table_name_15 ( current_manager VARCHAR, location VARCHAR )
Who is the current manager of the team located in tubize?
SELECT current_manager FROM table_name_15 WHERE location = "tubize"
sql_create_context
CREATE TABLE table_26128 ( "Election Year" real, "Assembly" text, "Winning Party/Coalition" text, "Chief Minister" text, "Speaker" text )
Who is the winning party/coalition name in election year 1980?
SELECT "Winning Party/Coalition" FROM table_26128 WHERE "Election Year" = '1980'
wikisql
CREATE TABLE table_name_93 ( score VARCHAR, date VARCHAR )
What was the score on 8 September 1999?
SELECT score FROM table_name_93 WHERE date = "8 september 1999"
sql_create_context
CREATE TABLE school ( Denomination VARCHAR, Founded INTEGER )
Show the denomination shared by schools founded before 1890 and schools founded after 1900
SELECT Denomination FROM school WHERE Founded < 1890 INTERSECT SELECT Denomination FROM school WHERE Founded > 1900
sql_create_context
CREATE TABLE table_51484 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Which week's game was attended by 33,057 people?
SELECT "Week" FROM table_51484 WHERE "Attendance" = '33,057'
wikisql
CREATE TABLE table_22577693_1 ( details VARCHAR, result VARCHAR )
If the results are Kuwait won by 72 runs scorecard, what are the details?
SELECT details FROM table_22577693_1 WHERE result = "Kuwait won by 72 runs Scorecard"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
从07年8月11日到18年7月17日,患者马芳蕙在470787上的检测记录详情
(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 table_name_95 ( tourist_arrivals__2011___millions_ INTEGER, tourism_receipts__2011___us$_per_arrival_ VARCHAR, tourism_receipts__2011___millions_of_us$_ VARCHAR )
What is the lowest tourism arrivals in 2011 in millions with 507 US $ per arrival in 2011 tourism receipts and less than 11,869 million of US $ in 2011 tourism receipts?
SELECT MIN(tourist_arrivals__2011___millions_) FROM table_name_95 WHERE tourism_receipts__2011___us$_per_arrival_ = 507 AND tourism_receipts__2011___millions_of_us$_ < 11 OFFSET 869
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) 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...
Draw a bar chart about the distribution of Nationality and the average of meter_100 , and group by attribute Nationality, and display in asc by the Nationality.
SELECT Nationality, AVG(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality
nvbench
CREATE TABLE table_name_3 ( away_team VARCHAR, venue VARCHAR )
When the Venue was Glenferrie Oval, who is the Away team?
SELECT away_team FROM table_name_3 WHERE venue = "glenferrie oval"
sql_create_context
CREATE TABLE table_name_79 ( date VARCHAR, week VARCHAR, opponent VARCHAR )
On what date did the Bills play the Houston Oilers before week 12?
SELECT date FROM table_name_79 WHERE week < 12 AND opponent = "houston oilers"
sql_create_context
CREATE TABLE table_name_66 ( first_leg VARCHAR, opposition VARCHAR )
What was the first leg score against Real Sociedad?
SELECT first_leg FROM table_name_66 WHERE opposition = "real sociedad"
sql_create_context
CREATE TABLE table_name_69 ( home_team VARCHAR, away_team VARCHAR )
What home team has Richmond listed as their Away team?
SELECT home_team FROM table_name_69 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE apartment_facilities ( apt_id number, facility_code text ) CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count number, room_count text ) CREATE TABLE apartment_bookings ( apt_booking...
Return the date of birth for all the guests with gender code 'Male'.
SELECT date_of_birth FROM guests WHERE gender_code = "Male"
spider
CREATE TABLE table_37129 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club Team (League)" text )
Which position does Jesse Boulerice play?
SELECT "Position" FROM table_37129 WHERE "Player" = 'jesse boulerice'
wikisql
CREATE TABLE table_77591 ( "Rank" real, "Player" text, "Country" text, "Earnings( $ )" real, "Wins" real )
How many average wins for players ranked below 2 with earnings greater than $7,676,552?
SELECT AVG("Wins") FROM table_77591 WHERE "Earnings( $ )" > '7,676,552' AND "Rank" > '2'
wikisql
CREATE TABLE table_204_708 ( id number, "victim(s)" text, "age" number, "gender" text, "date" text, "type of attack" text, "location" text, "details" text, "source(s)" text )
who was the victim of the last wolf attack to occur in california , usa ?
SELECT "victim(s)" FROM table_204_708 WHERE "location" = 'california' ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
what is the percentile of 13.8 for a white blood cells test given the same age of patient 96833 on their current hospital encounter?
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admiss...
mimic_iii