context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 procedures ( ...
give me the number of patients whose marital status is single and diagnoses long title is syncope and collapse?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Syncope and collapse"
mimicsql_data
CREATE TABLE table_47375 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
When Payne Stewart of the United States scored higher than 69, what was the To Par?
SELECT "To par" FROM table_47375 WHERE "Country" = 'united states' AND "Score" > '69' AND "Player" = 'payne stewart'
wikisql
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) 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...
What is the first name and GPA of every student that has a GPA lower than average.
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is the number of patients whose year of death is less than or equal to 2126 and procedure long title is (aorto)coronary bypass of two coronary arteries?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.long_title = "(Aorto)coronary bypass of two coronary arteries"
mimicsql_data
CREATE TABLE table_204_915 ( id number, "draw" number, "artist" text, "song" text, "points" number, "place" text )
bernadette 's soms and which other song earned the same number of points ?
SELECT "song" FROM table_204_915 WHERE "song" <> '"soms"' AND "points" = (SELECT "points" FROM table_204_915 WHERE "song" = '"soms"')
squall
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text,...
what is the ground transportation available in the city of PHILADELPHIA
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_name_42 ( year INTEGER, author VARCHAR )
what is the earliest year when the author is reki kawahara?
SELECT MIN(year) FROM table_name_42 WHERE author = "reki kawahara"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give me the number of patients whose diagnoses long title is other preterm infants, 2,000-2,499 grams?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other preterm infants, 2,000-2,499 grams"
mimicsql_data
CREATE TABLE table_204_876 ( id number, "ecclesiastical jurisdictions" text, "latin name" text, "type" text, "rite" text, "ecclesiastical province" text, "established" text, "area (km2)" number )
how many roman catholic dioceses were established in angola before 1990 ?
SELECT COUNT("ecclesiastical jurisdictions") FROM table_204_876 WHERE "established" < 1990
squall
CREATE TABLE table_204_750 ( id number, "team" text, "stadium" text, "capacity" number, "seated" number )
which of the teams had the top number of capacity ?
SELECT "team" FROM table_204_750 ORDER BY "capacity" DESC LIMIT 1
squall
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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...
what is the number of patients whose age is less than 62 and diagnoses long title is acute glomerulonephritis with other specified pathological lesion in kidney?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "62" AND diagnoses.long_title = "Acute glomerulonephritis with other specified pathological lesion in kidney"
mimicsql_data
CREATE TABLE table_name_17 ( style VARCHAR, choreographer_s_ VARCHAR )
What is Style, when Choreographer(s) is Dave Scott?
SELECT style FROM table_name_17 WHERE choreographer_s_ = "dave scott"
sql_create_context
CREATE TABLE table_18141 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text, "Candidates" text )
Who's the incumbent in Florida 6?
SELECT "Incumbent" FROM table_18141 WHERE "District" = 'Florida 6'
wikisql
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, ...
give me the flights from MIAMI to NEW YORK using FF
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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAM...
atis
CREATE TABLE table_27114708_2 ( date_of_appointment VARCHAR, team VARCHAR )
For team ascoli please mention all the appointment date.
SELECT date_of_appointment FROM table_27114708_2 WHERE team = "Ascoli"
sql_create_context
CREATE TABLE table_17715 ( "Name of System" text, "Location" text, "Traction Type" text, "Date (From)" text, "Date (To)" text, "Notes" text )
how many notes are form the date (from) 14 march 1910?
SELECT COUNT("Notes") FROM table_17715 WHERE "Date (From)" = '14 March 1910'
wikisql
CREATE TABLE table_1987 ( "Match no." real, "Match Type" text, "Team Europe" text, "Score" text, "Team USA" text, "Progressive Total" text )
How many match numbers have team europe listed as osku palermaa?
SELECT COUNT("Match no.") FROM table_1987 WHERE "Team Europe" = 'Osku Palermaa'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text te...
How many users with rep less than 15.
SELECT COUNT(*) AS Users FROM Users WHERE Reputation < 15 AND Id > 0
sede
CREATE TABLE table_46856 ( "Sport" text, "League" text, "Club" text, "Founded" real, "Venue" text, "League championships" real, "Championship years" text )
Which League championship is the lowest one that has a Venue of penn state ice pavilion, and a Club of penn state nittany lions men's ice hockey?
SELECT MIN("League championships") FROM table_46856 WHERE "Venue" = 'penn state ice pavilion' AND "Club" = 'penn state nittany lions men''s ice hockey'
wikisql
CREATE TABLE table_test_4 ( "id" int, "ejection_fraction_ef" int, "systolic_blood_pressure_sbp" int, "active_infection" bool, "heart_disease" bool, "renal_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "cardiogenic_shock" bool, "diastolic_blood_pressure_dbp" int, ...
estimated glomerular filtration rate ( egfr ) < 30 ml / min / 1.73 m2 using the mdrd formula at visit 1.
SELECT * FROM table_test_4 WHERE estimated_glomerular_filtration_rate_egfr < 30
criteria2sql
CREATE TABLE table_name_74 ( years_in_orlando VARCHAR, school_club_team VARCHAR )
Which Years in Orlando has a School/Club Team of texas tech?
SELECT years_in_orlando FROM table_name_74 WHERE school_club_team = "texas tech"
sql_create_context
CREATE TABLE table_68047 ( "Rank" real, "Population" real, "Name" text, "Former Name" text, "Municipality" text )
Name the total number of ranks for kujalleq with former name of brattahl and population less than 47
SELECT COUNT("Rank") FROM table_68047 WHERE "Municipality" = 'kujalleq' AND "Former Name" = 'brattahlíð' AND "Population" < '47'
wikisql
CREATE TABLE book_club ( category VARCHAR, YEAR INTEGER )
List categories that have at least two books after year 1989.
SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING COUNT(*) >= 2
sql_create_context
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...
在06年9月8日直到10年10月18日结束编码为8721079的医院有多少科室在门诊就诊中开出大于等于16张检验报告单?
SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '8721079' AND jybgb.BGRQ BETWEEN '2006-09-08' AND '2010-10-18' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 16) AS T
css
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test...
By whom is BIOLOGY 281 taught ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'BIOLOGY' AND course.number = 281 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offerin...
advising
CREATE TABLE table_2896329_1 ( date VARCHAR, handicap VARCHAR )
On what date was the handicap 8 st 12 lb?
SELECT date FROM table_2896329_1 WHERE handicap = "8 st 12 lb"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
count the number of patients whose diagnoses short title is alcohol cirrhosis liver and lab test category is hematology?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Alcohol cirrhosis liver" AND lab."CATEGORY" = "Hematology"
mimicsql_data
CREATE TABLE table_name_8 ( pick__number INTEGER, overall VARCHAR )
What Average Pick # has an Overall of 296?
SELECT AVG(pick__number) FROM table_name_8 WHERE overall = 296
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
how many patients whose ethnicity is black/cape verdean and year of birth is less than 2078?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.dob_year < "2078"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients whose procedure long title is open reduction of fracture with internal fixation, femur and lab test category is blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Open reduction of fracture with internal fixation, femur" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
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...
审核人的检验报告单07225686974有什么工号和姓名?
SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '07225686974'
css
CREATE TABLE table_204_651 ( id number, "date" text, "championship" text, "location" text, "category" text, "surface" text, "prev. result" text, "prev. points" number, "new points" number, "outcome" text )
what is the total of new points that have been given ?
SELECT SUM("new points") FROM table_204_651
squall
CREATE TABLE table_9992 ( "Round" real, "Pick" real, "Player" text, "Nationality" text, "College" text )
What is Player, when Round is less than 6, and when Pick is '69'?
SELECT "Player" FROM table_9992 WHERE "Round" < '6' AND "Pick" = '69'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
what was the name of the drug patient 32755 got prescription for within 2 days after being diagnosed with bmi 33.0-33.9,adult in the last hospital visit?
SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 32755 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'bmi 33...
mimic_iii
CREATE TABLE table_name_54 ( director_s_ VARCHAR, recipient VARCHAR )
Who was the director that had a recipient of Redbag Pictures Ltd?
SELECT director_s_ FROM table_name_54 WHERE recipient = "redbag pictures ltd"
sql_create_context
CREATE TABLE table_39013 ( "Game" real, "February" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Record has a Points smaller than 62 and a February larger than 16, and a Score of 8 7?
SELECT "Record" FROM table_39013 WHERE "Points" < '62' AND "February" > '16' AND "Score" = '8–7'
wikisql
CREATE TABLE exhibition ( exhibition_id number, year number, theme text, artist_id number, ticket_price number ) CREATE TABLE artist ( artist_id number, name text, country text, year_join number, age number ) CREATE TABLE exhibition_record ( exhibition_id number, date t...
How many artists do we have?
SELECT COUNT(*) FROM artist
spider
CREATE TABLE table_66216 ( "Rank" real, "Athlete" text, "Country" text, "Day 1" real, "Total" text )
Who had a rank under 17 with a total of 119?
SELECT "Athlete" FROM table_66216 WHERE "Rank" < '17' AND "Total" = '119'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
Provide the number of patients born before 2123 who have s/p hanging as their primary disease.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.dob_year < "2123"
mimicsql_data
CREATE TABLE table_29020 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What number pick was the player from HIFK Helsinki (Finland)?
SELECT "Pick #" FROM table_29020 WHERE "College/junior/club team" = 'HIFK Helsinki (Finland)'
wikisql
CREATE TABLE table_name_24 ( year INTEGER, notes VARCHAR )
What is the lowest Year, when Notes is '5.19km, 18controls'?
SELECT MIN(year) FROM table_name_24 WHERE notes = "5.19km, 18controls"
sql_create_context
CREATE TABLE table_name_50 ( diameter__km_ INTEGER, latitude VARCHAR, year_named VARCHAR, longitude VARCHAR )
What is the diameter for 1997 when longitude is 212.0e and latitude is 47.0n?
SELECT MIN(diameter__km_) FROM table_name_50 WHERE year_named = 1997 AND longitude = "212.0e" AND latitude = "47.0n"
sql_create_context
CREATE TABLE table_2453 ( "N\u00ba" real, "Cabinet (Nickname)" text, "Took office" text, "Left office" text, "Duration" text, "Coalition parties" text, "ministers" text, "ministries" real, "King" text )
What is the most amount of ministries?
SELECT MAX("ministries") FROM table_2453
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTas...
Top questions by Bayesian rating.
SELECT Id AS "post_link", upvotes, downvotes, Score, (upvotes + (AVG(upvotes) OVER ())) / (upvotes + downvotes + (AVG(upvotes + downvotes) OVER ())) AS br FROM (SELECT p.Id, COUNT(CASE v.VoteTypeId WHEN 2 THEN 1 ELSE NULL END) AS upvotes, COUNT(CASE v.VoteTypeId WHEN 3 THEN 1 ELSE NULL END) AS downvotes, MAX(p.Score) A...
sede
CREATE TABLE table_30888 ( "Code" text, "Subdivision name ( be ) (BGN/PCGN)" text, "Subdivision name ( be ) (GOST)" text, "Subdivision name ( ru ) (BGN/PCGN)" text, "Subdivision name ( ru ) (GOST)" text, "Subdivision category" text )
Which codes have subdivision names (BE) (BGN) of Homyel'skaya Voblasts'?
SELECT "Code" FROM table_30888 WHERE "Subdivision name ( be ) (BGN/PCGN)" = 'Homyel''skaya voblasts'
wikisql
CREATE TABLE Skills_Required_To_Fix ( part_fault_id INTEGER, skill_id INTEGER ) CREATE TABLE Skills ( skill_id INTEGER, skill_code VARCHAR(20), skill_description VARCHAR(255) ) CREATE TABLE Part_Faults ( part_fault_id INTEGER, part_id INTEGER, fault_short_name VARCHAR(20), fault_de...
How many staffs have contacted with each engineer? Give me a bar chart grouping by each engineer's last name, order the number of last name in descending order.
SELECT last_name, COUNT(last_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY last_name ORDER BY COUNT(last_name) DESC
nvbench
CREATE TABLE table_name_23 ( tv_time VARCHAR, date VARCHAR )
Which TV Time has a Date of january 2, 2005?
SELECT tv_time FROM table_name_23 WHERE date = "january 2, 2005"
sql_create_context
CREATE TABLE table_30574 ( "School" text, "Gender" text, "Age Range" text, "Religious Affiliation" text, "Location" text, "School website" text )
What is the gender of the school which has the website http://www.nicholasbreakspearschool.co.uk/?
SELECT "Gender" FROM table_30574 WHERE "School website" = 'http://www.nicholasbreakspearschool.co.uk/'
wikisql
CREATE TABLE table_44119 ( "Rank" real, "Title" text, "Studio" text, "Director" text, "Gross" text )
What is the rank of the film directed by Kevin Costner?
SELECT COUNT("Rank") FROM table_44119 WHERE "Director" = 'kevin costner'
wikisql
CREATE TABLE table_46062 ( "Game" real, "October" real, "Opponent" text, "Score" text, "Record" text )
What is the average game number that was on october 19?
SELECT AVG("Game") FROM table_46062 WHERE "October" = '19'
wikisql
CREATE TABLE fgwyjzb ( CLINIC_ID text, CLINIC_TYPE 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, ...
参保人编号为84583960年门诊医疗费一共要多少钱?
SELECT SUM(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '84583960' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT SUM(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '84583960' AND fgwyjzb.CLINIC_TYPE = '门诊'
css
CREATE TABLE table_name_15 ( craft VARCHAR, location VARCHAR )
What is the Craft used at Coniston Water?
SELECT craft FROM table_name_15 WHERE location = "coniston water"
sql_create_context
CREATE TABLE table_26996293_3 ( cfl_team VARCHAR, college VARCHAR )
How many CFL teams drafted someone from mount allison college?
SELECT COUNT(cfl_team) FROM table_26996293_3 WHERE college = "Mount Allison"
sql_create_context
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
give me the number of patients whose year of death is less than or equal to 2122 and drug code is beth5?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2122.0" AND prescriptions.formulary_drug_cd = "BETH5"
mimicsql_data
CREATE TABLE table_65419 ( "Branding" text, "Call-Sign" text, "Frequency" text, "Power (kw)" text, "Location" text )
What's the location when the branding is 1116 DXAS Zamboanga?
SELECT "Location" FROM table_65419 WHERE "Branding" = '1116 dxas zamboanga'
wikisql
CREATE TABLE table_name_33 ( points INTEGER, extra_points VARCHAR, field_goals VARCHAR )
Who had a points average with 0 extra points and 0 field goals?
SELECT AVG(points) FROM table_name_33 WHERE extra_points = 0 AND field_goals > 0
sql_create_context
CREATE TABLE table_name_79 ( share_of_seats VARCHAR, european_election__uk_ VARCHAR )
Which Share of seats has a European election (UK) of 2009?
SELECT share_of_seats FROM table_name_79 WHERE european_election__uk_ = 2009
sql_create_context
CREATE TABLE table_name_7 ( date VARCHAR, venue VARCHAR )
Which date held the match at the City Stadium, Georgetown?
SELECT date FROM table_name_7 WHERE venue = "city stadium, georgetown"
sql_create_context
CREATE TABLE table_72197 ( "Target" text, "Target Code (Allied)" text, "Luftwaffe unit (wing)" text, "Allied forces" text, "Effect on Allied Squadrons (according to official figures)" text )
Which Allied Force targetted Woensdrecht?
SELECT "Allied forces" FROM table_72197 WHERE "Target" = 'Woensdrecht'
wikisql
CREATE TABLE Apartment_Facilities ( apt_id INTEGER, facility_code CHAR(15) ) CREATE TABLE Apartments ( apt_id INTEGER, building_id INTEGER, apt_type_code CHAR(15), apt_number CHAR(10), bathroom_count INTEGER, bedroom_count INTEGER, room_count CHAR(5) ) CREATE TABLE Apartment_Bookin...
Find the number of booking start date for the apartments that have more than two bedrooms for each weekday in a bar chart.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2
nvbench
CREATE TABLE table_name_24 ( team VARCHAR, laps VARCHAR, driver VARCHAR )
What team had 10 Labs and the Driver was Alex Yoong?
SELECT team FROM table_name_24 WHERE laps = 10 AND driver = "alex yoong"
sql_create_context
CREATE TABLE table_35500 ( "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Venue" text )
What was the score at Spartan Stadium when San Jose was the Home team?
SELECT "Score" FROM table_35500 WHERE "Home Team" = 'san jose' AND "Venue" = 'spartan stadium'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number...
on 07/28/2102, when was the last time that the arterial bp [diastolic] of patient 21454 was greater than 52.0?
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 = 21454)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
mimic_iii
CREATE TABLE table_48673 ( "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 score on march 8?
SELECT "Score" FROM table_48673 WHERE "Date" = 'march 8'
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...
患者59707759所有检验结果指标记录在2019年2月27日到2019年5月21日内,有什么检测方法?
SELECT jyjgzbb.JCFF 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 jybgb.BGDH = jyjgzbb.BGDH...
css
CREATE TABLE table_64785 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of the bronze medals when there were less than 8 total medals, 0 silver medals and a rank of 9?
SELECT SUM("Bronze") FROM table_64785 WHERE "Total" < '8' AND "Rank" = '9' AND "Silver" < '0'
wikisql
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
What are the country of product origins where pesticide residues were not detected?
SELECT T1.country FROM sampledata15 AS T1 JOIN resultsdata15 AS T2 ON T1.sample_pk = T2.sample_pk WHERE T2.concen = "0" GROUP BY T1.country
pesticide
CREATE TABLE table_name_23 ( silver VARCHAR, gold VARCHAR, bronze VARCHAR, total VARCHAR, rank VARCHAR )
How many times is the total less than 15, rank less than 5, bronze is 4 and gold smaller than 3?
SELECT COUNT(silver) FROM table_name_23 WHERE total < 15 AND rank < 5 AND bronze = 4 AND gold < 3
sql_create_context
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_order_placed DATETIME, order_details VARCHAR(255) ) CREATE...
Show the number of accounts opened in each day. Bin the account open day by weekday and group by other account details in a stacked bar chart.
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts GROUP BY other_account_details
nvbench
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...
在编号为4616814的这家医院里,有多少科室的平均医疗住院时长在24天以上
SELECT COUNT(*) FROM (SELECT MED_ORG_DEPT_CD FROM t_kc21 WHERE MED_SER_ORG_NO = '4616814' GROUP BY MED_ORG_DEPT_CD HAVING AVG(IN_HOSP_DAYS) > 24) AS T
css
CREATE TABLE ref_colors ( color_code text, color_description text ) CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_description text, other_product_details t...
What are all the characteristic names of product 'sesame'?
SELECT t3.characteristic_name FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame"
spider
CREATE TABLE table_name_59 ( semi_finalist__number2 VARCHAR, year VARCHAR )
Who was the Semi-Finalist #2 in 2007?
SELECT semi_finalist__number2 FROM table_name_59 WHERE year = "2007"
sql_create_context
CREATE TABLE table_30288 ( "Religion" text, "Births" real, "Conversions" text, "New adherents per year" real, "Growth rate" text )
Name the number of new adherents per year for confucianism
SELECT COUNT("New adherents per year") FROM table_30288 WHERE "Religion" = 'Confucianism'
wikisql
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...
what is average age of patients whose gender is m and days of hospital stay is 27?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay = "27"
mimicsql_data
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, H...
从二00九年十一月三十日到二0一六年六月十三日这段时间内,患者78396126开出的药品有多少是自付比例低于0.31的
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '78396126' AND t_kc22.STA_DATE BETWEEN '2009-11-30' AND '2016-06-13' AND t_kc22.SELF_PAY_PRO < 0.31
css
CREATE TABLE table_name_48 ( rank VARCHAR, studio VARCHAR )
What is the total number of ranks that had vestron as the studio?
SELECT COUNT(rank) FROM table_name_48 WHERE studio = "vestron"
sql_create_context
CREATE TABLE table_14650162_1 ( pick__number VARCHAR, position VARCHAR )
How many picks played Tight end?
SELECT COUNT(pick__number) FROM table_14650162_1 WHERE position = "Tight End"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
how many patients since 3 years ago were diagnosed with s/p thyroid surgery after antiarrhythmics - class iii antiarrhythmic within 2 months?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiarrhythmics - class iii antiarrhythmic' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME()...
eicu
CREATE TABLE table_36704 ( "Conference" text, "Division" text, "Team" text, "City" text, "Home Stadium" text )
Which Division does the City being jacksonville, florida belong to?
SELECT "Division" FROM table_36704 WHERE "City" = 'jacksonville, florida'
wikisql
CREATE TABLE table_29565541_2 ( stolen_ends INTEGER, l VARCHAR )
When 5 is the l what is the lowest amount of stolen ends?
SELECT MIN(stolen_ends) FROM table_29565541_2 WHERE l = 5
sql_create_context
CREATE TABLE medicine_enzyme_interaction ( enzyme_id int, medicine_id int, interaction_type text ) CREATE TABLE enzyme ( id int, name text, Location text, Product text, Chromosome text, OMIM int, Porphyria text ) CREATE TABLE medicine ( id int, name text, Trade_Name...
Show me a bar chart for what is the id and trade name of the medicines can interact with at least 3 enzymes?, sort total number in ascending order please.
SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY id
nvbench
CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE conference ( cid int, homepage varchar, name varchar ) CREATE TABLE ...
return me the number of citations of ' Making database systems usable ' in each year .
SELECT year, SUM(citation_num) FROM publication WHERE title = 'Making database systems usable' GROUP BY year
academic
CREATE TABLE table_name_41 ( world_record VARCHAR )
What's the 123kg of the Total world record?
SELECT 123 AS kg FROM table_name_41 WHERE world_record = "total"
sql_create_context
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
患有阿尔茨海默病的人检测指标273122的参考值范围下限与上限能达到多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ...
css
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...
列出患者30728995的检验报告单日期在零二年八月二十七日之前的所对应的门诊就诊的流水号
SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '30728995' AND NOT mzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2002-08-27')
css
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 the primary disease and procedure icd9 code of subject id 74463?
SELECT demographic.diagnosis, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "74463"
mimicsql_data
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...
把2002年11月30日到2010年6月8日期间患者96886355一共看过多少种疾病查看一下
SELECT COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_ID = '96886355' AND IN_HOSP_DATE BETWEEN '2002-11-30' AND '2010-06-08'
css
CREATE TABLE table_name_38 ( result VARCHAR, date VARCHAR )
What was the result of the game that was played on february 27, 2000?
SELECT result FROM table_name_38 WHERE date = "february 27, 2000"
sql_create_context
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE 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, ...
病患56819536从06年11月26日到21年1月2日内检查的次数是多少次?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '56819536' AND t_kc22.STA_DATE BETWEEN '2006-11-26' AND '2021-01-02' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_41820 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" text, "Record" text )
Who is the visitor when the record is 2-1?
SELECT "Visitor" FROM table_41820 WHERE "Record" = '2-1'
wikisql
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...
what number of patients given the drug ciprofloxacin were male?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Ciprofloxacin"
mimicsql_data
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean...
Of questions that have upvoted answers, how many have accepted answers?.
SELECT a.Id AS "Answer ID", p.Id AS "Question ID", p.Title AS "Title" FROM Posts AS p JOIN Posts AS a ON p.Id = a.ParentId WHERE p.PostTypeId = 1 AND a.OwnerUserId = '##UserId:int##' AND a.Score >= '##MinAnswerScore:int##' AND a.Id != p.AcceptedAnswerId
sede
CREATE TABLE mountain ( Mountain_ID int, Name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE climber ( Climber_ID int, Name text, Country text, Time text, Points real, Mountain_ID int )
How many climbers are from each country, and sort by the Y in ascending.
SELECT Country, COUNT(*) FROM climber GROUP BY Country ORDER BY COUNT(*)
nvbench
CREATE TABLE table_7216 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the total number of points where there were 3 losses and a played number bigger than 12?
SELECT SUM("Points") FROM table_7216 WHERE "Lost" = '3' AND "Played" > '12'
wikisql
CREATE TABLE table_name_36 ( damage__millions_usd__ VARCHAR, min_press___mbar__ VARCHAR, deaths VARCHAR )
What is the cost of 972 Min Press caused 52 death?
SELECT damage__millions_usd__ FROM table_name_36 WHERE min_press___mbar__ = "972" AND deaths = "52"
sql_create_context
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...
what is marital status and admission type of subject id 15898?
SELECT demographic.marital_status, demographic.admission_type FROM demographic WHERE demographic.subject_id = "15898"
mimicsql_data
CREATE TABLE table_5682 ( "Gauge" text, "Railway" text, "Class" text, "Works no." text, "Year" text, "Builder" text )
Which railway has a class of 250 and year 1936?
SELECT "Railway" FROM table_5682 WHERE "Class" = '250' AND "Year" = '1936'
wikisql
CREATE TABLE table_25800134_2 ( writer_s_ VARCHAR, season__number VARCHAR )
Who are all the writers of episodes in season 24?
SELECT writer_s_ FROM table_25800134_2 WHERE season__number = 24
sql_create_context
CREATE TABLE table_26473176_1 ( series VARCHAR, position VARCHAR )
How many 'series' were in the 12th 'position?
SELECT COUNT(series) FROM table_26473176_1 WHERE position = "12th"
sql_create_context
CREATE TABLE table_26591434_1 ( ratings__kansai_ VARCHAR, original_airdate VARCHAR )
What is the ratings for the original air date may 25, 2010 22.00 - 22.54?
SELECT ratings__kansai_ FROM table_26591434_1 WHERE original_airdate = "May 25, 2010 22.00 - 22.54"
sql_create_context