context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_67 ( rider VARCHAR, grid VARCHAR, bike VARCHAR, laps VARCHAR, time VARCHAR )
What is the driver with the laps under 16, grid of 10, a bike of Yamaha YZF-R6, and ended with an accident?
SELECT rider FROM table_name_67 WHERE laps < 16 AND time = "accident" AND bike = "yamaha yzf-r6" AND grid = 10
sql_create_context
CREATE TABLE table_name_97 ( longest_span_in_s_metre___feet__ VARCHAR, land VARCHAR, name VARCHAR )
How long is the UK's Ballochmyle Viaduct?
SELECT longest_span_in_s_metre___feet__ FROM table_name_97 WHERE land = "uk" AND name = "ballochmyle viaduct"
sql_create_context
CREATE TABLE table_204_223 ( id number, "party" text, "previous council" number, "staying councillors" number, "seats up for election" number, "election result" number, "new council" number )
how many parties had zero councils ?
SELECT COUNT("party") FROM table_204_223 WHERE "new council" = 0
squall
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 diagnoses ( ...
what is the number of patients whose admission year is less than 2187 and procedure long title is infusion of vasopressor agent?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2187" AND procedures.long_title = "Infusion of vasopressor agent"
mimicsql_data
CREATE TABLE table_name_50 ( took_office INTEGER, senator VARCHAR, district VARCHAR )
What is the lowest Took Office, when Senator is Eddie Bernice Johnson, and when District is greater than 23?
SELECT MIN(took_office) FROM table_name_50 WHERE senator = "eddie bernice johnson" AND district > 23
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
provide the number of patients whose gender is f and death status is 1?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.expire_flag = "1"
mimicsql_data
CREATE TABLE table_204_135 ( id number, "position" number, "club" text, "played" number, "points" number, "wins" number, "draws" number, "losses" number, "goals for" number, "goals against" number, "goal difference" number )
which club had 27 point and a goal difference of +1 ?
SELECT "club" FROM table_204_135 WHERE "points" = 27 AND "goal difference" = 1
squall
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jo...
Can you specify the Core classes that are offered next Winter ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour...
advising
CREATE TABLE table_3729 ( "#" real, "Matches As Captain" text, "Player" text, "Asian Cup Played As A Captain" text, "Years Active" text, "Caps(Goals)" text )
What were the years active where Asian Cup played as a captain is Qatar 1988?
SELECT "Years Active" FROM table_3729 WHERE "Asian Cup Played As A Captain" = 'Qatar 1988'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
the first time patient 67902 received int inser lead atri-vent until 2104?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'int inser lead atri-vent') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 67902) AND...
mimic_iii
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, ...
医疗就诊25237614940具体负责的是哪个医疗机构的科室,这个科室的编码和名称是什么
SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.MED_ORG_DEPT_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '25237614940'
css
CREATE TABLE table_204_431 ( id number, "yacht" text, "nation" text, "owner" text, "skipper" text, "launch year" number )
who is the owner of the wild oatsxi bob oatley or mark richards ?
SELECT "owner" FROM table_204_431 WHERE "yacht" = 'wild oats xi'
squall
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
what is the number of patients whose admission year is less than 2146 and diagnoses icd9 code is 3004?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2146" AND diagnoses.icd9_code = "3004"
mimicsql_data
CREATE TABLE table_74305 ( "#" real, "Episode" text, "Directed by" text, "Written by" text, "U.S. Viewers (in millions)" text, "Original airdate" text )
Who wrote the episode with 7.52 million US viewers?
SELECT "Written by" FROM table_74305 WHERE "U.S. Viewers (in millions)" = '7.52'
wikisql
CREATE TABLE table_name_2 ( record VARCHAR, attendance VARCHAR )
What was the score when attendance was 19,887?
SELECT record FROM table_name_2 WHERE attendance = "19,887"
sql_create_context
CREATE TABLE table_204_840 ( id number, "no. in\nseries" number, "no. in\nseason" number, "title" text, "directed by" text, "written by" text, "original air date" text, "prod. code" text )
who wrote the first episode of the season ?
SELECT "written by" FROM table_204_840 WHERE "no. in\nseason" = 1
squall
CREATE TABLE table_38793 ( "Season" text, "Team" text, "Wins" text, "Losses" text, "Draws" text )
Which season had 0 wins and 5 losses for the Surrey team?
SELECT "Season" FROM table_38793 WHERE "Wins" = '0' AND "Losses" = '5' AND "Team" = 'surrey'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
What was the last time period the class THTREMUS 252 was offered ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'THTREMUS' AND course.number = 252 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1
advising
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...
what was the minimum monthly number of patients who were admitted for encephalopathy - metabolic in a year before?
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'encephalopathy - metabolic' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY STRFTIME('%y-%m', diagnosis.diagnosistime)) ...
eicu
CREATE TABLE table_name_76 ( engine VARCHAR, year VARCHAR )
What engine was used in 1999?
SELECT engine FROM table_name_76 WHERE year = "1999"
sql_create_context
CREATE TABLE table_name_2 ( second VARCHAR, fourth VARCHAR, fifth VARCHAR, sixth VARCHAR )
What team placed second during the season where Western Australia placed fifth, South Australia placed sixth, and Tasmania placed fourth?
SELECT second FROM table_name_2 WHERE fifth = "western australia" AND sixth = "south australia" AND fourth = "tasmania"
sql_create_context
CREATE TABLE fzzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
编号为89963549的病患的检验报告单的报告日期在15年3月17日之前的是在哪些门诊就诊的?列出门诊就诊的流水号
SELECT zzmzjzjlb.JZLSH FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE hz_info.RYBH = '89963549' AND NOT zzmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2015-03-17') UNION SELECT fzzmzjzjlb.JZLSH FROM hz_info JOI...
css
CREATE TABLE table_11914 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which away team scored 10.5 (65)?
SELECT "Away team" FROM table_11914 WHERE "Away team score" = '10.5 (65)'
wikisql
CREATE TABLE table_name_73 ( rating___percentage_ VARCHAR, channel VARCHAR )
Name the rating % for channel of anhui satellite tv
SELECT rating___percentage_ FROM table_name_73 WHERE channel = "anhui satellite tv"
sql_create_context
CREATE TABLE table_27504 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
What title did Bill Foster direct ?
SELECT "Title" FROM table_27504 WHERE "Directed by" = 'Bill Foster'
wikisql
CREATE TABLE table_60387 ( "Year" real, "Gold" text, "Silver" text, "Bronze" text, "Notes" text )
Who won Gold later than 2004 with Notes of 2.73km, 14controls?
SELECT "Gold" FROM table_60387 WHERE "Year" > '2004' AND "Notes" = '2.73km, 14controls'
wikisql
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 ...
检验结果指标记录06175030615的检测人工号和姓名分别是?
SELECT JCRGH, JCRXM FROM jyjgzbb WHERE JYZBLSH = '06175030615'
css
CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupation text, Votes int, Rank text ) CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) CREATE TABLE coach ( Coach_ID int, Coach_name ...
For players whose occupation is not 'Researcher', tell me the distribution of their residences with a bar chart, and could you display by the total number in desc?
SELECT Residence, COUNT(Residence) FROM player WHERE Occupation <> "Researcher" GROUP BY Residence ORDER BY COUNT(Residence) DESC
nvbench
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, ...
how many patients had admission location as clinic referral/premature and diagnoses icd9 code as 25541?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "25541"
mimicsql_data
CREATE TABLE table_name_43 ( loser VARCHAR, year VARCHAR, winner VARCHAR )
Who was the loser against the New York Giants in 2001?
SELECT loser FROM table_name_43 WHERE year = 2001 AND winner = "new york giants"
sql_create_context
CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, First_Elected real, Committee text ) CREATE TABLE county ( County_Id int, County_name text, Population real, Zip_code text ) CREATE TABLE party ( Party_ID int, ...
Show the name of each party and the corresponding number of delegates from that party with a bar chart, and sort by the bar in asc.
SELECT T2.Party, SUM(COUNT(*)) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID GROUP BY T2.Party ORDER BY T2.Party
nvbench
CREATE TABLE table_203_338 ( id number, "#" number, "title" text, "date" text, "director" text, "story" text, "synopsis" text, "notes" text )
what is the next cartoon directed by robert mckimson after le quiet squad ?
SELECT "title" FROM table_203_338 WHERE "director" = 'robert mckimson' AND "date" > (SELECT "date" FROM table_203_338 WHERE "title" = 'le quiet squad') ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_name_87 ( uninterrupted_rank VARCHAR, name VARCHAR )
How many uninterrupted ranks does john dingell have?
SELECT COUNT(uninterrupted_rank) FROM table_name_87 WHERE name = "john dingell"
sql_create_context
CREATE TABLE table_56465 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
What's the record of Carlos Boozer (23) as the leading scorer?
SELECT "Record" FROM table_56465 WHERE "Leading scorer" = 'carlos boozer (23)'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and employee_id , and list Y in descending order.
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC
nvbench
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...
因疾病B02.750而住院花费的的平均费用,中医普外在2011年1月24日到2015年3月6日内是多少?
SELECT AVG(zyb.MED_CLINIC_ID) FROM zyb WHERE zyb.MED_SER_ORG_NO = '中医外科' AND zyb.IN_HOSP_DAYS BETWEEN '2011-01-24' AND '2015-03-06' AND zyb.IN_DIAG_DIS_NM = 'B02.750'
css
CREATE TABLE table_name_40 ( position INTEGER, points VARCHAR, conceded VARCHAR )
The highest position with more than 16 points and less than 7 concedes?
SELECT MAX(position) FROM table_name_40 WHERE points > 16 AND conceded < 7
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 zyjzjlb ( CYBQDM text, CYBQMC...
08728091这个患者曾有过什么异常情况?
SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '...
css
CREATE TABLE table_name_39 ( mascot VARCHAR, _number___county VARCHAR )
what's the mascot for 66 pulaski 2?
SELECT mascot FROM table_name_39 WHERE _number___county = "66 pulaski 2"
sql_create_context
CREATE TABLE zyjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
了解一下申请编号是52839871632的检验报告单的科室编码以及名称
SELECT zyjybgb.SQKS, zyjybgb.SQKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '52839871632' UNION SELECT mzjybgb.SQKS, mzjybgb.SQKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '52839871632'
css
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE player ( pid number, pname text, ycard text, hs number )
Find the states where have some college students in tryout.
SELECT DISTINCT state FROM college AS T1 JOIN tryout AS T2 ON T1.cname = T2.cname
spider
CREATE TABLE school_performance ( School_Id int, School_Year text, Class_A text, Class_AA text ) CREATE TABLE school_details ( School_ID int, Nickname text, Colors text, League text, Class text, Division text ) CREATE TABLE player ( Player_ID int, Player text, Team ...
Create a bar chart showing the total number across denomination
SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination
nvbench
CREATE TABLE table_name_32 ( official_itv1_rating INTEGER, share VARCHAR )
What is the lowest official ITV1 rating with 45.4% share?
SELECT MIN(official_itv1_rating) FROM table_name_32 WHERE share = "45.4%"
sql_create_context
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, ...
what is the fare from PHILADELPHIA to PITTSBURGH BUSINESS class one way
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_n...
atis
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what were the first creatine kinase (ck) from patient 96833 in the current hospital visit?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 96833 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatine kinase (ck)') ORDER BY labevents.chart...
mimic_iii
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ...
Show me a bar chart for how many faculty members do we have for each faculty rank?, and list by the total number in ascending.
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank ORDER BY COUNT(*)
nvbench
CREATE TABLE table_62381 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" real, "Money ( $ )" real )
How much money did Willie Klein take home from the game in which he had a to par score larger than 13?
SELECT SUM("Money ( $ )") FROM table_62381 WHERE "Player" = 'willie klein' AND "To par" > '13'
wikisql
CREATE TABLE table_61341 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What is the Total for the Player with a To par of +11?
SELECT MAX("Total") FROM table_61341 WHERE "To par" = '+11'
wikisql
CREATE TABLE table_name_21 ( rank VARCHAR, gross VARCHAR )
What rank is the title with a gross of $26,589,355?
SELECT rank FROM table_name_21 WHERE gross = "$26,589,355"
sql_create_context
CREATE TABLE table_40471 ( "Year" real, "Author" text, "Illustrator" text, "Title" text, "Publisher" text )
Who was the illustrator in 1987?
SELECT "Illustrator" FROM table_40471 WHERE "Year" = '1987'
wikisql
CREATE TABLE table_61246 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
Who was the girl on week 1 that preceded week 2's Kamila Sulewska?
SELECT "Week 1" FROM table_61246 WHERE "Week 2" = 'kamila sulewska'
wikisql
CREATE TABLE table_5645 ( "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 acto...
What is the mecha with a condor bird uniform?
SELECT "Mecha" FROM table_5645 WHERE "Bird Uniform" = 'condor'
wikisql
CREATE TABLE table_train_208 ( "id" int, "anemia" bool, "serum_bicarbonate" int, "hemoglobin_a1c_hba1c" float, "temperature" float, "dementia" bool, "electrolyte_imbalances" bool, "impaired_sensorium" bool, "age" float, "NOUSE" float )
age > 75 years
SELECT * FROM table_train_208 WHERE age > 75
criteria2sql
CREATE TABLE table_name_63 ( area VARCHAR, roll VARCHAR )
What is the Area with 26 in Roll
SELECT area FROM table_name_63 WHERE roll = 26
sql_create_context
CREATE TABLE table_16602 ( "No." real, "Episode" text, "Air Date" text, "Timeslot" text, "Rating" text, "Share" text, "18\u201349 (Rating/Share)" text, "Viewers (m)" text, "Rank (#)" text )
What episode was seen by 2.05 million viewers?
SELECT "Episode" FROM table_16602 WHERE "Viewers (m)" = '2.05'
wikisql
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about code over the name , and group by attribute name by a bar chart, and rank in desc by the bars.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC
nvbench
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE...
get top protected questions by tag.
SELECT 'post_link' = Posts.Id, Posts.ViewCount, Posts.Score, Tags.TagName AS "tag_name" FROM PostHistory INNER JOIN PostTags ON PostTags.PostId = PostHistory.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON PostTags.PostId = Posts.Id WHERE PostHistory.PostHistoryTypeId = 19 AND Tags.TagName = @Tag...
sede
CREATE TABLE table_18955 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Points" text )
What club had 523 points against?
SELECT "Club" FROM table_18955 WHERE "Points against" = '523'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
在04年4月20日到05年7月29日这段时间里,病患70347742所有检验结果指标记录的检测人为杨玛丽的检验指标流水号是多少啊?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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 AND jybgb.YLJGDM = jyjgzbb.YLJ...
css
CREATE TABLE table_204_937 ( id number, "rank" number, "lane" number, "athlete" text, "time" number )
how many athletes did not finish with the time less than 53.00 ?
SELECT COUNT("athlete") FROM table_204_937 WHERE "time" >= 53
squall
CREATE TABLE table_4948 ( "Race Title" text, "Circuit" text, "City / State" text, "Date" text, "Winner" text )
On what Date is the Circuit at Sandown Raceway?
SELECT "Date" FROM table_4948 WHERE "Circuit" = 'sandown raceway'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, ...
show me all UA flights from DENVER to SAN FRANCISCO for 9 1 1991
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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND date_day.day_number = 1 AND date_day.month_number = 9...
atis
CREATE TABLE table_204_151 ( id number, "game" number, "day" text, "date" text, "kickoff" text, "opponent" text, "results\nscore" text, "results\nrecord" text, "location" text, "attendance" number )
how many times did the team play at home but did not win ?
SELECT COUNT(*) FROM table_204_151 WHERE "opponent" = 'home' AND "results\nscore" <> 'w'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
calculate the number of patients to whom lidocaine 5% patch was administered when admitted to emergency.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.drug = "Lidocaine 5% Patch"
mimicsql_data
CREATE TABLE table_name_15 ( year INTEGER, category VARCHAR )
What year had Best Actor in a Musical as a category?
SELECT SUM(year) FROM table_name_15 WHERE category = "best actor in a musical"
sql_create_context
CREATE TABLE table_53610 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
where did rochdale play as opponent?
SELECT "Venue" FROM table_53610 WHERE "Opponent" = 'rochdale'
wikisql
CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int...
Find journals about Neutralizing Antibody Languages .
SELECT DISTINCT paper.journalid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Neutralizing Antibody Languages' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.journalid
scholar
CREATE TABLE table_204_414 ( id number, "name" text, "armenian" text, "location" text, "# of prisoners designed for" number, "notes" text )
how many prisons are in nubarashen ?
SELECT COUNT("name") FROM table_204_414 WHERE "location" = 'nubarashen'
squall
CREATE TABLE table_49359 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
What is the Date of the Event in Punta del Este?
SELECT "Date" FROM table_49359 WHERE "City" = 'punta del este'
wikisql
CREATE TABLE table_7116 ( "Title" text, "Author" text, "Un-/Abridged" text, "Read by" text, "Published" text )
Who read the unabridged book written by Gary Paulsen?
SELECT "Read by" FROM table_7116 WHERE "Un-/Abridged" = 'unabridged' AND "Author" = 'gary paulsen'
wikisql
CREATE TABLE table_15248 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Pts." real )
What is the earliest year with points more than 8?
SELECT MIN("Year") FROM table_15248 WHERE "Pts." > '8'
wikisql
CREATE TABLE table_33987 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What's the score on April 9?
SELECT "Score" FROM table_33987 WHERE "Date" = 'april 9'
wikisql
CREATE TABLE table_5600 ( "Season" text, "Regionalliga S\u00fcd" text, "Regionalliga West/S\u00fcdwest" text, "Regionalliga Nord" text, "Regionalliga Nord-Ost" text )
Which season had a Regionalliga Sud of Stuttgarter Kickers?
SELECT "Season" FROM table_5600 WHERE "Regionalliga S\u00fcd" = 'stuttgarter kickers'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is age and diagnoses icd9 code of subject id 42067?
SELECT demographic.age, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42067"
mimicsql_data
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE medication ( medi...
in 12/this year protonix, ondansetron inj or lisinopril have been prescribed for patient 012-37411?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-37411')) AND medication.drugname IN ('protonix', 'ondansetron inj', 'l...
eicu
CREATE TABLE table_18967450_2 ( club VARCHAR, goals VARCHAR )
Which team/s have 48 goals total?
SELECT club FROM table_18967450_2 WHERE goals = 48
sql_create_context
CREATE TABLE table_25240 ( "Rnd" real, "Date" text, "Race Name" text, "Length" text, "Track" text, "Location" text, "Type" text, "Pole Position" text, "Winning Driver" text )
How many races took place on the Indianapolis Motor Speedway track?
SELECT COUNT("Race Name") FROM table_25240 WHERE "Track" = 'Indianapolis Motor Speedway'
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 admission time and diagnoses long title of subject id 2560?
SELECT demographic.admittime, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_56425 ( "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponents in the final" text, "Score" text )
Who were the opponents of the final on June 23, 2003?
SELECT "Opponents in the final" FROM table_56425 WHERE "Date" = 'june 23, 2003'
wikisql
CREATE TABLE diagnoses ( 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 (...
Provide the number of patients with bradycardia as their primary disease who were hospitalized for more than 5 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRADYCARDIA" AND demographic.days_stay > "5"
mimicsql_data
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
what is the name of the medication that was last prescribed to patient 26507 during the last month?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26507) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_28275 ( "Rank" real, "Runs" real, "Average" text, "Strike rate" text, "Player" text, "Matches" real, "Innings" real, "Period" text )
What is the smallest number of runs?
SELECT MIN("Runs") FROM table_28275
wikisql
CREATE TABLE table_64988 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "League Cup Apps" real, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
What's the total number of league cup apps when the league goals were less than 0?
SELECT COUNT("League Cup Apps") FROM table_64988 WHERE "League Goals" < '0'
wikisql
CREATE TABLE table_66696 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
In what round was the loss at ufc 118?
SELECT "Round" FROM table_66696 WHERE "Res." = 'loss' AND "Event" = 'ufc 118'
wikisql
CREATE TABLE table_191105_3 ( first_aired INTEGER, performed_by VARCHAR )
When zachary sanders is the performer what is the lowerst first aired?
SELECT MIN(first_aired) FROM table_191105_3 WHERE performed_by = "Zachary Sanders"
sql_create_context
CREATE TABLE table_22548 ( "Rank" real, "Name" text, "Tenure" text, "Leagues" text, "Attempts" real, "Completions" real, "Comp %" text, "Touchdowns" real, "Interceptions" real, "Yardage" real, "QB Rating" text )
What is the Quarterback rating of the player who got a comp percentage of 62.0?
SELECT "QB Rating" FROM table_22548 WHERE "Comp %" = '62.0'
wikisql
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Purchases ( purchase_transaction_id INTEGER, purchase_details VARCHAR(255) ) CREATE TABLE Investors ( invest...
For the sale details with amount smaller than 3000, visualize a bar chart that x-axis is the sales details and count them as y, I want to sort by the Y in desc.
SELECT sales_details, COUNT(sales_details) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 GROUP BY sales_details ORDER BY COUNT(sales_details) DESC
nvbench
CREATE TABLE table_name_56 ( record VARCHAR, nationality VARCHAR, date VARCHAR )
What is the record for Norway on 23 august 1981?
SELECT record FROM table_name_56 WHERE nationality = "norway" AND date = "23 august 1981"
sql_create_context
CREATE TABLE table_35773 ( "Rank" real, "Building" text, "City" text, "Height (m/ft)" text, "Built" real )
What is the sum of Rank with a build year earlier than 2007 for the howard johnson hotel bucharest?
SELECT SUM("Rank") FROM table_35773 WHERE "Built" < '2007' AND "Building" = 'howard johnson hotel bucharest'
wikisql
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
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, give me the comparison about the sum of employee_id over the hire_date bin hire_date by time, and list by the sum employee id in ascending please.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(EMPLOYEE_ID)
nvbench
CREATE TABLE table_29619494_2 ( apocalypstix VARCHAR, denim_demons VARCHAR )
List all the places that the Apocalypstix occupied when the Denim Demons were 2nd.
SELECT apocalypstix FROM table_29619494_2 WHERE denim_demons = "2nd"
sql_create_context
CREATE TABLE table_79418 ( "Time" text, "Wind" text, "Athlete" text, "Nationality" text, "Location of race" text, "Date" text )
Who was the athlete with a wind of 1.8?
SELECT "Athlete" FROM table_79418 WHERE "Wind" = '1.8'
wikisql
CREATE TABLE table_63803 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which player has a to par of +8?
SELECT "Player" FROM table_63803 WHERE "To par" = '+8'
wikisql
CREATE TABLE table_name_71 ( wins VARCHAR, events VARCHAR, rank VARCHAR )
How many win total which has the rank smaller than 3 and events smaller than 22
SELECT COUNT(wins) FROM table_name_71 WHERE events < 22 AND rank < 3
sql_create_context
CREATE TABLE table_204_442 ( id number, "institution" text, "location" text, "enrollment" number, "nickname" text, "varsity\nsports" number, "rugby\nsince" text, "head coach" text )
when was the first year of rugby of the terrapins ?
SELECT "rugby\nsince" FROM table_204_442 WHERE "nickname" = 'terrapins'
squall
CREATE TABLE table_64940 ( "Player" text, "Int'l Debut" text, "Year" text, "Cross Code Debut" text, "Date" text )
In what Year is Keith Smith's Cross Code Debut RL Test v Wales?
SELECT "Year" FROM table_64940 WHERE "Cross Code Debut" = 'rl test v wales' AND "Player" = 'keith smith'
wikisql
CREATE TABLE table_204_314 ( id number, "pos" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals for" number, "goals against" number, "goal difference" number, "points" number, "notes" text )
which two teams had the most draws ?
SELECT "team" FROM table_204_314 WHERE "draw" = (SELECT MAX("draw") FROM table_204_314)
squall
CREATE TABLE table_204_643 ( id number, "release" number, "artist" text, "title" text, "notes" text, "album" text )
what has been the last song this artist has made an other appearance on ?
SELECT "title" FROM table_204_643 ORDER BY id DESC LIMIT 1
squall
CREATE TABLE table_38144 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
Events larger than 22, and a Earnings ( $ ) of 1,543,192, and a Rank smaller than 2 has the lowest wins?
SELECT MIN("Wins") FROM table_38144 WHERE "Events" > '22' AND "Earnings ( $ )" = '1,543,192' AND "Rank" < '2'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total...
Of the upper level elective classes that are taking place next semester , which ones do n't meet on Fridays ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ...
advising