context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
what was patient 006-80884's first sao2 on this month/22.
SELECT vitalperiodic.sao2 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND NOT vitalperiodic.sao2 IS NULL AND DATETIME(v...
eicu
CREATE TABLE table_name_34 ( population INTEGER, median_household_income VARCHAR, number_of_households VARCHAR )
What is the highest Population that has a Median household income of $32,902 with a number of households less than 11,125
SELECT MAX(population) FROM table_name_34 WHERE median_household_income = "$32,902" AND number_of_households < 11 OFFSET 125
sql_create_context
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varch...
Are there any courses that would be useful for me to take before I take MATH 471 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'MATH' AND number = 471
advising
CREATE TABLE table_name_90 ( syracuse VARCHAR, buffalo VARCHAR, albany VARCHAR )
What is Syracuse, when Buffalo is Oatka Creek Shale, and when Albany is Berne?
SELECT syracuse FROM table_name_90 WHERE buffalo = "oatka creek shale" AND albany = "berne"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
how many patients whose procedure icd9 code is 8968?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "8968"
mimicsql_data
CREATE TABLE table_63386 ( "TIME" text, "ATHLETE" text, "SCHOOL" text, "CITY" text, "DATE" text )
What is the School of the Player with a Date of June 4, 2011?
SELECT "SCHOOL" FROM table_63386 WHERE "DATE" = 'june 4, 2011'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE city ( city_code varchar, city_name varchar, ...
i need a flight from ATLANTA to BALTIMORE nonstop arriving at 1900 please
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.arrival_time = 1900 AND flight.to_airport = AIRPORT_SERVICE_1.airp...
atis
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
what is admission type and death status of subject id 16438?
SELECT demographic.admission_type, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "16438"
mimicsql_data
CREATE TABLE orders ( order_id number, customer_id number, date_order_placed time, order_details text ) CREATE TABLE invoice_line_items ( order_item_id number, invoice_number number, product_id number, product_title text, product_quantity text, product_price number, derived_...
Return the average, minimum, maximum, and total transaction amounts.
SELECT AVG(transaction_amount), MIN(transaction_amount), MAX(transaction_amount), SUM(transaction_amount) FROM financial_transactions
spider
CREATE TABLE table_name_86 ( week_10_nov_2 VARCHAR, week_9_oct_26 VARCHAR )
Which Week 10 Nov 2 has a Week 9 Oct 26 of lsu (5-2)?
SELECT week_10_nov_2 FROM table_name_86 WHERE week_9_oct_26 = "lsu (5-2)"
sql_create_context
CREATE TABLE table_4438 ( "Lane" real, "Name" text, "Nationality" text, "50m split" real, "Time" text )
Who has a 50m split less than 27.79?
SELECT "Name" FROM table_4438 WHERE "50m split" < '27.79'
wikisql
CREATE TABLE table_79636 ( "Year" real, "Title" text, "US Country" text, "RIAA" text, "Label" text )
What is the title of the album that had a RIAA of gold?
SELECT "Title" FROM table_79636 WHERE "RIAA" = 'gold'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
What is the number of times that Prof. Thomas Buchmueller has taught 386 ?
SELECT COUNT(*) FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.number = 386 AND instructor.name LIKE '%Thomas Buchmueller%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering....
advising
CREATE TABLE table_name_95 ( crowd INTEGER, home_team VARCHAR )
What size was the biggest crowd that watched the home team Hawthorn play?
SELECT MAX(crowd) FROM table_name_95 WHERE home_team = "hawthorn"
sql_create_context
CREATE TABLE table_25518547_4 ( affiliation VARCHAR, mls_team VARCHAR )
What university is houston dynamo affiliated with?
SELECT affiliation FROM table_25518547_4 WHERE mls_team = "Houston Dynamo"
sql_create_context
CREATE TABLE table_17511 ( "Overall Pick #" real, "AFL Team" text, "Player" text, "Position" text, "College" text )
What college did the Cincinnati Bengals' player come from?
SELECT "College" FROM table_17511 WHERE "AFL Team" = 'Cincinnati Bengals'
wikisql
CREATE TABLE table_name_19 ( date VARCHAR, away_team VARCHAR )
On what date does Essendon play as the away team?
SELECT date FROM table_name_19 WHERE away_team = "essendon"
sql_create_context
CREATE TABLE table_name_8 ( enrollment INTEGER, mascot VARCHAR )
What's the least enrolled when the mascot was the Trojans?
SELECT MIN(enrollment) FROM table_name_8 WHERE mascot = "trojans"
sql_create_context
CREATE TABLE table_name_23 ( result VARCHAR, weight VARCHAR, race VARCHAR )
What is the result of the sajc king's cup race, which has a weight heavier than 8.1?
SELECT result FROM table_name_23 WHERE weight > 8.1 AND race = "sajc king's cup"
sql_create_context
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
门诊诊断为嗜眠症的患者的籍贯代码是什么?名称是什么?相应人数是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE mzjzjlb.JZZDSM = '嗜眠症' GROUP BY person_info.JGDM
css
CREATE TABLE table_1341586_44 ( candidates VARCHAR, incumbent VARCHAR )
Who are all the candidates vying for Henry B. Gonzalez' seat?
SELECT candidates FROM table_1341586_44 WHERE incumbent = "Henry B. Gonzalez"
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
when has patient 005-87465 received the last systemic antibiotics - vancomycin during their current hospital encounter?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitaldischargetime IS NULL)) AND treatm...
eicu
CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME varchar(20), CLASS_ROOM varchar(8), PROF_NUM int ) CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE va...
Find the average gpa of all students in each department with a bar chart.
SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE
nvbench
CREATE TABLE table_6445 ( "Name" text, "Pinnacle height" text, "Structural type" text, "Main use" text, "Country" text, "Town" text )
Which Town has a Structural type of guyed mast and a Country of belgium?
SELECT "Town" FROM table_6445 WHERE "Structural type" = 'guyed mast' AND "Country" = 'belgium'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
Posts that are one upvote away from earning you 'Necromancer'. Returns a list of questions for a given user that have 4 upvotes and are at least 60 days old, meaning the next upvote on any of the posts will earn the user a Necromancer badge.
SELECT p.ParentId AS "post_link", DATEDIFF(day, parent.CreationDate, CreationDate) AS "days_after_ask_for_answer", COUNT(*) AS voteCount FROM Posts AS p INNER JOIN Votes AS v ON v.PostId = p.Id AND v.VoteTypeId = 2 INNER JOIN Posts AS parent ON parent.Id = p.ParentId WHERE p.OwnerUserId = @userId AND DATEDIFF(day, pare...
sede
CREATE TABLE table_6 ( "No" real, "Date" text, "Round" text, "Circuit" text, "Pole Position" text, "Fastest Lap" text, "Race winner" text, "Report" text )
What was the date of the race in Misano?
SELECT "Date" FROM table_6 WHERE "Circuit" = 'Misano'
wikisql
CREATE TABLE appellations ( No INTEGER, Appelation TEXT, County TEXT, State TEXT, Area TEXT, isAVA TEXT ) CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TE...
Give me a bar chart for the number of area of each area, display by the x-axis in descending.
SELECT Area, COUNT(Area) FROM appellations GROUP BY Area ORDER BY Area DESC
nvbench
CREATE TABLE table_name_55 ( high_rebounds VARCHAR, score VARCHAR )
Who had the high rebounds when the score was l 85 102 (ot)?
SELECT high_rebounds FROM table_name_55 WHERE score = "l 85–102 (ot)"
sql_create_context
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Facilities ( apt_id I...
Show the booking status code and the corresponding number of bookings by a pie chart.
SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code
nvbench
CREATE TABLE table_3093 ( "Season" real, "Regular Season" text, "Playoffs" text, "U.S. Open Cup" text, "CONCACAF" text, "MLS Regular Season Record" text )
Name the number of playoffs for semifinals
SELECT COUNT("Playoffs") FROM table_3093 WHERE "CONCACAF" = 'Semifinals'
wikisql
CREATE TABLE table_66176 ( "play" text, "author" text, "company" text, "base" text, "country" text )
Waht is the Country of the play by Author Aristophanes?
SELECT "country" FROM table_66176 WHERE "author" = 'aristophanes'
wikisql
CREATE TABLE table_26826304_2 ( weekly_rank_sky1 VARCHAR, _number VARCHAR )
What is title numer 103's rank for weekly rank sky1?
SELECT weekly_rank_sky1 FROM table_26826304_2 WHERE _number = 103
sql_create_context
CREATE TABLE table_1140078_2 ( report VARCHAR, race VARCHAR )
What is the report of the united states grand prix west?
SELECT report FROM table_1140078_2 WHERE race = "United States Grand Prix West"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text,...
show flights from PITTSBURGH to OAKLAND connecting through DENVER
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND CITY_2.ci...
atis
CREATE TABLE table_52809 ( "Year" text, "2010" real, "2009" real, "2008" real, "2005" real, "2000" real, "1995" real, "1990" real, "1985" real )
What is the 1995 GDP when 1990 GDP is 441 and 1985 GDP is less than 359?
SELECT MIN("1995") FROM table_52809 WHERE "1990" = '441' AND "1985" < '359'
wikisql
CREATE TABLE table_name_53 ( result VARCHAR, date VARCHAR )
What is the Result of the Test match at the Edgbaston Venue on 5,6,7,8 June 1997?
SELECT result FROM table_name_53 WHERE date = "5,6,7,8 june 1997"
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,...
根据不同的入院诊断疾病名称和科室名称,一一列出医疗就诊记录中医院5583587所有患者保留平均年龄小于五岁的记录的平均年龄都是什么年龄?
SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5583587' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM HAVING AVG(PERSON_AGE) < 5
css
CREATE TABLE table_12644 ( "South West DFL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the lowest value for Wins, when South West DFL is 'Cavendish', and when Byes is less than 0?
SELECT MIN("Wins") FROM table_12644 WHERE "South West DFL" = 'cavendish' AND "Byes" < '0'
wikisql
CREATE TABLE table_60713 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total number of bronze that has less than 2 gold, and more than 1 silver?
SELECT COUNT("Bronze") FROM table_60713 WHERE "Gold" < '2' AND "Silver" > '1'
wikisql
CREATE TABLE table_25596 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text, "18-49 Rating/Share" text )
How many viewers (in millions) watched the episode written by deidre shaw?
SELECT "U.S. viewers (in millions)" FROM table_25596 WHERE "Written by" = 'Deidre Shaw'
wikisql
CREATE TABLE table_68872 ( "BR/SR No." text, "SR Name" text, "LSWR No." real, "Builder" text, "Built" real, "To IoW" real, "Withdrawn" real )
What is the BR/SR number of Freshwater which was withdrawn in 1967 and built before 1892 with a To LoW year after 1927?
SELECT "BR/SR No." FROM table_68872 WHERE "Withdrawn" = '1967' AND "Built" < '1892' AND "To IoW" > '1927' AND "SR Name" = 'freshwater'
wikisql
CREATE TABLE table_15187735_18 ( episode VARCHAR, segment_c VARCHAR )
Name the number of episods for segment c being s oyster
SELECT COUNT(episode) FROM table_15187735_18 WHERE segment_c = "s Oyster"
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Find All_Home and School_ID , and group by attribute ACC_Home, and visualize them by a bar chart, could you show bar in ascending order?
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_18600760_18 ( ansi_code INTEGER, land___sqmi__ VARCHAR )
What is the ANSI code of the township where the area is 35.737 square miles?
SELECT MIN(ansi_code) FROM table_18600760_18 WHERE land___sqmi__ = "35.737"
sql_create_context
CREATE TABLE table_18424435_5 ( us_air_date VARCHAR, directed_by VARCHAR )
How many air dates where directed by jim donovan?
SELECT COUNT(us_air_date) FROM table_18424435_5 WHERE directed_by = "Jim Donovan"
sql_create_context
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Reviewer ( rID int, name text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date )
Draw a bar chart to compare the stars of each movie by title, and rank by the names in asc.
SELECT title, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID ORDER BY title
nvbench
CREATE TABLE table_28736 ( "Institution" text, "Location" text, "Team Nickname" text, "Years" text, "New Conference" text, "New Classification" text )
What are the years that the new classification was MCLA division i?
SELECT "Years" FROM table_28736 WHERE "New Classification" = 'MCLA Division I'
wikisql
CREATE TABLE table_204_539 ( id number, "date" text, "name" text, "moving from" text, "moving to" text, "fee" text )
who was the next transfer after maico on may 30 , 2009 ?
SELECT "name" FROM table_204_539 WHERE "date" > (SELECT "date" FROM table_204_539 WHERE "name" = 'maicon') ORDER BY "date" LIMIT 1
squall
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, ...
住院就诊编号为60081857997的患者开出了多少份检验报告单?
SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '60081857997'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose age is less than 49 and procedure icd9 code is 9920?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "49" AND procedures.icd9_code = "9920"
mimicsql_data
CREATE TABLE table_name_48 ( melamine_content_mg_kg_ INTEGER, producer VARCHAR, samples_failed VARCHAR )
What's the most melamine content that has more than 1 samples failed and produced by Guangzhou Jinding Dairy Products Factory?
SELECT MAX(melamine_content_mg_kg_) FROM table_name_48 WHERE producer = "guangzhou jinding dairy products factory" AND samples_failed > 1
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, ...
when did patient 3277 have his or her last intake on 07/30/this year?
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 = 3277)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 's...
mimic_iii
CREATE TABLE table_23570 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What CFL team did simeon rottier play for?
SELECT "CFL Team" FROM table_23570 WHERE "Player" = 'Simeon Rottier'
wikisql
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
Please list courses without labs that are at the 400 level .
SELECT DISTINCT name, number FROM course WHERE department = 'EECS' AND has_lab = 'N' AND number < 400 + 100 AND number >= 400
advising
CREATE TABLE table_29846 ( "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 record when the score was l 84 96 (ot)?
SELECT "Record" FROM table_29846 WHERE "Score" = 'L 84–96 (OT)'
wikisql
CREATE TABLE table_26040604_1 ( die_size__mm_2__ VARCHAR, texture___gt__s_ VARCHAR )
How many die sizes have a texture of exactly 34?
SELECT COUNT(die_size__mm_2__) FROM table_26040604_1 WHERE texture___gt__s_ = "34"
sql_create_context
CREATE TABLE table_19911 ( "Series Ep." text, "Episode" real, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What is the first episode number?
SELECT MIN("Episode") FROM table_19911
wikisql
CREATE TABLE fires ( fire_year number, discovery_date number, discovery_doy number, discovery_time text, stat_cause_code number, stat_cause_descr text, cont_date text, cont_doy text, cont_time text, fire_size number, fire_size_class text, latitude number, longitude nu...
How many acres burned in 2000s and 1990s?
SELECT SUM(fire_size) FROM fires WHERE state = "TX" AND fire_year BETWEEN 2000 AND 2010 UNION SELECT SUM(fire_size) FROM fires WHERE state = "TX" AND fire_year BETWEEN 1990 AND 2000
uswildfires
CREATE TABLE table_42330 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the winning score of the Greater Vancouver Open tournament?
SELECT "Winning score" FROM table_42330 WHERE "Tournament" = 'greater vancouver open'
wikisql
CREATE TABLE authorship ( authid VARCHAR, instid VARCHAR ) CREATE TABLE authors ( fname VARCHAR, lname VARCHAR, authid VARCHAR ) CREATE TABLE inst ( instid VARCHAR, name VARCHAR )
Who belong to the institution 'University of Oxford'? Show the first names and last names.
SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Oxford"
sql_create_context
CREATE TABLE table_name_95 ( time VARCHAR, away VARCHAR )
What is Time, when Away is Central Blues?
SELECT time FROM table_name_95 WHERE away = "central blues"
sql_create_context
CREATE TABLE table_855 ( "Rnd" real, "Circuit" text, "GTP Winning Team" text, "GTO Winning Team" text, "GTU Winning Team" text, "Results" text )
What was the GTP winning team in the round in Portland during which Jack Baldwin become part of the GTU winning team?
SELECT "GTP Winning Team" FROM table_855 WHERE "Circuit" = 'Portland' AND "GTU Winning Team" = 'Jack Baldwin'
wikisql
CREATE TABLE table_name_83 ( tries_against VARCHAR, tries_for VARCHAR )
How many tries against for the team with 67 tries for?
SELECT tries_against FROM table_name_83 WHERE tries_for = "67"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
how many private patients had contrast aortogram?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.short_title = "Contrast aortogram"
mimicsql_data
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
在2017年12月5日至2018年3月20日期间,编码为74125080的参保人单一药品最大购买次数有多少次?
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '74125080' AND t_kc22.STA_DATE BETWEEN '2017-12-05' AND '2018-03-20' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_I...
css
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, d...
what is the earliest arriving flight from BOSTON to WASHINGTON DC
SELECT DISTINCT flight_id FROM flight WHERE ((from_airport IN (SELECT AIRPORT_SERVICEalias2.airport_code FROM airport_service AS AIRPORT_SERVICEalias2 WHERE AIRPORT_SERVICEalias2.city_code IN (SELECT CITYalias2.city_code FROM city AS CITYalias2 WHERE CITYalias2.city_name = 'BOSTON')) AND to_airport IN (SELECT AIRPORT_S...
atis
CREATE TABLE table_15700367_6 ( runs_conceded VARCHAR, er VARCHAR )
How many runs conceded when the earned runs was 4.96?
SELECT runs_conceded FROM table_15700367_6 WHERE er = "4.96"
sql_create_context
CREATE TABLE table_name_29 ( torque VARCHAR, engine VARCHAR )
What is the torque of a 2B engine?
SELECT torque FROM table_name_29 WHERE engine = "2b"
sql_create_context
CREATE TABLE table_79406 ( "play" text, "author" text, "company" text, "base" text, "country" text )
what is the country when the base is ljubljana?
SELECT "country" FROM table_79406 WHERE "base" = 'ljubljana'
wikisql
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, ...
i'd like to go from BOSTON to ATLANTA sometime after 1700 can you tell me the flights that could do that for me
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight.departure_time > 1700 AND flight.to_airport = AIRPORT_SERVICE_1.airpo...
atis
CREATE TABLE gyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
查一下病患葛映波的医疗记录,分别列出医疗费总额高于6981.35元的入院诊断疾病名和编码
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '葛映波' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6981.35) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '葛映波' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED...
css
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, v...
how many days has elapsed since the first time patient 81461 received a lab test for mcv in this hospital encounter?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81461 AND admissions.disc...
mimic_iii
CREATE TABLE table_24770 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text, "U.S. viewers (millions)" text )
How many millions of U.S. viewers watched the episode titled 'Once a Hero'?
SELECT "U.S. viewers (millions)" FROM table_24770 WHERE "Title" = 'Once a Hero'
wikisql
CREATE TABLE table_name_34 ( college_junior_club_team__league_ VARCHAR, round VARCHAR )
What College/Junior/Club Team (League) has 6 as the Round?
SELECT college_junior_club_team__league_ FROM table_name_34 WHERE round = 6
sql_create_context
CREATE TABLE table_name_55 ( country VARCHAR, format VARCHAR )
What country that has LP as a format?
SELECT country FROM table_name_55 WHERE format = "lp"
sql_create_context
CREATE TABLE table_204_556 ( id number, "rank" number, "athlete" text, "country" text, "time" text, "notes" text )
what is the total number of athletes from japan ?
SELECT COUNT("athlete") FROM table_204_556 WHERE "country" = 'japan'
squall
CREATE TABLE table_name_97 ( flap INTEGER, bike VARCHAR, race VARCHAR )
What is the highest FLap by a Honda NSR500 bike after Race 16?
SELECT MAX(flap) FROM table_name_97 WHERE bike = "honda nsr500" AND race > 16
sql_create_context
CREATE TABLE table_name_6 ( current_conference VARCHAR, nickname VARCHAR )
The River Hawks belonged to what current conference?
SELECT current_conference FROM table_name_6 WHERE nickname = "river hawks"
sql_create_context
CREATE TABLE table_76615 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
What is the lost when the try bonus is 5, and points against is 298?
SELECT "Lost" FROM table_76615 WHERE "Try bonus" = '5' AND "Points against" = '298'
wikisql
CREATE TABLE table_27508 ( "Song" text, "Singer" text, "Co-Singers" text, "Music Director" text, "Lyricist" text, "Co-Stars" text, "Movie/Album" text, "Year" text, "Additional Info" text )
What is the additional information in the song mera yaar bana hai dulha
SELECT "Additional Info" FROM table_27508 WHERE "Song" = 'Mera Yaar Bana Hai Dulha'
wikisql
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患者奚嘉珍的游离前列腺特异性抗原在09年6月17日到17年5月2日的这段时间情况咋样啊?
SELECT * FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy...
css
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
count the number of patients whose discharge location is home and lab test name is sodium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "HOME" AND lab.label = "Sodium"
mimicsql_data
CREATE TABLE table_21835 ( "Rank" real, "County" text, "State" text, "Land area (km\u00b2)" text, "Land area (mi\u00b2)" text, "April 1, 2010 census" real, "April 1, 2010 density (/km\u00b2)" real, "April 1, 2010 density (/mi\u00b2)" real, "July 1, 2010 official estimate" real, "...
Name the total number of county seat or courthouse for april 1 2010 denisty is 2205
SELECT COUNT("County seat or courthouse") FROM table_21835 WHERE "April 1, 2010 density (/mi\u00b2)" = '2205'
wikisql
CREATE TABLE city ( City_ID int, Official_Name text, Status text, Area_km_2 real, Population real, Census_Ranking text ) CREATE TABLE competition_record ( Competition_ID int, Farm_ID int, Rank int ) CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme tex...
Show how many competitions are held in each year with a line chart, and could you rank by the X in ascending?
SELECT Year, COUNT(Year) FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID ORDER BY Year
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
to how many female patients was dextrose 50% administered?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.drug = "Dextrose 50%"
mimicsql_data
CREATE TABLE table_name_32 ( representative VARCHAR, presentation_of_credentials VARCHAR )
Who is the representative with a presentation of credentials date on February 23, 1854?
SELECT representative FROM table_name_32 WHERE presentation_of_credentials = "february 23, 1854"
sql_create_context
CREATE TABLE table_1723080_1 ( episode VARCHAR, broadcast_date VARCHAR )
What episode aired on 11july1964?
SELECT episode FROM table_1723080_1 WHERE broadcast_date = "11July1964"
sql_create_context
CREATE TABLE table_28826 ( "Name" text, "Jewel" text, "Species" text, "Gender" text, "Jewel Power" text, "Attribute" text, "Birthday" text, "Media Debut" text, "Voice actor" text )
who is the voice actor with the birthday march 26?
SELECT "Voice actor" FROM table_28826 WHERE "Birthday" = 'March 26'
wikisql
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service...
list a round trip fare from KANSAS CITY to MINNEAPOLIS flights
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 = 'KANSAS CITY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1....
atis
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...
患者61218284被开出过药品2524-6在哪几家医院?
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '61218284' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '2524-6')
css
CREATE TABLE table_name_24 ( date VARCHAR, location VARCHAR, record VARCHAR )
On what date did they play in Boston Garden with a record of 22-4?
SELECT date FROM table_name_24 WHERE location = "boston garden" AND record = "22-4"
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...
韦俊贤这个病人在医院3431551中就诊记录中,共有多少在科室名称中不包含病理科的医疗就诊记录
SELECT * FROM t_kc21 WHERE t_kc21.PERSON_NM = '韦俊贤' AND t_kc21.MED_SER_ORG_NO = '3431551' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%病理科%'
css
CREATE TABLE table_14698 ( "Rank" real, "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
Who had a lane number smaller than 7 and a time of 2:19.86?
SELECT "Name" FROM table_14698 WHERE "Lane" < '7' AND "Time" = '2:19.86'
wikisql
CREATE TABLE Companies ( name VARCHAR, Assets_billion VARCHAR )
What are the name and assets of each company, sorted in ascending order of company name?
SELECT name, Assets_billion FROM Companies ORDER BY name
sql_create_context
CREATE TABLE table_name_39 ( first VARCHAR, year VARCHAR, country VARCHAR, last VARCHAR )
Name the first for countries of trinidad and tobago for hutchinson for years before 2004
SELECT first FROM table_name_39 WHERE country = "trinidad and tobago" AND last = "hutchinson" AND year < 2004
sql_create_context
CREATE TABLE table_79768 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" text, "Class" text, "FCC info" text )
Name the call sign with frequency of 89.5
SELECT "Call sign" FROM table_79768 WHERE "Frequency MHz" = '89.5'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the drug code of the patient name kelly gallardo?
SELECT prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_3185 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
When bill young redistricted from the 10th district is the incumbent what is the party?
SELECT "Party" FROM table_3185 WHERE "Incumbent" = 'Bill Young Redistricted from the 10th district'
wikisql
CREATE TABLE table_67927 ( "Wins" real, "Draws" real, "Losses" real, "Goal difference" text, "Total" real )
What is the lowest total that has draws less than 2 and wins less than 1, losses bigger than 1 with a goal difference of 1:2
SELECT MIN("Total") FROM table_67927 WHERE "Draws" < '2' AND "Wins" < '1' AND "Goal difference" = '1:2' AND "Losses" > '1'
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 lab ( labid numbe...
what is the five most frequent drug that was prescribed within 2 months to the encephalopathy male patients aged 30s after they have been diagnosed with encephalopathy during the previous year?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'encephalopathy' AND DATETIME(diagnosis.diagnosisti...
eicu