table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_12614 (
"Team" text,
"B10 Conference" text,
"B10 %" real,
"B10 Home" text,
"B10 Road" text,
"All Games" text,
"All Games %" real,
"All Home" text,
"All Road" text,
"All Neutral" text
) | What is the All Home with less than 0.406% All Games? | SELECT "All Home" FROM table_12614 WHERE "All Games %" < '0.406' |
CREATE TABLE table_76319 (
"Club" text,
"League" text,
"Venue" text,
"Capacity" text,
"Location" text,
"Established" real,
"Championships" real
) | When was the venue named nassau veterans memorial coliseum established?? | SELECT MAX("Established") FROM table_76319 WHERE "Venue" = 'nassau veterans memorial coliseum' |
CREATE TABLE table_name_56 (
rank VARCHAR,
nation VARCHAR,
bronze VARCHAR,
total VARCHAR
) | What rank has 0 as the bronze, and a total less than 3, with north korea as the nation? | SELECT rank FROM table_name_56 WHERE bronze = 0 AND total < 3 AND nation = "north korea" |
CREATE TABLE table_name_7 (
location VARCHAR,
time VARCHAR
) | what is the location when the time is 3:15? | SELECT location FROM table_name_7 WHERE time = "3:15" |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | Show me Epistemology courses of 15 credits . | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Epistemology%' OR name LIKE '%Epistemology%') AND credits = 15 |
CREATE TABLE table_63492 (
"Rank" real,
"Title" text,
"Release Date" text,
"Franchise" text,
"Developer(s)" text,
"Platform" text,
"Units sold (in Millions)" real
) | What's the platform of Super Mario All-Stars? | SELECT "Platform" FROM table_63492 WHERE "Title" = 'super mario all-stars' |
CREATE TABLE table_203_568 (
id number,
"town/village" text,
"population" number,
"postal code" text,
"municipality" text,
"island" text,
"location" text
) | how many towns have a population higher than 1000 ? | SELECT COUNT("town/village") FROM table_203_568 WHERE "population" > 1000 |
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id text
)
CREATE TABLE book_club (
book_club_id number,
year number,
author_or_editor text,
book_title text,
publisher text,
cate... | What is the title and director for the movie with highest worldwide gross in the year 2000 or before? | SELECT title, director FROM movie WHERE year <= 2000 ORDER BY gross_worldwide DESC LIMIT 1 |
CREATE TABLE table_49566 (
"Race" real,
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text,
"Team" text
) | When was the Lakeside race where Paul Morris won? | SELECT "Date" FROM table_49566 WHERE "Race Title" = 'lakeside' AND "Winner" = 'paul morris' |
CREATE TABLE table_203_212 (
id number,
"#" number,
"district" text,
"land area (km2)" number,
"population\n(2010 census)" number,
"density (persons/km2)" number
) | what is the total land area of saint lucia -lrb- in square kilometers -rrb- ? | SELECT "land area (km2)" FROM table_203_212 WHERE "district" = 'saint lucia' |
CREATE TABLE table_name_98 (
province_region VARCHAR,
location VARCHAR
) | Where is the Cagayan de Oro city located? | SELECT province_region FROM table_name_98 WHERE location = "cagayan de oro city" |
CREATE TABLE table_13741576_6 (
club VARCHAR,
points_against VARCHAR
) | What club had 404 points against? | SELECT club FROM table_13741576_6 WHERE points_against = "404" |
CREATE TABLE subjects (
subject_id number,
subject_name text
)
CREATE TABLE course_authors_and_tutors (
author_id number,
author_tutor_atb text,
login_name text,
password text,
personal_name text,
middle_name text,
family_name text,
gender_mf text,
address_line_1 text
)
CRE... | What are the personal names and family names of the students? Sort the result in alphabetical order of the family name. | SELECT personal_name, family_name FROM students ORDER BY family_name |
CREATE TABLE table_7978 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which event did he win with a method of submission (triangle choke) and a time of n/a? | SELECT "Event" FROM table_7978 WHERE "Res." = 'win' AND "Time" = 'n/a' AND "Method" = 'submission (triangle choke)' |
CREATE TABLE table_27823058_1 (
series__number INTEGER
) | What's the highest series number ? | SELECT MAX(series__number) FROM table_27823058_1 |
CREATE TABLE table_40023 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Total" text
) | What is the set 5 with a 19-25 set 1? | SELECT "Set 5" FROM table_40023 WHERE "Set 1" = '19-25' |
CREATE TABLE table_63216 (
"Island" text,
"Country" text,
"Population" text,
"Area km\u00b2" text,
"Density (per km\u00b2)" text
) | Which country has a density (per km ) of 6,814? | SELECT "Country" FROM table_63216 WHERE "Density (per km\u00b2)" = '6,814' |
CREATE TABLE order_items (
order_id number,
product_id number,
order_quantity text
)
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_address_from time,
address_type text,
date_address_to time
)
CREATE TABLE customer_contact_channels (
customer_id numbe... | What are names of customers who never ordered product Latte. | SELECT customer_name FROM customers EXCEPT SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id JOIN products AS t4 ON t3.product_id = t4.product_id WHERE t4.product_details = 'Latte' |
CREATE TABLE table_19222 (
"Institution" text,
"Location" text,
"Established" real,
"Gained university status" real,
"Vice-chancellor" text,
"Total Number of Students" real,
"Research Funding (\u00a3,000)" real
) | How many members gained university status in 1900? | SELECT COUNT("Research Funding (\u00a3,000)") FROM table_19222 WHERE "Gained university status" = '1900' |
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price... | For each phone, show its names and total number of stocks Visualize by bar chart, rank by the Y-axis in ascending please. | SELECT Name, SUM(T1.Num_of_stock) FROM phone_market AS T1 JOIN phone AS T2 ON T1.Phone_ID = T2.Phone_ID GROUP BY T2.Name ORDER BY SUM(T1.Num_of_stock) |
CREATE TABLE table_15001 (
"Series" text,
"TV Channel" text,
"Launch Date" text,
"Finale Date" text,
"Days" real,
"The Winner" text,
"The Prize" text,
"The Presenter" text
) | Who won when the presenter was Tatiana Stefanidou? | SELECT "The Winner" FROM table_15001 WHERE "The Presenter" = 'tatiana stefanidou' |
CREATE TABLE table_name_28 (
long INTEGER,
gain INTEGER
) | What is the long figure when gain is less than 0? | SELECT AVG(long) FROM table_name_28 WHERE gain < 0 |
CREATE TABLE table_203_2 (
id number,
"name" text,
"mineral" text,
"opened" text,
"closed" text,
"years connected" text,
"notes" text
) | how many quarries opened before 1892 ? | SELECT COUNT(*) FROM table_203_2 WHERE "opened" <= 1892 |
CREATE TABLE table_2417345_4 (
date_successor_seated VARCHAR,
successor VARCHAR
) | When was successor George E. Harris (R) seated? | SELECT date_successor_seated FROM table_2417345_4 WHERE successor = "George E. Harris (R)" |
CREATE TABLE table_63594 (
"Draw" real,
"Language" text,
"Artist" text,
"English translation" text,
"Place" real,
"Points" real
) | What is the highest draw number when there are more than 31 points, a rank greater than 6, and the English translation is listen to me? | SELECT MAX("Draw") FROM table_63594 WHERE "Points" > '31' AND "Place" > '6' AND "English translation" = 'listen to me' |
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 d_labitems (
row_id number,
itemid number,
label te... | count the number of people who were prescribed vancomycin hcl during the same month following a diagnosis of ac vasc insuff intestine since 6 years ago. | 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 = 'ac vasc insuff int... |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedb... | select * from Users where Id= 113. | SELECT * FROM Users WHERE Id = 113 |
CREATE TABLE table_17622 (
"Number in series" real,
"Broadcast Order" text,
"Title" text,
"Villain/s" text,
"U.S. Air Date" text,
"Production Code" text
) | What's the series number of the episode titled 'The Quest'? | SELECT MAX("Number in series") FROM table_17622 WHERE "Title" = 'The Quest' |
CREATE TABLE table_name_94 (
game VARCHAR,
high_rebounds VARCHAR
) | What game has jones (10) as the high rebounds? | SELECT game FROM table_name_94 WHERE high_rebounds = "jones (10)" |
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,... | how many patients are born before 2056 and administered with si drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2056" AND prescriptions.route = "SL" |
CREATE TABLE table_19712 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" real
) | What was the result of the game on October 6, 1974? | SELECT "Result" FROM table_19712 WHERE "Date" = 'October 6, 1974' |
CREATE TABLE table_name_93 (
tournament VARCHAR
) | WHAT IS THE 2010 WITH 2012 OF 2R AT MIAMI MASTERS? | SELECT 2010 FROM table_name_93 WHERE 2012 = "2r" AND tournament = "miami masters" |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE fare_basis (
fare_basis_cod... | give me a list of the morning flights from ATLANTA to BOSTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO... |
CREATE TABLE table_202_160 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"position" text,
"movements" text
) | what division was the team most commonly found in ? | SELECT "division" FROM table_202_160 GROUP BY "division" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_58095 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text
) | Who won in 2003? | SELECT "Winner" FROM table_58095 WHERE "Year" = '2003' |
CREATE TABLE table_name_52 (
song VARCHAR,
weeks_at_number_one VARCHAR,
issue_date_s_ VARCHAR
) | Which Song has a Weeks at number one larger than 2, and an Issue date(s) of 17 april - 8 may? | SELECT song FROM table_name_52 WHERE weeks_at_number_one > 2 AND issue_date_s_ = "17 april - 8 may" |
CREATE TABLE table_72576 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Name the player for chicago black hawks | SELECT "Player" FROM table_72576 WHERE "NHL team" = 'Chicago Black Hawks' |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE... | i need a flight from NEW YORK to TORONTO THURSDAY 5 24 arriving by 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, date_day, days AS DAYS_0, days AS DAYS_1, flight WHERE (((DAYS_1.day_name = 'THURSDAY' AND flight.arrival_time <= 1200 AND flight.flight_days = DAYS_1.days_code) AND date_day... |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE T... | Questions counted by vote range. | SELECT COUNT(CASE WHEN UPPER(Posts.Tags) LIKE '%<OPEN-ENDED>%' THEN 1 END) AS OpenEndedCount FROM Posts JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE PostTypes.Name = 'Question' |
CREATE TABLE table_name_44 (
floors VARCHAR,
street_address_in_detroit VARCHAR
) | How many floors does the address 1828 jay street have? | SELECT floors FROM table_name_44 WHERE street_address_in_detroit = "1828 jay street" |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_las... | Find the number of booking start date for the apartments that have more than two bedrooms for each weekday in a bar chart, display total number from high to low order please. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date) DESC |
CREATE TABLE table_36315 (
"Athlete" text,
"Country" text,
"Run 1" real,
"Run 2" real,
"Run 3" real
) | Who had a run 2 of 50.67? | SELECT "Athlete" FROM table_36315 WHERE "Run 2" = '50.67' |
CREATE TABLE table_27277284_28 (
ht VARCHAR,
mult_1 VARCHAR
) | How much ht does the model with 10x mult. 1 have? | SELECT ht FROM table_27277284_28 WHERE mult_1 = "10x" |
CREATE TABLE table_13618358_1 (
income_poverty_f VARCHAR,
services_ VARCHAR,
_cons_truction_b VARCHAR
) | How low was the income where services is 72.5? | SELECT income_poverty_f FROM table_13618358_1 WHERE services_ & _cons_truction_b = "72.5" |
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... | What is the total number of patients who had allo hem stem ct w/o pur and died in or before the year 2138? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2138.0" AND procedures.short_title = "Allo hem stem ct w/o pur" |
CREATE TABLE table_7631 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"\"Coat of Cash\" Wearing Celebrity" text
) | What is the lowest of Episode Number that has a Air Date on 20 july 2007? | SELECT MIN("Episode Number") FROM table_7631 WHERE "Air Date" = '20 july 2007' |
CREATE TABLE Services (
Service_ID VARCHAR,
Service_Type_Code VARCHAR
)
CREATE TABLE EVENTS (
event_details VARCHAR,
Service_ID VARCHAR
) | what are the event details of the services that have the type code 'Marriage'? | SELECT T1.event_details FROM EVENTS AS T1 JOIN Services AS T2 ON T1.Service_ID = T2.Service_ID WHERE T2.Service_Type_Code = 'Marriage' |
CREATE TABLE table_name_62 (
team__number2 VARCHAR
) | What is the 1st leg of bp. honv d team #2? | SELECT 1 AS st_leg FROM table_name_62 WHERE team__number2 = "bp. honvéd" |
CREATE TABLE table_17943 (
"Year" real,
"Starts" real,
"Wins (Majors)" text,
"2nd" real,
"3rd" real,
"Earnings ($)" real,
"Money list rank" text,
"Scoring average" text
) | Name the total number of scoring average for money list rank of 174 | SELECT COUNT("Scoring average") FROM table_17943 WHERE "Money list rank" = '174' |
CREATE TABLE table_name_23 (
points INTEGER,
engine VARCHAR
) | Which gc37-01 v10 engine has the fewest points? | SELECT MIN(points) FROM table_name_23 WHERE engine = "gc37-01 v10" |
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Eve... | What are the ids and details of events that have more than one participants Visualize by bar chart, and I want to show in ascending by the Y. | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_ID |
CREATE TABLE table_19439864_2 (
tromsø INTEGER,
total VARCHAR
) | When the total score is 740, what is tromso? | SELECT MIN(tromsø) FROM table_19439864_2 WHERE total = 740 |
CREATE TABLE table_2417340_4 (
successor VARCHAR,
vacator VARCHAR,
district VARCHAR
) | Who was the successor for vacant louisiana 5th | SELECT successor FROM table_2417340_4 WHERE vacator = "Vacant" AND district = "Louisiana 5th" |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE cine... | For each film, show the price and group them by cinema name in a stacked bar chart, and list Y from high to low order. | SELECT Name, Price FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Title, Name ORDER BY Price DESC |
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 flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | what is the least expensive one way ticket from ATLANTA to DENVER leaving on 10 12 | 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_35 (
first_match VARCHAR,
final_position VARCHAR,
final_round VARCHAR
) | On what date did the first match occur for the competition that ended with a final position of winners and the final round in the finals? | SELECT first_match FROM table_name_35 WHERE final_position = "winners" AND final_round = "finals" |
CREATE TABLE table_name_67 (
away_team VARCHAR,
home_team VARCHAR
) | What was home team South Melbourne's opponents score? | SELECT away_team AS score FROM table_name_67 WHERE home_team = "south melbourne" |
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
) | Find the papers which have 'Olin Shivers' as an author. | SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers" |
CREATE TABLE schedule (
film_id VARCHAR,
show_times_per_day INTEGER
)
CREATE TABLE film (
directed_by VARCHAR,
film_id VARCHAR
) | Show director with the largest number of show times in total. | SELECT T2.directed_by FROM schedule AS T1 JOIN film AS T2 ON T1.film_id = T2.film_id GROUP BY T2.directed_by ORDER BY SUM(T1.show_times_per_day) DESC LIMIT 1 |
CREATE TABLE table_13592 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | Which constituency number has a name of Timarni? | SELECT "Constituency number" FROM table_13592 WHERE "Name" = 'timarni' |
CREATE TABLE table_name_20 (
league VARCHAR,
nationality VARCHAR,
points VARCHAR
) | Which league's nationality was Italy when there were 62 points? | SELECT league FROM table_name_20 WHERE nationality = "italy" AND points = "62" |
CREATE TABLE table_name_35 (
grid VARCHAR,
bike VARCHAR,
time VARCHAR
) | What is the total number for grid with a Suzuki GSX-R1000 K7 for +13.283? | SELECT COUNT(grid) FROM table_name_35 WHERE bike = "suzuki gsx-r1000 k7" AND time = "+13.283" |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEX... | What are the date and mean humidity for the top 3 days with the largest max gust speeds? Return me a bar chart. | SELECT date, mean_humidity FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 |
CREATE TABLE table_66980 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Name the years for dannevirke south school | SELECT "Years" FROM table_66980 WHERE "Name" = 'dannevirke south school' |
CREATE TABLE table_name_92 (
draw INTEGER,
points VARCHAR,
match VARCHAR
) | What is the highest draw that has points greater than 4, with a match greater than 5? | SELECT MAX(draw) FROM table_name_92 WHERE points > 4 AND match > 5 |
CREATE TABLE table_16432543_1 (
nickname VARCHAR,
location VARCHAR
) | How many nicknames does the school in Newark, DE have | SELECT COUNT(nickname) FROM table_16432543_1 WHERE location = "Newark, DE" |
CREATE TABLE table_71840 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which country watch Tom Watson at t9 score 72-72=144? | SELECT "Country" FROM table_71840 WHERE "Place" = 't9' AND "Score" = '72-72=144' AND "Player" = 'tom watson' |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Which useful courses are available before taking EMBA 628 ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'EMBA' AND number = 628 |
CREATE TABLE student_course_registrations (
student_id number,
course_id number,
registration_date time
)
CREATE TABLE addresses (
address_id number,
line_1 text,
line_2 text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE students (
s... | How many students attend course English? | SELECT COUNT(*) FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "English" |
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,
... | what is the number of patients whose admission year is less than 2152 and diagnoses short title is nb obs genetc/metabl cnd? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2152" AND diagnoses.short_title = "NB obs genetc/metabl cnd" |
CREATE TABLE table_69301 (
"Year" real,
"Artist" text,
"Album / Song" text,
"Award" text,
"Result / Category" text
) | Which result is older than 2007? | SELECT "Result / Category" FROM table_69301 WHERE "Year" < '2007' |
CREATE TABLE table_21886 (
"Tie no" real,
"Home team" text,
"Score 1" text,
"Away team" text,
"Attendance" real
) | What tie number featured Chelsea as the home team? | SELECT MIN("Tie no") FROM table_21886 WHERE "Home team" = 'Chelsea' |
CREATE TABLE Financial_transactions (
transaction_type VARCHAR,
transaction_amount INTEGER
) | Show the transaction types and the total amount of transactions. | SELECT transaction_type, SUM(transaction_amount) FROM Financial_transactions GROUP BY transaction_type |
CREATE TABLE table_1393 (
"Television Station" text,
"Frequency" text,
"Site" text,
"Transmitted" text,
"Network" text,
"Status" text,
"Country of Region" text
) | What are the site(s) for tv station 8tv? | SELECT "Site" FROM table_1393 WHERE "Television Station" = '8TV' |
CREATE TABLE table_37997 (
"Game" real,
"April" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Game is the lowest one that has Points smaller than 92? | SELECT MIN("Game") FROM table_37997 WHERE "Points" < '92' |
CREATE TABLE table_13570_1 (
nucleus VARCHAR,
cytoplasm VARCHAR
) | The pink cytoplasm will have a nucleus of what color? | SELECT nucleus FROM table_13570_1 WHERE cytoplasm = "Pink" |
CREATE TABLE table_7763 (
"Year" real,
"Team" text,
"Player" text,
"Position" text,
"School" text
) | What was the lowest year that a player from midfield won first team honors? | SELECT MIN("Year") FROM table_7763 WHERE "Team" = 'first team' AND "Position" = 'midfield' |
CREATE TABLE table_10980 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team has a crowd that is bigger than 22,449? | SELECT "Home team" FROM table_10980 WHERE "Crowd" > '22,449' |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | What classes are necessary to declare a major in MODGREEK ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%MODGREEK%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
CREATE TABLE table_61144 (
"Year" real,
"Winner" text,
"Sport" text,
"Hometown" text,
"College" text
) | What is the hometown of the player who went to college at USC? | SELECT "Hometown" FROM table_61144 WHERE "College" = 'usc' |
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
... | What is the name, account type, and account balance corresponding to the customer with the highest credit score? | SELECT cust_name, acc_type, acc_bal FROM customer ORDER BY credit_score DESC LIMIT 1 |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text... | Compare the number of the local authority by the local authority. | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority |
CREATE TABLE table_name_1 (
content VARCHAR,
television_service VARCHAR
) | What content is provided by the television service ewtn? | SELECT content FROM table_name_1 WHERE television_service = "ewtn" |
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 TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For those employees whose first name does not contain the letter M, give me a line chart to show the hire date and the corresponding salaries, and show X-axis from high to low order. | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY HIRE_DATE DESC |
CREATE TABLE table_12286195_1 (
original_team VARCHAR,
result VARCHAR
) | What is the original team of the celebrity who had the result 08 fired in week 10 (2008-03-06) | SELECT original_team FROM table_12286195_1 WHERE result = "08 Fired in week 10 (2008-03-06)" |
CREATE TABLE table_3033 (
"Borough" text,
"County" text,
"Franchise type" text,
"Members" real,
"Voters in 1800" real,
"Times contested" real,
"Fate in 1832" text
) | Which county has a membership of 1, a franchise type of corporation and a borough of Ennis? | SELECT "County" FROM table_3033 WHERE "Members" = '1' AND "Franchise type" = 'Corporation' AND "Borough" = 'Ennis' |
CREATE TABLE table_name_29 (
partner VARCHAR,
score VARCHAR
) | Who is the partner with a score of 6 1, 6 4? | SELECT partner FROM table_name_29 WHERE score = "6–1, 6–4" |
CREATE TABLE table_35856 (
"Season" real,
"Overall" text,
"Slalom" text,
"Giant Slalom" text,
"Super G" text,
"Combined" text
) | Which combined score has an overall of 8? | SELECT "Combined" FROM table_35856 WHERE "Overall" = '8' |
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Tries real,
Goals text,
Points real
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE club (
Club_ID int,
... | List the position of players and the average number of points of players of each position by a bar chart, and display from low to high by the X. | SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY Position |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,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... | For those employees who was hired before 2002-06-21, find job_id and the average of salary , and group by attribute job_id, and visualize them by a bar chart, and I want to rank by the Y-axis in descending. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(SALARY) 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... | what number of patients with femoral artery thrombosis have 0 death status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" |
CREATE TABLE table_name_84 (
area_km_2 INTEGER,
population VARCHAR,
official_name VARCHAR
) | What is the highest area for locations named Centreville having populations over 532? | SELECT MAX(area_km_2) FROM table_name_84 WHERE population > 532 AND official_name = "centreville" |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_... | Count those days and in which zip code was the min dew point lower than any day in zip code 94107 using a bar graph, and I want to list by the bars from low to high. | SELECT date, COUNT(date) FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) GROUP BY date ORDER BY date |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | what's the minimum cost of a hospital that includes a anion gap lab test until 2101? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'anion gap')) AND STRFTIME('%y', cost.chargetime) <= '2101' GROUP BY ... |
CREATE TABLE table_204_711 (
id number,
"dance" text,
"best dancer(s)" text,
"best score" number,
"worst dancer(s)" text,
"worst score" number
) | which is the last dance on the chart | SELECT "dance" FROM table_204_711 ORDER BY id DESC LIMIT 1 |
CREATE TABLE table_57035 (
"Date" text,
"Tournament" text,
"Location" text,
"Purse( $ )" real,
"Winner" text,
"Score" text,
"1st Prize( $ )" real
) | What is the winner for Virginia? | SELECT "Winner" FROM table_57035 WHERE "Location" = 'virginia' |
CREATE TABLE table_6148 (
"Year" real,
"Finish position" text,
"1st day" text,
"2nd day" text,
"3rd day" text,
"4th Day" text
) | What is the 3rd day that has bumped by clare as the 4th day? | SELECT "3rd day" FROM table_6148 WHERE "4th Day" = 'bumped by clare' |
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 the number of patients whose year of birth is less than 2056 and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Pleural" |
CREATE TABLE device (
Software_Platform VARCHAR
) | Please show different software platforms and the corresponding number of devices using each. | SELECT Software_Platform, COUNT(*) FROM device GROUP BY Software_Platform |
CREATE TABLE table_name_62 (
a330 VARCHAR,
a310 VARCHAR
) | What is the A330 and the A310 wide? | SELECT a330 FROM table_name_62 WHERE a310 = "wide" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.