context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_25519358_1 ( horizontal_0_a VARCHAR, number VARCHAR )
Name the horizontal number for number 10
SELECT COUNT(horizontal_0_a) FROM table_25519358_1 WHERE number = 10
sql_create_context
CREATE TABLE table_name_54 ( away_team VARCHAR, home_team VARCHAR )
Who faced Collingwood as an away team?
SELECT away_team FROM table_name_54 WHERE home_team = "collingwood"
sql_create_context
CREATE TABLE table_204_871 ( id number, "ano" text, "title" text, "role" text, "channel" text, "notes" text )
which is the oldest , kachorra or sos mi vida ?
SELECT "title" FROM table_204_871 WHERE "title" IN ('kachorra', 'sos mi vida') ORDER BY "ano" LIMIT 1
squall
CREATE TABLE table_name_95 ( attendance INTEGER, opponent VARCHAR, week VARCHAR )
Which Attendance has an Opponent of green bay packers, and a Week larger than 10?
SELECT MIN(attendance) FROM table_name_95 WHERE opponent = "green bay packers" AND week > 10
sql_create_context
CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number,...
Return the prices of wines produced before 2010.
SELECT price FROM wine WHERE year < 2010
spider
CREATE TABLE table_name_53 ( dissolved VARCHAR, summoned VARCHAR )
What is the dissolved date of the parliament summoned on 28 February 1467?
SELECT dissolved FROM table_name_53 WHERE summoned = "28 february 1467"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), ...
Show employee_id from each email
SELECT EMAIL, EMPLOYEE_ID FROM employees
nvbench
CREATE TABLE table_203_695 ( id number, "draw" number, "artist" text, "song" text, "points" number, "place" text )
in the irish national final for the eurovision song contest in 1990 , how many artists received less than 90 points ?
SELECT COUNT("artist") FROM table_203_695 WHERE "points" < 90
squall
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number,...
how many patients were prescribed phenylephrine within 2 months in 2104 following the procedure of thoracentesis?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'thoracentes...
mimic_iii
CREATE TABLE table_name_56 ( appeared INTEGER, rr_w_rate VARCHAR, result VARCHAR )
If the RR Rate is less than 0.75 with a result of RR:08,09, what is the average appeared?
SELECT AVG(appeared) FROM table_name_56 WHERE rr_w_rate < 0.75 AND result = "rr:08,09"
sql_create_context
CREATE TABLE table_19195 ( "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 )
Name the s car plate starting 1937 for area 1930 being 22.2
SELECT "s Car plate (starting 1937)" FROM table_19195 WHERE "Area (1930) in 1,000skm 2" = '22.2'
wikisql
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paperkeyphrase ( paperid int, ...
Latest paper by jeff dean
SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'jeff dean' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC
scholar
CREATE TABLE table_name_47 ( to_par INTEGER, player VARCHAR, country VARCHAR, place VARCHAR )
Which To par has a Country of england, and a Place of t9, and a Player of graeme storm?
SELECT MAX(to_par) FROM table_name_47 WHERE country = "england" AND place = "t9" AND player = "graeme storm"
sql_create_context
CREATE TABLE table_38938 ( "Team" text, "Constructor" text, "Motorcycle" text, "Rider" text, "Rounds" text )
What team has a yamaha constructor with all rounds?
SELECT "Team" FROM table_38938 WHERE "Rounds" = 'all' AND "Constructor" = 'yamaha'
wikisql
CREATE TABLE table_24726 ( "School" text, "Location" text, "Enrolment" real, "Founded" real, "Denomination" text, "Boys/Girls" text, "Day/Boarding" text, "School Colors" text )
What is every school for the Adelaide location?
SELECT "School" FROM table_24726 WHERE "Location" = 'Adelaide'
wikisql
CREATE TABLE table_name_33 ( name VARCHAR, teams VARCHAR )
What is the name of the event where Cornell-Penn played?
SELECT name FROM table_name_33 WHERE teams = "cornell-penn"
sql_create_context
CREATE TABLE table_name_79 ( attendance INTEGER, score VARCHAR )
What was the total attendance for the 3:1 game?
SELECT SUM(attendance) FROM table_name_79 WHERE score = "3:1"
sql_create_context
CREATE TABLE table_3766 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
What is the name of the episode that was written by Scott M. Gimple?
SELECT "Title" FROM table_3766 WHERE "Written by" = 'Scott M. Gimple'
wikisql
CREATE TABLE table_27496 ( "Year" real, "Population" real, "Index" real, "Violent" real, "Property" real, "Murder" real, "Forcible rape" real, "Robbery" real, "Aggravated assault" real, "Burglary" real, "Larceny Theft" real, "Vehicle Theft" real )
How many violent catagories are listed for the year forcible rapes were 1156?
SELECT COUNT("Violent") FROM table_27496 WHERE "Forcible rape" = '1156'
wikisql
CREATE TABLE table_24150 ( "Season" text, "Games" real, "Won" real, "Lost" real, "Tied" real, "Points" real, "Pct %" text, "Goals For" real, "Goals Against" real, "Standing" text )
What was the standing in the season that the pct% was 0.769?
SELECT "Standing" FROM table_24150 WHERE "Pct %" = '0.769'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
分别在哪几次医疗记录中病人75906484被开出的均价超过1703.04元药品和医疗就诊编号是多少?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '75906484' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 1703.04)
css
CREATE TABLE table_11968 ( "Player" text, "Position" text, "Date of Birth (Age)" text, "Caps" real, "Club/province" text )
When was brian lemay born?
SELECT "Date of Birth (Age)" FROM table_11968 WHERE "Player" = 'brian lemay'
wikisql
CREATE TABLE zyb ( 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...
患者93292938的自付比例低于0.34的药品量在2005年2月13日到2020年12月30日之间有多少?
SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '93292938' AND t_kc22.STA_DATE BETWEEN '2005-02-13' AND '2020-12-30' AND t_kc22.SELF_PAY_PRO < 0.34 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.PERSON_ID = '9329293...
css
CREATE TABLE table_name_95 ( gold INTEGER, rank VARCHAR, total VARCHAR, silver VARCHAR )
What is the average Gold, when Total is 2, when Silver is less than 1, and when Rank is greater than 5?
SELECT AVG(gold) FROM table_name_95 WHERE total = 2 AND silver < 1 AND rank > 5
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
For how many patients admitted before the year 2120 had a lab test for monos conducted?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2120" AND lab.label = "Monos"
mimicsql_data
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is diagnoses long title of subject name alice nixon?
SELECT diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Alice Nixon"
mimicsql_data
CREATE TABLE table_49278 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location/Attendance" text, "Record" text )
What is the score of game 21?
SELECT "Score" FROM table_49278 WHERE "Game" = '21'
wikisql
CREATE TABLE table_13164 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
Which Position has Goals against larger than 32, and points larger than 30?
SELECT "Position" FROM table_13164 WHERE "Goals against" > '32' AND "Points" > '30'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, Rejectio...
Posts by Jon Skeet per day versus total badges he's earnt.
SELECT DATE(p.CreationDate) AS PostDate, COUNT(p.Id) AS Posts, (SELECT COUNT(b.Id) / 100 FROM Badges AS b WHERE b.UserId = u.Id AND b.Date <= DATE(p.CreationDate)) AS BadgesEarned FROM Posts AS p, Users AS u WHERE u.Id = @UserId AND p.OwnerUserId = u.Id GROUP BY DATE(p.CreationDate), u.Id ORDER BY DATE(p.CreationDate)
sede
CREATE TABLE table_10829 ( "Team" text, "Season" text, "Regular Season" real, "Tournament" real, "Total" real )
How many tournament titles for texas with over 0 total?
SELECT COUNT("Tournament") FROM table_10829 WHERE "Total" > '0' AND "Team" = 'texas'
wikisql
CREATE TABLE table_261941_1 ( founded INTEGER )
When was the earliest founded university?
SELECT MIN(founded) FROM table_261941_1
sql_create_context
CREATE TABLE table_12488 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the Score of the Hereford United Away game?
SELECT "Score" FROM table_12488 WHERE "Away team" = 'hereford united'
wikisql
CREATE TABLE table_1342359_39 ( result VARCHAR, district VARCHAR )
What is the result for south carolina 4?
SELECT result FROM table_1342359_39 WHERE district = "South Carolina 4"
sql_create_context
CREATE TABLE table_37142 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
Which Events have Earnings ($) of 1,841,117, and a Rank smaller than 4?
SELECT SUM("Events") FROM table_37142 WHERE "Earnings ( $ )" = '1,841,117' AND "Rank" < '4'
wikisql
CREATE TABLE table_name_7 ( score_qualifying VARCHAR, score_final VARCHAR )
What is the sum of qualifying scores when the final score is 16.625?
SELECT COUNT(score_qualifying) FROM table_name_7 WHERE score_final = 16.625
sql_create_context
CREATE TABLE table_name_45 ( appointed_by VARCHAR, presentation_of_credentials VARCHAR )
Which Appointed has a Presentation of Credentials on November 22, 1990
SELECT appointed_by FROM table_name_45 WHERE presentation_of_credentials = "november 22, 1990"
sql_create_context
CREATE TABLE table_name_43 ( earnings___ VARCHAR, events VARCHAR, rank VARCHAR )
How much money did the player ranked above 3 with under 28 events earn?
SELECT COUNT(earnings___) AS $__ FROM table_name_43 WHERE events < 28 AND rank < 3
sql_create_context
CREATE TABLE table_35080 ( "Date" text, "Kicker" text, "Kicking team" text, "Opponent" text, "Yards" real, "Result" text, "Game time" text )
Yards larger than 52, and a Opponent of san francisco 49ers is what kicker?
SELECT "Kicker" FROM table_35080 WHERE "Yards" > '52' AND "Opponent" = 'san francisco 49ers'
wikisql
CREATE TABLE table_name_69 ( music___director VARCHAR, co___singer VARCHAR, film VARCHAR )
Who is the music-director for the song from the film khaleja who had a co-singer of hemachandra?
SELECT music___director FROM table_name_69 WHERE co___singer = "hemachandra" AND film = "khaleja"
sql_create_context
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE T...
show me flights from BOSTON to SAN FRANCISCO
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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
atis
CREATE TABLE table_name_10 ( scores_by_each_individual_judge VARCHAR, total_score_week VARCHAR, co_contestant__yaar_vs_pyaar_ VARCHAR )
What are the scores when total score/week is 41/60 and co-contestant is Shalini Chandran?
SELECT scores_by_each_individual_judge FROM table_name_10 WHERE total_score_week = "41/60" AND co_contestant__yaar_vs_pyaar_ = "shalini chandran"
sql_create_context
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
flights from NEWARK NEW JERSEY to MINNEAPOLIS
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, state WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'NEWARK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
atis
CREATE TABLE table_17311 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
how many times was the high rebounds by Mcdyess (9) and the high assists was by Billups (10)?
SELECT COUNT("High points") FROM table_17311 WHERE "High rebounds" = 'McDyess (9)' AND "High assists" = 'Billups (10)'
wikisql
CREATE TABLE Invoice ( InvoiceId integer, CustomerId integer, InvoiceDate datetime, BillingAddress varchar(70), BillingCity varchar(40), BillingState varchar(40), BillingCountry varchar(40), BillingPostalCode varchar(10), Total decimal(10,2) ) CREATE TABLE PlaylistTrack ( Playli...
Show the album names and ids for albums that contain tracks with unit price bigger than 1 Visualize by bar chart, and I want to list X-axis in descending order.
SELECT T1.Title, T1.AlbumId FROM Album AS T1 JOIN Track AS T2 ON T1.AlbumId = T2.AlbumId WHERE T2.UnitPrice > 1 ORDER BY T1.Title DESC
nvbench
CREATE TABLE table_22646 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Dolphins points" real, "Opponents" real, "Record" text, "Attendance" real )
How many opponents are at Minnesota Vikings?
SELECT MAX("Opponents") FROM table_22646 WHERE "Opponent" = 'at Minnesota Vikings'
wikisql
CREATE TABLE table_name_66 ( entrant VARCHAR, points VARCHAR, chassis VARCHAR )
Which entrant has 49 points and a Mclaren M7A chassis?
SELECT entrant FROM table_name_66 WHERE points = "49" AND chassis = "mclaren m7a"
sql_create_context
CREATE TABLE table_name_3 ( top_5 INTEGER, top_10 VARCHAR, cuts_made VARCHAR )
What is the average number of top-5s for the major with 5 top-10s and fewer than 12 cuts made?
SELECT AVG(top_5) FROM table_name_3 WHERE top_10 = 5 AND cuts_made < 12
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, ...
在09年1月7日到14年9月23日期间病号陶寒香都有什么检查方法记录在检验结果指标记录中?
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose insurance is government and admission location is clinic referral/premature?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE"
mimicsql_data
CREATE TABLE table_204_409 ( id number, "date" text, "race name" text, "location" text, "uci rating" number, "winner" text, "team" text )
how many races are there total on the chart ?
SELECT COUNT("race name") FROM table_204_409
squall
CREATE TABLE Companies ( name VARCHAR, Headquarters VARCHAR )
What are the names of companies whose headquarters are not 'USA'?
SELECT name FROM Companies WHERE Headquarters <> 'USA'
sql_create_context
CREATE TABLE table_1508 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What team has draft picks from Mississippi?
SELECT "NFL Team" FROM table_1508 WHERE "College" = 'Mississippi'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PendingFlags ( Id number, FlagTypeId ...
Users with most posts on the site.
SELECT DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, OwnerUserId AS "user_link", COUNT(*) AS Count FROM Posts WHERE OwnerUserId > 0 GROUP BY OwnerUserId ORDER BY Count DESC, OwnerUserId LIMIT 1000
sede
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...
Min, max, and average of score to view count ratios per question over a given year. thanks to http://data.stackexchange.com/stackoverflow/s/1506/average-answer-score
SELECT MIN(CAST(Score AS FLOAT) / CAST(ViewCount AS FLOAT)) AS "Minimum", MAX(CAST(Score AS FLOAT) / CAST(ViewCount AS FLOAT)) AS "Maximum", (SUM(CAST(Score AS FLOAT) / CAST(ViewCount AS FLOAT)) + 0.0) / COUNT(*) AS "Average" FROM Posts WHERE CreationDate >= CAST('##year:int##' AS TEXT) + '-01-01' AND CreationDate < CA...
sede
CREATE TABLE table_72406 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What candidates are from mississippi 6?
SELECT "Candidates" FROM table_72406 WHERE "District" = 'Mississippi 6'
wikisql
CREATE TABLE table_name_13 ( years VARCHAR, jersey_number_s_ VARCHAR )
During what years was the Jersey Numbers 34, 30 played?
SELECT years FROM table_name_13 WHERE jersey_number_s_ = "34, 30"
sql_create_context
CREATE TABLE table_name_96 ( tie_no VARCHAR, home_team VARCHAR )
What's the tie number of Chelsea when they were home?
SELECT tie_no FROM table_name_96 WHERE home_team = "chelsea"
sql_create_context
CREATE TABLE table_name_50 ( first_party VARCHAR, second_member VARCHAR, second_party VARCHAR )
Which of the first parties has second member as Charles Robert Colvile, and a liberal second party?
SELECT first_party FROM table_name_50 WHERE second_member = "charles robert colvile" AND second_party = "liberal"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE microlab ( microlabid number, ...
when did patient 006-40255 last have the maximum amount of phosphate since 136 months ago?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-40255')) AND lab.labname = 'phosphate' AND DATETIME(lab.labresulttime) >= DATET...
eicu
CREATE TABLE table_16387953_1 ( away_team VARCHAR, ground VARCHAR )
What was the away team's score at the venue football park?
SELECT away_team AS score FROM table_16387953_1 WHERE ground = "Football Park"
sql_create_context
CREATE TABLE table_59186 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( \u00a3 )" real )
What score has 2 as the place?
SELECT "Score" FROM table_59186 WHERE "Place" = '2'
wikisql
CREATE TABLE table_17976 ( "Value" text, "Diameter" text, "Thickness" text, "Mass" text, "Composition" text, "Edge" text, "Obverse" text, "Reverse" text, "first minting" real, "issue" text, "withdrawal" text, "lapse" text )
When was the coin with the mass of 3.7 g first minted?
SELECT "first minting" FROM table_17976 WHERE "Mass" = '3.7 g'
wikisql
CREATE TABLE table_name_32 ( tournament VARCHAR )
Name the tournament for 2009 2r
SELECT tournament FROM table_name_32 WHERE 2009 = "2r"
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 ) ...
provide the number of patients whose gender is m and diagnoses long title is bone marrow replaced by transplant?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Bone marrow replaced by transplant"
mimicsql_data
CREATE TABLE table_name_59 ( college_junior_club_team__league_ VARCHAR, round INTEGER )
What college did the player selected in rounds over 3 play for?
SELECT college_junior_club_team__league_ FROM table_name_59 WHERE round > 3
sql_create_context
CREATE TABLE table_23699 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
Name the number of season for team bruichladdich
SELECT COUNT("Season") FROM table_23699 WHERE "Team" = 'Team Bruichladdich'
wikisql
CREATE TABLE table_72940 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original U.S. air date" text, "Prod. code" real, "Viewers (millions)" text )
How many million viewers watched episode 6?
SELECT "Viewers (millions)" FROM table_72940 WHERE "No. in season" = '6'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
what is the number of patients whose admission type is urgent and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
tell me the name of the drug which patient 032-32248 was prescribed within 2 days after receiving a cultures procedure?
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-32248') AND treatment.treatme...
eicu
CREATE TABLE table_name_53 ( home_team VARCHAR )
What did St Kilda score when they were the home team?
SELECT home_team AS score FROM table_name_53 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_2663 ( "Ticket / Office" text, "Secretary of State" text, "Comptroller" text, "Attorney General" text, "Treasurer" text, "State Engineer" text )
Name the comptroller for republican
SELECT "Comptroller" FROM table_2663 WHERE "Ticket / Office" = 'Republican'
wikisql
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe tex...
count users with 0 downvotes.
SELECT COUNT(*) FROM Users AS u WHERE u.Reputation >= 3000 AND u.DownVotes = 0
sede
CREATE TABLE table_name_42 ( height VARCHAR, name VARCHAR )
What is Trevard Lindley's height?
SELECT height FROM table_name_42 WHERE name = "trevard lindley"
sql_create_context
CREATE TABLE table_dev_21 ( "id" int, "gender" string, "leukopenia" int, "dialysis" bool, "hemoglobin_a1c_hba1c" float, "cd4_count" int, "platelets" int, "renal_disease" bool, "fasting_triglycerides" int, "hyperlipidemia" bool, "lymphopenia" int, "hba1c" float, "fasti...
hyperlipidemia ( fasting ldl cholesterol > 139 mg / dl, treated, or untreated; and / or fasting triglycerides > 200 mg / dl
SELECT * FROM table_dev_21 WHERE hyperlipidemia = 1 OR fasting_ldl_cholesterol > 139 OR fasting_triglycerides > 200
criteria2sql
CREATE TABLE table_name_22 ( host_team VARCHAR, stadium VARCHAR )
Who was the host team at Candlestick Park?
SELECT host_team FROM table_name_22 WHERE stadium = "candlestick park"
sql_create_context
CREATE TABLE table_204_736 ( id number, "party" text, "candidate" text, "votes" number )
which of the labor party candidates had the least number of votes ?
SELECT "candidate" FROM table_204_736 WHERE "party" = 'labour' ORDER BY "votes" LIMIT 1
squall
CREATE TABLE table_name_15 ( home_ground VARCHAR, nickname VARCHAR )
What's the home ground of the Lions?
SELECT home_ground FROM table_name_15 WHERE nickname = "lions"
sql_create_context
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
list flights from HOUSTON to SAN JOSE
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 = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN JO...
atis
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 route of administration for Influenza Virus Vaccine.
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Influenza Virus Vaccine"
mimicsql_data
CREATE TABLE table_60997 ( "Semi-closed initial unstressed vowels" text, "17th c." text, "American" text, "Australian" text, "Examples" text )
What is the entry for the Australian sound that has an example of illyria, cf. cirrhosis?
SELECT "Australian" FROM table_60997 WHERE "Examples" = 'illyria, cf. cirrhosis'
wikisql
CREATE TABLE table_73955 ( "Entered [A ]" text, "Weeks in top 10" real, "Single" text, "Artist" text, "Peak" real, "Peak reached [A ]" text, "Weeks at peak" real )
If the peak reached is 6 cannot handle non-empty timestamp argument! 1992, what is the entered?
SELECT "Entered [A ]" FROM table_73955 WHERE "Peak reached [A ]" = '6 Cannot handle non-empty timestamp argument! 1992'
wikisql
CREATE TABLE table_55732 ( "Rank" real, "Name" text, "Nation" text, "SP+FS" real, "Points" real, "Places" real )
Name the average SP+FS with places less tha 94 for renata baierova
SELECT AVG("SP+FS") FROM table_55732 WHERE "Places" < '94' AND "Name" = 'renata baierova'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, ...
what are the top four frequently prescribed drugs that patients have been prescribed within 2 months after having been prescribed simvastatin in 2103?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'simvastatin' AND STRFTIME('%y', prescriptions.startdate) = '2103'...
mimic_iii
CREATE TABLE table_name_66 ( starting_point VARCHAR, operates VARCHAR, name VARCHAR )
What is the starting point of the north/south operating Palafox Street route?
SELECT starting_point FROM table_name_66 WHERE operates = "north/south" AND name = "palafox street"
sql_create_context
CREATE TABLE table_31599 ( "Year" real, "Title" text, "U.S." text, "U.S. R&B" text, "U.S. dance" text )
What value for U.S. dance occurred in 1986 when the value of U.S. R&B was 9?
SELECT "U.S. dance" FROM table_31599 WHERE "Year" = '1986' AND "U.S. R&B" = '9'
wikisql
CREATE TABLE table_30165 ( "Series episode" real, "Season episode" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in million)" text )
What was the title of the episode viewed by 5.03 million viewers?
SELECT "Title" FROM table_30165 WHERE "U.S. viewers (in million)" = '5.03'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
give me the number of patients whose item id is 51221 and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51221" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_204_450 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
what was the total number of marathons in japan that lorraine moller competed in ?
SELECT COUNT("competition") FROM table_204_450 WHERE "venue" = 'japan'
squall
CREATE TABLE table_74325 ( "Player" text, "Matches" real, "Innings" real, "Runs" real, "Average" text, "Strike rate" text, "Highest Score" text, "50s" real )
What is the highest score for the player with average of 30.00?
SELECT "Highest Score" FROM table_74325 WHERE "Average" = '30.00'
wikisql
CREATE TABLE table_46235 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Series" text )
Which High points have High rebounds of lamar odom (15), and a Date of april 27?
SELECT "High points" FROM table_46235 WHERE "High rebounds" = 'lamar odom (15)' AND "Date" = 'april 27'
wikisql
CREATE TABLE mzb ( 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...
列出编号为7867709的这个医院中所有姓郎的病患的就诊记录详情,时间为两千年一月二日到两千零三年一月二日
SELECT * FROM qtb WHERE qtb.MED_SER_ORG_NO = '7867709' AND qtb.IN_HOSP_DATE BETWEEN '2000-01-02' AND '2013-01-02' AND qtb.PERSON_NM LIKE '郎%' UNION SELECT * FROM gyb WHERE gyb.MED_SER_ORG_NO = '7867709' AND gyb.IN_HOSP_DATE BETWEEN '2000-01-02' AND '2013-01-02' AND gyb.PERSON_NM LIKE '郎%' UNION SELECT * FROM zyb WHERE ...
css
CREATE TABLE table_train_176 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "estimated_glomerular_filtration_rate_egfr" int, "blood_glucose" int, "hypoglycemia" bool, "total_cholesterol" int, "low_density_lipoprotein_ldl_cholesterol" int, "triglyceride_t...
have a baseline hba1c level between 7.5 % and 10 %
SELECT * FROM table_train_176 WHERE hemoglobin_a1c_hba1c > 7.5 AND hemoglobin_a1c_hba1c < 10
criteria2sql
CREATE TABLE table_4879 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score of Richmond when they were the away team?
SELECT "Away team score" FROM table_4879 WHERE "Away team" = 'richmond'
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...
之前,患者22973171有哪些异常情况?
SELECT * FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i...
css
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH ...
审核人在检验结果指标记录57209046031上有什么工号、姓名?
SELECT SHRGH, SHRXM FROM jyjgzbb WHERE JYZBLSH = '57209046031'
css
CREATE TABLE table_12655 ( "Name" text, "Country" text, "Type" text, "Transfer window" text, "Transfer fee" text, "Apps" real, "Goals" real )
How many goals for Kenton have a transfer window of Summer?
SELECT COUNT("Goals") FROM table_12655 WHERE "Transfer window" = 'summer' AND "Name" = 'kenton'
wikisql
CREATE TABLE table_6269 ( "Tournament" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "Career Win-Loss" text )
Which in 2004 has a 2003 of 1r and Wimbledon Tournament
SELECT "2004" FROM table_6269 WHERE "2003" = '1r' AND "Tournament" = 'wimbledon'
wikisql
CREATE TABLE table_train_223 ( "id" int, "anemia" bool, "diabetic" string, "eye_disease" bool, "hgb" int, "retinal_pigmentation_abnormalities" bool, "glucose_6_phosphate_dehydrogenase_deficiency_g6pd" int, "age" float, "NOUSE" float )
anemia ( hgb < 9 )
SELECT * FROM table_train_223 WHERE anemia = 1 OR hgb < 9
criteria2sql
CREATE TABLE table_name_97 ( points INTEGER, nation VARCHAR, pts_game VARCHAR )
what is the average points when the nation is wales and the pts/game is more than 5?
SELECT AVG(points) FROM table_name_97 WHERE nation = "wales" AND pts_game > 5
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) 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 TA...
flight leaving from OAKLAND to SALT LAKE CITY
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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SALT L...
atis