context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_22796 ( "Match no." real, "Match Type" text, "Team Europe" text, "Score" text, "Team USA" text, "Progressive Total" text )
When tim mack is on team usa what is the progressive total?
SELECT "Progressive Total" FROM table_22796 WHERE "Team USA" = 'Tim Mack'
wikisql
CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in DATETIME, date_moved_out DATETIME, other_details VARCHAR(255) ) CREATE TABLE Customer_Events ( Customer_Event_ID INTEGER, customer_id INTEGER, date_moved_in DATETIME, property_id INTEGER, resident_i...
Show the number of type of thing code from each type of thing code, and I want to rank Y-axis in asc order please.
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things GROUP BY Type_of_Thing_Code ORDER BY COUNT(Type_of_Thing_Code)
nvbench
CREATE TABLE table_42551 ( "Time" text, "06:00 PM" text, "07:00 PM" text, "08:00 PM" text, "09:00 PM" text, "10:00 PM" text, "10:30 PM" text, "11:00 PM" text )
What is the 08:00 PM when the 07:00 PM is I am siam (rerun)?
SELECT "08:00 PM" FROM table_42551 WHERE "07:00 PM" = 'i am siam (rerun)'
wikisql
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE jou...
Which papers cite Daniel Jurafsky ?
SELECT DISTINCT paper.paperid FROM author, cite, paper, writes WHERE author.authorname = 'Daniel Jurafsky' AND paper.paperid = cite.citingpaperid AND writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid
scholar
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
i need a return flight from DENVER to ATLANTA
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA...
atis
CREATE TABLE table_name_41 ( year_s__won VARCHAR, player VARCHAR )
What years did Lou Graham win in?
SELECT year_s__won FROM table_name_41 WHERE player = "lou graham"
sql_create_context
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...
从00年4月19日到20年11月4日医院6853242的住院医疗记录的数目统共有多少?
SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '6853242' AND gwyjzb.IN_HOSP_DATE BETWEEN '2000-04-19' AND '2020-11-04' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '6853242' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2000-04-19' AND '2020-11-04' AND fgwyjzb.CLINIC_TY...
css
CREATE TABLE table_65200 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
What is the Rank of the Rider with a Speed of 111.072mph in Team 250CC Honda?
SELECT AVG("Rank") FROM table_65200 WHERE "Team" = '250cc honda' AND "Speed" = '111.072mph'
wikisql
CREATE TABLE table_204_358 ( id number, "species" text, "common name" text, "ncbi accession #" text, "ncbi name" text, "length" text, "sequence identity" text, "sequence similarity" text, "years since divergence from human (mya)" number )
which species have at least 87 % sequence identity ?
SELECT "species" FROM table_204_358 WHERE "sequence identity" >= 87
squall
CREATE TABLE table_name_42 ( pick VARCHAR, player VARCHAR )
What was the pick number when mark hayes was drafted?
SELECT pick FROM table_name_42 WHERE player = "mark hayes"
sql_create_context
CREATE TABLE table_name_32 ( loss VARCHAR, score VARCHAR )
Score of postponed (rain) rescheduled for June 27 had what loss?
SELECT loss FROM table_name_32 WHERE score = "postponed (rain) rescheduled for june 27"
sql_create_context
CREATE TABLE table_name_70 ( finish VARCHAR, player VARCHAR, total VARCHAR, to_par VARCHAR )
What was the finish with a total larger than 286, a to par of +4 and Bob Tway played?
SELECT finish FROM table_name_70 WHERE total > 286 AND to_par = "+4" AND player = "bob tway"
sql_create_context
CREATE TABLE table_22282 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" text, "New entries this round" text, "Leagues entering at this round" text )
How many new entries started in the round where winners from the previous round is 32?
SELECT "New entries this round" FROM table_22282 WHERE "Winners from previous round" = '32'
wikisql
CREATE TABLE table_54005 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
what is the date when the home is st. louis?
SELECT "Date" FROM table_54005 WHERE "Home" = 'st. louis'
wikisql
CREATE TABLE table_11585313_1 ( number_of_goals VARCHAR, date_of_debut VARCHAR )
What is the total number of goals on the debut date of 14-04-1907?
SELECT COUNT(number_of_goals) FROM table_11585313_1 WHERE date_of_debut = "14-04-1907"
sql_create_context
CREATE TABLE qtb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
在04年7月13日到2012年6月26日之间患者65683500自费花多于6686.51元的药品总量为多少?
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '65683500' AND t_kc22.STA_DATE BETWEEN '2004-07-13' AND '2012-06-26' AND t_kc22.SELF_PAY_AMO > 6686.51 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '6568...
css
CREATE TABLE table_53608 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
what was the attendance for a home venue and a w 3-0 result?
SELECT AVG("Attendance") FROM table_53608 WHERE "Venue" = 'home' AND "Result" = 'w 3-0'
wikisql
CREATE TABLE table_31547 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Tell me the college for jason holland
SELECT "College/junior/club team" FROM table_31547 WHERE "Player" = 'jason holland'
wikisql
CREATE TABLE table_38962 ( "Week 2 Sept 7" text, "Week 3 Sept 14" text, "Week 4 Sept 21" text, "Week 5 Sept 28" text, "Week 6 Oct 5" text, "Week 7 Oct 12" text, "Week 10 Nov 2" text, "Week 12 Nov 16" text, "Week 14 Nov 30" text, "Week 15 Dec 7" text, "Week 16 (Final) Jan 9" t...
What was the week 5 opponent for the year with a week 10 opponent of Maryland (6-2)?
SELECT "Week 5 Sept 28" FROM table_38962 WHERE "Week 10 Nov 2" = 'maryland (6-2)'
wikisql
CREATE TABLE table_5141 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
What is the least population with more than 78,748 households in Davis County?
SELECT MIN("Population") FROM table_5141 WHERE "Number of households" > '78,748' AND "County" = 'davis'
wikisql
CREATE TABLE table_name_64 ( away_team VARCHAR )
How much did the away team Melbourne score?
SELECT away_team AS score FROM table_name_64 WHERE away_team = "melbourne"
sql_create_context
CREATE TABLE table_23316034_23 ( dismissals INTEGER, rank VARCHAR )
Name the least dismissals for 4 rank
SELECT MAX(dismissals) FROM table_23316034_23 WHERE rank = 4
sql_create_context
CREATE TABLE table_55862 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
what is the least laps when the grid is 5?
SELECT MIN("Laps") FROM table_55862 WHERE "Grid" = '5'
wikisql
CREATE TABLE table_name_70 ( position VARCHAR, nationality VARCHAR, player VARCHAR )
Corey Maggette from the United States plays what position?
SELECT position FROM table_name_70 WHERE nationality = "united states" AND player = "corey maggette"
sql_create_context
CREATE TABLE table_name_31 ( best VARCHAR, qual_2 VARCHAR )
What is the Best of the racer with a Qual 2 of 1:00.588?
SELECT best FROM table_name_31 WHERE qual_2 = "1:00.588"
sql_create_context
CREATE TABLE table_30198 ( "Sponsored name" text, "Non-sponsored name" text, "Sponsor" text, "Stadium" text, "City" text, "Country" text, "Sport" text, "Sponsorship Ended" real )
What country is new orleans in?
SELECT "Country" FROM table_30198 WHERE "City" = 'New Orleans'
wikisql
CREATE TABLE table_16799784_2 ( name VARCHAR, longitude VARCHAR )
Name the name origin for 54.0e
SELECT name AS origin FROM table_16799784_2 WHERE longitude = "54.0E"
sql_create_context
CREATE TABLE table_name_61 ( a_score INTEGER, b_score VARCHAR, total VARCHAR )
What is the lowest A Score when the B Score is 9.15, and total is 16.05?
SELECT MIN(a_score) FROM table_name_61 WHERE b_score = 9.15 AND total = 16.05
sql_create_context
CREATE TABLE table_27994983_8 ( viewers VARCHAR, draw VARCHAR )
How many items appear in the viewers column when the draw is 2?
SELECT COUNT(viewers) FROM table_27994983_8 WHERE draw = 2
sql_create_context
CREATE TABLE table_name_73 ( draw INTEGER, song VARCHAR, points VARCHAR )
WHAT IS THE DRAW FOR u ritmu ljubavi, POINTS LARGER THAN 87?
SELECT MAX(draw) FROM table_name_73 WHERE song = "u ritmu ljubavi" AND points > 87
sql_create_context
CREATE TABLE table_name_31 ( sales VARCHAR, album_title VARCHAR )
How many copies of scouting for girls were sold?
SELECT COUNT(sales) FROM table_name_31 WHERE album_title = "scouting for girls"
sql_create_context
CREATE TABLE table_21157 ( "Player" text, "GP" real, "K. Ret." real, "KR Yds" real, "KR Avg." text, "KR TD" real, "KR LG" real, "P. Ret." real, "PR Yds" real, "PR Avg." text, "PR TD" real, "PR LG" real, "MFG Ret." real, "MFG Yds" real, "MFG Avg." text, "MF...
Who's average is 24.8?
SELECT "Player" FROM table_21157 WHERE "KR Avg." = '24.8'
wikisql
CREATE TABLE table_name_26 ( year_introduced INTEGER, memory__gb_ VARCHAR )
Which Year Introduced has a Memory (GB) of 0.125 2?
SELECT MAX(year_introduced) FROM table_name_26 WHERE memory__gb_ = "0.125–2"
sql_create_context
CREATE TABLE table_75038 ( "Rank" real, "Player" text, "Goals" real, "Games" real, "Goal Ratio" real )
How many goal ratios have rank of 2 with more than 44 games?
SELECT COUNT("Goal Ratio") FROM table_75038 WHERE "Rank" = '2' AND "Games" > '44'
wikisql
CREATE TABLE table_name_65 ( entrant VARCHAR, driver VARCHAR, rounds VARCHAR, chassis VARCHAR )
Who was the entrant for Gabriele Tarquini with all rounds and a JH24 JH25 Chassis?
SELECT entrant FROM table_name_65 WHERE rounds = "all" AND chassis = "jh24 jh25" AND driver = "gabriele tarquini"
sql_create_context
CREATE TABLE stadium ( id int, name text, Home_Games int, Average_Attendance real, Total_Attendance real, Capacity_Percentage real ) CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) ...
Show the number of games in each season and group by home team in a group line chart The x-axis is season, show Season in asc order.
SELECT Season, COUNT(Season) FROM game GROUP BY Home_team ORDER BY Season
nvbench
CREATE TABLE table_name_28 ( tournament VARCHAR )
Which Tournament has a 2009 of q1, and a 2008 of 1r?
SELECT tournament FROM table_name_28 WHERE 2009 = "q1" AND 2008 = "1r"
sql_create_context
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABL...
datasets used for evaluating semantic parsing
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
scholar
CREATE TABLE table_name_92 ( to_par VARCHAR, score VARCHAR )
What was the to par when the score was 71-70-72-68=281?
SELECT to_par FROM table_name_92 WHERE score = 71 - 70 - 72 - 68 = 281
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
Which patients are younger than 70 years old and have other specified perinatal disorder of digestive system diagnoses?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "70" AND diagnoses.short_title = "Perinat GI sys dis NEC"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
what was the name of the intake, patient 027-154299 last had on this month/30?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-154299')) AND intakeoutput.cellpath LIKE '%intake%' AND ...
eicu
CREATE TABLE table_1750 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
With the given points of 51, what was the total number of the try bonus?
SELECT COUNT("Try bonus") FROM table_1750 WHERE "Points" = '51'
wikisql
CREATE TABLE table_60638 ( "Order Year" text, "Builder" text, "Model" text, "Length (ft.)" text, "Engine/Transmission" text )
What is the order year of obi builder and 05.505 model that is 30 feet long?
SELECT "Order Year" FROM table_60638 WHERE "Builder" = 'obi' AND "Length (ft.)" = '30' AND "Model" = '05.505'
wikisql
CREATE TABLE table_49010 ( "Season" text, "Passenger" text, "Equipment" text, "Position" text, "Points" real, "Races" real, "Wins" text, "Second" text, "Third" text )
Which position has 30 points and Reiner Stuyvenberg as a passenger?
SELECT "Position" FROM table_49010 WHERE "Points" = '30' AND "Passenger" = 'reiner stuyvenberg'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Evolution of the mean question score and number of questions of each week of 2015.
SELECT TIME_TO_STR(p.CreationDate, '%W') AS weekOfCreation, SUM(p.Score) AS meanQuestionScore FROM Posts AS p WHERE p.PostTypeId = 1 AND TIME_TO_STR(p.CreationDate, '%Y') = 2015 GROUP BY TIME_TO_STR(p.CreationDate, '%W') ORDER BY TIME_TO_STR(p.CreationDate, '%W')
sede
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
count the number of patients whose diagnoses long title is embolism and thrombosis of iliac artery and lab test abnormal status is delta?
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.long_title = "Embolism and thrombosis of iliac artery" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_name_55 ( game VARCHAR, team VARCHAR )
How many Games has a Team of chicago?
SELECT COUNT(game) FROM table_name_55 WHERE team = "chicago"
sql_create_context
CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text, acc_percent text, acc_home text, acc_road text, all_games text, all_games_percent number, all_home text, all_road text, all_neutral text ) CREATE TABLE university (...
What are the average enrollment size of the universities that are founded before 1850?
SELECT AVG(enrollment) FROM university WHERE founded < 1850
spider
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 ( ...
find the number of patients with procedure icd9 code 3523 who died in or before 2165.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2165.0" AND procedures.icd9_code = "3523"
mimicsql_data
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
Tell me the proportion of the nationality of all ships.
SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality
nvbench
CREATE TABLE table_name_87 ( city VARCHAR, rank VARCHAR, name VARCHAR )
What city is the lamar tower 1, ranked above 5?
SELECT city FROM table_name_87 WHERE rank < 5 AND name = "lamar tower 1"
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 d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE diagnoses_icd ( row_id number, ...
during the last year what was the first procedure time for patient 29806?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29806) AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY procedures_icd.charttime LIMIT 1
mimic_iii
CREATE TABLE table_2522 ( "Outcome" text, "Year" real, "Championship" text, "Surface" text, "Partner" text, "Opponents in the final" text, "Score in the final" text )
What is the latest year?
SELECT MAX("Year") FROM table_2522
wikisql
CREATE TABLE table_name_80 ( total INTEGER, championship INTEGER )
What is the highest total when there is less than 1 championship?
SELECT MAX(total) FROM table_name_80 WHERE championship < 1
sql_create_context
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...
从2006年9月3日起,截止到2007年5月5日,7452450这个医院有多少科室涉及的医疗费总额超过5876.89元
SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '7452450' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-09-03' AND '2007-05-05' GROUP B...
css
CREATE TABLE table_name_77 ( competition VARCHAR, score VARCHAR, location VARCHAR )
WHich competition was held on Alvor with a score 1-0?
SELECT competition FROM table_name_77 WHERE score = "1-0" AND location = "alvor"
sql_create_context
CREATE TABLE table_37154 ( "Season" real, "Series" text, "Team Name" text, "Races" text, "Wins" text, "Poles" text, "F/Laps" text, "Podiums" text, "Points" text, "Final Placing" text )
Which Series has Poles of 0, and Races of 17?
SELECT "Series" FROM table_37154 WHERE "Poles" = '0' AND "Races" = '17'
wikisql
CREATE TABLE table_name_76 ( time VARCHAR, country VARCHAR )
What time did the team from Ukraine have?
SELECT time FROM table_name_76 WHERE country = "ukraine"
sql_create_context
CREATE TABLE table_train_218 ( "id" int, "plasma_glucose_concentration" int, "c_peptide_level" float, "body_weight" float, "diabetic" string, "single_antigen_b_sab" int, "low_density_lipoprotein_ldl_cholesterol" int, "body_mass_index_bmi" float, "triglyceride_tg" float, "NOUSE" f...
pre _ trial low _ density lipoprotein ( ldl ) cholesterol > 100 and triglycerides > 200 mg / dl with or without lipid lowering therapy
SELECT * FROM table_train_218 WHERE low_density_lipoprotein_ldl_cholesterol > 100 AND triglyceride_tg > 200
criteria2sql
CREATE TABLE table_name_78 ( total INTEGER, nation VARCHAR, bronze VARCHAR )
what is the least total when the nation is canada (can) and bronze is less than 0?
SELECT MIN(total) FROM table_name_78 WHERE nation = "canada (can)" AND bronze < 0
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
what was the last ward id that patient 030-44598 went in this hospital encounter?
SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-44598' AND patient.hospitaldischargetime IS NULL) ORDER BY patient.unitadmittime DESC LIMIT 1
eicu
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name te...
what were the three most frequent drugs that were prescribed within 2 months to the male patients aged 20s after having been diagnosed with esophageal reflux, in 2105.
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
在2003-10-14到2014-10-02这几年里,查一下医疗机构5126566外地门诊的就诊记录数量
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '5126566' AND JZKSRQ BETWEEN '2003-10-14' AND '2014-10-02' AND WDBZ > 0
css
CREATE TABLE table_11251601_2 ( carbon_dioxide_emissions_per_year__10_6_tons___2006_ VARCHAR, carbon_dioxide_emissions_per_year__tons_per_person___2007_ VARCHAR )
WHAT WAS THE AMOUNT OF CARBON DIOXIDE EMISSIONS IN 2006 IN THE COUNTRY WHOSE CO2 EMISSIONS (TONS PER PERSON) REACHED 1.4 IN 2OO7?
SELECT carbon_dioxide_emissions_per_year__10_6_tons___2006_ FROM table_11251601_2 WHERE carbon_dioxide_emissions_per_year__tons_per_person___2007_ = "1.4"
sql_create_context
CREATE TABLE zyjzjlb_jybgb ( YLJGDM_ZYJZJLB text, BGDH number, YLJGDM number ) 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, ...
号码是75590344936的住院患者开出的检验报告单是多少份?
SELECT COUNT(*) FROM jybgb WHERE jybgb.JZLSH = '75590344936'
css
CREATE TABLE table_26555737_1 ( result VARCHAR, director VARCHAR )
When hany abu-assad category:articles with hcards is the director what is the result?
SELECT result FROM table_26555737_1 WHERE director = "Hany Abu-Assad Category:Articles with hCards"
sql_create_context
CREATE TABLE table_2562572_35 ( population__2011_ VARCHAR, settlement VARCHAR )
Name the total number of population 2011 for perlez
SELECT COUNT(population__2011_) FROM table_2562572_35 WHERE settlement = "Perlez"
sql_create_context
CREATE TABLE table_2481 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
What were his winnings when he had 14 top 10s?
SELECT "Winnings" FROM table_2481 WHERE "Top 10" = '14'
wikisql
CREATE TABLE table_78072 ( "Player" text, "Pos." text, "From" text, "School/Country" text, "Rebs" real, "Asts" real )
What position does the player from arkansas play?
SELECT "Pos." FROM table_78072 WHERE "School/Country" = 'arkansas'
wikisql
CREATE TABLE table_name_13 ( name_of_the_stone__sila_ VARCHAR, name_of_the_state_where_found_in_india VARCHAR )
What is the name of the stone found in Andhra Pradesh, India?
SELECT name_of_the_stone__sila_ FROM table_name_13 WHERE name_of_the_state_where_found_in_india = "andhra pradesh"
sql_create_context
CREATE TABLE table_20246201_9 ( popular_vote VARCHAR, candidate VARCHAR )
How many different popular vote counts were there for the candidate Rick Perry?
SELECT COUNT(popular_vote) FROM table_20246201_9 WHERE candidate = "Rick Perry"
sql_create_context
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_care...
how much is the cost of a lab test of glucose, pleural?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose, pleural'))
mimic_iii
CREATE TABLE table_11339 ( "Round" text, "Pick" text, "Player" text, "Position" text, "Nationality" text, "Team" text, "College" text )
What team has a player from Santa Clara?
SELECT "Team" FROM table_11339 WHERE "College" = 'santa clara'
wikisql
CREATE TABLE table_21053 ( "Poll Source" text, "Dates administered" text, "Democrat: Carl Levin" text, "Republican: Jack Hoogendyk" text, "Lead Margin" real )
How many times did Public Policy Polling under Republican: Jack Hoogendyk?
SELECT COUNT("Republican: Jack Hoogendyk") FROM table_21053 WHERE "Poll Source" = 'Public Policy Polling'
wikisql
CREATE TABLE table_2847477_2 ( area VARCHAR, english_name VARCHAR )
What is the area of xin county?
SELECT area FROM table_2847477_2 WHERE english_name = "Xin County"
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 admission location and diagnoses icd9 code of subject id 18372?
SELECT demographic.admission_location, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "18372"
mimicsql_data
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
What is the average question score per view?. http://meta.stackexchange.com/questions/279418/what-is-the-average-question-score-per-view/279421#279421
SELECT SUM(CAST(scores AS INT)) AS sc, SUM(CAST(views AS INT)) AS vi, SUM(CAST(upvotes AS INT)) AS uv, SUM(CAST(downvotes AS INT)) AS dv FROM (SELECT p.Id AS id, Score AS scores, ViewCount AS views, SUM(CASE WHEN v.VoteTypeId = 2 THEN 1 ELSE 0 END) AS upvotes, SUM(CASE WHEN v.VoteTypeId = 3 THEN 1 ELSE 0 END) AS downvo...
sede
CREATE TABLE table_13663434_1 ( jp__210_ VARCHAR, title_and_source VARCHAR )
what's the jp -210- with title and source being fun! fun! minigolf
SELECT jp__210_ FROM table_13663434_1 WHERE title_and_source = "Fun! Fun! Minigolf"
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...
在门诊诊断为混合性焦虑和抑郁障碍的甲状旁腺素名叫金睿聪的患者的结果定量和单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy...
css
CREATE TABLE table_26419467_1 ( alumni VARCHAR, original_season VARCHAR )
What alumni were in rw: cancun as their original season?
SELECT alumni FROM table_26419467_1 WHERE original_season = "RW: Cancun"
sql_create_context
CREATE TABLE table_75153 ( "Date" text, "City" text, "Opponent" text, "Results\u00b9" text, "Type of game" text )
What was the opponent on october 28?
SELECT "Opponent" FROM table_75153 WHERE "Date" = 'october 28'
wikisql
CREATE TABLE table_11677100_16 ( school VARCHAR, player VARCHAR )
What school did the player Ethan Bennett attend?
SELECT school FROM table_11677100_16 WHERE player = "Ethan Bennett"
sql_create_context
CREATE TABLE table_22584 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
How many starts were there when the winnings are $690,321?
SELECT MIN("Starts") FROM table_22584 WHERE "Winnings" = '$690,321'
wikisql
CREATE TABLE table_203_187 ( id number, "conference" text, "bids" number, "record" text, "win %" number, "quarterfinals" number, "semifinals" number, "final" number, "champions" number )
did atlantic coast conference or independent have a higher win percentage ?
SELECT "conference" FROM table_203_187 WHERE "conference" IN ('atlantic coast conference', 'independent') ORDER BY "win %" DESC LIMIT 1
squall
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenit...
What is the average age for each dorm and what are the names of each dorm Plot them as bar chart, and show by the total number from low to high.
SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name ORDER BY AVG(T1.Age)
nvbench
CREATE TABLE table_2800 ( "Club" text, "Location" text, "Manager" text, "Stadium" text, "Capacity" real, "Team captain" text )
Who's the captain of the team whose stadium is Gradski Stadion?
SELECT "Team captain" FROM table_2800 WHERE "Stadium" = 'Gradski Stadion'
wikisql
CREATE TABLE table_31956 ( "Date" text, "Opponent" text, "Venue" text, "Result" text, "Attendance" real )
Name the date of st albans city for result of drew 0-0
SELECT "Date" FROM table_31956 WHERE "Opponent" = 'st albans city' AND "Result" = 'drew 0-0'
wikisql
CREATE TABLE table_name_86 ( cubic_inches__exact_ VARCHAR, unit VARCHAR )
What are the exact Cubic inches of the Unit of kruzhka?
SELECT cubic_inches__exact_ FROM table_name_86 WHERE unit = "kruzhka"
sql_create_context
CREATE TABLE table_name_60 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on April 28?
SELECT opponent FROM table_name_60 WHERE date = "april 28"
sql_create_context
CREATE TABLE table_53851 ( "Rank" real, "Date" text, "Stadium" text, "Opponent" text, "Competition" text, "Score Scotland's score is shown first." text )
Which competition was ranked 9?
SELECT "Competition" FROM table_53851 WHERE "Rank" = '9'
wikisql
CREATE TABLE table_56519 ( "Year" text, "League" text, "Reg. Season" text, "Playoffs" text, "Attendance Average" text )
What Playoffs were held during the years of 2007-08?
SELECT "Playoffs" FROM table_56519 WHERE "Year" = '2007-08'
wikisql
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
what were the five most frequent lab tests that patients had within the same hospital visit after receiving a parent infus nutrit sub?
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t3.itemid FROM (SELECT t2.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_i...
mimic_iii
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 ( ...
how many privately insured patients have been diagnosed with unspecified shock?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Private" AND diagnoses.long_title = "Shock, unspecified"
mimicsql_data
CREATE TABLE table_51387 ( "Name" text, "Bodyweight" real, "Snatch" real, "Clean & jerk" real, "Total (kg)" real )
Of weightlifters who weighed more than 136.16, who had the highest Total?
SELECT MAX("Total (kg)") FROM table_51387 WHERE "Bodyweight" > '136.16'
wikisql
CREATE TABLE table_1387 ( "Frequency" text, "Station" text, "Operator" text, "Language" text, "Genre" text, "Coverage Area" text )
What is the frequency of hot fm?
SELECT COUNT("Frequency") FROM table_1387 WHERE "Station" = 'Hot FM'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
病患04686817药品均价低于9433.92元在哪几次医疗记录中被开出的和医疗就诊编号是多少啊?
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '04686817' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 9433.92)
css
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
list the fares of ML airlines flights from BOSTON to PHILADELPHIA
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
atis
CREATE TABLE table_name_38 ( Id VARCHAR )
Tell me the 2008 for 2012 of 4r and 2009 of a
SELECT 2008 FROM table_name_38 WHERE 2012 = "4r" AND 2009 = "a"
sql_create_context
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 ) ...
what is primary disease and admission time of subject id 9258?
SELECT demographic.diagnosis, demographic.admittime FROM demographic WHERE demographic.subject_id = "9258"
mimicsql_data
CREATE TABLE table_203_16 ( id number, "name" text, "took office" text, "left office" text, "party" text, "district residence" text, "notes" text )
which representative was the earliest to take office ?
SELECT "name" FROM table_203_16 ORDER BY "took office" LIMIT 1
squall