context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_78484 ( "Driver" text, "Constructor" text, "Laps" text, "Time/Retired" text, "Grid" text )
What's the time/retired for constructor source:?
SELECT "Time/Retired" FROM table_78484 WHERE "Constructor" = 'source:'
wikisql
CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station_id INTEGER, bike_id INTEGER, subscription_type TEXT, zip_code INTEGER ) CREATE TABLE station ( id INTEG...
Please show the trend about the number of days with max temperature reaches 80 change over dates, display x axis from low to high order.
SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date
nvbench
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...
give the number of patients whose admission location is trsf within this facility and procedure icd9 code is 8847.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND procedures.icd9_code = "8847"
mimicsql_data
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, ...
How do I query SEDE for user names with ZALGO Unicode abuse?. http://meta.stackexchange.com/questions/276551/how-do-i-query-sede-for-user-names-with-zalgo-unicode-abuse/277871#277871
SELECT Id, CAST(DisplayName AS TEXT(150)) COLLATE Latin1_General_BIN FROM Users WHERE NOT LOWER(SUBSTRING(DisplayName, 1, 1)) IN ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0')
sede
CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE train ( Train_ID int, Name text, Time text, Service text ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, ...
Give me a bar chart about the average of number_of_platforms in different locations, and rank X from low to high order.
SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location ORDER BY Location
nvbench
CREATE TABLE wdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZD...
在2007-08-06到2021-12-19期间内,患者70148968被开出的所有检验报告单中的标本采集部位需要列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '70148968' AND jybgb.BGRQ BETWEEN '2007-08-06' AND '2021-12-19' UNI...
css
CREATE TABLE table_name_87 ( home_team VARCHAR, venue VARCHAR )
What is the home team for the Princes Park venue?
SELECT home_team FROM table_name_87 WHERE venue = "princes park"
sql_create_context
CREATE TABLE table_name_34 ( starts INTEGER, wins VARCHAR, position VARCHAR )
What is the average start with wins larger than 0 and 32nd position?
SELECT AVG(starts) FROM table_name_34 WHERE wins > 0 AND position = "32nd"
sql_create_context
CREATE TABLE table_5458 ( "s Car plate (starting 1937)" text, "Voivodeship or city" text, "Capital" text, "Area (1930) in 1,000skm 2" text, "Population (1931) in 1,000s" text )
Area (1930) in 1,000skm 2 of 31.7 has what capital?
SELECT "Capital" FROM table_5458 WHERE "Area (1930) in 1,000skm 2" = '31.7'
wikisql
CREATE TABLE store_district ( Store_ID int, District_ID int ) CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE product ( product_id int, product text, dimensions text, dpi real, pages_per_minute_color real, max_page_size text, interface text ) CREAT...
Find the number of stores in each city. Plot them as bar chart.
SELECT Headquartered_City, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.Store_ID = t2.Store_ID JOIN district AS t3 ON t2.District_ID = t3.District_ID GROUP BY t3.Headquartered_City
nvbench
CREATE TABLE table_24578 ( "Round #" real, "Pick #" real, "Player" text, "Position" text, "Nationality" text, "College/junior/club team" text )
Which player belongs to deerfield academy (Massachusetts) college/junior/club team?
SELECT "Player" FROM table_24578 WHERE "College/junior/club team" = 'Deerfield Academy (Massachusetts)'
wikisql
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 varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
How many classes of MKT are offered for the next semester ?
SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MKT' AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE phone ( Company_name VARCHAR )
How many phone hardware models are produced by the company named 'Nokia Corporation'?
SELECT COUNT(*) FROM phone WHERE Company_name = "Nokia Corporation"
sql_create_context
CREATE TABLE table_300283_1 ( official_name VARCHAR, name_in_basque VARCHAR )
What is the official name of the municipality whose name in Basque is Bilar?
SELECT official_name FROM table_300283_1 WHERE name_in_basque = "Bilar"
sql_create_context
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, sh...
when in 2103 patient 3516 received for the first time a procedure?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3516) AND STRFTIME('%y', procedures_icd.charttime) = '2103' ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE table_8049 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Crowd" real, "Box Score" text, "Report" text )
What did the Melbourne Tigers score when they were the away team?
SELECT "Score" FROM table_8049 WHERE "Away team" = 'melbourne tigers'
wikisql
CREATE TABLE table_name_25 ( mascot VARCHAR, location VARCHAR )
What is the Mascot of Brook?
SELECT mascot FROM table_name_25 WHERE location = "brook"
sql_create_context
CREATE TABLE table_26672 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real, "Left" real )
In what year did the teams leave the conference?
SELECT MAX("Left") FROM table_26672
wikisql
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text ) CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text )
A bar chart for returning the number of the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones.
SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones"
nvbench
CREATE TABLE table_name_59 ( time VARCHAR, grid VARCHAR )
Which Time has a Grid of 19?
SELECT time FROM table_name_59 WHERE grid = 19
sql_create_context
CREATE TABLE table_name_74 ( attack VARCHAR, gerb VARCHAR )
What Attack has a 30,00% GERB?
SELECT attack FROM table_name_74 WHERE gerb = "30,00%"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
whats the first value of calculated total co2 in 03/this year for patient 21468?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21468) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'calculated total co2') AND DATETIME(labevents.charttime, 'start of year') = DATE...
mimic_iii
CREATE TABLE table_203_3 ( id number, "province" text, "capital" text, "population" number, "density" text, "municipalities" text, "legal districts" number )
which province in andalusia has the highest density ?
SELECT "province" FROM table_203_3 ORDER BY "density" DESC LIMIT 1
squall
CREATE TABLE table_54803 ( "1961 Democratic primary" text, "Manhattan" text, "The Bronx" text, "Brooklyn" text, "Queens" text, "Richmond [Staten Is.]" text, "Total" real )
Who got 189,524 votes?
SELECT "Queens" FROM table_54803 WHERE "Manhattan" = '189,524'
wikisql
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, I want to show from low to high by the y axis.
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(SALARY)
nvbench
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
Draw a bar chart about the distribution of meter_200 and the sum of ID , and group by attribute meter_200, rank in descending by the y axis.
SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY SUM(ID) DESC
nvbench
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
what's the last time patient 027-100528 has had a procedure since 2104?
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 = '027-100528')) AND STRFTIME('%y', treatment.treatmenttime) >= '210...
eicu
CREATE TABLE table_51145 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" real )
what is the goal difference when drawn is more than 11, goals against is less than 63, goals for is less than 87 and lost is more than 16?
SELECT "Goal Difference" FROM table_51145 WHERE "Drawn" > '11' AND "Goals Against" < '63' AND "Goals For" < '87' AND "Lost" > '16'
wikisql
CREATE TABLE table_57960 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalogue" text )
Which region was on June 8, 2004?
SELECT "Region" FROM table_57960 WHERE "Date" = 'june 8, 2004'
wikisql
CREATE TABLE table_38260 ( "Elementary Schools" text, "Mascot" text, "Address" text, "Principal (2013-2014)" text, "Assistant Principal (2013-2014)" text )
What was the mascot for the 2013-2014 principal named Frank Hendricsen?
SELECT "Mascot" FROM table_38260 WHERE "Principal (2013-2014)" = 'frank hendricsen'
wikisql
CREATE TABLE table_name_7 ( score VARCHAR, place VARCHAR, player VARCHAR )
What score did Ed Furgol get to come in at T6?
SELECT score FROM table_name_7 WHERE place = "t6" AND player = "ed furgol"
sql_create_context
CREATE TABLE table_30951 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text )
When was the home team Essendon?
SELECT "Date" FROM table_30951 WHERE "Home team" = 'Essendon'
wikisql
CREATE TABLE table_3628 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
What is the result in the virginia 11 district?
SELECT "Result" FROM table_3628 WHERE "District" = 'Virginia 11'
wikisql
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...
Draw a bar chart about the distribution of All_Neutral and School_ID , and list from high to low by the X.
SELECT All_Neutral, School_ID FROM basketball_match ORDER BY All_Neutral DESC
nvbench
CREATE TABLE table_22941863_19 ( team_classification VARCHAR, stage VARCHAR )
If the stage is 9, what is the team classification name?
SELECT team_classification FROM table_22941863_19 WHERE stage = 9
sql_create_context
CREATE TABLE table_35589 ( "Year" text, "Winners" text, "Score" text, "Runner-up" text, "Venue" text )
What is the score of the match with UTC as the runner-up and Saint-Gaudens Bears as the winners?
SELECT "Score" FROM table_35589 WHERE "Runner-up" = 'utc' AND "Winners" = 'saint-gaudens bears'
wikisql
CREATE TABLE table_1965650_8 ( nhl_team VARCHAR, player VARCHAR )
What NHL team does Denis Desgagnes play for?
SELECT nhl_team FROM table_1965650_8 WHERE player = "Denis Desgagnes"
sql_create_context
CREATE TABLE table_10149 ( "Player" text, "Span" text, "Start" real, "Tries" real, "Conv" real, "Pens" real, "Drop" real )
Which player had more than 1 try, 0 drops over a span on 1992-2000?
SELECT "Player" FROM table_10149 WHERE "Tries" > '1' AND "Drop" = '0' AND "Span" = '1992-2000'
wikisql
CREATE TABLE table_37265 ( "School" text, "Location" text, "Mascot" text, "# / County" text, "Year joined" real, "Previous conference" text, "Year left" real, "New conference" text )
What year did Culver leave?
SELECT SUM("Year left") FROM table_37265 WHERE "Location" = 'culver'
wikisql
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...
医疗记录中年龄没超过21岁的患者的医疗费平均金额是多少
SELECT AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE <= 21)
css
CREATE TABLE table_10351 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the highest crowd at windy hill?
SELECT MAX("Crowd") FROM table_10351 WHERE "Venue" = 'windy hill'
wikisql
CREATE TABLE table_train_55 ( "id" int, "ejection_fraction_ef" int, "systolic_dysfunction" bool, "language" string, "valvular_dysfunction" bool, "consent" bool, "heart_disease" bool, "left_bundle_branch_block" bool, "trauma" bool, "pericardial_disease" bool, "complete_fluid_c...
failure to complete fluid challenge
SELECT * FROM table_train_55 WHERE complete_fluid_challenge = 0
criteria2sql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
provide the number of patients whose diagnoses icd9 code is v4581 and drug route is ed?
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.icd9_code = "V4581" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_204_209 ( id number, "released" text, "title" text, "label" text, "number" text, "notes" text )
avalon was released in the same month as which other record ?
SELECT "title" FROM table_204_209 WHERE "title" <> 'avalon' AND "released" = (SELECT "released" FROM table_204_209 WHERE "title" = 'avalon')
squall
CREATE TABLE table_name_33 ( flagship VARCHAR, host_s_ VARCHAR )
What is the Flagship of the Show Hosted by Rover (Shane French)?
SELECT flagship FROM table_name_33 WHERE host_s_ = "rover (shane french)"
sql_create_context
CREATE TABLE table_name_67 ( premier VARCHAR, second VARCHAR )
What is the total number of Premier, when Second is '55'?
SELECT COUNT(premier) FROM table_name_67 WHERE second = 55
sql_create_context
CREATE TABLE Addresses ( Address_ID INTEGER, address_details VARCHAR(255) ) CREATE TABLE Assets_in_Events ( Asset_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Parties_in_Events ( Party_ID INTEGER, Event_ID INTEGER, Role_Code CHAR(15) ) CREATE TABLE Finances ( Finance_ID INTEGER, Ot...
Show the names of products and the number of events they are in, sorted by the number of events in descending order by a bar chart.
SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC
nvbench
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 ethnicity is asian and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "ASIAN" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_1691800_2 ( income_class VARCHAR, area__km²_ VARCHAR )
what is the income class for area 75?
SELECT income_class FROM table_1691800_2 WHERE area__km²_ = 75
sql_create_context
CREATE TABLE table_name_41 ( ties VARCHAR, season VARCHAR, losses VARCHAR, wins VARCHAR, games VARCHAR )
How many Ties have Wins smaller than 1, and Games of 6, and Losses of 6, and a Season larger than 1941?
SELECT COUNT(ties) FROM table_name_41 WHERE wins < 1 AND games = 6 AND losses = 6 AND season > 1941
sql_create_context
CREATE TABLE table_name_56 ( year INTEGER, role VARCHAR, director VARCHAR )
What year was the role nan taylor, alias of nan ellis, aka mrs. andrews and directed by William keighley?
SELECT SUM(year) FROM table_name_56 WHERE role = "nan taylor, alias of nan ellis, aka mrs. andrews" AND director = "william keighley"
sql_create_context
CREATE TABLE location ( restaurant_id int, house_number int, street_name varchar, city_name varchar ) CREATE TABLE restaurant ( id int, name varchar, food_type varchar, city_name varchar, rating "decimal ) CREATE TABLE geographic ( city_name varchar, county varchar, reg...
give me some restaurants good for french food in the yosemite and mono lake area ?
SELECT location.house_number, restaurant.name FROM geographic, location, restaurant WHERE geographic.region = 'yosemite and mono lake area' AND restaurant.city_name = geographic.city_name AND restaurant.food_type = 'french' AND restaurant.id = location.restaurant_id AND restaurant.rating > 2.5
restaurants
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, ...
从12年9月21日至17年9月17日之间因骨伤的住院量是多少?
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.JZKSMC = '创伤骨科' AND wdmzjzjlb.RYDJSJ BETWEEN '2012-09-21' AND '2017-09-17' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.JZKSMC = '创伤骨科' AND bdmzjzjlb.RYDJSJ BETWEEN '2012-09-21' AND '2017-09-17'
css
CREATE TABLE table_2640 ( "Party Name" text, "States contested" real, "Seats contested" real, "Seats won" real, "No. of Votes" real, "% of Votes" text, "% in Seats contested" text, "Forfeited in seats" real )
What is the lowest number of states contested under apna dal?
SELECT MIN("States contested") FROM table_2640 WHERE "Party Name" = 'Apna Dal'
wikisql
CREATE TABLE table_name_71 ( date VARCHAR, result VARCHAR )
When was the result l 14 24?
SELECT date FROM table_name_71 WHERE result = "l 14–24"
sql_create_context
CREATE TABLE table_52069 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Tell me the lowest Grid for engine and driver of emerson fittipaldi with more laps than 70
SELECT MIN("Grid") FROM table_52069 WHERE "Time/Retired" = 'engine' AND "Driver" = 'emerson fittipaldi' AND "Laps" > '70'
wikisql
CREATE TABLE table_26996293_7 ( pick__number VARCHAR, cfl_team VARCHAR )
What is the pick # of cfl team bc lions (7)
SELECT pick__number FROM table_26996293_7 WHERE cfl_team = "BC Lions (7)"
sql_create_context
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CRE...
since 2105, had lisinopril 10 mg po tabs ever been prescribed to patient 006-99708?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-99708')) AND medication.drugname = 'lisinopril 10 mg po tabs' AND STRF...
eicu
CREATE TABLE table_58574 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which game number did they play the Chicago team?
SELECT "Game" FROM table_58574 WHERE "Team" = 'chicago'
wikisql
CREATE TABLE table_203_127 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text )
games above 30,000 in attendance
SELECT COUNT(*) FROM table_203_127 WHERE "attendance" > 30000
squall
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, ...
For the top 3 days with the largest max gust speeds, just show the average temperature and mean humidity using a scatter chart.
SELECT mean_temperature_f, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3
nvbench
CREATE TABLE table_name_43 ( builder VARCHAR, pennant_number VARCHAR )
Who is the builder of Pennant d03?
SELECT builder FROM table_name_43 WHERE pennant_number = "d03"
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, ...
provide the number of patients whose diagnoses icd9 code is 30390 and lab test category is blood gas?
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.icd9_code = "30390" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_53839 ( "Year" real, "Class" text, "Tyres" text, "Team" text, "Co-Drivers" text, "Laps" real, "Pos." text, "Class Pos." text )
Which tyre was before 1995 with 142 laps?
SELECT "Tyres" FROM table_53839 WHERE "Year" < '1995' AND "Laps" = '142'
wikisql
CREATE TABLE table_34260 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real )
What are the lowest wins for Australia?
SELECT MIN("Wins") FROM table_34260 WHERE "Country" = 'australia'
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...
22021171患者被门诊诊断为混合性焦虑障碍,查看他的检测指标074536的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is minimum age of patients whose days of hospital stay is 20 and year of death is less than 2164?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "20" AND demographic.dod_year < "2164.0"
mimicsql_data
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
Which Intermediate Quechua , courses will satisfy the MDE requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Intermediate Quechua ,%' OR course.description LIKE '%Intermediate Quechua ,%' OR course.name LI...
advising
CREATE TABLE table_1341973_6 ( result VARCHAR, incumbent VARCHAR )
What was the result of the election of the incumbent clyde doyle?
SELECT result FROM table_1341973_6 WHERE incumbent = "Clyde Doyle"
sql_create_context
CREATE TABLE table_203_805 ( id number, "year" number, "player" text, "position" text, "high school" text, "college" text )
which college was the most attended by players ?
SELECT "college" FROM table_203_805 GROUP BY "college" ORDER BY COUNT("player") DESC LIMIT 1
squall
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在02年7月13日到2009年11月4日内名叫戚雅娴的病人所有检验结果指标记录中的仪器编号以及名称分别都是啥?
SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybg...
css
CREATE TABLE table_name_63 ( venue VARCHAR, notes VARCHAR )
What venue featured a notes of 2:38:44?
SELECT venue FROM table_name_63 WHERE notes = "2:38:44"
sql_create_context
CREATE TABLE publication ( Publisher VARCHAR, Price VARCHAR )
List the publisher of the publication with the highest price.
SELECT Publisher FROM publication ORDER BY Price DESC LIMIT 1
sql_create_context
CREATE TABLE table_41598 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real )
What was the total number of matches for Nat Lofthouse, ranking higher than 7?
SELECT COUNT("Matches") FROM table_41598 WHERE "Name" = 'nat lofthouse' AND "Rank" > '7'
wikisql
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varc...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of department_id over the job_id , and group by attribute job_id, and I want to sort in asc by the JOB_ID.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_53260 ( "Rank" real, "Previous Rank" text, "Name" text, "Nationality" text, "Team" text, "Points" real )
I want to know the sum of points with a previous rank of 3
SELECT SUM("Points") FROM table_53260 WHERE "Previous Rank" = '3'
wikisql
CREATE TABLE table_name_92 ( villages INTEGER, hanzi VARCHAR, population VARCHAR )
Which town has the most villages with the hanzi and a population larger than 24,802?
SELECT MAX(villages) FROM table_name_92 WHERE hanzi = "南流乡" AND population > 24 OFFSET 802
sql_create_context
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
Show me about the distribution of Sex and the sum of Weight , and group by attribute Sex in a bar chart, and sort X in asc order please.
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) 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_procedures ( ...
count how many times did patient 95057 go to hospital since 2105.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 95057 AND STRFTIME('%y', admissions.admittime) >= '2105'
mimic_iii
CREATE TABLE table_56734 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the high rebounds on February 24?
SELECT "High rebounds" FROM table_56734 WHERE "Date" = 'february 24'
wikisql
CREATE TABLE txmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
患者36091672号从02年2月9日到05年3月12日这段时间去过多少次医院就诊?
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 = '36091672' AND txmzjzjlb.JZKSRQ BETWEEN '2002-02-09' AND '2005-03-12' UNION SELECT COUNT(*) FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjz...
css
CREATE TABLE table_28245 ( "Metropolitan ring" text, "Localities" real, "Total" real, "Jews and others 1" real, "Thereof: Jews" real, "Arabs" real, "Population density (per km\u00b2)" text, "Annual Population growth rate" text )
How many time is the population density (per km ) is 2.5?
SELECT COUNT("Localities") FROM table_28245 WHERE "Population density (per km\u00b2)" = '2.5'
wikisql
CREATE TABLE table_name_59 ( drawn INTEGER, lost VARCHAR, points VARCHAR )
How many total drawn has less than 4 lost and 8 points?
SELECT SUM(drawn) FROM table_name_59 WHERE lost < 4 AND points = 8
sql_create_context
CREATE TABLE table_21601 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What game was the record 2-3?
SELECT COUNT("Game") FROM table_21601 WHERE "Record" = '2-3'
wikisql
CREATE TABLE table_3423 ( "Player" text, "G" real, "Solo TK" real, "Asst. TK" real, "Total TK" real, "Sack" text, "YdL" real, "INT" real, "Yards" real, "ForFum" real, "FumRec" real, "TD" real )
If the player is Reed Doughty, what isthe fumrec?
SELECT "FumRec" FROM table_3423 WHERE "Player" = 'Reed Doughty'
wikisql
CREATE TABLE table_56659 ( "Tournament" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Which tournament was on 2009 with 11?
SELECT "Tournament" FROM table_56659 WHERE "2009" = '11'
wikisql
CREATE TABLE Grants ( grant_id INTEGER, organisation_id INTEGER, grant_amount DECIMAL(19,4), grant_start_date DATETIME, grant_end_date DATETIME, other_details VARCHAR(255) ) CREATE TABLE Staff_Roles ( role_code VARCHAR(10), role_description VARCHAR(255) ) CREATE TABLE Organisations ( ...
Give me the trend about the date_to attributes of all researchers, and bin the date_to into Year interval.
SELECT date_to, COUNT(date_to) FROM Project_Staff
nvbench
CREATE TABLE table_12043148_2 ( premier_two VARCHAR, gloucestershire VARCHAR )
who many times is gloucestershire is painswick?
SELECT COUNT(premier_two) FROM table_12043148_2 WHERE gloucestershire = "Painswick"
sql_create_context
CREATE TABLE table_name_30 ( away_team VARCHAR, home_team VARCHAR )
What is Away Team, when Home Team is 'Boston United'?
SELECT away_team FROM table_name_30 WHERE home_team = "boston united"
sql_create_context
CREATE TABLE table_name_7 ( construct__tion_no INTEGER, wheel_arrange__ment VARCHAR )
How many constructions has a Wheel arrange- ment of 4-4-0?
SELECT SUM(construct__tion_no) FROM table_name_7 WHERE wheel_arrange__ment = "4-4-0"
sql_create_context
CREATE TABLE table_name_25 ( left_office VARCHAR, took_office VARCHAR )
What is Left Office, when Took Office is 1998?
SELECT left_office FROM table_name_25 WHERE took_office = "1998"
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...
医疗记录中的医院9572624在出院诊断出牙齿楔状缺损的花费的最少和最多医务费总额大概有多少?
SELECT MIN(MED_AMOUT), MAX(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '9572624' AND OUT_DIAG_DIS_NM = '牙齿楔状缺损')
css
CREATE TABLE table_name_34 ( average VARCHAR, balls_faced VARCHAR, innings VARCHAR )
What is the number of averages having a balls faced over 297 and more than 7 innings?
SELECT COUNT(average) FROM table_name_34 WHERE balls_faced > 297 AND innings > 7
sql_create_context
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text )
Show the title and the lowest rating among all movies in a pie chart.
SELECT title, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title
nvbench
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid...
tell me the number of times a fasciotomy procedure was done during the previous year?
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'fasciotomy' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
eicu
CREATE TABLE table_61314 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What was Adam Scott's total score when playing in Australia with a to par of e?
SELECT SUM("Score") FROM table_61314 WHERE "Country" = 'australia' AND "To par" = 'e' AND "Player" = 'adam scott'
wikisql
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, ...
Post Links by PostId descending.
SELECT PostId, RelatedPostId FROM PostLinks WHERE LinkTypeId = 1 ORDER BY PostId DESC
sede
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
医院5826228全部医疗记录中根据不同的科室名和不同的入院诊断病名算算看患者平均年纪是多少
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5826228' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '58262...
css
CREATE TABLE lives_in ( stuid number, dormid number, room_number number ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text )...
What amenities does Smith Hall have in alphabetical order?
SELECT T3.amenity_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T1.dorm_name = 'Smith Hall' ORDER BY T3.amenity_name
spider
CREATE TABLE table_203_531 ( id number, "date" text, "tournament" text, "location" text, "winner" text, "score" text, "1st prize ($)" number )
which pga tour event gave out the least prize money to its 1st place finisher ?
SELECT "tournament" FROM table_203_531 ORDER BY "1st prize ($)" LIMIT 1
squall