context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_74749 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away team when the game was at corio oval?
SELECT "Away team" FROM table_74749 WHERE "Venue" = 'corio oval'
wikisql
CREATE TABLE rating ( rid number, mid number, stars number, ratingdate time ) CREATE TABLE reviewer ( rid number, name text ) CREATE TABLE movie ( mid number, title text, year number, director text )
What is the lowest and highest rating star?
SELECT MAX(stars), MIN(stars) FROM rating
spider
CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(10), customer_code VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(25...
Compute the total maximal product price across product type code as a pie chart.
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code
nvbench
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airport ( airport_code varchar, ...
i'd like to fly from ATLANTA to DENVER on 8 29
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, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 29 AND date_day.month_number = 8 AND da...
atis
CREATE TABLE table_204_34 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what rank did the nation with the most total medals receive ?
SELECT "rank" FROM table_204_34 ORDER BY "total" DESC LIMIT 1
squall
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...
把2002年10月16日到2006年1月26日期间患者喻思聪主要患的是什么疾病查看一下
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '喻思聪' AND qtb.IN_HOSP_DATE BETWEEN '2002-10-16' AND '2006-01-26' GROUP BY qtb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '喻思聪' AND gyb.IN_HOSP_DATE BETWEEN '...
css
CREATE TABLE table_42096 ( "Outcome" text, "Date" real, "Championship" text, "Surface" text, "Opponent in the final" text, "Score in the final" text )
What Opponent in the final had a match with a Score in the final of 7 5, 6 2?
SELECT "Opponent in the final" FROM table_42096 WHERE "Score in the final" = '7–5, 6–2'
wikisql
CREATE TABLE table_16345 ( "League" text, "Sport" text, "Country" text, "Season" text, "Games" real, "Average attendance" real, "Total attendance" real )
What's the average attendance of the leagues in the season of 2013?
SELECT MIN("Average attendance") FROM table_16345 WHERE "Season" = '2013'
wikisql
CREATE TABLE table_71166 ( "School" text, "Grades" text, "Affiliation" text, "Student Body" text, "Enrollment" real )
Which Grades has an Enrollment larger htan 443 with a Student body of Co-ed?
SELECT "Grades" FROM table_71166 WHERE "Enrollment" > '443' AND "Student Body" = 'co-ed'
wikisql
CREATE TABLE table_8274 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text )
What was the name of the catalog released on 19 July 2008?
SELECT "Catalog" FROM table_8274 WHERE "Date" = '19 july 2008'
wikisql
CREATE TABLE table_204_668 ( id number, "#" number, "menteri besar" text, "took office" text, "left office" text, "party" text )
who was in office previous to abdullah jaafar ?
SELECT "menteri besar" FROM table_204_668 WHERE "took office" < (SELECT "took office" FROM table_204_668 WHERE "menteri besar" = 'abdullah jaafar') ORDER BY "took office" DESC LIMIT 1
squall
CREATE TABLE table_11576 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Who lost on July 20 with 42,607 attending?
SELECT "Loss" FROM table_11576 WHERE "Attendance" > '42,607' AND "Date" = 'july 20'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, C...
questions closed by mods vs community.
SELECT UserId, UserId AS "user_link", COUNT(PostId) FROM PostHistory WHERE PostHistoryTypeId = 10 GROUP BY UserId
sede
CREATE TABLE table_75607 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Save" text )
Name the date with loss of carman (3-12)
SELECT "Date" FROM table_75607 WHERE "Loss" = 'carman (3-12)'
wikisql
CREATE TABLE table_31543 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Tell me the position for pick of 47
SELECT "Position" FROM table_31543 WHERE "Pick" = '47'
wikisql
CREATE TABLE table_68114 ( "Player" text, "Overs" real, "Figures" text, "Opponent" text, "Ground" text )
Which player has figures of 4/14?
SELECT "Player" FROM table_68114 WHERE "Figures" = '4/14'
wikisql
CREATE TABLE table_76523 ( "Season" text, "Skip" text, "Third" text, "Second" text, "Lead" text )
Which Third has a Second of scott pfeifer?
SELECT "Third" FROM table_76523 WHERE "Second" = 'scott pfeifer'
wikisql
CREATE TABLE table_14108 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What is the total number of points of driver enrique bernoldi (r)?
SELECT COUNT("Points") FROM table_14108 WHERE "Driver" = 'enrique bernoldi (r)'
wikisql
CREATE TABLE table_name_85 ( grid INTEGER, laps INTEGER )
what is the lowest grid with laps larger than 23?
SELECT MIN(grid) FROM table_name_85 WHERE laps > 23
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( ...
tell me the total amount of urine that patient 002-74856 has on 09/03/2105.
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-74856')) AND intakeoutput.celllabel = 'urine...
eicu
CREATE TABLE table_21207 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Name the high assists for 70 game
SELECT "High assists" FROM table_21207 WHERE "Game" = '70'
wikisql
CREATE TABLE table_name_82 ( pole_position VARCHAR, race_name VARCHAR )
What pole position did 2006 gehl championship finale have?
SELECT pole_position FROM table_name_82 WHERE race_name = "2006 gehl championship finale"
sql_create_context
CREATE TABLE table_60637 ( "Order Year" text, "Builder" text, "Model" text, "Length (ft.)" text, "Engine/Transmission" text )
What builder has a 2001-02 order year?
SELECT "Builder" FROM table_60637 WHERE "Order Year" = '2001-02'
wikisql
CREATE TABLE table_name_26 ( date VARCHAR, home_team VARCHAR )
what is the date when the home team is st kilda?
SELECT date FROM table_name_26 WHERE home_team = "st kilda"
sql_create_context
CREATE TABLE table_69790 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What is the lowest decile with 1-6 years and area of Maitland?
SELECT MIN("Decile") FROM table_69790 WHERE "Years" = '1-6' AND "Area" = 'maitland'
wikisql
CREATE TABLE table_1615980_4 ( runner_s__up VARCHAR, tournament VARCHAR )
Who was the runner up at the Volvo Masters Andalucia?
SELECT runner_s__up FROM table_1615980_4 WHERE tournament = "Volvo Masters Andalucia"
sql_create_context
CREATE TABLE zyb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
这位花华彩患者过往都有过什么疾病吗?
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '花华彩' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '花华彩' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_NM = '花华彩' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG_DIS_NM FROM mz...
css
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
Create a bar chart showing how many allergytype across allergytype, and list in descending by the how many allergytype.
SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(AllergyType) DESC
nvbench
CREATE TABLE table_21902 ( "Year(s)" real, "Final television commentator" text, "Radio commentator" text, "Spokesperson" text, "Semi-final television commentator" text, "Semi-final second television commentator" text )
Who was the semi-final television commentator when the spokesperson was Colin Berry and the final television commentator was Pete Murray?
SELECT "Semi-final television commentator" FROM table_21902 WHERE "Spokesperson" = 'Colin Berry' AND "Final television commentator" = 'Pete Murray'
wikisql
CREATE TABLE table_name_79 ( time VARCHAR, athlete VARCHAR, rank VARCHAR, notes VARCHAR )
The Athlete Shin Yeong-eun with a rank larger than 3 and notes of FD had what time?
SELECT time FROM table_name_79 WHERE rank > 3 AND notes = "fd" AND athlete = "shin yeong-eun"
sql_create_context
CREATE TABLE table_10619 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did Hawthorn play an away game?
SELECT "Venue" FROM table_10619 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE icustays ( row_id number, subj...
what are the three most frequent drugs prescribed to the patients with the age of 60 or above during the same hospital encounter after they were diagnosed with alcoh dep nec/nos-contin?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id 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_...
mimic_iii
CREATE TABLE table_1566848_6 ( pictorials VARCHAR, date VARCHAR )
Name the number of pictorials for 5-85
SELECT COUNT(pictorials) FROM table_1566848_6 WHERE date = "5-85"
sql_create_context
CREATE TABLE table_2201724_2 ( outcome VARCHAR, championship VARCHAR )
How many different outcomes of the French Championships were there?
SELECT COUNT(outcome) FROM table_2201724_2 WHERE championship = "French championships"
sql_create_context
CREATE TABLE table_73734 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What was bruce baldwin's pick #?
SELECT "Pick #" FROM table_73734 WHERE "Player" = 'Bruce Baldwin'
wikisql
CREATE TABLE company ( Company_ID int, Rank int, Company text, Headquarters text, Main_Industry text, Sales_billion real, Profits_billion real, Assets_billion real, Market_Value real ) CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_N...
How many gas stations dors each manager have? Plot a bar chart, and sort from high to low by the y-axis.
SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY COUNT(Manager_Name) DESC
nvbench
CREATE TABLE table_12148147_2 ( third_year VARCHAR, first_year VARCHAR )
How many classes are taken in the third year when pag-unawa was taken in the first year?
SELECT COUNT(third_year) FROM table_12148147_2 WHERE first_year = "Pag-unawa"
sql_create_context
CREATE TABLE table_name_94 ( rank INTEGER, location VARCHAR )
What was the highest rink for Kingston?
SELECT MAX(rank) FROM table_name_94 WHERE location = "kingston"
sql_create_context
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationD...
Users with highest median answer score.
SELECT Users.Id, DisplayName, COUNT(Posts.Id) AS Questions, (SELECT MAX(Score) FROM (SELECT percent AS Score FROM Posts AS PU WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND PU.OwnerUserId = Users.Id ORDER BY Score LIMIT 50) AS t) AS MedianQuestionScore FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHER...
sede
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
Which 9 -credit Water Quality and Human the Great Lakes Basin classes are there ?
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Water Quality and Human the Great Lakes Basin%' OR name LIKE '%Water Quality and Human the Great Lakes Basin%') AND credits = 9
advising
CREATE TABLE table_33633 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" text )
Which stadium held the game that 65,677 people attended?
SELECT "Stadium" FROM table_33633 WHERE "Attendance" = '65,677'
wikisql
CREATE TABLE table_46403 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text, "Money ( $ )" text )
What is the To par when the score was 72-67-68-71=278?
SELECT "To par" FROM table_46403 WHERE "Score" = '72-67-68-71=278'
wikisql
CREATE TABLE table_name_97 ( gold INTEGER, silver VARCHAR, bronze VARCHAR, rank VARCHAR )
What is the lowest number of Gold, when the number of Bronze is less than 36, when the Rank is 2, and when Silver is less than 37?
SELECT MIN(gold) FROM table_name_97 WHERE bronze < 36 AND rank = "2" AND silver < 37
sql_create_context
CREATE TABLE table_11552751_2 ( total_number_of_ways VARCHAR )
When was the delevery date when there were 12 ways of delivery?
SELECT 1 AS st_ship_delivery_date FROM table_11552751_2 WHERE total_number_of_ways = "12 ways"
sql_create_context
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...
把开出药品的超限价自付金额高于1575.84元的所有药品列出来,就是19710178151的那次治疗就诊用到的药
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM 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 = '19710178151' AND t_kc22.OVE_SELF_AMO > 1575.84
css
CREATE TABLE table_45977 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
WHAT IS THE APPOINTMENT DATE FOR AC HORSENS?
SELECT "Date of appointment" FROM table_45977 WHERE "Team" = 'ac horsens'
wikisql
CREATE TABLE table_9482 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Ben Crenshaw has what To par?
SELECT "To par" FROM table_9482 WHERE "Player" = 'ben crenshaw'
wikisql
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
review stats for each review queue.
SELECT CASE ReviewTaskTypeId WHEN 1 THEN 'Suggested edits' WHEN 2 THEN 'Close Votes' WHEN 3 THEN 'Low Quality Posts' WHEN 4 THEN 'First Posts' WHEN 5 THEN 'Late Answers' WHEN 6 THEN 'Reopen Votes' WHEN 7 THEN 'Community Evaluation' WHEN 8 THEN 'Link Validation' WHEN 9 THEN 'Flagged Posts' WHEN 10 THEN 'Triage' WHEN 11 ...
sede
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, uniquepid text,...
had patient 013-23267 received a procedure of calcium channel blocker - diltiazem in 2105?
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-23267')) AND treatment.treatmentname = 'calcium channel blocker - diltia...
eicu
CREATE TABLE table_54 ( "Year" real, "Game or event" text, "Date contested" text, "League or governing body" text, "Sport" text, "Winning team" text, "Losing team" text, "Final score" text )
Which winning team beat the New York Yankees?
SELECT "Winning team" FROM table_54 WHERE "Losing team" = 'New York Yankees'
wikisql
CREATE TABLE table_name_71 ( receipts_per_arrival_2010__col_2___col_1____usd__ VARCHAR, selected_caribbean_and_n_latin_america_countries VARCHAR )
What is the number of recepits per arrival in 2010 (col 2)/(col 1) USD with colombia (1) as the selected carribean and latin american country?
SELECT receipts_per_arrival_2010__col_2___col_1____usd__ FROM table_name_71 WHERE selected_caribbean_and_n_latin_america_countries = "colombia (1)"
sql_create_context
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text )
Visualize the title and their average smallest ratings of the movie using a bar chart.
SELECT T2.title, AVG(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title
nvbench
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
What are some software courses that are easier than DHYGRACK 685 ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%software%' AND program_course.workload < (SELECT MIN(PROGRAM_COURSEalias...
advising
CREATE TABLE table_12919003_3 ( viewers_millions_ VARCHAR, episode VARCHAR )
How many millions of viewers did watch Episode 5?
SELECT viewers_millions_ FROM table_12919003_3 WHERE episode = "episode 5"
sql_create_context
CREATE TABLE table_80417 ( "Year" text, "Carries" real, "Rushing Yards" real, "Average" real, "Touchdowns" real, "Points" real )
How many carries have an average under 8.7 and touchdowns of 72?
SELECT COUNT("Carries") FROM table_80417 WHERE "Average" < '8.7' AND "Touchdowns" = '72'
wikisql
CREATE TABLE table_64169 ( "Medal" text, "Name" text, "Games" text, "Sport" text, "Event" text )
Which Medal has a Name of alex obeyesekera?
SELECT "Medal" FROM table_64169 WHERE "Name" = 'alex obeyesekera'
wikisql
CREATE TABLE table_24486462_1 ( disposable_usd_2011 INTEGER )
What is the lowest disposable USD 2011?
SELECT MIN(disposable_usd_2011) FROM table_24486462_1
sql_create_context
CREATE TABLE table_74867 ( "Team" text, "Class" text, "Chassis" text, "Engine" text, "Driver" text )
What type of engine does the BF Racing Marron Excavations have that also has Monaco as chassis and Lee Filliponi as the driver?
SELECT "Engine" FROM table_74867 WHERE "Team" = 'bf racing marron excavations' AND "Chassis" = 'monaco' AND "Driver" = 'lee filliponi'
wikisql
CREATE TABLE table_1197 ( "Series Ep." text, "Episode" real, "Netflix" text, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
Name the number of episodes for s hacksaw
SELECT COUNT("Episode") FROM table_1197 WHERE "Segment B" = 's Hacksaw'
wikisql
CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDisplayName text...
Percentage of the dupe questions by month. It counts also the deleted questions.
SELECT * FROM PostLinks WHERE PostId = 1066589
sede
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is drug type and drug route of drug name influenza virus vaccine?
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Influenza Virus Vaccine"
mimicsql_data
CREATE TABLE table_name_74 ( tournament VARCHAR, opponent VARCHAR )
Which tournament included an opponent of Marinko Matosevic?
SELECT tournament FROM table_name_74 WHERE opponent = "marinko matosevic"
sql_create_context
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE flight_fare ( flight_id int, f...
okay on tuesday june first i'd like to go from PHOENIX to DETROIT in the late afternoon
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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DETROIT' AND date_day.day_number = 22 AND date_day.month_number = 3 AND ...
atis
CREATE TABLE table_name_26 ( year VARCHAR, position VARCHAR, venue VARCHAR )
what is the year that the position was 1st in paris?
SELECT year FROM table_name_26 WHERE position = "1st" AND venue = "paris"
sql_create_context
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer...
what is the THRIFT flight fare from WASHINGTON to SAN FRANCISCO
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code ...
atis
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diag...
what are the weight changes in patient 15447's second measured on the current hospital visit compared to the first value measured on the current hospital 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 = 15447 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM...
mimic_iii
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE prescriptions ( ...
was the rocuronium prescribed to patient 69895 during their first hospital visit?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 69895 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'rocuronium'
mimic_iii
CREATE TABLE table_name_31 ( start VARCHAR, rank VARCHAR )
What is the start value for rank 11?
SELECT start FROM table_name_31 WHERE rank = "11"
sql_create_context
CREATE TABLE table_64664 ( "Episode" text, "Date" text, "Time" text, "Network" text, "Length" text )
What date did episode one air on?
SELECT "Date" FROM table_64664 WHERE "Episode" = 'one'
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...
范璇子患者曾经得过的病有什么
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '范璇子' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '范璇子' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_NM = '范璇子' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG_DIS_NM FROM mz...
css
CREATE TABLE table_66279 ( "Elector" text, "Nationality" text, "Cardinalatial order and title" text, "Elevated" text, "Elevator" text )
What is the cardinalatial order of the elector elevated circa 1116?
SELECT "Cardinalatial order and title" FROM table_66279 WHERE "Elevated" = 'circa 1116'
wikisql
CREATE TABLE table_name_80 ( date VARCHAR, opponent VARCHAR )
When did the Browns play the Pittsburgh Steelers?
SELECT date FROM table_name_80 WHERE opponent = "pittsburgh steelers"
sql_create_context
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...
来医院2171159就诊的医疗记录中显示入院时诊断为D38.070的最低和最高医疗费用总额是多少?
SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2171159' AND gwyjzb.IN_DIAG_DIS_CD = 'D38.070' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2171159' AND fgwyjzb.IN_DIA...
css
CREATE TABLE table_203_213 ( id number, "name" text, "builder" text, "type" text, "date" text, "works number" number, "notes" text )
what was the last locomotive ?
SELECT "name" FROM table_203_213 ORDER BY "date" DESC LIMIT 1
squall
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...
出院时诊断的疾病编号及名称,在医疗就诊78262122998中是什么?
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '78262122998' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '78262122998' UNION SELECT zyb.OUT_DIAG_DIS_CD, zyb.OUT_DIAG_DIS_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '78262122998' UNION SELECT mzb....
css
CREATE TABLE table_60326 ( "Location" text, "Year" real, "Champion" text, "Runner-up" text, "Score" text )
Which Location has a Year larger than 2006, and a Score of 6 3, 6 3?
SELECT "Location" FROM table_60326 WHERE "Year" > '2006' AND "Score" = '6–3, 6–3'
wikisql
CREATE TABLE table_62846 ( "Peak" text, "Country" text, "Elevation (m)" real, "Prominence (m)" real, "Col (m)" real )
Which Prominence (m) has a Col (m) of 350?
SELECT AVG("Prominence (m)") FROM table_62846 WHERE "Col (m)" = '350'
wikisql
CREATE TABLE table_51542 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Event" text )
In which event did he place 6th in 1971?
SELECT "Event" FROM table_51542 WHERE "Year" = '1971' AND "Result" = '6th'
wikisql
CREATE TABLE diagnoses ( 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, ...
show me the number of patients who had elective hospital admission and were born before 2052.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.dob_year < "2052"
mimicsql_data
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
provide the number of patients whose ethnicity is hispanic or latino and year of birth is less than 2109?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND demographic.dob_year < "2109"
mimicsql_data
CREATE TABLE table_name_21 ( lane INTEGER, mark VARCHAR )
What is the lowest Lane, when Mark is 7.66?
SELECT MIN(lane) FROM table_name_21 WHERE mark = "7.66"
sql_create_context
CREATE TABLE table_name_64 ( lost VARCHAR, _percentage_won VARCHAR )
Name the lost for % won of 55.37
SELECT lost FROM table_name_64 WHERE _percentage_won = "55.37"
sql_create_context
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the sum of employee_id , and group by attribute job_id, list Y from high to low order please.
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC
nvbench
CREATE TABLE table_1539201_1 ( february VARCHAR )
Name all of the february
SELECT february FROM table_1539201_1
sql_create_context
CREATE TABLE table_11222 ( "Name" text, "Area (km 2 )" real, "Population Estimate 2005" real, "Population Census 2010" real, "Capital" text )
how many population estimate 2005 are for majene?
SELECT COUNT("Population Estimate 2005") FROM table_11222 WHERE "Capital" = 'majene'
wikisql
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...
在那些和检验指标记录47193236499有着相同的检测指标名称以及检测指标结果定量单位的记录中,存在哪些检测指标结果定量是小于或等于这个的检验指标记录呢?
SELECT * FROM jyjgzbb WHERE jyjgzbb.JCZBMC = (SELECT jyjgzbb.JCZBMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '47193236499') AND jyjgzbb.JCZBJGDW = (SELECT jyjgzbb.JCZBJGDW FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '47193236499') AND jyjgzbb.JCZBJGDL <= (SELECT jyjgzbb.JCZBJGDL FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '47193236499')
css
CREATE TABLE table_name_59 ( year INTEGER, studio_s_ VARCHAR )
What is Year is Walt Disney Pictures Imagemovers Digital?
SELECT SUM(year) FROM table_name_59 WHERE studio_s_ = "walt disney pictures imagemovers digital"
sql_create_context
CREATE TABLE table_77800 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the grid total for ralf schumacher racing over 53 laps?
SELECT SUM("Grid") FROM table_77800 WHERE "Driver" = 'ralf schumacher' AND "Laps" > '53'
wikisql
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
give me the number of patients whose language is russ and discharge location is long term care hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "RUSS" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
mimicsql_data
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE ta ( campus_job_id int, student_id int...
What is on offer in the way of hardware courses for Spring and Summer of 2019 ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%hardw...
advising
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE airport_servic...
i'm sorry i want to book a flight from ATLANTA to DENVER colorado
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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER...
atis
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
统计年龄不高于6岁的患者医疗记录的平均医疗费总额是多少?
SELECT AVG(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_AGE <= 6)
css
CREATE TABLE table_25518547_4 ( position VARCHAR, pick__number VARCHAR )
What is the position of pick # 63?
SELECT position FROM table_25518547_4 WHERE pick__number = 63
sql_create_context
CREATE TABLE table_86 ( "Country" text, "Players" real, "Standard" real, "Minor" real, "First title" real, "Last title" real )
What's the smallest number of players?
SELECT MIN("Players") FROM table_86
wikisql
CREATE TABLE table_35728 ( "Year" real, "Record" text, "Seed" text, "Region" text, "Results" text )
What Results has a Seed #12 and a Year that's smaller than 1996
SELECT "Results" FROM table_35728 WHERE "Seed" = '#12' AND "Year" < '1996'
wikisql
CREATE TABLE table_name_90 ( year VARCHAR, entrant VARCHAR, points VARCHAR )
What number of years did the red bull sauber petronas have greater than 6 points?
SELECT COUNT(year) FROM table_name_90 WHERE entrant = "red bull sauber petronas" AND points > 6
sql_create_context
CREATE TABLE table_55010 ( "Date" text, "Ship" text, "Type" text, "Nationality" text, "Tonnage GRT" real )
What is the total Tonnage GRT with a Type of cargo ship, and a Nationality of norway?
SELECT SUM("Tonnage GRT") FROM table_55010 WHERE "Type" = 'cargo ship' AND "Nationality" = 'norway'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the average of code , and group by attribute founder, could you rank from high to low by the Founder?
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC
nvbench
CREATE TABLE table_203_157 ( id number, "year" number, "film" text, "role" text, "language" text, "notes" text )
what is the number of films where the language was hindi ?
SELECT COUNT("film") FROM table_203_157 WHERE "language" = 'hindi'
squall
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...
how many patients whose age is less than 45 and drug route is ih?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "45" AND prescriptions.route = "IH"
mimicsql_data