context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_75 ( club_province VARCHAR, position VARCHAR, caps VARCHAR )
Which Club/province has a Position of centre, and Caps of 27?
SELECT club_province FROM table_name_75 WHERE position = "centre" AND caps = 27
sql_create_context
CREATE TABLE table_8905 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" text )
What was the Attendance on November 26?
SELECT "Attendance" FROM table_8905 WHERE "Date" = 'november 26'
wikisql
CREATE TABLE table_name_25 ( opponent VARCHAR, round VARCHAR, time VARCHAR )
Who did wilson reis fight against that lasted less than 3 rounds with a time of 1:02?
SELECT opponent FROM table_name_25 WHERE round < 3 AND time = "1:02"
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,...
find the number of patients with medicaid insurance whose primary disease is syncope;telemetry.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "SYNCOPE;TELEMETRY"
mimicsql_data
CREATE TABLE table_52375 ( "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 in the game that had the Away team of south melbourne?
SELECT "Home team score" FROM table_52375 WHERE "Away team" = 'south melbourne'
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 prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, ...
did patient 1912's arterial bp [systolic] on the last hospital encounter be greater than 121.0?
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1912 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND chartevents.itemid ...
mimic_iii
CREATE TABLE table_name_77 ( home VARCHAR, venue VARCHAR )
Who was the home team for the match at Stadion pod Vrmcem?
SELECT home FROM table_name_77 WHERE venue = "stadion pod vrmcem"
sql_create_context
CREATE TABLE artist ( artist_id number, artist text, age number, famous_title text, famous_release_date text ) CREATE TABLE volume ( volume_id number, volume_issue text, issue_date text, weeks_on_top number, song text, artist_id number ) CREATE TABLE music_festival ( id...
Return the famous release date for the oldest artist.
SELECT famous_release_date FROM artist ORDER BY age DESC LIMIT 1
spider
CREATE TABLE table_name_98 ( year INTEGER, engine VARCHAR )
What is the earliest year that has a Bristol engine?
SELECT MIN(year) FROM table_name_98 WHERE engine = "bristol"
sql_create_context
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, find name and the sum of manufacturer , and group by attribute name, and visualize them by a bar chart, order from low to high by the Name.
SELECT T2.Name, T1.Manufacturer 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_80392 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the record at the game that had a score of 7-10?
SELECT "Record" FROM table_80392 WHERE "Score" = '7-10'
wikisql
CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country text, active varchar(2) ) CREATE TABLE airports ( apid integer, name text, city text, country text, x real, y real, elevation bigint, iata character varc...
A pie chart for what are the number of the countries of all airlines whose names start with Orbit?
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country
nvbench
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Number of users with reputation grouped and ordered by last access date.
SELECT DATEADD(day, DATEDIFF(day, 0, LastAccessDate), 0) AS "Last access date", COUNT(*) AS "Users" FROM Users WHERE Reputation >= '##Reputation:int?5##' GROUP BY DATEADD(day, DATEDIFF(day, 0, LastAccessDate), 0) ORDER BY DATEADD(day, DATEDIFF(day, 0, LastAccessDate), 0)
sede
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ...
Deleted questions by specific gold badge holder.
SELECT 'ex' + 'cel' AS "tag"
sede
CREATE TABLE table_name_50 ( opponent VARCHAR, date VARCHAR )
Who was the opponent on June 3?
SELECT opponent FROM table_name_50 WHERE date = "june 3"
sql_create_context
CREATE TABLE table_29952 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What location and attendance were there for game 5?
SELECT "Location Attendance" FROM table_29952 WHERE "Game" = '5'
wikisql
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE flight ( flno number(4,0), origin var...
Return a bar chart on what are the names and distances for all airplanes?, and list from low to high by the Y please.
SELECT name, distance FROM aircraft ORDER BY distance
nvbench
CREATE TABLE table_28846752_12 ( innings VARCHAR, average VARCHAR )
How many innings for the player with an average of 22.61?
SELECT innings FROM table_28846752_12 WHERE average = "22.61"
sql_create_context
CREATE TABLE table_46480 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is the lowest score that wes ellis got?
SELECT MIN("Score") FROM table_46480 WHERE "Player" = 'wes ellis'
wikisql
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE ground_service ( city_code text, airport...
what flights go from DENVER to ATLANTA
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA...
atis
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...
Draw a bar chart about the distribution of All_Home and the sum of School_ID , and group by attribute All_Home, and order All_Home from low to high order please.
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
nvbench
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text ) 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...
列出患者奚经略所有检验结果指标记录中的检测方法在2007-09-21到2008-12-08内有什么?
SELECT jyjgzbb.JCFF FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 = jybgb...
css
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patient...
what intake did patient 006-133605 have the first time the previous day.
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-133605')) AND intakeoutput.cellpath LIKE '%intake%' AND ...
eicu
CREATE TABLE table_name_11 ( max_torque_at_rpm VARCHAR, engine_name VARCHAR )
What is the max torque of the 1.2 mpi engine?
SELECT max_torque_at_rpm FROM table_name_11 WHERE engine_name = "1.2 mpi"
sql_create_context
CREATE TABLE table_75418 ( "Rank" text, "City" text, "Population" real, "Area (km 2 )" real, "Density (inhabitants/km 2 )" real, "Altitude (mslm)" real )
Which Population is the highest one that has a Density (inhabitants/km 2) larger than 2805.8, and a Rank of 1st, and an Altitude (mslm) smaller than 122?
SELECT MAX("Population") FROM table_75418 WHERE "Density (inhabitants/km 2 )" > '2805.8' AND "Rank" = '1st' AND "Altitude (mslm)" < '122'
wikisql
CREATE TABLE table_name_91 ( launched VARCHAR, time_elapsed VARCHAR )
What launched has 158 days (5 months, 8 days) as the time elapsed?
SELECT launched FROM table_name_91 WHERE time_elapsed = "158 days (5 months, 8 days)"
sql_create_context
CREATE TABLE table_23458 ( "Number" real, "Registration" text, "First flew" text, "Last flew" text, "Flying hours" real, "Location" text )
how many number is located at registration f-bvff?
SELECT COUNT("Number") FROM table_23458 WHERE "Registration" = 'F-BVFF'
wikisql
CREATE TABLE table_23844 ( "Seed" real, "Player" text, "Marseille (32 draw)" text, "Metz (32)" text, "Lyon (32)" text, "Paris (48 - byes)" text )
What is the seed for lyon (32) was DNQ?
SELECT MAX("Seed") FROM table_23844 WHERE "Lyon (32)" = 'DNQ'
wikisql
CREATE TABLE table_name_58 ( total VARCHAR, set_2 VARCHAR )
What is the Total of Set 2 of 21:12?
SELECT total FROM table_name_58 WHERE set_2 = "21:12"
sql_create_context
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 ...
患有慢性根尖周炎的那些人确诊时同型半胱氨酸的参考值范畴下限和上限是多少?
SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '慢性根尖周炎' AND jyjgzbb.JCZBMC = '同型半胱氨酸' UNION SELECT jyjgzbb.CKZFW...
css
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, star...
What is the difficulty ranking for all CS-LSA classes ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE program_course.course_id = course.course_id AND program.name LIKE 'CS-LSA' AND program.program_id = program_course.program_id
advising
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid numb...
in the previous year, what were the top four most commonly prescribed medications to patients during the same month after the prescription of cefazolin 2 gm in ns 100 ml ivpb?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'cefazolin 2 gm in ns 100 ml ivpb' AND DATETIME(medi...
eicu
CREATE TABLE table_21481509_4 ( r1b1a2__r_m269_ VARCHAR, r1b1c__r_v88_ VARCHAR )
What percentage is listed in column r1b1a2 (r-m269) for the 77.8% r1b1c (r-v88)?
SELECT r1b1a2__r_m269_ FROM table_21481509_4 WHERE r1b1c__r_v88_ = "77.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, ...
what is the number of patients whose insurance is self pay and lab test name is granular casts?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Granular Casts"
mimicsql_data
CREATE TABLE table_name_11 ( nationality VARCHAR, player VARCHAR )
What is Nationality of daniel goneau?
SELECT nationality FROM table_name_11 WHERE player = "daniel goneau"
sql_create_context
CREATE TABLE table_name_39 ( time VARCHAR, opponent VARCHAR )
Which Time has an Opponent of shamil abdurahimov?
SELECT time FROM table_name_39 WHERE opponent = "shamil abdurahimov"
sql_create_context
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age te...
tell me, what were the top three most commonly prescribed drugs in 2102?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE STRFTIME('%y', medication.drugstarttime) = '2102' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 3
eicu
CREATE TABLE table_2925 ( "Year" real, "Population" real, "Serbs" text, "Germans" text, "Romanians" text, "Hungarians" text, "Croats" text, "Roma" text, "Slovaks" text, "Rest" text )
What is every value for Serbs if value for Hungarians is 9.26%?
SELECT "Serbs" FROM table_2925 WHERE "Hungarians" = '9.26%'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, ...
Average answer score of top 10.
SELECT u.DisplayName, AVG(CAST(p.Score AS FLOAT(4))) AS AvgScore FROM Posts AS p JOIN Users AS u ON u.Id = p.OwnerUserId WHERE PostTypeId = 2 AND OwnerUserId IN (SELECT Id FROM Users ORDER BY Reputation DESC LIMIT 10) GROUP BY u.DisplayName ORDER BY AvgScore DESC
sede
CREATE TABLE table_name_54 ( Id VARCHAR )
what is 2000 when 2012 is w and 2011 is 4r?
SELECT 2000 FROM table_name_54 WHERE 2012 = "w" AND 2011 = "4r"
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...
Closed Questions by Join Date.
SELECT Opened.cYear, Opened.cMonth, openedQuestions, closedQuestions, (1.0 * closedQuestions / openedQuestions) FROM (SELECT YEAR(Users.CreationDate) AS cYear, MONTH(Users.CreationDate) AS cMonth, COUNT(*) AS closedQuestions FROM Posts JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Posts.PostTypeId = 1 AND NOT Closed...
sede
CREATE TABLE table_47083 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Record" text )
Can you tell me the Score that has the Date of 11/17/1979?
SELECT "Score" FROM table_47083 WHERE "Date" = '11/17/1979'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescription...
provide the number of patients whose days of hospital stay is greater than 10 and procedure long title is coronary arteriography using two catheters?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "10" AND procedures.long_title = "Coronary arteriography using two catheters"
mimicsql_data
CREATE TABLE submission ( Submission_ID int, Scores real, Author text, College text ) CREATE TABLE Acceptance ( Submission_ID int, Workshop_ID int, Result text ) CREATE TABLE workshop ( Workshop_ID int, Date text, Venue text, Name text )
Show the number of venue from each venue, sort how many venue in desc order.
SELECT Venue, COUNT(Venue) FROM workshop GROUP BY Venue ORDER BY COUNT(Venue) DESC
nvbench
CREATE TABLE table_52360 ( "Year" real, "Result" text, "Award" text, "Film or series" text, "Character" text )
What year did was the Inside Soap Awards won?
SELECT AVG("Year") FROM table_52360 WHERE "Result" = 'won' AND "Award" = 'inside soap awards'
wikisql
CREATE TABLE table_13871 ( "Date" text, "Season" text, "Playing for" text, "Opponent" text, "Final score" text )
who is playing for when the opponent is deportes savio and the date is 2010-03-11?
SELECT "Playing for" FROM table_13871 WHERE "Opponent" = 'deportes savio' AND "Date" = '2010-03-11'
wikisql
CREATE TABLE table_67015 ( "Round" real, "Pick" real, "Name" text, "Position" text, "College" text )
Which college had rounds smaller than 2?
SELECT "College" FROM table_67015 WHERE "Round" < '2'
wikisql
CREATE TABLE table_22305 ( "English" text, "German" text, "Dutch" text, "Latin" text, "Romanian" text, "Portuguese" text, "Spanish" text, "Italian" text, "French" text, "Greek (Modern)" text, "Bulgarian" text, "Macedonian" text, "Polish (extinct)" text )
Name the macedonian for il/elle avait entendu
SELECT "Macedonian" FROM table_22305 WHERE "French" = 'il/elle avait entendu'
wikisql
CREATE TABLE table_38247 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real )
Which Games have a Drawn smaller than 1, and a Lost smaller than 1?
SELECT "Games" FROM table_38247 WHERE "Drawn" < '1' AND "Lost" < '1'
wikisql
CREATE TABLE table_name_53 ( jockey VARCHAR, post VARCHAR )
What is Jockey, when Post is 12?
SELECT jockey FROM table_name_53 WHERE post = 12
sql_create_context
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...
provide the number of patients whose days of hospital stay is greater than 43 and drug name is artificial tears preserv. free?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "43" AND prescriptions.drug = "Artificial Tears Preserv. Free"
mimicsql_data
CREATE TABLE table_72532 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
Name the least touchdowns for 11 points
SELECT MIN("Touchdowns") FROM table_72532 WHERE "Points" = '11'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, BGJGDM text, BGJGMC text, BGRGH text, BGRQ time, BGRXM text, BGSJ time, CJRQ time, JSBBRQSJ time, JSBBSJ time, JYBBH text, JYJGMC text, JYJSGH text, JYJSQM text, ...
姓名是赵静逸的病人促肾上腺皮质激素情况在01年7月27日至07年7月19日之中这段时间内情况怎么样?
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb JOIN 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 = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzb...
css
CREATE TABLE table_77213 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Who is the player with a +3 to par and a 74-71-68=213 score?
SELECT "Player" FROM table_77213 WHERE "To par" = '+3' AND "Score" = '74-71-68=213'
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...
to how many patients was drug code repa0.5 administered?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "REPA0.5"
mimicsql_data
CREATE TABLE table_72408 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What is the result for w. arthur winstead?
SELECT "Result" FROM table_72408 WHERE "Incumbent" = 'W. Arthur Winstead'
wikisql
CREATE TABLE table_2626495_1 ( title VARCHAR, written_by VARCHAR )
what is the title of the episode daphne field wrote?
SELECT title FROM table_2626495_1 WHERE written_by = "Daphne Field"
sql_create_context
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 ...
患者柳丽容为牙列缺损,门诊诊断的糖类抗原125的结果定量是什么?单位是什么?
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 PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
Questions with more than n answers.
SELECT q.Id, q.Title, q.Body, q.AnswerCount, a.Id, a.Body, q.CreationDate, a.CreationDate, q.ClosedDate, a.ClosedDate, q.ViewCount, q.OwnerUserId, a.OwnerUserId, q.FavoriteCount FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND q.AnswerCount >= 10
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 divorced had a lab test named lactate dehydrogenase, csf?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Lactate Dehydrogenase, CSF"
mimicsql_data
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 gender is m and admission location is transfer from hosp/extram?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM"
mimicsql_data
CREATE TABLE table_name_65 ( authors VARCHAR, name VARCHAR )
Who is the author for the malasaurus?
SELECT authors FROM table_name_65 WHERE name = "malasaurus"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
what was the name of the drug that was prescribed last to patient 021-111547 since 20 months ago via deepsubcut route?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547')) AND medication.routeadmin = 'deepsubcut' AND DATETIME...
eicu
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 year of birth is less than 1846 and drug type is main?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "1846" AND prescriptions.drug_type = "MAIN"
mimicsql_data
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
when was patient 88659 first tested for microbiology in 09/last year?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88659) AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', microbiolo...
mimic_iii
CREATE TABLE table_73092 ( "Date Released" text, "Institute" text, "Socialist" text, "Social Democratic" text, "United People Alliance" text, "Democratic and Social Centre" text, "Democratic Renewal" text, "Lead" text )
which institutes gave the democratic renewal 18.0% 22.0% on a poll from October 6, 1985?
SELECT "Institute" FROM table_73092 WHERE "Democratic Renewal" = '18.0% – 22.0%'
wikisql
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE T...
For all employees who have the letters D or S in their first name, find job_id and the sum of salary , and group by attribute job_id, and visualize them by a bar chart, and display by the JOB_ID in desc.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
how many patients have been discharged since 1 year ago?
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-1 year')
eicu
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...
Find All_Games and School_ID , and visualize them by a bar chart, and show in ascending by the bar.
SELECT All_Games, School_ID FROM basketball_match ORDER BY All_Games
nvbench
CREATE TABLE table_71468 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the decision when Chicago was the visiting team?
SELECT "Decision" FROM table_71468 WHERE "Visitor" = 'chicago'
wikisql
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number...
has patient 028-42654 been given a laboratory test until 54 months ago?
SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-42654')) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-54 month')
eicu
CREATE TABLE table_36375 ( "Maryland Counties" text, "Fall 05" real, "Fall 06" real, "Fall 07" real, "Fall 08" real, "Fall 09" real )
Name the average fall 07 for fall 07 more than 219
SELECT AVG("Fall 07") FROM table_36375 WHERE "Fall 06" > '219'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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...
在2004年9月6日到2020年10月17日期间,7510294医疗机构的有多少新生儿门诊的就诊记录
SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '7510294' AND JZKSRQ BETWEEN '2004-09-06' AND '2020-10-17' AND ZSEBZ > 0
css
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of first_name and department_id .
SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid ...
has cordarone, lactated ringers, or lantus been prescribed last year for patient 035-19333?
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 = '035-19333')) AND medication.drugname IN ('cordarone', 'lactated ringers', ...
eicu
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 are divorced and followed the procedure small-to-small intestinal anastomosis?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.long_title = "Small-to-small intestinal anastomosis"
mimicsql_data
CREATE TABLE table_2840500_6 ( college_junior_club_team VARCHAR, nationality VARCHAR )
How many college teams have a player with a nationality of Russia?
SELECT COUNT(college_junior_club_team) FROM table_2840500_6 WHERE nationality = "Russia"
sql_create_context
CREATE TABLE table_51561 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue #" text )
Which country had a cad 4011 catalogue #?
SELECT "Country" FROM table_51561 WHERE "Catalogue #" = 'cad 4011'
wikisql
CREATE TABLE table_44450 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Who was the partner on the game which took place on a clay surface with opponents of marco chiudinelli michael lammer and a runner-up result?
SELECT "Partner" FROM table_44450 WHERE "Outcome" = 'runner-up' AND "Surface" = 'clay' AND "Opponents" = 'marco chiudinelli michael lammer'
wikisql
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 departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
Bar chart x axis first name y axis salary, I want to rank names in descending order.
SELECT FIRST_NAME, SALARY FROM employees ORDER BY FIRST_NAME DESC
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE cost ( costid number, ...
count the number of drugs that patient 022-158213 was prescribed during their first hospital visit.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-158213' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hos...
eicu
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Of the courses I have to choose from , which ones are worth 15 credits ?
SELECT DISTINCT name, number FROM course WHERE credits = 15 AND department = 'EECS'
advising
CREATE TABLE hz_info ( KH text, KLX number, YLJGDM text, RYBH text ) 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...
名叫葛歌韵的患者在2019年12月22日到2020年12月16日期间开出的全部检验报告单的检验报告单号都是什么?
(SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '葛歌韵' AND jyb...
css
CREATE TABLE table_name_93 ( points_1 VARCHAR, position VARCHAR, goal_difference VARCHAR )
What are the points 1 for the team with position less than 13 and goal difference of +16?
SELECT points_1 FROM table_name_93 WHERE position < 13 AND goal_difference = "+16"
sql_create_context
CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby i...
Datasets with semantic parsing information
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
scholar
CREATE TABLE table_203_730 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number, "bye" text )
who did the broncos play against during the last game of the season ?
SELECT "opponent" FROM table_203_730 ORDER BY "week" DESC LIMIT 1
squall
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numc...
list datasets for video segmentation
SELECT DISTINCT dataset.datasetid FROM dataset, keyphrase, paperdataset, paperkeyphrase WHERE keyphrase.keyphrasename = 'video segmentation' AND paperdataset.datasetid = dataset.datasetid AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paperkeyphrase.paperid = paperdataset.paperid
scholar
CREATE TABLE zyb ( CLINIC_ID 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, INSU_TYPE text, IN...
6951170的医疗机构使用次数最多的项目是哪个
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6951170' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID...
css
CREATE TABLE table_52535 ( "Competition" text, "Played" real, "Drawn" real, "Lost" real, "Position" text, "Coach" text, "Captain" text, "Main Article" text )
What Position has a Super League 1 Competition?
SELECT "Position" FROM table_52535 WHERE "Competition" = 'super league 1'
wikisql
CREATE TABLE table_2618061_1 ( written_by VARCHAR, directed_by VARCHAR )
How many episodes were directed by james quinn?
SELECT COUNT(written_by) FROM table_2618061_1 WHERE directed_by = "James Quinn"
sql_create_context
CREATE TABLE table_2219961_2 ( season__number INTEGER, director VARCHAR )
What is the latest season number that Eric Tuchman directed?
SELECT MAX(season__number) FROM table_2219961_2 WHERE director = "Eric Tuchman"
sql_create_context
CREATE TABLE table_57028 ( "Country" text, "Release Date" real, "Music Label" text, "Media" text, "Catalogue Number" text )
What is the music label with the catalogue number enocd 10?
SELECT "Music Label" FROM table_57028 WHERE "Catalogue Number" = 'enocd 10'
wikisql
CREATE TABLE table_name_56 ( grid INTEGER, constructor VARCHAR, laps VARCHAR )
What is the high grid for osella - alfa romeo, and a Laps larger than 61?
SELECT MAX(grid) FROM table_name_56 WHERE constructor = "osella - alfa romeo" AND laps > 61
sql_create_context
CREATE TABLE table_31478 ( "Round" real, "Circuit" text, "Date" text, "Length" text, "Pole Position" text, "GT3 Winner" text, "GT4 Winner" text )
When charles bateman michael lyons is the gt3 winner and 9 is the round who is the gt4 winner?
SELECT "GT4 Winner" FROM table_31478 WHERE "Round" = '9' AND "GT3 Winner" = 'Charles Bateman Michael Lyons'
wikisql
CREATE TABLE table_name_61 ( player VARCHAR, place VARCHAR, country VARCHAR, score VARCHAR )
Who is the player with a t10 place, from the United States, and has a score of 69-70-76=215?
SELECT player FROM table_name_61 WHERE place = "t10" AND country = "united states" AND score = 69 - 70 - 76 = 215
sql_create_context
CREATE TABLE table_20866024_2 ( model_type VARCHAR, model_designation VARCHAR )
What model type has model designation 97500?
SELECT model_type FROM table_20866024_2 WHERE model_designation = "97500"
sql_create_context
CREATE TABLE table_name_68 ( call_sign VARCHAR, erp_w VARCHAR )
What was the call sign for ERP W of 99?
SELECT call_sign FROM table_name_68 WHERE erp_w = 99
sql_create_context
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give me the number of patients whose primary disease is coronary artery disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE"
mimicsql_data
CREATE TABLE table_39965 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
Who was the home team that the Clippers played?
SELECT "Home" FROM table_39965 WHERE "Visitor" = 'clippers'
wikisql
CREATE TABLE table_11803648_20 ( round VARCHAR, player VARCHAR )
How many rounds is the player Matthew Puempel associated with?
SELECT COUNT(round) FROM table_11803648_20 WHERE player = "Matthew Puempel"
sql_create_context