context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_76261 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text )
Which opponent was played in Week 6?
SELECT "Opponent" FROM table_76261 WHERE "Week" = '6'
wikisql
CREATE TABLE Products ( Manufacturer VARCHAR, Price INTEGER )
Select the average price of each manufacturer's products, showing only the manufacturer's code.
SELECT AVG(Price), Manufacturer FROM Products GROUP BY Manufacturer
sql_create_context
CREATE TABLE table_22353769_3 ( share VARCHAR, viewers__millions_ VARCHAR )
How many episodes had 3.62 million viewers?
SELECT COUNT(share) FROM table_22353769_3 WHERE viewers__millions_ = "3.62"
sql_create_context
CREATE TABLE table_75752 ( "Election" real, "Liberal Party" text, "Conservative Party" text, "Labour Party" text, "Independents" text, "Control" text )
Who was in control the year that Labour Party won 12 (+6) seats?
SELECT "Control" FROM table_75752 WHERE "Labour Party" = '12 (+6)'
wikisql
CREATE TABLE table_43148 ( "Date" text, "Tournament" text, "Location" text, "Home team" text, "Score" text, "Away team" text )
What is the location with Honduras is Home team?
SELECT "Location" FROM table_43148 WHERE "Home team" = 'honduras'
wikisql
CREATE TABLE table_name_56 ( catalog VARCHAR, region VARCHAR )
What is the Catalog with a Region that is europe?
SELECT catalog FROM table_name_56 WHERE region = "europe"
sql_create_context
CREATE TABLE gas_station ( open_year INTEGER )
How many gas station are opened between 2000 and 2005?
SELECT COUNT(*) FROM gas_station WHERE open_year BETWEEN 2000 AND 2005
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 ) ...
how many patients are below 30 years of age and tested with lab test abnormal status?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "30" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_name_45 ( home_team VARCHAR, venue VARCHAR )
When the VFL played Junction Oval what was the home team score?
SELECT home_team AS score FROM table_name_45 WHERE venue = "junction oval"
sql_create_context
CREATE TABLE table_43747 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which player has a score of 71-72=143?
SELECT "Player" FROM table_43747 WHERE "Score" = '71-72=143'
wikisql
CREATE TABLE table_7884 ( "Name" text, "Location" text, "Years as tallest" text, "Height metres / ft" text, "Floors" text )
How many floors did the building at the Jewellery quarter have?
SELECT "Floors" FROM table_7884 WHERE "Location" = 'jewellery quarter'
wikisql
CREATE TABLE table_76963 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What are the total rounds for the texas college and has a pick smaller than 25?
SELECT COUNT("Round") FROM table_76963 WHERE "College" = 'texas' AND "Pick" < '25'
wikisql
CREATE TABLE table_28696 ( "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 (millions)" text )
What is the original air date of 'Helen Back Again'?
SELECT "Original air date" FROM table_28696 WHERE "Title" = 'Helen Back Again'
wikisql
CREATE TABLE table_name_46 ( super_g INTEGER, season INTEGER )
What is the highest Super G, when Season is later than 1996?
SELECT MAX(super_g) FROM table_name_46 WHERE season > 1996
sql_create_context
CREATE TABLE table_67503 ( "Season" real, "Cars Entered" real, "Winning Driver" text, "Second Driver" text, "Third Driver" text, "Race Report" text )
What are the largest Cars Entered with a Season of 1958?
SELECT MAX("Cars Entered") FROM table_67503 WHERE "Season" = '1958'
wikisql
CREATE TABLE table_16353 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
What is the title written by David Mamet?
SELECT "Title" FROM table_16353 WHERE "Written by" = 'David Mamet'
wikisql
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, ...
calculate how many times patient 40435 had a chest tubes left pleural 1 output on last month/25.
SELECT COUNT(*) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'chest tubes left p...
mimic_iii
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admi...
CAAS 438 is offered at what morning times ?
SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'CAAS' AND cou...
advising
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerU...
Questions and answers per year.
SELECT (SELECT COUNT(Id) FROM Posts WHERE YEAR(Posts.CreationDate) = 2019 AND DeletionDate IS NULL AND ParentId IS NULL) AS questionCount, (SELECT COUNT(Id) FROM Posts WHERE YEAR(Posts.CreationDate) = 2019 AND DeletionDate IS NULL AND NOT ParentId IS NULL) AS answerCount
sede
CREATE TABLE table_18596 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who are all of the candidates in the election featuring james r. domengeaux?
SELECT "Candidates" FROM table_18596 WHERE "Incumbent" = 'James R. Domengeaux'
wikisql
CREATE TABLE table_26708105_5 ( protein_name VARCHAR, e_value VARCHAR )
What is the protein name when the e-value is 2.50e-41?
SELECT protein_name FROM table_26708105_5 WHERE e_value = "2.50E-41"
sql_create_context
CREATE TABLE table_name_7 ( apps INTEGER, rank VARCHAR, season VARCHAR )
How many apps for the rank of 8 in the 2012/13 season?
SELECT MAX(apps) FROM table_name_7 WHERE rank = 8 AND season = "2012/13"
sql_create_context
CREATE TABLE table_56402 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When the Home team of essendon is playing what is the Away team score?
SELECT "Away team score" FROM table_56402 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_7523 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2010\u201311" text )
What kind of 2006 07 event has a 2010 11 of n/a and an Event of colonial square?
SELECT "2006\u201307" FROM table_7523 WHERE "2010\u201311" = 'n/a' AND "Event" = 'colonial square'
wikisql
CREATE TABLE table_41305 ( "Team" text, "University" text, "Location" text, "Year entered league" real, "2013\u201314 division" text )
What is the 2013-2014 division for the Wolverhampton Wildcats?
SELECT "2013\u201314 division" FROM table_41305 WHERE "Team" = 'wolverhampton wildcats'
wikisql
CREATE TABLE table_49099 ( "Year" text, "League Position" text, "League" text, "Domestic Cup" text, "Cup Position" text )
What league has a position of 8/13?
SELECT "League" FROM table_49099 WHERE "League Position" = '8/13'
wikisql
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
Bar chart x axis date y axis total number of cloud cover, and show Y from high to low order.
SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover) DESC
nvbench
CREATE TABLE table_name_61 ( outcome VARCHAR, score_in_the_final VARCHAR )
Which Outcome has a Score in the final of 1 6, 6 4, 7 5?
SELECT outcome FROM table_name_61 WHERE score_in_the_final = "1–6, 6–4, 7–5"
sql_create_context
CREATE TABLE domain_keyword ( did int, kid int ) CREATE TABLE domain ( did int, name varchar ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE journal ( homepage var...
return me the conference that has the most number of papers containing keyword ' Relational Database ' .
SELECT conference.name FROM conference, keyword, publication, publication_keyword WHERE keyword.keyword = 'Relational Database' AND publication_keyword.kid = keyword.kid AND publication.cid = conference.cid AND publication.pid = publication_keyword.pid GROUP BY conference.name ORDER BY COUNT(DISTINCT (publication.title...
academic
CREATE TABLE table_name_98 ( cfl_team VARCHAR, pick__number VARCHAR )
What is the CFL Team with #48 as the pick number?
SELECT cfl_team FROM table_name_98 WHERE pick__number = 48
sql_create_context
CREATE TABLE table_69823 ( "Cyclist" text, "Nation" text, "Team" text, "Time" text, "UCI Points" real )
Which nation is Danilo di Luca from?
SELECT "Nation" FROM table_69823 WHERE "Cyclist" = 'danilo di luca'
wikisql
CREATE TABLE table_24910733_2 ( share VARCHAR, air_date VARCHAR )
How many share figures are there for the episode that aired on October 17, 2007?
SELECT COUNT(share) FROM table_24910733_2 WHERE air_date = "October 17, 2007"
sql_create_context
CREATE TABLE table_74739 ( "Municipality" text, "Inhabitants" real, "Mayor" text, "Party" text, "Election" real )
What party was achille variati afilliated with?
SELECT "Party" FROM table_74739 WHERE "Mayor" = 'achille variati'
wikisql
CREATE TABLE table_27601 ( "#" real, "Name" text, "Position" text, "Height" text, "Weight" real, "Year" text, "Home Town" text, "Last School" text )
Name the total number of height for number 32
SELECT COUNT("Height") FROM table_27601 WHERE "#" = '32'
wikisql
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...
Questions by number of close votes.
WITH the_data AS (SELECT q.Id, COUNT(DISTINCT v.Id) AS c_votes, MAX(a.Score) AS a_score FROM Posts AS q JOIN Votes AS v ON q.Id = v.PostId LEFT OUTER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 WHERE q.PostTypeId = 1 AND q.ClosedDate IS NULL AND v.VoteTypeId = 6 GROUP BY q.Id) SELECT c_votes AS "close_vot...
sede
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title 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 )...
how many times do patient 3745 go to the hospital until 1 year ago.
SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 3745 AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-1 year')
mimic_iii
CREATE TABLE table_22954 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
Who came as a replacement in Sheffield United?
SELECT "Replaced by" FROM table_22954 WHERE "Team" = 'Sheffield United'
wikisql
CREATE TABLE table_name_51 ( bronze INTEGER, rank VARCHAR, silver VARCHAR, total VARCHAR )
What's the bronze medal count for Rank 33 when the silver count was less than 2 and the total was more than 4?
SELECT MAX(bronze) FROM table_name_51 WHERE silver < 2 AND total > 4 AND rank = "33"
sql_create_context
CREATE TABLE table_1331313_1 ( office VARCHAR, incumbent VARCHAR )
who is the the office with incumbent being ramon r. jimenez, jr.
SELECT office FROM table_1331313_1 WHERE incumbent = "Ramon R. Jimenez, Jr."
sql_create_context
CREATE TABLE table_63566 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What is the to par of United States' Cristie Kerr?
SELECT "To par" FROM table_63566 WHERE "Country" = 'united states' AND "Player" = 'cristie kerr'
wikisql
CREATE TABLE news_report ( journalist_ID int, Event_ID int, Work_Type text ) CREATE TABLE journalist ( journalist_ID int, Name text, Nationality text, Age text, Years_working int ) CREATE TABLE event ( Event_ID int, Date text, Venue text, Name text, Event_Attendance...
Show me a bar chart for what are the nationalities and total ages of journalists?
SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality
nvbench
CREATE TABLE table_12591022_2 ( teaching_language VARCHAR, duration__years_ VARCHAR )
What is the teaching language with the duration (years) 3.5?
SELECT teaching_language FROM table_12591022_2 WHERE duration__years_ = "3.5"
sql_create_context
CREATE TABLE Sales ( sales_transaction_id INTEGER, sales_details VARCHAR(255) ) CREATE TABLE Transactions_Lots ( transaction_id INTEGER, lot_id INTEGER ) CREATE TABLE Lots ( lot_id INTEGER, investor_id INTEGER, lot_details VARCHAR(255) ) CREATE TABLE Transactions ( transaction_id INTE...
Show the average amount of transactions for different lots in a scatter chart
SELECT lot_id, AVG(amount_of_transaction) FROM Transactions AS T1 JOIN Transactions_Lots AS T2 ON T1.transaction_id = T2.transaction_id GROUP BY T2.lot_id
nvbench
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id...
Percentage of first posts which get closed (per day, between dates).
WITH firstpostids_cte AS (SELECT MIN(Id) AS MinId, OwnerUserId FROM Posts WHERE PostTypeId = 1 GROUP BY OwnerUserId), firstpostsclosed_cte AS (SELECT p.Id, p.CreationDate AS cre, p.ClosedDate AS clo FROM firstpostids_cte AS fp JOIN Posts AS p ON fp.MinId = p.Id) SELECT DATE(cre), ROUND((COUNT(clo)) * 100.0 / (COUNT(*))...
sede
CREATE TABLE table_39166 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Time" text, "Record" text )
What is the average attendance that has june 24 as the date?
SELECT AVG("Attendance") FROM table_39166 WHERE "Date" = 'june 24'
wikisql
CREATE TABLE table_42771 ( "Region" text, "Date" real, "Label" text, "Format" text, "Catalog" text )
What is the latest Date, when Label is Captain Oi! Records?
SELECT MAX("Date") FROM table_42771 WHERE "Label" = 'captain oi! records'
wikisql
CREATE TABLE table_25035 ( "Year" text, "Network" text, "Play-by-play" text, "Color commentator(s)" text, "Ice level reporters" text, "Studio host" text, "Studio analysts" text )
Who is the color commentator when brian engblom is ice level reporters?
SELECT "Color commentator(s)" FROM table_25035 WHERE "Ice level reporters" = 'Brian Engblom'
wikisql
CREATE TABLE band ( id number, firstname text, lastname text ) CREATE TABLE albums ( aid number, title text, year number, label text, type text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE performance ( songid number, bandmate number, stagepositi...
How many songs are there?
SELECT COUNT(*) FROM songs
spider
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( vitalperio...
what are the top five most common diagnosis since 3 years ago?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_27376 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What NFL team picked a player from Jackson State?
SELECT "NFL Team" FROM table_27376 WHERE "College" = 'Jackson State'
wikisql
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE bdmzjzjlb ( HXPLC number, HZX...
列举出在2001年2月17日到2007年7月3日这段时间内患者24318631所有检验报告单的审核日期时间是什么呢?
SELECT jybgb.SHSJ FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '24318631' AND jybgb.BGRQ BETWEEN '2001-02-17' AND '2007-...
css
CREATE TABLE table_11545282_7 ( years_for_jazz VARCHAR, no VARCHAR )
How many years did number 25 play for the Jazz?
SELECT years_for_jazz FROM table_11545282_7 WHERE no = 25
sql_create_context
CREATE TABLE table_33533 ( "Network" text, "Origin of Programming" text, "Language" text, "Genre" text, "Service" text )
Whose origin of Programming offers a general genre, a network of ntv bangla and a service of cogeco cable?
SELECT "Origin of Programming" FROM table_33533 WHERE "Genre" = 'general' AND "Network" = 'ntv bangla' AND "Service" = 'cogeco cable'
wikisql
CREATE TABLE table_53674 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
When is the earliest year for it is in barcelona, spain?
SELECT MIN("Year") FROM table_53674 WHERE "Venue" = 'barcelona, spain'
wikisql
CREATE TABLE table_75762 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
Who's the Runner(s)-up with a Winning score of 19 (71-63-63-64=261)?
SELECT "Runner(s)-up" FROM table_75762 WHERE "Winning score" = '−19 (71-63-63-64=261)'
wikisql
CREATE TABLE table_name_97 ( played INTEGER, pd_per_game VARCHAR, loss VARCHAR )
Which Played has a PD per game larger than 6.28, and a Loss smaller than 4?
SELECT MIN(played) FROM table_name_97 WHERE pd_per_game > 6.28 AND loss < 4
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
count the number of patients less than 72 years who have stayed in hospital for more than 17 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "72" AND demographic.days_stay > "17"
mimicsql_data
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number...
thanks comments on accepted answers.
SELECT Id AS "comment_link" FROM Comments WHERE (Text LIKE '%thank you%' COLLATE SQL_Latin1_General_CP1_CI_AS OR Text LIKE '%thanks%' COLLATE SQL_Latin1_General_CP1_CI_AS OR Text LIKE '%gracias%' COLLATE SQL_Latin1_General_CP1_CI_AS OR Text LIKE '%edit%' COLLATE SQL_Latin1_General_CP1_CI_AS) AND LENGTH(Text) <= 20 AND ...
sede
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...
继发龋的患者在被门诊诊断后他们的妊娠相关性血浆蛋白-A数值的平均值以及最值都是什么?
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE wdmzjzjlb.JZZDSM = '继发龋' AND jyjgzbb.JCZBMC = '妊娠相关...
css
CREATE TABLE table_name_13 ( record VARCHAR, loss VARCHAR )
What was the record at the game that had a loss of Spillner (1-8)?
SELECT record FROM table_name_13 WHERE loss = "spillner (1-8)"
sql_create_context
CREATE TABLE table_name_9 ( party VARCHAR, first_elected VARCHAR )
when first elected was 1898 what was the party?
SELECT party FROM table_name_9 WHERE first_elected = "1898"
sql_create_context
CREATE TABLE table_203_643 ( id number, "year" number, "award" text, "group" text, "result" text, "notes" text )
what was the first award he was nominated for ?
SELECT "award" FROM table_203_643 WHERE id = 1
squall
CREATE TABLE table_3130 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
What were the shots below par when the winning score was 69-66-69-64=268?
SELECT "To par" FROM table_3130 WHERE "Winning score" = '69-66-69-64=268'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
count the number of patients who have diagnoses icd9 code 45182 along with abnormal lab test status.
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 = "45182" AND lab.flag = "abnormal"
mimicsql_data
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
How rare are my badges?.
SELECT a.Id, a.OwnerUserId, CASE WHEN a.Score >= 10 THEN 1 ELSE 0 END AS NiceAnswer, CASE WHEN a.Score >= 25 THEN 1 ELSE 0 END AS GoodAnswer, CASE WHEN a.Score >= 100 THEN 1 ELSE 0 END AS GreatAnswer, CASE WHEN a.Score >= 40 AND a.Id = q.AcceptedAnswerId THEN 1 ELSE 0 END AS Guru FROM Posts AS a JOIN Posts AS q ON a.Pa...
sede
CREATE TABLE table_name_87 ( title VARCHAR, year VARCHAR, date VARCHAR )
What is the title for year 1991 and a date of March 21?
SELECT title FROM table_name_87 WHERE year = 1991 AND date = "march 21"
sql_create_context
CREATE TABLE table_6382 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real )
What game has 2 points?
SELECT MAX("Games") FROM table_6382 WHERE "Points" = '2'
wikisql
CREATE TABLE table_11129123_1 ( episode_air_date VARCHAR, callback_venue VARCHAR )
When did the callbacks from rancho bernardo inn air
SELECT episode_air_date FROM table_11129123_1 WHERE callback_venue = "Rancho Bernardo Inn"
sql_create_context
CREATE TABLE table_71414 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the Score of the 2008 Africa Cup of Nations Competition?
SELECT "Score" FROM table_71414 WHERE "Competition" = '2008 africa cup of nations'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( i...
hey what was patient 028-45581's minimum troponin - i value in 08/2102?
SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-45581')) AND lab.labname = 'troponin - i' AND STRFTIME('%y-%m', lab.labresultt...
eicu
CREATE TABLE table_name_61 ( venue VARCHAR, driver VARCHAR, event VARCHAR )
Where was the BRDC International Trophy with driver Emerson Fittipaldi held?
SELECT venue FROM table_name_61 WHERE driver = "emerson fittipaldi" AND event = "brdc international trophy"
sql_create_context
CREATE TABLE table_72182 ( "Route Name" text, "Direction" text, "Termini" text, "Junctions" text, "Length" text, "Population Area" text, "Remarks" text )
What unit of length is being used for the route with 'replaced by us 81' in their remarks section?
SELECT "Length" FROM table_72182 WHERE "Remarks" = 'Replaced by US 81'
wikisql
CREATE TABLE table_name_52 ( losses INTEGER, goals_for VARCHAR, played VARCHAR )
What was the highest amount of losses when there were 45 goals and the play was smaller than 38?
SELECT MAX(losses) FROM table_name_52 WHERE goals_for = 45 AND played < 38
sql_create_context
CREATE TABLE table_name_13 ( round INTEGER, name VARCHAR )
What is the round for bob randall?
SELECT AVG(round) FROM table_name_13 WHERE name = "bob randall"
sql_create_context
CREATE TABLE table_64942 ( "Player" text, "Int'l Debut" text, "Year" text, "Cross Code Debut" text, "Date" text )
What is the Player in the Int'l Debut of 1974?
SELECT "Player" FROM table_64942 WHERE "Year" = '1974'
wikisql
CREATE TABLE table_1341973_6 ( result VARCHAR, incumbent VARCHAR )
What was the result of the election of incumbent john shelley?
SELECT result FROM table_1341973_6 WHERE incumbent = "John Shelley"
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...
Access time of specific tag users.
WITH Questions AS (SELECT *, (CASE WHEN EXISTS(SELECT * FROM Posts AS P WHERE P.OwnerUserId = Q.OwnerUserId AND P.PostTypeId = 1 AND P.CreationDate < Q.CreationDate) THEN 0 ELSE 1 END) AS "first" FROM Posts AS Q WHERE Q.PostTypeId = 1 AND Q.Tags LIKE @Pattern), IDUsers AS (SELECT U.*, Q.CreationDate AS "questiondate" F...
sede
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE jyjgzbb ( BGDH text, BGRQ tim...
列举出在06年8月30日到2008年5月14日内蒋锐锋病患所有检验报告单的审核日期时间是那几天?
SELECT jybgb.SHSJ 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 jybg...
css
CREATE TABLE table_11178271_1 ( viewers__m_ VARCHAR, rating VARCHAR )
What is the viewers where the rating is 5.3?
SELECT viewers__m_ FROM table_11178271_1 WHERE rating = "5.3"
sql_create_context
CREATE TABLE table_3297 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
List the year in which the driver was in 1st place.
SELECT "Season" FROM table_3297 WHERE "Position" = '1st'
wikisql
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_400 text, meter_500 text, meter_600 text, meter_700 text, Time text ) ...
Give me the comparison about meter_100 over the meter_500 by a bar chart, I want to sort in ascending by the meter_100.
SELECT meter_500, meter_100 FROM swimmer ORDER BY meter_100
nvbench
CREATE TABLE table_33052 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the Home team's score when the Away team scored 12.6 (78)?
SELECT "Home team score" FROM table_33052 WHERE "Away team score" = '12.6 (78)'
wikisql
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid nu...
retrieve the patient identifications who have been diagnosed with fall-1 level to oth nec in the previous year.
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'fall-1 level to oth nec') AND DATETIME(diagnoses_icd.charttime, 'start of ...
mimic_iii
CREATE TABLE routes ( rid integer, dst_apid integer, dst_ap varchar(4), src_apid bigint, src_ap varchar(4), alid bigint, airline varchar(4), codeshare text ) CREATE TABLE airports ( apid integer, name text, city text, country text, x real, y real, elevation b...
A bar chart for what are the number of the countries of all airlines whose names start with Orbit?, sort from high to low by the names.
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY country DESC
nvbench
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
how much does patient 20034 have to pay for their hospital stay in 2104?
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20034) AND STRFTIME('%y', cost.chargetime) = '2104'
mimic_iii
CREATE TABLE table_69364 ( "Outcome" text, "Year" real, "Tournament" text, "Opponent" text, "Score" text )
What was the score of the player who played against Wong Choong Hann in the Dutch Open?
SELECT "Score" FROM table_69364 WHERE "Tournament" = 'dutch open' AND "Opponent" = 'wong choong hann'
wikisql
CREATE TABLE table_203_70 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many more medals did egypt win than ivory coast ?
SELECT (SELECT "total" FROM table_203_70 WHERE "nation" = 'egypt') - (SELECT "total" FROM table_203_70 WHERE "nation" = 'ivory coast')
squall
CREATE TABLE table_204_297 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which team placed in first with the most earned medals ?
SELECT "nation" FROM table_204_297 ORDER BY "total" DESC LIMIT 1
squall
CREATE TABLE table_name_54 ( pal_m VARCHAR, ntsc_m VARCHAR )
What is the PAL M for the NTSC M 4.5mhz?
SELECT pal_m FROM table_name_54 WHERE ntsc_m = "4.5mhz"
sql_create_context
CREATE TABLE table_5404 ( "Score" real, "Opposition" text, "Venue" text, "City" text, "Year" real )
Which City has a Score smaller than 30, and a Venue of aigburth?
SELECT "City" FROM table_5404 WHERE "Score" < '30' AND "Venue" = 'aigburth'
wikisql
CREATE TABLE t_kc21 ( CLINIC_ID text, CLINIC_TYPE text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, ...
医疗机构2299367从零五年五月五号到一一年八月二十二期间就诊总量里患者是未就业人员有多少
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2299367' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-05-05' AND '2011-08-22' AND t_kc21.INSURED_STS = '未就业'
css
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For those employees who do not work in departments with managers that have ids between 100 and 200, a line chart shows the trend of department_id over hire_date , sort HIRE_DATE in ascending order.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime tim...
when was the first time that patient 80645 got a urine out void output on 12/05/last year?
SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80645)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin...
mimic_iii
CREATE TABLE t_kc22 ( MED_EXP_DET_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, MED_EXP_BILL_ID text, SOC_SRT_DIRE_CD text, SOC_SRT_DIRE_NM text, DIRE_TYPE number, CHA_ITEM_LEV number, MED_INV_ITEM_TYPE text, MED_DIRE_CD text, MED_DIRE_NM text,...
因患疾病G15.489的人在2004年7月3日到2008年9月9日内在预防保健科住院产生的平均费用是多少?
SELECT AVG(MED_AMOUT) FROM t_kc21 WHERE MED_ORG_DEPT_NM = '预防保健科' AND IN_HOSP_DATE BETWEEN '2004-07-03' AND '2008-09-09' AND IN_DIAG_DIS_CD = 'G15.489' AND CLINIC_TYPE = '住院'
css
CREATE TABLE table_name_80 ( nationality VARCHAR, time VARCHAR )
What is the nationality of the athlete with a time of 2:12.56?
SELECT nationality FROM table_name_80 WHERE time = "2:12.56"
sql_create_context
CREATE TABLE table_53998 ( "Frequency" text, "Call sign" text, "Name" text, "Format" text, "Owner" text )
What is the frequency of the talk station?
SELECT "Frequency" FROM table_53998 WHERE "Format" = 'talk'
wikisql
CREATE TABLE table_name_65 ( proposed VARCHAR, listed VARCHAR, county VARCHAR )
What date was proposed when the listed date was 12/16/1994 in the County of beaufort?
SELECT proposed FROM table_name_65 WHERE listed = "12/16/1994" AND county = "beaufort"
sql_create_context
CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM text, ZYLBDM text, ZYMC text ) CREATE TABLE wdmzjzjlb ( HXPLC number, HZX...
患者华明煦被门诊诊断为矽肺壹期,查查胃泌素释放肽前体的结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ...
css
CREATE TABLE table_name_14 ( language VARCHAR, director VARCHAR )
What is the language of the film directed by Hans Kristensen?
SELECT language FROM table_name_14 WHERE director = "hans kristensen"
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is the number of patients whose admission location is emergency room admit and admission year is less than 2151?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.admityear < "2151"
mimicsql_data