context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_54399 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
What was the final score of the game on June 17?
SELECT "Score" FROM table_54399 WHERE "Date" = 'june 17'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
when did patient 017-88691 last have sodium maximum since 12/2105?
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 = '017-88691')) AND lab.labname = 'sodium' AND STRFTIME('%y-%m', lab.labresulttime) >=...
eicu
CREATE TABLE table_name_13 ( area VARCHAR, _percentage_other VARCHAR )
What area has a percentage of other of 3%?
SELECT area FROM table_name_13 WHERE _percentage_other = "3%"
sql_create_context
CREATE TABLE table_10321124_1 ( ↓_function___genus_→ VARCHAR, shigella VARCHAR )
what's the function / genus with shigella being spa32
SELECT ↓_function___genus_→ FROM table_10321124_1 WHERE shigella = "Spa32"
sql_create_context
CREATE TABLE table_79724 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What opponent has a record of 86-62?
SELECT "Opponent" FROM table_79724 WHERE "Record" = '86-62'
wikisql
CREATE TABLE table_name_99 ( branding VARCHAR, callsign VARCHAR )
What is the Branding with a Callsign DWLL?
SELECT branding FROM table_name_99 WHERE callsign = "dwll"
sql_create_context
CREATE TABLE table_10342194_3 ( amount_of_trees VARCHAR, _that_require_replacement VARCHAR, district VARCHAR )
What is the amount of trees, that require replacement when the district is motovilikhinsky?
SELECT amount_of_trees, _that_require_replacement FROM table_10342194_3 WHERE district = "Motovilikhinsky"
sql_create_context
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, ...
what were the top five most frequent specimen test for patients within the same month after the diagnosis of valvular insufficiency - mitral valve?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular insufficiency - mitral valve') AS t...
eicu
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduct...
On Mondays and Wednesday is 545 available to take ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
advising
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...
从01年1月31日一直到09年8月12日内患者80476579被开出盐酸多奈哌齐片(薄膜)的总次数一共有多少?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '80476579' AND t_kc22.STA_DATE BETWEEN '2001-01-31' AND '2009-08-12' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐片(薄膜)'
css
CREATE TABLE table_19882 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What is Segment B for series episode 12-02?
SELECT "Segment B" FROM table_19882 WHERE "Series Ep." = '12-02'
wikisql
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 ) ...
count the number of patients whose procedure long title is thoracentesis and lab test category is blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Thoracentesis" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_203_857 ( id number, "denomination" text, "1870" text, "1880" text, "1890" text, "1900" text, "1910" text, "1920" text, "1930" text, "1941" text, "1949" text, "2001" text, "2011" text )
which religious denomination had a higher percentage in 1900 , jewish or roman catholic ?
SELECT "denomination" FROM table_203_857 WHERE "denomination" IN ('jewish', 'roman catholic') ORDER BY "1900" DESC LIMIT 1
squall
CREATE TABLE table_name_12 ( series VARCHAR, game VARCHAR )
Name the series for game 5
SELECT series FROM table_name_12 WHERE game = "game 5"
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...
count the number of patients whose ethnicity is asian and diagnosis long title is suicide and self-inflicted injury by hanging.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Suicide and self-inflicted injury by hanging"
mimicsql_data
CREATE TABLE table_38770 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text )
Who won a medal at the 2008 Beijing Olympics?
SELECT "Name" FROM table_38770 WHERE "Games" = '2008 beijing'
wikisql
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPriv...
2016 answers by users with no answers before 2016.
SELECT A.Id AS "post_link", A.Score, U.DisplayName FROM Posts AS A JOIN Users AS U ON A.OwnerUserId = U.Id WHERE YEAR(A.CreationDate) = 2017 AND A.PostTypeId = 2 AND NOT EXISTS(SELECT * FROM Posts AS A2 WHERE A2.OwnerUserId = U.Id AND YEAR(A2.CreationDate) < 2016 AND A2.PostTypeId = 2) ORDER BY A.Score DESC
sede
CREATE TABLE table_72782 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Time" text )
Name the ground for essendon
SELECT "Ground" FROM table_72782 WHERE "Home team" = 'Essendon'
wikisql
CREATE TABLE table_203_18 ( id number, "year" number, "film" text, "role" text, "co-star" text, "director" text, "notes" text )
how long has she been making films ?
SELECT (SELECT MAX("year") FROM table_203_18) - (SELECT MIN("year") FROM table_203_18)
squall
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, ...
门诊给患者31141271的诊断为支气管炎,他的尿素检查的结果定量及其单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.Y...
css
CREATE TABLE table_54445 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What driver has 44 laps?
SELECT "Driver" FROM table_54445 WHERE "Laps" = '44'
wikisql
CREATE TABLE table_28819393_1 ( average_votes_per_candidate INTEGER, average__percentage_of_vote_per_candidate VARCHAR )
When 3.29% was the average per candidate, what was the number of average votes per candidate?
SELECT MIN(average_votes_per_candidate) FROM table_28819393_1 WHERE average__percentage_of_vote_per_candidate = "3.29"
sql_create_context
CREATE TABLE table_name_12 ( results¹ VARCHAR, type_of_game VARCHAR, date VARCHAR )
What is the Results that was a friendly game and played on June 25?
SELECT results¹ FROM table_name_12 WHERE type_of_game = "friendly" AND date = "june 25"
sql_create_context
CREATE TABLE table_46584 ( "Place" text, "Player" text, "Country" text, "Score" text, "To Par" text )
What is Country, when Place is 'T9', and when Player is 'Jay Hebert'?
SELECT "Country" FROM table_46584 WHERE "Place" = 't9' AND "Player" = 'jay hebert'
wikisql
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDe...
Top 1000 users from Colombia.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%colombia%' ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, ...
what is the yearly average amount of urinary catheter output: coude urethral 14 fr. that patient 006-13677 had since 08/2105?
SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-13677')) AND intakeoutput.celllabel = 'urina...
eicu
CREATE TABLE field ( fieldid int ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE...
What papers has mirella lapata written ?
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'mirella lapata' AND writes.authorid = author.authorid
scholar
CREATE TABLE section ( course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), building varchar(15), room_number varchar(7), time_slot_id varchar(4) ) CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numer...
Give me a histogram for what is the lowest salary in departments with average salary greater than the overall average, and could you rank by the x axis in asc?
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, ...
检验报告单10369980822上的就诊类型都是什么类型?
SELECT JZLX FROM jybgb WHERE BGDH = '10369980822'
css
CREATE TABLE table_41463 ( "Name" text, "Position" text, "Number" text, "Season" text, "Acquisition via" text )
What name has 8 as the number?
SELECT "Name" FROM table_41463 WHERE "Number" = '8'
wikisql
CREATE TABLE table_26986076_6 ( sat_21_aug VARCHAR, tues_24_aug VARCHAR )
What was the Sat 21 Aug time for the rider whose Tues 24 Aug time was 20' 38.40 109.680mph?
SELECT sat_21_aug FROM table_26986076_6 WHERE tues_24_aug = "20' 38.40 109.680mph"
sql_create_context
CREATE TABLE table_55763 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
what is the number of laps when the driver is ron flockhart?
SELECT COUNT("Laps") FROM table_55763 WHERE "Driver" = 'ron flockhart'
wikisql
CREATE TABLE table_60792 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What year did the player with a t3 finish win?
SELECT "Year(s) won" FROM table_60792 WHERE "Finish" = 't3'
wikisql
CREATE TABLE table_79299 ( "Period" text, "Internet Explorer" text, "Firefox" text, "Chrome" text, "Safari" text, "Opera" text, "Other" text )
What safari has 2012 q4 as the period?
SELECT "Safari" FROM table_79299 WHERE "Period" = '2012 q4'
wikisql
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, Exp...
Top SO in South Carolina.
SELECT Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%charleston, sc%' OR LOWER(Location) LIKE '%south carolina%' ORDER BY Reputation DESC
sede
CREATE TABLE table_2511876_1 ( league VARCHAR, year VARCHAR )
Name the league for 2003
SELECT league FROM table_2511876_1 WHERE year = 2003
sql_create_context
CREATE TABLE table_name_19 ( Id VARCHAR )
What is the highest 2003 value with a 2011 less than 107 and a 1995 value less than 17?
SELECT MAX(2003) FROM table_name_19 WHERE 2011 < 107 AND 1995 < 17
sql_create_context
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Dorm_amenity ( amenid ...
Give me a histogram for how many students are older than 20 in each dorm?, and rank by the Y in ascending please.
SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY COUNT(*)
nvbench
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of email and commission_pct , sort X-axis in asc order.
SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL
nvbench
CREATE TABLE table_41217 ( "Ballarat FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the total number of wins for Darley of Ballarat FL against larger than 1055?
SELECT COUNT("Wins") FROM table_41217 WHERE "Ballarat FL" = 'darley' AND "Against" > '1055'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
what is the number of elective hospital admission patients who have lab test item id 50927?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "50927"
mimicsql_data
CREATE TABLE table_42227 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the number of top-25s in events under 13, cuts made under 3, and 1 top-10?
SELECT "Top-25" FROM table_42227 WHERE "Events" < '13' AND "Cuts made" < '3' AND "Top-10" = '1'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, ...
Which 400 / 500 -level PERIODON courses have the least workload ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'PERIODON' AND program_course.workload = (SELECT MIN(P...
advising
CREATE TABLE table_name_47 ( player VARCHAR, round VARCHAR, position VARCHAR )
Who is the player from round 13 that plays center?
SELECT player FROM table_name_47 WHERE round = 13 AND position = "center"
sql_create_context
CREATE TABLE table_name_59 ( record VARCHAR, visitor VARCHAR, home VARCHAR )
What was the record when the visitor was Cleveland in Dallas?
SELECT record FROM table_name_59 WHERE visitor = "cleveland" AND home = "dallas"
sql_create_context
CREATE TABLE table_203_154 ( id number, "type" text, "manufacturer" text, "numbers" text, "year built" number, "quantity built" number, "power (horsepower)" number, "max speed (km/h)" number, "note" text )
which type has the lowest max speed ?
SELECT "type" FROM table_203_154 ORDER BY "max speed (km/h)" LIMIT 1
squall
CREATE TABLE table_53218 ( "Year" real, "Tracks" text, "Title" text, "Format, Special Notes" text, "Label" text )
What is the Format and Special Notes for of the pact: ...of the gods?
SELECT "Format, Special Notes" FROM table_53218 WHERE "Title" = 'the pact: ...of the gods'
wikisql
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
During the Winter , which PERSIAN classes , upper level , are offered ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PERSIAN' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Win...
advising
CREATE TABLE table_25965003_3 ( conditions_of_access VARCHAR, access_using_a_croatian_identity_card VARCHAR, length_of_stay_permitted VARCHAR )
What are the conditions of access where access using a Croatian identity card is yes and the length of stay permitted is freedom of movement?
SELECT conditions_of_access FROM table_25965003_3 WHERE access_using_a_croatian_identity_card = "Yes" AND length_of_stay_permitted = "Freedom of movement"
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...
i need a flight on AC from TORONTO to SAN DIEGO with a layover in WASHINGTON
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 = 'SAN DIEGO' AND CITY_2...
atis
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JO...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by weekday, and list by the Y-axis in descending.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
how many patients aged below 70 years had a drug route ivpca?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "70" AND prescriptions.route = "IVPCA"
mimicsql_data
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, Revision...
Suggested Edit Review Stats (your approval rate).
SELECT total, approved, rejected, ROUND(CAST(approved * 100 AS FLOAT) / total, 1) AS ApprovedPercentage, ROUND(CAST(rejected * 100 AS FLOAT) / total, 1) AS RejectedPercentage FROM (SELECT COUNT(Id) AS total, COUNT(ApprovalDate) AS approved, COUNT(RejectionDate) AS rejected FROM SuggestedEdits WHERE OwnerUserId = @UserI...
sede
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 PostFeedback ( Id number, PostId numb...
Users with Post Tags Sorted by Reputation (without links to Posts).
SELECT DISTINCT u.Id AS "user_link", CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.UpVotes, u.DownVotes, u.EmailHash, u.Reputation FROM Users AS u, Posts AS p, Tags AS t, PostTags AS pt WHERE (u.Id = p.OwnerUserId) AND (pt.PostId = p.I...
sede
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, ...
How many questions have these tags?.
SELECT SUM(CASE WHEN p.Tags LIKE '%<access-vba>%' THEN 1 ELSE 0 END) AS accessTag, SUM(CASE WHEN p.Tags LIKE '%<access-vba>%' AND NOT p.Tags LIKE '%<ms-access>%' THEN 1 ELSE 0 END) AS accessWOms, SUM(CASE WHEN p.Tags LIKE '%<access-vba>%' AND NOT p.Tags LIKE '%<vba>%' THEN 1 ELSE 0 END) AS accessWOvba, SUM(CASE WHEN p....
sede
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
getting all TagSynonyms mapped to Tags.
SELECT DISTINCT t1.TagName FROM Tags AS t1, TagSynonyms AS t2 WHERE t1.TagName = t2.TargetTagName ORDER BY t1.TagName
sede
CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE songs ( songid number, title text ) CREATE...
How many instruments does the song 'Le Pop' use?
SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop"
spider
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
count the number of patients whose primary disease is aortic valve insufficiency/aortic valve replacement/sda and lab test fluid is blood.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_10499 ( "Title" text, "Format" text, "Label" text, "Catalog number" text, "Formats" text, "Year" real )
Tell me the format with year more than 2000 and label of myuzyk with catalog number of mzykn08
SELECT "Format" FROM table_10499 WHERE "Year" > '2000' AND "Label" = 'myuzyk' AND "Catalog number" = 'mzykn08'
wikisql
CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata t...
For each airport name, how many routes start at that airport?
SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name
spider
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...
医院9698019的非科室3455负责的所有医疗就诊记录有哪些在2001-11-15到2014-12-27内?
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9698019' AND gwyjzb.IN_HOSP_DATE BETWEEN '2001-11-15' AND '2014-12-27' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9698019' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2001-11-15' AND '2014-12-27' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '969801...
css
CREATE TABLE table_78149 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the name of the Venue for the team that has an Away team score of 14.11 (95)?
SELECT "Venue" FROM table_78149 WHERE "Away team score" = '14.11 (95)'
wikisql
CREATE TABLE table_204_814 ( id number, "date" text, "opposition" text, "result" text, "score" text, "brazil scorers" text, "competition" text )
did brazil score more goals against the soviet union or portugal in 1982 ?
SELECT "opposition" FROM table_204_814 WHERE "opposition" IN ('soviet union', 'portugal') ORDER BY "score" DESC LIMIT 1
squall
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE aircraft ( aircraft_code varc...
on monday show me flights from BALTIMORE to DALLAS
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND date_day.day_number = 21 AND date_day.month_number = 2 AND da...
atis
CREATE TABLE table_35992 ( "Game" real, "January" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which Opponent has a January larger than 8, and a Game smaller than 48, and a Score of 5 3?
SELECT "Opponent" FROM table_35992 WHERE "January" > '8' AND "Game" < '48' AND "Score" = '5–3'
wikisql
CREATE TABLE table_54943 ( "Year" real, "Artist" text, "Composition" text, "Mintage" real, "Issue Price" text )
What is the lowest Mintage for the Artist Royal Canadian Mint Engravers, in the Year 2009, with an Issue Price of $10,199.95?
SELECT MIN("Mintage") FROM table_54943 WHERE "Artist" = 'royal canadian mint engravers' AND "Issue Price" = '$10,199.95' AND "Year" > '2009'
wikisql
CREATE TABLE table_203_568 ( id number, "town/village" text, "population" number, "postal code" text, "municipality" text, "island" text, "location" text )
which town would come first in alphabetical order , of all the towns in the faroe islands ?
SELECT "town/village" FROM table_203_568 ORDER BY "town/village" LIMIT 1
squall
CREATE TABLE table_49565 ( "Tie no" real, "Home team" text, "Score" text, "Away team" text, "Attendance" real )
What is the average attendance of the match with arlesey town as the home team?
SELECT AVG("Attendance") FROM table_49565 WHERE "Home team" = 'arlesey town'
wikisql
CREATE TABLE table_name_98 ( attendance INTEGER, points_for VARCHAR, first_downs VARCHAR, opponent VARCHAR )
Which Attendance has a First Downs smaller than 26, an Opponent of los angeles rams, and Points For larger than 28?
SELECT SUM(attendance) FROM table_name_98 WHERE first_downs < 26 AND opponent = "los angeles rams" AND points_for > 28
sql_create_context
CREATE TABLE table_204_771 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what is the total numbers of medals won by ecuador ?
SELECT "total" FROM table_204_771 WHERE "nation" = 'ecuador'
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, ...
潘德庸这个患者有过哪些住院诊断历史
SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE person_info.XM = '潘德庸' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM person_info JOIN...
css
CREATE TABLE table_name_95 ( series VARCHAR, team VARCHAR )
what is the series when the team is gunbroker racing?
SELECT series FROM table_name_95 WHERE team = "gunbroker racing"
sql_create_context
CREATE TABLE table_55615 ( "Network" text, "8:00 PM" text, "8:30 PM" text, "9:00 PM" text, "9:30 PM" text, "10:00 PM" text )
What is the network that plays ugly betty?
SELECT "Network" FROM table_55615 WHERE "8:30 PM" = 'ugly betty'
wikisql
CREATE TABLE table_1013129_11 ( college_junior_club_team VARCHAR, nhl_team VARCHAR )
What college/junior/club teams do the players from the St. Louis Blues come from?
SELECT college_junior_club_team FROM table_1013129_11 WHERE nhl_team = "St. Louis Blues"
sql_create_context
CREATE TABLE table_28685 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (million)" text )
What is the name of chapter 8 of season 4?
SELECT "Title" FROM table_28685 WHERE "No. in season" = '8'
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 living patients were diagnosed with procedure icd9 code 3897?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3897"
mimicsql_data
CREATE TABLE table_name_62 ( events INTEGER, top_25 VARCHAR, wins VARCHAR )
What is the average Events when the top-25 is 12 and there are less than 0 wins?
SELECT AVG(events) FROM table_name_62 WHERE top_25 = 12 AND wins < 0
sql_create_context
CREATE TABLE table_60875 ( "English Name" text, "Simplified" text, "Traditional" text, "Pinyin" text, "Area" text, "Population" text, "Density" text )
What is the population of area of 11?
SELECT "Population" FROM table_60875 WHERE "Area" = '11'
wikisql
CREATE TABLE table_name_2 ( score VARCHAR, date VARCHAR )
Which Score has a Date of july 20?
SELECT score FROM table_name_2 WHERE date = "july 20"
sql_create_context
CREATE TABLE grapes ( ID INTEGER, Grape TEXT, Color TEXT ) CREATE TABLE wine ( No INTEGER, Grape TEXT, Winery TEXT, Appelation TEXT, State TEXT, Name TEXT, Year INTEGER, Price INTEGER, Score INTEGER, Cases INTEGER, Drink TEXT ) CREATE TABLE appellations ( No...
Display a bar chart for what are the numbers of wines for different grapes?
SELECT Grape, COUNT(*) FROM wine GROUP BY Grape
nvbench
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEdits ( ...
Pundit comments, with scores, sorted DESC.
SELECT Id AS "comment_link", Score FROM Comments WHERE UserId = '##UserId##' AND Score > 0 ORDER BY Score DESC
sede
CREATE TABLE table_name_33 ( score VARCHAR, visitor VARCHAR )
What is the score when Miami is the visitor?
SELECT score FROM table_name_33 WHERE visitor = "miami"
sql_create_context
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 diagnoses ( ...
provide the number of patients whose year of birth is less than 2156 and drug name is levetiracetam?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2156" AND prescriptions.drug = "Levetiracetam"
mimicsql_data
CREATE TABLE table_name_93 ( wards__branches_in_arkansas INTEGER, stake VARCHAR )
What is the sum of the wards/branches in Arkansas of the North Little Rock Arkansas stake?
SELECT SUM(wards__branches_in_arkansas) FROM table_name_93 WHERE stake = "north little rock arkansas"
sql_create_context
CREATE TABLE table_name_80 ( score VARCHAR, home VARCHAR, decision VARCHAR, visitor VARCHAR )
Name the score when it had a decision of dipietro and visitor of ny islanders with home of colorado
SELECT score FROM table_name_80 WHERE decision = "dipietro" AND visitor = "ny islanders" AND home = "colorado"
sql_create_context
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...
Get High-Scoring Comments and associated posts, by User ID.
SELECT * FROM Comments JOIN Posts ON Comments.PostId = Posts.Id JOIN PostLinks ON Posts.Id = PostLinks.PostId WHERE UserId = @UserID AND Comments.Score >= 0 ORDER BY Comments.Score DESC
sede
CREATE TABLE table_21530474_1 ( drivetrain VARCHAR, engine_code VARCHAR, chassis_code VARCHAR )
Name the drivetrain for 1ur-fse for usf41
SELECT drivetrain FROM table_21530474_1 WHERE engine_code = "1UR-FSE" AND chassis_code = "USF41"
sql_create_context
CREATE TABLE table_name_45 ( name VARCHAR, party VARCHAR )
What is the name of the minister from the party of minister for community safety and legal affairs?
SELECT name FROM table_name_45 WHERE party = "minister for community safety and legal affairs"
sql_create_context
CREATE TABLE table_43740 ( "Season" real, "Overall" real, "Slalom" text, "Giant Slalom" real, "Super G" text, "Downhill" text, "Combined" text )
What season had a combined of 13 and a Giant Slalom more than 31?
SELECT MAX("Season") FROM table_43740 WHERE "Combined" = '13' AND "Giant Slalom" > '31'
wikisql
CREATE TABLE table_name_78 ( week INTEGER, opponent VARCHAR )
What week did the dallas cowboys play?
SELECT SUM(week) FROM table_name_78 WHERE opponent = "dallas cowboys"
sql_create_context
CREATE TABLE table_64262 ( "Class" text, "Railway number(s)" text, "Quantity" text, "Year(s) of manufacture" text, "Type" text )
What is the railway number of the aw class?
SELECT "Railway number(s)" FROM table_64262 WHERE "Class" = 'aw'
wikisql
CREATE TABLE table_name_52 ( all_amendments_sponsored INTEGER, bills_originally_cosponsored VARCHAR, all_bills_cosponsored VARCHAR )
What is the fewest amendments sponsored associated with 150 bills originally cosponsored and over 247 bills cosponsored?
SELECT MIN(all_amendments_sponsored) FROM table_name_52 WHERE bills_originally_cosponsored = 150 AND all_bills_cosponsored > 247
sql_create_context
CREATE TABLE table_name_97 ( year INTEGER, player VARCHAR )
What year was the player David Rose?
SELECT SUM(year) FROM table_name_97 WHERE player = "david rose"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH...
患有疾病M60.726的患者的在确诊时其D2聚体(柠檬酸盐)的含量参考值范围的下限与上限的数值都是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ...
css
CREATE TABLE 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...
for patient id 64208, specify the time of admission and icd9 code.
SELECT demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "64208"
mimicsql_data
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, JY...
26180794898的门诊就诊日期是哪天
SELECT wdmzjzjlb.JZKSRQ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '26180794898' UNION SELECT bdmzjzjlb.JZKSRQ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '26180794898'
css
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime ...
how much does patient 19428 change in temperature c (calc) last measured on the current icu visit compared to the first value measured on the current icu visit?
SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19428) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i...
mimic_iii
CREATE TABLE table_name_34 ( date VARCHAR, circuit VARCHAR, winning_manufacturer VARCHAR )
What was the date of Circuit Hockenheimring and the winning manufacturer being Mercedes-Benz?
SELECT date FROM table_name_34 WHERE circuit = "hockenheimring" AND winning_manufacturer = "mercedes-benz"
sql_create_context
CREATE TABLE table_14746 ( "Name" text, "Species Authority" text, "Order" text, "Family" text, "Red List" real )
What is the order for a red list of 7 in the didelphidae family?
SELECT "Order" FROM table_14746 WHERE "Red List" = '7' AND "Family" = 'didelphidae'
wikisql
CREATE TABLE table_53909 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
Was it a home game on the date of April 6?
SELECT "Home" FROM table_53909 WHERE "Date" = 'april 6'
wikisql