context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_89 ( id number, "team" text, "truck(s)" text, "#" number, "driver(s)" text, "primary sponsor(s)" text, "listed owner(s)" text, "crew chief" text )
who is at the top of the list ?
SELECT "team" FROM table_204_89 WHERE id = 1
squall
CREATE TABLE table_name_23 ( captain VARCHAR, year VARCHAR, guns VARCHAR )
Tell me the captain for 1774 and guns of 14
SELECT captain FROM table_name_23 WHERE year = "1774" AND guns = "14"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellv...
has patient 027-68991 been admitted to the er until 2104?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '027-68991' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.unitadmittime) <= '2104'
eicu
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
show all users from india as per their reputation.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%IN' ORDER BY Reputation DESC
sede
CREATE TABLE table_58809 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who was the away team on 9 February 1988?
SELECT "Away team" FROM table_58809 WHERE "Date" = '9 february 1988'
wikisql
CREATE TABLE table_20575 ( "Date (CE)" text, "Text" text, "Simplified characters" text, "Traditional characters" text, "Pinyin" text, "Wade-Giles" text, "Literal meaning" text )
Name the text for
SELECT "Text" FROM table_20575 WHERE "Simplified characters" = '心猿意马'
wikisql
CREATE TABLE table_name_69 ( founded VARCHAR, institution VARCHAR )
What is the date that the Institution of Lynn University was founded on?
SELECT founded FROM table_name_69 WHERE institution = "lynn university"
sql_create_context
CREATE TABLE table_name_54 ( media_market_ranking VARCHAR, metropolitan_area VARCHAR )
What is the media market ranking for new york, new york?
SELECT media_market_ranking FROM table_name_54 WHERE metropolitan_area = "new york, new york"
sql_create_context
CREATE TABLE table_203_456 ( id number, "player" text, "-1967" text, "3.3" text, "3.31" text, "4.04" text, "10.14" text, "1968" text, "total" text )
how many players made an appearance that year ?
SELECT COUNT("player") FROM table_203_456
squall
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
when patient 016-27397 was last diagnosed with hypomagnesemia since 2 years ago?
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397')) AND diagnosis.diagnosisname = 'hypomagnesemia' AND D...
eicu
CREATE TABLE table_name_55 ( opponent VARCHAR, method VARCHAR )
Who was the opponent when the method was points (4 x 0)?
SELECT opponent FROM table_name_55 WHERE method = "points (4 x 0)"
sql_create_context
CREATE TABLE table_68799 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
What Women's Doubles team played after 2004 and where Line Isberg played Women's Singles?
SELECT "Women's doubles" FROM table_68799 WHERE "Year" > '2004' AND "Women's singles" = 'line isberg'
wikisql
CREATE TABLE table_67430 ( "Team" text, "Miles [One Way]" real, "Home Result" text, "Fans Brought" text, "Away Result" text, "Fans Took" text, "Points Gained" real )
What is the points gained of the match where fans took 403 [sunday]?
SELECT SUM("Points Gained") FROM table_67430 WHERE "Fans Took" = '403 [sunday]'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
在医疗记录中有多少次给患者彭博艺开出了价格全部不高于1800.54元的药物?医疗就诊编号是多少?
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '彭博艺' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 1800.54) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '彭博艺' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FRO...
css
CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year int ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of t...
A bar chart about the name and age for all male people who don't have a wedding, and show by the Y in descending please.
SELECT Name, Age FROM people WHERE Is_Male = 'T' AND NOT People_ID IN (SELECT Male_ID FROM wedding) ORDER BY Age DESC
nvbench
CREATE TABLE table_71353 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What is the Chassis from before 1997 with a Lamborghini v12 engine?
SELECT "Chassis" FROM table_71353 WHERE "Year" < '1997' AND "Engine" = 'lamborghini v12'
wikisql
CREATE TABLE table_name_91 ( venue VARCHAR, competition VARCHAR )
In what venue did the 1982 FIFA World Cup Qualification take place?
SELECT venue FROM table_name_91 WHERE competition = "1982 fifa world cup qualification"
sql_create_context
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_I...
Please tell me how many employees in the department 80 on each type of job titles using a bar chart, list total number in asc order.
SELECT JOB_TITLE, COUNT(JOB_TITLE) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.DEPARTMENT_ID = 80 GROUP BY JOB_TITLE ORDER BY COUNT(JOB_TITLE)
nvbench
CREATE TABLE table_17759 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Bens location" text, "Original air date" text, "U.S. viewers (million)" text )
What was the original air date for the episode with 3.90 u.s. viewers (millions)?
SELECT "Original air date" FROM table_17759 WHERE "U.S. viewers (million)" = '3.90'
wikisql
CREATE TABLE table_19982699_1 ( _number INTEGER, producer VARCHAR, television_premiere VARCHAR )
How many numbers have Charles Salmon as the producer and January 27, 2007 was the television premiere?
SELECT MIN(_number) FROM table_19982699_1 WHERE producer = "Charles Salmon" AND television_premiere = "January 27, 2007"
sql_create_context
CREATE TABLE table_12846 ( "Governorate" text, "Cereals" real, "Fruit Trees" real, "Olives" real, "Industrial crops" real, "Vegetables" real )
What is the total number of vegetables of the governorate with more than 135,685 trees, less than 3,140 cereals, and less than 31,443 olives?
SELECT COUNT("Vegetables") FROM table_12846 WHERE "Fruit Trees" > '135,685' AND "Cereals" < '3,140' AND "Olives" < '31,443'
wikisql
CREATE TABLE table_72825 ( "Rank" real, "Company" text, "Headquarters" text, "Industry" text, "Sales (billion $)" text, "Profits (billion $)" text, "Assets (billion $)" text, "Market Value (billion $)" text )
What is the highest rank of a company that has 1,715.8 billion in assets?
SELECT MAX("Rank") FROM table_72825 WHERE "Assets (billion $)" = '1,715.8'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, ...
二零一八年二月三日到二零二零年十二月九日,去医疗机构6269787的新生儿门诊就诊的人有多少
SELECT COUNT(*) FROM txmzjzjlb WHERE txmzjzjlb.YLJGDM = '6269787' AND txmzjzjlb.JZKSRQ BETWEEN '2018-02-03' AND '2020-12-09' AND txmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM ftxmzjzjlb WHERE ftxmzjzjlb.YLJGDM = '6269787' AND ftxmzjzjlb.JZKSRQ BETWEEN '2018-02-03' AND '2020-12-09' AND ftxmzjzjlb.ZSEBZ > 0
css
CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code text, charac...
How many products have the color description 'red' and the characteristic name 'slow'?
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id JOIN ref_colors AS t4 ON t1.color_code = t4.color_code WHERE t4.color_description = "red" AND t3.characteristic_name = "slow"
spider
CREATE TABLE table_name_7 ( position VARCHAR, school_country VARCHAR )
What is the position of the player from Temple?
SELECT position FROM table_name_7 WHERE school_country = "temple"
sql_create_context
CREATE TABLE table_30787 ( "Player" text, "Matches" real, "Innings" real, "Runs" real, "Average" text, "Highest Score" text, "100s" real, "50s" real )
What is the highest number listed for matches?
SELECT MAX("Matches") FROM table_30787
wikisql
CREATE TABLE table_name_16 ( away_team VARCHAR, home_team VARCHAR )
If the Home team was st kilda, what was the score of the Away team they played?
SELECT away_team AS score FROM table_name_16 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_14598_5 ( composition VARCHAR, christians VARCHAR )
How many data points for chrstians are 39.7?
SELECT COUNT(composition) FROM table_14598_5 WHERE christians = "39.7"
sql_create_context
CREATE TABLE table_76257 ( "Date From" text, "Date To" text, "Position" text, "Name" text, "From" text )
Where was the player from who had the position of DF, who started 2007-10-30?
SELECT "From" FROM table_76257 WHERE "Position" = 'df' AND "Date From" = '2007-10-30'
wikisql
CREATE TABLE table_61409 ( "Letter" text, "American" text, "British" text, "Australian" text, "Examples" text )
What is the British letter with o /o /?
SELECT "British" FROM table_61409 WHERE "Letter" = 'o /oʊ/'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
Comments by a specific user containing given keyword.
SELECT Id AS "comment_link", Text, CreationDate FROM Comments WHERE Text LIKE '%##Word##%' AND UserId = '##userid##' ORDER BY CreationDate
sede
CREATE TABLE table_50179 ( "Radical (variants)" text, "Stroke count" real, "P\u012bny\u012bn" text, "Hiragana - Romaji" text, "Meaning" text, "Frequency" real, "Examples" text )
WHAT IS THE STROKE COUNT WITH RADICAL FREQUENCY SMALLER THAN 129?
SELECT AVG("Stroke count") FROM table_50179 WHERE "Radical (variants)" = '皿' AND "Frequency" < '129'
wikisql
CREATE TABLE table_80093 ( "Index" text, "Name" text, "Talent Segment" text, "Acting Segment" text, "Overall Ranking" real, "Status" text )
What's the acting segment of lin peiqi's events that are eliminated?
SELECT "Acting Segment" FROM table_80093 WHERE "Status" = 'eliminated' AND "Name" = '林佩琪 lin peiqi'
wikisql
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Give me the comparison about meter_100 over the meter_500 by a bar chart, and display from high to low by the x axis.
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_500 DESC
nvbench
CREATE TABLE table_203_293 ( id number, "years of appearance" text, "title" text, "network" text, "character name" text, "actor" text, "notes" text )
how many shows aired before 1992 ?
SELECT COUNT("title") FROM table_203_293 WHERE "years of appearance" < 1992
squall
CREATE TABLE table_204_604 ( id number, "year" number, "date" text, "driver" text, "team" text, "manufacturer" text, "race distance\nlaps" number, "race distance\nmiles (km)" text, "race time" text, "average speed\n(mph)" number, "report" text )
who won the race in 2014 ?
SELECT "driver" FROM table_204_604 WHERE "year" = 2014
squall
CREATE TABLE table_name_92 ( d_47 VARCHAR, d_49 VARCHAR )
What is the D 47 when the D 49 is r 32?
SELECT d_47 FROM table_name_92 WHERE d_49 = "r 32"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, ...
what is the monthly maximum value of patient 027-168760's urinary creatinine on their first hospital visit?
SELECT MAX(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 = '027-168760' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospita...
eicu
CREATE TABLE table_name_82 ( time VARCHAR, competition VARCHAR )
What's the total time for the summer universiade competition?
SELECT COUNT(time) FROM table_name_82 WHERE competition = "summer universiade"
sql_create_context
CREATE TABLE table_test_3 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "severe_hemodynamic_instability" bool, "consent" bool, "hemoglobin_a1c_hba1c" float, "metallic_implants" bool, "allergy_to_aspirin" bool, "creatinine_clearance_cl" float, "post_menopausal" bool,...
known creatinine clearance < 30 cc / minute ( severe kidney disease ) ;
SELECT * FROM table_test_3 WHERE creatinine_clearance_cl < 30 OR kidney_disease = 1
criteria2sql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
what is five of the most common intakes?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE entrepreneur ( People_ID VARCHAR ) CREATE TABLE people ( Name VARCHAR, People_ID VARCHAR, Weight VARCHAR )
What is the name of the entrepreneur with the greatest weight?
SELECT T2.Name FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T2.Weight DESC LIMIT 1
sql_create_context
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Tags ( Id number, TagName text, Count ...
Questions filtered by tag, sorted by # of answers.
SELECT q.Id AS "post_link", q.CreationDate, q.AnswerCount, q.Score FROM Posts AS q INNER JOIN PostTags AS pt ON q.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = '##tagName:string##' ORDER BY AnswerCount DESC LIMIT 100
sede
CREATE TABLE table_58264 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which Time/Retired has a Grid of 2?
SELECT "Time/Retired" FROM table_58264 WHERE "Grid" = '2'
wikisql
CREATE TABLE table_203_613 ( id number, "formula" text, "color" text, "symmetry" text, "space group" text, "no" number, "pearson symbol" text, "a (pm)" number, "b (pm)" number, "c (pm)" number, "z" number, "density, g/cm3" number )
of those listed , which compound has the highest density ?
SELECT "formula" FROM table_203_613 ORDER BY "density, g/cm3" DESC LIMIT 1
squall
CREATE TABLE table_30570 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
where did glenn greenough come from
SELECT "College/junior/club team" FROM table_30570 WHERE "Player" = 'Glenn Greenough'
wikisql
CREATE TABLE table_39728 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
When is the latest year that an entrant has toro rosso str1 chassis and under 1 point?
SELECT MAX("Year") FROM table_39728 WHERE "Chassis" = 'toro rosso str1' AND "Points" < '1'
wikisql
CREATE TABLE table_name_55 ( wins INTEGER, team VARCHAR, draws VARCHAR )
What is the average number of wins for Runcorn Highfield with more than 0 draws?
SELECT AVG(wins) FROM table_name_55 WHERE team = "runcorn highfield" AND draws > 0
sql_create_context
CREATE TABLE table_203_759 ( id number, "year" number, "company" text, "number of members affected" number, "duration of strike" text, "notes" text )
what is the total number of verizon workers affected by a strike ?
SELECT SUM("number of members affected") FROM table_203_759 WHERE "company" = 'verizon'
squall
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,...
在医院6149241中,根据入院诊断疾病名称把不同疾病患者的平均年龄列一下
SELECT IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '6149241' GROUP BY IN_DIAG_DIS_NM
css
CREATE TABLE table_name_31 ( stand INTEGER, qual INTEGER )
What is the sum of the stand with a qual more than 589?
SELECT SUM(stand) FROM table_name_31 WHERE qual > 589
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) 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, good_feedback int, tough_...
Which teacher is teaching the ULCS classes next Winter ?
SELECT DISTINCT instructor.name 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 INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 jobs ( JOB_ID varchar(10), JOB_TI...
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of first_name and employee_id in a bar chart.
SELECT FIRST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_55422 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was Hawthorn's away teams opponents score?
SELECT "Away team score" FROM table_55422 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE medicine ( id int, name text, Trade_Name text, FDA_approved text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, ...
Visualize a bar chart for what are the ids and names of the medicine that can interact with two or more enzymes?, and rank by the bars in ascending.
SELECT name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY name
nvbench
CREATE TABLE table_24910737_1 ( title VARCHAR, us_viewers__millions_ VARCHAR )
What is the episode title that had a US viewership of 8.16?
SELECT title FROM table_24910737_1 WHERE us_viewers__millions_ = "8.16"
sql_create_context
CREATE TABLE table_203_204 ( id number, "year" number, "film" text, "language" text, "actors" text, "music" text, "banner" text, "note" text )
which film was the first to be directed by sridhar ?
SELECT "film" FROM table_203_204 ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_name_55 ( year VARCHAR, percentage VARCHAR )
Name the year with percentage of 9.66%
SELECT year FROM table_name_55 WHERE percentage = "9.66%"
sql_create_context
CREATE TABLE table_21795846_1 ( podiums VARCHAR, position VARCHAR )
If the position is 9th, what is the total podiums number?
SELECT COUNT(podiums) FROM table_21795846_1 WHERE position = "9th"
sql_create_context
CREATE TABLE table_name_8 ( race_title VARCHAR, team VARCHAR, circuit VARCHAR )
What is the race title of the Oran Park raceway circuit with team jps team bmw?
SELECT race_title FROM table_name_8 WHERE team = "jps team bmw" AND circuit = "oran park raceway"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
what were the number of times patient 027-122814 produced a urine output on the last hospital encounter?
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-122814' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient...
eicu
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number )
For each classroom, report the classroom number and the number of grades using it.
SELECT classroom, COUNT(DISTINCT grade) FROM list GROUP BY classroom
spider
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 ...
is the heart rate value of patient 22753 last measured on the last icu visit less than the value first measured on the last icu visit?
SELECT (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 = 22753) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents...
mimic_iii
CREATE TABLE person ( name text, age number, city text, gender text, job text ) CREATE TABLE personfriend ( name text, friend text, year number )
How many females does this network has?
SELECT COUNT(*) FROM person WHERE gender = 'female'
spider
CREATE TABLE table_28468 ( "Institution" text, "Location" text, "Nickname" text, "Founded" real, "Enrollment" real, "Joined" real )
Name where bethany college is
SELECT "Location" FROM table_28468 WHERE "Institution" = 'Bethany College'
wikisql
CREATE TABLE table_78708 ( "Ending" text, "American" text, "British" text, "Australian" text, "Examples" text )
Which British has Examples of exit?
SELECT "British" FROM table_78708 WHERE "Examples" = 'exit'
wikisql
CREATE TABLE table_name_29 ( place VARCHAR, dance VARCHAR, points_jury VARCHAR )
What was the place for the tango dance when the points was jury of 24 (7,5,6,6)?
SELECT place FROM table_name_29 WHERE dance = "tango" AND points_jury = "24 (7,5,6,6)"
sql_create_context
CREATE TABLE table_203_216 ( id number, "rank" number, "hospital" text, "city" text, "county" text, "# beds" number, "type of hospital" text )
does patton state hospital in the city of patton in san bernardino county have more mental health hospital beds than atascadero state hospital in atascadero , san luis obispo county ?
SELECT (SELECT "# beds" FROM table_203_216 WHERE "hospital" = 'patton state hospital') > (SELECT "# beds" FROM table_203_216 WHERE "hospital" = 'atascadero state hospital')
squall
CREATE TABLE table_937 ( "Number" real, "Astronaut" text, "Agency" text, "Total EVAs" real, "Total Time Hours:Minutes" text )
What is the total EVAs of the walk that lasted 45:34?
SELECT MAX("Total EVAs") FROM table_937 WHERE "Total Time Hours:Minutes" = '45:34'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_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, ...
自二零一零年十月十九日开始,截止到二零一六年十一月十二日,患者苗婉丽通过医保看病,统筹基金一共花了多少钱
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.PERSON_NM = '苗婉丽' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2010-10-19' AND '2016-11-12'
css
CREATE TABLE table_dev_12 ( "id" int, "systolic_blood_pressure_sbp" int, "creatinine_clearance_cl" float, "allergy_to_glucagon" bool, "platelet_count" float, "diastolic_blood_pressure_dbp" int, "insulin_requirement" float, "adverse_reaction_to_glucagon" bool, "NOUSE" float )
platelet count < 100
SELECT * FROM table_dev_12 WHERE platelet_count < 100
criteria2sql
CREATE TABLE table_1147705_1 ( engine_configuration_ VARCHAR, _notes_0_100km_h VARCHAR, engine_type VARCHAR )
What is the engine configuration $notes 0-100km/h for the engine type b5244 t2?
SELECT engine_configuration_ & _notes_0_100km_h FROM table_1147705_1 WHERE engine_type = "B5244 T2"
sql_create_context
CREATE TABLE table_41426 ( "Tournament" text, "2003" text, "2004" text, "2012" text, "2013" text )
What is the results from 2003 that has a 2012 result of 1r and a 2004 result of 2r and from the Australian Open?
SELECT "2003" FROM table_41426 WHERE "2012" = '1r' AND "2004" = '2r' AND "Tournament" = 'australian open'
wikisql
CREATE TABLE table_name_57 ( tied VARCHAR, span VARCHAR, win__percentage VARCHAR )
How many games were Tied during the Span of 2011 2013 with a less than 80% Win %?
SELECT COUNT(tied) FROM table_name_57 WHERE span = "2011–2013" AND win__percentage < 80
sql_create_context
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Answers per Fiscal Quarter by DisplayName.
SELECT pt.Name, Posts = COUNT(*), Views = SUM(COALESCE(p.ViewCount, parent.ViewCount)), Start = TIME_TO_STR(@startDate, '%B'), Finish = TIME_TO_STR(@endDate, '%B') FROM Posts AS p LEFT JOIN Posts AS parent ON p.ParentId = parent.Id JOIN Users AS u ON p.OwnerUserId = u.Id JOIN PostTypes AS pt ON p.PostTypeId = pt.Id WHE...
sede
CREATE TABLE table_18347 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the candidates for texas 1
SELECT "Candidates" FROM table_18347 WHERE "District" = 'Texas 1'
wikisql
CREATE TABLE table_35567 ( "Version" text, "Length" text, "Album" text, "Remixed by" text, "Year" real )
What's the Remixed by with a Version of Strings for Soul's Mix?
SELECT "Remixed by" FROM table_35567 WHERE "Version" = 'strings for soul''s mix'
wikisql
CREATE TABLE customer ( cust_name VARCHAR, acc_bal VARCHAR )
List the name of all customers sorted by their account balance in ascending order.
SELECT cust_name FROM customer ORDER BY acc_bal
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...
在17-02-20到20-04-10期间,患者葛德元这位患者被开出多少次地西泮片
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '葛德元' AND t_kc22.STA_DATE BETWEEN '2017-02-20' AND '2020-04-10' AND t_kc22.SOC_SRT_DIRE_NM = '地西泮片' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_NM = '葛德元' AN...
css
CREATE TABLE table_77374 ( "Opposing Team" text, "Against" real, "Date" text, "Venue" text, "Status" text )
Which opposing team had an Against score less than 42 and a Tour Match status in Rugby Park, Gisborne?
SELECT "Opposing Team" FROM table_77374 WHERE "Against" < '42' AND "Status" = 'tour match' AND "Venue" = 'rugby park, gisborne'
wikisql
CREATE TABLE table_name_96 ( score_in_the_final VARCHAR, date VARCHAR )
On the final date of April 5, 1995, what was the score?
SELECT score_in_the_final FROM table_name_96 WHERE date = "april 5, 1995"
sql_create_context
CREATE TABLE table_7990 ( "YEAR" real, "DATE" text, "CHAMPION" text, "BEAT" text, "TIME" text, "COURSE" text )
WHAT YEAR WAS ROBERT COOMBES CHAMPION ON MAY 7?
SELECT COUNT("YEAR") FROM table_7990 WHERE "CHAMPION" = 'robert coombes' AND "DATE" = 'may 7'
wikisql
CREATE TABLE table_name_19 ( games INTEGER, player VARCHAR, goals VARCHAR )
What is the average Games, when Player is Robert Hock, and when Goals is less than 24?
SELECT AVG(games) FROM table_name_19 WHERE player = "robert hock" AND goals < 24
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code ...
i would like to fly from BOSTON to PHILADELPHIA next THURSDAY
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 AS DAYS_0, days AS DAYS_1, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND DAYS_0.day_name = date_day.day_na...
atis
CREATE TABLE table_64799 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
What county has a population more than 603,403 and a mediuan family income of $61,694?
SELECT "County" FROM table_64799 WHERE "Population" > '603,403' AND "Median family income" = '$61,694'
wikisql
CREATE TABLE table_229059_2 ( dates VARCHAR, tournament_location VARCHAR )
When was the tournament in Forest Lake Country Club held?
SELECT dates FROM table_229059_2 WHERE tournament_location = "Forest Lake country Club"
sql_create_context
CREATE TABLE table_67470 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
What is the brand of DXRE?
SELECT "Branding" FROM table_67470 WHERE "Callsign" = 'dxre'
wikisql
CREATE TABLE table_10202 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team score at vfl park?
SELECT "Away team score" FROM table_10202 WHERE "Venue" = 'vfl park'
wikisql
CREATE TABLE table_name_96 ( country VARCHAR, fis_nordic_world_ski_championships VARCHAR )
Which Country has a FIS Nordic World Ski Championships of 1948, 1950?
SELECT country FROM table_name_96 WHERE fis_nordic_world_ski_championships = "1948, 1950"
sql_create_context
CREATE TABLE table_7529 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What nation has 1 as the gold and 2 as the total?
SELECT "Nation" FROM table_7529 WHERE "Gold" = '1' AND "Total" = '2'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, ...
哪些检验指标记录在检测指标名称与检测指标结果定量单位和检验指标记录38241644433相同,且检测指标结果定量大于等于其
SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '38241644433') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '38241644433') AND JCZBJGDL >= (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '38241644433')
css
CREATE TABLE table_61114 ( "Central Murray" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the number of against when Central Murray is Tooleybuc Manangatang and there are fewer than 13 wins?
SELECT MAX("Against") FROM table_61114 WHERE "Central Murray" = 'tooleybuc manangatang' AND "Wins" < '13'
wikisql
CREATE TABLE table_160510_1 ( modern_equivalent VARCHAR, former_kingdom VARCHAR, hanja VARCHAR )
What is the modern equivalent of the former kingdom 'silla' with the hanja ?
SELECT COUNT(modern_equivalent) FROM table_160510_1 WHERE former_kingdom = "Silla" AND hanja = "尙州"
sql_create_context
CREATE TABLE table_name_56 ( team VARCHAR, manner_of_departure VARCHAR )
What team did the manager come from who departed due to an end of tenure as caretaker?
SELECT team FROM table_name_56 WHERE manner_of_departure = "end of tenure as caretaker"
sql_create_context
CREATE TABLE table ( r VARCHAR, position VARCHAR, AM VARCHAR, league VARCHAR )
If the position is AM and the league is larger than 7.0, what is the total R number?
SELECT COUNT(r) FROM table WHERE position = AM AND league > 7.0
sql_create_context
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
Which class is easier : EECS 633 or EECS 498 ?
SELECT DISTINCT course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (course.number = 633 OR course.number = 498) AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1 INNER JOIN course AS COURSEalias1 ON ...
advising
CREATE TABLE table_name_82 ( laps INTEGER, year VARCHAR, position VARCHAR, number VARCHAR )
What is the fewest laps for a team with a position of DNF and a number smaller than 25 before 2001?
SELECT MIN(laps) FROM table_name_82 WHERE position = "dnf" AND number < 25 AND year < 2001
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
how many emergency hospital admission patients have private health insurance?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.insurance = "Private"
mimicsql_data
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
名叫周泰和的这个患者以前有哪些治疗项目啊?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '周泰和' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE stud...
Find the id of instructors who taught a class in Fall 2009 but not in Spring 2010.
SELECT id FROM teaches WHERE semester = 'Fall' AND year = 2009 EXCEPT SELECT id FROM teaches WHERE semester = 'Spring' AND year = 2010
spider