context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
what were the four most commonly given diagnoses for patients that had previously received a other pleural incision within 2 months, since 2102?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
mimic_iii
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Show me about the distribution of meter_200 and the average of meter_100 , and group by attribute meter_200 in a bar chart, and could you show mean meter 100 from low to high order?
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200 ORDER BY AVG(meter_100)
nvbench
CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number ) CREATE TABLE race ( race_id number, name text, class text, date text, track_id text )
Return the name, location, and seating of the track that was opened in the most recent year.
SELECT name, location, seating FROM track ORDER BY year_opened DESC LIMIT 1
spider
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
has patient 002-4486 been prescribed with magnesium sulfate 2 g in ns premix, sodium chloride 0.9% 500 ml lvp or enoxaparin inj during their current hospital visit?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-4486' AND patient.hospitaldischargetime IS NULL)) AND medication.drugn...
eicu
CREATE TABLE table_name_31 ( year INTEGER, extra VARCHAR )
Tell me the sum of year for extra of junior team competition
SELECT SUM(year) FROM table_name_31 WHERE extra = "junior team competition"
sql_create_context
CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stock int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Rankin...
Compare the number of the names of phones by a bar chart.
SELECT Name, COUNT(Name) FROM phone_market AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID JOIN phone AS T3 ON T1.Phone_ID = T3.Phone_ID GROUP BY Name
nvbench
CREATE TABLE table_name_83 ( score VARCHAR, date VARCHAR, surface VARCHAR, partner VARCHAR )
What is the score of the tournament on 25 July 1994 with a clay surface and Patricia Tarabini as the partner?
SELECT score FROM table_name_83 WHERE surface = "clay" AND partner = "patricia tarabini" AND date = "25 july 1994"
sql_create_context
CREATE TABLE table_42941 ( "Year" text, "Venue" text, "Champion" text, "Country" text, "Score" text, "Runner-up" text )
Who was the champion in the game played at the St. Andrews Links with Dick Chapman as the runner-up?
SELECT "Champion" FROM table_42941 WHERE "Runner-up" = 'dick chapman' AND "Venue" = 'st. andrews links'
wikisql
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, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
知不知道门诊就诊79366019227的患者体征记录的日期和时间呢
SELECT JLSJ FROM mzjzjlb WHERE JZLSH = '79366019227'
css
CREATE TABLE table_41238 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Unit" text, "Location" text )
What name has gen et sp nov as the novelty?
SELECT "Name" FROM table_41238 WHERE "Novelty" = 'gen et sp nov'
wikisql
CREATE TABLE table_name_46 ( winning_team VARCHAR, circuit VARCHAR )
Who was the winning team for circuit zolder?
SELECT winning_team FROM table_name_46 WHERE circuit = "circuit zolder"
sql_create_context
CREATE TABLE table_44779 ( "Year" real, "Month" text, "Single" text, "Album" text, "Record label" text )
What's the average year for the good things happening album's single 'lady lady lay'?
SELECT AVG("Year") FROM table_44779 WHERE "Album" = 'good things happening' AND "Single" = 'lady lady lay'
wikisql
CREATE TABLE table_77745 ( "Rd #" real, "Pick #" real, "Player" text, "Team (League)" text, "Reg GP" real, "Pl GP" real )
How many reg GP for nathan barrett in a round less than 8?
SELECT COUNT("Reg GP") FROM table_77745 WHERE "Player" = 'nathan barrett' AND "Rd #" < '8'
wikisql
CREATE TABLE t_kc21_t_kc24 ( MED_CLINIC_ID text, MED_SAFE_PAY_ID number ) 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, ...
医疗就诊02796405922在就诊期间产生的费用是否退费结算完成?
SELECT t_kc24.REF_SLT_FLG FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '02796405922'
css
CREATE TABLE table_name_8 ( took_office VARCHAR, governor VARCHAR )
Who took office under the government of Matthew E. Welsh?
SELECT took_office FROM table_name_8 WHERE governor = "matthew e. welsh"
sql_create_context
CREATE TABLE table_21230 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who scored highest rebounds high points is charlie villanueva (32)
SELECT "High rebounds" FROM table_21230 WHERE "High points" = 'Charlie Villanueva (32)'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose days of hospital stay is greater than 15 and lab test name is creatinine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "15" AND lab.label = "Creatinine"
mimicsql_data
CREATE TABLE table_78605 ( "Letter" text, "Pronunciation spelled free" text, "Pronunciation spelled checked" text, "Example spelled free" text, "Example spelled checked" text )
What is Letter, when Example Spelled Checked is 'tin /t n/ ('tin')'?
SELECT "Letter" FROM table_78605 WHERE "Example spelled checked" = 'tin /tɪn/ ("tin")'
wikisql
CREATE TABLE gwyjzb ( 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, ...
从02年2月17日开始05年10月13日结束的医疗机构5215588的统筹总金额和总金额是多少元?
SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '5215588' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-02-17' AND '2005-10-13' UNION SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM fgwyjzb JOIN t_kc24 ON fgwyjzb.ME...
css
CREATE TABLE table_name_81 ( nflcom_recap VARCHAR, game_site VARCHAR )
What's the site of the recap at qualcomm stadium?
SELECT nflcom_recap FROM table_name_81 WHERE game_site = "qualcomm stadium"
sql_create_context
CREATE TABLE table_name_12 ( constituency VARCHAR, result VARCHAR, liberal_democrats VARCHAR )
In what constituency was the result labour hold and Liberal democrat Elizabeth Newton won?
SELECT constituency FROM table_name_12 WHERE result = "labour hold" AND liberal_democrats = "elizabeth newton"
sql_create_context
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...
姓名叫魏正雅的参保人在2011年2月1日到2018年3月19日内她的门诊检查费用一共有多少?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_SEX = '魏正雅' AND t_kc22.STA_DATE BETWEEN '2011-02-01' AND '2018-03-19' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE table_name_27 ( position VARCHAR, name VARCHAR )
What is the Postion, when the Name is Rod Paavola?
SELECT position FROM table_name_27 WHERE name = "rod paavola"
sql_create_context
CREATE TABLE table_57142 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
what is the highest laps when the grid is 1?
SELECT MAX("Laps") FROM table_57142 WHERE "Grid" = '1'
wikisql
CREATE TABLE has_allergy ( stuid number, allergy text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE allergy_type ( allergy text, allergytype text )
Which advisor has most number of students?
SELECT advisor FROM student GROUP BY advisor ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_74043 ( "Team" text, "Contest and round" text, "Opponent" text, "1st leg score*" text, "2nd leg score**" text, "Aggregate score" text )
What was the score between Marseille and Manchester United on the second leg of the Champions League Round of 16?
SELECT "2nd leg score**" FROM table_74043 WHERE "Opponent" = 'Marseille'
wikisql
CREATE TABLE table_74351 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What nationality is keith carney?
SELECT "Nationality" FROM table_74351 WHERE "Player" = 'Keith Carney'
wikisql
CREATE TABLE table_11959669_3 ( high_assists VARCHAR, date VARCHAR )
Who had the highest assists on November 4
SELECT high_assists FROM table_11959669_3 WHERE date = "November 4"
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
how many patients are procedured with icd9 code 5187?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "5187"
mimicsql_data
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...
55046021585这个检验报告单的就诊类型属于那个种类?
SELECT JZLX FROM jybgb WHERE BGDH = '55046021585'
css
CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) 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, X...
检验报告单91253770144是哪个人报告的,报告人工号和姓名是什么
SELECT jybgb.BGRGH, jybgb.BGRXM FROM jybgb WHERE jybgb.BGDH = '91253770144'
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
has there ever been any .9% normal saline given to patient 5395 in 09/this year?
SELECT COUNT(*) > 0 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 = 5395)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.9% norma...
mimic_iii
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, ...
which patients have drug code bactss?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "BACTSS"
mimicsql_data
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
how many patients are suggested with the procedure colonoscopy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Colonoscopy"
mimicsql_data
CREATE TABLE table_name_62 ( opponent VARCHAR, record VARCHAR )
Which opponent has a record of 78-60?
SELECT opponent FROM table_name_62 WHERE record = "78-60"
sql_create_context
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 )
For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of revenue , and group by attribute name, and order by the Name in asc.
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name
nvbench
CREATE TABLE table_name_61 ( party VARCHAR, district VARCHAR, delegate VARCHAR )
Which party belongs to district 41, and is delegated by Jill P. Carter?
SELECT party FROM table_name_61 WHERE district = 41 AND delegate = "jill p. carter"
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...
Top Users of SO From Bangladesh.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%bangladesh%' OR LOWER(Location) LIKE '%bd' OR LOWER(Location) LIKE '%dhaka%' ORDER BY Reputation DESC
sede
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
how many patients whose marital status is married and ethnicity is black/cape verdean?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "BLACK/CAPE VERDEAN"
mimicsql_data
CREATE TABLE table_name_94 ( to_par VARCHAR, place VARCHAR, player VARCHAR )
WHAT IS THE TO PAR FOR GEOFF OGILVY WITH A PLACE OF T3?
SELECT to_par FROM table_name_94 WHERE place = "t3" AND player = "geoff ogilvy"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
give me the number of patients whose days of hospital stay is greater than 17 and lab test name is fibrinogen, functional?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "17" AND lab.label = "Fibrinogen, Functional"
mimicsql_data
CREATE TABLE table_34501 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Who was the opponent at the game with a score of 6 5 (10)?
SELECT "Opponent" FROM table_34501 WHERE "Score" = '6–5 (10)'
wikisql
CREATE TABLE table_name_90 ( team VARCHAR, outgoing_manager VARCHAR )
What team did gonzalo arconada manage?
SELECT team FROM table_name_90 WHERE outgoing_manager = "gonzalo arconada"
sql_create_context
CREATE TABLE EMPLOYEE ( EMP_NUM int, EMP_LNAME varchar(15), EMP_FNAME varchar(12), EMP_INITIAL varchar(1), EMP_JOBCODE varchar(5), EMP_HIREDATE datetime, EMP_DOB datetime ) CREATE TABLE CLASS ( CLASS_CODE varchar(5), CRS_CODE varchar(10), CLASS_SECTION varchar(2), CLASS_TIME...
Give the proportion of how many credits does the department offer?
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE
nvbench
CREATE TABLE table_50570 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What player has a score of 67-70-77=214?
SELECT "Player" FROM table_50570 WHERE "Score" = '67-70-77=214'
wikisql
CREATE TABLE table_23292220_8 ( jasons_team VARCHAR, first_broadcast VARCHAR )
Who was on Jason's team for the 12 June 2009 episode?
SELECT jasons_team FROM table_23292220_8 WHERE first_broadcast = "12 June 2009"
sql_create_context
CREATE TABLE table_name_14 ( attendance INTEGER, date VARCHAR )
How many people attended on 2 may 2007?
SELECT SUM(attendance) FROM table_name_14 WHERE date = "2 may 2007"
sql_create_context
CREATE TABLE table_26200084_1 ( rank__week_ VARCHAR, _number VARCHAR )
What was the ranking of episode #19?
SELECT rank__week_ FROM table_26200084_1 WHERE _number = 19
sql_create_context
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswe...
People with the gold spring-batch badge.
SELECT u.DisplayName FROM Badges AS b INNER JOIN Users AS u ON u.Id = b.UserId WHERE b.Name = 'spring-batch' AND b.Class = 1 ORDER BY u.DisplayName
sede
CREATE TABLE table_name_65 ( gauthier VARCHAR, liscumb VARCHAR )
What Gauthier had a 15 Liscumb?
SELECT gauthier FROM table_name_65 WHERE liscumb = "15"
sql_create_context
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id nu...
have patient 23070 received lab tests in this month?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23070) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
mimic_iii
CREATE TABLE table_name_84 ( score_in_the_final VARCHAR, partner VARCHAR, tournament VARCHAR )
What was the score where Olga Lugina played in the Tournament of poitiers , france itf $25,000?
SELECT score_in_the_final FROM table_name_84 WHERE partner = "olga lugina" AND tournament = "poitiers , france itf $25,000"
sql_create_context
CREATE TABLE table_1566852_3 ( cover_model VARCHAR, centerfold_model VARCHAR )
WHO WAS THE COVER MODEL OF PLAYBOY WHERE THE CENTERFOLD MODEL WAS SHALLAN MEIERS?
SELECT cover_model FROM table_1566852_3 WHERE centerfold_model = "Shallan Meiers"
sql_create_context
CREATE TABLE problem_category_codes ( problem_category_code text, problem_category_description text ) CREATE TABLE problem_status_codes ( problem_status_code text, problem_status_description text ) CREATE TABLE problems ( problem_id number, product_id number, closure_authorised_by_staff_id...
How many problems are there for product voluptatem?
SELECT COUNT(*) FROM product AS T1 JOIN problems AS T2 ON T1.product_id = T2.product_id WHERE T1.product_name = "voluptatem"
spider
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,...
get me the number of patients with gast30l drug code who were categorized under chemistry lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "GAST30L" AND lab."CATEGORY" = "Chemistry"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
what is age and drug code of subject id 2560?
SELECT demographic.age, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE table_13943 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
The time of 8:34.27 was set by what athlete?
SELECT "Athlete" FROM table_13943 WHERE "Time" = '8:34.27'
wikisql
CREATE TABLE table_4615 ( "Line" text, "Color" text, "Terminus" text, "Length" text, "Stations" text, "Daily Ridership" real )
The color diamond is assigned to which Terminus?
SELECT "Terminus" FROM table_4615 WHERE "Color" = 'diamond'
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 maximum age of patients whose admission type is elective and year of death is before 2183?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dod_year < "2183.0"
mimicsql_data
CREATE TABLE table_13423 ( "Date" text, "Tournament" text, "Winning Score" text, "Margin of Victory" text, "Runner(s)-up" text )
What's the winning score on Feb 12, 1978?
SELECT "Winning Score" FROM table_13423 WHERE "Date" = 'feb 12, 1978'
wikisql
CREATE TABLE table_39124 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
What is the difference of the team with 12 points?
SELECT "Difference" FROM table_39124 WHERE "Points" = '12'
wikisql
CREATE TABLE table_9958 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" text, "Record" text, "Points" real )
Who is the visitor from the game with 7,000 in attendance on January 1?
SELECT "Visitor" FROM table_9958 WHERE "Attendance" = '7,000' AND "Date" = 'january 1'
wikisql
CREATE TABLE table_78 ( "Stadium" text, "Capacity" real, "City" text, "Country" text, "Tenant" text, "Opening" real )
How many tenants are there in the city of Samsun?
SELECT COUNT("Tenant") FROM table_78 WHERE "City" = 'Samsun'
wikisql
CREATE TABLE table_7270 ( "Year" real, "Pass Rate" text, "% 'A' Aggregates" text, "% 'B' Aggregates" text, "% 'A' or 'B' Aggregates" text, "Average A's per learner" real )
Which % 'A' or 'B' Aggregates has a Year of 2009?
SELECT "% 'A' or 'B' Aggregates" FROM table_7270 WHERE "Year" = '2009'
wikisql
CREATE TABLE table_58421 ( "Player" text, "Date of Birth" text, "Batting Style" text, "Bowling Style" text, "First Class Team" text )
What is the birth date for Mervyn Dillon?
SELECT "Date of Birth" FROM table_58421 WHERE "Player" = 'mervyn dillon'
wikisql
CREATE TABLE table_43913 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What was the position of the player from the college of Nevada with a round over 5?
SELECT "Position" FROM table_43913 WHERE "Round" > '5' AND "College" = 'nevada'
wikisql
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE ReviewTaskResults ( Id number, ...
Find which User IDs don't exist (deleted users). Enter the maximum user ID to retrieve up to and click 'Run Query.
SELECT Id, DisplayName, Reputation, Age FROM Users WHERE Id > 4 AND Id < @id
sede
CREATE TABLE table_25220821_3 ( fri_4_june VARCHAR, wed_2_june VARCHAR )
What is the Friday 4 June if the Wednesday 2 June is 20' 50.62 108.608mph?
SELECT fri_4_june FROM table_25220821_3 WHERE wed_2_june = "20' 50.62 108.608mph"
sql_create_context
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...
What is the minimum salary in each department. Show scatter chart.
SELECT MIN(SALARY), DEPARTMENT_ID FROM employees
nvbench
CREATE TABLE table_79492 ( "Season" real, "Network" text, "Episodes" real, "Premiered" text, "Ended" text, "DVD set release date" text )
What is the total season number for episodes later than episode 30?
SELECT SUM("Season") FROM table_79492 WHERE "Episodes" > '30'
wikisql
CREATE TABLE table_40191 ( "Club" text, "City" text, "Stadium" text, "2009 season" text, "Group" text )
WHich Club has a City of col n?
SELECT "Club" FROM table_40191 WHERE "City" = 'colón'
wikisql
CREATE TABLE table_1331313_1 ( office VARCHAR, department VARCHAR )
how many office with department being department of justice kagawaran ng katarungan
SELECT COUNT(office) FROM table_1331313_1 WHERE department = "department of Justice Kagawaran ng Katarungan"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
what is the cost of a drug known as dextrose 5%/nacl 0.45%?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'dextrose 5%/nacl 0.45%')
eicu
CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number int, from_airport varchar, meal_code text, stops int,...
leaving DENVER flying to SAN FRANCISCO before 1000 what type of aircraft is used
SELECT DISTINCT aircraft.aircraft_code FROM aircraft, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, equipment_sequence, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time < 1000 AND f...
atis
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
when was the first laboratory test patient 002-58884 received last month?
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 = '002-58884')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T...
eicu
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_labitems ( row_id ...
how many patients have undergone a circumcision within the same hospital visit after having been diagnosed with personal history of fall, last year?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
mimic_iii
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is the daily minimum dose of d5ns ivf that patient 006-50368 takes since 20 months ago?
SELECT MIN(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-50368')) AND intakeoutput.celllabel = 'd5ns ...
eicu
CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline text, departure_flight_number int, stop_time int ) CREATE TABLE dual_carrier...
i would like an early morning nonstop flight from NEW YORK to LAS VEGAS on 2 28
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 = 'LAS VEGAS' AND date_day.day_number = 28 AND date_day.month_number = 2 ...
atis
CREATE TABLE table_69801 ( "Year" real, "Date" text, "Winner" text, "Result" text, "Loser" text, "Location" text )
Where was the game that the Indianapolis Colts lost 24-14?
SELECT "Location" FROM table_69801 WHERE "Loser" = 'indianapolis colts' AND "Result" = '24-14'
wikisql
CREATE TABLE table_15634 ( "Year" real, "Number of Users" text, "Penetration" text, "Number of Broadband Subscribers" text, "Broadband Penetration" text, "Population" text, "Data provided by" text )
What is the broadband penetration where there are ~355,100 broadband subscribers?
SELECT "Broadband Penetration" FROM table_15634 WHERE "Number of Broadband Subscribers" = '~355,100'
wikisql
CREATE TABLE table_name_62 ( score VARCHAR, date VARCHAR )
What was the score on 26 July 1930?
SELECT score FROM table_name_62 WHERE date = "26 july 1930"
sql_create_context
CREATE TABLE table_name_7 ( urban_population__2010_ INTEGER, city VARCHAR )
What is the urban population for the city of Fuzhou?
SELECT AVG(urban_population__2010_) FROM table_name_7 WHERE city = "fuzhou"
sql_create_context
CREATE TABLE table_20597634_3 ( dates_administered VARCHAR, scott_mcadams__d_ VARCHAR )
When 23% scott mcadams (d) what are the dates administered?
SELECT dates_administered FROM table_20597634_3 WHERE scott_mcadams__d_ = "23%"
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 drug code and drug dose of drug name acetaminophen iv?
SELECT prescriptions.formulary_drug_cd, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Acetaminophen IV"
mimicsql_data
CREATE TABLE table_22904 ( "No." real, "#" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Name the production code for viewers for 1.69
SELECT "Production code" FROM table_22904 WHERE "U.S. viewers (million)" = '1.69'
wikisql
CREATE TABLE table_7275 ( "Rank" real, "Airport" text, "Location" text, "Code" text, "Total passengers" real, "% Change 2011-2012" real, "Aircraft movements" real, "Cargo traffic" real )
Can you tell me the average Total passengers that has the Code of mad, and the Cargo traffic smaller than 359,362,155?
SELECT AVG("Total passengers") FROM table_7275 WHERE "Code" = 'mad' AND "Cargo traffic" < '359,362,155'
wikisql
CREATE TABLE table_43861 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text )
what is the name when the lane is less than 4 and mark is 52.64?
SELECT "Name" FROM table_43861 WHERE "Lane" < '4' AND "Mark" = '52.64'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
how many patients are diagnosed with primary disease sepsis and stayed in hospital for more than 43 days?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SEPSIS" AND demographic.days_stay > "43"
mimicsql_data
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, ...
从一三年九月十九日到一八年八月十日科室4316的住院量是多少知道吗?
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSDM = '4316' AND zyjzjlb.RYDJSJ BETWEEN '2013-09-19' AND '2018-08-10'
css
CREATE TABLE table_12716 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the Country of the T8 Place Player with a Score of 68-74=142?
SELECT "Country" FROM table_12716 WHERE "Place" = 't8' AND "Score" = '68-74=142'
wikisql
CREATE TABLE table_47712 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the method when 4-2 was the record?
SELECT "Method" FROM table_47712 WHERE "Record" = '4-2'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
how many hours has it been since patient 006-133605 was admitted into the hospital?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.hospitaladmittime)) FROM patient WHERE patient.uniquepid = '006-133605' AND patient.hospitaldischargetime IS NULL
eicu
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX nu...
把检测指标结果定量单位、检测指标名称和这个14159075657检验指标记录相同的且检测指标结果定量小于其的检验指标记录都找出来有啥?
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '14159075657') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '14159075657') AND jyjgzbb.JCZBJGDL < (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '14159075657')
css
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, ZYLBDM text, ZYMC text ) CREATE TABLE hz_info_mzjzjlb ( JZLSH number, ...
姓名是谢飞烟的那个病人在2015年3月8日之后都有哪些当时的住院就诊记录对应的检验报告单?住院期间就诊流水号是什么数字?
SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '谢飞烟' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2015-03-08')
css
CREATE TABLE table_200_35 ( id number, "party" text, "active voters" number, "inactive voters" number, "total voters" number, "percentage" text )
as of october 25 , 2005 , what percentage of voters were unaffiliated ?
SELECT "percentage" FROM table_200_35 WHERE "party" = 'unaffiliated'
squall
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time...
For exams , does Prof. Firas Shalabi always set one ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN...
advising
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...
give me the number of patients whose ethnicity is white and diagnoses icd9 code is v4502?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "WHITE" AND diagnoses.icd9_code = "V4502"
mimicsql_data
CREATE TABLE person ( name VARCHAR ) CREATE TABLE PersonFriend ( name VARCHAR )
Who is the person that has no friend?
SELECT name FROM person EXCEPT SELECT name FROM PersonFriend
sql_create_context
CREATE TABLE table_name_1 ( pos VARCHAR, club VARCHAR, name VARCHAR )
What is Spandau 04 Player Jens Pohlmann's Pos.?
SELECT pos FROM table_name_1 WHERE club = "spandau 04" AND name = "jens pohlmann"
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABL...
Find the number of activities available.
SELECT COUNT(*) FROM activity
spider