context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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 dead/expired patients have been discharged and had undergone the lab test manual reticulocyte count?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "DEAD/EXPIRED" AND lab.label = "Reticulocyte Count, Manual"
mimicsql_data
CREATE TABLE table_34617 ( "Region served" text, "City" text, "Channels ( Analog / Digital )" text, "First air date" text, "ERP (Analog/ Digital)" text, "HAAT (Analog/ Digital) 1" text, "Transmitter Location" text )
Which Region served has of 1176 m 1190 m HAAT (Analog/ Digital) 1?
SELECT "Region served" FROM table_34617 WHERE "HAAT (Analog/ Digital) 1" = '1176 m 1190 m'
wikisql
CREATE TABLE table_name_24 ( round VARCHAR, position VARCHAR, signed VARCHAR )
What round drafted was the 1b and a Signed of no cardinals - 1969 june?
SELECT COUNT(round) FROM table_name_24 WHERE position = "1b" AND signed = "no cardinals - 1969 june"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
what are the top five most often ordered procedures?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_70189 ( "Year" text, "Venue" text, "Winners" text, "Runner-up" text, "3rd place" text )
Who was the runner-up in 2004?
SELECT "Runner-up" FROM table_70189 WHERE "Year" = '2004'
wikisql
CREATE TABLE table_204_78 ( id number, "no." number, "train no." text, "origin" text, "destination" text, "train name" text )
how many trains are going to trivandrum ?
SELECT COUNT("train name") FROM table_204_78 WHERE "destination" = 'trivandrum'
squall
CREATE TABLE member ( Member_ID int, Member_Name text, Party_ID text, In_office text ) CREATE TABLE region ( Region_ID int, Region_name text, Date text, Label text, Format text, Catalogue text ) CREATE TABLE party ( Party_ID int, Minister text, Took_office text, ...
How many parties of the time they left office, binning the left office time into Year interval, and then split by the minister's name, I want to display in ascending by the Y.
SELECT Left_office, COUNT(Left_office) FROM party GROUP BY Minister ORDER BY COUNT(Left_office)
nvbench
CREATE TABLE table_78261 ( "Athlete" text, "Event" text, "Snatch" real, "Clean & Jerk" real, "Total" real )
What is the total that had an event of +105 kg and clean & jerk less than 227.5?
SELECT COUNT("Total") FROM table_78261 WHERE "Event" = '+105 kg' AND "Clean & Jerk" < '227.5'
wikisql
CREATE TABLE table_name_42 ( name VARCHAR, moving_from VARCHAR, type VARCHAR )
Who is moving from Treviso with a loan return?
SELECT name FROM table_name_42 WHERE moving_from = "treviso" AND type = "loan return"
sql_create_context
CREATE TABLE table_65811 ( "Airing date" text, "English title (Chinese title)" text, "Number of episodes" real, "Genre" text, "Official website" text )
What's the airing date for the show with 62 episodes?
SELECT "Airing date" FROM table_65811 WHERE "Number of episodes" = '62'
wikisql
CREATE TABLE table_18161217_2 ( cospar_id VARCHAR, estimated_operational_life VARCHAR, satellite VARCHAR )
What is the cospar ID of the Kosmos 2397 satellite, which has an operational life of 2 months?
SELECT cospar_id FROM table_18161217_2 WHERE estimated_operational_life = "2 months" AND satellite = "Kosmos 2397"
sql_create_context
CREATE TABLE table_47406 ( "Nat." text, "Name" text, "Moving to" text, "Type" text, "Transfer window" text, "Transfer fee" text )
Which Type has a Name of edson ratinho?
SELECT "Type" FROM table_47406 WHERE "Name" = 'edson ratinho'
wikisql
CREATE TABLE Assets ( asset_id INTEGER, maintenance_contract_id INTEGER, supplier_company_id INTEGER, asset_details VARCHAR(255), asset_make VARCHAR(20), asset_model VARCHAR(20), asset_acquired_date DATETIME, asset_disposed_date DATETIME, other_asset_details VARCHAR(255) ) CREATE TA...
Which parts have more than 2 faults? Show the part name and id in a bar chart, show by the y axis from low to high.
SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_id
nvbench
CREATE TABLE scientists ( ssn number, name text ) CREATE TABLE projects ( code text, name text, hours number ) CREATE TABLE assignedto ( scientist number, project text )
Find the name of scientists who are not assigned to any project.
SELECT name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM assignedto)
spider
CREATE TABLE table_54149 ( "Year" real, "Artist" text, "Composition" text, "Mintage" real, "Issue Price" text )
What is the composition with an artist of Henry Purdy, a year smaller than 2002, and a mint more than 1,998?
SELECT "Composition" FROM table_54149 WHERE "Year" < '2002' AND "Mintage" > '1,998' AND "Artist" = 'henry purdy'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
入院登记日期时间在2012-01-28之后的数量是多少?在1211179这个医疗机构的住院就诊记录中查一下
SELECT COUNT(*) FROM zyjzjlb JOIN hz_info_zyjzjlb JOIN hz_info ON hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.zyjzjlb_id = zyjzjlb.zyjzjlb_id AND hz_info_zyjzjlb.YLJGDM = hz_info.YLJGDM WHERE hz_info.YLJGDM = '12...
css
CREATE TABLE table_name_42 ( took_office INTEGER, left_office VARCHAR )
What is the Took Office Date of the Presidency that Left Office Incumbent?
SELECT SUM(took_office) FROM table_name_42 WHERE left_office = "incumbent"
sql_create_context
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, ...
list flights from MINNEAPOLIS to PITTSBURGH on friday
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 = 'PITTSBURGH' AND date_day.day_number = 25 AND date_day.month_number = 6 AN...
atis
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD...
列出来医院1457935所有医疗记录里个人自费的额度和总医疗额的比值最小值,要依据科室名字的不同与出院诊断编码的不同来计算,然后按照升序的方法排好
SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '1457935' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_...
css
CREATE TABLE table_53611 ( "Round" real, "Date" text, "Home Team" text, "Score" text, "Away Team" text, "Crowd" real, "Stadium" text, "Match Details" text )
Which home team played in front of 18,345 people in Adelaide Oval?
SELECT "Home Team" FROM table_53611 WHERE "Crowd" > '18,345' AND "Stadium" = 'adelaide oval'
wikisql
CREATE TABLE table_name_58 ( pop_act VARCHAR, album VARCHAR )
Which act's album has a name of All That You Can't Leave Behind?
SELECT pop_act FROM table_name_58 WHERE album = "all that you can't leave behind"
sql_create_context
CREATE TABLE manager_award_vote ( award_id TEXT, year INTEGER, league_id TEXT, player_id TEXT, points_won INTEGER, points_max INTEGER, votes_first INTEGER ) CREATE TABLE batting ( player_id TEXT, year INTEGER, stint INTEGER, team_id TEXT, league_id TEXT, g INTEGER, ...
Show the trend about the total average number of attendance at home games change over the years, bin year into year interval, and I want to list by the X in desc please.
SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year DESC
nvbench
CREATE TABLE table_name_24 ( rd__number VARCHAR, reg_gp VARCHAR, pick__number VARCHAR )
What is the rd number where the reg GP is 0 and the pick is 150?
SELECT COUNT(rd__number) FROM table_name_24 WHERE reg_gp = 0 AND pick__number = 150
sql_create_context
CREATE TABLE table_44506 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
Which Score has a Set 1 of 25 16?
SELECT "Score" FROM table_44506 WHERE "Set 1" = '25–16'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
get me the number of white ethnic background patients who were born before the year 2058.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2058"
mimicsql_data
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId nu...
difficulty of various JS frameworks.
SELECT Tags.TagName FROM Tags AS tags JOIN PostTags AS postTags ON PostTags.TagId = Tags.Id JOIN Posts AS posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName IN ('angularjs', 'angular2', 'vue.js', 'ember.js', 'backbone.js', 'reactjs', 'knockout.js', 'typescript') AND Posts.AcceptedAnswerId IS NULL
sede
CREATE TABLE table_27296 ( "Freq" real, "Call" text, "City" text, "Owner" text, "Start" real, "Day Power ( W )" real, "Night Power" real, "Nickname" text, "Format" text, "Stereo" text )
Does the city of moline have stereo?
SELECT "Stereo" FROM table_27296 WHERE "City" = 'Moline'
wikisql
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_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
If I take PHARMACY 426 , what classes will I be able to take ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_1.department = 'PHARMACY' AND COURSE_1.num...
advising
CREATE TABLE table_55094 ( "Title" text, "Year" real, "Country" text, "Music" text, "Uncut run time" text )
What music is in the film before 1962?
SELECT "Music" FROM table_55094 WHERE "Year" = '1962'
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...
what is days of hospital stay and diagnoses icd9 code of subject name troy friedman?
SELECT demographic.days_stay, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Troy Friedman"
mimicsql_data
CREATE TABLE table_45022 ( "Antibody" text, "Brand name" text, "Approval date" real, "Type" text, "Target" text )
What's the target for the brand mylotarg?
SELECT "Target" FROM table_45022 WHERE "Brand name" = 'mylotarg'
wikisql
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 microlab ( microl...
how much does it cost for nacl 0.9% bolus?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'nacl 0.9% bolus')
eicu
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
在2000-02-17到2009-07-01内,列出医院2298937开出的检验报告单中,列出不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值,并把数据按平均值升序排序
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '2298937' AND BGRQ BETWEEN '2000-02-17' AND '2009-07-01' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL)
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 drug type and drug name of METD5?
SELECT prescriptions.drug_type, prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "METD5"
mimicsql_data
CREATE TABLE users ( user_id number, role_code text, user_name text, user_login text, password text ) CREATE TABLE images ( image_id number, image_alt_text text, image_name text, image_url text ) CREATE TABLE document_sections_images ( section_id number, image_id number ) ...
Return the codes of the document types that do not have a total access count of over 10000.
SELECT document_type_code FROM documents GROUP BY document_type_code HAVING SUM(access_count) > 10000
spider
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, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, find job_id and employee_id , and visualize them by a bar chart, and display Y-axis in asc order.
SELECT JOB_ID, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID
nvbench
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...
how many patients are diagnosed with hx surgery to organs nec and base drug type?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Hx surgery to organs NEC" AND prescriptions.drug_type = "BASE"
mimicsql_data
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text, person_info_CSD text, person_info_CSRQ time, person_info_GJDM text, person_info_GJMC text, person_info_JGDM text, person_info_JGMC text, person_info_MZDM text, person_info_MZMC text, person_info_XBDM ...
在09年7月5日到17年7月6日这段时间,患者卫逸明一共有多少检验报告单,把这些检验报告单的标本采集部位列出来
SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.person_info_XM = '卫逸明' AND jybgb.BGRQ BETWEEN '2009-07-05' AND '2017-07-06...
css
CREATE TABLE school ( school_id number, school text, location text, enrollment number, founded number, denomination text, boys_or_girls text, day_or_boarding text, year_entered_competition number, school_colors text ) CREATE TABLE school_details ( school_id number, nickn...
List the enrollment for each school that does not have 'Catholic' as denomination.
SELECT enrollment FROM school WHERE denomination <> "Catholic"
spider
CREATE TABLE table_76866 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Attendance" real, "Record" text, "Points" real )
What is the location of the game with a 6-11-8 record?
SELECT "Location" FROM table_76866 WHERE "Record" = '6-11-8'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
was there any organism found during the last month in patient 031-15666's first urine, catheter specimen test?
SELECT COUNT(*) > 0 FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15666')) AND microlab.culturesite = 'urine, catheter specimen' AND DATETIM...
eicu
CREATE TABLE table_1979619_3 ( term_ends VARCHAR, residence VARCHAR )
Name the term ends for bethlehem
SELECT COUNT(term_ends) FROM table_1979619_3 WHERE residence = "Bethlehem"
sql_create_context
CREATE TABLE table_name_35 ( episodes INTEGER, actor VARCHAR )
What is the lowest number of episodes for anabel barnston?
SELECT MIN(episodes) FROM table_name_35 WHERE actor = "anabel barnston"
sql_create_context
CREATE TABLE table_17685 ( "Track Name" text, "Location" text, "Length" text, "Seating" real, "Year Opened" real, "Year Acquired [A ]" real )
Where is the track that opened in 1995?
SELECT "Location" FROM table_17685 WHERE "Year Opened" = '1995'
wikisql
CREATE TABLE table_6629 ( "Name" text, "Country" text, "Type" text, "Moving from" text, "Transfer window" text, "Ends" text, "Transfer fee" text, "Source" text )
What country has a loan as the type?
SELECT "Country" FROM table_6629 WHERE "Type" = 'loan'
wikisql
CREATE TABLE table_6723 ( "Year" real, "Male" text, "Female" text, "Band" text, "Album" text, "Pop Act" text, "Lifetime Achievement Award" text )
Which act's album has a name of All That You Can't Leave Behind?
SELECT "Pop Act" FROM table_6723 WHERE "Album" = 'all that you can''t leave behind'
wikisql
CREATE TABLE table_name_38 ( result VARCHAR, week VARCHAR )
What was the result of week 13?
SELECT result FROM table_name_38 WHERE week = 13
sql_create_context
CREATE TABLE table_11214212_1 ( naturalisation_by_marriage VARCHAR, registration_of_a_minor_child VARCHAR )
what's the naturalisation by marriage with regbeingtration of a minor child being 114
SELECT naturalisation_by_marriage FROM table_11214212_1 WHERE registration_of_a_minor_child = 114
sql_create_context
CREATE TABLE table_482 ( "Season #" real, "Series #" real, "Title" text, "Canadian airdate" text, "U.S. airdate" text, "Production code" real )
what are all the Canadian air dates where the u.s. air date is may 1, 2009
SELECT "Canadian airdate" FROM table_482 WHERE "U.S. airdate" = 'May 1, 2009'
wikisql
CREATE TABLE table_2562572_22 ( dominant_religion__2002_ VARCHAR, cyrillic_name_other_names VARCHAR )
Name the dominant religion for
SELECT dominant_religion__2002_ FROM table_2562572_22 WHERE cyrillic_name_other_names = "Станишић"
sql_create_context
CREATE TABLE table_name_92 ( county VARCHAR, r_bacon VARCHAR )
Which county has 438 (4%) listed under R. Bacon?
SELECT county FROM table_name_92 WHERE r_bacon = "438 (4%)"
sql_create_context
CREATE TABLE table_name_41 ( john_edwards VARCHAR, john_kerry VARCHAR )
What is John Edwards, when John Kerry is '70%'?
SELECT john_edwards FROM table_name_41 WHERE john_kerry = "70%"
sql_create_context
CREATE TABLE table_name_54 ( score VARCHAR, opponent VARCHAR )
What was the score in the match against Sanaz Marand?
SELECT score FROM table_name_54 WHERE opponent = "sanaz marand"
sql_create_context
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Suggested edits voting compared to final result.
SELECT p.Id AS Id, p.Id AS "post_link", se.Id AS "suggested_edit_link" FROM SuggestedEdits AS se INNER JOIN SuggestedEditVotes AS sev ON sev.SuggestedEditId = se.Id INNER JOIN Posts AS p ON p.Id = se.PostId WHERE sev.UserId = '##UserId##' AND NOT se.RejectionDate IS NULL AND sev.VoteTypeId = 2
sede
CREATE TABLE table_34338 ( "Pick #" real, "Round" text, "Player" text, "Position" text, "College" text )
How many picks did the College of USC wind up getting?
SELECT COUNT("Pick #") FROM table_34338 WHERE "College" = 'usc'
wikisql
CREATE TABLE table_name_35 ( money___$__ VARCHAR, score VARCHAR )
What is Money ( $ ), when Score is '75-71-72-70=288'?
SELECT money___$__ FROM table_name_35 WHERE score = 75 - 71 - 72 - 70 = 288
sql_create_context
CREATE TABLE table_35972 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
Who had a points average with 0 extra points and 0 field goals?
SELECT AVG("Points") FROM table_35972 WHERE "Extra points" = '0' AND "Field goals" > '0'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
what is minimum age of patients whose admission location is phys referral/normal deli and primary disease is bladder cancer/sda?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.diagnosis = "BLADDER CANCER/SDA"
mimicsql_data
CREATE TABLE table_69378 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text )
Which team had the attendance of 16,468 and lost?
SELECT "Loss" FROM table_69378 WHERE "Attendance" = '16,468'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Find posts in last 60 days with 'coreclr' in title, body or tags.
SELECT Posts.Id AS "post_link", Title, Posts.CreationDate, PostTypeId, AnswerCount, Tags, ViewCount, Score, OwnerUserId AS "user_link", DisplayName, LastActivityDate, LastEditDate, ClosedDate, Body FROM Posts, Users WHERE Posts.OwnerUserId = Users.Id AND Posts.CreationDate >= CURRENT_TIMESTAMP() - 60 AND (Title LIKE '%...
sede
CREATE TABLE table_203_661 ( id number, "year" number, "single" text, "peak chart positions\nus mod" number, "peak chart positions\nuk" number, "album" text )
how long was it between losing streak almbum and gnv fla in years .
SELECT ABS((SELECT "year" FROM table_203_661 WHERE "album" = 'losing streak') - (SELECT "year" FROM table_203_661 WHERE "album" = 'gnv fla'))
squall
CREATE TABLE table_34916 ( "Country" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
Which Skip has a Third of sara carlsson?
SELECT "Skip" FROM table_34916 WHERE "Third" = 'sara carlsson'
wikisql
CREATE TABLE table_name_58 ( player VARCHAR, club_province VARCHAR, date_of_birth__age_ VARCHAR )
Which player on the Bulls has a 6 May 1978 birthday?
SELECT player FROM table_name_58 WHERE club_province = "bulls" AND date_of_birth__age_ = "6 may 1978"
sql_create_context
CREATE TABLE table_3049 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" text, "Points won" real, "New points" real, "Status" text )
List the competitor ranking with 900 defense points.
SELECT COUNT("Seed") FROM table_3049 WHERE "Points defending" = '900'
wikisql
CREATE TABLE table_204_884 ( id number, "medal" text, "name" text, "sport" text, "event" text, "date" text )
how many gold medals did this country win during these olympics ?
SELECT COUNT(*) FROM table_204_884 WHERE "medal" = 'gold'
squall
CREATE TABLE table_3796 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
What is the branding for callsign dypv?
SELECT "Branding" FROM table_3796 WHERE "Callsign" = 'DYPV'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
在医疗机构0896805患者66990606从08年8月22日到15年12月14日有多少次检查?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '66990606' AND t_kc22.STA_DATE BETWEEN '2008-08-22' AND '2015-12-14' AND t_kc21.MED_SER_ORG_NO = '0896805' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_34 ( centre VARCHAR, rank VARCHAR )
Which Centre has a Rank of 42?
SELECT centre FROM table_name_34 WHERE rank = 42
sql_create_context
CREATE TABLE table_name_64 ( position VARCHAR, player VARCHAR )
Which Position has a Player of bernard thompson?
SELECT position FROM table_name_64 WHERE player = "bernard thompson"
sql_create_context
CREATE TABLE table_67409 ( "Date" text, "Opponent" text, "Result" text, "Game Site" text, "Attendance" text )
What is the date that 4,286 attended?
SELECT "Date" FROM table_67409 WHERE "Attendance" = '4,286'
wikisql
CREATE TABLE table_name_22 ( points INTEGER, played VARCHAR, goal_difference VARCHAR, losses VARCHAR, goals_against VARCHAR )
What is the fewest points for positions with under 12 losses, goals against under 50, goal difference over 11, and under 30 played?
SELECT MIN(points) FROM table_name_22 WHERE losses < 12 AND goals_against < 50 AND goal_difference > 11 AND played < 30
sql_create_context
CREATE TABLE table_73140 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the incumbent for lost renomination republican hold
SELECT "Incumbent" FROM table_73140 WHERE "Result" = 'Lost renomination Republican hold'
wikisql
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE diagnoses_icd ( ...
when was the last time on this month/26 that patient 10855's heart rate was measured greater than 94.0?
SELECT chartevents.charttime 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 = 10855)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra...
mimic_iii
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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, JOB_ID varchar(10), SALARY decimal(8,2), CO...
For those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and commission_pct , and visualize them by a bar chart, sort bar from high to low order please.
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
nvbench
CREATE TABLE table_57132 ( "Dep." text, "Chief town" text, "Arrondissement" text, "Population (1999)" text, "Area (Square km)" real, "Pop density" real, "Cantons" real, "Communes" real )
How many communes associated with over 10 cantons and an area (Square km) of 1,589?
SELECT AVG("Communes") FROM table_57132 WHERE "Cantons" > '10' AND "Area (Square km)" = '1,589'
wikisql
CREATE TABLE table_61066 ( "State" text, "City" text, "Population" real, "Violent Crime" text, "Murder and Non-Negligent Manslaughter" real, "Forcible Rape" text, "Robbery" real, "Aggravated Assault" real, "Property Crime" text, "Burglary" real, "Larceny-Theft" text, "Mot...
When population is greater than 832,901 and murder and non-negligent manslaughter is 11.6, what is the smallest burglary?
SELECT MIN("Burglary") FROM table_61066 WHERE "Population" > '832,901' AND "Murder and Non-Negligent Manslaughter" = '11.6'
wikisql
CREATE TABLE table_name_47 ( attendance VARCHAR, opponent VARCHAR )
What is the attendance when the opponent was the Houston Oilers?
SELECT attendance FROM table_name_47 WHERE opponent = "houston oilers"
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...
provide the number of patients whose diagnoses short title is subtrochanteric fx-close and drug route is left eye?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Subtrochanteric fx-close" AND prescriptions.route = "LEFT EYE"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide the number of patients whose death status is 0 and primary disease is aortic insufficiency/re-do sternotomy; aortic valve replacement.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
mimicsql_data
CREATE TABLE table_name_13 ( attendance VARCHAR, score VARCHAR )
When the Score was 4-10, what was the Attendance?
SELECT attendance FROM table_name_13 WHERE score = "4-10"
sql_create_context
CREATE TABLE table_33885 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text )
What is the score for game 5?
SELECT "Score" FROM table_33885 WHERE "Game" = '5'
wikisql
CREATE TABLE table_71159 ( "Margin" real, "Score" text, "Opponent" text, "Venue" text, "Year" real )
Name the opponent for 1996 at the mt smart stadium venue
SELECT "Opponent" FROM table_71159 WHERE "Venue" = 'mt smart stadium' AND "Year" = '1996'
wikisql
CREATE TABLE table_52044 ( "Series" text, "Years" text, "Magazine" text, "Albums" text, "Editor" text )
Which series with a total of 27 albums did Dargaud edit?
SELECT "Series" FROM table_52044 WHERE "Editor" = 'dargaud' AND "Albums" = '27'
wikisql
CREATE TABLE table_name_99 ( year VARCHAR, publication VARCHAR )
Which year had a publication of Pazz & Jop?
SELECT year FROM table_name_99 WHERE publication = "pazz & jop"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
患者16935106有哪些医疗记录被开了853.43元以上的药品?列出医疗就诊编号
SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '16935106' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 853.43) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '16935106' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FR...
css
CREATE TABLE player ( POSITION VARCHAR, Points INTEGER )
What are the positions with both players having more than 20 points and less than 10 points.
SELECT POSITION FROM player WHERE Points > 20 INTERSECT SELECT POSITION FROM player WHERE Points < 10
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE ta ( campus_job_id int, student_id int...
Are there any 400 -level courses in the Fall or Winter term that I can take ?
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM...
advising
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
Give me a bar chart for sum price of each name, and order y-axis in desc order.
SELECT Name, SUM(Price) FROM Products GROUP BY Name ORDER BY SUM(Price) DESC
nvbench
CREATE TABLE ship ( Ship_ID int, Name text, Type text, Nationality text, Tonnage int ) CREATE TABLE mission ( Mission_ID int, Ship_ID int, Code text, Launched_Year int, Location text, Speed_knots int, Fate text )
Give me a bar chart for mean tonnage of each type, show by the Y in asc.
SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage)
nvbench
CREATE TABLE diagnoses ( 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, ...
how old is the patient josette orr?
SELECT demographic.age FROM demographic WHERE demographic.name = "Josette Orr"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is discharge location of subject name kelly gallardo?
SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_...
how patient 8991 was admitted to hospital in the previous year for the last time?
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 8991 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE degrees ( Id VARCHAR ) CREATE TABLE campuses ( Id VARCHAR )
How many degrees were conferred in 'San Jose State University' in 2000?
SELECT degrees FROM campuses AS T1 JOIN degrees AS T2 ON t1.Id = t2.campus WHERE t1.campus = "San Jose State University" AND t2.year = 2000
sql_create_context
CREATE TABLE entrepreneur ( Entrepreneur_ID int, People_ID int, Company text, Money_Requested real, Investor text ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Date_of_Birth text )
Draw a bar chart of investor versus the total number, and could you list bars from high to low order?
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY Investor DESC
nvbench
CREATE TABLE table_67793 ( "Date" text, "Venue" text, "Score" text, "Competition" text, "Match report" text )
What was the Match Report for the Euro2008q at the Athens Olympic Stadium on November 17, 2007?
SELECT "Match report" FROM table_67793 WHERE "Competition" = 'euro2008q' AND "Venue" = 'athens olympic stadium' AND "Date" = 'november 17, 2007'
wikisql
CREATE TABLE table_58122 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
What is the first prize amount of the person who has a score of 207 (-9) and a purse amount of more than 800,000?
SELECT COUNT("1st Prize( $ )") FROM table_58122 WHERE "Score" = '207 (-9)' AND "Purse( $ )" > '800,000'
wikisql
CREATE TABLE table_34894 ( "Rank" real, "Name" text, "Nationality" text, "1st (m)" real, "2nd (m)" real, "Points" real, "Overall WC points (Rank)" text )
Which 2nd (m) has a 1st (m) of 120.5 and Points smaller than 249.9?
SELECT AVG("2nd (m)") FROM table_34894 WHERE "1st (m)" = '120.5' AND "Points" < '249.9'
wikisql
CREATE TABLE table_52444 ( "Year" real, "Network" text, "Lap-by-lap" text, "Color commentator(s)" text, "Pit reporters" text, "Host" text, "Ratings" text, "Viewers" text )
Who was the host that garnered ratings of 9.6/26?
SELECT "Host" FROM table_52444 WHERE "Ratings" = '9.6/26'
wikisql
CREATE TABLE table_9338 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
What was the score for the Perth Wildcats as away team?
SELECT "Score" FROM table_9338 WHERE "Away team" = 'perth wildcats'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
which language does patient jonathan wiggins speak?
SELECT demographic.language FROM demographic WHERE demographic.name = "Jonathan Wiggins"
mimicsql_data