context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_3 ( finished VARCHAR, trainer VARCHAR, horse VARCHAR )
What is the Finished place for da'tara trained by Nick zito?
SELECT finished FROM table_name_3 WHERE trainer = "nick zito" AND horse = "da'tara"
sql_create_context
CREATE TABLE table_name_62 ( visitor VARCHAR, date VARCHAR )
Who is the visitor on March 24?
SELECT visitor FROM table_name_62 WHERE date = "march 24"
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE faculty...
How many faculty members participate in an activity?
SELECT COUNT(DISTINCT facid) FROM faculty_participates_in
spider
CREATE TABLE table_78033 ( "Source" text, "Date" text, "Cardwell" text, "Jones" text, "Knight" text, "Lanier" text, "Martin" text )
What martin is on july 8 9, 2008?
SELECT "Martin" FROM table_78033 WHERE "Date" = 'july 8–9, 2008'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
give me the number of patients whose admission location is clinic referral/premature and primary disease is st elevated myocardial infarction\cardiac cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
mimicsql_data
CREATE TABLE table_24209 ( "Order" real, "Couple" text, "Karen" text, "Nicky" text, "Jason" text, "Ruthie" text, "Robin" text, "Total" text, "Scoreboard" text, "Song" text, "Public Vote %" text, "Result" text )
Name the nicky for ' take a chance on me ' abba
SELECT "Nicky" FROM table_24209 WHERE "Song" = ' Take a Chance on Me "– ABBA'
wikisql
CREATE TABLE table_name_97 ( total INTEGER, silver VARCHAR, gold VARCHAR )
What is the total medals for nation with more than 0 silvers and more than 0 golds?
SELECT AVG(total) FROM table_name_97 WHERE silver > 0 AND gold > 0
sql_create_context
CREATE TABLE table_203_529 ( id number, "fin" number, "st" number, "driver" text, "car #" number, "make" text, "points" number, "bonus" number, "laps" number, "winnings" text )
how many race car drivers out of the 43 listed drove toyotas ?
SELECT COUNT(*) FROM table_203_529 WHERE "make" = 'toyota'
squall
CREATE TABLE table_203_592 ( id number, "institution" text, "location" text, "athletic nickname" text, "undergraduate enrollment" number, "graduate enrollment" number, "total enrollment" number, "2013 endowment\n(and us rank)" text, "academic staff" number, "motto" text )
colombia has the highest graduate enrollment at 15,760 . what school has the next highest ?
SELECT "institution" FROM table_203_592 WHERE "graduate enrollment" < (SELECT "graduate enrollment" FROM table_203_592 WHERE "institution" = 'columbia university') ORDER BY "graduate enrollment" DESC LIMIT 1
squall
CREATE TABLE table_44906 ( "Year" real, "Coach" text, "Captain" text, "Club Champion" text, "Leading goalkicker" text, "Player's Player" text, "Iron Man Award" text, "Community Award" text, "Most Professional" text, "Most Improved" text, "NEAFL Player of the Year" text )
How many Years have an Iron Man Award of kyal horsley?
SELECT COUNT("Year") FROM table_44906 WHERE "Iron Man Award" = 'kyal horsley'
wikisql
CREATE TABLE table_2308381_1 ( avg_start VARCHAR, avg_finish VARCHAR )
Name the avg start for avg finish being 24.2
SELECT avg_start FROM table_2308381_1 WHERE avg_finish = "24.2"
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...
患者戚霞辉被开出的单价最高的药品有什么编码和名称及其单价在医院0335466中?
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '戚霞辉' AND t_kc22.t_kc21_MED_SER_ORG_NO = '0335466') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1
css
CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE ...
datasets used in papers written by oren etzioni ?
SELECT DISTINCT paperdataset.datasetid FROM author, paper, paperdataset, writes WHERE author.authorname = 'oren etzioni' AND paper.paperid = paperdataset.paperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid
scholar
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId n...
Test Query for RPG Contest. I'm running some test queries to ensure that the RPG contest proposal doesn't garner an empty set of winners.
SELECT UserId, Name, COUNT(*) FROM Badges WHERE Date BETWEEN '##StartDate##' AND '##EndDate##' AND Name IN ('Nice Answer', 'Nice Question') GROUP BY UserId, Name ORDER BY Name, COUNT(*) DESC
sede
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, give me the comparison about the average of code over the founder , and group by attribute founder by a bar chart, sort Y-axis in asc order please.
SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T1.Code
nvbench
CREATE TABLE table_66146 ( "Model number" text, "sSpec number" text, "Cores" text, "Frequency" text, "Turbo" text, "L2 cache" text, "L3 cache" text, "GPU model" text, "GPU frequency" text, "Socket" text, "I/O bus" text, "Release date" text, "Part number(s)" text, ...
What is the L3 cache of the processor with a release price of $440?
SELECT "L3 cache" FROM table_66146 WHERE "Release price ( USD )" = '$440'
wikisql
CREATE TABLE table_name_67 ( against INTEGER, draws VARCHAR, losses VARCHAR )
What shows for against when draws are 0, and losses are 16?
SELECT AVG(against) FROM table_name_67 WHERE draws = 0 AND losses = 16
sql_create_context
CREATE TABLE table_name_4 ( bronze INTEGER, nation VARCHAR, gold VARCHAR )
What is the highest number of bronze medals of west germany, which has more than 0 golds?
SELECT MAX(bronze) FROM table_name_4 WHERE nation = "west germany" AND gold > 0
sql_create_context
CREATE TABLE table_name_76 ( location VARCHAR, runner_s__up VARCHAR )
Where is runner-up Betsy Rawls from?
SELECT location FROM table_name_76 WHERE runner_s__up = "betsy rawls"
sql_create_context
CREATE TABLE table_203_183 ( id number, "season" text, "tier" number, "division" number, "place" text )
which season did they finish in the same place as the 1998-1999 season ?
SELECT "season" FROM table_203_183 WHERE "season" <> '1998/99' AND "place" = (SELECT "place" FROM table_203_183 WHERE "season" = '1998/99')
squall
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, visualize a bar chart about the distribution of name and the amount of name , and group by attribute name, and display in descending by the Y.
SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY COUNT(T2.Name) DESC
nvbench
CREATE TABLE table_32623 ( "Stage" text, "Date" text, "Route" text, "Terrain" text, "Length" text, "Winner" text )
Who won at stage 22?
SELECT "Winner" FROM table_32623 WHERE "Stage" = '22'
wikisql
CREATE TABLE table_11367 ( "Nat." text, "Name" text, "Since" real, "Goals" real, "Ends" real, "Transfer fee" text )
What is the total number of Since with a Goals larger than 6, and a Name with deco?
SELECT COUNT("Since") FROM table_11367 WHERE "Goals" > '6' AND "Name" = 'deco'
wikisql
CREATE TABLE table_31505 ( "Townland" text, "Area( acres )" real, "Barony" text, "Civil parish" text, "Poor law union" text )
How few acres is the area of Clashroe?
SELECT MIN("Area( acres )") FROM table_31505 WHERE "Townland" = 'Clashroe'
wikisql
CREATE TABLE table_name_5 ( population__1_july_2005_est_ INTEGER, population_density__per_km²_ VARCHAR )
What is the lowest Population (1 July 2005 est.), when Population density (per km ) is 0?
SELECT MIN(population__1_july_2005_est_) FROM table_name_5 WHERE population_density__per_km²_ = 0
sql_create_context
CREATE TABLE table_48192 ( "Player" text, "Nationality" text, "Jersey Number(s)" text, "Position" text, "Years" text, "From" text )
Who was the player from Duke?
SELECT "Position" FROM table_48192 WHERE "From" = 'duke'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
how many times do patient 006-195310 visit the hospital until 2104?
SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '006-195310' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104'
eicu
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit te...
what is the number of patients who had been admitted to the hospital this year?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_203_874 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
in what year was korzeniowski 's last competition ?
SELECT "year" FROM table_203_874 ORDER BY "year" DESC LIMIT 1
squall
CREATE TABLE table_name_19 ( venue VARCHAR, notes VARCHAR )
Which venue has 2:04.22 notes?
SELECT venue FROM table_name_19 WHERE notes = "2:04.22"
sql_create_context
CREATE TABLE table_19131921_1 ( dma INTEGER, format VARCHAR )
What is the dma when the format is rhythmic contemporary?
SELECT MIN(dma) FROM table_19131921_1 WHERE format = "Rhythmic Contemporary"
sql_create_context
CREATE TABLE table_64813 ( "Date" text, "Topic of the Show" text, "Song" text, "Original Artist" text, "Place/Percentage" text )
What song came out on March 8, 2008?
SELECT "Song" FROM table_64813 WHERE "Date" = 'march 8, 2008'
wikisql
CREATE TABLE table_21442 ( "1st throw" real, "2nd throw" real, "3rd throw" real, "Equation" text, "Result" real )
If the equation is 1 9 + 4 9 + 0, what is the 2nd throw?
SELECT "2nd throw" FROM table_21442 WHERE "Equation" = '1 × 9² + 4 × 9 + 0'
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...
provide the number of patients who were admitted before the year 2195 had 78659 as the diagnosis icd9 code.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2195" AND diagnoses.icd9_code = "78659"
mimicsql_data
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
what is the cheapest fare from WASHINGTON to SAN FRANCISCO leaving on 9 30
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, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C...
atis
CREATE TABLE table_203_382 ( id number, "date" text, "opponent" text, "site" text, "result" text )
what are the total number of games played in october ?
SELECT COUNT(*) FROM table_203_382 WHERE "date" = 10
squall
CREATE TABLE table_name_16 ( rank INTEGER, country VARCHAR )
What is the rank for the competitor from Bulgaria?
SELECT MIN(rank) FROM table_name_16 WHERE country = "bulgaria"
sql_create_context
CREATE TABLE table_name_53 ( winning_score VARCHAR, date VARCHAR )
What is Winning Score, when Date is Jul 27, 1997?
SELECT winning_score FROM table_name_53 WHERE date = "jul 27, 1997"
sql_create_context
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 demographic ( subject_id text, hadm_id t...
provide the number of patients whose marital status is married and item id is 51026?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.itemid = "51026"
mimicsql_data
CREATE TABLE Products_in_Events ( Product_in_Event_ID INTEGER, Event_ID INTEGER, Product_ID INTEGER ) CREATE TABLE Assets ( Asset_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Addresses ( Address_ID INTEGER, address_details VARCHAR(255) ) CREATE TABLE Channels ( Channel_ID INT...
Bar chart x axis product type code y axis the number of product type code, rank in descending by the Y-axis.
SELECT Product_Type_Code, COUNT(Product_Type_Code) FROM Products GROUP BY Product_Type_Code ORDER BY COUNT(Product_Type_Code) DESC
nvbench
CREATE TABLE table_6087 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the date of the home game for Hartford?
SELECT "Date" FROM table_6087 WHERE "Home" = 'hartford'
wikisql
CREATE TABLE table_1820752_1 ( hd_designation VARCHAR, arrival_date VARCHAR )
What is the hd designation for arrival date of February 2070?
SELECT COUNT(hd_designation) FROM table_1820752_1 WHERE arrival_date = "February 2070"
sql_create_context
CREATE TABLE branch ( name VARCHAR, membership_amount VARCHAR )
What are names for top three branches with most number of membership?
SELECT name FROM branch ORDER BY membership_amount DESC LIMIT 3
sql_create_context
CREATE TABLE table_11960407_4 ( high_rebounds VARCHAR, high_points VARCHAR )
Who had the high rebounds when Chris Bosh (16) had the high points?
SELECT high_rebounds FROM table_11960407_4 WHERE high_points = "Chris Bosh (16)"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id...
an AA flight FIRST class from PHILADELPHIA to DALLAS
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, fare, fare_basis, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.ci...
atis
CREATE TABLE table_name_23 ( against INTEGER, team VARCHAR, drawn VARCHAR, points VARCHAR )
Which average Against has Drawn of 3, and Points larger than 9, and a Team of portuguesa?
SELECT AVG(against) FROM table_name_23 WHERE drawn = 3 AND points > 9 AND team = "portuguesa"
sql_create_context
CREATE TABLE table_53976 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
What was the College of Player Perry Ellis?
SELECT "College" FROM table_53976 WHERE "Player" = 'perry ellis'
wikisql
CREATE TABLE table_45593 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the Home team on November 16, 1946?
SELECT "Home" FROM table_45593 WHERE "Date" = 'november 16, 1946'
wikisql
CREATE TABLE Movie ( director VARCHAR, title VARCHAR, mID VARCHAR ) CREATE TABLE Rating ( mID VARCHAR, stars VARCHAR )
What are the names of directors who directed movies with 5 star rating? Also return the title of these movies.
SELECT T1.director, T1.title FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars = 5
sql_create_context
CREATE TABLE table_name_53 ( country VARCHAR, operator VARCHAR, project_name VARCHAR )
What country did the project, Bonga SW; Aparo with a shell operator take place?
SELECT country FROM table_name_53 WHERE operator = "shell" AND project_name = "bonga sw; aparo"
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...
Give the number of patients who are younger than 51 years with a drug name colchicine.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "51" AND prescriptions.drug = "Colchicine"
mimicsql_data
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE regions ( REGION_...
For those employees who did not have any job in the past, show me about the change of manager_id over hire_date in a line chart.
SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_204_907 ( id number, "lift name" text, "type" text, "top\nelevation\n(ft)" number, "bottom\nelevation" number, "vertical\nrise" number, "length\n(ft)" number, "slope\n(%)" text, "capacity\n(rides/hr)" number, "speed\n(ft/min)" number, "lift\nmanufacturer" t...
the capacity of a timberline lodge lift is at most how many rides per hour ?
SELECT MAX("capacity\n(rides/hr)") FROM table_204_907
squall
CREATE TABLE table_22095 ( "District" text, "Vacator" text, "Reason for change" text, "Successor" text, "Date successor seated" text )
Name the vacator for tennessee 1st
SELECT "Vacator" FROM table_22095 WHERE "District" = 'Tennessee 1st'
wikisql
CREATE TABLE table_74949 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Which Silver is the lowest one that has a Gold larger than 0, and a Rank of total, and a Bronze smaller than 32?
SELECT MIN("Silver") FROM table_74949 WHERE "Gold" > '0' AND "Rank" = 'total' AND "Bronze" < '32'
wikisql
CREATE TABLE table_38017 ( "Pos." real, "Car #" real, "Driver" text, "Make" text, "Team" text )
What is Driver Brendan Gaughan's Pos?
SELECT "Pos." FROM table_38017 WHERE "Driver" = 'brendan gaughan'
wikisql
CREATE TABLE table_name_57 ( tournament VARCHAR, opponent VARCHAR )
What is the tournament with greg rusedski as the opponent?
SELECT tournament FROM table_name_57 WHERE opponent = "greg rusedski"
sql_create_context
CREATE TABLE table_66913 ( "Stage" text, "Winner" text, "General classification" text, "Points classification" text, "Mountains classification" text, "Intergiro classification" text, "Trofeo Fast Team" text )
Who was the winner from team Asics-c.g.a. and has a mountains classification of Mariano Piccoli?
SELECT "Winner" FROM table_66913 WHERE "Trofeo Fast Team" = 'asics-c.g.a.' AND "Mountains classification" = 'mariano piccoli'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Bar chart x axis meter 600 y axis id, order by the ID from high to low.
SELECT meter_600, ID FROM swimmer ORDER BY ID DESC
nvbench
CREATE TABLE table_13789248_2 ( points VARCHAR, artist VARCHAR )
what's the points with artbeingt being dave appell
SELECT points FROM table_13789248_2 WHERE artist = "Dave Appell"
sql_create_context
CREATE TABLE table_name_23 ( film VARCHAR, category VARCHAR, lost_to VARCHAR )
which Film has a Category of best actress musical or comedy, and a Lost to of nicole kidman ( moulin rouge! )?
SELECT film FROM table_name_23 WHERE category = "best actress – musical or comedy" AND lost_to = "nicole kidman ( moulin rouge! )"
sql_create_context
CREATE TABLE table_67581 ( "Nat." text, "Name" text, "Since" real, "Goals" real, "Ends" text, "Transfer fee" text )
Where is Rix from?
SELECT "Nat." FROM table_67581 WHERE "Name" = 'rix'
wikisql
CREATE TABLE people ( Hometown VARCHAR, People_ID VARCHAR ) CREATE TABLE gymnast ( Gymnast_ID VARCHAR )
List the distinct hometowns that are not associated with any gymnast.
SELECT DISTINCT Hometown FROM people EXCEPT SELECT DISTINCT T2.Hometown FROM gymnast AS T1 JOIN people AS T2 ON T1.Gymnast_ID = T2.People_ID
sql_create_context
CREATE TABLE table_53601 ( "Tournament" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Career Win\u2013Loss" text )
What is the 2009 value with a 2010 A value?
SELECT "2009" FROM table_53601 WHERE "2010" = 'a'
wikisql
CREATE TABLE table_23828 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in millions)" text )
Who is the director of the episode titled 'The Reunion Job'?
SELECT "Directed by" FROM table_23828 WHERE "Title" = 'The Reunion Job'
wikisql
CREATE TABLE table_29087004_3 ( written_by VARCHAR, directed_by VARCHAR, united_states_original_airdate VARCHAR )
Who were the writers of the episodes directed by Greg Sullivan and which first aired on July 21, 2012?
SELECT written_by FROM table_29087004_3 WHERE directed_by = "Greg Sullivan" AND united_states_original_airdate = "July 21, 2012"
sql_create_context
CREATE TABLE table_77905 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
What is the highest number of rounds for a 3:16 fight?
SELECT MAX("Round") FROM table_77905 WHERE "Time" = '3:16'
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 were admitted in hospital before the year 2198?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2198"
mimicsql_data
CREATE TABLE table_name_84 ( recorded VARCHAR, time VARCHAR, track VARCHAR, release_date VARCHAR )
Tell me the recorded for time of 2:50 and released date of 6/6/77 with track more than 20
SELECT recorded FROM table_name_84 WHERE track > 20 AND release_date = "6/6/77" AND time = "2:50"
sql_create_context
CREATE TABLE table_37275 ( "Date" text, "Episode" real, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text )
What is the average episode number where jimmy mulville was the 4th performer?
SELECT AVG("Episode") FROM table_37275 WHERE "Performer 4" = 'jimmy mulville'
wikisql
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE intakeoutput ( in...
was patient 002-76990 receiving in the last hospital visit any medication?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-76990' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient....
eicu
CREATE TABLE table_76453 ( "Season" real, "Season premiere" text, "Season finale" text, "TV season" text, "Ranking" text, "Households (in millions)" text )
Which TV season has a Season larger than 2, and a Ranking of #5?
SELECT "TV season" FROM table_76453 WHERE "Season" > '2' AND "Ranking" = '#5'
wikisql
CREATE TABLE table_train_210 ( "id" int, "serum_potassium" float, "serum_calcium" float, "estimated_glomerular_filtration_rate_egfr" int, "body_mass_index_bmi" float, "age" float, "NOUSE" float )
serum potassium < 3.5 mmol / l
SELECT * FROM table_train_210 WHERE serum_potassium < 3.5
criteria2sql
CREATE TABLE table_67169 ( "Pick #" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
What which player from Canada was picked #49 and plays left wing?
SELECT "Player" FROM table_67169 WHERE "Nationality" = 'canada' AND "Position" = 'left wing' AND "Pick #" = '49'
wikisql
CREATE TABLE table_train_121 ( "id" int, "depression" bool, "suicidality" bool, "neurodegenerative_disease" bool, "unstable_asthmatic_condition" bool, "vitamin_k_deficiency" bool, "renal_disease" bool, "cerebrovascular_disease" bool, "hepatic_disease" bool, "liver_disease" bool, ...
a current diagnosis of cardiac, renal or hepatic disease
SELECT * FROM table_train_121 WHERE cardiac_disease = 1 OR renal_disease = 1 OR hepatic_disease = 1
criteria2sql
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what is the difference between the weights second measured on the first hospital visit compared to the first value measured on the first hospital visit of patient 27739?
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 = 27739 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartev...
mimic_iii
CREATE TABLE table_name_87 ( software VARCHAR, latest_stable_date__version_ VARCHAR )
Name the software with the latest stable date of 0.6.1
SELECT software FROM table_name_87 WHERE latest_stable_date__version_ = "0.6.1"
sql_create_context
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text ) CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real )
Return a scatter chart about the correlation between Clean_Jerk and Total .
SELECT Clean_Jerk, Total FROM body_builder
nvbench
CREATE TABLE table_203_370 ( id number, "year" number, "competition" text, "venue" text, "position" text, "event" text, "notes" text )
how many times in total did ikangaa run the marathon in the olympic games ?
SELECT COUNT(*) FROM table_203_370 WHERE "competition" = 'olympic games'
squall
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 elective hospital admission patients have sarcoidosis diagnoses?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Sarcoidosis"
mimicsql_data
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) 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, H...
秦霞雰这个患者在02年6月24日到15年12月19期间买了多少次西药
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '秦霞雰' AND t_kc22.STA_DATE BETWEEN '2002-06-24' AND '2015-12-19' AND t_kc22.MED_INV_ITEM_TYPE = '西药费'
css
CREATE TABLE table_name_57 ( pastoral_region VARCHAR, cemeteries VARCHAR )
What Pastoral Region has 3 Cemeteries?
SELECT pastoral_region FROM table_name_57 WHERE cemeteries = 3
sql_create_context
CREATE TABLE table_62763 ( "School" text, "Location" text, "Mascot" text, "Enrollment 08-09" real, "IHSAA Class/ Football Class" text, "County" text, "Year Joined" real, "Previous Conference" text )
What School had 3a/2a as the value for IHSAA Class/ Football Class?
SELECT "School" FROM table_62763 WHERE "IHSAA Class/ Football Class" = '3a/2a'
wikisql
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE trip ( id INTEGER, d...
A bar chart for what are the number of the dates in which the mean sea level pressure was between 303 and 31?, and show Y-axis in descending order please.
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) DESC
nvbench
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) ...
what is the five year survival rate of pleural effusion patients diagnosed?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI...
eicu
CREATE TABLE table_80244 ( "Representative" text, "Title" text, "Presentation of Credentials" text, "Termination of Mission" text, "Appointed by" text )
Which representative has a Termination of MIssion date Mar 25, 1976?
SELECT "Representative" FROM table_80244 WHERE "Termination of Mission" = 'mar 25, 1976'
wikisql
CREATE TABLE race ( race_id number, name text, class text, date text, track_id text ) CREATE TABLE track ( track_id number, name text, location text, seating number, year_opened number )
What is the name of the track that has had the greatest number of races?
SELECT T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id GROUP BY T1.track_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_17798093_20 ( examples VARCHAR, american VARCHAR )
which examples are pronounced s in american
SELECT examples FROM table_17798093_20 WHERE american = "ɪs"
sql_create_context
CREATE TABLE table_18600760_18 ( land___sqmi__ VARCHAR, township VARCHAR )
What is the land area of Reed Township?
SELECT land___sqmi__ FROM table_18600760_18 WHERE township = "Reed"
sql_create_context
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...
按科室编码的不同和出院病名的不同计算一下医院3667285所有的记录里病人平均是多少岁
SELECT MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '3667285' GROUP BY MED_ORG_DEPT_CD, OUT_DIAG_DIS_NM
css
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
A bar chart shows the distribution of All_Road and ACC_Percent , display in ascending by the bar.
SELECT All_Road, ACC_Percent FROM basketball_match ORDER BY All_Road
nvbench
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,...
what is primary disease and diagnoses long title of subject name jane dillard?
SELECT demographic.diagnosis, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jane Dillard"
mimicsql_data
CREATE TABLE table_name_15 ( time_retired VARCHAR, grid VARCHAR )
What was the time of the driver on grid 3?
SELECT time_retired FROM table_name_15 WHERE grid = 3
sql_create_context
CREATE TABLE table_203_868 ( id number, "frequency band" text, "band number" number, "radio interface" text, "generation" text, "status" text, "notes" text )
what are the total number of times the status is listed as roaming ?
SELECT COUNT(*) FROM table_203_868 WHERE "status" = 'roaming'
squall
CREATE TABLE table_39467 ( "Name" text, "Status" text, "Population" real, "District" text, "Former local authority" text )
Who were the former local authority for the civil parish, Ennerdale and Kinniside in the copeland district, with less than 1,280 in population?
SELECT "Former local authority" FROM table_39467 WHERE "Status" = 'civil parish' AND "District" = 'copeland' AND "Population" < '1,280' AND "Name" = 'ennerdale and kinniside'
wikisql
CREATE TABLE table_name_9 ( away_team VARCHAR, home_team VARCHAR )
What was home team Essendon's opponents score?
SELECT away_team AS score FROM table_name_9 WHERE home_team = "essendon"
sql_create_context
CREATE TABLE table_54649 ( "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
what is the title of the episode with the production code of ad1a22?
SELECT "Title" FROM table_54649 WHERE "Production code" = 'ad1a22'
wikisql
CREATE TABLE table_47803 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
What is the total round when DB was the position, and the pick less than 21, and Jeff Welch as the name?
SELECT SUM("Round") FROM table_47803 WHERE "Position" = 'db' AND "Name" = 'jeff welch' AND "Pick" < '21'
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...
孙文敏病患从07年9月1日到2018年9月21日之间所有检测结果指标记录的检测员为编码02458651的检验指标流水号是多少?
SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz...
css
CREATE TABLE 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 jybgb ( BBCJBW text, BBDM tex...
在05年4月24日到11年1月23日的这几年里,共有多少新生儿的门诊就诊记录在5509091这个医疗机构
SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '5509091' AND wdmzjzjlb.JZKSRQ BETWEEN '2005-04-24' AND '2011-01-23' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '5509091' AND bdmzjzjlb.JZKSRQ BETWEEN '2005-04-24' AND '2011-01-23' AND bdmzjzjlb.ZSEBZ > 0
css