context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_84 ( attendance VARCHAR, date VARCHAR )
What was the attendance for july 18?
SELECT COUNT(attendance) FROM table_name_84 WHERE date = "july 18"
sql_create_context
CREATE TABLE table_23089 ( "Country" text, "Area km\u00b2" real, "Population" real, "Population density per km\u00b2" real, "HDI (2011)" text, "Capital" text )
Which capitals have an area of exactly 377930 square km?
SELECT "Capital" FROM table_23089 WHERE "Area km\u00b2" = '377930'
wikisql
CREATE TABLE table_20217456_7 ( rl_süd__1st_ VARCHAR, rl_südwest__1st_ VARCHAR )
Who was RL S d (1st) when FK Pirmasens was RL S dwest (1st)?
SELECT rl_süd__1st_ FROM table_20217456_7 WHERE rl_südwest__1st_ = "FK Pirmasens"
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 jyjgzbb ( BGDH text, BGRQ tim...
门诊就诊34693713657的时间是啥时候?
SELECT zzmzjzjlb.JZKSRQ FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '34693713657' UNION SELECT fzzmzjzjlb.JZKSRQ FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '34693713657'
css
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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 te...
81766246008住院就诊的患者出院病区的代码和名称分别是啥?在这个病区的哪个床位出院的
SELECT zyjzjlb.CYBQDM, zyjzjlb.CYBQMC, zyjzjlb.CYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '81766246008'
css
CREATE TABLE table_name_57 ( venue VARCHAR, away_team VARCHAR )
Where did Richmond play as the away team?
SELECT venue FROM table_name_57 WHERE away_team = "richmond"
sql_create_context
CREATE TABLE Product ( product_id INTEGER, product_name VARCHAR(80), product_details VARCHAR(255) ) CREATE TABLE Problem_Log ( problem_log_id INTEGER, assigned_to_staff_id INTEGER, problem_id INTEGER, problem_category_code VARCHAR(20), problem_status_code VARCHAR(20), log_entry_date...
Find all the ids and dates of the logs for the problem whose id is 10 Plot them as bar chart, I want to list in descending by the log_entry_date.
SELECT log_entry_date, problem_log_id FROM Problem_Log WHERE problem_id = 10 ORDER BY log_entry_date DESC
nvbench
CREATE TABLE table_name_76 ( unit_test VARCHAR, msdn_integration VARCHAR, projects_templates VARCHAR )
Which Unit test has a MSDN integration of full, and a Projects templates of yes?
SELECT unit_test FROM table_name_76 WHERE msdn_integration = "full" AND projects_templates = "yes"
sql_create_context
CREATE TABLE table_204_914 ( id number, "year" number, "team" text, "games" number, "attempts" number, "yards" number, "ypc" number, "long" number, "tds" number )
what was the only year that this player played for the atlanta falcons ?
SELECT "year" FROM table_204_914 WHERE "team" = 'atlanta falcons'
squall
CREATE TABLE Fault_Log_Parts ( fault_log_entry_id INTEGER, part_fault_id INTEGER, fault_status VARCHAR(10) ) CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_datetime DATETIME, fault_description VARCHAR(255), other_...
Visualize a scatter chart on how many assets does each maintenance contract contain? List the number and the contract id.
SELECT COUNT(*), T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id
nvbench
CREATE TABLE table_41209 ( "Year" real, "Film" text, "Director" text, "Producer" text, "Writer" text )
What year is the latest year that has no under director?
SELECT MAX("Year") FROM table_41209 WHERE "Director" = 'no'
wikisql
CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) CREATE TABLE race ( race_id number, name text, class text, date text, track_id text )
Find the locations where have both tracks with more than 90000 seats and tracks with less than 70000 seats.
SELECT location FROM track WHERE seating > 90000 INTERSECT SELECT location FROM track WHERE seating < 70000
spider
CREATE TABLE table_10364 ( "State" text, "Swimsuit" real, "Interview" real, "Evening Gown" real, "Average" real )
What is the lowest swimsuit score a contestant from Rhode Island with an average larger than 9.235 has?
SELECT MIN("Swimsuit") FROM table_10364 WHERE "State" = 'rhode island' AND "Average" > '9.235'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
until 6 months ago, what was the monthly maximum intake of po cl liqs of patient 008-19005?
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-19005')) AND intakeoutput.celllabel = 'po cl...
eicu
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...
看看患有牙折断的病人,都是开的哪些编号和名称的药品来治疗的
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.IN_DIAG_DIS_NM = '牙折断' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.IN_DIAG_DIS_NM = '牙折断' UNION SELE...
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id num...
what are the five most commonly ordered microbiology tests for patients that had already received packed cell transfusion during the same hospital visit the last year?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_pro...
mimic_iii
CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Coun...
Show me about the correlation between ID and meter_100 in a scatter chart.
SELECT ID, meter_100 FROM swimmer
nvbench
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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...
编号为63566626307检验报告单的标本代码、名称、状态都是什么?
SELECT zyjybgb.BBDM, zyjybgb.BBMC, zyjybgb.BBZT FROM zyjybgb WHERE zyjybgb.BGDH = '63566626307' UNION SELECT mzjybgb.BBDM, mzjybgb.BBMC, mzjybgb.BBZT FROM mzjybgb WHERE mzjybgb.BGDH = '63566626307'
css
CREATE TABLE table_dev_40 ( "id" int, "tc" int, "ldl_cholesterol" int, "systolic_blood_pressure_sbp" int, "untreated_hyperlipidemia" bool, "hemoglobin_a1c_hba1c" float, "platelets" int, "neutropenia" int, "thrombocytopenia" float, "diastolic_blood_pressure_dbp" int, "tgc" int...
fasting serum lipoprotein values of: ldl _ cholesterol, > 160 mg / dl or triglycerides, > 500 mg / dl
SELECT * FROM table_dev_40 WHERE fasting_serum_lipoprotein = 1 OR ldl_cholesterol > 160 OR triglyceride_tg > 500
criteria2sql
CREATE TABLE table_50620 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partnering" text, "Opponent in the final" text, "Score" text )
What tournament is on 18 May 1992?
SELECT "Tournament" FROM table_50620 WHERE "Date" = '18 may 1992'
wikisql
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID
nvbench
CREATE TABLE table_name_83 ( supercopa_sudamericana_1992 VARCHAR, team VARCHAR )
Which Supercopa Sudamericana 1992 has a Team of santos?
SELECT supercopa_sudamericana_1992 FROM table_name_83 WHERE team = "santos"
sql_create_context
CREATE TABLE debate_people ( debate_id number, affirmative number, negative number, if_affirmative_win others ) CREATE TABLE people ( people_id number, district text, name text, party text, age number ) CREATE TABLE debate ( debate_id number, date text, venue text, ...
Show the distinct venues of debates
SELECT DISTINCT venue FROM debate
spider
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
SOja - Number of active posts last month per 3 moderators.
SELECT COUNT(*) AS PostsLastMonth, 3 AS Moderators, (COUNT(*) / 3) AS PostsLastMonthPerMod FROM Posts WHERE LastActivityDate >= DATEADD(month, -1, (SELECT MAX(LastActivityDate) FROM Posts))
sede
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 the number of patients whose religion is greek orthodox and admission year is less than 2203?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "GREEK ORTHODOX" AND demographic.admityear < "2203"
mimicsql_data
CREATE TABLE table_name_88 ( make VARCHAR, year VARCHAR )
what is the make for the year 2008?
SELECT make FROM table_name_88 WHERE year = 2008
sql_create_context
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 ...
when was the first time that patient 2700 was prescribed with dexamethasone in 12/2100?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2700) AND prescriptions.drug = 'dexamethasone' AND STRFTIME('%y-%m', prescriptions.startdate) = '2100-12' ORDER BY prescriptions.startdate LIMIT 1
mimic_iii
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
what is the marital status of patient 58932 on their first hospital visit?
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 58932 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight i...
give me fares from ATLANTA to BALTIMORE
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, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
atis
CREATE TABLE table_name_16 ( react INTEGER, time VARCHAR, rank VARCHAR, nationality VARCHAR )
Which Reaction has a Rank smaller than 4, and a Nationality of trinidad and tobago, and a Time larger than 45.13?
SELECT AVG(react) FROM table_name_16 WHERE rank < 4 AND nationality = "trinidad and tobago" AND time > 45.13
sql_create_context
CREATE TABLE table_204_859 ( id number, "year" number, "seniors (trood award & rodda medal)" text, "reserves (rex hartley medal)" text, "under 18's (bruce wilkinson medal)" text, "under 16's (shaw/carter medal)" text )
who is the only medal winner of 1985 ?
SELECT "seniors (trood award & rodda medal)" FROM table_204_859 WHERE "year" = 1985
squall
CREATE TABLE table_49515 ( "Poll Source" text, "Dates administered" text, "Democrat: Vivian Davis Figures" text, "Republican: Jeff Sessions" text, "Lead Margin" real )
What is the date administered when Vivian Davis Figures was at 37%?
SELECT "Dates administered" FROM table_49515 WHERE "Democrat: Vivian Davis Figures" = '37%'
wikisql
CREATE TABLE table_name_74 ( score VARCHAR, event VARCHAR )
Which Score has an Event of constructionjobs.com classic?
SELECT score FROM table_name_74 WHERE event = "constructionjobs.com classic"
sql_create_context
CREATE TABLE table_name_16 ( tournament VARCHAR )
What was the result in 2011 for the French Open tournament?
SELECT 2011 FROM table_name_16 WHERE tournament = "french open"
sql_create_context
CREATE TABLE table_40968 ( "Player" text, "Nationality" text, "Position" text, "Years in Orlando" text, "School/Club Team" text )
Which Player has a School/Club Team of Illinois?
SELECT "Player" FROM table_40968 WHERE "School/Club Team" = 'illinois'
wikisql
CREATE TABLE table_13750 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
In which lane did the swimmer with a time of 1:58.44 swim?
SELECT COUNT("Lane") FROM table_13750 WHERE "Time" = '1:58.44'
wikisql
CREATE TABLE table_43209 ( "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
When Don't Forget the Lyrics aired at 8:30 what aired at 9:00?
SELECT "9:00" FROM table_43209 WHERE "8:30" = 'don''t forget the lyrics'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
count the number of patients whose language is span and age is less than 74?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.age < "74"
mimicsql_data
CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
Show how many country from each country, show bars in desc order.
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country DESC
nvbench
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) ...
Number of open answered questions.
SELECT COUNT(DISTINCT p_q.Id) FROM Posts AS p_a INNER JOIN Posts AS p_q ON p_q.Id = p_a.ParentId AND p_q.PostTypeId = 1 AND p_q.ClosedDate IS NULL WHERE p_a.PostTypeId = 2 AND (p_a.Score > 0 OR p_a.Id = p_q.AcceptedAnswerId)
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( uniquepid text, ...
how many days has it been since the last intake of ivpb volume (ml) for patient 006-133605 on the current icu visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE table_name_14 ( no_s_ INTEGER, years_for_rockets VARCHAR )
What is the average number of years for the Houston Rockets 2004-05?
SELECT AVG(no_s_) FROM table_name_14 WHERE years_for_rockets = "2004-05"
sql_create_context
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
Are there any professors who have given a B to a student minoring in RCSSCI ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN student_record ON student_record.offering_id = offering_instructor.offering_id INNER JOIN student ON student.student_id = student_record.student_id WHERE (student_rec...
advising
CREATE TABLE table_59506 ( "School" text, "Suburb/Town" text, "Years" text, "Founded" real, "Website" text )
Which website is located in Albury and has a school of Albury High School?
SELECT "Website" FROM table_59506 WHERE "Suburb/Town" = 'albury' AND "School" = 'albury high school'
wikisql
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, ...
what is the change/difference of the platelet count of patient 42757 measured at 2102-11-07 05:01:00 compared to the value measured at 2102-11-07 00:15:00?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42757) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'platelet count') AND labevents.charttime = '2102-11-07 05:01:00') - (SEL...
mimic_iii
CREATE TABLE table_19371 ( "Team" text, "Average" text, "Points" real, "Played" real, "1986-87" text, "1987-88" text, "1988-89" real )
list the number of matches played by the teams that got an average of 1.079
SELECT "1986-87" FROM table_19371 WHERE "Average" = '1.079'
wikisql
CREATE TABLE table_73533 ( "Episode" text, "First broadcast" text, "Seans team" text, "Jasons team" text, "Scores" text )
In how many episodes did Sean's team include Jeremy Clarkson and James McQuillan?
SELECT COUNT("Episode") FROM table_73533 WHERE "Seans team" = 'Jeremy Clarkson and James McQuillan'
wikisql
CREATE TABLE table_54103 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What did home team score at glenferrie oval?
SELECT "Home team score" FROM table_54103 WHERE "Venue" = 'glenferrie oval'
wikisql
CREATE TABLE table_name_85 ( a_league VARCHAR, pre_season INTEGER )
How much A-League has a Pre-Season larger than 0?
SELECT COUNT(a_league) FROM table_name_85 WHERE pre_season > 0
sql_create_context
CREATE TABLE table_name_2 ( name VARCHAR, round VARCHAR )
What is the name of the player taken in round 23?
SELECT name FROM table_name_2 WHERE round = 23
sql_create_context
CREATE TABLE table_11012 ( "Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text )
What is the title of the episode written by David J. Burke?
SELECT "Title" FROM table_11012 WHERE "Written by" = 'david j. burke'
wikisql
CREATE TABLE table_26136228_3 ( episode_no INTEGER, us_viewers__millions_ VARCHAR )
What episode number in the season had 1.05 million U.S. viewers?
SELECT MAX(episode_no) FROM table_26136228_3 WHERE us_viewers__millions_ = "1.05"
sql_create_context
CREATE TABLE table_59405 ( "State" text, "Born/Died" text, "Active service" text, "Chief Judge" text, "Senior status" text, "Appointed by" text, "Reason for termination" text )
Which Senior status has a Chief Judge of 1991 1995?
SELECT "Senior status" FROM table_59405 WHERE "Chief Judge" = '1991–1995'
wikisql
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
How many answered questions are there for a tag?.
SELECT COUNT(p.Id) FROM Posts AS p INNER JOIN PostTags AS pt ON pt.TagId = @TagId WHERE pt.PostId = p.Id AND p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL
sede
CREATE TABLE table_27688 ( "Country" text, "Contestant" text, "Age" real, "Height (cm)" real, "Height (ft)" text, "Hometown" text )
What country was Danissa Zurek from?
SELECT "Country" FROM table_27688 WHERE "Contestant" = 'Danissa Zurek'
wikisql
CREATE TABLE table_1780 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Who was the episode writer when the viewers reached 3.03 million in the US?
SELECT "Written by" FROM table_1780 WHERE "U.S. viewers (million)" = '3.03'
wikisql
CREATE TABLE table_name_58 ( appearances INTEGER, bronze_medals INTEGER )
What is the average amount of appearances for the Bronze Meals less than 0?
SELECT AVG(appearances) FROM table_name_58 WHERE bronze_medals < 0
sql_create_context
CREATE TABLE table_40853 ( "Republican ticket" text, "Democratic ticket" text, "American Labor ticket" text, "Communist ticket" text, "Socialist ticket" text )
Who's the Republican ticket with a Democratic ticket of matthew j. merritt?
SELECT "Republican ticket" FROM table_40853 WHERE "Democratic ticket" = 'matthew j. merritt'
wikisql
CREATE TABLE manufacturer ( Num_of_Factories INTEGER, num_of_shops INTEGER )
Find the average number of factories for the manufacturers that have more than 20 shops.
SELECT AVG(Num_of_Factories) FROM manufacturer WHERE num_of_shops > 20
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
count the number of patients who have received a analgesics - non-narcotic analgesic procedure within the same month after they had been diagnosed with pulmonary aspiration in 2105.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pulmonary aspiration' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1 JOIN (SELECT patient.uniqu...
eicu
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE venue ( venueid int, venue...
Where did li dong publish in 2016 ?
SELECT DISTINCT paper.venueid FROM author, paper, writes WHERE author.authorname = 'li dong' AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE table_44098 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Which Score has a Place of t1, and a Player of hubert green?
SELECT AVG("Score") FROM table_44098 WHERE "Place" = 't1' AND "Player" = 'hubert green'
wikisql
CREATE TABLE table_name_86 ( drawn INTEGER, played VARCHAR, tries VARCHAR, _percentage_won VARCHAR )
What is the average draws for a player larger than 16 with more than 1 tries and a win percentage smaller than 56.15%?
SELECT AVG(drawn) FROM table_name_86 WHERE tries > 1 AND _percentage_won < 56.15 AND played > 16
sql_create_context
CREATE TABLE table_name_73 ( crew VARCHAR, end_time VARCHAR )
What is the crew with the end time of 21:11?
SELECT crew FROM table_name_73 WHERE end_time = "21:11"
sql_create_context
CREATE TABLE table_5818 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
What opponent in the final has rockford, Illinois as the tournament?
SELECT "Opponent in the final" FROM table_5818 WHERE "Tournament" = 'rockford, illinois'
wikisql
CREATE TABLE table_name_82 ( position VARCHAR, college VARCHAR )
What position does the player from Mississippi state play?
SELECT position FROM table_name_82 WHERE college = "mississippi state"
sql_create_context
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, ...
从14年12月31日到21年1月18日当中头颈肿瘤外科的门诊量有多少吗?
SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.JZKSMC = '头颈肿瘤科' AND mzjzjlb.JZKSRQ BETWEEN '2014-12-31' AND '2021-01-18'
css
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Na...
select top(10) id from posts intersect select postid from PostHistory.
SELECT * FROM Posts WHERE Id = 45551035
sede
CREATE TABLE table_59289 ( "Date" text, "Opponent" text, "Score" text, "Result" text, "Record" text )
What is Date, when Score is '80-79'?
SELECT "Date" FROM table_59289 WHERE "Score" = '80-79'
wikisql
CREATE TABLE airport ( country VARCHAR )
how many airports are there in each country?
SELECT COUNT(*), country FROM airport GROUP BY country
sql_create_context
CREATE TABLE teachers ( lastname text, firstname text, classroom number ) CREATE TABLE list ( lastname text, firstname text, grade number, classroom number )
List the first names of all the students in room 107.
SELECT DISTINCT firstname FROM list WHERE classroom = 107
spider
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text...
列一下患者94975740在0156079这家医院住院的时候的记录,要其中入院科室名字含有重症的
SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '94975740' AND hz_info.YLJGDM = '0156079' AND zyjzjlb.JZKSMC LIKE '%重症%'
css
CREATE TABLE txmzjzjlb ( 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, MZZYZDZ...
患者36425103在门诊诊断为由于使用阿片类药引起的精神病性障碍的触珠蛋白的结果定量还有单位都是多少呢?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
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...
自2014.5.23起,到2016.12.27止,患者29201885被开出药品香砂养胃丸一共有多少次
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '29201885' AND t_kc22.STA_DATE BETWEEN '2014-05-23' AND '2016-12-27' 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_ID = '2...
css
CREATE TABLE table_name_30 ( date VARCHAR, ship_type VARCHAR, location VARCHAR )
What date was a brig type ship located in SW Approaches?
SELECT date FROM table_name_30 WHERE ship_type = "brig" AND location = "sw approaches"
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
how many times has patient 17398 had a d & c nec when they came to the hospital last time.
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'd & c nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17398 AND NOT admissions.dischtime IS NUL...
mimic_iii
CREATE TABLE table_name_34 ( season INTEGER, super_g VARCHAR )
What is the oldest season that had a listed Super G score of 33?
SELECT MIN(season) FROM table_name_34 WHERE super_g = "33"
sql_create_context
CREATE TABLE Products ( product_id INTEGER, product_details VARCHAR(255) ) CREATE TABLE Customer_Contact_Channels ( customer_id INTEGER, channel_code VARCHAR(15), active_from_date DATETIME, active_to_date DATETIME, contact_number VARCHAR(50) ) CREATE TABLE Addresses ( address_id INTEGE...
A bar chart for what are the number of the dates when customers with ids between 10 and 20 became customers?, and I want to sort from low to high by the Y-axis.
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer)
nvbench
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 ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients are diagnosed with hx of colonic malignancy and have iv route of drug administration?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx of colonic malignancy" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_46463 ( "Rider" text, "Manufacturer" text, "Laps" real, "Time" text, "Grid" real )
Can you tell me the sum of Grid that has the Time of +6.355, and the Laps larger than 23?
SELECT SUM("Grid") FROM table_46463 WHERE "Time" = '+6.355' AND "Laps" > '23'
wikisql
CREATE TABLE table_26440 ( "No. by series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production number" real, "U.S. viewers (in millions)" text )
Who is the director of the episode titled 'Hell hath no fury'?
SELECT "Directed by" FROM table_26440 WHERE "Title" = 'Hell Hath No Fury'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), ...
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and I want to order in ascending by the bars.
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_name_53 ( kickoff VARCHAR, game_site VARCHAR, nflcom_recap VARCHAR, week VARCHAR )
What is the kickoff that has a NFL.com recap, is played before week 17, and is played at arrowhead stadium?
SELECT kickoff FROM table_name_53 WHERE nflcom_recap = "recap" AND week < 17 AND game_site = "arrowhead stadium"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
get me the four year survival probability of patients who were prescribed enoxaparin sodium after having been diagnosed with fx dorsal vertebra-close?
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
mimic_iii
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
Is the professor who is teaching 570 next semester Prof. Jesse Gregory ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 570 AND instructor.name LIKE '%Jesse Gregory%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_i...
advising
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Get question information given answer IDs.
SELECT MyAnswers.Id AS AnswerID, p.Id AS QuestionID, p.CreationDate, p.ViewCount, p.Tags FROM Posts AS p INNER JOIN (SELECT Id, ParentId FROM Posts WHERE Id IN (25210096, 25222542, 25240280, 25233555, 25307353, 25310175)) AS MyAnswers ON p.Id = MyAnswers.ParentId
sede
CREATE TABLE table_203_306 ( id number, "no." number, "title" text, "directed by" text, "written by" text, "original air date" text )
how many episodes were directed by perry lang
SELECT COUNT("title") FROM table_203_306 WHERE "directed by" = 'perry lang'
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
when has patient 022-187132 received a prescription for furosemide (lasix) inj 40 mg first on this hospital encounter?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132' AND patient.hospitaldischargetime IS NULL)) AND me...
eicu
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, ...
列出在2007-12-26到2017-05-25期间,患者华歌韵所有检验结果指标记录的检测人为尤弘业的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jy...
css
CREATE TABLE table_2803106_1 ( tonioli VARCHAR, week__number VARCHAR, dixon VARCHAR )
On week 11 when Dixon scored an 8, what was tonioli's score?
SELECT tonioli FROM table_2803106_1 WHERE week__number = 11 AND dixon = "8"
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岁的病人的医疗记录的平均医疗费总额有多少
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_AGE >= 17)
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...
specify the number of patients with regional enteritis nos who received iv therapy
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Regional enteritis NOS" AND prescriptions.route = "IV"
mimicsql_data
CREATE TABLE table_name_6 ( chef VARCHAR, restaurant_name VARCHAR, location VARCHAR, original_name VARCHAR )
What chef that has a location in Toronto, ON, that has n/a as the original name, and a Restaurant Name of Bagel World?
SELECT chef FROM table_name_6 WHERE location = "toronto, on" AND original_name = "n/a" AND restaurant_name = "bagel world"
sql_create_context
CREATE TABLE table_name_65 ( record VARCHAR, attendance VARCHAR )
What was the record for the game attended by 35,614 spectators?
SELECT record FROM table_name_65 WHERE attendance = "35,614"
sql_create_context
CREATE TABLE table_3785 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text, "Points" real )
What was the team's rcord on february 1?
SELECT "Record" FROM table_3785 WHERE "February" = '1'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number...
when was the heartrate of patient 008-22202 last measured on 09/26/this year?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-22202')) AND NOT vitalperiodic.heartrate IS NUL...
eicu
CREATE TABLE table_name_68 ( gold VARCHAR, year VARCHAR )
What Gold has the Year of 1994?
SELECT gold FROM table_name_68 WHERE year = 1994
sql_create_context
CREATE TABLE table_3901 ( "Standard" text, "Date" text, "CO (g/kWh)" text, "NO x (g/kWh)" text, "HC (g/kWh)" text, "PM (g/kWh)" text )
How many different standards have a PM of 0.02 g/kWh?
SELECT COUNT("Standard") FROM table_3901 WHERE "PM (g/kWh)" = '0.02'
wikisql
CREATE TABLE table_18745 ( "Frequency" text, "Call sign" text, "Name" text, "Format" text, "Owner" text, "Target city/ market" text, "City of license" text )
What station has the call number K213cl
SELECT "Format" FROM table_18745 WHERE "Call sign" = 'K213CL'
wikisql
CREATE TABLE table_204_593 ( id number, "year" text, "chairperson" text )
how many years did shilpa bendi serve ?
SELECT "year" - "year" FROM table_204_593 WHERE "chairperson" = 'shilpa bendi'
squall