context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_20996 ( "Year" real, "Mens Open" text, "Womens Open" text, "Mixed Open" text, "Mens u20" text, "Womens u20" text, "Senior Mixed" text, "Mens 30" text, "Womens 30" text, "Mens 35" text, "Womens 35" text, "Mens 40" text, "Womens 40" text, "Mens 45...
What were the results of the mens open when the womens 40 was Sydney Scorpions defeated Hunter Hornets?
SELECT "Mens Open" FROM table_20996 WHERE "Womens 40" = 'Sydney Scorpions defeated Hunter Hornets'
wikisql
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JY...
列出患者韦伟彦所有检验结果指标记录的检测人为郎霞姝的检验指标流水号有多少在在2009-11-03到2010-06-13内?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
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, ...
count the number of patients whose age is less than 30 and days of hospital stay is greater than 6?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "30" AND demographic.days_stay > "6"
mimicsql_data
CREATE TABLE table_24356 ( "Type of Record" text, "Attendance" real, "Date/Year" text, "Stadium" text, "Result/Games" text )
When 2005 is the date/year how many measurements of attendance are there?
SELECT COUNT("Attendance") FROM table_24356 WHERE "Date/Year" = '2005'
wikisql
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 patient ( uniquep...
who was diagnosed with thrombocytopenia - suspected since 6 years ago?
SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'thrombocytopenia - suspected' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-6 year'))
eicu
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real )
List the snatch score and clean jerk score of body builders in ascending order of snatch score in a scatter chart
SELECT Snatch, Clean_Jerk FROM body_builder
nvbench
CREATE TABLE table_name_56 ( home_team VARCHAR, away_team VARCHAR )
What was St Kilda's home team opponents score?
SELECT home_team AS score FROM table_name_56 WHERE away_team = "st kilda"
sql_create_context
CREATE TABLE table_204_622 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how long did the 400m in erfurt , germany take for piotr kedzia ?
SELECT "notes" FROM table_204_622 WHERE "event" = '400 m' AND "venue" = 'erfurt, germany'
squall
CREATE TABLE performance ( songid number, bandmate number, stageposition text ) CREATE TABLE vocals ( songid number, bandmate number, type text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE a...
What is the label with the most albums?
SELECT label FROM albums GROUP BY label ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE products ( product_id text, product_name text, product_price number, product_description text, other_product_service_details text ) CREATE TABLE performers ( performer_id number, address_id number, customer_name text, customer_phone text, customer_email_address text...
Which workshop groups have bookings with status code 'stop'? Give me the names.
SELECT T2.store_name FROM bookings AS T1 JOIN drama_workshop_groups AS T2 ON T1.workshop_group_id = T2.workshop_group_id WHERE T1.status_code = "stop"
spider
CREATE TABLE table_26914076_3 ( us_viewers__millions_ VARCHAR, directed_by VARCHAR )
How many entries are there for u.s. viewers (millions) for the episode directed by rob bailey?
SELECT COUNT(us_viewers__millions_) FROM table_26914076_3 WHERE directed_by = "Rob Bailey"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
For the attribute All_Road and School_ID, show their proportion by a pie chart.
SELECT All_Road, School_ID FROM basketball_match
nvbench
CREATE TABLE table_18978 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is the lowest numbered game on the list?
SELECT MIN("Game") FROM table_18978
wikisql
CREATE TABLE table_name_74 ( home_team VARCHAR, tie_no VARCHAR )
Which Home team that has a Tie no of 20?
SELECT home_team FROM table_name_74 WHERE tie_no = "20"
sql_create_context
CREATE TABLE table_name_23 ( place VARCHAR, score VARCHAR )
What was the place when the score was 67-73-73=213?
SELECT place FROM table_name_23 WHERE score = 67 - 73 - 73 = 213
sql_create_context
CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text ) CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text )
Create a bar chart showing how many team across team, and I want to rank from low to high by the X-axis please.
SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team ORDER BY Team
nvbench
CREATE TABLE table_204_920 ( id number, "goal" number, "date" text, "location" text, "opponent" text, "lineup" text, "min" number, "assist/pass" text, "score" text, "result" text, "competition" text )
how many total goals were scored against nigeria ?
SELECT COUNT("goal") FROM table_204_920 WHERE "opponent" = 'nigeria'
squall
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 lab ( labid numbe...
the first time since 06/2105, when was patient 007-4322 prescribed insulin lispro 100 units/ml subq soln and insulin aspart at the same time?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'insulin lispro 100 units/ml subq soln' AND patient.uniquepid = '007-4322' AND STRFTIME('%y-%m', medication.drugstarttime)...
eicu
CREATE TABLE table_60723 ( "Place" real, "Name" text, "All Around" real, "Hoop" real, "Total" real )
What is the smallest all around when the total is 19.85 and the hoop is less than 9.85?
SELECT MIN("All Around") FROM table_60723 WHERE "Total" = '19.85' AND "Hoop" < '9.85'
wikisql
CREATE TABLE table_61719 ( "Year" text, "Tournaments played" real, "Cuts made*" real, "Wins" real, "Top 10s" real, "Best finish" text, "Earnings ( $ )" text, "Money list rank" text, "Scoring average" text, "Scoring rank" text )
What is the best top 10 when there are fewer than 0 wins?
SELECT MAX("Top 10s") FROM table_61719 WHERE "Wins" < '0'
wikisql
CREATE TABLE table_48186 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Opponent" text, "Score" text )
What is the lowest Year, when Surface is Hard, and when Opponent is Dinara Safina?
SELECT MIN("Year") FROM table_48186 WHERE "Surface" = 'hard' AND "Opponent" = 'dinara safina'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE R...
SELECT TOP 10 Id, DisplayName FROM Users;.
SELECT Id, DisplayName FROM Users LIMIT 10
sede
CREATE TABLE table_name_86 ( lane VARCHAR, rank VARCHAR, name VARCHAR )
what is the number of lane with a rank more than 2 for Louise rnstedt?
SELECT COUNT(lane) FROM table_name_86 WHERE rank > 2 AND name = "louise ørnstedt"
sql_create_context
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR...
Give me a pie to show the total number from different rank.
SELECT Rank, COUNT(*) FROM Faculty GROUP BY Rank
nvbench
CREATE TABLE table_8315 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the Attendance on November 6, 1960?
SELECT "Attendance" FROM table_8315 WHERE "Date" = 'november 6, 1960'
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...
在6998667这个医院的患者魏烨磊,他的出院诊断疾病名称中不包括楔状缺损的医疗就诊记录编号是哪些
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_NM = '魏烨磊' AND gwyjzb.MED_SER_ORG_NO = '6998667' AND NOT gwyjzb.OUT_DIAG_DIS_NM LIKE '%楔状缺损%' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '魏烨磊' AND fgwyjzb.MED_SER_ORG_NO = '6998667' AND NOT fgwyjzb.OUT_DIAG_DIS_NM LIKE '%楔状缺损%'
css
CREATE TABLE table_3443 ( "Actor/Actress" text, "Character" text, "First Appearance" text, "Last Appearance" text, "Duration" text, "Total" real )
What is the highest total number?
SELECT MAX("Total") FROM table_3443
wikisql
CREATE TABLE table_name_83 ( british VARCHAR, australian VARCHAR, examples VARCHAR )
What is British, when Australian is 'i, , ', and when Examples is ' sophagus'?
SELECT british FROM table_name_83 WHERE australian = "i, ɪ, ə" AND examples = "œsophagus"
sql_create_context
CREATE TABLE table_name_82 ( city VARCHAR, date VARCHAR )
On October 8, what city was the game played?
SELECT city FROM table_name_82 WHERE date = "october 8"
sql_create_context
CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
因疾病F35.173住院在9918这个科室记录有多少平均费用,时间在二零零六年八月二十七日至二零一四年六月十四日
SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '9918' AND gwyjzb.IN_HOSP_DATE BETWEEN '2006-08-27' AND '2014-06-14' AND gwyjzb.IN_DIAG_DIS_CD = 'F35.173' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '9918' AND fgwyjzb.IN_HOSP_DAT...
css
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
名为秦傲雪的患者有哪些检验报告单的报告日期在一四年九月六日以前?这些报告单所对应的住院就诊的流水号是什么
SELECT wdmzjzjlb.JZLSH 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 person_info.XM = '秦傲雪' AND NOT wdmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2014-09-0...
css
CREATE TABLE table_203_240 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text )
who played previous to the pirates on august 4 ?
SELECT "opponent" FROM table_203_240 WHERE id = (SELECT id FROM table_203_240 WHERE "date" = 'august 4' AND "opponent" = 'pirates') - 1
squall
CREATE TABLE table_name_24 ( date VARCHAR, venue VARCHAR )
On what date did the game at Windy Hill take place?
SELECT date FROM table_name_24 WHERE venue = "windy hill"
sql_create_context
CREATE TABLE table_23614702_2 ( speed___knots__ VARCHAR, tons___lton__ VARCHAR )
List the maximum speed for the 1.150 ton ships?
SELECT speed___knots__ FROM table_23614702_2 WHERE tons___lton__ = "1.150"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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, ...
when did patient 24547 have a lipids 20% intake for the last time?
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24547)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label...
mimic_iii
CREATE TABLE table_name_85 ( score VARCHAR, date VARCHAR )
WHAT IS THE SCORE OF MARCH 28?
SELECT score FROM table_name_85 WHERE date = "march 28"
sql_create_context
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE course ( c...
For 619 , when does it meet in the Summer ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
advising
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
when did patient 52647 get a last lab test?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 52647) ORDER BY labevents.charttime DESC LIMIT 1
mimic_iii
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the gender and admission time of the patient id 87275?
SELECT demographic.gender, demographic.admittime FROM demographic WHERE demographic.subject_id = "87275"
mimicsql_data
CREATE TABLE table_name_1 ( britain__2013_ VARCHAR, us__2013_ VARCHAR )
What was Britain's (2013) birthstone when the U.S (2013) birthstone was ruby?
SELECT britain__2013_ FROM table_name_1 WHERE us__2013_ = "ruby"
sql_create_context
CREATE TABLE table_203_19 ( id number, "number" number, "builder" text, "type" text, "date" number, "length" text, "notes" text )
what was the number of cars built by american car company ?
SELECT COUNT(*) FROM table_203_19 WHERE "builder" = 'american car company'
squall
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...
列出患者43772576所有检验结果指标记录中的仪器编号以及名称在2005-02-16到2014-01-13内均为什么?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ...
css
CREATE TABLE table_name_80 ( place VARCHAR, artist VARCHAR, draw VARCHAR )
How many places have an Artist of august , and a Draw smaller than 6?
SELECT COUNT(place) FROM table_name_80 WHERE artist = "augustė" AND draw < 6
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...
在2009年3月25日到2012年4月22日以内,患者朱元纬医保的个人账户支出共有多少钱?
SELECT SUM(t_kc24.PER_ACC_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.PERSON_NM = '朱元纬' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2009-03-25' AND '2012-04-22' UNION SELECT SUM(t_kc24.PER_ACC_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE fgwyjz...
css
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...
count the number of patients born before 2073 who have iv route of drug administration.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2073" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE product_characteristics ( product_id number, characteristic_id number, product_characteristic_value text ) CREATE TABLE characteristics ( characteristic_id number, characteristic_type_code text, characteri...
Give the color description that is least common across products.
SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) LIMIT 1
spider
CREATE TABLE table_66600 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text )
Who is the owner of CKLF-FM?
SELECT "Owner" FROM table_66600 WHERE "Call sign" = 'cklf-fm'
wikisql
CREATE TABLE table_53739 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the date of the game when the home team scored 7.13 (55)?
SELECT "Date" FROM table_53739 WHERE "Home team score" = '7.13 (55)'
wikisql
CREATE TABLE table_name_54 ( area VARCHAR, name VARCHAR )
What is the area of Mangamahu primary school?
SELECT area FROM table_name_54 WHERE name = "mangamahu primary school"
sql_create_context
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...
what is discharge time and diagnoses icd9 code of subject id 42820?
SELECT demographic.dischtime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "42820"
mimicsql_data
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) ...
keywords used by luke zettlemoyer
SELECT DISTINCT keyphrase.keyphraseid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'luke zettlemoyer' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Draw a scatter chart about the correlation between Team_ID and ACC_Percent , and group by attribute All_Home.
SELECT Team_ID, ACC_Percent FROM basketball_match GROUP BY All_Home
nvbench
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
What are the courses required to major but not in the ARTDES department ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department <> 'ARTDES' AND program_course.course_id = course.course_id AND program.program_id = program_course.program_id
advising
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Badges ( Id number, UserId numb...
C#.
SELECT DATEADD(m, DATEDIFF(m, 0, CreationDate), 0) AS Month, AVG(qi.Interval) AS AveregeToFirstAnswer FROM (SELECT q.Id AS id, q.CreationDate AS CreationDate, MIN(a.CreationDate) AS AnswerCreationDate, DATEDIFF(hh, q.CreationDate, MIN(a.CreationDate)) AS Interval FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q....
sede
CREATE TABLE table_26139405_1 ( writer VARCHAR, episode__number VARCHAR )
Who wrote episode 26 in the series?
SELECT writer FROM table_26139405_1 WHERE episode__number = 26
sql_create_context
CREATE TABLE table_41111 ( "Headphone Model" text, "Headphone Class" text, "Driver-matched dB" real, "Construction" text, "Earpads" text, "Termination" text, "US MSRP" text )
What was the termination type for the headphones with comfort pads and selling for $150?
SELECT "Termination" FROM table_41111 WHERE "Earpads" = 'comfort pads' AND "US MSRP" = '$150'
wikisql
CREATE TABLE table_204_365 ( id number, "year" number, "single" text, "chart positions\nusa billboard hot dance club play" number, "chart positions\npolish charts" number, "album" text )
what was natalia lesz 's most popular song , according to the polish charts ?
SELECT "single" FROM table_204_365 ORDER BY "chart positions\npolish charts" LIMIT 1
squall
CREATE TABLE table_21500850_1 ( original_game VARCHAR, artist VARCHAR )
What is every original game for the artist Lynyrd Skynyrd?
SELECT original_game FROM table_21500850_1 WHERE artist = "Lynyrd Skynyrd"
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Draw a bar chart about the distribution of Date_of_Birth and Height , sort from low to high by the x axis.
SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth
nvbench
CREATE TABLE table_name_67 ( bronze INTEGER, total VARCHAR, silver VARCHAR, gold VARCHAR )
What is the highest bronze when the silver was 0, the gold was larger than 0, and the total was larger than 2?
SELECT MAX(bronze) FROM table_name_67 WHERE silver = 0 AND gold > 0 AND total > 2
sql_create_context
CREATE TABLE qtb ( 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...
根据入院诊断疾病编码,编号为6735951的医院内部患有不同疾病的人的平均患者年龄是多少岁?
SELECT qtb.IN_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '6735951' GROUP BY qtb.IN_DIAG_DIS_CD UNION SELECT gyb.IN_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '6735951' GROUP BY gyb.IN_DIAG_DIS_CD UNION SELECT zyb.IN_DIAG_DIS_CD, AVG(zyb.PERSON_AGE) FROM zyb WHERE zyb....
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients with admission year before 2178 have abnormal lab test results?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2178" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
Can I take 513 on days like Monday and Wednesday ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
CREATE TABLE table_26424 ( "Stage (Winner)" text, "General classification" text, "Sprint Classification" text, "Mountains Classification" text, "Youth Classification" text, "Aggressive Rider" text, "Team Classification" text )
Name the sprint classification for michael barry
SELECT "Sprint Classification" FROM table_26424 WHERE "Aggressive Rider" = 'Michael Barry'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, Dupli...
Filter posts by high rep user.
SELECT ParentId AS "post_link", OwnerUserId FROM Posts JOIN Users ON Posts.OwnerUserId = Users.Id WHERE Users.Reputation > @RepFilter AND PostTypeId = 1
sede
CREATE TABLE table_name_55 ( round INTEGER, college VARCHAR, overall VARCHAR )
WHAT IS THE ROUND FROM MICHIGAN COLLEGE, AND OVERALL LARGER THAN 37?
SELECT SUM(round) FROM table_name_55 WHERE college = "michigan" AND overall > 37
sql_create_context
CREATE TABLE financial_transactions ( transaction_id number, previous_transaction_id number, account_id number, card_id number, transaction_type text, transaction_date time, transaction_amount number, transaction_comment text, other_transaction_details text ) CREATE TABLE customers_...
Show ids, customer ids, names for all accounts.
SELECT account_id, customer_id, account_name FROM accounts
spider
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
has there been a abscess microbiology test performed in their first hospital encounter on patient 025-28600?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-28600' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital...
eicu
CREATE TABLE table_21243 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Where are all of Utah's games held and how many have attended?
SELECT "Location Attendance" FROM table_21243 WHERE "Team" = 'Utah'
wikisql
CREATE TABLE table_54461 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text )
What was the the total top attendance with a score of 0 4?
SELECT MAX("Attendance") FROM table_54461 WHERE "Score" = '0 – 4'
wikisql
CREATE TABLE table_1713 ( "Source" text, "Dates administered" text, "Democrat: Christine Gregoire" text, "Republican: Dino Rossi" text, "Lead Margin" text )
What was the percentage democrat Christine Gregoire was polling when the republican Dino Rossi was polling at 44% and the lead margin was 4?
SELECT "Democrat: Christine Gregoire" FROM table_1713 WHERE "Lead Margin" = '4' AND "Republican: Dino Rossi" = '44%'
wikisql
CREATE TABLE table_54637 ( "Round" real, "Date" text, "Place" text, "Finished" text, "Total Points" real, "Standing" text )
I want the standing for january 29 and finished of 3rd and total points less than 248
SELECT "Standing" FROM table_54637 WHERE "Total Points" < '248' AND "Finished" = '3rd' AND "Date" = 'january 29'
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 d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_icd_procedures ( row_i...
did patient 26799 since 2101 undergo surgery?
SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26799) AND STRFTIME('%y', procedures_icd.charttime) >= '2101'
mimic_iii
CREATE TABLE table_53078 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date was the game played at vfl park?
SELECT "Date" FROM table_53078 WHERE "Venue" = 'vfl park'
wikisql
CREATE TABLE table_name_83 ( władysławowo_ VARCHAR, _poland VARCHAR, snatch VARCHAR, world_record VARCHAR, marcin_dołęga___pol__ VARCHAR )
What shows for W adys awowo, Poland when the world record shows olympic record, a Marcin Do ga (POL) is olympic standard, and Snatch is clean & jerk?
SELECT władysławowo_, _poland FROM table_name_83 WHERE world_record = "olympic record" AND marcin_dołęga___pol__ = "olympic standard" AND snatch = "clean & jerk"
sql_create_context
CREATE TABLE advisor ( s_id text, i_id text ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE prereq ( course_id text, prereq_id text ) CREATE TABLE depar...
Count the number of rooms that are not in the Lamberton building.
SELECT COUNT(*) FROM classroom WHERE building <> 'Lamberton'
spider
CREATE TABLE table_5989 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Total smaller than 7, and a Bronze larger than 1 is what amount of average silver?
SELECT AVG("Silver") FROM table_5989 WHERE "Total" < '7' AND "Bronze" > '1'
wikisql
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...
在17年10月30日到18年12月8日期间,列出金宏茂患者所有检验结果指标记录中用的什么检测方法?
SELECT jyjgzbb.JCFF 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 = jyj...
css
CREATE TABLE customers ( customer_id number, customer_details text ) CREATE TABLE customer_policies ( policy_id number, customer_id number, policy_type_code text, start_date time, end_date time ) CREATE TABLE settlements ( settlement_id number, claim_id number, date_claim_made ...
Give me the the customer details and id for the customers who had two or more policies but did not file any claims.
SELECT T1.customer_details, T1.customer_id FROM customers AS T1 JOIN customer_policies AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id HAVING COUNT(*) >= 2 EXCEPT SELECT T1.customer_details, T1.customer_id FROM customers AS T1 JOIN customer_policies AS T2 ON T1.customer_id = T2.customer_id JOIN claims ...
spider
CREATE TABLE table_name_95 ( pole VARCHAR, flap VARCHAR, podium VARCHAR )
When the Flap is less than 15 and the podium is larger than 11, what is the pole?
SELECT pole FROM table_name_95 WHERE flap < 15 AND podium > 11
sql_create_context
CREATE TABLE HOST ( Name VARCHAR, Host_ID VARCHAR ) CREATE TABLE party ( Party_ID VARCHAR, Number_of_hosts INTEGER ) CREATE TABLE party_host ( Host_ID VARCHAR, Party_ID VARCHAR )
Show the host names for parties with number of hosts greater than 20.
SELECT T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID WHERE T3.Number_of_hosts > 20
sql_create_context
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,...
医疗就诊53958791954与医疗就诊57666307159中开出了哪些名称相同的药品?其名称都叫什么?
(SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '57666307159') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '53958791954')
css
CREATE TABLE table_22007 ( "Team" text, "Outgoing manage" text, "Manner" text, "Date of vacancy" text, "Incoming manager" text, "Date of appointment" text )
What team(s) had an outgoing manager of jo o alves?
SELECT "Team" FROM table_22007 WHERE "Outgoing manage" = 'João Alves'
wikisql
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...
门诊就诊中开出的检验报告单47110365099是谁的
SELECT person_info.XM FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '4...
css
CREATE TABLE table_name_61 ( city VARCHAR, icao VARCHAR )
Which city has an ICAO of Oejn?
SELECT city FROM table_name_61 WHERE icao = "oejn"
sql_create_context
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) C...
Top Users in Brisbane by reputation.
SELECT Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%brisbane%' ORDER BY Reputation DESC
sede
CREATE TABLE zyb ( 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...
哪几次医疗记录中给病患任雅昶开出过金额高于2237.38元的药品?列出医疗就诊编号是多少?
SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '任雅昶' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2237.38) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '任雅昶' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2237....
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
what is the total amount of output of patient 19981 has had on the first icu visit?
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19981) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1)
mimic_iii
CREATE TABLE table_3044 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text )
What the total amount of points won during seed 25?
SELECT COUNT("Points won") FROM table_3044 WHERE "Seed" = '25'
wikisql
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 prescription...
provide the number of patient with replaced route of drug administration who have procedure icd9 code 8105.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8105" AND prescriptions.route = "REPLACE"
mimicsql_data
CREATE TABLE table_694 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What district first elected in 1978?
SELECT "District" FROM table_694 WHERE "First elected" = '1978'
wikisql
CREATE TABLE table_name_12 ( venue VARCHAR, runs VARCHAR )
What was the venue for runs 325/6?
SELECT venue FROM table_name_12 WHERE runs = "325/6"
sql_create_context
CREATE TABLE table_1342249_5 ( party VARCHAR, district VARCHAR )
What party did the incumbent of the Arkansas 6 district belong to?
SELECT party FROM table_1342249_5 WHERE district = "Arkansas 6"
sql_create_context
CREATE TABLE table_204_596 ( id number, "year" number, "winners" text, "score" text, "runners up" text, "notes" text )
tell me the difference in the scores for the game in 1955 .
SELECT ABS("score" - "score") FROM table_204_596 WHERE "year" = 1955
squall
CREATE TABLE table_27723526_13 ( record VARCHAR, team VARCHAR )
What is the record after the Phoenix game?
SELECT record FROM table_27723526_13 WHERE team = "Phoenix"
sql_create_context
CREATE TABLE table_74993 ( "Release date" text, "Release title" text, "Country" text, "Publisher" text, "Format" text, "Language" text, "Subtitles" text, "Notes" text )
Which country had a release of 1 VCD titled Martial Law: Substitutes?
SELECT "Country" FROM table_74993 WHERE "Notes" = '1 vcd' AND "Release title" = 'martial law: substitutes'
wikisql
CREATE TABLE keyword ( id int, keyword text ) CREATE TABLE copyright ( id int, msid int, cid int ) CREATE TABLE genre ( gid int, genre text ) CREATE TABLE made_by ( id int, msid int, pid int ) CREATE TABLE directed_by ( id int, msid int, did int ) CREATE TABLE ta...
find the number of actors from Iran who played in ' Jim Jarmusch ' movies
SELECT COUNT(DISTINCT (actor.name)) FROM actor, cast, directed_by, director, movie WHERE actor.nationality = 'Iran' AND cast.aid = actor.aid AND director.did = directed_by.did AND director.name = 'Jim Jarmusch' AND movie.mid = cast.msid AND movie.mid = directed_by.msid
imdb
CREATE TABLE table_61064 ( "Season" text, "Date" text, "Winners" text, "Finalists" text, "Score" text )
When did Motherwell win?
SELECT "Date" FROM table_61064 WHERE "Winners" = 'motherwell'
wikisql
CREATE TABLE table_20190834_1 ( enrollment INTEGER, team_name VARCHAR )
What is the maximum enrollment of the Sooners?
SELECT MAX(enrollment) FROM table_20190834_1 WHERE team_name = "Sooners"
sql_create_context
CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE t...
Give me a bar chart about the number of platforms in different locations, show total number in asc order.
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location ORDER BY SUM(Number_of_Platforms)
nvbench