context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_49 ( caps VARCHAR, date_of_birth__age_ VARCHAR )
How many caps have a Date of Birth (Age) of 15 july 1981?
SELECT COUNT(caps) FROM table_name_49 WHERE date_of_birth__age_ = "15 july 1981"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
看看被门诊诊断为疾病U99.814的患者柏志国的检测指标095190的结果定量是什么?单位又是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = j...
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 of the patients from a black/haitian ethnic origin were aged below 68?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.age < "68"
mimicsql_data
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 was hired before 2002-06-21, show me about the distribution of hire_date and the sum of salary bin hire_date by time in a bar chart.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_name_23 ( date VARCHAR, competition VARCHAR )
Name the date for 2004 afc asian cup qualifier
SELECT date FROM table_name_23 WHERE competition = "2004 afc asian cup qualifier"
sql_create_context
CREATE TABLE table_name_67 ( australian VARCHAR, british VARCHAR, letter VARCHAR )
What is the Australian letter with a British of and a letter of /i/??
SELECT australian FROM table_name_67 WHERE british = "ɪ" AND letter = "æ /i/"
sql_create_context
CREATE TABLE table_14182 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "County" text )
What is the IHSAA class for the school in 10 Clark county with mascot of the Mustangs?
SELECT "IHSAA Class" FROM table_14182 WHERE "County" = '10 clark' AND "Mascot" = 'mustangs'
wikisql
CREATE TABLE table_62257 ( "Season" text, "Date" text, "Winner" text, "Loser" text, "Score" text, "Venue" text, "Attendance" text )
What season did Stoke City win?
SELECT "Season" FROM table_62257 WHERE "Winner" = 'stoke city'
wikisql
CREATE TABLE table_2253 ( "Date" text, "Location" text, "Discipline" text, "Winner" text, "2nd place" text, "3rd place" text )
Who got the 3rd place in the cup on 01.02.2009?
SELECT "3rd place" FROM table_2253 WHERE "Date" = '01.02.2009'
wikisql
CREATE TABLE table_45922 ( "Passenger" text, "Points" real, "Races" real, "Wins" text, "Second" text, "Third" text )
What Passenger has 16 Wins?
SELECT "Passenger" FROM table_45922 WHERE "Wins" = '16'
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...
能知道患者16019866之前看病的医院吗
SELECT wdmzjzjlb.YLJGDM FROM hz_info JOIN wdmzjzjlb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE hz_info.RYBH = '16019866' UNION SELECT bdmzjzjlb.YLJGDM FROM hz_info JOIN bdmzjzjlb ON hz_info.YLJGDM = bdmzjzjlb.YLJGDM AND hz_info.KH = bdmzjzjlb.KH AND hz_info....
css
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE o...
when did patient 16572 get an intake, the first time until 1872 days ago?
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572)) AND DATETIME(inputevents_cv.charttime) <= DATETIME(CURRENT_TIME(), '-1872 day') ORDE...
mimic_iii
CREATE TABLE table_name_88 ( label VARCHAR, format VARCHAR, catalog VARCHAR )
What Label has a Format of cd, and a Catalog of crgd 86136?
SELECT label FROM table_name_88 WHERE format = "cd" AND catalog = "crgd 86136"
sql_create_context
CREATE TABLE table_204_163 ( id number, "airline" text, "icao" text, "iata" text, "callsign" text, "commenced\noperations" number )
what is the next airline to be listed after royal daisy airlines ?
SELECT "airline" FROM table_204_163 WHERE id = (SELECT id FROM table_204_163 WHERE "airline" = 'royal daisy airlines') + 1
squall
CREATE TABLE table_26142 ( "Year" real, "Driver" text, "Constructor" text, "Location" text, "Formula" text, "Report" text )
What was the constructor in 1975?
SELECT "Constructor" FROM table_26142 WHERE "Year" = '1975'
wikisql
CREATE TABLE table_62664 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
What Per capita income has a Median family income of $50,755?
SELECT "Per capita income" FROM table_62664 WHERE "Median family income" = '$50,755'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
has patient 30267 excreted foley since 05/22/2105?
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30267)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'foley' AND d_i...
mimic_iii
CREATE TABLE table_22264 ( "Foodstuff" text, "Pinoresinol" real, "Syringaresinol" real, "Sesamin" text, "Lariciresinol" real, "Secoisolariciresinol" real, "Matairesinol" real, "Hydroxymatairesinol" real )
how much sesamin is in sesame seed?
SELECT "Sesamin" FROM table_22264 WHERE "Foodstuff" = 'Sesame seed'
wikisql
CREATE TABLE table_74707 ( "Name" text, "Case type" text, "Bullet diameter" text, "Neck diameter" text, "Base diameter" text, "Rim diameter" text, "Case length" text, "Cartridge length" text )
Which Case type has a Base diameter of 13.03 (.513), and a Case length of 63.5 (2.5)?
SELECT "Case type" FROM table_74707 WHERE "Base diameter" = '13.03 (.513)' AND "Case length" = '63.5 (2.5)'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
number of posts in slots.
SELECT TIME_TO_STR(CreationDate, '%Y') AS rok, TIME_TO_STR(CreationDate, '%m') AS miesiac, COUNT(Id) AS ilosc FROM Posts WHERE Posts.PostTypeId = 1 GROUP BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m') ORDER BY TIME_TO_STR(CreationDate, '%Y'), TIME_TO_STR(CreationDate, '%m')
sede
CREATE TABLE table_name_84 ( organisation VARCHAR, year VARCHAR, award VARCHAR )
what is the organisation when the year is less than 2005 and the award is the best variety show host?
SELECT organisation FROM table_name_84 WHERE year < 2005 AND award = "best variety show host"
sql_create_context
CREATE TABLE table_142159_1 ( name VARCHAR, builder VARCHAR )
What is the name with the builder of Kerr Stuart
SELECT name FROM table_142159_1 WHERE builder = "Kerr Stuart"
sql_create_context
CREATE TABLE table_58830 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What was the highest number of bronze medals for the entry with rank 2 and fewer than 3 silver medals?
SELECT MAX("Bronze") FROM table_58830 WHERE "Rank" = '2' AND "Silver" < '3'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
how many hours has it been since patient 025-44842 was admitted for to the hospital?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '025-44842' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE table_28983 ( "Episode Number" real, "Air Date" text, "Guests" text, "Three Darts Challenge" text, "Musical Performance" text )
What were the guests that aired on 7 June 2010?
SELECT "Guests" FROM table_28983 WHERE "Air Date" = '7 June 2010'
wikisql
CREATE TABLE table_48288 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
With a date of Aldershot and Aldershot as the away team what was the score of the game?
SELECT "Score" FROM table_48288 WHERE "Away team" = 'aldershot' AND "Date" = 'aldershot'
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...
find the number of patients with procedure icd9 code 3142 who died on or before 2133.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2133.0" AND procedures.icd9_code = "3142"
mimicsql_data
CREATE TABLE Complaints ( complaint_id INTEGER, product_id INTEGER, customer_id INTEGER, complaint_outcome_code VARCHAR(20), complaint_status_code VARCHAR(20), complaint_type_code VARCHAR(20), date_complaint_raised DATETIME, date_complaint_closed DATETIME, staff_id INTEGER ) CREATE ...
Return the average price of products that have each category code.
SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code
nvbench
CREATE TABLE table_203_837 ( id number, "rank" number, "name" text, "height\nft / m" text, "floors" number, "year" number, "notes" text )
which is taller , the aep building or the one columbus center ?
SELECT "name" FROM table_203_837 WHERE "name" IN ('aep building', 'one columbus center') ORDER BY "height\nft / m" DESC LIMIT 1
squall
CREATE TABLE table_75183 ( "Company" text, "Type" text, "Principal activities" text, "Incorporated in" text, "Group's Equity Shareholding (10 March 2010)" text )
Which company's principal activities are catering services, and a Group's Equity Shareholding (as of March 10th 2010) of 40%?
SELECT "Company" FROM table_75183 WHERE "Principal activities" = 'catering services' AND "Group's Equity Shareholding (10 March 2010)" = '40%'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
post within last three months.
SELECT Id, ParentId, PostTypeId, CreationDate, Body, Title, Tags FROM Posts WHERE CreationDate > '01/01/2014'
sede
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE ...
NELL papers
SELECT DISTINCT paper.paperid FROM dataset, paper, paperdataset WHERE dataset.datasetname = 'NELL' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
scholar
CREATE TABLE table_name_92 ( points_against VARCHAR, try_bonus VARCHAR, tries_against VARCHAR )
How many points against does the club that has a try bonus of 6 and tries against of 54 have ?
SELECT points_against FROM table_name_92 WHERE try_bonus = "6" AND tries_against = "54"
sql_create_context
CREATE TABLE table_name_37 ( school VARCHAR, location VARCHAR )
What is the name of the school that is in Valparaiso?
SELECT school FROM table_name_37 WHERE location = "valparaiso"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is the number of patients whose primary disease is left femur fracture and lab test abnormal status is abnormal?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "LEFT FEMUR FRACTURE" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE table_name_5 ( money___ INTEGER, player VARCHAR, to_par VARCHAR )
How much money did Willie Klein take home from the game in which he had a to par score larger than 13?
SELECT SUM(money___) AS $__ FROM table_name_5 WHERE player = "willie klein" AND to_par > 13
sql_create_context
CREATE TABLE table_name_12 ( rank_by_average VARCHAR, total_points VARCHAR, average VARCHAR )
What is the total rank with more than 392 total points and an 24.8 average?
SELECT COUNT(rank_by_average) FROM table_name_12 WHERE total_points > 392 AND average = 24.8
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
give me the number of patients whose diagnoses short title is hx traumatic fracture and lab test fluid is joint fluid?
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.short_title = "Hx traumatic fracture" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_54785 ( "Type" text, "Sign" real, "Exponent" real, "Significand" real, "Total bits" real, "Exponent bias" real, "Bits precision" real, "Number of decimal digits" text )
What's the number of decimal digits when the total bits is more than 32 and the exponent is less than 15?
SELECT "Number of decimal digits" FROM table_54785 WHERE "Total bits" > '32' AND "Exponent" < '15'
wikisql
CREATE TABLE table_11277 ( "Year of award" real, "Date(s)" text, "Sport" text, "Winner" text, "Loser" text )
What year were the awards given june 6, 2004 june 15, 2004?
SELECT SUM("Year of award") FROM table_11277 WHERE "Date(s)" = 'june 6, 2004–june 15, 2004'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE treatment ( treatmentid...
when was patient 005-11182 prescribed with a drug via intraven route for the first time in 09/last year?
SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-11182')) AND medication.routeadmin = 'intraven' AND DATETI...
eicu
CREATE TABLE table_name_48 ( game VARCHAR, high_rebounds VARCHAR )
In which game number was Chris Andersen (12) the high rebounds scorer?
SELECT game FROM table_name_48 WHERE high_rebounds = "chris andersen (12)"
sql_create_context
CREATE TABLE table_203_426 ( id number, "year" number, "title" text, "peak chart positions\naus" number, "peak chart positions\nnz" number, "peak chart positions\nuk" number, "album" text )
in what year did the track , wide open road come out ?
SELECT "year" FROM table_203_426 WHERE "title" = '"wide open road"'
squall
CREATE TABLE election ( Party VARCHAR, District VARCHAR ) CREATE TABLE party ( Comptroller VARCHAR, Party_ID VARCHAR )
Who were the comptrollers of the parties associated with the delegates from district 1 or district 2?
SELECT T2.Comptroller FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 OR T1.District = 2
sql_create_context
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Return a scatter chart about the correlation between School_ID and All_Games_Percent .
SELECT School_ID, All_Games_Percent FROM basketball_match
nvbench
CREATE TABLE table_name_84 ( release_date VARCHAR, developer_s_ VARCHAR )
Which Release date has a Developer(s) of microsoft research?
SELECT release_date FROM table_name_84 WHERE developer_s_ = "microsoft research"
sql_create_context
CREATE TABLE table_name_95 ( crowd INTEGER, home_team VARCHAR )
What was the smallest crowd when Footscray played at home?
SELECT MIN(crowd) FROM table_name_95 WHERE home_team = "footscray"
sql_create_context
CREATE TABLE table_name_61 ( wins INTEGER, played VARCHAR, goals_against VARCHAR, points VARCHAR, goal_difference VARCHAR )
What is the average number of wins for entries with more than 32 points, a goal difference smaller than 23, and a Goals against of 36, and a Played smaller than 30?
SELECT AVG(wins) FROM table_name_61 WHERE points > 32 AND goal_difference < 23 AND goals_against = 36 AND played < 30
sql_create_context
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
what was the name of the procedure that patient 004-79017 received two times this month.
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
CREATE TABLE table_name_24 ( region VARCHAR, _percentage_growth VARCHAR )
Which Region that has a growth of 3.6%?
SELECT region FROM table_name_24 WHERE _percentage_growth = "−3.6"
sql_create_context
CREATE TABLE table_1976898_1 ( english_name VARCHAR, post_code VARCHAR )
What's the English name of the county with a postcode 246400?
SELECT english_name FROM table_1976898_1 WHERE post_code = 246400
sql_create_context
CREATE TABLE table_name_77 ( result VARCHAR, attendance VARCHAR )
What was the result when the attendance was 12,000?
SELECT result FROM table_name_77 WHERE attendance = "12,000"
sql_create_context
CREATE TABLE table_35863 ( "Gauge" text, "Railway" text, "Works no." text, "Year" text, "Builder" text )
In what Year is the Works No. 2040-2049?
SELECT "Year" FROM table_35863 WHERE "Works no." = '2040-2049'
wikisql
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewTasks ( Id number, ReviewTask...
Number of answers which have no comments.
SELECT COUNT(*) AS AnswerCount FROM Posts WHERE CommentCount > 0 AND PostTypeId = 2
sede
CREATE TABLE table_76976 ( "Nation" text, "Gold" text, "Silver" text, "Bronze" text, "Total" real )
What is Bronze, when Silver is 2, and when Nation is Italy?
SELECT "Bronze" FROM table_76976 WHERE "Silver" = '2' AND "Nation" = 'italy'
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 ) ...
provide the number of patients whose primary disease is brain mass;intracranial hemorrhage and year of birth is less than 2056?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND demographic.dob_year < "2056"
mimicsql_data
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT * where [CreationDate] >= CAST(GETDATE() AS date).
SELECT COUNT(*) FROM Posts WHERE 'creationdate' < DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)
sede
CREATE TABLE table_name_72 ( vs_all VARCHAR, vs_terran VARCHAR )
What is the score vs. all when the score vs. Terran is 159?
SELECT vs_all FROM table_name_72 WHERE vs_terran = "159"
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 age is less than 44 and diagnoses long title is atrioventricular block, complete?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "44" AND diagnoses.long_title = "Atrioventricular block, complete"
mimicsql_data
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
在13年9月2日到21年5月16日这段时间里91296755号病患的所有检验结果指标记录中的都有什么检测方法?
SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH...
css
CREATE TABLE table_70293 ( "Representative" text, "Years" text, "State" text, "Party" text, "Lifespan" text )
What was the lifespan of Representative Harry P. O'neill from the state of Pennsylvania?
SELECT "Lifespan" FROM table_70293 WHERE "State" = 'pennsylvania' AND "Representative" = 'harry p. o''neill'
wikisql
CREATE TABLE table_637 ( "W.H. Archer" text, "J.E. Armstrong" text, "H.L. Birkett" text, "F.A. Brill" text, "H.T. Brewer" text )
Who is h.l birkett if w.h. archer is r. cochrane?
SELECT "H.L. Birkett" FROM table_637 WHERE "W.H. Archer" = 'R. Cochrane'
wikisql
CREATE TABLE table_22554 ( "Nation" text, "Rider" text, "Horse" text, "Cross Country Penalties" text, "Total Penalties" text, "Total Team Penalties" text, "Team Rank" real )
Who is the rider where the horse is galan de sauvagere?
SELECT "Rider" FROM table_22554 WHERE "Horse" = 'Galan De Sauvagere'
wikisql
CREATE TABLE table_name_37 ( team VARCHAR, date VARCHAR )
What team played on November 28?
SELECT team FROM table_name_37 WHERE date = "november 28"
sql_create_context
CREATE TABLE table_name_88 ( original_artist VARCHAR, week__number VARCHAR )
What is the original artist of top 9 as the week number?
SELECT original_artist FROM table_name_88 WHERE week__number = "top 9"
sql_create_context
CREATE TABLE table_66111 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
What episode has average ratings of 7.4%?
SELECT AVG("Episodes") FROM table_66111 WHERE "Average Ratings" = '7.4%'
wikisql
CREATE TABLE table_59421 ( "Geelong FL" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What's the average against of Leopold with more than 11 wins?
SELECT AVG("Against") FROM table_59421 WHERE "Geelong FL" = 'leopold' AND "Wins" > '11'
wikisql
CREATE TABLE table_26751 ( "Year" real, "Tournaments played" real, "Cuts made" real, "Wins" real, "2nd" real, "3rd" real, "Top 10s" real, "Best finish" text, "Earnings ($)" real, "Money list rank" real, "Scoring average" text, "Scoring rank" real )
When 0 is the top 10's what is the highest amount of cuts made?
SELECT MAX("Cuts made") FROM table_26751 WHERE "Top 10s" = '0'
wikisql
CREATE TABLE table_71431 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original title" text, "Director" text )
Name the film title that is spanish from peru
SELECT "Film title used in nomination" FROM table_71431 WHERE "Language" = 'spanish' AND "Country" = 'peru'
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_...
Can I ask how many credits is 557 ?
SELECT DISTINCT credits FROM course WHERE department = 'EECS' AND number = 557
advising
CREATE TABLE table_30873 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What are Scott Zygulski's pick numbers?
SELECT "Pick #" FROM table_30873 WHERE "Player" = 'Scott Zygulski'
wikisql
CREATE TABLE table_38180 ( "Round" text, "Venue" text, "Discipline" text, "Date" text, "Winner" text, "Second" text, "Third" text )
Who was third at the 0.8km f sprint discipline?
SELECT "Third" FROM table_38180 WHERE "Discipline" = '0.8km f sprint'
wikisql
CREATE TABLE table_name_67 ( score VARCHAR, date VARCHAR, location VARCHAR, winner VARCHAR )
What is the Score, when the Location is Clemson, SC, when the Winner is Clemson, and when the Date is November 11, 2006?
SELECT score FROM table_name_67 WHERE location = "clemson, sc" AND winner = "clemson" AND date = "november 11, 2006"
sql_create_context
CREATE TABLE fzzmzjzjlb ( 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, MZZYZD...
我想知道患者窦嘉美之前就诊的医院
SELECT zzmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zzmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE person_info.XM = '窦嘉美' UNION SELECT fzzmzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN fzzmzjzjlb ON person_...
css
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE fare ( fare_id int, from_...
what 's the lowest round trip fare from DALLAS to any city
SELECT DISTINCT fare.fare_id FROM airport_service, city, fare, flight, flight_fare WHERE city.city_code = airport_service.city_code AND city.city_name = 'DALLAS' AND fare.round_trip_cost = (SELECT MIN(FAREalias1.round_trip_cost) FROM airport_service AS AIRPORT_SERVICEalias1, city AS CITYalias1, fare AS FAREalias1, flig...
atis
CREATE TABLE table_12809 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Place of the Player with a To par of 8 and a Score of 67-74-67=208?
SELECT "Place" FROM table_12809 WHERE "To par" = '–8' AND "Score" = '67-74-67=208'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE...
For those employees who was hired before 2002-06-21, show me about the correlation between employee_id and department_id in a scatter chart.
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21'
nvbench
CREATE TABLE table_61319 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
What is the FA Cup Apps when total goals is smaller than 4, League Cup Goals is 0, and League Apps is 8 (10)?
SELECT "FA Cup Apps" FROM table_61319 WHERE "Total Goals" < '4' AND "League Cup Goals" = '0' AND "League Apps" = '8 (10)'
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...
give me the number of patients whose insurance is medicaid and diagnoses icd9 code is v667?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.icd9_code = "V667"
mimicsql_data
CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline varchar(4), codeshare text ) CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country...
What is the altitude (or elevation) of the airports in the city of New York? Show me a bar chart, and I want to sort from low to high by the x axis.
SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY name
nvbench
CREATE TABLE table_name_67 ( date VARCHAR, tie_no VARCHAR )
What is the Date of Tie no 3?
SELECT date FROM table_name_67 WHERE tie_no = "3"
sql_create_context
CREATE TABLE table_79758 ( "Exam" text, "2006 First Time" text, "2006 All" text, "2007 First Time" text, "2007 All" text, "2008 First Time" text, "2008 All" text, "2009 First Time" text, "2009 All" text, "2010 First Time" text, "2011 First Time" text, "2012 First Time" te...
What is the percentage for all in 2007 when all in 2006 was 65%?
SELECT "2007 All" FROM table_79758 WHERE "2006 All" = '65%'
wikisql
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...
编号为7367933的医院在医疗记录里写的出院诊断为复发性阿弗他溃疡的病患其最低和最高医疗费一共多少钱?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7367933' AND t_kc21.OUT_DIAG_DIS_NM = '复发性阿弗他溃疡')
css
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...
96264599846门诊就诊的患者体征记录是哪天的
SELECT JLSJ FROM mzjzjlb WHERE JZLSH = '96264599846'
css
CREATE TABLE table_name_57 ( label VARCHAR, date VARCHAR )
What is Label, when Date is 1987?
SELECT label FROM table_name_57 WHERE date = "1987"
sql_create_context
CREATE TABLE Departments ( department_id INTEGER, dept_store_id INTEGER, department_name VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Department_Stores ( dept_store_id INTEG...
what are the names and ids of customers whose address contains TN?
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%"
nvbench
CREATE TABLE table_name_85 ( position VARCHAR, caps VARCHAR )
What position does the player with 13 caps play?
SELECT position FROM table_name_85 WHERE caps = 13
sql_create_context
CREATE TABLE table_75674 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text )
Which region had a release format of CD Maxi?
SELECT "Region" FROM table_75674 WHERE "Format" = 'cd maxi'
wikisql
CREATE TABLE table_17887 ( "No" real, "Player" text, "Height" text, "Position" text, "Year born" real, "Current Club" text )
What is the minimum year born for strasbourg?
SELECT MIN("Year born") FROM table_17887 WHERE "Current Club" = 'Strasbourg'
wikisql
CREATE TABLE table_9494 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What college did Keith Shologan play for?
SELECT "College" FROM table_9494 WHERE "Player" = 'keith shologan'
wikisql
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
列出医院4553560中根据出院诊断疾病编码,不同疾病的平均患者年龄是多大?
SELECT OUT_DIAG_DIS_CD, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '4553560' GROUP BY OUT_DIAG_DIS_CD
css
CREATE TABLE table_name_3 ( away_team VARCHAR, home_team VARCHAR )
When the home team is richmond, what was the away team playing?
SELECT away_team FROM table_name_3 WHERE home_team = "richmond"
sql_create_context
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Plot all_games_percent by grouped by all games as a bar graph
SELECT All_Games, All_Games_Percent FROM basketball_match
nvbench
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...
年龄在10岁以下的病人的医疗记录的平均医疗费总额有多少
SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE < 10 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE < 10 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE < 10 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PERSON...
css
CREATE TABLE table_78688 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
What is Name, when Weight is 'kg (lb)', when Club is 'Gezira', and when Date of Birth is '1974-02-18'?
SELECT "Name" FROM table_78688 WHERE "Weight" = 'kg (lb)' AND "Club" = 'gezira' AND "Date of Birth" = '1974-02-18'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE proce...
how many patients were prescribed with golytely in the same month until 2101 after the procedure of colonoscopy?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'colonoscopy...
mimic_iii
CREATE TABLE table_name_9 ( silver INTEGER, bronze VARCHAR, nation VARCHAR, total VARCHAR, gold VARCHAR )
What is the highest number of silvers for qatar with under 8 total, 0 golds, and over 2 bronzes?
SELECT MAX(silver) FROM table_name_9 WHERE total < 8 AND gold = 0 AND nation = "qatar" AND bronze > 2
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients died on or before 2133?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.dod_year <= "2133.0"
mimicsql_data
CREATE TABLE table_43417 ( "Date" text, "Result" text, "Score" text, "Brazil scorers" text, "Competition" text )
With a score of 2-2, what was the Result?
SELECT "Result" FROM table_43417 WHERE "Score" = '2-2'
wikisql
CREATE TABLE table_66504 ( "Debut year" real, "Player" text, "Games" real, "Goals" real, "Years at club" text )
How many Goals have Years at club of 1961 1966, and a Debut year larger than 1961?
SELECT COUNT("Goals") FROM table_66504 WHERE "Years at club" = '1961–1966' AND "Debut year" > '1961'
wikisql