context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_42527 ( "Game" real, "Date" text, "Team" text, "Score" text, "Location Attendance" text, "Record" text )
Which Game has a Team of at san antonio, and a Record of 3-3?
SELECT "Game" FROM table_42527 WHERE "Team" = 'at san antonio' AND "Record" = '3-3'
wikisql
CREATE TABLE table_name_5 ( tournament VARCHAR, margin_of_victory VARCHAR, date VARCHAR )
What is Tournament, when Margin Of Victory is 1 Stroke, and when Date is 18 Jan 2009?
SELECT tournament FROM table_name_5 WHERE margin_of_victory = "1 stroke" AND date = "18 jan 2009"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
provide the admission location and discharge location of subject id 84129.
SELECT demographic.admission_location, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "84129"
mimicsql_data
CREATE TABLE table_1353096_2 ( station VARCHAR, city_of_license_market VARCHAR )
Which station has a license in Fort Collins, Colorado?
SELECT station FROM table_1353096_2 WHERE city_of_license_market = "Fort Collins, Colorado"
sql_create_context
CREATE TABLE invoices ( invoice_number number, order_id number, invoice_date time ) CREATE TABLE accounts ( account_id number, customer_id number, date_account_opened time, account_name text, other_account_details text ) CREATE TABLE order_items ( order_item_id number, order_id...
Show all product names and the number of customers having an order on each product.
SELECT T2.product_name, COUNT(*) FROM order_items AS T1 JOIN products AS T2 ON T1.product_id = T2.product_id JOIN orders AS T3 ON T3.order_id = T1.order_id GROUP BY T2.product_name
spider
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(...
Show employee_id from each email, and display from high to low by the total number.
SELECT EMAIL, EMPLOYEE_ID FROM employees ORDER BY EMPLOYEE_ID DESC
nvbench
CREATE TABLE table_72923 ( "School" text, "Est. Denotes original date of establishment of the school, changes in name and/or location noted in corresponding ootnote" real, "Location Denotes location of school by Seattle neighborhood, does not necessary correspond with attendance area" text, "Nickname" t...
Name the most 11-12 enrollment for columbia city
SELECT MAX("11-12 Enrollment") FROM table_72923 WHERE "Location Denotes location of school by Seattle neighborhood, does not necessary correspond with attendance area" = 'Columbia City'
wikisql
CREATE TABLE table_21692 ( "Winner" text, "Country" text, "Winter Olympics" text, "FIS Nordic World Ski Championships" text, "Holmenkollen" text )
In what year did the winner of the FIS championship in 1982 win the Winter Olympics?
SELECT "Winter Olympics" FROM table_21692 WHERE "FIS Nordic World Ski Championships" = '1982'
wikisql
CREATE TABLE table_45765 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text )
Which Streak has a Game larger than 49?
SELECT "Streak" FROM table_45765 WHERE "Game" > '49'
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...
how many patients whose age is less than 27 and lab test name is creatine kinase (ck)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "27" AND lab.label = "Creatine Kinase (CK)"
mimicsql_data
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTy...
Users by location, reputation and tags sorted by reputation.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation AS Tags FROM Users WHERE LOWER(Location) LIKE LOWER('%##Location##%') ORDER BY Reputation DESC
sede
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...
All code history for a PostId.
SELECT Id, Text FROM PostHistory WHERE PostId = 111102
sede
CREATE TABLE table_726 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What year was Frank Annunzio elected
SELECT MIN("First elected") FROM table_726 WHERE "Incumbent" = 'Frank Annunzio'
wikisql
CREATE TABLE table_7461 ( "Type" text, "Name" text, "Title" text, "Political group" text, "From" text )
What is the Political group for p. maelius capitolinus?
SELECT "Political group" FROM table_7461 WHERE "Name" = 'p. maelius capitolinus'
wikisql
CREATE TABLE Locations ( Location_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Parties_in_Events ( Party_ID INTEGER, Event_ID INTEGER, Role_Code CHAR(15) ) CREATE TABLE Events ( Event_ID INTEGER, Address_ID INTEGER, Channel_ID INTEGER, Event_Type_Code CHAR(15), Finance...
Show the names of products and the number of events they are in by a bar chart.
SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name
nvbench
CREATE TABLE customers ( customer_id number, payment_method text, customer_name text, date_became_customer time, other_customer_details text ) CREATE TABLE products ( product_id number, product_details text ) CREATE TABLE customer_contact_channels ( customer_id number, channel_code...
What is the average amount of items ordered in each order?
SELECT AVG(order_quantity) FROM order_items
spider
CREATE TABLE table_name_22 ( to_par VARCHAR, winning_score VARCHAR )
Which To par has a Winning score of 64-68-66-63=261?
SELECT to_par FROM table_name_22 WHERE winning_score = 64 - 68 - 66 - 63 = 261
sql_create_context
CREATE TABLE table_26202940_6 ( outcome VARCHAR, score_in_the_final VARCHAR )
How many outcomes occur for score in the final of 6 3, 6 4, 7 6 (13 11)?
SELECT COUNT(outcome) FROM table_26202940_6 WHERE score_in_the_final = "6–3, 6–4, 7–6 (13–11)"
sql_create_context
CREATE TABLE table_name_95 ( genre VARCHAR, number_of_episodes VARCHAR, english_title__chinese_title_ VARCHAR )
What genre has over 20 episodes, with an English title (Chinese title) of wong fei hung - master of kung fu ?
SELECT genre FROM table_name_95 WHERE number_of_episodes > 20 AND english_title__chinese_title_ = "wong fei hung - master of kung fu 我師傅係黃飛鴻"
sql_create_context
CREATE TABLE table_name_52 ( pick VARCHAR, player VARCHAR )
How many picks included Kenny Evans?
SELECT COUNT(pick) FROM table_name_52 WHERE player = "kenny evans"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, ...
show me all flights arriving to DENVER from OAKLAND
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 = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
CREATE TABLE table_45412 ( "Position" real, "Name" text, "Played" real, "Drawn" real, "Lost" real, "Points" real )
what is the lowest position when the name is esv t rkheim, and Drawn more than 0?
SELECT MIN("Position") FROM table_45412 WHERE "Name" = 'esv türkheim' AND "Drawn" > '0'
wikisql
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, draw a bar chart about the distribution of name and the sum of price , and group by attribute name.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name
nvbench
CREATE TABLE table_69263 ( "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
Name the score for yuliya ustyuzhanina
SELECT "Score" FROM table_69263 WHERE "Opponent" = 'yuliya ustyuzhanina'
wikisql
CREATE TABLE table_train_228 ( "id" int, "ejection_fraction_ef" int, "hiv_infection" bool, "heart_disease" bool, "body_weight" float, "body_mass_index_bmi" float, "allergy_to_beef" bool, "NOUSE" float )
allergy to beef
SELECT * FROM table_train_228 WHERE allergy_to_beef = 1
criteria2sql
CREATE TABLE table_76858 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
What is Series, when Date is 'June 7'?
SELECT "Series" FROM table_76858 WHERE "Date" = 'june 7'
wikisql
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number,...
Up Votes vs Down Votes.
SELECT (SELECT CAST(COUNT(Votes.Id) AS FLOAT) FROM Votes WHERE VoteTypeId = 2) / (SELECT CAST(COUNT(Votes.Id) AS FLOAT) FROM Votes WHERE VoteTypeId = 3) AS "Up Votes / Down Votes"
sede
CREATE TABLE table_11007 ( "Episode #" text, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text )
What is the title of the program that was originally aired on June 13, 1999?
SELECT "Title" FROM table_11007 WHERE "Original airdate" = 'june 13, 1999'
wikisql
CREATE TABLE table_74750 ( "Year" real, "Date" text, "Location" text, "Theme" text, "Anthem" text )
What is the location in 2007?
SELECT "Location" FROM table_74750 WHERE "Year" = '2007'
wikisql
CREATE TABLE table_34326 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
Which Drawn has a Difference of 14?
SELECT AVG("Drawn") FROM table_34326 WHERE "Difference" = '14'
wikisql
CREATE TABLE table_69336 ( "Ship" text, "Builder" text, "Namesake" text, "Renamed" text, "Laid down" text, "Launched" text, "Commissioned or completed(*)" text )
What date was the ship named Manhattan completed?
SELECT "Commissioned or completed(*)" FROM table_69336 WHERE "Ship" = 'manhattan'
wikisql
CREATE TABLE table_name_85 ( decision VARCHAR, date VARCHAR )
Which Decision has a Date of april 25?
SELECT decision FROM table_name_85 WHERE date = "april 25"
sql_create_context
CREATE TABLE table_name_94 ( oct VARCHAR, nov VARCHAR )
What were the Oct. temperatures for the city that had Nov. temperatures of 51/30?
SELECT oct FROM table_name_94 WHERE nov = "51/30"
sql_create_context
CREATE TABLE film ( Title VARCHAR, Film_ID VARCHAR ) CREATE TABLE film_market_estimation ( Type VARCHAR, Film_ID VARCHAR )
Please show the titles of films and the types of market estimations.
SELECT T1.Title, T2.Type FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID
sql_create_context
CREATE TABLE table_13106 ( "Player" text, "Height" real, "Position" text, "Year born (Age)" text, "Current Club" text )
What is the Current Club of the PG/SG player with a Height of less than 1.9500000000000002?
SELECT "Current Club" FROM table_13106 WHERE "Height" < '1.9500000000000002' AND "Position" = 'pg/sg'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number...
count the number of times that patient 015-94542 has had tube fdging form until 44 months ago.
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-94542')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce...
eicu
CREATE TABLE table_31237 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" real, "New entries this round" text, "Leagues entering at this round" text )
How many different values of clubs involved were there when the league entering at this round was allsvenskan?
SELECT COUNT("Clubs involved") FROM table_31237 WHERE "Leagues entering at this round" = 'Allsvenskan'
wikisql
CREATE TABLE table_name_72 ( category VARCHAR, cancelable VARCHAR, type VARCHAR )
When Cancelable of yes, and a Type of drag, what was the Category?
SELECT category FROM table_name_72 WHERE cancelable = "yes" AND type = "drag"
sql_create_context
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_CLINIC_ID text, MED_DIRE_CD tex...
请排列出孔曼青患者在2001年8月29日到2015年3月17日内被开出的所有药品的编码、名称、数量、单价、金额分别是多少?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '孔曼青' AND qtb.IN_HOSP_DATE BETWEEN '2001-08-29' AND '2015-03-17' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.Q...
css
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid num...
tell me the name of the first specimen test patient 031-3355 had received this month?
SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND DATETIME(microlab.culturetakentime, 'start of month') ...
eicu
CREATE TABLE table_name_86 ( number_of_episodes VARCHAR, status VARCHAR )
What is Number Of Episodes, when Status is '2001 - 2003, 2005 - 2009'?
SELECT number_of_episodes FROM table_name_86 WHERE status = "2001 - 2003, 2005 - 2009"
sql_create_context
CREATE TABLE table_10549 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the attendance at the game played at Moorabbin Oval?
SELECT "Crowd" FROM table_10549 WHERE "Venue" = 'moorabbin oval'
wikisql
CREATE TABLE table_name_41 ( bulgarian_commander VARCHAR, battle VARCHAR, date VARCHAR )
What is the Bulgarian Commander in Autumn 1040 at the Battle of Thessalonica?
SELECT bulgarian_commander FROM table_name_41 WHERE battle = "battle of thessalonica" AND date = "autumn 1040"
sql_create_context
CREATE TABLE table_1217448_1 ( publisher VARCHAR, cover_date VARCHAR )
what is the total number of publisher where cover date is may 1939
SELECT COUNT(publisher) FROM table_1217448_1 WHERE cover_date = "May 1939"
sql_create_context
CREATE TABLE table_76064 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
In the game on or before week 9, who was the opponent when the attendance was 61,626?
SELECT "Opponent" FROM table_76064 WHERE "Week" < '9' AND "Attendance" = '61,626'
wikisql
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 is the top three most frequent drugs that patients were prescribed within 2 months after being prescribed with chlorothiazide sodium until 2 years ago?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'chlorothiazide sodium' AND DATETIME(prescriptions.startdate) <= D...
mimic_iii
CREATE TABLE table_68217 ( "Year" real, "Manufacturer" text, "Start" real, "Finish" real, "Team" text )
Name the most finish for 2006
SELECT MAX("Finish") FROM table_68217 WHERE "Year" = '2006'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code...
when was the last time patient 28484 had a urine . output until 2078 days ago.
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 = 28484)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'urin...
mimic_iii
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, ...
let me know the short title of diagnoses for the patient with patient id 21796.
SELECT diagnoses.short_title FROM diagnoses WHERE diagnoses.subject_id = "21796"
mimicsql_data
CREATE TABLE table_name_88 ( held_record VARCHAR, structural_type VARCHAR, town VARCHAR )
What is the church made from in Hamburg?
SELECT held_record FROM table_name_88 WHERE structural_type = "church" AND town = "hamburg"
sql_create_context
CREATE TABLE table_14360 ( "Country" text, "Film title used in nomination" text, "Language" text, "Original name" text, "Director" text )
What was the film title used in nomination for Panny Z Wilka?
SELECT "Film title used in nomination" FROM table_14360 WHERE "Original name" = 'panny z wilka'
wikisql
CREATE TABLE table_name_94 ( evening_gown INTEGER, state VARCHAR, interview VARCHAR )
What is the highest evening gown number in North Carolina with less than 9.214 interviews?
SELECT MAX(evening_gown) FROM table_name_94 WHERE state = "north carolina" AND interview < 9.214
sql_create_context
CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby int, journalid int ) CREATE TABLE paperfield ( ...
List the popular publications on Object discrimination
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Object discrimination' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid
scholar
CREATE TABLE table_11868 ( "Name" text, "Premiere" text, "Finale" text, "Original teams" text, "The Biggest Loser" text, "At-Home Winner" text )
What were the original teams for the season that was won at-home by Mark Pinkhasovich?
SELECT "Original teams" FROM table_11868 WHERE "At-Home Winner" = 'mark pinkhasovich'
wikisql
CREATE TABLE table_54188 ( "! Late 1941" text, "Late 1942" real, "Sept. 1943" real, "Late 1943" real, "Late 1944" real, "1978 Veteran membership" real )
What is the 1978 Veteran membership with a late 1941 macedonia and a late 1943 less than 10,000?
SELECT SUM("1978 Veteran membership") FROM table_54188 WHERE "! Late 1941" = 'macedonia' AND "Late 1943" < '10,000'
wikisql
CREATE TABLE table_49521 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the Visitor on March 31?
SELECT "Visitor" FROM table_49521 WHERE "Date" = 'march 31'
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...
在2005年12月29日至2010年12月28日之中风湿免疫科的云南白药胶囊的共开药量有多些呢?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.MED_ORG_DEPT_NM = '风湿免疫科' AND t_kc22.STA_DATE BETWEEN '2005-12-29' AND '2010-12-28' AND t_kc22.SOC_SRT_DIRE_NM = '云南白药胶囊'
css
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, ...
这个药品4106-d在医疗就诊58910754404期间的多久使用一次还有每次用量是多些呢?
SELECT t_kc22.USE_FRE, t_kc22.EACH_DOSAGE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '58910754404' AND t_kc22.SOC_SRT_DIRE_CD = '4106-d'
css
CREATE TABLE table_68622 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the home team of the game on January 22?
SELECT "Home" FROM table_68622 WHERE "Date" = 'january 22'
wikisql
CREATE TABLE table_262383_1 ( margin VARCHAR, runner_s__up VARCHAR )
what is the space where the next one was mike turnesa
SELECT margin FROM table_262383_1 WHERE runner_s__up = "Mike Turnesa"
sql_create_context
CREATE TABLE table_25086 ( "Year" real, "Network" text, "Race caller" text, "s Host" text, "s Analyst" text, "Reporters" text, "Trophy presentation" text )
Name the number of reporters for heywood hale broun
SELECT COUNT("Reporters") FROM table_25086 WHERE "s Analyst" = 'Heywood Hale Broun'
wikisql
CREATE TABLE table_name_41 ( record VARCHAR, high_assists VARCHAR, game VARCHAR )
What is the record of game 26 with beno udrih (4) as the highest assists?
SELECT record FROM table_name_41 WHERE high_assists = "beno udrih (4)" AND game = 26
sql_create_context
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, C...
Search post where comment text like '...'. Also included Score and text
SELECT Id AS "comment_link", Score, Text FROM Comments WHERE UPPER(Text) LIKE UPPER('%##CommentText##%') AND CreationDate > '01/01/2019' ORDER BY Score DESC
sede
CREATE TABLE loan ( cust_id VARCHAR, amount INTEGER ) CREATE TABLE customer ( cust_name VARCHAR, cust_id VARCHAR )
Find the name of customer who has the highest amount of loans.
SELECT T1.cust_name FROM customer AS T1 JOIN loan AS T2 ON T1.cust_id = T2.cust_id GROUP BY T1.cust_name ORDER BY SUM(T2.amount) DESC LIMIT 1
sql_create_context
CREATE TABLE diagnoses ( 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 ) C...
provide the number of patients with death status as 0 and procedure title as endoscopic removal of stone(s) from biliary tract.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract"
mimicsql_data
CREATE TABLE table_5189 ( "Maryland Counties" text, "Fall 05" real, "Fall 06" real, "Fall 07" real, "Fall 08" real, "Fall 09" real )
What is the largest value for Fall 08 when Fall 09 is 792 and Fall 05 is less than 791?
SELECT MAX("Fall 08") FROM table_5189 WHERE "Fall 09" = '792' AND "Fall 05" < '791'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDat...
Get users that have smileys in their username.
SELECT Id, Reputation, DisplayName, Location, Age, CreationDate, WebsiteUrl FROM Users WHERE DisplayName LIKE '%sanchy%' ORDER BY Reputation DESC
sede
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 diagnoses ( ...
provide the number of patients whose drug type is main and lab test name is calculated bicarbonate, whole blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.drug_type = "MAIN" AND lab.label = "Calculated Bicarbonate, Whole Blood"
mimicsql_data
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what are the cost of diagnosis for h zoster complicated nec?
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_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 = 'h zoster complicated nec'))
mimic_iii
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 ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE...
A bar chart shows the distribution of meter_700 and ID , I want to sort in ascending by the bar.
SELECT meter_700, ID FROM swimmer ORDER BY meter_700
nvbench
CREATE TABLE table_16797 ( "Week" text, "Date" text, "Opponent" text, "Result" text, "Kickoff [a ]" text, "Game site" text, "TV" text, "Attendance" text, "Record" text )
Which tv had the date december 7, 1986?
SELECT "TV" FROM table_16797 WHERE "Date" = 'December 7, 1986'
wikisql
CREATE TABLE table_name_74 ( Id VARCHAR )
Which Tournament in 2010 also has Grand Slam tournaments in 2011
SELECT 2010 FROM table_name_74 WHERE 2011 = "grand slam tournaments"
sql_create_context
CREATE TABLE table_69958 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
Who won the men's singles in 1958?
SELECT "Men's singles" FROM table_69958 WHERE "Year" = '1958'
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...
what is maximum age of patients whose admission location is trsf within this facility and primary disease is liver transplant?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "LIVER TRANSPLANT"
mimicsql_data
CREATE TABLE table_17858 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What club has a tries for count of 19?
SELECT "Club" FROM table_17858 WHERE "Tries for" = '19'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
Provide the number of patients who were ordered a potassium urine lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Potassium, Urine"
mimicsql_data
CREATE TABLE subjects ( subject_id number, subject_name text ) CREATE TABLE student_course_enrolment ( registration_id number, student_id number, course_id number, date_of_enrolment time, date_of_completion time ) CREATE TABLE courses ( course_id number, author_id number, subje...
What are the enrollment dates of all the tests that have result 'Pass'?
SELECT T1.date_of_enrolment FROM student_course_enrolment AS T1 JOIN student_tests_taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass"
spider
CREATE TABLE table_39934 ( "Name" text, "Position" text, "Number" real, "Season" text, "Acquisition via" text )
How many numbers had Brandon Dean as a name?
SELECT SUM("Number") FROM table_39934 WHERE "Name" = 'brandon dean'
wikisql
CREATE TABLE table_name_11 ( school_club_team_country VARCHAR, height_in_ft VARCHAR )
Name the school/club team/country for the player that is 6-5 ft
SELECT school_club_team_country FROM table_name_11 WHERE height_in_ft = "6-5"
sql_create_context
CREATE TABLE table_38330 ( "School" text, "Mascot" text, "Conference" text, "National Titles" real, "Founded" real )
What is the total number of national titles for the team with doane tigers as the mascot?
SELECT COUNT("National Titles") FROM table_38330 WHERE "Mascot" = 'doane tigers'
wikisql
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, ...
what is procedure short title of procedure icd9 code 3606?
SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "3606"
mimicsql_data
CREATE TABLE table_name_57 ( home_team VARCHAR, venue VARCHAR )
What is the Home team at corio oval?
SELECT home_team FROM table_name_57 WHERE venue = "corio oval"
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...
how many patients whose insurance is government and procedure short title is percu endosc jejunostomy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Percu endosc jejunostomy"
mimicsql_data
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, ...
is the value of chloride second measured on the first hospital visit of patient 030-40641 less than its value first measured on the first hospital visit?
SELECT (SELECT 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 = '030-40641' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
eicu
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConce...
Suggested edits but nowt else.
SELECT DATE(ApprovalDate) AS dateonly, u.CreationDate, SUM(COUNT(*) * 2) OVER (ORDER BY DATE(ApprovalDate)) AS score, u.Reputation FROM SuggestedEdits INNER JOIN Users AS u ON u.Id = SuggestedEdits.OwnerUserId WHERE NOT ApprovalDate IS NULL AND u.CreationDate >= '2015-01-01' AND u.Reputation BETWEEN 100 AND 2000 AND u....
sede
CREATE TABLE table_name_69 ( brilliance_grade VARCHAR, benchmark VARCHAR )
Which Brilliance Grade has a Benchmark of practical fine cut?
SELECT brilliance_grade FROM table_name_69 WHERE benchmark = "practical fine cut"
sql_create_context
CREATE TABLE table_26650 ( "State (class)" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date of successors formal installation" text )
List the number of vacators when successors were formally installed on June 22, 1868.
SELECT COUNT("Vacator") FROM table_26650 WHERE "Date of successors formal installation" = 'June 22, 1868'
wikisql
CREATE TABLE table_name_17 ( city VARCHAR, prize VARCHAR )
What is the City, when the Prize is $1,859,000?
SELECT city FROM table_name_17 WHERE prize = "$1,859,000"
sql_create_context
CREATE TABLE table_61682 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
What is the opposing team with 11 against?
SELECT "Opposing Teams" FROM table_61682 WHERE "Against" = '11'
wikisql
CREATE TABLE candidates ( candidate_id number, candidate_details text ) CREATE TABLE student_course_registrations ( student_id number, course_id number, registration_date time ) CREATE TABLE people_addresses ( person_address_id number, person_id number, address_id number, date_from...
How many courses do the student whose id is 171 attend?
SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T2.student_id = 171
spider
CREATE TABLE table_67941 ( "Country" text, "Player name" text, "Period" text, "Position" text, "Matches" text, "Goals" text )
Name the goals with matches of 21
SELECT "Goals" FROM table_67941 WHERE "Matches" = '21'
wikisql
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Courses...
Find the student ID and personal name of the student with at least two enrollments, order x axis in ascending order.
SELECT T2.personal_name, T1.student_id FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id ORDER BY T2.personal_name
nvbench
CREATE TABLE table_53450 ( "Rank" real, "Constituency" text, "Winning party 2003" text, "Swing to gain" real, "SNP's place 2003" text, "Result" text )
Which rank had the Labour party winning in 2003, a swing to gain that was larger than 2.13, a lab hold as a result, and which took place in the Linlithgow constituency?
SELECT "Rank" FROM table_53450 WHERE "Winning party 2003" = 'labour' AND "Swing to gain" > '2.13' AND "Result" = 'lab hold' AND "Constituency" = 'linlithgow'
wikisql
CREATE TABLE table_name_99 ( result VARCHAR, year VARCHAR )
What was the result in 2008?
SELECT result FROM table_name_99 WHERE year = "2008"
sql_create_context
CREATE TABLE table_name_13 ( song VARCHAR, music_director_s_ VARCHAR )
What song was directed by Shankar Jaikishan?
SELECT song FROM table_name_13 WHERE music_director_s_ = "shankar jaikishan"
sql_create_context
CREATE TABLE table_61157 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
Which competition was held in Arles, France?
SELECT "Competition" FROM table_61157 WHERE "Venue" = 'arles, france'
wikisql
CREATE TABLE table_204_788 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
wendlinger finished 8th . who finished next ?
SELECT "driver" FROM table_204_788 WHERE "pos" = 8 + 1
squall
CREATE TABLE Products ( product_id INTEGER, parent_product_id INTEGER, production_type_code VARCHAR(15), unit_price DECIMAL(19,4), product_name VARCHAR(80), product_color VARCHAR(20), product_size VARCHAR(20) ) CREATE TABLE Orders ( order_id INTEGER, customer_id INTEGER, date_or...
Show the number of accounts for each customer in a bar chart grouping by customer's first name, and list names in asc order.
SELECT customer_first_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY customer_first_name
nvbench
CREATE TABLE table_51262 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
If north melbourne played as the home team, who was the away team they played?
SELECT "Away team" FROM table_51262 WHERE "Home team" = 'north melbourne'
wikisql
CREATE TABLE table_60464 ( "Golden Rivers" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
How many losses did the Golden rivers of hay have?
SELECT AVG("Losses") FROM table_60464 WHERE "Golden Rivers" = 'hay'
wikisql