context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_71052 ( "Date" text, "City" text, "Event" text, "Winner" text, "Prize" text )
What Event did John dibella win?
SELECT "Event" FROM table_71052 WHERE "Winner" = 'john dibella'
wikisql
CREATE TABLE table_10335_1 ( operational VARCHAR, camp VARCHAR )
what's the operational period with camp sajmi te
SELECT operational FROM table_10335_1 WHERE camp = "Sajmište"
sql_create_context
CREATE TABLE table_203_43 ( id number, "polling firm" text, "month" text, "link" text, "favor" number, "oppose" number )
how many in favor votes did rutgers eagleton give in march 2014 ?
SELECT "favor" FROM table_203_43 WHERE "polling firm" = 'rutgers-eagleton' AND "month" = 'march 2014'
squall
CREATE TABLE table_17411 ( "Jurisdiction" text, "For Prohibition" real, "Percent For" text, "Against Prohibition" real, "Percent Against" text )
What is the percent for when against prohibition is 2978?
SELECT "Percent For" FROM table_17411 WHERE "Against Prohibition" = '2978'
wikisql
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, ...
have patient 5520 been to the emergency room in the last year?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 5520 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
mimic_iii
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
在01年8月16日到06年10月1日之间给患者68819999开出盐酸美金刚口服溶液这个药品的总次数是多少次?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '68819999' AND t_kc22.STA_DATE BETWEEN '2001-08-16' AND '2006-10-01' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸美金刚口服溶液'
css
CREATE TABLE table_203_720 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "result" text )
what was the highest amount points scored by the 1987 syracuse football team ?
SELECT MAX("result") FROM table_203_720
squall
CREATE TABLE table_24850487_5 ( field_goals VARCHAR, player VARCHAR )
How many field goals did Stacey Thomas have?
SELECT field_goals FROM table_24850487_5 WHERE player = "Stacey Thomas"
sql_create_context
CREATE TABLE table_14845640_1 ( written_by VARCHAR, us_viewers__millions_ VARCHAR )
Name the written by for 16.32 million viewers
SELECT written_by FROM table_14845640_1 WHERE us_viewers__millions_ = "16.32"
sql_create_context
CREATE TABLE table_name_15 ( first_aired VARCHAR, entrepreneur_s_ VARCHAR )
What episode featured entrepreneur Richard Ernest?
SELECT first_aired FROM table_name_15 WHERE entrepreneur_s_ = "richard ernest"
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,...
患者姜慧美出院诊断疾病名称包含所致的医疗在医院6311609是什么就诊记录编号?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_NM = '姜慧美' AND MED_SER_ORG_NO = '6311609' AND OUT_DIAG_DIS_NM LIKE '%所致%'
css
CREATE TABLE actor ( actor_id SMALLINT UNSIGNED, first_name VARCHAR(45), last_name VARCHAR(45), last_update TIMESTAMP ) CREATE TABLE city ( city_id SMALLINT UNSIGNED, city VARCHAR(50), country_id SMALLINT UNSIGNED, last_update TIMESTAMP ) CREATE TABLE language ( language_id TINYINT...
Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa, and count them by a bar chart, could you list from high to low by the Y-axis please?
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC
nvbench
CREATE TABLE table_27882 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
Which settlement has the cyrillic and other name of (romanian: locve)?
SELECT "Settlement" FROM table_27882 WHERE "Cyrillic Name Other Names" = 'Локве (Romanian: Locve)'
wikisql
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city v...
Who teaches Advanced Intergroup Relations ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id WHERE course.name L...
advising
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
在99850400907的医疗就诊中,患者入院时诊断的是哪种疾病,把疾病的编号也找出来
SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE MED_CLINIC_ID = '99850400907'
css
CREATE TABLE table_9080 ( "City" text, "Chinese" text, "Pinyin" text, "County" text, "Population (2010)" real )
Which County has a Chinese of ?
SELECT "County" FROM table_9080 WHERE "Chinese" = '新竹'
wikisql
CREATE TABLE table_name_10 ( tyres VARCHAR, driver VARCHAR )
What is the tyres for Didier pironi?
SELECT tyres FROM table_name_10 WHERE driver = "didier pironi"
sql_create_context
CREATE TABLE table_20667854_1 ( gics_sector VARCHAR, free_float VARCHAR )
How many GICS sectors have a free float of 0.2391?
SELECT COUNT(gics_sector) FROM table_20667854_1 WHERE free_float = "0.2391"
sql_create_context
CREATE TABLE COURSE ( DNO VARCHAR, CName VARCHAR ) CREATE TABLE DEPARTMENT ( Dname VARCHAR, Room VARCHAR, DNO VARCHAR )
Find the department name and room of the course INTRODUCTION TO COMPUTER SCIENCE.
SELECT T2.Dname, T2.Room FROM COURSE AS T1 JOIN DEPARTMENT AS T2 ON T1.DNO = T2.DNO WHERE T1.CName = "INTRODUCTION TO COMPUTER SCIENCE"
sql_create_context
CREATE TABLE table_38833 ( "Distance" text, "Time" text, "Date" text, "Location" text, "Notes" text )
What is in the notes for men's speed skating?
SELECT "Notes" FROM table_38833 WHERE "Time" = 'men''s speed skating'
wikisql
CREATE TABLE table_15159 ( "Year" text, "League" text, "Position" text, "Leading Scorer" text, "Goals" real )
Leading Scorer that has a Goal smaller than 23, and a League of football league division 3, and a Year of 1997 98 is who?
SELECT "Leading Scorer" FROM table_15159 WHERE "Goals" < '23' AND "League" = 'football league division 3' AND "Year" = '1997–98'
wikisql
CREATE TABLE table_name_96 ( surface VARCHAR, opponent_in_the_final VARCHAR )
What surface was the tournament played on against Steven Diez?
SELECT surface FROM table_name_96 WHERE opponent_in_the_final = "steven diez"
sql_create_context
CREATE TABLE table_204_937 ( id number, "rank" number, "lane" number, "athlete" text, "time" number )
how many athletes finished before pinki pramanik ?
SELECT COUNT("athlete") FROM table_204_937 WHERE "time" < (SELECT "time" FROM table_204_937 WHERE "athlete" = 'pinki pramanik')
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...
calculate the number of times that sodium chloride 0.9% was prescribed to patient 032-2747.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-2747')) AND medication.drugname = 'sodium chloride 0.9%'
eicu
CREATE TABLE table_67080 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
Name the least attendance with visitor of edmonton
SELECT MIN("Attendance") FROM table_67080 WHERE "Visitor" = 'edmonton'
wikisql
CREATE TABLE movie ( mid int, title text, release_year int, title_aka text, budget text ) CREATE TABLE cast ( id int, msid int, aid int, role text ) CREATE TABLE copyright ( id int, msid int, cid int ) CREATE TABLE tags ( id int, msid int, kid int ) CREATE...
What is the nationality of the actress ' Ellen Page ' ?
SELECT nationality FROM actor WHERE name = 'Ellen Page'
imdb
CREATE TABLE table_name_17 ( Id VARCHAR )
What is the 2004 when 2013 is 3rd?
SELECT 2004 FROM table_name_17 WHERE 2013 = "3rd"
sql_create_context
CREATE TABLE table_name_45 ( away_team VARCHAR, home_team VARCHAR )
If the Home team of collingwood was playing, what was the Away team?
SELECT away_team FROM table_name_45 WHERE home_team = "collingwood"
sql_create_context
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ...
Posts with the most number of comments.
SELECT Id AS "post_link", CommentCount FROM Posts ORDER BY CommentCount DESC LIMIT 50
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the number of patients whose admission year is less than 2150 and lab test name is free calcium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2150" AND lab.label = "Free Calcium"
mimicsql_data
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 procedures_icd ( row_id number, subject_id number, ...
until 2104, patient 80858 got admitted to the hospital?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 80858 AND STRFTIME('%y', admissions.admittime) <= '2104'
mimic_iii
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
Get number of questions in a single month.
SELECT COUNT(Id) FROM Posts WHERE PostTypeId = 1 AND CreationDate > '2015-04-01' AND CreationDate < '2015-05-01'
sede
CREATE TABLE table_55912 ( "Date" text, "Name" text, "Flag" text, "Tonnage (GRT)" real, "Sunk by" text )
What is the date where the tonnage is larger than 5,754 and the ship was sunk by U-305?
SELECT "Date" FROM table_55912 WHERE "Tonnage (GRT)" > '5,754' AND "Sunk by" = 'u-305'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
count the number of times patient 23237 has been given cath lab intake this month.
SELECT COUNT(*) 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 = 23237)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'cath lab int...
mimic_iii
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
count the number of patients diagnosed with chronic pancreatitis who are taking medication via left eye.
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 = "Chronic pancreatitis" AND prescriptions.route = "LEFT EYE"
mimicsql_data
CREATE TABLE table_7195 ( "State" text, "Type" text, "Name" text, "Title" text, "Royal house" text, "From" text )
What is the title from 302 bc?
SELECT "Title" FROM table_7195 WHERE "From" = '302 bc'
wikisql
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE labevents ( row...
when did patient 17398 receive the last microbiology test of the biopsy since 180 months ago?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17398) AND microbiologyevents.spec_type_desc = 'biopsy' AND DATETIME(microbiologyevents.charttime) >= DATETIME(CURRENT_TIME(), '-180 month') ORDER BY m...
mimic_iii
CREATE TABLE table_name_42 ( gold VARCHAR, silver VARCHAR )
who received gold when silver is wolfgang eibeck austria (aut)?
SELECT gold FROM table_name_42 WHERE silver = "wolfgang eibeck austria (aut)"
sql_create_context
CREATE TABLE table_name_31 ( date VARCHAR, opponents VARCHAR, h___a VARCHAR )
When is The Opponents of lincoln city and a H / A of a?
SELECT date FROM table_name_31 WHERE opponents = "lincoln city" AND h___a = "a"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id num...
how did patient 64519 in the last year first visit the hospital?
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 64519 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime LIMIT 1
mimic_iii
CREATE TABLE table_name_85 ( hosted VARCHAR, average VARCHAR )
How many were hosted whene the average attendance was 27,638?
SELECT COUNT(hosted) FROM table_name_85 WHERE average = 27 OFFSET 638
sql_create_context
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResults ( Id number, ...
Users with at least 100 bronze badges.
SELECT U.Id AS "user_link", COUNT(B.Id) AS "Bronze Badges" FROM Users AS U JOIN Badges AS B ON U.Id = B.UserId WHERE B.Class = 3 GROUP BY U.Id HAVING COUNT(B.Id) >= 100 ORDER BY COUNT(B.Id) DESC
sede
CREATE TABLE table_53027 ( "Name" text, "Real Name" text, "Birthdate" text, "Costume Role" text, "Defining characteristics" text )
Who is the person with the defining characteristic of the shortest band member?
SELECT "Real Name" FROM table_53027 WHERE "Defining characteristics" = 'shortest band member'
wikisql
CREATE TABLE table_37101 ( "Rank" real, "Name" text, "Height* ft (m)" text, "Year* (est.)" text, "City" text )
what name was on the year 2012
SELECT "Name" FROM table_37101 WHERE "Year* (est.)" = '2012'
wikisql
CREATE TABLE table_71213 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Who was the opponent at the game that had a loss of Hendrickson (0-1)?
SELECT "Opponent" FROM table_71213 WHERE "Loss" = 'hendrickson (0-1)'
wikisql
CREATE TABLE table_name_49 ( date VARCHAR, score_f_a VARCHAR, opponents VARCHAR )
Score F A of 2 0, and a Opponents of walsall has what date?
SELECT date FROM table_name_49 WHERE score_f_a = "2–0" AND opponents = "walsall"
sql_create_context
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
Select titkes with Like and Not Like.
SELECT P.Title FROM Posts AS P WHERE P.Tags LIKE '%android%' AND P.Tags LIKE '%uiautomator%' AND NOT P.Tags LIKE '%test%' AND NOT P.Tags LIKE '%android-testing%' AND NOT P.Tags LIKE '%robotium%' AND NOT P.Tags LIKE '%appium%' AND NOT P.Tags LIKE '%android-espresso%' AND NOT P.Tags LIKE '%android-emulator%' AND NOT P.Ta...
sede
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance int ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working...
Show the names of journalists and the number of events they reported Visualize by bar chart, and list by the bar in ascending.
SELECT T3.Name, COUNT(*) FROM news_report AS T1 JOIN event AS T2 ON T1.Event_ID = T2.Event_ID JOIN journalist AS T3 ON T1.journalist_ID = T3.journalist_ID GROUP BY T3.Name ORDER BY T3.Name
nvbench
CREATE TABLE table_203_562 ( id number, "state" text, "no. of candidates" number, "no. of elected" number, "total no. of seats in assembly" number, "year of election" number )
what is the first state after delhi ?
SELECT "state" FROM table_203_562 WHERE id = (SELECT id FROM table_203_562 WHERE "state" = 'delhi') + 1
squall
CREATE TABLE table_name_89 ( tyres VARCHAR, laps VARCHAR, team VARCHAR )
Which tyres has more than 5 laps with team nissan motorsports international?
SELECT tyres FROM table_name_89 WHERE laps > 5 AND team = "nissan motorsports international"
sql_create_context
CREATE TABLE table_31128 ( "#" real, "Name" text, "Position" text, "Height" text, "Weight" real, "Year" text, "Former school" text, "Hometown" text )
What number is the player whose hometown is Tampa, FL?
SELECT "#" FROM table_31128 WHERE "Hometown" = 'Tampa, FL'
wikisql
CREATE TABLE table_name_98 ( country VARCHAR, score VARCHAR )
What is the country of the player with a 70-71-68=209 score?
SELECT country FROM table_name_98 WHERE score = 70 - 71 - 68 = 209
sql_create_context
CREATE TABLE table_72938 ( "Season" text, "Date Released" text, "# Of Episodes" real, "# Of Discs" real, "Special Features" text )
What day was the complete 2nd series: volume one released?
SELECT "Date Released" FROM table_72938 WHERE "Season" = 'The Complete 2nd Series: Volume One'
wikisql
CREATE TABLE table_7702 ( "Name/ designation" text, "Year of intro" real, "Country of origin" text, "Primary cartridge" text, "Type" text )
What is Country of Origin, when Year of Intro is 1977?
SELECT "Country of origin" FROM table_7702 WHERE "Year of intro" = '1977'
wikisql
CREATE TABLE table_name_33 ( characters VARCHAR, construction VARCHAR )
Who has a Construction of 1873, foochow navy yard?
SELECT characters FROM table_name_33 WHERE construction = "1873, foochow navy yard"
sql_create_context
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 int, capacity int, pay_load int, cruising_speed int, range_...
give me morning flights from ATLANTA to BALTIMORE
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_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_name = 'BALTI...
atis
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
what are the flights DALLAS to BOSTON on monday morning
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_nam...
atis
CREATE TABLE table_16912000_13 ( kr_td VARCHAR, mfg_lg VARCHAR )
What is the kr td when mfg lg is 64?
SELECT kr_td FROM table_16912000_13 WHERE mfg_lg = 64
sql_create_context
CREATE TABLE table_6075 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
How many wins were in the Masters Tournament with less than 15 events?
SELECT MAX("Wins") FROM table_6075 WHERE "Tournament" = 'masters tournament' AND "Events" < '15'
wikisql
CREATE TABLE table_24119 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Orangemen points" real, "Opponents" real, "Record" text )
How many results have a game of 5?
SELECT COUNT("Result") FROM table_24119 WHERE "Game" = '5'
wikisql
CREATE TABLE table_train_14 ( "id" int, "bone_marrow_transplant" bool, "pregnancy_or_lactation" bool, "organ_transplantation" bool, "advanced_pulmonary_fibrosis" bool, "cardiopulmonary_resuscitation" bool, "myocardial_infarction" bool, "NOUSE" float )
advanced pulmonary fibrosis
SELECT * FROM table_train_14 WHERE advanced_pulmonary_fibrosis = 1
criteria2sql
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
列出按平均住院时长升序排序医院6177251中各科室的编码、名称都是什么?平均住院时长是多少?
SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM, AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '6177251' GROUP BY MED_ORG_DEPT_CD ORDER BY AVG(IN_HOSP_DAYS)
css
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE fare ( fare...
i want a flight from MONTREAL QUEBEC to SAN DIEGO CALIFORNIA that leaves sunday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight, state AS STATE_0, state AS STATE_1 WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND date_day.day_number = ...
atis
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 icustays ( row_id number, ...
how many times was the colonoscopy procedure performed in 2105?
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 = 'colonoscopy') AND STRFTIME('%y', procedures_icd.charttime) = '2105'
mimic_iii
CREATE TABLE table_46048 ( "Player" text, "Nationality" text, "Position" text, "Years for Grizzlies" text, "School/Club Team" text )
In which years did Zach Randolph play for the Grizzlies?
SELECT "Years for Grizzlies" FROM table_46048 WHERE "Player" = 'zach randolph'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
provide the number of patients whose marital status is widowed and procedure long title is extracorporeal circulation auxiliary to open heart surgery?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.long_title = "Extracorporeal circulation auxiliary to open heart surgery"
mimicsql_data
CREATE TABLE table_name_59 ( high_points VARCHAR, score VARCHAR )
Who had the high points when the score was w 108 105 (ot)?
SELECT high_points FROM table_name_59 WHERE score = "w 108–105 (ot)"
sql_create_context
CREATE TABLE table_name_82 ( gold VARCHAR, bronze VARCHAR, silver VARCHAR )
How many golds have a bronze less than 1, and a silver less than 1?
SELECT COUNT(gold) FROM table_name_82 WHERE bronze < 1 AND silver < 1
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
病患号码是47642343的那个人在其医疗记录里被开出的药品均超出748.1元有多少次?以及具体的编号是多少?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '47642343' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT <= 748.1)
css
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
what is the monthly average value of patient 2753's weight?
SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2753)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit...
mimic_iii
CREATE TABLE table_25931 ( "No." real, "#" real, "Original airdate" text, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text, "U.S. viewers (millions)" text )
What is the highest episode number?
SELECT MAX("No.") FROM table_25931
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...
患者13034482在2003年4月25日到2009年2月2日内曾在医院一共就诊多少次?
SELECT (SELECT COUNT(*) FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '13034482' AND txmzjzjlb.JZKSRQ BETWEEN '2003-04-25' AND '2009-02-02' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjz...
css
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE m...
what is in 02/2103 average ph value of patient 022-87224?
SELECT AVG(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-87224')) AND lab.labname = 'ph' AND STRFTIME('%y-%m', lab.labresulttime) = '21...
eicu
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about the amount of headquarter over the headquarter , and group by attribute headquarter by a bar chart, and show x-axis in desc order.
SELECT Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
what were the three frequent output events that happened during this year?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY intakeoutput.celllabel) AS ...
eicu
CREATE TABLE table_59486 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What's the lowest goal difference when the position is higher than 16?
SELECT MIN("Goal Difference") FROM table_59486 WHERE "Position" > '16'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
calculate the length of the last hospital stay of patient 004-61151.
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '004-61151' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
eicu
CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTEGER, investor_id INTEGER, transaction_type_code VARCHAR(10), date_of_transaction DATETIME, amount_of_transaction DECIMAL(19,4), share_count VARCHAR(40),...
Bar chart x axis date of transaction y axis mean share count
SELECT date_of_transaction, AVG(share_count) FROM Transactions
nvbench
CREATE TABLE table_75783 ( "Stage" text, "Shooter" text, "Time" real, "Avg. Run" real, "Year" real )
What is the total years with average runs less than 4.75 and a time of 14.26?
SELECT COUNT("Year") FROM table_75783 WHERE "Time" = '14.26' AND "Avg. Run" < '4.75'
wikisql
CREATE TABLE repair ( repair_ID int, name text, Launch_Date text, Notes text ) CREATE TABLE repair_assignment ( technician_id int, repair_ID int, Machine_ID int ) CREATE TABLE machine ( Machine_ID int, Making_Year int, Class text, Team text, Machine_series text, val...
Show names of technicians in ascending order of quality rank of the machine they are assigned, and count them by a pie chart
SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name ORDER BY T2.quality_rank
nvbench
CREATE TABLE table_name_49 ( Id VARCHAR )
What is the 1993 value of the 1997 Grand Slams?
SELECT 1993 FROM table_name_49 WHERE 1997 = "grand slams"
sql_create_context
CREATE TABLE table_1342451_16 ( candidates VARCHAR, incumbent VARCHAR )
How many candidates were there when Henry Garland Dupr was the incumbent?
SELECT COUNT(candidates) FROM table_1342451_16 WHERE incumbent = "Henry Garland Dupré"
sql_create_context
CREATE TABLE table_name_42 ( home VARCHAR, record VARCHAR )
Name the home with record of 33-18-9
SELECT home FROM table_name_42 WHERE record = "33-18-9"
sql_create_context
CREATE TABLE table_name_84 ( rank INTEGER, floors VARCHAR )
What is the average rank for a building with 24 floors?
SELECT AVG(rank) FROM table_name_84 WHERE floors = 24
sql_create_context
CREATE TABLE table_name_79 ( points INTEGER, year VARCHAR, wins VARCHAR )
Which Points have a Year larger than 1998, and Wins of 1?
SELECT AVG(points) FROM table_name_79 WHERE year > 1998 AND wins = 1
sql_create_context
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 ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
when was first time patient 7165 was measured with a greater arterial bp [systolic] than 141.0 on the last icu visit?
SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7165) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid ...
mimic_iii
CREATE TABLE table_29335 ( "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 wrote the episode with the production code of 3t7255?
SELECT "Written by" FROM table_29335 WHERE "Production code" = '3T7255'
wikisql
CREATE TABLE mountain ( mountain_id number, name text, height number, prominence number, range text, country text ) CREATE TABLE climber ( climber_id number, name text, country text, time text, points number, mountain_id number )
Return the name of the mountain with the greatest height.
SELECT name FROM mountain ORDER BY height DESC LIMIT 1
spider
CREATE TABLE table_29264319_1 ( mix_artist VARCHAR, setlist VARCHAR, artist_1 VARCHAR )
Who is the mix artist for the closing party setlist where artist 1 is Dillinja and Skibadee?
SELECT mix_artist FROM table_29264319_1 WHERE setlist = "Closing Party" AND artist_1 = "Dillinja and Skibadee"
sql_create_context
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title te...
what are the three most frequent medications that were prescribed during the same month to patients aged 30s after having been diagnosed with nb obsrv suspct infect, in the previous year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE table_34941 ( "Date" text, "Opponent#" text, "Site" text, "Result" text, "Attendance" text )
What is the Opponent name at memorial stadium minneapolis, mn on 10/20/1928?
SELECT "Opponent#" FROM table_34941 WHERE "Site" = 'memorial stadium • minneapolis, mn' AND "Date" = '10/20/1928'
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...
沈雅懿患者的检验报告单对应的检验结果指标均异常都是哪些?列出对应的检验报告单号都是啥?
SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.JZLSH_MZJZJLB ...
css
CREATE TABLE table_name_97 ( week INTEGER, date VARCHAR )
What is the lowest week number that had a game on December 3, 1967?
SELECT MIN(week) FROM table_name_97 WHERE date = "december 3, 1967"
sql_create_context
CREATE TABLE table_name_75 ( delegates INTEGER, candidate VARCHAR, counties VARCHAR )
What is the lowest number of delegates when John McCain was the candidate with less than 45 candidates?
SELECT MIN(delegates) FROM table_name_75 WHERE candidate = "john mccain" AND counties < 45
sql_create_context
CREATE TABLE table_name_41 ( avg_g VARCHAR, gain VARCHAR, loss VARCHAR, name VARCHAR )
How much Avg/G has a Loss larger than 117, and a Name of opponents, and a Gain smaller than 2444?
SELECT COUNT(avg_g) FROM table_name_41 WHERE loss > 117 AND name = "opponents" AND gain < 2444
sql_create_context
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
查看一下范雅韶这位患者以前的治疗方案
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '范雅韶' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费'
css
CREATE TABLE table_1652224_5 ( date_successor_seated VARCHAR, reason_for_change VARCHAR )
what is the date the successor seated because the person died august 17, 1954?
SELECT date_successor_seated FROM table_1652224_5 WHERE reason_for_change = "Died August 17, 1954"
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, ...
在编号为6465172的医院就诊的病患36808605在入院时科室名称中含有优生的住院就诊记录都有哪几条?
SELECT * FROM hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb...
css
CREATE TABLE table_204_120 ( id number, "rank" number, "athlete" text, "country" text, "time" text, "notes" text )
the number of total skaters in the competition
SELECT COUNT("athlete") FROM table_204_120
squall
CREATE TABLE table_name_73 ( grid INTEGER, driver VARCHAR, laps VARCHAR )
Tell me the average Grid for driver of Luca Badoer and Laps more than 69
SELECT AVG(grid) FROM table_name_73 WHERE driver = "luca badoer" AND laps > 69
sql_create_context