context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_23 ( result VARCHAR, score VARCHAR )
Which result has a Score of 1 1?
SELECT result FROM table_name_23 WHERE score = "1–1"
sql_create_context
CREATE TABLE table_22467 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real )
Which township has a longitude of -98.741656?
SELECT "Township" FROM table_22467 WHERE "Longitude" = '-98.741656'
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...
how many patients are in admission location clinic referral/premature and with diagnosis icd9 code 431?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND diagnoses.icd9_code = "431"
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 ) ...
how many patients born before 2066 undertook procedure icd9 code 9983?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2066" AND procedures.icd9_code = "9983"
mimicsql_data
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId nu...
Questions with X amount of votes..
SELECT p.Id AS "post_link", p.Score, (SELECT COUNT(v.Id) FROM Votes AS v WHERE v.VoteTypeId IN (2, 3) AND v.PostId = p.Id) AS VoteCount, p.CreationDate FROM Posts AS p WHERE p.Score < '##ScoreInput##' AND (p.CreationDate < GETDATE() AND p.CreationDate > DATEADD(day, -'##DaysAgo##', GETDATE())) ORDER BY p.CreationDate D...
sede
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, COM_PAY number, DATA_ID text, ENT_ACC_PAY number, ENT_PAY number, F...
自二零零九年二月五日开始,截止到二零一零年十二月二十三日,患者07777908的在医治时做过几次检查
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '07777908' AND t_kc22.STA_DATE BETWEEN '2009-02-05' AND '2010-12-23' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients with newborn primary disease had joint fluid lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
Which kind of pesticide is the easiest to be tested?
SELECT MAX(pestcode) FROM resultsdata15
pesticide
CREATE TABLE table_61998 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" real )
What is To par, when Country is 'United States', and when Player is 'Jay Haas'?
SELECT "To par" FROM table_61998 WHERE "Country" = 'united states' AND "Player" = 'jay haas'
wikisql
CREATE TABLE table_name_61 ( position VARCHAR, played VARCHAR, goals_against VARCHAR, points_1 VARCHAR )
What is the total number of positions when there are more than 48 goals against, 1 of 29 points are played, and less than 34 games have been played?
SELECT COUNT(position) FROM table_name_61 WHERE goals_against > 48 AND points_1 = "29" AND played < 34
sql_create_context
CREATE TABLE table_4328 ( "Heat Rank" real, "Lane" real, "Swimmer" text, "Country" text, "Time" real, "Overall Rank" text )
Tell me the country for lane of 6
SELECT "Country" FROM table_4328 WHERE "Lane" = '6'
wikisql
CREATE TABLE table_25840200_1 ( titles VARCHAR, notes VARCHAR )
What was the title for the Undercard of Stevenson/Bellew?
SELECT titles FROM table_25840200_1 WHERE notes = "Undercard of Stevenson/Bellew"
sql_create_context
CREATE TABLE table_name_88 ( school VARCHAR, round VARCHAR )
From what school was the player drafted in round 3?
SELECT school FROM table_name_88 WHERE round = 3
sql_create_context
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, ...
list the flights from BALTIMORE to SEATTLE that stop in MINNEAPOLIS
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SEATTLE' AND CITY_2.ci...
atis
CREATE TABLE table_59588 ( "Name" text, "E-mail server" text, "Faxing" text, "Instant messaging" text, "Telephony" text, "Videoconferencing" text, "Web conferencing" text, "Data conferencing" text, "Application sharing" text, "Electronic meeting system" text, "Synchronous con...
What is Videoconferencing, when Synchronous Conferencing is 'No', when Web Conferencing is 'No', and when Faxing is 'Yes'?
SELECT "Videoconferencing" FROM table_59588 WHERE "Synchronous conferencing" = 'no' AND "Web conferencing" = 'no' AND "Faxing" = 'yes'
wikisql
CREATE TABLE table_37637 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" text )
Week smaller than 4, and a Game Site of rca dome, and a Opponent of new england patriots involves what date?
SELECT "Date" FROM table_37637 WHERE "Week" < '4' AND "Game Site" = 'rca dome' AND "Opponent" = 'new england patriots'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostFeedback ( Id number, PostId numb...
Top Irish users on Stackoverflow.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE Id = 1362136 ORDER BY Reputation DESC
sede
CREATE TABLE Claims ( Amount_Claimed INTEGER )
Find the total claimed amount of all the claims.
SELECT SUM(Amount_Claimed) FROM Claims
sql_create_context
CREATE TABLE table_18642 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What district had someone first elected in 1932?
SELECT "District" FROM table_18642 WHERE "First elected" = '1932'
wikisql
CREATE TABLE table_20334 ( "Week" real, "Date" text, "Result" text, "Record" text, "Opponent" text, "Points For" real, "Points Against" real, "First Downs" real, "Attendance" real )
What was the total number of first down on October 23?
SELECT COUNT("First Downs") FROM table_20334 WHERE "Date" = 'October 23'
wikisql
CREATE TABLE table_name_26 ( played VARCHAR, points VARCHAR )
Which 1990-1991 is the average one that has Played of 38, and Points of 40?
SELECT AVG(1990 AS _1991) FROM table_name_26 WHERE played = 38 AND points = 40
sql_create_context
CREATE TABLE table_26726 ( "Country or region" text, "Highest point" text, "Maximum elevation" text, "Lowest point" text, "Minimum elevation" text, "Elevation span" text )
What is the maximum elevation in netherlands?
SELECT "Maximum elevation" FROM table_26726 WHERE "Country or region" = 'Netherlands'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
provide the number of patients whose marital status is single and item id is 50911?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.itemid = "50911"
mimicsql_data
CREATE TABLE table_name_39 ( score INTEGER, place VARCHAR, player VARCHAR )
What is the average score of player lee trevino, who has a t8 place?
SELECT AVG(score) FROM table_name_39 WHERE place = "t8" AND player = "lee trevino"
sql_create_context
CREATE TABLE table_11114 ( "Jurisdiction" text, "Voted Yes" real, "Percent Yes" real, "Voted No" real, "Percent No" real )
What is the highest percent of yes Alberta, which had less than 60.2 vote no, has?
SELECT MAX("Percent Yes") FROM table_11114 WHERE "Jurisdiction" = 'alberta' AND "Percent No" < '60.2'
wikisql
CREATE TABLE table_53591 ( "Rank" real, "Name" text, "Nation" text, "Placings" real, "Figures" real, "Free" real, "Total" real )
What was the free score of the skater with a total of 156.67?
SELECT "Free" FROM table_53591 WHERE "Total" = '156.67'
wikisql
CREATE TABLE table_name_27 ( wins VARCHAR, byes INTEGER )
How many wins were there when the byes were more than 3?
SELECT COUNT(wins) FROM table_name_27 WHERE byes > 3
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
give me the number of patients whose days of hospital stay is greater than 27 and diagnoses short title is intermed coronary synd?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "27" AND diagnoses.short_title = "Intermed coronary synd"
mimicsql_data
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the minimum age of patients who stayed in hospital for 4 days and were admitted in or after the year 2177?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.days_stay = "4" AND demographic.admityear >= "2177"
mimicsql_data
CREATE TABLE table_name_30 ( number INTEGER, school_club_team VARCHAR )
What is the lowest Number, when School/Club Team is Misamis Institute?
SELECT MIN(number) FROM table_name_30 WHERE school_club_team = "misamis institute"
sql_create_context
CREATE TABLE table_name_81 ( points INTEGER, lost VARCHAR, games VARCHAR )
Which Points have a Lost smaller than 1, and Games larger than 7?
SELECT MAX(points) FROM table_name_81 WHERE lost < 1 AND games > 7
sql_create_context
CREATE TABLE table_80366 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text )
Which party's 1st member is William Denison in the election of 1832?
SELECT "1st Party" FROM table_80366 WHERE "1st Member" = 'william denison' AND "Election" = '1832'
wikisql
CREATE TABLE table_name_48 ( swimsuit INTEGER, preliminaries INTEGER )
What is the total swimsuit with Preliminaries smaller than 8.27?
SELECT SUM(swimsuit) FROM table_name_48 WHERE preliminaries < 8.27
sql_create_context
CREATE TABLE table_75267 ( "Nation" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
Who is the Second with Nikolina Petric as Third?
SELECT "Second" FROM table_75267 WHERE "Third" = 'nikolina petric'
wikisql
CREATE TABLE table_27551 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
What is the lowest attendance?
SELECT MIN("Attendance") FROM table_27551
wikisql
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, ...
号码08011688869的住院就诊的住病区号码和名号以及入院床位号码可以跟我说一下吗?
SELECT wdmzjzjlb.RZBQDM, wdmzjzjlb.RZBQMC, wdmzjzjlb.RYCWH FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '08011688869' UNION SELECT bdmzjzjlb.RZBQDM, bdmzjzjlb.RZBQMC, bdmzjzjlb.RYCWH FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '08011688869'
css
CREATE TABLE table_name_20 ( record VARCHAR, date VARCHAR )
Name the record for april 6
SELECT record FROM table_name_20 WHERE date = "april 6"
sql_create_context
CREATE TABLE table_name_32 ( college VARCHAR, school VARCHAR )
What college is getting a player that attends Wichita Heights High School?
SELECT college FROM table_name_32 WHERE school = "wichita heights high school"
sql_create_context
CREATE TABLE table_34732 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real )
Team of elgin city, and a Highest smaller than 537 had what total number of average?
SELECT COUNT("Average") FROM table_34732 WHERE "Team" = 'elgin city' AND "Highest" < '537'
wikisql
CREATE TABLE table_26769 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
How many positions were given when 30 points were won?
SELECT COUNT("Position") FROM table_26769 WHERE "Points" = '30'
wikisql
CREATE TABLE table_40281 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What is the average Week when there were more than 63,866 people in attendance on September 7, 1981?
SELECT AVG("Week") FROM table_40281 WHERE "Attendance" > '63,866' AND "Date" = 'september 7, 1981'
wikisql
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, ...
病员03874754的检测游离甲状腺素项目在2007年9月8日到16年8月20日期间是哪位医务人员做的员工号及姓名分别是什么?
SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyj...
css
CREATE TABLE table_name_58 ( pop__2010_ INTEGER, geo_id VARCHAR, longitude VARCHAR )
What is the highest 2010 population having GEO ID of 3802763220 and longitude over -98.936777?
SELECT MAX(pop__2010_) FROM table_name_58 WHERE geo_id = 3802763220 AND longitude > -98.936777
sql_create_context
CREATE TABLE wdmzjzjlb ( 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...
患有疾病V89.725的患者任和暖在门诊诊断时的二氧化碳的结果定量及其单位是多少?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_8703 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "Location Attendance" text, "Record" text )
What is listed for the High rebounds on the Date of March 31?
SELECT "High rebounds" FROM table_8703 WHERE "Date" = 'march 31'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, Cr...
Users with more than 28 questions.
WITH QuestionsPerUser AS (SELECT U.Id AS UserId, COUNT(*) AS QuestionCount FROM Users AS u INNER JOIN Posts AS p ON u.Id = p.OwnerUserId WHERE p.PostTypeId = 1 GROUP BY U.Id), UsersWITHMoreThan28Questions AS (SELECT * FROM QuestionsPerUser WHERE QuestionCount > 28) SELECT SUM(QuestionCount) FROM UsersWITHMoreThan28Ques...
sede
CREATE TABLE table_69580 ( "Year" real, "Team" text, "Chassis" text, "Engine" text, "Rank" text, "Points" real )
What rank is later than 1994?
SELECT "Rank" FROM table_69580 WHERE "Year" > '1994'
wikisql
CREATE TABLE table_943 ( "Rnd" real, "Circuit" text, "LMP1 Winning Team" text, "LMP2 Winning Team" text, "GT1 Winning Team" text, "GT2 Winning Team" text, "Results" text )
The results for gt2 winning team is all lars-erik nielsen allan simonsen richard westbrook.
SELECT "Results" FROM table_943 WHERE "GT2 Winning Team" = 'Lars-Erik Nielsen Allan Simonsen Richard Westbrook'
wikisql
CREATE TABLE table_name_46 ( year INTEGER, animal VARCHAR )
What year was the downy woodpecker coin created?
SELECT SUM(year) FROM table_name_46 WHERE animal = "downy woodpecker"
sql_create_context
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, a...
what is patient 015-56556's daily minimum level of anion gap during the previous year?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-56556')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime, 'start ...
eicu
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
how many patients have undergone wound care until 1 year ago in the same month after the first procedure of a antiarrhythmics - class iv antiarrhythmic?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiarrhythmics - class iv antiarrhythmic' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(),...
eicu
CREATE TABLE authorship ( authid number, instid number, paperid number, authorder number ) CREATE TABLE papers ( paperid number, title text ) CREATE TABLE authors ( authid number, lname text, fname text ) CREATE TABLE inst ( instid number, name text, country text )
Which papers' first author is affiliated with an institution in the country 'Japan' and has last name 'Ohori'? Give me the titles of the papers.
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "Japan" AND t2.authorder = 1 AND t1.lname = "Ohori"
spider
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE treatment ( treat...
what was the weight change in patient 015-59552 second measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59552' AND patient.hospitaldischargetime IS NULL) AND NOT patient.admissionweight IS NULL ORDER BY patient.unitadmittime LIMIT 1 OFFSET 1) ...
eicu
CREATE TABLE table_66875 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text, "Note" text )
Name the format for 12cm note and catalog of alca-9198
SELECT "Format" FROM table_66875 WHERE "Note" = '12cm' AND "Catalog" = 'alca-9198'
wikisql
CREATE TABLE table_46453 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What was the sum of the rounds for the player who had a position of LS and an overall draft pick bigger than 230?
SELECT SUM("Round") FROM table_46453 WHERE "Position" = 'ls' AND "Overall" > '230'
wikisql
CREATE TABLE table_21295 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the team for arco arena 13,685
SELECT "Team" FROM table_21295 WHERE "Location Attendance" = 'ARCO Arena 13,685'
wikisql
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, countr...
The PreMajor classes are ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id
advising
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId...
Top 100 users in a given tag (TeX version). This query fetches the top 100 users on a given tag name. The original query is available here: data.stackexchange.com/stackoverflow/s/1791
SELECT u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t WITH (nolock) INNER JOIN PostTags AS pt WITH (nolock) ON pt.TagId = t.Id INNER JOIN Posts AS p WITH (nolock) ON p.ParentId = pt.PostId INNER JOIN Votes AS v WITH (nolock) ON v.PostId = p.Id AND v.VoteTypeId = 2 INNER JOIN Users AS u WITH (nolock) ON u.Id = ...
sede
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Documents ( Document_ID INTEGER, Document_Type_Code CHAR(15), Project_ID INTEGER, Document_Date DATETIME, Document_Name VARCHAR(255), Document_Description VARCHAR(255), Oth...
Show the number of documents for different document name in a bar chart, order bar in asc order.
SELECT Document_Name, COUNT(Document_Name) FROM Documents GROUP BY Document_Name ORDER BY Document_Name
nvbench
CREATE TABLE table_name_58 ( tournament VARCHAR )
What french open tournament happened in 2010 and has a 2004 1r?
SELECT 2010 FROM table_name_58 WHERE 2004 = "1r" AND tournament = "french open"
sql_create_context
CREATE TABLE table_55814 ( "Locomotive" text, "Serial No" text, "Entered service" text, "Gauge" text, "Livery" text )
What is the locomotive with a standard gauge and a serial number of 83-1015?
SELECT "Locomotive" FROM table_55814 WHERE "Gauge" = 'standard' AND "Serial No" = '83-1015'
wikisql
CREATE TABLE storm ( Storm_ID int, Name text, Dates_active text, Max_speed int, Damage_millions_USD real, Number_Deaths int ) CREATE TABLE affected_region ( Region_id int, Storm_ID int, Number_city_affected real ) CREATE TABLE region ( Region_id int, Region_code text, R...
Return a bar chart on how many regions were affected by each storm?, list in descending by the names please.
SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY Name DESC
nvbench
CREATE TABLE table_name_94 ( place VARCHAR, comp VARCHAR, date VARCHAR )
What's the place of 1989 with a comp of ECH?
SELECT place FROM table_name_94 WHERE comp = "ech" AND date = "1989"
sql_create_context
CREATE TABLE table_name_75 ( john_oxendine VARCHAR, karen_handel VARCHAR )
What is John Oxendine at in the poll where Karen Handel is at 38%?
SELECT john_oxendine FROM table_name_75 WHERE karen_handel = "38%"
sql_create_context
CREATE TABLE table_57118 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the highest number of laps when the Time/Retired is differential?
SELECT MAX("Laps") FROM table_57118 WHERE "Time/Retired" = 'differential'
wikisql
CREATE TABLE table_3122 ( "Rank" text, "Player" text, "Nationality" text, "Team" text, "Opponent" text, "Score" text, "Competition" text, "Vote percentage" text )
What was the score for the 1st ranked team?
SELECT "Score" FROM table_3122 WHERE "Rank" = '1st'
wikisql
CREATE TABLE table_18475946_2 ( rnag__mhz_ VARCHAR, lyric_fm__mhz_ VARCHAR )
What is the rnag for lyric fm 98.7?
SELECT rnag__mhz_ FROM table_18475946_2 WHERE lyric_fm__mhz_ = "98.7"
sql_create_context
CREATE TABLE table_60707 ( "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text )
What is the week 3, prior to the when the week 4 was Laura Nicole?
SELECT "Week 4" FROM table_60707 WHERE "Week 3" = 'laura nicole'
wikisql
CREATE TABLE table_train_118 ( "id" int, "hypocalcemia" bool, "heart_disease" bool, "renal_disease" bool, "fibrinogen" float, "diastolic_blood_pressure_dbp" int, "symptomatic_hypotension" bool, "serum_creatinine" float, "ca" float, "hypertension" bool, "NOUSE" float )
fibrinogen < 1.5 g / l )
SELECT * FROM table_train_118 WHERE fibrinogen < 1.5
criteria2sql
CREATE TABLE table_name_49 ( date VARCHAR, home_team VARCHAR )
When the Home team was north melbourne what was the Date of the game?
SELECT date FROM table_name_49 WHERE home_team = "north melbourne"
sql_create_context
CREATE TABLE table_name_96 ( to_par INTEGER, country VARCHAR, score VARCHAR )
What is the lowest to par of a player from australia with a score of 76-70-75-72=293?
SELECT MIN(to_par) FROM table_name_96 WHERE country = "australia" AND score = 76 - 70 - 75 - 72 = 293
sql_create_context
CREATE TABLE table_train_269 ( "id" int, "pregnancy_or_lactation" bool, "hemoglobin_a1c_hba1c" float, "diabetic" string, "hba1c" float, "prisoners" bool, "age" float, "NOUSE" float )
age 18 or older
SELECT * FROM table_train_269 WHERE age >= 18
criteria2sql
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 prescription...
what is religion of subject name paul edwards?
SELECT demographic.religion FROM demographic WHERE demographic.name = "Paul Edwards"
mimicsql_data
CREATE TABLE table_204_631 ( id number, "#" number, "title" text, "english translation" text, "original album" text, "length" text )
how many albums are more than 3:30 long ?
SELECT COUNT("title") FROM table_204_631 WHERE "length" > '3:30'
squall
CREATE TABLE table_48088 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text )
Which Event has a Record of 19-9?
SELECT "Event" FROM table_48088 WHERE "Record" = '19-9'
wikisql
CREATE TABLE table_42487 ( "English" text, "German" text, "Dutch" text, "Icelandic" text, "Latin" text, "Greek" text, "Russian" text )
What is the Icelandic word for the English word bride?
SELECT "Icelandic" FROM table_42487 WHERE "English" = 'bride'
wikisql
CREATE TABLE table_17120964_8 ( venue VARCHAR, man_of_the_match VARCHAR )
What is the venue of the game with Man of the Match Vaclav Zavoral?
SELECT venue FROM table_17120964_8 WHERE man_of_the_match = "Vaclav Zavoral"
sql_create_context
CREATE TABLE table_name_11 ( year INTEGER, date VARCHAR )
Which Year has a Date of 14 February?
SELECT MIN(year) FROM table_name_11 WHERE date = "14 february"
sql_create_context
CREATE TABLE table_name_21 ( measurement VARCHAR, estimated_function__percentage INTEGER )
What is the measurement where the estimated function % is less than 20?
SELECT measurement FROM table_name_21 WHERE estimated_function__percentage < 20
sql_create_context
CREATE TABLE culture_company ( Company_name text, Type text, Incorporated_in text, Group_Equity_Shareholding real, book_club_id text, movie_id text ) CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREAT...
Show all book categories and the number of books in each category in a pie chart.
SELECT Category, COUNT(*) FROM book_club GROUP BY Category
nvbench
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
count the number of patients whose diagnoses icd9 code is 40391 and lab test category is chemistry?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "40391" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
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, ...
provide the number of patients whose admission type is elective and admission location is trsf within this facility.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.admission_location = "TRSF WITHIN THIS FACILITY"
mimicsql_data
CREATE TABLE table_name_73 ( date VARCHAR, home_team VARCHAR, game VARCHAR )
On what date was the game 1 played at Portland?
SELECT date FROM table_name_73 WHERE home_team = "portland" AND game = "game 1"
sql_create_context
CREATE TABLE table_name_12 ( roll VARCHAR, name VARCHAR )
What is the total number of roll for Te Hapua school?
SELECT COUNT(roll) FROM table_name_12 WHERE name = "te hapua school"
sql_create_context
CREATE TABLE table_204_202 ( id number, "year" number, "tournament" text, "venue" text, "result" text, "rank" text, "event" text )
what was the first olympic games in which indrek kaseorg competed ?
SELECT MIN("year") FROM table_204_202 WHERE "tournament" = 'olympic games'
squall
CREATE TABLE table_11647 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum number of bronzes when the rank is less than 2 and the gold is less than 1?
SELECT COUNT("Bronze") FROM table_11647 WHERE "Rank" < '2' AND "Gold" < '1'
wikisql
CREATE TABLE table_name_79 ( tie_no VARCHAR, away_team VARCHAR )
What was the tie number of the away game for Ashford Town (Middx)?
SELECT tie_no FROM table_name_79 WHERE away_team = "ashford town (middx)"
sql_create_context
CREATE TABLE table_name_58 ( tv_seasons INTEGER, tv_series VARCHAR, species VARCHAR )
What is the smallest season for a tv series with a yes and human was the species?
SELECT MIN(tv_seasons) FROM table_name_58 WHERE tv_series = "yes" AND species = "human"
sql_create_context
CREATE TABLE table_204_234 ( id number, "round" text, "100 yd (91 m)" text, "80 yd (73 m)" text, "60 yd (55 m)" text, "50 yd (46 m)" text, "40 yd (37 m)" text )
who is at the top of the chart ?
SELECT "round" FROM table_204_234 ORDER BY id LIMIT 1
squall
CREATE TABLE table_21058823_1 ( date VARCHAR, record VARCHAR )
How many games did they play when their record 0-2-0?
SELECT COUNT(date) FROM table_21058823_1 WHERE record = "0-2-0"
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_...
how many passengers can a BOEING 737 hold
SELECT DISTINCT aircraft_code FROM aircraft WHERE basic_type = '737' AND manufacturer = 'BOEING'
atis
CREATE TABLE table_203_440 ( id number, "rank" number, "player" text, "from" text, "to" text, "transfer fee\n(\u20ac million)" number, "year" number )
how many players had a transfer fee of at least 8 million ?
SELECT COUNT("player") FROM table_203_440 WHERE "transfer fee\n(\u20ac million)" >= 8
squall
CREATE TABLE table_78835 ( "Country" text, "Career" text, "Victories" real, "Super G" text, "Giant Slalom" text, "Slalom" text, "Combined" text, "Parallel" text )
What Career has a Super G of 5, and a Combined of 6?
SELECT "Career" FROM table_78835 WHERE "Super G" = '5' AND "Combined" = '6'
wikisql
CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varcha...
Bar chart of mean stu gpa from each dept code, sort in descending by the total number.
SELECT DEPT_CODE, AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE ORDER BY AVG(STU_GPA) DESC
nvbench
CREATE TABLE table_name_85 ( director VARCHAR, title VARCHAR )
What is the Director for the episode titled some lapse of time ?
SELECT director FROM table_name_85 WHERE title = "“some lapse of time”"
sql_create_context
CREATE TABLE table_name_41 ( sport VARCHAR, medal VARCHAR, games VARCHAR )
Which sport resulted in a gold medal in the 2000 Sydney games?
SELECT sport FROM table_name_41 WHERE medal = "gold" AND games = "2000 sydney"
sql_create_context
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
when did patient 004-79017 last got the maximum of respiration on the current icu visit?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017') AND patient.unitdischargetime IS NULL) ...
eicu
CREATE TABLE table_29979 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Who directed the episode with an audience of 14.11 million?
SELECT "Directed by" FROM table_29979 WHERE "U.S. viewers (million)" = '14.11'
wikisql
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_...
For upper level elective classes offered next semester , which ones do n't meet on Fridays ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' 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 = 'FA' ...
advising
CREATE TABLE made_by ( id int, msid int, pid int ) CREATE TABLE genre ( gid int, genre text ) CREATE TABLE tags ( id int, msid int, kid int ) CREATE TABLE movie ( mid int, title text, release_year int, title_aka text, budget text ) CREATE TABLE writer ( wid in...
List all the directors of movies about nuclear weapons
SELECT director.name FROM directed_by, director, keyword, movie, tags WHERE director.did = directed_by.did AND keyword.keyword = 'nuclear weapons' AND movie.mid = directed_by.msid AND tags.kid = keyword.id AND tags.msid = movie.mid
imdb