context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_3927 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had highest points during game against the Utah Jazz?
SELECT "High points" FROM table_3927 WHERE "Team" = 'Utah Jazz'
wikisql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what was the name of the medicine that was prescribed to patient 65484 until 08/2103 for the last time?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65484) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2103-08' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_73 ( tournament VARCHAR, year INTEGER )
Which tournament was held after 1966?
SELECT tournament FROM table_name_73 WHERE year > 1966
sql_create_context
CREATE TABLE table_204_508 ( id number, "no." number, "race title" text, "track" text, "date" text, "tv" text )
what are the total number of races that took place in fort worth ?
SELECT COUNT("race title") FROM table_204_508 WHERE "track" = 'fort worth'
squall
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges...
Add bounty remarks to a question's revision history. http://meta.stackexchange.com/questions/110003/add-bounty-remarks-to-a-questions-revision-history
SELECT pn.Body AS "custom_comment", pt.Name AS "notice_type", pt.Body AS "reason", pn.CreationDate, pn.DeletionDate, OwnerUserId AS "user_link" FROM PostNotices AS pn INNER JOIN PostNoticeTypes AS pt ON pt.Id = pn.PostNoticeTypeId WHERE PostId = '##questionid?83292##'
sede
CREATE TABLE table_7674 ( "Outcome" text, "Date" text, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
Which final opponent's surface was hard (i) and participated on October 9, 2005?
SELECT "Opponent in the final" FROM table_7674 WHERE "Surface" = 'hard (i)' AND "Date" = 'october 9, 2005'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
Last 100, as offtopic closed questions.
SELECT Posts.Id AS "post_link", Posts.* FROM PostHistory LEFT JOIN Posts ON PostHistory.PostId = Posts.Id WHERE PostHistoryTypeId = 10 AND Comment = 102 ORDER BY PostHistory.CreationDate DESC LIMIT 100
sede
CREATE TABLE table_1140085_2 ( pole_position VARCHAR, rnd VARCHAR )
who is the pole position for the rnd 3
SELECT pole_position FROM table_1140085_2 WHERE rnd = 3
sql_create_context
CREATE TABLE table_24570 ( "Season" real, "Network" text, "Timeslot" text, "Season premiere" text, "Season finale" text, "TV season" text, "Rank Rank denotes the relative position of the television series with respect to other prime time shows on the CW, FOX, NBC, CBS, and ABC." text, "V...
What season had 2.52 million viewers?
SELECT "TV season" FROM table_24570 WHERE "Viewers in millions" = '2.52'
wikisql
CREATE TABLE table_name_46 ( years VARCHAR, representative VARCHAR )
Which years did James Robert Jones serve?
SELECT years FROM table_name_46 WHERE representative = "james robert jones"
sql_create_context
CREATE TABLE table_name_54 ( dance_styles VARCHAR, draw VARCHAR, points VARCHAR )
Which dance style had a draw smaller than 15 and 18 points?
SELECT dance_styles FROM table_name_54 WHERE draw < 15 AND points = 18
sql_create_context
CREATE TABLE table_28234 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
What is the title of the episode with the production code 3x5362?
SELECT "Title" FROM table_28234 WHERE "Production code" = '3X5362'
wikisql
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...
Visualize a bar chart about the distribution of All_Games and All_Games_Percent , could you list names in descending order?
SELECT All_Games, All_Games_Percent FROM basketball_match ORDER BY All_Games DESC
nvbench
CREATE TABLE table_8990 ( "Side" text, "Group" text, "Inscription" text, "Official history" text, "Identification" text )
Which side has Ludovico Carracci listed as the identification?
SELECT "Side" FROM table_8990 WHERE "Identification" = 'ludovico carracci'
wikisql
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, ...
在医院6497114中编码为44656469的患者门诊诊断名称中有哪些不包含瘙痒症的门诊就诊记录?
SELECT * FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '44656469' AND hz_info.YLJGDM = '6497114' AND NOT mzjzjlb.JZZDSM LIKE '%瘙痒症%'
css
CREATE TABLE table_66643 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Attendance" text )
What is the tie no that has southport as the away team?
SELECT "Tie no" FROM table_66643 WHERE "Away team" = 'southport'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE 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 year of death is less than or equal to 2158 and drug name is oxycodone-acetaminophen elixir?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2158.0" AND prescriptions.drug = "OxycoDONE-Acetaminophen Elixir"
mimicsql_data
CREATE TABLE table_68869 ( "Rank" text, "Score" text, "Player" text, "Club" text, "Opponent" text, "Year" text, "Round" text, "Venue" text )
What club had a score of 18.1?
SELECT "Club" FROM table_68869 WHERE "Score" = '18.1'
wikisql
CREATE TABLE table_name_90 ( year_s__withdrawn VARCHAR, year_made VARCHAR )
What year was the locomotive withdrawn that was made in 1876?
SELECT year_s__withdrawn FROM table_name_90 WHERE year_made = "1876"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, va...
in their last hospital visit what was the marital status of patient 26175?
SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 26175 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
mimic_iii
CREATE TABLE table_name_39 ( entrant VARCHAR, year VARCHAR )
Name the entrant for year of 1952
SELECT entrant FROM table_name_39 WHERE year = 1952
sql_create_context
CREATE TABLE table_204_613 ( id number, "title" text, "year" number, "peak chart positions\nus" number, "peak chart positions\nus\nr&b" number, "peak chart positions\nus\nrap" number, "album" text )
which song had a peak chart position of 45 and 24 ?
SELECT "title" FROM table_204_613 WHERE "peak chart positions\nus\nr&b" = 45
squall
CREATE TABLE table_15405904_1 ( won INTEGER, team VARCHAR )
When the team is ypiranga-sp what is the number of won games?
SELECT MIN(won) FROM table_15405904_1 WHERE team = "Ypiranga-SP"
sql_create_context
CREATE TABLE club ( name VARCHAR, Club_ID VARCHAR ) CREATE TABLE player ( Club_ID VARCHAR, Position VARCHAR )
Show the names of clubs that have players with position 'Right Wing'.
SELECT T1.name FROM club AS T1 JOIN player AS T2 ON T1.Club_ID = T2.Club_ID WHERE T2.Position = "Right Wing"
sql_create_context
CREATE TABLE procedures ( 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, ...
count the number of patients whose diagnoses short title is pressure ulcer, buttock and drug route is id?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Pressure ulcer, buttock" AND prescriptions.route = "ID"
mimicsql_data
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Bookings ( apt_bookin...
Return the booking start date for the apartments that have type code 'Duplex' and bin the year into weekday interval with a bar chart, and display by the y-axis in ascending.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT(booking_start_date)
nvbench
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 number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
病患76177334在08年7月12日到09年7月19日内的全部检测结果指标记录的检查员为39427347的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
CREATE TABLE table_name_54 ( show_name VARCHAR, time VARCHAR )
What show has a time of 4:00pm 5:00am?
SELECT show_name FROM table_name_54 WHERE time = "4:00pm–5:00am"
sql_create_context
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALA...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id by a bar chart, could you order x axis in desc order?
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC
nvbench
CREATE TABLE table_27319183_7 ( total_itv_viewers__millions_ VARCHAR, official_itv_rating__millions_ VARCHAR )
How many total itv viewers were there for the episode with official itv ratings of 10.24 million?
SELECT total_itv_viewers__millions_ FROM table_27319183_7 WHERE official_itv_rating__millions_ = "10.24"
sql_create_context
CREATE TABLE table_name_45 ( year VARCHAR, mixed_doubles VARCHAR )
What year was there no competition in Mixed Doubles?
SELECT year FROM table_name_45 WHERE mixed_doubles = "no competition"
sql_create_context
CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club_rank ( Rank real, Club_ID int, Gold real, Silver real, Bronze real, Tota...
What is the number of players who have points less than 30 for each position Plot them as bar chart, order the total number from high to low order.
SELECT Position, COUNT(*) FROM player WHERE Points < 30 GROUP BY Position ORDER BY COUNT(*) DESC
nvbench
CREATE TABLE table_74391 ( "Player" text, "Nationality" text, "Position" text, "Dynamo career" text, "Appearances" real, "Goals" real )
What was the position of the player with 57 goals?
SELECT "Position" FROM table_74391 WHERE "Goals" = '57'
wikisql
CREATE TABLE table_name_90 ( record VARCHAR, visitor VARCHAR )
What was the record when the visitor was Atlanta Hawks?
SELECT record FROM table_name_90 WHERE visitor = "atlanta hawks"
sql_create_context
CREATE TABLE savings ( custid number, balance number ) CREATE TABLE checking ( custid number, balance number ) CREATE TABLE accounts ( custid number, name text )
Find the total saving balance for each account name.
SELECT SUM(T2.balance), T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid GROUP BY T1.name
spider
CREATE TABLE table_2350 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Boilermakers points" real, "Opponents" real, "Record" text )
What was the result of the game with the record of 3-1?
SELECT "Result" FROM table_2350 WHERE "Record" = '3-1'
wikisql
CREATE TABLE mzb ( 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...
从零一年五月十六号到一九年七月二十三医疗机构3199188未就业人员的就诊花的总医疗费559.51元以上的就诊记录数量
SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3199188' AND qtb.IN_HOSP_DATE BETWEEN '2001-05-16' AND '2019-07-23' AND qtb.INSURED_STS = '未就业' AND qtb.MED_AMOUT >= 559.51 UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3199188' AND gyb.IN_HOSP_DATE BETWEEN '2001-05-16' AND '2019-07-23' AND gyb.INSURED_...
css
CREATE TABLE table_61704 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
In what place did Darren Clarke finish?
SELECT "Place" FROM table_61704 WHERE "Player" = 'darren clarke'
wikisql
CREATE TABLE table_20660 ( "Title" text, "Series" text, "Release" text, "Featuring" text, "Writer" text, "Director" text, "Length" text, "Timeline" text, "Release Date" text )
Under what series was the 3.5 release?
SELECT "Series" FROM table_20660 WHERE "Release" = '3.5'
wikisql
CREATE TABLE table_21701 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
What's the meaning of the verb whose part 1 is slapen?
SELECT "Verb meaning" FROM table_21701 WHERE "Part 1" = 'slapen'
wikisql
CREATE TABLE table_11412 ( "Name" text, "Builder" text, "Type" text, "Date" real, "Works number" real )
What is the total works number of the locomotive with 0-6-4t type after 1875?
SELECT SUM("Works number") FROM table_11412 WHERE "Type" = '0-6-4t' AND "Date" > '1875'
wikisql
CREATE TABLE table_1140113_5 ( constructor VARCHAR, race_name VARCHAR )
How many constructors won the III Redex Trophy?
SELECT COUNT(constructor) FROM table_1140113_5 WHERE race_name = "III RedeX Trophy"
sql_create_context
CREATE TABLE table_74142 ( "Date" text, "Player" text, "Injury" text, "Date of injury" text, "Number of matches (Total)" text, "Source" text )
What is the date of injury when the injury is sustained posterior thigh strains in his left leg?
SELECT "Date of injury" FROM table_74142 WHERE "Injury" = 'Sustained posterior thigh strains in his left leg'
wikisql
CREATE TABLE table_204_750 ( id number, "team" text, "stadium" text, "capacity" number, "seated" number )
besides merthyr town , which other team had the highest number of capacity ?
SELECT "team" FROM table_204_750 WHERE "team" <> 'merthyr town' ORDER BY "capacity" DESC LIMIT 1
squall
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Questions in a given tag sorted by number of views per day.
SELECT q.Id AS "post_link", q.ViewCount, ROUND(CAST(q.ViewCount AS FLOAT) / DATEDIFF(dd, q.CreationDate, @today), 1) AS ViewsPerDay FROM Posts AS q ORDER BY LEN(q.Body) DESC
sede
CREATE TABLE table_name_59 ( population VARCHAR, official_name VARCHAR, area_km_2 VARCHAR )
For Saint-Paul parish, if it has an area of over 228.65 kilometers how many people live there?
SELECT COUNT(population) FROM table_name_59 WHERE official_name = "saint-paul" AND area_km_2 > 228.65
sql_create_context
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABL...
Lists all users which answered the same questions as I did and compare the scores. Lists all users which answered the same questions as I did and compare the scores
SELECT oa.OwnerUserId AS "user_link", COUNT(*) AS "total_answers", SUM(CASE WHEN AcceptedAnswerId = ma.Id THEN 1 ELSE 0 END) AS "ma_accepted", SUM(CASE WHEN AcceptedAnswerId = oa.Id THEN 1 ELSE 0 END) AS "oa_accepted", NULLIF(SUM(CASE WHEN AcceptedAnswerId = ma.Id THEN 1 ELSE 0 END), 0) / NULLIF(SUM(CASE WHEN AcceptedA...
sede
CREATE TABLE table_2175858_1 ( driver VARCHAR, laps VARCHAR, average_speed__mph_ VARCHAR )
How many drivers drove 300 laps at average speed of 103.594?
SELECT COUNT(driver) FROM table_2175858_1 WHERE laps = "300" AND average_speed__mph_ = "103.594"
sql_create_context
CREATE TABLE table_25778 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What is every record for the team Boston?
SELECT "Record" FROM table_25778 WHERE "Team" = 'Boston'
wikisql
CREATE TABLE table_name_60 ( to_par VARCHAR, place VARCHAR )
What was the To par when the place was 4?
SELECT to_par FROM table_name_60 WHERE place = "4"
sql_create_context
CREATE TABLE table_name_78 ( outcome VARCHAR, surface VARCHAR, date VARCHAR )
Which Outcome has a Surface of hard (i), and a Date of 28 january 2003?
SELECT outcome FROM table_name_78 WHERE surface = "hard (i)" AND date = "28 january 2003"
sql_create_context
CREATE TABLE Scientists ( SSN int, Name Char(30) ) CREATE TABLE Projects ( Code Char(4), Name Char(50), Hours int ) CREATE TABLE AssignedTo ( Scientist int, Project char(4) )
What is the name of the project that has a scientist assigned to it whose name contains 'Smith', and count them by a bar chart, and could you show bar in descending order?
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY T2.Name DESC
nvbench
CREATE TABLE table_22160 ( "Title" text, "Developer" text, "Category" text, "Function" text, "Release date" text, "Version" text )
What is the category when the version is 1.0 and the title is Chord finder?
SELECT "Category" FROM table_22160 WHERE "Version" = '1.0' AND "Title" = 'Chord Finder'
wikisql
CREATE TABLE table_22372 ( "Episode" text, "Broadcast date" text, "Run time" text, "Viewers (in millions)" text, "Archive" text )
What is the broadcast date of the 16mm t/r episode?
SELECT "Broadcast date" FROM table_22372 WHERE "Archive" = '16mm t/r'
wikisql
CREATE TABLE table_10015132_11 ( player VARCHAR, position VARCHAR, years_in_toronto VARCHAR )
What player played guard for toronto in 1996-97?
SELECT player FROM table_10015132_11 WHERE position = "Guard" AND years_in_toronto = "1996-97"
sql_create_context
CREATE TABLE table_name_9 ( network VARCHAR, language VARCHAR, service VARCHAR, origin_of_programming VARCHAR, genre VARCHAR )
Which network has an origina of Programming in India, a general genre, a service of bell fibe tv, and tamil as its language?
SELECT network FROM table_name_9 WHERE origin_of_programming = "india" AND genre = "general" AND service = "bell fibe tv" AND language = "tamil"
sql_create_context
CREATE TABLE table_4150 ( "Episode #" real, "Series #" real, "Episode Title" text, "Original air date" text, "Production Code" real )
When 'the secret of deep stadium' is the episode title what is the lowest series number?
SELECT MIN("Series #") FROM table_4150 WHERE "Episode Title" = 'The Secret of Deep Stadium'
wikisql
CREATE TABLE table_29629 ( "#" real, "No." real, "Title" text, "Directed by" text, "Written by" text, "Viewers" real, "Original airdate" text, "Prod. code" real )
Who directed the episode with 899000 viewers?
SELECT "Directed by" FROM table_29629 WHERE "Viewers" = '899000'
wikisql
CREATE TABLE table_name_2 ( position VARCHAR, pick INTEGER )
What position has a pick less than 20?
SELECT position FROM table_name_2 WHERE pick < 20
sql_create_context
CREATE TABLE table_15187735_12 ( netflix VARCHAR, segment_d VARCHAR )
What is the Netflix where Segment D is pressure gauges ?
SELECT netflix FROM table_15187735_12 WHERE segment_d = "Pressure Gauges"
sql_create_context
CREATE TABLE table_18875 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Which team played on April 1?
SELECT "Team" FROM table_18875 WHERE "Date" = 'April 1'
wikisql
CREATE TABLE table_204_706 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
how many competitions did he place in the top three ?
SELECT COUNT("competition") FROM table_204_706 WHERE "position" <= 3
squall
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chart...
how much is patient 32026's heart rate differing second measured on the first icu visit compared to the value first measured on the first icu visit?
SELECT (SELECT chartevents.valuenum 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 = 32026) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item...
mimic_iii
CREATE TABLE jybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH text, 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, JY...
从09年8月30日到12年10月24日这段时间内70984037号患者的所有检验报告单都在什么时间审核的?
SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '70984037' AND jybgb.BGRQ BETWEEN '2009-08-30' AND '2012-10-24' UNION...
css
CREATE TABLE table_name_23 ( cultural_and_educational_panel INTEGER, labour_panel VARCHAR, agricultural_panel VARCHAR )
What is the sum of all from the Cultural and Educational Panel with less than 7 from the Labour Panel and less than 1 from the Agricultural Panel?
SELECT SUM(cultural_and_educational_panel) FROM table_name_23 WHERE labour_panel < 7 AND agricultural_panel < 1
sql_create_context
CREATE TABLE table_73669 ( "Circuit" text, "Difficulty" text, "Turns" real, "Direction" text, "Setting" text, "Conditions" text, "Unlock Order" real, "Unlocks" text, "Unlocked by" text )
What are the conditions for the athens circuit?
SELECT "Conditions" FROM table_73669 WHERE "Circuit" = 'Athens'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text...
名叫孔宏峻的患者需要查询一下在医疗就诊29424118209时的检验报告单?
SELECT * FROM zyjybgb WHERE zyjybgb.JZLSH = '29424118209' UNION SELECT * FROM mzjybgb WHERE mzjybgb.JZLSH = '29424118209'
css
CREATE TABLE table_20007413_6 ( torque VARCHAR, applications VARCHAR )
What are the torque characteristics of the model with 346 applications?
SELECT torque FROM table_20007413_6 WHERE applications = 346
sql_create_context
CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, basePrice INTEGER, decor TEXT ) CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adul...
What is the minimum price of the rooms for each different decor? Show me a bar chart!, I want to sort in descending by the bars.
SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor ORDER BY decor DESC
nvbench
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE STUDENT ( STU_NUM int, STU_LNAME varchar(15), STU_FNAME varchar(15), STU_INIT varchar(1), STU_DOB datetime, STU_HRS int, STU_CLASS varchar(2), STU_GPA float(8), STU_TRANSFER...
Give me a histogram for what is the number of professors for different school?, sort x axis in desc order.
SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY SCHOOL_CODE DESC
nvbench
CREATE TABLE table_12173 ( "Position" real, "Club" text, "Games played" text, "Wins" real, "Draws" real, "Loses" real, "Goals scored" real, "Goals conceded" real, "Points" real )
How many goals scored have utenis utena as the club, with wins less than 8?
SELECT SUM("Goals scored") FROM table_12173 WHERE "Club" = 'utenis utena' AND "Wins" < '8'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
For those employees who did not have any job in the past, show me about the distribution of hire_date and the average of department_id bin hire_date by time in a bar chart, and could you display the average of department id in ascending order?
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(DEPARTMENT_ID)
nvbench
CREATE TABLE course ( course_id text, title text, dept_name text, credits number ) CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE department ( dept_name text, building text, budget number ) CREATE TABLE advisor ( s_id text, i_i...
Which semeseter and year had the fewest students?
SELECT semester, year FROM takes GROUP BY semester, year ORDER BY COUNT(*) LIMIT 1
spider
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program ( program_id int, name varchar, college varchar...
I would like to know the names of courses that are worth 16 credits .
SELECT DISTINCT name, number FROM course WHERE credits = 16 AND department = 'EECS'
advising
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
Are there any 8 -credit courses ?
SELECT DISTINCT name, number FROM course WHERE credits = 8 AND department = 'EECS'
advising
CREATE TABLE table_name_81 ( tries INTEGER, played INTEGER )
What is the number of tries for the player who is larger than 16?
SELECT SUM(tries) FROM table_name_81 WHERE played > 16
sql_create_context
CREATE TABLE table_31967 ( "Calls" text, "Frequency" text, "Branding" text, "Format" text, "Timeslot" text, "Group owner" text )
Tell me the timeslot for calls of whyn
SELECT "Timeslot" FROM table_31967 WHERE "Calls" = 'whyn'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
give the number of patients with private insurance admitted before the year 2172.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.admityear < "2172"
mimicsql_data
CREATE TABLE table_name_8 ( nickname VARCHAR, established VARCHAR )
What is the nickname of the school established in 2009?
SELECT nickname FROM table_name_8 WHERE established = 2009
sql_create_context
CREATE TABLE ftxmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZD...
哪个人门诊就诊中开出的检验报告单21844290233
SELECT person_info.XM FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE jybgb.BGDH = '2...
css
CREATE TABLE table_204_93 ( id number, "round" number, "pick" number, "player" text, "position" text, "nationality" text, "team" text, "college" text )
what team comes before hank stein ?
SELECT "team" FROM table_204_93 WHERE id = (SELECT id FROM table_204_93 WHERE "player" = 'hank stein') - 1
squall
CREATE TABLE table_1341453_20 ( district VARCHAR, incumbent VARCHAR )
What district does John Cooksey represent?
SELECT district FROM table_1341453_20 WHERE incumbent = "John Cooksey"
sql_create_context
CREATE TABLE table_58796 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
How many total goals have 0 (3) as total apps, with league goals less than 0?
SELECT COUNT("Total Goals") FROM table_58796 WHERE "Total Apps" = '0 (3)' AND "League Goals" < '0'
wikisql
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
Tell me the average pesticide residue for each state in the US where food is grown.
SELECT T1.growst, AVG(T2.concen) FROM sampledata15 AS T1 JOIN resultsdata15 AS T2 ON T1.sample_pk = T2.sample_pk GROUP BY T1.growst
pesticide
CREATE TABLE table_27614 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
How many game sites are there where the team record is 1 7?
SELECT COUNT("Game site") FROM table_27614 WHERE "Team record" = '1–7'
wikisql
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...
根据出院诊断的不同以及科室的不同计算出0101657这家医院全部医疗就诊的记录里患者就诊的平均岁数是多少,把里面平均岁数超过23岁的记录留下来
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0101657' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM HAVING AVG(gwyjzb.PERSON_AGE) > 23 UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb...
css
CREATE TABLE table_10160447_1 ( position INTEGER, winnings VARCHAR )
what's the maximum position with winnings $50,000
SELECT MAX(position) FROM table_10160447_1 WHERE winnings = "$50,000"
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 cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
until 1 year ago, has patient 59275 been admitted into the hospital?
SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 59275 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_name_52 ( year VARCHAR, finish_position VARCHAR )
What was the 4th day in the year before 2012 that the finish is 33rd?
SELECT 4 AS th_day FROM table_name_52 WHERE year < 2012 AND finish_position = "33rd"
sql_create_context
CREATE TABLE table_66297 ( "School" text, "Location" text, "Mascot" text, "Size" real, "IHSAA Class" text, "County" text )
Which School has a Size larger than 408, and a Mascot of pacers?
SELECT "School" FROM table_66297 WHERE "Size" > '408' AND "Mascot" = 'pacers'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
count the number of patients whose age is less than 41 and drug route is oral?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "41" AND prescriptions.route = "ORAL"
mimicsql_data
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName tex...
create big list of questions.
SELECT p.Id, p.Tags, p.Id AS "post_link" FROM Posts AS p WHERE NOT Tags LIKE '%##exclude##%'
sede
CREATE TABLE table_56099 ( "Nat." text, "Name" text, "Since" real, "Goals" real, "Transfer fee" text )
Name the highest goals for youth system and ita
SELECT MAX("Goals") FROM table_56099 WHERE "Nat." = 'ita' AND "Transfer fee" = 'youth system'
wikisql
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TAB...
what was the last thing patient 025-13899 received for intake on 07/05/last year?
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 = '025-13899')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
eicu
CREATE TABLE table_203_533 ( id number, "season" number, "level" text, "division" text, "section" text, "position" text, "movements" text )
which division as the most entries ?
SELECT "division" FROM table_203_533 GROUP BY "division" ORDER BY COUNT(*) DESC LIMIT 1
squall
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 swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_40...
Show id from each meter 300, order by the bars in descending.
SELECT meter_300, ID FROM swimmer ORDER BY meter_300 DESC
nvbench
CREATE TABLE table_name_34 ( class VARCHAR, prom__m_ VARCHAR, peak VARCHAR )
Which Class is Peak Sail when it has a Prom larger than 30?
SELECT class FROM table_name_34 WHERE prom__m_ > 30 AND peak = "sail"
sql_create_context
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
what are the three most frequent drugs that were prescribed to patients of the 60 or above during the same month after having been diagnosed with anemia nos a year before?
SELECT t3.drug FROM (SELECT t2.drug, 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.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( row_id number, ...
how many hours have passed since patient 15447 stayed in careunit tsicu for the first time on this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15447 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1
mimic_iii
CREATE TABLE table_66669 ( "Rank" real, "Lane" real, "Athlete" text, "Country" text, "Time" text )
What time does lane 7 have?
SELECT "Time" FROM table_66669 WHERE "Lane" = '7'
wikisql