context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_58797 ( "Name" text, "Position" text, "League Apps" text, "League Goals" real, "FA Cup Apps" text, "FA Cup Goals" real, "League Cup Apps" text, "League Cup Goals" real, "Total Apps" text, "Total Goals" real )
What is the lowest league goals that have 0 as the FA Cup Apps, with 1 (3) as totals apps?
SELECT MIN("League Goals") FROM table_58797 WHERE "FA Cup Apps" = '0' AND "Total Apps" = '1 (3)'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what were the four most common prescription drugs for patients who had been diagnosed with septic shock previously within 2 months, since 2105?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'septic shock' AND STRFTIME('%y', diagnosis.diagnos...
eicu
CREATE TABLE table_33740 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team's score when hawthorn is away?
SELECT "Away team score" FROM table_33740 WHERE "Away team" = 'hawthorn'
wikisql
CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE equipment_sequence ( aircraft_code_sequence...
show me all the flights from DENVER and all the flights from MIAMI that arrive at BALTIMORE around noon
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.arrival_time <= 1230 AND flight.arrival_time >= 1130) AND CITY_2.city_code = AIRPORT_SERVICE_2.cit...
atis
CREATE TABLE table_520 ( "Frame size" text, "Width" real, "Height" real, "Mpix" text, "Aspect Ratio" text, "Maximum fps" real, "Maximum fps HDRx" real, "least compression at 24 fps" text, "least compression at maximum fps" text )
What size is a 30 frames per minute
SELECT "Frame size" FROM table_520 WHERE "Maximum fps" = '30'
wikisql
CREATE TABLE table_24535 ( "No. in total" text, "No. in series" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
How many number in series's are written by Greg Haddrick?
SELECT COUNT("No. in series") FROM table_24535 WHERE "Written by" = 'Greg Haddrick'
wikisql
CREATE TABLE table_53015 ( "Member" text, "Party" text, "Electorate" text, "State" text, "First elected" text )
Which first election for the labor party is James Sharpe a part of?
SELECT "First elected" FROM table_53015 WHERE "Party" = 'labor' AND "Member" = 'james sharpe'
wikisql
CREATE TABLE category ( id int, business_id varchar, category_name varchar ) CREATE TABLE checkin ( cid int, business_id varchar, count int, day varchar ) CREATE TABLE review ( rid int, business_id varchar, user_id varchar, rating float, text longtext, year int, ...
How many Egyptian restaurant are there in Edinburgh ?
SELECT COUNT(DISTINCT (business.name)) FROM business, category AS CATEGORY_0, category AS CATEGORY_1 WHERE business.city = 'Edinburgh' AND CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'restaurant' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'Egyptian'
yelp
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE T...
For all employees in the same department as Clara excluding Clara, bin their hire date into the day of week interval, and count how many employees in each month for a bar chart, and rank total number in ascending order.
SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE DEPARTMENT_ID = (SELECT DEPARTMENT_ID FROM employees WHERE FIRST_NAME = "Clara") AND FIRST_NAME <> "Clara" ORDER BY COUNT(HIRE_DATE)
nvbench
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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ...
count the number of patients who are dead after being diagnosed with fx orbital floor-closed in the same month since 2102.
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di...
mimic_iii
CREATE TABLE table_42082 ( "Team" text, "Tries for" real, "Tries against" real, "Try diff" text, "Points for" real, "Points against" real, "Points diff" text )
How many Tries against has a Try diff of 17 and Points for smaller than 80?
SELECT COUNT("Tries against") FROM table_42082 WHERE "Try diff" = '–17' AND "Points for" < '80'
wikisql
CREATE TABLE table_name_88 ( touchdowns INTEGER, player VARCHAR, field_goals VARCHAR )
What is the smallest amount of touchdowns when there is a total player and a number of field goals of more than 0?
SELECT MIN(touchdowns) FROM table_name_88 WHERE player = "total" AND field_goals > 0
sql_create_context
CREATE TABLE table_name_45 ( draws VARCHAR, goal_difference VARCHAR, goals_for VARCHAR, losses VARCHAR )
Name the total number of Draws when goals for is 58 and losses is 12 when goal differences is less than 21
SELECT COUNT(draws) FROM table_name_45 WHERE goals_for = 58 AND losses = 12 AND goal_difference < 21
sql_create_context
CREATE TABLE table_name_84 ( tied VARCHAR )
What venue had a tie?
SELECT tied FROM table_name_84 WHERE "venue" = "venue"
sql_create_context
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...
Getting all users from Cuba.
SELECT Reputation, DisplayName, Location FROM Users ORDER BY Reputation DESC
sede
CREATE TABLE table_34978 ( "Player" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
What's the number of touchdowns that Snow made that had 0 field goals, more than 5 points, and more than 0 extra points?
SELECT MIN("Touchdowns") FROM table_34978 WHERE "Points" > '5' AND "Field goals" = '0' AND "Player" = 'snow' AND "Extra points" > '0'
wikisql
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
EECS students take what Other classes ?
SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%Other%' AND program_course.course_id = course.course_id
advising
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_req...
show me flights from DENVER to BOSTON on tuesday
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 = 'BOSTON' AND date_day.day_number = 22 AND date_day.month_number = 3 AND da...
atis
CREATE TABLE Staff_Department_Assignments ( staff_id INTEGER, department_id INTEGER, date_assigned_from DATETIME, job_title_code VARCHAR(10), date_assigned_to DATETIME ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Department_Sto...
What are the names and ids of customers whose address contains TN. Visualize by pie chart.
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%"
nvbench
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 whose admission location is emergency room admit and procedure short title is opn lft hemicolectmy nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND procedures.short_title = "Opn lft hemicolectmy NEC"
mimicsql_data
CREATE TABLE table_name_54 ( swimsuit VARCHAR, average VARCHAR, interview VARCHAR, evening_gown VARCHAR )
Name the total number of swimsuits for evening gowns less than 8.21 and average of 8.453 with interview less than 9.09
SELECT COUNT(swimsuit) FROM table_name_54 WHERE interview < 9.09 AND evening_gown < 8.21 AND average = 8.453
sql_create_context
CREATE TABLE table_37269 ( "Year" real, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text, "Mixed doubles" text )
what game had a doubles round in 1979
SELECT "Mixed doubles" FROM table_37269 WHERE "Year" = '1979'
wikisql
CREATE TABLE table_name_78 ( laps INTEGER, time_retired VARCHAR )
What is the average number of laps associated with a Time/Retired of +1:14.801?
SELECT AVG(laps) FROM table_name_78 WHERE time_retired = "+1:14.801"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(4...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the last_name , I want to show names in asc order.
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME
nvbench
CREATE TABLE train ( name VARCHAR, TIME VARCHAR, service VARCHAR )
Show the name, time, and service for all trains.
SELECT name, TIME, service FROM train
sql_create_context
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, ...
give me the number of patients whose admission year is less than 2124 and drug route is iv bolus?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2124" AND prescriptions.route = "IV BOLUS"
mimicsql_data
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Give me the comparison about ACC_Percent over the All_Neutral , and rank by the total number in desc.
SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC
nvbench
CREATE TABLE table_28540609_2 ( cuts_made VARCHAR, player VARCHAR )
How many cuts did Gary Clark make?
SELECT cuts_made FROM table_28540609_2 WHERE player = "Gary Clark"
sql_create_context
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
what was the organism found in the last bronchoalveolar lavage test of patient 97395 in this month?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97395) AND microbiologyevents.spec_type_desc = 'bronchoalveolar lavage' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.char...
mimic_iii
CREATE TABLE table_25534 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
If the original air date is February 4, 2003, what is the episode title?
SELECT "Title" FROM table_25534 WHERE "Original air date" = 'February 4, 2003'
wikisql
CREATE TABLE table_57357 ( "Player" text, "Car." real, "Yards" text, "Avg." text, "TD's" real, "Long" text )
Tell me the long for TD's of 4
SELECT "Long" FROM table_57357 WHERE "TD's" = '4'
wikisql
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE cite ( citingpaperid int, citedpape...
how many parsing papers did ACL 2014 have ?
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL'
scholar
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE SuggestedEdits ( Id n...
Questions bookmarked or commented on by user.
SELECT q.Id AS "post_link", q.CreationDate, q.Score, q.Tags, b.CreationDate AS "Bookmark date", c.CreationDate AS "Comment date", c.Id AS "comment_link" FROM Posts AS q LEFT OUTER JOIN Votes AS b ON q.Id = b.PostId AND b.VoteTypeId = 5 AND b.UserId = '##UserId:int##' LEFT JOIN LATERAL (SELECT Id, CreationDate FROM Comm...
sede
CREATE TABLE table_10953197_6 ( no_in_season INTEGER, director VARCHAR, production_code VARCHAR )
what is season 6 sum of both the number of times processing ID 2397162 was assigned and the number of times chip chalmers managed an episode
SELECT MAX(no_in_season) FROM table_10953197_6 WHERE director = "Chip Chalmers" AND production_code = "2397162"
sql_create_context
CREATE TABLE table_name_35 ( company VARCHAR, country VARCHAR, business VARCHAR, date VARCHAR )
In the United Kingdom, what company has an unknown date and is an energy business?
SELECT company FROM table_name_35 WHERE business = "energy" AND date = "unknown" AND country = "united kingdom"
sql_create_context
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...
List of edits where edit summary contains given keyword.
SELECT PostId AS "post_link", Comment, UserId AS "user_link", CreationDate FROM PostHistory WHERE UserId = '##userid##' AND Comment LIKE '%##keyword##%' ORDER BY CreationDate
sede
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id num...
how many patients underwent coronar arteriogr-2 cath after having been diagnosed with long-term use anticoagul within the same month?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'long-term use anti...
mimic_iii
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
when patient 017-24595 was first discharged from the hospital?
SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '017-24595' ORDER BY patient.hospitaldischargetime LIMIT 1
eicu
CREATE TABLE table_13301516_1 ( directed_by VARCHAR, original_air_date VARCHAR )
Who directed the episode that originally aired on January 15, 2008?
SELECT directed_by FROM table_13301516_1 WHERE original_air_date = "January 15, 2008"
sql_create_context
CREATE TABLE table_7650 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of Silver with a Bronze that is larger than 0 with a Gold smaller than 0?
SELECT SUM("Silver") FROM table_7650 WHERE "Bronze" > '0' AND "Gold" < '0'
wikisql
CREATE TABLE table_22746 ( "Player" text, "Original Season" text, "Gender" text, "Eliminated" text, "Placing" text )
Who was the female contestant on the Original season of Fresh Meat?
SELECT "Player" FROM table_22746 WHERE "Original Season" = 'Fresh Meat' AND "Gender" = 'Female'
wikisql
CREATE TABLE table_41257 ( "Administrative Panel" real, "Agricultural Panel" real, "Cultural and Educational Panel" real, "Industrial and Commercial Panel" real, "Labour Panel" real, "National University of Ireland" real, "University of Dublin" real, "Nominated by the Taoiseach" real, ...
What is the number for the University of Dublin with their Cultural and Educational Panel of 5, and an Industrial and Commercial Panel with less than 9?
SELECT COUNT("University of Dublin") FROM table_41257 WHERE "Cultural and Educational Panel" = '5' AND "Industrial and Commercial Panel" < '9'
wikisql
CREATE TABLE table_2528382_5 ( singers VARCHAR, Co VARCHAR, co_stars VARCHAR )
How many co-singers were there when Parveen Babi co-starred?
SELECT COUNT(Co) - singers FROM table_2528382_5 WHERE co_stars = "Parveen Babi"
sql_create_context
CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Description VARCHAR(255) ) CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME ) CREATE TABLE...
Show the number of documents in different ending date Bin ending date by year interval and group by location code with a group line chart, I want to display by the Date_in_Locaton_To from high to low.
SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations GROUP BY Location_Code ORDER BY Date_in_Locaton_To DESC
nvbench
CREATE TABLE table_204_302 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what is the total number of nations that did not win gold ?
SELECT COUNT("nation") FROM table_204_302 WHERE "gold" = 0
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...
count the number of patients whose procedure icd9 code is 8968 and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "8968" AND prescriptions.drug_type = "ADDITIVE"
mimicsql_data
CREATE TABLE table_18738 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What was the net seat gain in the race john a. elston (r) 88.4% luella twining (s) 11.6%?
SELECT "Result" FROM table_18738 WHERE "Candidates" = 'John A. Elston (R) 88.4% Luella Twining (S) 11.6%'
wikisql
CREATE TABLE table_26365 ( "Team" text, "City/Area" text, "Arena" text, "Founded" real, "Joined" real, "Head Coach" text, "Captain" text )
Who is the head coach for the team that plays at Altrincham Ice Dome?
SELECT "Head Coach" FROM table_26365 WHERE "Arena" = 'Altrincham Ice Dome'
wikisql
CREATE TABLE table_204_17 ( id number, "region" text, "date" text, "format" text, "version(s)" text, "label" text )
which region appears more on this list , france or united states ?
SELECT "region" FROM table_204_17 WHERE "region" IN ('france', 'united states') GROUP BY "region" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREAT...
what did patient 021-93953 first have as an output on the last intensive care unit visit?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-93953') AND NOT patient.unitdischargetime IS NULL ORDER ...
eicu
CREATE TABLE table_52540 ( "Rider" text, "Horse" text, "Faults" text, "Round 1 + 2A + 2B + 3A Points" text, "Total" real )
What was the total for christina liebherr?
SELECT MIN("Total") FROM table_52540 WHERE "Rider" = 'christina liebherr'
wikisql
CREATE TABLE table_73947 ( "Rank" real, "Couple" text, "Judges" real, "Public" real, "Total" real, "Vote percentage" text, "Result" text )
How many judges were there for the eliminated couple?
SELECT "Judges" FROM table_73947 WHERE "Result" = 'Eliminated'
wikisql
CREATE TABLE table_5080 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
Which Wins have a Rank of 3?
SELECT AVG("Wins") FROM table_5080 WHERE "Rank" = '3'
wikisql
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, ...
what airlines go to PITTSBURGH
SELECT DISTINCT airline.airline_code FROM airline, airport_service, city, flight WHERE city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.airline_code = airline.airline_code AND flight.from_airport = airport_service.airport_code
atis
CREATE TABLE table_69182 ( "Date" text, "Opponent" text, "Result" text, "Game Site" text, "Attendance" text )
How many people were in attendance on the game on April 8, 2007?
SELECT "Attendance" FROM table_69182 WHERE "Date" = 'april 8, 2007'
wikisql
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
when was the first time that patient 002-64535 was prescribed with potassium chloride and aspirin at the same time since 09/2105?
SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'potassium chloride' AND patient.uniquepid = '002-64535' AND STRFTIME('%y-%m', medication.drugstarttime) >= '2105-09') AS ...
eicu
CREATE TABLE table_name_85 ( runner_up VARCHAR, tier VARCHAR, winner VARCHAR )
When Gigi Fern ndez Natalia Zvereva 6 2, 6 1 won, who was the Tier II Runner-up?
SELECT runner_up FROM table_name_85 WHERE tier = "tier ii" AND winner = "gigi fernández natalia zvereva 6–2, 6–1"
sql_create_context
CREATE TABLE table_name_19 ( gold INTEGER, total VARCHAR, bronze VARCHAR )
What is the gold number when the total is 8 and bronze is more than 4?
SELECT AVG(gold) FROM table_name_19 WHERE total = 8 AND bronze > 4
sql_create_context
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
Compare the number of items in each color scheme using a bar chart, and sort Y in desc order.
SELECT color, COUNT(color) FROM photos GROUP BY color ORDER BY COUNT(color) DESC
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( ...
what is the minimum cost of hospital that involves a procedure called ins drug-elut coronry st last year?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ins drug-elut coronry st')) AND DATETIME(cost.chargetime,...
mimic_iii
CREATE TABLE table_79303 ( "Rank" real, "Lane" real, "Athlete" text, "Nationality" text, "Time" real, "React" real )
How many total Time listings have a 0.209 React entry and a Rank that is greater than 7?
SELECT COUNT("Time") FROM table_79303 WHERE "React" = '0.209' AND "Rank" > '7'
wikisql
CREATE TABLE invoice_line_items ( order_item_id number, invoice_number number, product_id number, product_title text, product_quantity text, product_price number, derived_product_cost number, derived_vat_payable number, derived_total_cost number ) CREATE TABLE financial_transactions...
What is the invoice number and invoice date corresponding to the invoice with the greatest number of transactions?
SELECT T2.invoice_number, T2.invoice_date FROM financial_transactions AS T1 JOIN invoices AS T2 ON T1.invoice_number = T2.invoice_number GROUP BY T1.invoice_number ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_name_62 ( safari VARCHAR, firefox VARCHAR )
What percentage of browsers were using Safari during the period in which 31.27% were using Firefox?
SELECT safari FROM table_name_62 WHERE firefox = "31.27%"
sql_create_context
CREATE TABLE table_36245 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text )
What was the result for Julius Kahn's first election of 1898?
SELECT "Result" FROM table_36245 WHERE "First elected" = '1898' AND "Incumbent" = 'julius kahn'
wikisql
CREATE TABLE table_name_30 ( airport VARCHAR, country VARCHAR, iata VARCHAR )
What is the name of the airport located in Russia with an IATA of KRR?
SELECT airport FROM table_name_30 WHERE country = "russia" AND iata = "krr"
sql_create_context
CREATE TABLE journal ( journalid int, journalname varchar ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) C...
most recent papers of ali farhadi
SELECT DISTINCT paper.paperid, paper.year FROM author, paper, writes WHERE author.authorname = 'ali farhadi' AND paper.year = (SELECT MIN(PAPERalias1.year) FROM author AS AUTHORalias1, paper AS PAPERalias1, writes AS WRITESalias1 WHERE AUTHORalias1.authorname = 'ali farhadi' AND WRITESalias1.authorid = AUTHORalias1.aut...
scholar
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
when was the last time patient 4718 was having greater than 90.0 heart rate until 770 days ago?
SELECT chartevents.charttime 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 = 4718)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat...
mimic_iii
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...
在2002年6月28日至2012年4月6日内柏安民患者医保的统筹基金支出总共有多少钱?
SELECT SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '柏安民' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-06-28' AND '2012-04-06'
css
CREATE TABLE Customers ( customer_id INTEGER, payment_method VARCHAR(15), customer_name VARCHAR(80), date_became_customer DATETIME, other_customer_details VARCHAR(255) ) CREATE TABLE Products ( product_id INTEGER, product_details VARCHAR(255) ) CREATE TABLE Customer_Addresses ( custome...
A bar chart for finding the number of the 'date became customers' of the customers whose ID is between 10 and 20, and I want to show by the y axis in descending.
SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 ORDER BY COUNT(date_became_customer) DESC
nvbench
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_re...
which DL flights depart from SAN FRANCISCO heading toward BOSTON after 1200
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 1200 AND flight.to_airport = AIRPORT_SERVICE_1.airpo...
atis
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, ...
when was the last time that patient 8016 had pe 24 fs po intake on last month/27?
SELECT inputevents_cv.charttime FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8016)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label ...
mimic_iii
CREATE TABLE table_name_11 ( years_for_grizzlies VARCHAR, school_club_team VARCHAR )
for how many years did the player who graduated from stanford play for Grizzlies?
SELECT years_for_grizzlies FROM table_name_11 WHERE school_club_team = "stanford"
sql_create_context
CREATE TABLE table_name_46 ( guests INTEGER, ship_name VARCHAR, year_built VARCHAR )
What is the number of guests for the Viking Ingvar, built earlier than 1990?
SELECT AVG(guests) FROM table_name_46 WHERE ship_name = "viking ingvar" AND year_built < 1990
sql_create_context
CREATE TABLE table_31419 ( "Official name" text, "INE code" real, "Name in Spanish" text, "Name in Basque" text, "Population (2007)" real )
What is the official name of the municipality whose name in Spanish is Vitoria?
SELECT "Official name" FROM table_31419 WHERE "Name in Spanish" = 'Vitoria'
wikisql
CREATE TABLE table_30177 ( "Proceed to Quarter-final" text, "Match points" text, "Aggregate score" text, "Points margin" real, "Eliminated from competition" text )
When brive is the proceed to quarter final how many were eliminated from competition?
SELECT COUNT("Eliminated from competition") FROM table_30177 WHERE "Proceed to Quarter-final" = 'Brive'
wikisql
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Who else has commented on the same posts?.
SELECT u.Id AS "Other User ID", u.DisplayName AS "Name", u.Reputation AS "Reputation", co.CreationDate AS "Comment Date", p.Id AS "Answer ID", pp.Id AS "Question ID", pp.Title AS "Title" FROM Posts AS p JOIN Posts AS pp ON pp.Id = p.ParentId JOIN Comments AS c ON c.PostId = p.Id JOIN Comments AS co ON co.PostId = p.Id ...
sede
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE writes ( paperid int, authorid int ) CREATE TABLE ...
What is the latest Semantic Parsing paper from Nabil Aouf 's group ?
SELECT DISTINCT paper.year, writes.paperid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE author.authorname = 'Nabil Aouf' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.paperid = paperkeyphrase.paperid AND writes.paperid = paper.paperid O...
scholar
CREATE TABLE table_name_48 ( player VARCHAR, pick VARCHAR )
Which player's pick is 160?
SELECT player FROM table_name_48 WHERE pick = 160
sql_create_context
CREATE TABLE table_204_723 ( id number, "year" number, "film" text, "role" text, "notes" text )
which other 1986 film came after love 86 ?
SELECT "film" FROM table_204_723 WHERE id = (SELECT id FROM table_204_723 WHERE "film" = 'love 86') + 1
squall
CREATE TABLE table_name_2 ( fastest_laps INTEGER, seasons VARCHAR, poles VARCHAR, podiums VARCHAR )
What's the fastest laps during the 1995 season having poles & podiums at 0?
SELECT SUM(fastest_laps) FROM table_name_2 WHERE poles = 0 AND podiums = 0 AND seasons = "1995"
sql_create_context
CREATE TABLE table_50058 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What country is Bob Tway from?
SELECT "Country" FROM table_50058 WHERE "Player" = 'bob tway'
wikisql
CREATE TABLE table_4608 ( "Team" text, "Chassis" text, "Engine" text, "Tires" text, "Drivers" text )
What tires did BFM Enterprises run on their Offy engine and manta chassis?
SELECT "Tires" FROM table_4608 WHERE "Engine" = 'offy' AND "Chassis" = 'manta' AND "Team" = 'bfm enterprises'
wikisql
CREATE TABLE table_204_325 ( id number, "class" text, "name" text, "company" text, "residence" text, "term expires dec 31" number, "notes" text )
what is the number of companies presented ?
SELECT COUNT("company") FROM table_204_325
squall
CREATE TABLE table_name_95 ( lost INTEGER, percentage VARCHAR, played VARCHAR )
what is the most lost games when the percentage is 50.00% and games played is less than 2?
SELECT MAX(lost) FROM table_name_95 WHERE percentage = "50.00%" AND played < 2
sql_create_context
CREATE TABLE table_28457 ( "Year" real, "Championship" text, "54 holes" text, "Winning score" text, "Margin" text, "Runner(s)-up" text )
what is the space where the next winner is skee riegel
SELECT "Margin" FROM table_28457 WHERE "Runner(s)-up" = 'Skee Riegel'
wikisql
CREATE TABLE table_10164 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which team scored 9.8 (62) points against Fitzroy?
SELECT "Away team" FROM table_10164 WHERE "Away team score" = '9.8 (62)'
wikisql
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) ...
what is the maximum amount of the total hospital cost which involves calculus of kidney during this year?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'calculus of kidney')) AND DATETIME(cost.chargetime, 'start of y...
mimic_iii
CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, Software_Platform text ) CREATE TABLE stock ( Shop_ID int, Device...
Return a bar chart showing how many shops in each location, and order in ascending by the x-axis.
SELECT Location, COUNT(Location) FROM shop GROUP BY Location ORDER BY Location
nvbench
CREATE TABLE table_51717 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
What School did Terrence Jones play for?
SELECT "School" FROM table_51717 WHERE "Player" = 'terrence jones'
wikisql
CREATE TABLE table_name_91 ( actor VARCHAR, character VARCHAR, soap_opera VARCHAR, duration VARCHAR )
What actor has goede tijden, slechte tijden, as the soap opera, 11 years as the duration, with rosa gonzalez as the character?
SELECT actor FROM table_name_91 WHERE soap_opera = "goede tijden, slechte tijden" AND duration = "11 years" AND character = "rosa gonzalez"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
葛心怡这个患者之前在哪个医院看病啊
SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '葛心怡' UNION SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_i...
css
CREATE TABLE table_203_200 ( id number, "region" text, "seed" number, "team" text, "coach" text, "finished" text, "final opponent" text, "score" text )
what region is listed before the midwest ?
SELECT "region" FROM table_203_200 WHERE id < (SELECT id FROM table_203_200 WHERE "region" = 'midwest') ORDER BY id DESC LIMIT 1
squall
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...
Users from the Zwolle, the Netherlands. Lists every user (ranked by reputation) that is located in the Zwolle based on their profile info
SELECT Users.Id, Users.Id AS "user_link", Reputation, WebsiteUrl, Location FROM Users INNER JOIN PostHistory AS ph ON ph.UserId = Users.Id INNER JOIN Posts ON Posts.Id = ph.PostId WHERE Location LIKE '%Zwolle%' AND Tags LIKE '%php%' ORDER BY Reputation DESC
sede
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...
患者柏婉娜的门诊就诊记录中检验报告日期在零六年七月九日之后的门诊就诊流水号是什么
SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '柏婉娜' AND NOT txmzjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ <= '2006-07-0...
css
CREATE TABLE table_76773 ( "Name" text, "Gain" real, "Loss" real, "Long" real, "Avg/G" real )
Which Long is the highest one that has a Loss larger than 3, and a Gain larger than 2,894?
SELECT MAX("Long") FROM table_76773 WHERE "Loss" > '3' AND "Gain" > '2,894'
wikisql
CREATE TABLE table_name_16 ( location_attendance VARCHAR, record VARCHAR )
What is the Location and Attendance with a Record of 21 22?
SELECT location_attendance FROM table_name_16 WHERE record = "21–22"
sql_create_context
CREATE TABLE table_21330550_2 ( location VARCHAR, big_ten_team VARCHAR )
How many locations have #12 Michigan State as the big ten team?
SELECT COUNT(location) FROM table_21330550_2 WHERE big_ten_team = "#12 Michigan State"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
count the number of patients whose admission location is trsf within this facility and lab test fluid is ascites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND lab.fluid = "Ascites"
mimicsql_data
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Show me about the distribution of Date_of_Birth and Height in a bar chart, show X in descending order.
SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth DESC
nvbench
CREATE TABLE table_2248991_2 ( total_gdp_world_rank INTEGER, gdp_per_capita VARCHAR )
What is the total gdp world rank when the gdp per capita was listed at $1,163?
SELECT MIN(total_gdp_world_rank) FROM table_2248991_2 WHERE gdp_per_capita = "$1,163"
sql_create_context