context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
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_DIRE_CD text, MED_DIRE_NM text,...
零四年四月二十一日到一二年十一月二十六日,手术量排名在最后五名的科室编码和名称有哪些
SELECT t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.STA_DATE BETWEEN '2004-04-21' AND '2012-11-26' AND t_kc22.MED_INV_ITEM_TYPE = '手术费' GROUP BY t_kc22.MED_ORG_DEPT_CD ORDER BY COUNT(*) LIMIT 5
css
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, visualize the relationship between code and price , and group by attribute name.
SELECT T1.Code, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE appellations ( no number, appelation text, county text, state text, area text, isava text ) CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text,...
List the grapes and appelations of all wines.
SELECT grape, appelation FROM wine
spider
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
what is the allergy that patient 025-44495 has had this month?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND DATETIME(allergy.allergytime, 'start of month') = DATETI...
eicu
CREATE TABLE table_name_27 ( street_address VARCHAR, name VARCHAR )
What's the address of the union bank of California tower?
SELECT street_address FROM table_name_27 WHERE name = "union bank of california tower"
sql_create_context
CREATE TABLE table_name_99 ( round VARCHAR, venue VARCHAR )
What Round is in Ullevaal?
SELECT round FROM table_name_99 WHERE venue = "ullevaal"
sql_create_context
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients with hx traumatic fracture had a lab test for 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 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...
在患者韩文丽的医疗就诊记录中其在医院7659093入院是诊断疾病名称不包含炭末这俩字的编号是多少?
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '韩文丽' AND t_kc21.MED_SER_ORG_NO = '7659093' AND NOT t_kc21.IN_DIAG_DIS_NM LIKE '%炭末%'
css
CREATE TABLE table_2116 ( "Institution" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Nickname" text, "Joined" real )
In what year did the Lions join?
SELECT MIN("Joined") FROM table_2116 WHERE "Nickname" = 'Lions'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE pat...
since 3 years ago what are the top three most frequent diagnoses given to patients during the same month after the diagnosis of elderly multigravida-del?
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, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
mimic_iii
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...
参保人水高翰门诊花了多少手术费,在2000-01-07到2004-02-14这四年里?
SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '水高翰' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2000-01-07' AND '2004-02-14' AND t_kc22.MED_INV_ITEM_TYPE = '手术费'
css
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careuni...
what were the three most ordered microbiology tests for patients who have previously received oth extraoc mus-tend op within the same month during the last year?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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 = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR...
mimic_iii
CREATE TABLE table_name_63 ( finish VARCHAR, country VARCHAR )
What is the finish of South Africa?
SELECT finish FROM table_name_63 WHERE country = "south africa"
sql_create_context
CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Rank VARCHAR(15), Sex VARCHAR(1), Phone INTEGER, Room VARCHAR(5), ...
Return a bar chart on how many faculty members does each building have? List the result with the name of the building, and show total number in asc order.
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*)
nvbench
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREA...
is there ground transportation from ATL airport to downtown ATLANTA
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'ATLANTA' AND ground_service.airp...
atis
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 )...
indicate the daily average amount of respiration for patient 006-202970 on the last intensive care unit visit.
SELECT AVG(vitalperiodic.respiration) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-202970') AND NOT patient.unitdischargetime IS ...
eicu
CREATE TABLE table_name_51 ( eruptions VARCHAR, country VARCHAR, location VARCHAR, volcanic_explosivity_index VARCHAR )
Which Eruptions have a Location of pacific ring of fire, and a Volcanic Explosivity Index of 6, and a Country of peru?
SELECT eruptions FROM table_name_51 WHERE location = "pacific ring of fire" AND volcanic_explosivity_index = "6" AND country = "peru"
sql_create_context
CREATE TABLE person_info ( RYBH text, XBDM number, XBMC text, XM text, CSRQ time, CSD text, MZDM text, MZMC text, GJDM text, GJMC text, JGDM text, JGMC text, XLDM text, XLMC text, ZYLBDM text, ZYMC text ) CREATE TABLE jybgb ( YLJGDM text, YLJGDM_M...
在医疗就诊73994470317中,为70740731这个患者检验的科室和编码分别是什么
SELECT JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '73994470317'
css
CREATE TABLE climber ( Country VARCHAR )
How many distinct countries are the climbers from?
SELECT COUNT(DISTINCT Country) FROM climber
sql_create_context
CREATE TABLE table_204_944 ( id number, "mine" text, "province" text, "coordinates" text, "town" text, "dates" text, "comments" text )
what province is the town of temagami ?
SELECT "province" FROM table_204_944 WHERE "town" = 'temagami'
squall
CREATE TABLE table_20684390_1 ( mccain_percentage VARCHAR, county VARCHAR )
What is the McCain vote percentage in Jerome county?
SELECT mccain_percentage FROM table_20684390_1 WHERE county = "Jerome"
sql_create_context
CREATE TABLE table_name_25 ( rank VARCHAR, games VARCHAR )
What is the rank that shows 276 games?
SELECT rank FROM table_name_25 WHERE games = "276"
sql_create_context
CREATE TABLE table_41381 ( "Year" real, "Award" text, "Category" text, "Nominee" text, "Result" text )
What was the result for the Outstanding director of a musical category?
SELECT "Result" FROM table_41381 WHERE "Category" = 'outstanding director of a musical'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate tim...
User average score after final post.
SELECT Score, Title FROM Posts WHERE OwnerUserId = 251299
sede
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 s/p hanging and admission year is less than 2133?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.admityear < "2133"
mimicsql_data
CREATE TABLE table_203_675 ( id number, "match" number, "date" text, "round" text, "home/away" text, "opponent team" text, "score" text, "scorers" text )
what number of games did both teams score no points ?
SELECT COUNT(*) FROM table_203_675 WHERE "score" = 0 AND "score" = 0
squall
CREATE TABLE table_57568 ( "Coach" text, "Season" text, "Record" text, "Home" text, "Away" text, "Win %" real, "Average (Total) Home Attendance" text )
What was the lowest win% with an away score of 3-2 in 2011 season?
SELECT MIN("Win %") FROM table_57568 WHERE "Away" = '3-2' AND "Season" = '2011'
wikisql
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefin...
Number of questions that would be automatically protected. Enter Query Description
SELECT COUNT(Id) FROM Posts AS q WHERE PostTypeId = 1 AND DATEDIFF(m, q.CreationDate, GETDATE()) >= 6 AND AnswerCount >= 1 AND ViewCount >= 1000
sede
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 amount of name , and group by attribute name, could you rank by the X-axis in ascending?
SELECT T2.Name, COUNT(T2.Name) 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_24330912_1 ( money_list_rank INTEGER )
What is the lowest overall money list rank?
SELECT MIN(money_list_rank) FROM table_24330912_1
sql_create_context
CREATE TABLE table_name_37 ( surface VARCHAR, opponent VARCHAR )
What is the surface of the tournament with Sascha Kloer as the opponent?
SELECT surface FROM table_name_37 WHERE opponent = "sascha kloer"
sql_create_context
CREATE TABLE neighborhood ( id int, business_id varchar, neighborhood_name varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, month varchar ) CREATE TABLE business ( bid int, business_id varchar, nam...
Find the total checkins in Sunday
SELECT SUM(count) FROM checkin WHERE day = 'Sunday'
yelp
CREATE TABLE table_name_61 ( drawn INTEGER, games INTEGER )
How many Drawn is which has a Games smaller than 6?
SELECT SUM(drawn) FROM table_name_61 WHERE games < 6
sql_create_context
CREATE TABLE table_name_61 ( catalog VARCHAR, region VARCHAR, format VARCHAR )
Which Catalog has a Region of Canada and a Format of cd/dvd?
SELECT catalog FROM table_name_61 WHERE region = "canada" AND format = "cd/dvd"
sql_create_context
CREATE TABLE table_name_19 ( location VARCHAR, record VARCHAR )
Which location held the bout that led to a 4-3 record?
SELECT location FROM table_name_19 WHERE record = "4-3"
sql_create_context
CREATE TABLE table_21132404_1 ( _percentage_2006 VARCHAR, political_parties VARCHAR )
How many time was the political party the social democratic party of germany?
SELECT COUNT(_percentage_2006) FROM table_21132404_1 WHERE political_parties = "Social Democratic Party of Germany"
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
Is Prof. Yves Atchade the head professor for 525 next semester ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 525 AND instructor.name LIKE '%Yves Atchade%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_in...
advising
CREATE TABLE table_train_40 ( "id" int, "bone_marrow_transplant" bool, "organ_transplantation" bool, "systolic_blood_pressure_sbp" int, "do_not_resuscitate_dnr" bool, "autoimmune_disease" bool, "steroid_therapy" bool, "intention_to_central_venous_catheter" bool, "hematologic_disease"...
established do not resuscitate orders prior to enrollment
SELECT * FROM table_train_40 WHERE do_not_resuscitate_dnr = 1
criteria2sql
CREATE TABLE table_name_80 ( points VARCHAR, rank VARCHAR, games VARCHAR )
How many points are there for rank 5 with more than 34 games?
SELECT COUNT(points) FROM table_name_80 WHERE rank = 5 AND games > 34
sql_create_context
CREATE TABLE table_60015 ( "Name" text, "Region" text, "Programming" text, "Type" text, "Encryption" text )
What is the region for tv uskana?
SELECT "Region" FROM table_60015 WHERE "Name" = 'tv uskana'
wikisql
CREATE TABLE table_16976 ( "Total No." real, "Celebrity" text, "Director" text, "Original air date" text, "Viewers" text )
If the Original Air Date is 10January2008, what directors released on that date?
SELECT "Director" FROM table_16976 WHERE "Original air date" = '10January2008'
wikisql
CREATE TABLE table_name_73 ( home_team VARCHAR, away_team VARCHAR )
What was the home team that played Collingwood?
SELECT home_team FROM table_name_73 WHERE away_team = "collingwood"
sql_create_context
CREATE TABLE publication ( Publication_ID int, Book_ID int, Publisher text, Publication_Date text, Price real ) CREATE TABLE book ( Book_ID int, Title text, Issues real, Writer text )
Show different publishers together with the number of publications they have Plot them as bar chart, and could you list by the total number from high to low?
SELECT Publisher, COUNT(*) FROM publication GROUP BY Publisher ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_63789 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
What is the highest rank for a 6:52.70 time and notes of sa/b?
SELECT MAX("Rank") FROM table_63789 WHERE "Notes" = 'sa/b' AND "Time" = '6:52.70'
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,...
what is the number of patients whose marital status is single?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE"
mimicsql_data
CREATE TABLE table_53048 ( "Raion (district) or City" text, "Total" text, "Ukrainians" text, "Moldovans" text, "Bessarabian Bulgarians" text, "Russians" text, "Gagauzians" text, "Other ethnic groups\u00b2" text )
What city or Raion (district) has 8,600 Bessarabian Bulgarians?
SELECT "Raion (district) or City" FROM table_53048 WHERE "Bessarabian Bulgarians" = '8,600'
wikisql
CREATE TABLE table_4823 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team's score when south melbourne is the away team?
SELECT "Away team score" FROM table_4823 WHERE "Away team" = 'south melbourne'
wikisql
CREATE TABLE table_name_64 ( date INTEGER, cores_per_die___dies_per_module VARCHAR, clock VARCHAR )
What is the latest date with Cores per die / Dies per module of 2 / 1, and a Clock of 1.4-1.6ghz?
SELECT MAX(date) FROM table_name_64 WHERE cores_per_die___dies_per_module = "2 / 1" AND clock = "1.4-1.6ghz"
sql_create_context
CREATE TABLE table_20500097_1 ( points VARCHAR, poles INTEGER )
How many points did he win in the race with more than 1.0 poles?
SELECT points FROM table_20500097_1 WHERE poles > 1.0
sql_create_context
CREATE TABLE table_64207 ( "Frequency" text, "Station" text, "Operator" text, "Country of origin" text, "Transmitter location" text, "Format" text )
Which station has a frequency of 873khz?
SELECT "Station" FROM table_64207 WHERE "Frequency" = '873khz'
wikisql
CREATE TABLE table_60853 ( "Position" real, "Club" text, "Played" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Points" real, "Goal Difference" real )
Can you tell me the average Wins that has the Goal Difference larger than -24, and the Draws larger than 7?
SELECT AVG("Wins") FROM table_60853 WHERE "Goal Difference" > '-24' AND "Draws" > '7'
wikisql
CREATE TABLE table_name_1 ( song VARCHAR, year VARCHAR, us_hot_100 VARCHAR )
Which Song has a Year smaller than 1979, and a US Hot 100 of 8?
SELECT song FROM table_name_1 WHERE year < 1979 AND us_hot_100 = "8"
sql_create_context
CREATE TABLE table_33865 ( "Frequency" real, "Callsign" text, "Brand" text, "City of License" text, "Website" text, "Webcast" text )
Which Frequency has a Website of , and a Webcast of in san antonio?
SELECT AVG("Frequency") FROM table_33865 WHERE "Website" = '•' AND "Webcast" = '•' AND "City of License" = 'san antonio'
wikisql
CREATE TABLE competition_result ( competition_id number, club_id_1 number, club_id_2 number, score text ) CREATE TABLE club ( club_id number, name text, region text, start_year text ) CREATE TABLE competition ( competition_id number, year number, competition_type text, ...
What are the names of all clubs that do not have any players?
SELECT name FROM club WHERE NOT club_id IN (SELECT club_id FROM player)
spider
CREATE TABLE table_70048 ( "Rank" real, "Mountain Peak" text, "Province" text, "Mountain Range" text, "Location" text )
Name the mountain peak with location of 46.7000 n 60.5992 w
SELECT "Mountain Peak" FROM table_70048 WHERE "Location" = '46.7000°n 60.5992°w'
wikisql
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistoryTypes ( Id number, Name te...
Popular MongoDB Queries by ViewCount.
SELECT Score, ViewCount, CreationDate, DATEDIFF(DAY, CreationDate, GETDATE()) AS "DaysOpen", (ViewCount / DATEDIFF(DAY, CreationDate, GETDATE())) AS "NewScore", LastActivityDate, Title, Id, Tags FROM Posts WHERE Title LIKE '%mongodb%' OR Tags LIKE '%mongodb%' ORDER BY NewScore DESC
sede
CREATE TABLE table_8168 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Date" text, "Crowd" real )
What date was the away team from Adelaide?
SELECT "Date" FROM table_8168 WHERE "Away team" = 'adelaide'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number...
count the number of people who were prescribed tamsulosin hcl 0.4 mg po caps within 2 months following a diagnosis of chest pain until 2104.
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'chest pain' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1 JOIN (SELECT patient.uniquepid, med...
eicu
CREATE TABLE table_name_28 ( title VARCHAR, rank VARCHAR )
Which title had rank 9?
SELECT title FROM table_name_28 WHERE rank = 9
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is the number of patients whose year of birth is less than 2043 and lab test fluid is urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2043" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_2006661_1 ( date VARCHAR, value VARCHAR )
Name the date for value 55c
SELECT date FROM table_2006661_1 WHERE value = "55c"
sql_create_context
CREATE TABLE vocals ( TYPE VARCHAR )
Find all the vocal types.
SELECT DISTINCT TYPE FROM vocals
sql_create_context
CREATE TABLE festival_detail ( Festival_Name VARCHAR, YEAR VARCHAR )
Show the names of the three most recent festivals.
SELECT Festival_Name FROM festival_detail ORDER BY YEAR DESC LIMIT 3
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number,...
Top 300 users by Reputation in Iran.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users WHERE Location LIKE '%Iran%' ORDER BY Reputation DESC LIMIT 300
sede
CREATE TABLE table_name_90 ( power VARCHAR, class VARCHAR, identifier VARCHAR )
What is the power that belongs to Class A with an Identifier of CBOC-FM?
SELECT power FROM table_name_90 WHERE class = "a" AND identifier = "cboc-fm"
sql_create_context
CREATE TABLE table_14805 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Name the date with margin of victory of 1 stroke and tournament of legend financial group classic
SELECT "Date" FROM table_14805 WHERE "Margin of victory" = '1 stroke' AND "Tournament" = 'legend financial group classic'
wikisql
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real )
Return a scatter chart about the correlation between People_ID and Total .
SELECT People_ID, Total FROM body_builder
nvbench
CREATE TABLE table_name_84 ( outcome VARCHAR, score_in_final VARCHAR )
What was the outcome for the match that ended in a score of 5 7, 6 4, [10 7]?
SELECT outcome FROM table_name_84 WHERE score_in_final = "5–7, 6–4, [10–7]"
sql_create_context
CREATE TABLE table_name_36 ( slalom VARCHAR, downhill VARCHAR )
Which Slalom has a Downhill of 4?
SELECT slalom FROM table_name_36 WHERE downhill = "4"
sql_create_context
CREATE TABLE table_58142 ( "Player" text, "Nationality" text, "Position" text, "Years for Jazz" text, "School/Club Team" text )
What is the nationality of the guard who plays at Utah?
SELECT "Nationality" FROM table_58142 WHERE "Position" = 'guard' AND "School/Club Team" = 'utah'
wikisql
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 )...
how many patients were prescribed with acetaminophen 650 mg re supp within 2 months after the diagnosis of hepatorenal syndrome,?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hepatorenal syndrome') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN p...
eicu
CREATE TABLE table_50139 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" real, "Year named" real, "Name origin" text )
COunt the sum of Diameter (km) which has a Latitude of 62.7n?
SELECT SUM("Diameter (km)") FROM table_50139 WHERE "Latitude" = '62.7n'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
is there any microbiological test result for patient 031-23605's blood, venipuncture the previous year?
SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-23605')) AND microlab.culturesite = 'blood, venipuncture' AND DATETIME(microla...
eicu
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is the number of patients prescribed sulfameth/trimethoprim ds who were admitted via physician referral/normal delivery?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Sulfameth/Trimethoprim DS"
mimicsql_data
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text )
What is the proportion of the teams in elimination? Display by a pie chart.
SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team
nvbench
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), ...
For all employees who have the letters D or S in their first name, a line chart shows the change of employee_id over hire_date, and could you sort by the X in ascending?
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE
nvbench
CREATE TABLE table_name_86 ( network VARCHAR, title VARCHAR )
What is the Network, when Title is 'Epik High's Love And Delusion'?
SELECT network FROM table_name_86 WHERE title = "epik high's love and delusion"
sql_create_context
CREATE TABLE table_71814 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the score of the Blue Jays game when their record was 75-68 and the attendance was larger than 33,736?
SELECT "Score" FROM table_71814 WHERE "Attendance" > '33,736' AND "Record" = '75-68'
wikisql
CREATE TABLE table_29218221_2 ( rider VARCHAR, fri_3_june VARCHAR )
Who was the rider with a Fri 3 June time of 18' 19.68 123.516mph?
SELECT rider FROM table_29218221_2 WHERE fri_3_june = "18' 19.68 123.516mph"
sql_create_context
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDis...
CV Most Interesting Users - Only Counting 'immediate' votes.
SELECT COUNT(*) AS score, p.Id, p.OwnerUserId FROM Votes AS v, Posts AS p, Posts AS p2 WHERE v.VoteTypeId = 2 AND v.PostId = p.Id AND p.ParentId = p2.Id AND v.CreationDate - p2.CreationDate < 14 GROUP BY p.Id, p.OwnerUserId HAVING COUNT(*) > 10
sede
CREATE TABLE table_name_50 ( away_team VARCHAR )
What was South Melbourne's score as the away team?
SELECT away_team AS score FROM table_name_50 WHERE away_team = "south melbourne"
sql_create_context
CREATE TABLE table_name_64 ( entrant VARCHAR, year VARCHAR )
What is the entrant in 1999?
SELECT entrant FROM table_name_64 WHERE year = 1999
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_DIRE_CD text, MED_DIRE_NM text,...
医院8731863所有的就诊记录里医保的统筹基金花费和总的医疗费比值根据科室不同列出来平均有多少
SELECT t_kc21.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '8731863' GROUP BY t_kc21.MED_ORG_DEPT_NM
css
CREATE TABLE table_6328 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What Tournament on October 24, 1982 had Alycia Moulton as the Partner?
SELECT "Tournament" FROM table_6328 WHERE "Date" = 'october 24, 1982' AND "Partner" = 'alycia moulton'
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,...
give me the number of patients whose diagnoses icd9 code is 42831 and lab test fluid is other body 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.icd9_code = "42831" AND lab.fluid = "Other Body Fluid"
mimicsql_data
CREATE TABLE table_17683 ( "Series Ep #" real, "Season 3 Ep #" real, "Title" text, "Director" text, "Writer(s)" text, "Original Airdate" text, "Production Code" real )
What is the title of season 3 ep# 12?
SELECT "Title" FROM table_17683 WHERE "Season 3 Ep #" = '12'
wikisql
CREATE TABLE table_42202 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What Country had a Score of 71-67=138?
SELECT "Country" FROM table_42202 WHERE "Score" = '71-67=138'
wikisql
CREATE TABLE table_name_45 ( surface VARCHAR, score VARCHAR )
Which has a Score of 6 1, 3 0 ret.?
SELECT surface FROM table_name_45 WHERE score = "6–1, 3–0 ret."
sql_create_context
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_...
what are the ids and names of all start stations that were the beginning of at least 200 trips?, and could you rank bars in ascending order?
SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_name
nvbench
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TAB...
For my graduation is LHC 750 essential ?
SELECT COUNT(*) > 0 FROM course, program_course WHERE course.department = 'LHC' AND course.number = 750 AND program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id
advising
CREATE TABLE table_57613 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score of the home team when the opposing team had a score of 9.11 (65)?
SELECT "Home team score" FROM table_57613 WHERE "Away team score" = '9.11 (65)'
wikisql
CREATE TABLE table_17879 ( "Week" real, "Date" text, "Kickoff ( ET )" text, "TV" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text )
What is the opponent of the veterans stadium
SELECT "Opponent" FROM table_17879 WHERE "Game Site" = 'Veterans Stadium'
wikisql
CREATE TABLE table_65026 ( "Rank" real, "Athletes" text, "Country" text, "Time" text, "Notes" text )
What is the rank of Israel?
SELECT MAX("Rank") FROM table_65026 WHERE "Country" = 'israel'
wikisql
CREATE TABLE table_name_53 ( opponent VARCHAR, location_attendance VARCHAR )
Who was the opponent when they played at the Skydome?
SELECT opponent FROM table_name_53 WHERE location_attendance = "skydome"
sql_create_context
CREATE TABLE table_name_27 ( player VARCHAR, score VARCHAR )
With a score of 70, this player's name is listed as what?
SELECT player FROM table_name_27 WHERE score = 70
sql_create_context
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_items ( row_id num...
the number of patients in careunit micu in the last year?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'micu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year'))
mimic_iii
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 born before 2156 who had endoscopic retrograde cholangiography.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2156" AND procedures.short_title = "Endosc retro cholangiopa"
mimicsql_data
CREATE TABLE table_67579 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text )
what last performance has past status, ballet as style and tommy batchelor?
SELECT "Last Performance" FROM table_67579 WHERE "Status" = 'past' AND "Style" = 'ballet' AND "Name" = 'tommy batchelor'
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 days have passed since patient 016-9636 received his first -monos lab test on the current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', 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 = '016-9636' AND patient.hospit...
eicu
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Na...
getting post data for inverted index.
SELECT Id, PostTypeId, Tags, ClosedDate, CreationDate FROM Posts WHERE CreationDate LIKE '%2018%'
sede