table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
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... | what is the aircraft type with the greatest seating capacity | SELECT DISTINCT aircraft_code FROM aircraft WHERE capacity = (SELECT MAX(AIRCRAFTalias1.capacity) FROM aircraft AS AIRCRAFTalias1) |
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 procedure short title of subject id 6983? | SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "6983" |
CREATE TABLE table_37630 (
"Date" text,
"Title" text,
"Origin" text,
"Label & Cat. no." text,
"Chart no." real
) | What is origin country for a title that charted at 52? | SELECT "Origin" FROM table_37630 WHERE "Chart no." = '52' |
CREATE TABLE table_18055005_1 (
no_in_series VARCHAR,
prod_code VARCHAR
) | What's the series number of the episode with production code 329? | SELECT no_in_series FROM table_18055005_1 WHERE prod_code = "329" |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Return the room and number of reservations made for each of the rooms to draw a bar chart, I want to sort Y-axis in descending order. | SELECT Room, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY COUNT(*) DESC |
CREATE TABLE table_name_88 (
week__number VARCHAR,
original_artist VARCHAR
) | What is the week number with Phil Collins as the original artist? | SELECT week__number FROM table_name_88 WHERE original_artist = "phil collins" |
CREATE TABLE table_name_56 (
team VARCHAR,
college VARCHAR
) | What's the team of the player who went to lawrence tech? | SELECT team FROM table_name_56 WHERE college = "lawrence tech" |
CREATE TABLE table_68037 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the Final" text,
"Score" text
) | What tournament has nov. 21, 1999 as the date? | SELECT "Tournament" FROM table_68037 WHERE "Date" = 'nov. 21, 1999' |
CREATE TABLE table_name_62 (
nfl_team VARCHAR,
position VARCHAR
) | What NFL team did the Tight End position belong to? | SELECT nfl_team FROM table_name_62 WHERE position = "tight end" |
CREATE TABLE table_name_92 (
builder VARCHAR,
works_number VARCHAR
) | Who was the Builder for the locomotive that has a works number of 323? | SELECT builder FROM table_name_92 WHERE works_number = "323" |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text... | On what days are most questions posted?. | SELECT COUNT(*) AS "# votes", TIME_TO_STR(v.CreationDate, '%h') AS "hour" FROM Votes AS v GROUP BY TIME_TO_STR(v.CreationDate, '%h') |
CREATE TABLE table_name_59 (
margin_of_victory VARCHAR,
winning_score VARCHAR
) | When the Winning score is 68-65-65-68=266, what is the Margin of victory? | SELECT margin_of_victory FROM table_name_59 WHERE winning_score = 68 - 65 - 65 - 68 = 266 |
CREATE TABLE table_25431 (
"Year" real,
"Tournaments played" real,
"Cuts made" real,
"Wins" real,
"2nd" real,
"Top 10s" real,
"Best finish" text,
"Earnings ($)" real,
"Money list rank" real,
"Scoring average" text,
"Scoring rank" real
) | If the year is 2007, what is the top ten? | SELECT "Top 10s" FROM table_25431 WHERE "Year" = '2007' |
CREATE TABLE table_23564 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Foochow" text,
"Area" real,
"Population" real,
"Density" real
) | Name the foochow for pingnan county | SELECT "Foochow" FROM table_23564 WHERE "English Name" = 'Pingnan County' |
CREATE TABLE table_name_12 (
city___state VARCHAR,
winner VARCHAR,
circuit VARCHAR
) | In what City/State did John Bowe win at Phillip Island Grand Prix Circuit? | SELECT city___state FROM table_name_12 WHERE winner = "john bowe" AND circuit = "phillip island grand prix circuit" |
CREATE TABLE table_8742 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What iwas the attendance of the game that took place on december 6, 1998? | SELECT "Attendance" FROM table_8742 WHERE "Date" = 'december 6, 1998' |
CREATE TABLE table_1342451_16 (
district VARCHAR,
incumbent VARCHAR
) | What district did James O'Connor belong to? | SELECT district FROM table_1342451_16 WHERE incumbent = "James O'Connor" |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday, order Y in desc order please. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20)... | Show the transaction type and the number of transactions by a bar chart. | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type |
CREATE TABLE table_203_510 (
id number,
"township" text,
"fips" number,
"population\ncenter" text,
"population" number,
"population\ndensity\n(/mi2)" number,
"population\ndensity\n(/km2)" number,
"land area\n(mi2)" number,
"land area\n(km2)" number,
"water area\n(mi2)" number,
... | which township has the least water area in miles ? | SELECT "township" FROM table_203_510 WHERE "water area\n(mi2)" = (SELECT MIN("water area\n(mi2)") FROM table_203_510) |
CREATE TABLE table_name_28 (
year INTEGER
) | Which Year Inducted is the highest one that has a Year smaller than 1965? | SELECT MAX(year) AS Inducted FROM table_name_28 WHERE year < 1965 |
CREATE TABLE table_16974 (
"Edition" text,
"Round" text,
"Date" text,
"Partnering" text,
"Against" text,
"Surface" text,
"Opponents" text,
"W\u2013L" text,
"Result" text
) | What date was the result 6 2, 4 6, 6 4? | SELECT "Date" FROM table_16974 WHERE "Result" = '6–2, 4–6, 6–4' |
CREATE TABLE table_name_18 (
artist VARCHAR,
album VARCHAR
) | Who is the artist of the album Soul? | SELECT artist FROM table_name_18 WHERE album = "soul" |
CREATE TABLE table_5045 (
"Year" text,
"Title" text,
"Role" text,
"Producer" text,
"Director" text
) | What is Director Erik Matti's Producer? | SELECT "Producer" FROM table_5045 WHERE "Director" = 'erik matti' |
CREATE TABLE table_name_85 (
club VARCHAR,
stadium VARCHAR,
founded VARCHAR,
joined_prsl VARCHAR
) | what is the club that was founded before 2007, joined prsl in 2008 and the stadium is yldefonso sol morales stadium? | SELECT club FROM table_name_85 WHERE founded < 2007 AND joined_prsl = 2008 AND stadium = "yldefonso solá morales stadium" |
CREATE TABLE table_51826 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What was the championship that had final score of 6 2, 5 7, 6 4, 6 2 and was on a clay surface? | SELECT "Championship" FROM table_51826 WHERE "Surface" = 'clay' AND "Score in the final" = '6–2, 5–7, 6–4, 6–2' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | get the number of patients who were hospitalized for more than 27 days and had aortic valve insufficiency/aortic valve replacement/sda primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND demographic.days_stay > "27" |
CREATE TABLE table_name_7 (
rank VARCHAR,
studio VARCHAR,
director VARCHAR
) | WHAT IS THE RANK OF UNIVERSAL, AND DIRECTOR JOHN HUGHES? | SELECT rank FROM table_name_7 WHERE studio = "universal" AND director = "john hughes" |
CREATE TABLE table_25131572_3 (
season__number INTEGER,
written_by VARCHAR
) | What is the highest season# for the writer Daegan Fryklind? | SELECT MAX(season__number) FROM table_25131572_3 WHERE written_by = "Daegan Fryklind" |
CREATE TABLE table_1132600_3 (
round VARCHAR,
winning_constructor VARCHAR,
pole_position VARCHAR,
fastest_lap VARCHAR
) | Which round had Michael Schumacher in the pole position, David Coulthard with the fastest lap, and McLaren - Mercedes as the winning constructor? | SELECT COUNT(round) FROM table_1132600_3 WHERE pole_position = "Michael Schumacher" AND fastest_lap = "David Coulthard" AND winning_constructor = "McLaren - Mercedes" |
CREATE TABLE table_52532 (
"Round" real,
"Overall" real,
"Player" text,
"Nationality" text,
"Club team" text
) | What is the name of the player with an Overall larger than 227? | SELECT "Player" FROM table_52532 WHERE "Overall" > '227' |
CREATE TABLE apartment_buildings (
building_id number,
building_short_name text,
building_full_name text,
building_description text,
building_address text,
building_manager text,
building_phone text
)
CREATE TABLE apartments (
apt_id number,
building_id number,
apt_type_code tex... | Which guests have apartment bookings with status code 'Confirmed'? Return their first names and last names. | SELECT T2.guest_first_name, T2.guest_last_name FROM apartment_bookings AS T1 JOIN guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed" |
CREATE TABLE table_71364 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronze medals did the country with 7 medals and over 5 silver medals receive? | SELECT SUM("Bronze") FROM table_71364 WHERE "Total" = '7' AND "Silver" > '5' |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_... | What are card ids, customer ids, card types, and card numbers for each customer card?, and could you show y axis in desc order? | SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number) DESC |
CREATE TABLE table_68632 (
"Year" text,
"Record" text,
"Finish" text,
"Manager" text,
"Playoffs" text
) | Name the record for 1997 | SELECT "Record" FROM table_68632 WHERE "Year" = '1997' |
CREATE TABLE table_2331549_1 (
second_place VARCHAR,
champion VARCHAR
) | Who came in second place when the champion was south dakota school of mines & technology? | SELECT second_place FROM table_2331549_1 WHERE champion = "South Dakota School of Mines & Technology" |
CREATE TABLE table_1886270_1 (
built VARCHAR,
withdrawn VARCHAR
) | When 2/1939 is the withdrawn when was it built? | SELECT built FROM table_1886270_1 WHERE withdrawn = "2/1939" |
CREATE TABLE table_name_74 (
husband VARCHAR,
image VARCHAR
) | Who was the husband of marie of baden-sponheim? | SELECT husband FROM table_name_74 WHERE image = "marie of baden-sponheim" |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | How many regions were affected by each storm Visualize by bar chart, and rank from high to low by the y-axis. | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY COUNT(*) DESC |
CREATE TABLE table_59479 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | Who was the away team at the game attended by 81? | SELECT "Away team" FROM table_59479 WHERE "Attendance" = '81' |
CREATE TABLE table_37036 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
) | Total larger than 285, and a Finish of t30 belongs to what player? | SELECT "Player" FROM table_37036 WHERE "Total" > '285' AND "Finish" = 't30' |
CREATE TABLE accounts (
account_id number,
customer_id number,
account_name text,
other_account_details text
)
CREATE TABLE financial_transactions (
transaction_id number,
previous_transaction_id number,
account_id number,
card_id number,
transaction_type text,
transaction_date ... | What are the valid from and valid to dates for the card with the number 4560596484842? | SELECT date_valid_from, date_valid_to FROM customers_cards WHERE card_number = "4560596484842" |
CREATE TABLE table_204_743 (
id number,
"pos" text,
"no" number,
"driver" text,
"constructor" text,
"laps" number,
"time/retired" text,
"grid" number,
"points" number
) | what was jenson button 's time ? | SELECT "time/retired" FROM table_204_743 WHERE "driver" = 'jenson button' |
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 Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(... | A bar chart for finding the number of the last name of female (sex is F) students in the descending order of age. | SELECT LName, COUNT(LName) FROM Student WHERE Sex = "F" GROUP BY LName ORDER BY Age DESC |
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 of the patients aged below 61 had hypothyroidism nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "61" AND diagnoses.short_title = "Hypothyroidism NOS" |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE T... | what is the cheapest one way fare from PITTSBURGH to ATLANTA traveling on tuesday august twentieth | 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... |
CREATE TABLE table_name_44 (
chassis VARCHAR,
engine VARCHAR,
year VARCHAR
) | What chassis did the porsche flat-4 use before 1958? | SELECT chassis FROM table_name_44 WHERE engine = "porsche flat-4" AND year < 1958 |
CREATE TABLE table_256286_61 (
_percentage_yes VARCHAR,
yes_votes VARCHAR
) | What is the percentage of yes when there were 218846 yes votes | SELECT _percentage_yes FROM table_256286_61 WHERE yes_votes = 218846 |
CREATE TABLE table_77965 (
"Rank" real,
"Rmax Rpeak ( Pflops )" text,
"Name" text,
"Vendor" text,
"Operating system" text
) | What is the rank of Rmax Rpeak ( Pflops ) of 17.173 20.133? | SELECT AVG("Rank") FROM table_77965 WHERE "Rmax Rpeak ( Pflops )" = '17.173 20.133' |
CREATE TABLE table_name_65 (
location VARCHAR,
school VARCHAR
) | WHere is the friends' school? | SELECT location FROM table_name_65 WHERE school = "the friends' school" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose diagnosis icd9 code is 53081 and lab test category is hematology. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "53081" AND lab."CATEGORY" = "Hematology" |
CREATE TABLE table_76715 (
"Week" text,
"Theme" text,
"Artist" text,
"Order sung" text,
"Status" text
) | What order was the performance of a Richard Marx song? | SELECT "Order sung" FROM table_76715 WHERE "Artist" = 'richard marx' |
CREATE TABLE table_63261 (
"HR Number" real,
"Name" text,
"LMS Number" real,
"BR number" text,
"Withdrawn" text
) | Which BR number has an LMS number over 14768? | SELECT "BR number" FROM table_63261 WHERE "LMS Number" > '14768' |
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
)
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
) | Compare each editors' ages using a bar chart, sort by the x axis in ascending. | SELECT Name, Age FROM editor ORDER BY Name |
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,
... | provide the number of patients whose death status is 0 and procedure short title is regional lymph node exc? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.short_title = "Regional lymph node exc" |
CREATE TABLE table_51537 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the score on August 8? | SELECT "Score" FROM table_51537 WHERE "Date" = 'august 8' |
CREATE TABLE table_name_47 (
icb_sector VARCHAR,
ticker_symbol VARCHAR
) | Which ICB Sector had a ticker symbol of pp? | SELECT icb_sector FROM table_name_47 WHERE ticker_symbol = "pp" |
CREATE TABLE table_name_62 (
rank VARCHAR,
time VARCHAR
) | What rank did the time of 7:31.90 receive? | SELECT COUNT(rank) FROM table_name_62 WHERE time = "7:31.90" |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime ti... | on their last hospital visit what was the marital status of patient 25461? | SELECT admissions.marital_status FROM admissions WHERE admissions.subject_id = 25461 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE table_name_72 (
director VARCHAR,
title VARCHAR,
platform_s_ VARCHAR,
year VARCHAR
) | Who was the director of Battalion Wars 2 which was released on GCN after 2004? | SELECT director FROM table_name_72 WHERE platform_s_ = "gcn" AND year > 2004 AND title = "battalion wars 2" |
CREATE TABLE table_17143 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | What is the position for the player that played in 2006? | SELECT "Position" FROM table_17143 WHERE "Years for Rockets" = '2006' |
CREATE TABLE table_27700530_15 (
location_attendance VARCHAR,
game VARCHAR
) | What was the location and attendance for game 2? | SELECT location_attendance FROM table_27700530_15 WHERE game = 2 |
CREATE TABLE table_28298589_4 (
result VARCHAR,
home_team VARCHAR
) | What was the final score of Washington's home game? | SELECT result FROM table_28298589_4 WHERE home_team = "Washington" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age te... | on the current hospital encounter, count the number of drugs that patient 032-9230 had been prescribed. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '032-9230' AND patient.hospitaldischargetime IS NULL)) |
CREATE TABLE table_name_22 (
record VARCHAR,
attendance VARCHAR
) | What was the team's record at the game attended by 30,452? | SELECT record FROM table_name_22 WHERE attendance = "30,452" |
CREATE TABLE personfriend (
name text,
friend text,
year number
)
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
) | What are the different names and ages of every friend of either Dan or alice? | SELECT DISTINCT T1.name, T1.age FROM person AS T1 JOIN personfriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Dan' OR T2.friend = 'Alice' |
CREATE TABLE table_name_55 (
winner VARCHAR,
trofeo_fast_team VARCHAR,
stage VARCHAR
) | who is the winner when the trofeo fast team is carrera jeans-vagabond in stage 5? | SELECT winner FROM table_name_55 WHERE trofeo_fast_team = "carrera jeans-vagabond" AND stage = "5" |
CREATE TABLE table_26434 (
"No. by series" real,
"No. by season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production number" real,
"U.S. viewers (in millions)" text
) | What episode was watched by 10.81 million US viewers? | SELECT MIN("No. by season") FROM table_26434 WHERE "U.S. viewers (in millions)" = '10.81' |
CREATE TABLE table_name_53 (
date VARCHAR,
result VARCHAR
) | What is the date of the game with a result of W 13-10? | SELECT date FROM table_name_53 WHERE result = "w 13-10" |
CREATE TABLE table_name_89 (
stolen_ends INTEGER,
ends_lost INTEGER
) | Name the average Stolen Ends which has an Ends Lost smaller than 35? | SELECT AVG(stolen_ends) FROM table_name_89 WHERE ends_lost < 35 |
CREATE TABLE table_11589522_3 (
title VARCHAR,
original_air_date VARCHAR
) | what's the title where original air date is january18,2009 | SELECT title FROM table_11589522_3 WHERE original_air_date = "January18,2009" |
CREATE TABLE table_name_91 (
country VARCHAR,
to_par VARCHAR
) | For the player finishing at +8, what is his nationality? | SELECT country FROM table_name_91 WHERE to_par = "+8" |
CREATE TABLE table_27277284_28 (
model_number VARCHAR,
order_part_number VARCHAR
) | What is the model number for the order part numbered tmrm75dam22gg? | SELECT model_number FROM table_27277284_28 WHERE order_part_number = "TMRM75DAM22GG" |
CREATE TABLE table_68201 (
"Team" text,
"City" text,
"Stadium" text,
"Manager" text,
"Past season" text
) | what city has a past season of n/a? | SELECT "City" FROM table_68201 WHERE "Past season" = 'n/a' |
CREATE TABLE table_name_11 (
performer_3 VARCHAR,
performer_4 VARCHAR
) | Who was the 3rd performer when Rory Bremner was the 4th performer? | SELECT performer_3 FROM table_name_11 WHERE performer_4 = "rory bremner" |
CREATE TABLE table_name_76 (
company VARCHAR,
release_date VARCHAR
) | Who is the company that released the album on 2008-09-18 18 September 2008? | SELECT company FROM table_name_76 WHERE release_date = "2008-09-18 18 september 2008" |
CREATE TABLE table_204_13 (
id number,
"finished" text,
"post" number,
"horse" text,
"jockey" text,
"trainer" text,
"owner" text,
"time / behind" text
) | name of horse that finished first in the 1997 kentucky derby | SELECT "horse" FROM table_204_13 WHERE "finished" = 1 |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | what is patient 19428's maximum arterial bp [systolic] at on this month/27? | SELECT MAX(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 = 19428)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... |
CREATE TABLE table_name_39 (
mecha VARCHAR,
japanese_voice_actor VARCHAR
) | What is the Mecha of the Japanese voice actor Shingo Kanemoto? | SELECT mecha FROM table_name_39 WHERE japanese_voice_actor = "shingo kanemoto" |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
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... | what tests are the four most frequently ordered lab tests in this year? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY labevents.itemid) AS t1... |
CREATE TABLE table_51901 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | Which school has a Player of donte greene? | SELECT "School" FROM table_51901 WHERE "Player" = 'donte greene' |
CREATE TABLE table_204_73 (
id number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"record" text
) | number of games in which the starzz scored at most 59 points | SELECT COUNT(*) FROM table_204_73 WHERE "score" <= 59 |
CREATE TABLE table_name_41 (
year_born__age_ VARCHAR,
current_club VARCHAR,
position VARCHAR
) | Which Year born (Age) has a Current Club of sporting al riyadi beirut, and a Position of pf? | SELECT year_born__age_ FROM table_name_41 WHERE current_club = "sporting al riyadi beirut" AND position = "pf" |
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE game (
... | Show me a scatter chart for how many games has each stadium held? | SELECT T1.id, COUNT(*) FROM stadium AS T1 JOIN game AS T2 ON T1.id = T2.stadium_id GROUP BY T1.id |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
... | show me the flights from PITTSBURGH to SAN FRANCISCO | 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 = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... |
CREATE TABLE table_28268 (
"Model" text,
"Launch" text,
"Code name" text,
"Transistors (million)" real,
"Die size (mm 2 )" real,
"Bus interface" text,
"Memory ( MB )" text,
"SM count" real,
"Core config 1,3" text,
"Core ( MHz )" real,
"Shader ( MHz )" real,
"Memory ( MHz ... | How many die sizes have a texture of exactly 34? | SELECT COUNT("Die size (mm 2 )") FROM table_28268 WHERE "Texture ( GT /s)" = '34' |
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 Team_ID over the All_Home , and group by attribute ACC_Road, and show from high to low by the x axis. | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC |
CREATE TABLE table_46935 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" text
) | Name the Team which has a Time/Retired of contact, and a Grid smaller than 17? | SELECT "Team" FROM table_46935 WHERE "Time/Retired" = 'contact' AND "Grid" < '17' |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId nu... | User and count of answers on closed questions. | SELECT a.OwnerUserId, COUNT(*) AS "total" FROM Posts AS a JOIN Posts AS q ON q.Id = a.ParentId WHERE NOT q.ClosedDate IS NULL GROUP BY a.OwnerUserId ORDER BY total DESC |
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
) | Show the number of the names of editors that are on the committee of journals with sales bigger than 3000, sort Name from high to low order. | SELECT Name, COUNT(Name) FROM journal_committee AS T1 JOIN editor AS T2 ON T1.Editor_ID = T2.Editor_ID JOIN journal AS T3 ON T1.Journal_ID = T3.Journal_ID WHERE T3.Sales > 3000 GROUP BY Name ORDER BY Name DESC |
CREATE TABLE table_name_93 (
points INTEGER,
engine VARCHAR,
chassis VARCHAR
) | What is the average number of points for an Offenhauser L4 engine with a Trevis chassis? | SELECT AVG(points) FROM table_name_93 WHERE engine = "offenhauser l4" AND chassis = "trevis" |
CREATE TABLE table_54123 (
"Player" text,
"Car." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
) | How many TDs for the player with a long of less than 4 and under 8 yards? | SELECT SUM("TD's") FROM table_54123 WHERE "Long" < '4' AND "Yards" < '8' |
CREATE TABLE table_20141 (
"Ecozone" text,
"Area (km\u00b2)" real,
"Percentage of total area" text,
"Percentage of land area" text,
"Percentage protected" text
) | What is the percentage of land area in the ecozone that the percentage protected is 15.28? | SELECT "Percentage of land area" FROM table_20141 WHERE "Percentage protected" = '15.28' |
CREATE TABLE services (
service_id number,
service_type_code text,
workshop_group_id number,
product_description text,
product_name text,
product_price number,
other_product_service_details text
)
CREATE TABLE marketing_regions (
marketing_region_code text,
marketing_region_name tex... | What is the description of the service type which offers both the photo product and the film product? | SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product_name = 'photo' INTERSECT SELECT T1.service_type_description FROM ref_service_types AS T1 JOIN services AS T2 ON T1.service_type_code = T2.service_type_code WHERE T2.product... |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | For each director, return the director's name together with the value of that rating and ignore movies whose director is NULL Could you plot the result with a bar chart?, I want to list by the director in desc. | SELECT director, stars FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE director <> "null" ORDER BY director DESC |
CREATE TABLE table_11400 (
"Year" real,
"Chassis" text,
"Engine(s)" text,
"Tyres" text,
"Points" real
) | What engines have the year 1992? | SELECT "Engine(s)" FROM table_11400 WHERE "Year" = '1992' |
CREATE TABLE furniture_manufacte (
Manufacturer_ID int,
Furniture_ID int,
Price_in_Dollar real
)
CREATE TABLE manufacturer (
Manufacturer_ID int,
Open_Year real,
Name text,
Num_of_Factories int,
Num_of_Shops int
)
CREATE TABLE furniture (
Furniture_ID int,
Name text,
Num_of... | Give me the names and prices of furnitures which some companies are manufacturing with a bar chart, display y axis from low to high order. | SELECT Name, Price_in_Dollar FROM furniture AS t1 JOIN furniture_manufacte AS t2 ON t1.Furniture_ID = t2.Furniture_ID ORDER BY Price_in_Dollar |
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 in the weight of patient 594's last measured on the last hospital visit compared to the value first measured on the last 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 = 594 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND char... |
CREATE TABLE table_75694 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the number of totals that have silvers under 2, bronzes over 0, and golds over 1? | SELECT COUNT("Total") FROM table_75694 WHERE "Silver" < '2' AND "Bronze" > '0' AND "Gold" > '1' |
CREATE TABLE table_593 (
"No" real,
"Player" text,
"Height" text,
"Position" text,
"Year born" real,
"Current Club" text
) | What's Yotam Halperin's position? | SELECT "Position" FROM table_593 WHERE "Player" = 'Yotam Halperin' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.