context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_26218124_1 ( founded VARCHAR, city VARCHAR )
How many clubs were founded in belo horizonte?
SELECT COUNT(founded) FROM table_26218124_1 WHERE city = "Belo Horizonte"
sql_create_context
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 ...
患者85722841被门诊诊断为疾病T18.984,他的免疫球蛋白A(敏感)的结果定量及单位是怎样的
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb...
css
CREATE TABLE competition_result ( competition_id number, club_id_1 number, club_id_2 number, score text ) CREATE TABLE club ( club_id number, name text, region text, start_year text ) CREATE TABLE competition ( competition_id number, year number, competition_type text, ...
What are the different years for all competitions that are not of type equal to tournament?
SELECT DISTINCT year FROM competition WHERE competition_type <> "Tournament"
spider
CREATE TABLE ship ( ship_id number, name text, type text, built_year number, class text, flag text ) CREATE TABLE captain ( captain_id number, name text, ship_id number, age text, class text, rank text )
What is the year in which most ships were built?
SELECT built_year FROM ship GROUP BY built_year ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttim...
has there been any organism found in the last tissue microbiology test of patient 47460 in 08/this year?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 47460) AND microbiologyevents.spec_type_desc = 'tissue' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of year') = DATET...
mimic_iii
CREATE TABLE table_23285805_4 ( game INTEGER, record VARCHAR )
If the record is 5-5, what is the game maximum?
SELECT MAX(game) FROM table_23285805_4 WHERE record = "5-5"
sql_create_context
CREATE TABLE table_31191 ( "Year" text, "Universities" real, "No. of Students Signed up" real, "% electricity reduction" text, "Tonnes of CO2 Saved" real, "\u00a3 Saved" text )
When 10% is the percentage of electricity reduction how many sets of universities are there?
SELECT COUNT("Universities") FROM table_31191 WHERE "% electricity reduction" = '10%'
wikisql
CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE player ( player_id number, player text, years_played text, total_wl text, singles_wl text, doubles_wl text, team number ) CREATE TABLE match_season ( ...
Which players are from Indonesia?
SELECT T2.player FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country WHERE T1.country_name = "Indonesia"
spider
CREATE TABLE table_dev_18 ( "id" int, "bleeding" int, "chronic_anticoagulant_therapy" bool, "renal_disease" bool, "hyperlipidemia" bool, "creatinine_clearance_cl" float, "chronic_hemostasis_disorders" bool, "significant_proteinuria" bool, "platelet_count" float, "total_cholestero...
hyperlipidemia ( total cholesterol > 260 mg / dl, ldl > 130 mg / dl, and / or triglycerides > 300 mg / dl ) despite appropriate treatment.
SELECT * FROM table_dev_18 WHERE hyperlipidemia = 1 OR (total_cholesterol > 260 OR ldl > 130 OR triglyceride_tg > 300)
criteria2sql
CREATE TABLE table_name_37 ( episodes VARCHAR, actor VARCHAR )
How many episodes did the actor David Faustino appear in?
SELECT episodes FROM table_name_37 WHERE actor = "david faustino"
sql_create_context
CREATE TABLE table_11959669_4 ( location_attendance VARCHAR, high_points VARCHAR )
What was the location attendance when High points was by Pierce (22)?
SELECT location_attendance FROM table_11959669_4 WHERE high_points = "Pierce (22)"
sql_create_context
CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id number, reported_by_staff_id number, date_problem_reported time, date_problem_closed time, problem_description text, other_problem_details text ) CREATE TABLE problem_category_codes ( proble...
What are the ids of the problems that are from the product 'voluptatem' and are reported after 1995?
SELECT T1.problem_id FROM problems AS T1 JOIN product AS T2 ON T1.product_id = T2.product_id WHERE T2.product_name = "voluptatem" AND T1.date_problem_reported > "1995"
spider
CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE...
Show the names of all the activities Mark Giuliano participates in.
SELECT T3.activity_name FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T3.actid = T2.actid WHERE T1.fname = "Mark" AND T1.lname = "Giuliano"
spider
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...
how many asian patients were treated with nifedipine cr?
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 = "NIFEdipine CR"
mimicsql_data
CREATE TABLE table_name_25 ( runner_up VARCHAR, year VARCHAR )
who was the runner-up in the 1915 competition for 'Articles with HCards'?
SELECT runner_up FROM table_name_25 WHERE year = 1915
sql_create_context
CREATE TABLE table_name_32 ( cfl_team VARCHAR, player VARCHAR )
What is the CFL Team with Will Grant?
SELECT cfl_team FROM table_name_32 WHERE player = "will grant"
sql_create_context
CREATE TABLE accounts ( custid number, name text ) CREATE TABLE checking ( custid number, balance number ) CREATE TABLE savings ( custid number, balance number )
How many accounts are there in total?
SELECT COUNT(*) FROM accounts
spider
CREATE TABLE zzmzjzjlb ( 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...
患者53796219为疾病L85.935,门诊诊断的D2聚体(柠檬酸盐)的结果定量及其单位数据均为?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jyb...
css
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructo...
In the next semester , what is the total number of classes being offered ?
SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE table_name_36 ( name_in_polish VARCHAR, seat VARCHAR )
Tell me the name in polish for radom seat
SELECT name_in_polish FROM table_name_36 WHERE seat = "radom"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
what is the maximum cost of the hospital which involves aortic valve disorder in 2105?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'aortic valve disorder')) AND STRFTIME('%y', cost.chargetime) = ...
mimic_iii
CREATE TABLE table_name_53 ( away_team VARCHAR )
How much did the away team Geelong score?
SELECT away_team AS score FROM table_name_53 WHERE away_team = "geelong"
sql_create_context
CREATE TABLE table_2428 ( "Period" text, "Births" text, "Deaths" text, "Difference" text, "Crude Birth Rate" real, "Crude Death Rate" real, "Natural Increase" real, "Total Fertility Rate" real, "Infant Mortality Rate" real )
Among deaths 106 000 how many is crude rate.
SELECT "Crude Death Rate" FROM table_2428 WHERE "Deaths" = '106 000'
wikisql
CREATE TABLE student_course_attendance ( student_id VARCHAR )
List the id of students who attended some courses?
SELECT student_id FROM student_course_attendance
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, ...
患者32152549开出的所有检验报告单在2015年3月23日至2021年1月14日内的科室是什么编码还有名称是啥?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb...
css
CREATE TABLE table_13384 ( "2002/ 03" text, "2003/ 04" text, "2004/ 05" text, "2005/ 06" text, "2006/ 07" text, "2007/ 08" text, "2008/ 09" text, "2009/ 10" text, "2010/ 11" text, "2011/ 12" text, "2012/ 13" text )
what is 2006/07 when 2007/08 is nr?
SELECT "2006/ 07" FROM table_13384 WHERE "2007/ 08" = 'nr'
wikisql
CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) CREATE TABLE race ( race_id number, name text, class text, date text, track_id text )
What are the names, classes, and dates for all races?
SELECT name, class, date FROM race
spider
CREATE TABLE table_name_55 ( place VARCHAR, player VARCHAR, score VARCHAR )
Name the place for score of 67-70=137 and stuart appleby
SELECT place FROM table_name_55 WHERE score = 67 - 70 = 137 AND player = "stuart appleby"
sql_create_context
CREATE TABLE table_43365 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
For the teams that had fewer than 4 Losses, and less than 16 Wins, what was the total number of Draws?
SELECT COUNT("Draws") FROM table_43365 WHERE "Losses" < '4' AND "Wins" < '16'
wikisql
CREATE TABLE table_47999 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
Where is the player Raymond Floyd?
SELECT "Place" FROM table_47999 WHERE "Player" = 'raymond floyd'
wikisql
CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE teaches ( id text, course_id text, sec_id text, semester text, year number ) CREATE TABLE instructor ( id text, name text, dept_name text, salary number ) CREATE TABLE classro...
What is the title, credit value, and department name for courses with more than one prerequisite?
SELECT T1.title, T1.credits, T1.dept_name FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY T2.course_id HAVING COUNT(*) > 1
spider
CREATE TABLE table_2668378_18 ( party VARCHAR, incumbent VARCHAR )
What party represents the district with incumbent matthew clay?
SELECT party FROM table_2668378_18 WHERE incumbent = "Matthew Clay"
sql_create_context
CREATE TABLE table_42578 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the Competition with a Result of win with a Score that is 1-0?
SELECT "Competition" FROM table_42578 WHERE "Result" = 'win' AND "Score" = '1-0'
wikisql
CREATE TABLE Order_Items ( item_id INTEGER, order_item_status_code VARCHAR(15), order_id INTEGER, product_id INTEGER, item_status_code VARCHAR(15), item_delivered_datetime DATETIME, item_order_quantity VARCHAR(80) ) CREATE TABLE Mailshot_Customers ( mailshot_id INTEGER, customer_id ...
Show all distinct product categories along with the number of mailshots in each category. Visualize by bar chart.
SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
Which patients have a 2137-06-30 06:04:00 lab test chart time?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2137-06-30 06:04:00"
mimicsql_data
CREATE TABLE table_76246 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
How many rounds have john o'day as the name, and a pick less than 3?
SELECT SUM("Round") FROM table_76246 WHERE "Name" = 'john o''day' AND "Pick" < '3'
wikisql
CREATE TABLE table_75731 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text )
What is the location of the team nicknamed Broncos, which was founded after 1889?
SELECT "Location" FROM table_75731 WHERE "Founded" > '1889' AND "Team Nickname" = 'broncos'
wikisql
CREATE TABLE table_name_3 ( pick INTEGER, team VARCHAR )
What is the lowest number pick from san diego chargers?
SELECT MIN(pick) FROM table_name_3 WHERE team = "san diego chargers"
sql_create_context
CREATE TABLE table_train_75 ( "id" int, "pregnancy_or_lactation" bool, "alzheimer" bool, "alzheimer_family_history" bool, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
parents and siblings of the participant with alzheimer's disease.
SELECT * FROM table_train_75 WHERE alzheimer = 1
criteria2sql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
what was the name of the intake that patient 20713 on the last intensive care unit visit first had?
SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid 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 = 20713) AND NOT icustays.outtime IS N...
mimic_iii
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, ...
患者的检测指标602455在门诊诊断为疾病G21.554的参考值范围下限和上限分别是?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE table_name_68 ( round VARCHAR, player VARCHAR )
Name the Round which has a Player of zack walz?
SELECT round FROM table_name_68 WHERE player = "zack walz"
sql_create_context
CREATE TABLE table_33006 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team scored 12.15 (87)?
SELECT "Home team" FROM table_33006 WHERE "Home team score" = '12.15 (87)'
wikisql
CREATE TABLE table_name_54 ( year VARCHAR, binibining_pilipinas_international VARCHAR )
Which Year has a Binibining Pilipinas International of alma concepcion?
SELECT year FROM table_name_54 WHERE binibining_pilipinas_international = "alma concepcion"
sql_create_context
CREATE TABLE table_204_371 ( id number, "team" text, "competition" text, "category" text, "appearances\nstart" number, "appearances\nsub" number, "goals" number, "team record" text )
in which two competitions did japan lack goals ?
SELECT "competition" FROM table_204_371 WHERE "goals" = 0
squall
CREATE TABLE table_15294 ( "First game" real, "Played" real, "Drawn" real, "Lost" real, "Percentage" text )
what is the highest number of games played when there was 2 losses, percentage was 0.00% and more than 0 draws?
SELECT MAX("Played") FROM table_15294 WHERE "Lost" = '2' AND "Percentage" = '0.00%' AND "Drawn" > '0'
wikisql
CREATE TABLE table_36504 ( "Arabic" text, "English" text, "Maltese" text, "Turkish" text, "Somali" text, "Persian" text, "Urdu" text, "Hindi" text, "Punjabi (India)" text, "Punjabi (Pakistan)" text, "Malayalam" text, "Bangla" text, "Hebrew" text, "Indonesian" text...
What is the Pashto word for the Malayalam word vyazham?
SELECT "Pashto" FROM table_36504 WHERE "Malayalam" = 'വ്യാഴം vyazham'
wikisql
CREATE TABLE table_54352 ( "Round" real, "Pick" real, "Player" text, "Position" text, "Nationality" text, "School/Club Team" text )
What position has round less than 2?
SELECT "Position" FROM table_54352 WHERE "Round" < '2'
wikisql
CREATE TABLE table_name_15 ( surface VARCHAR, date VARCHAR )
what is the surface on july 26, 2010?
SELECT surface FROM table_name_15 WHERE date = "july 26, 2010"
sql_create_context
CREATE TABLE table_72781 ( "Institution" text, "Location" text, "Founded" real, "Affiliation" text, "Enrollment" real, "Team Nickname" text, "Primary conference" text )
What kind of school is Canton, New York?
SELECT "Affiliation" FROM table_72781 WHERE "Location" = 'Canton, New York'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
Among patients with cerebral aneurysm/sda as their primary disease, calculate the total number of those born before the year 2173.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CEREBRAL ANEURYSM/SDA" AND demographic.admityear < "2173"
mimicsql_data
CREATE TABLE table_27747 ( "Team" text, "Manager" text, "Captain" text, "Kit manufacturer" text, "Shirt sponsor" text, "Average Squad Age" text )
What is the average squad age of the team whose shirt sponsor is Sho'rtan Gaz Mahsulot and whose kit manufacturer is Adidas?
SELECT "Average Squad Age" FROM table_27747 WHERE "Shirt sponsor" = 'Sho''rtan Gaz Mahsulot' AND "Kit manufacturer" = 'Adidas'
wikisql
CREATE TABLE competition_record ( Competition_ID int, Farm_ID int, Rank int ) CREATE TABLE farm ( Farm_ID int, Year int, Total_Horses real, Working_Horses real, Total_Cattle real, Oxen real, Bulls real, Cows real, Pigs real, Sheep_and_Goats real ) CREATE TABLE farm_...
A bar chart about what are the statuses and average populations of each city?
SELECT Status, AVG(Population) FROM city GROUP BY Status
nvbench
CREATE TABLE table_17245 ( "Date of Issue" text, "Theme" text, "Denomination" text, "Design" text, "Illustration" text, "Printing Process" text, "Paper Type" text, "First Day Cover Cancellation" text )
Who created the illustration for the stamp that was themed 100 years of scouting?
SELECT "Illustration" FROM table_17245 WHERE "Theme" = '100 Years of Scouting'
wikisql
CREATE TABLE table_1601027_2 ( headphone_class VARCHAR, headphone_model VARCHAR )
Name the number of headphone class for sr100
SELECT COUNT(headphone_class) FROM table_1601027_2 WHERE headphone_model = "SR100"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
A bar chart shows the distribution of Team_Name and ACC_Percent , display in asc by the y-axis please.
SELECT Team_Name, ACC_Percent FROM basketball_match ORDER BY ACC_Percent
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( ...
calculate the total volume of urine out foley patient 76327 was producing in the previous day.
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 76327)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'uri...
mimic_iii
CREATE TABLE table_38006 ( "Unit" text, "Russian" text, "Ratio" text, "Metric value" text, "Avoirdupois value" text )
What Russian has an Avoirdupois value of 0.686 gr?
SELECT "Russian" FROM table_38006 WHERE "Avoirdupois value" = '0.686 gr'
wikisql
CREATE TABLE Marketing_Regions ( Marketing_Region_Code CHAR(15), Marketing_Region_Name VARCHAR(255), Marketing_Region_Descriptrion VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Ref_Service_Types ( Service_Type_Code CHAR(15), Parent_Service_Type_Code CHAR(15), Service_Type_Descript...
A bar chart for finding the number of the order dates of the orders with price above 1000.
SELECT Order_Date, COUNT(Order_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_Price > 1000
nvbench
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 prescription...
count the number of patients whose gender is m and procedure long title is transfusion of packed cells?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.long_title = "Transfusion of packed cells"
mimicsql_data
CREATE TABLE table_name_24 ( tv_time VARCHAR, date VARCHAR )
What was the tv time on december 6, 1998?
SELECT tv_time FROM table_name_24 WHERE date = "december 6, 1998"
sql_create_context
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 airline ( airline_code varchar, airline_name text, note text ) CREATE ...
find me the earliest flight from BOSTON to DENVER that serves BREAKFAST
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, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_se...
atis
CREATE TABLE zzmzjzjlb ( 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...
从零一年二月十一日到零七年四月二十六日的这段时间里,医生55870374的门诊就诊数量是多少
SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.ZZYSGH = '55870374' AND zzmzjzjlb.JZKSRQ BETWEEN '2001-02-11' AND '2007-04-26' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.ZZYSGH = '55870374' AND fzzmzjzjlb.JZKSRQ BETWEEN '2001-02-11' AND '2007-04-26'
css
CREATE TABLE table_23801721_1 ( rank INTEGER, technology VARCHAR )
What was the rank of operator whose technology is CDMA EVDO?
SELECT MIN(rank) FROM table_23801721_1 WHERE technology = "CDMA EVDO"
sql_create_context
CREATE TABLE table_204_683 ( id number, "no." number, "constituency" text, "winner candidate" text, "party" text, "votes" number, "margin" number )
how many votes did deodar receive ?
SELECT "votes" FROM table_204_683 WHERE "constituency" = 'deodar'
squall
CREATE TABLE people ( first_name VARCHAR )
List the first names of people in alphabetical order?
SELECT first_name FROM people ORDER BY first_name
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 outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
did there was an organism in patient 97677's last serology/blood test?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97677) AND microbiologyevents.spec_type_desc = 'serology/blood' AND NOT microbiologyevents.org_name IS NULL ORDER BY microbiologyevents.charttime DESC LIMIT 1
mimic_iii
CREATE TABLE table_36011 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many Gold medals does the country with 2 Silver and more than 2 Bronze have?
SELECT COUNT("Gold") FROM table_36011 WHERE "Silver" = '2' AND "Bronze" > '2'
wikisql
CREATE TABLE table_204_177 ( id number, "player" text, "years played" text, "total w-l" text, "singles w-l" text, "doubles w-l" text )
who had a better singles record , boo kil or seung bok ?
SELECT "player" FROM table_204_177 WHERE "player" IN ('choi boo-kil', 'baek seung-bok') ORDER BY "singles w-l" DESC LIMIT 1
squall
CREATE TABLE table_name_36 ( erp_w INTEGER, call_sign VARCHAR )
Name the average ERP W and call sign of w237br
SELECT AVG(erp_w) FROM table_name_36 WHERE call_sign = "w237br"
sql_create_context
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student ( student_id int, lastname varchar, ...
After 17:00 A.M. next Spring what upper level electives are available ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.start_time > '17:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester...
advising
CREATE TABLE table_78944 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
How many Drawn have a Lost smaller than 25, and a Goal Difference of +7, and a Played larger than 34?
SELECT COUNT("Drawn") FROM table_78944 WHERE "Lost" < '25' AND "Goal Difference" = '+7' AND "Played" > '34'
wikisql
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, ...
give me the number of patients whose religion is catholic and item id is 51067?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CATHOLIC" AND lab.itemid = "51067"
mimicsql_data
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 diagnoses ( ...
How many male patients are with medicaid insurance?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.insurance = "Medicaid"
mimicsql_data
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
how many hours is it since the first time patient 022-187132 had a d5w intake on the current icu visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE table_67017 ( "Rank" text, "Games" text, "Player" text, "Club" text, "Career span" text )
What is the name of the club with a rank of 5?
SELECT "Club" FROM table_67017 WHERE "Rank" = '5'
wikisql
CREATE TABLE table_14203 ( "Team 1" text, "Score" text, "Team 2" text, "1st round" text, "2nd round" text )
who is team 1 when team 2 is usl dunkerque (d2)?
SELECT "Team 1" FROM table_14203 WHERE "Team 2" = 'usl dunkerque (d2)'
wikisql
CREATE TABLE table_23399481_4 ( title VARCHAR, us_viewers__in_millions_ VARCHAR )
What is the name of the episodes which had 1.22 million U.S. viewers?
SELECT title FROM table_23399481_4 WHERE us_viewers__in_millions_ = "1.22"
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, ...
在99850400907的医疗就诊中,患者入院时诊断的是哪种疾病,把疾病的编号也找出来
SELECT t_kc21.IN_DIAG_DIS_CD, t_kc21.IN_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '99850400907'
css
CREATE TABLE table_1360997_2 ( result VARCHAR, race VARCHAR )
How many results were there for the Stan Fox Stakes race?
SELECT COUNT(result) FROM table_1360997_2 WHERE race = "Stan Fox Stakes"
sql_create_context
CREATE TABLE table_name_57 ( xii_season VARCHAR, episode VARCHAR )
What is XII Season, when Episode is 6?
SELECT xii_season FROM table_name_57 WHERE episode = "6"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
患者的门诊诊断为疾病E91.673的苯妥因的参考值范围下限是什么?上限是什么?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'E91.673' AND jyjgzbb.JCZBMC = '苯妥因' UNION SELECT jyjgzbb.CKZFWXX...
css
CREATE TABLE table_name_48 ( runners_up VARCHAR, winners VARCHAR, date VARCHAR )
Who were the runners-up in the game that was won by Cork City F.C. on 10/05/1998?
SELECT runners_up FROM table_name_48 WHERE winners = "cork city f.c." AND date = "10/05/1998"
sql_create_context
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...
Give me the comparison about the sum of meter_100 over the meter_200 , and group by attribute meter_200 by a bar chart.
SELECT meter_200, SUM(meter_100) FROM swimmer GROUP BY meter_200
nvbench
CREATE TABLE table_47272 ( "Player" text, "Position" text, "Round" real, "Pick" real, "NFL Club" text )
What is the highest pick of the houston oilers NFL club, which has a round greater than 10?
SELECT MAX("Pick") FROM table_47272 WHERE "NFL Club" = 'houston oilers' AND "Round" > '10'
wikisql
CREATE TABLE tip ( tip_id int, business_id varchar, text longtext, user_id varchar, likes int, year int, month varchar ) CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE neighborhood ( id int, business_id varchar, neighborhoo...
List all the neighborhoods with Italian restaurant in Madison
SELECT neighborhood.neighborhood_name FROM business, category AS CATEGORY_0, category AS CATEGORY_1, neighborhood WHERE business.city = 'Madison' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'Italian' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'r...
yelp
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, ...
有哪些医院给患者章俊材开过药品518833181-4
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '章俊材' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_CD = '518833181-4')
css
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患者李妮娜的α-羟丁酸脱氢酶情况在14年5月27日到2021年4月18日这段时间内怎么样?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info.XM = '李妮娜'...
css
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, ...
there is a microbiological test result for patient 74392's urine until 107 months ago?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74392) AND microbiologyevents.spec_type_desc = 'urine' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-107 month')
mimic_iii
CREATE TABLE table_31461 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many entries are there for high rebounds when high points is inge 19?
SELECT COUNT("High rebounds") FROM table_31461 WHERE "High points" = 'Inge – 19'
wikisql
CREATE TABLE table_58623 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What is Date, when Outcome is 'Runner Up', and when Opponent is 'Lu Jiaxiang'?
SELECT "Date" FROM table_58623 WHERE "Outcome" = 'runner up' AND "Opponent" = 'lu jiaxiang'
wikisql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name te...
Top 100 users ordered by earned bounties.
SELECT ROW_NUMBER() OVER (ORDER BY SUM(Votes.BountyAmount) DESC, Users.Id) AS rnSum, ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC, Users.Id) AS rnCount, Users.Id AS "user_link", Users.Reputation, SUM(Votes.BountyAmount) AS BountyEarnedTotal, COUNT(*) AS BountyEarnedCount FROM Votes INNER JOIN Posts ON Posts.Id = Votes.Pos...
sede
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, what is the relationship between manufacturer and code , and group by attribute headquarter?
SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter
nvbench
CREATE TABLE table_55147 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What's the catalog number for a December 11, 2007 record from columbia formatted in a that's from Canada?
SELECT "Catalog" FROM table_55147 WHERE "Label" = 'columbia' AND "Date" = 'december 11, 2007' AND "Region" = 'canada'
wikisql
CREATE TABLE table_4809 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many games feature hawthorn as the away squad?
SELECT COUNT("Crowd") FROM table_4809 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE table_22167 ( "Satellite" text, "COSPAR ID" text, "SATCAT No." real, "Product Number" real, "Launch Date" text, "Estimated End Date[ clarification needed ]" text, "Estimated Operational Life" text )
What it the international designation for the kosmos 2379 satellite?
SELECT "COSPAR ID" FROM table_22167 WHERE "Satellite" = 'Kosmos 2379'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE procedures_icd ( row_id number, su...
how many patients until 2101 were prescribed heparin within the same month after diagnosis of hyperparathyroidism nos?
SELECT COUNT(DISTINCT t1.subject_id) 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 d_icd_diagnoses.short_title = 'hyperparathyroidis...
mimic_iii
CREATE TABLE table_28677723_10 ( christer_tornell INTEGER, karianne_gulliksen VARCHAR )
What is listed under chister tornell when karianne gulliksen is 7?
SELECT MIN(christer_tornell) FROM table_28677723_10 WHERE karianne_gulliksen = 7
sql_create_context
CREATE TABLE table_name_6 ( enrollment INTEGER, institution VARCHAR, founded VARCHAR )
What is the Enrollment at Whitman College Founded after 1859?
SELECT AVG(enrollment) FROM table_name_6 WHERE institution = "whitman college" AND founded > 1859
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Migrations causing untagged questions, networkwide.
SELECT COUNT(*) FROM PostHistory AS hit INNER JOIN PostHistory AS hmig ON hit.PostId = hmig.PostId WHERE hit.PostHistoryTypeId = 3 AND hit.Text = '<untagged>' AND hmig.PostHistoryTypeId = 36
sede