table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_14502 (
"Status" text,
"Name" text,
"First Performance" text,
"Last Performance" text,
"Style" text
) | What is the date of the First Performance of Rhys Kosakowski as Billy Elliot in the Original Cast? | SELECT "First Performance" FROM table_14502 WHERE "Status" = 'original cast' AND "Name" = 'rhys kosakowski' |
CREATE TABLE table_19007 (
"Rank" real,
"Airport" text,
"Total Passengers" real,
"% Change 2007/2008" text,
"International Passengers" real,
"Domestic Passengers" real,
"Transit Passengers" real,
"Aircraft Movements" real,
"Freight ( Metric Tonnes )" real
) | What is the total number of passengers of the airport ranked 15? | SELECT "International Passengers" FROM table_19007 WHERE "Rank" = '15' |
CREATE TABLE table_name_47 (
bronze INTEGER,
rank VARCHAR,
gold VARCHAR
) | What is the sum of Bronze when the rank is more than 11 and gold is less than 0? | SELECT SUM(bronze) FROM table_name_47 WHERE rank > 11 AND gold < 0 |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description... | Number of posts with a tag name grouped by day. | SELECT DATE(CreationDate), COUNT(PostId) FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Tags.TagName = '##TagName:string##' GROUP BY DATE(CreationDate) ORDER BY DATE(CreationDate) |
CREATE TABLE table_name_51 (
laps VARCHAR,
grid VARCHAR,
rider VARCHAR
) | How many Laps have Grid larger than 14, and a Rider of sylvain guintoli? | SELECT COUNT(laps) FROM table_name_51 WHERE grid > 14 AND rider = "sylvain guintoli" |
CREATE TABLE table_4042 (
"School" text,
"Gender" text,
"Age Range" text,
"Religious Affiliation" text,
"Location" text,
"School website" text
) | Which school has a website of http://www.sjfisher.herts.sch.uk/? | SELECT "School" FROM table_4042 WHERE "School website" = 'http://www.sjfisher.herts.sch.uk/' |
CREATE TABLE table_8321 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the attendance when they played the New Orleans Saints? | SELECT "Attendance" FROM table_8321 WHERE "Opponent" = 'new orleans saints' |
CREATE TABLE table_30991 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What are the results of those matches where the championship is French Open? | SELECT "Score" FROM table_30991 WHERE "Championship" = 'French Open' |
CREATE TABLE table_46705 (
"Name" text,
"Latitude" text,
"Longitude" text,
"Diameter (km)" real,
"Year named" real,
"Name origin" text
) | What was the year when the diameter was 729 km? | SELECT "Year named" FROM table_46705 WHERE "Diameter (km)" = '729' |
CREATE TABLE procedures (
code number,
name text,
cost number
)
CREATE TABLE affiliated_with (
physician number,
department number,
primaryaffiliation boolean
)
CREATE TABLE room (
roomnumber number,
roomtype text,
blockfloor number,
blockcode number,
unavailable boolean
)
... | Sort the list of names and costs of all procedures in the descending order of cost. | SELECT name, cost FROM procedures ORDER BY cost DESC |
CREATE TABLE table_name_97 (
samurai VARCHAR,
stampede VARCHAR
) | Name the samurai for stampede of t. mask | SELECT samurai FROM table_name_97 WHERE stampede = "t. mask" |
CREATE TABLE table_12687 (
"Season" text,
"GP/MP" text,
"Kills" real,
"K/Game" real,
"Errors" real,
"Total Attempts" real,
"Percentage" real,
"Assists" real,
"Service Aces" real,
"Digs" real,
"Solo Blocks" real,
"Block Assists" real,
"Total Blocks" real
) | When the percentage is 0.34900000000000003 with more than 13 solo blocks and less than 4713 total attempts, what is the greatest assists? | SELECT MAX("Assists") FROM table_12687 WHERE "Percentage" < '0.34900000000000003' AND "Solo Blocks" > '13' AND "Total Attempts" < '4713' |
CREATE TABLE table_1405704_1 (
team VARCHAR,
race_name VARCHAR,
engine VARCHAR
) | What team raced with a Foyt engine in the Texas Grand Prix? | SELECT team FROM table_1405704_1 WHERE race_name = "Texas Grand Prix" AND engine = "Foyt" |
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
)
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
... | Show different parties of people along with the number of people in each party with a bar chart, and I want to order by the X in ascending please. | SELECT Party, COUNT(*) FROM people GROUP BY Party ORDER BY Party |
CREATE TABLE table_name_80 (
score VARCHAR,
player VARCHAR,
country VARCHAR,
place VARCHAR
) | What is the score for the United States in place T1 for David Duval? | SELECT score FROM table_name_80 WHERE country = "united states" AND place = "t1" AND player = "david duval" |
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 labevents (
row_id number,
subje... | what is patient 55281's first urine out foley output time on the current intensive care unit visit? | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281) AND icustays.outtime IS NULL) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_item... |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | what is the drug route for drug ciprobase? | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "CIPROBASE" |
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... | give me the number of patients whose procedure long title is radical neck dissection, unilateral and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Radical neck dissection, unilateral" AND lab."CATEGORY" = "Blood Gas" |
CREATE TABLE table_name_20 (
result VARCHAR,
score VARCHAR
) | What is the result when the score is 0-2? | SELECT result FROM table_name_20 WHERE score = "0-2" |
CREATE TABLE table_10812403_4 (
position VARCHAR,
pick__number VARCHAR
) | How many people were pick #30? | SELECT COUNT(position) FROM table_10812403_4 WHERE pick__number = 30 |
CREATE TABLE table_2732 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who was the opponent in the game held on February 4? | SELECT "Team" FROM table_2732 WHERE "Date" = 'February 4' |
CREATE TABLE table_47146 (
"Company" text,
"Type" text,
"Principal activities" text,
"Incorporated in" text,
"Group's Equity Shareholding" text
) | Which Type has an Incorporated in of netherlands, a Principal activities of airline, and a Company of transavia.com? | SELECT "Type" FROM table_47146 WHERE "Incorporated in" = 'netherlands' AND "Principal activities" = 'airline' AND "Company" = 'transavia.com' |
CREATE TABLE table_name_22 (
lane VARCHAR,
heat VARCHAR,
nationality VARCHAR
) | What lane number was Hungary and had a heat of 4? | SELECT COUNT(lane) FROM table_name_22 WHERE heat = 4 AND nationality = "hungary" |
CREATE TABLE table_62007 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | What kind of the Winning driver has a Circuit of saint-rapha l? | SELECT "Winning driver" FROM table_62007 WHERE "Circuit" = 'saint-raphaël' |
CREATE TABLE table_1566850_8 (
centerfold_model VARCHAR,
pictorials VARCHAR
) | Who was the centerfold model when a pictorial was done on marilyn monroe? | SELECT centerfold_model FROM table_1566850_8 WHERE pictorials = "Marilyn Monroe" |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_co... | what are the flights available after 1800 between SAN FRANCISCO and 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.departure_time > 1800 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... |
CREATE TABLE table_26678 (
"Region/Country" text,
"Local name" text,
"Main presenter" text,
"Network" text,
"Year premiered" real
) | Who is every main presenter for the year 2011? | SELECT "Main presenter" FROM table_26678 WHERE "Year premiered" = '2011' |
CREATE TABLE table_name_26 (
opponent_in_the_final VARCHAR,
surface VARCHAR,
date VARCHAR
) | Which final opponent's surface was hard (i) and participated on October 9, 2005? | SELECT opponent_in_the_final FROM table_name_26 WHERE surface = "hard (i)" AND date = "october 9, 2005" |
CREATE TABLE table_58151 (
"Runs" text,
"Player" text,
"Opponent" text,
"Venue" text,
"Season" text
) | During runs 332, what was the venue? | SELECT "Venue" FROM table_58151 WHERE "Runs" = '332' |
CREATE TABLE table_28190534_1 (
engine VARCHAR,
entrant VARCHAR
) | Name the engine for ecurie lutetia | SELECT engine FROM table_28190534_1 WHERE entrant = "Ecurie Lutetia" |
CREATE TABLE table_33591 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was home team Essendon's opponents score? | SELECT "Away team score" FROM table_33591 WHERE "Home team" = 'essendon' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id numbe... | what is the last ward id patient 11914 got in their first hospital visit. | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11914 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND NOT transfers.wardid IS NULL ORDER BY transfers.intime DESC LIMIT 1 |
CREATE TABLE table_name_4 (
location_attendance VARCHAR,
record VARCHAR
) | What is the location/ attendance for a 35-28 record? | SELECT location_attendance FROM table_name_4 WHERE record = "35-28" |
CREATE TABLE table_3255 (
"Information" text,
"James E. Holmes" text,
"Reidsville" text,
"Rockingham County" text,
"Western Rockingham Middle School" text
) | Name the james e. holmes for erselle young | SELECT "James E. Holmes" FROM table_3255 WHERE "Reidsville" = 'Erselle Young' |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name var... | i would like to fly from BOSTON to BALTIMORE | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMO... |
CREATE TABLE Documents (
document_name VARCHAR,
document_id VARCHAR,
document_type_code VARCHAR
) | Find names and ids of all documents with document type code BK. | SELECT document_name, document_id FROM Documents WHERE document_type_code = "BK" |
CREATE TABLE table_56376 (
"State" text,
"Swimsuit" real,
"Evening gown" real,
"Interview" real,
"Average" real
) | Which state had an average of less than 8.67, a swimsuit score of 8.27, an evening gown score of 8.78, and an interview number of 8.52? | SELECT "State" FROM table_56376 WHERE "Average" < '8.67' AND "Swimsuit" = '8.27' AND "Evening gown" = '8.78' AND "Interview" = '8.52' |
CREATE TABLE table_63979 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | what is the date when the competition is 1996 tiger cup and the result is drew? | SELECT "Date" FROM table_63979 WHERE "Competition" = '1996 tiger cup' AND "Result" = 'drew' |
CREATE TABLE orders (
order_id number,
customer_id number,
order_status text,
date_order_placed time,
order_details text
)
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE customers (
customer_id number,
customer_name text,
customer_details ... | Find the ids of all the order items whose product id is 11. | SELECT order_item_id FROM order_items WHERE product_id = 11 |
CREATE TABLE table_name_52 (
class VARCHAR,
rank VARCHAR
) | Which class had a rank of 2nd? | SELECT class FROM table_name_52 WHERE rank = "2nd" |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of price , and group by attribute name, and order X-axis in asc order. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE journal (
journalid int,
jo... | papers about character recognition from before 2010 | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'character recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year < 2010 |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
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 Lives_in (
stuid INTEGER,
... | Bar graph to show maximal age from different sex, and could you list Sex from high to low order? | SELECT Sex, MAX(Age) FROM Student GROUP BY Sex ORDER BY Sex DESC |
CREATE TABLE table_name_44 (
game VARCHAR,
opponent VARCHAR
) | Opponent of @ atlanta flames had what game? | SELECT game FROM table_name_44 WHERE opponent = "@ atlanta flames" |
CREATE TABLE table_36896 (
"Country" text,
"Date" text,
"Label" text,
"Format" text,
"Catalogue #" text
) | What Country is Catalogue # ASW 50248 (724385024825) from? | SELECT "Country" FROM table_36896 WHERE "Catalogue #" = 'asw 50248 (724385024825)' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
... | what was the first care unit of patient 22204's ward until 2 years ago? | SELECT transfers.careunit FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22204) AND NOT transfers.careunit IS NULL AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-2 year') ORDER BY transfers.intime LIMIT 1 |
CREATE TABLE table_name_84 (
money___ INTEGER,
player VARCHAR,
score VARCHAR
) | Can you tell me the sum of Money ($) that has the Score of 69-72-67-71=279, and the Player of loren roberts? | SELECT SUM(money___) AS $__ FROM table_name_84 WHERE score = 69 - 72 - 67 - 71 = 279 AND player = "loren roberts" |
CREATE TABLE table_26336739_1 (
elected INTEGER,
incumbent VARCHAR
) | What date was the district incumbent Saxby Chambliss elected? | SELECT MAX(elected) FROM table_26336739_1 WHERE incumbent = "Saxby Chambliss" |
CREATE TABLE staff (
staff_id number,
gender text,
first_name text,
last_name text,
email_address text,
phone_number text
)
CREATE TABLE complaints (
complaint_id number,
product_id number,
customer_id number,
complaint_outcome_code text,
complaint_status_code text,
comp... | Find the address line 1 and 2 of the customer with email 'vbogisich@example.org'. | SELECT address_line_1, address_line_2 FROM customers WHERE email_address = "vbogisich@example.org" |
CREATE TABLE table_2668416_7 (
district VARCHAR,
party VARCHAR,
candidates VARCHAR
) | What is the district for the party federalist and the candidates are william craik (f) 51.0% benjamin edwards 49.0%? | SELECT district FROM table_2668416_7 WHERE party = "Federalist" AND candidates = "William Craik (F) 51.0% Benjamin Edwards 49.0%" |
CREATE TABLE table_204_127 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"opponent" text,
"score" text
) | which surface was played on the least ? | SELECT "surface" FROM table_204_127 GROUP BY "surface" ORDER BY COUNT(*) LIMIT 1 |
CREATE TABLE table_68903 (
"Rank" real,
"Country/Region" text,
"Population" real,
"Area (km 2 )" real,
"Density (Pop. per km 2 )" real
) | What is the lowest area of the region with a population less than 22,955,395 in Bangladesh with a density less than 1034? | SELECT MIN("Area (km 2 )") FROM table_68903 WHERE "Population" < '22,955,395' AND "Country/Region" = 'bangladesh' AND "Density (Pop. per km 2 )" < '1034' |
CREATE TABLE table_68530 (
"Venue" text,
"City" text,
"Tickets Sold / Available" text,
"Gross Revenue (1979)" text,
"Gross Revenue (2012)" text
) | Which venue has Tickets Sold/ Available with a Gross Revenue (1979) of $665,232? | SELECT "Tickets Sold / Available" FROM table_68530 WHERE "Gross Revenue (1979)" = '$665,232' |
CREATE TABLE table_2523 (
"Rank" real,
"School" text,
"Basic Elements" real,
"Tumbling" real,
"Stunts" text,
"Pyramids" text,
"Tosses" text,
"Deductions" text,
"Total" text
) | What is every total for the University of the Cordilleras UC Dance Squad? | SELECT "Total" FROM table_2523 WHERE "School" = 'University of the Cordilleras UC Dance Squad' |
CREATE TABLE table_77191 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | what is the date when the round is sf? | SELECT "Date" FROM table_77191 WHERE "Round" = 'sf' |
CREATE TABLE table_13625792_1 (
total__number VARCHAR,
bush__percentage VARCHAR
) | In the county where Bush won 77.76%, how many total votes were cast? | SELECT total__number FROM table_13625792_1 WHERE bush__percentage = "77.76%" |
CREATE TABLE table_18824 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many pairs of numbers are under record on April 12? | SELECT COUNT("Record") FROM table_18824 WHERE "Date" = 'April 12' |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local... | Bar graph to show the average of high temperature from different day of week, and could you show y axis in ascending order? | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
even... | retrieve the patients' ids who are diagnosed with streptococcus unspecf since 2103. | SELECT admissions.subject_id FROM admissions WHERE admissions.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 = 'streptococcus unspecf') AND STRFTIME('%y', diagnoses_icd.charttime) >= '21... |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTask... | Highest reputation users with a specific badge. | SELECT RANK() OVER (ORDER BY u.Reputation DESC) AS Rank, u.Id AS "user_link", u.Reputation, COUNT(b.Id) AS "count" FROM Badges AS b INNER JOIN Users AS u ON b.UserId = u.Id WHERE (b.Name = '##name?Famous Question##') GROUP BY u.Id, u.Reputation ORDER BY u.Reputation DESC LIMIT 500 |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground_service (
city_code text,
airp... | all flights leaving WASHINGTON to SAN FRANCISCO that are FIRST class | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND fare_basis.class_type = 'FIRST' AND far... |
CREATE TABLE table_74942 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | If the Played was played, what is the lost? | SELECT "Lost" FROM table_74942 WHERE "Played" = 'played' |
CREATE TABLE table_20856 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race time" text,
"Average speed (mph)" text,
"Report" text
) | Name the driver for race time being 2:34:21 | SELECT "Driver" FROM table_20856 WHERE "Race time" = '2:34:21' |
CREATE TABLE table_12473 (
"State" text,
"Type" text,
"Name" text,
"Title" text,
"Royal house" text,
"From" text
) | What state is Ding and has a royal house of Ji? | SELECT "State" FROM table_12473 WHERE "Royal house" = 'ji' AND "Name" = 'ding' |
CREATE TABLE table_72449 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many tries against got the club with 62 tries for? | SELECT "Tries against" FROM table_72449 WHERE "Tries for" = '62' |
CREATE TABLE table_43805 (
"Release date" text,
"Album title" text,
"Record label" text,
"Disc number" text,
"Track number" text,
"Title" text
) | Which Track number has a Album title of , and a Title of ? | SELECT "Track number" FROM table_43805 WHERE "Album title" = '文武双全升级版' AND "Title" = '老爸你别装酷' |
CREATE TABLE table_12985 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | Which Election has a 2nd Member of reform act 1867 : constituency abolished? | SELECT "Election" FROM table_12985 WHERE "2nd Member" = 'reform act 1867 : constituency abolished' |
CREATE TABLE orders (
order_id number,
customer_id number,
order_status text,
date_order_placed time,
order_details text
)
CREATE TABLE shipments (
shipment_id number,
order_id number,
invoice_number number,
shipment_tracking_number text,
shipment_date time,
other_shipment_d... | Find the name of the customers who have at most two orders. | SELECT T2.customer_name FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T2.customer_id HAVING COUNT(*) <= 2 |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
... | until 2102 how many patients were prescribed cefazolin (ancef) in dextrose ivpb 2 g during the same month after being diagnosed with cholecystitis - acute? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'cholecystitis - acute' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2102') AS t1 JOIN (SELECT patient.uni... |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | what is the number of patients whose admission type is urgent and with lab test item id 50980? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.itemid = "50980" |
CREATE TABLE table_name_21 (
site_stadium VARCHAR,
date VARCHAR
) | On March 23, what is the site/stadium? | SELECT site_stadium FROM table_name_21 WHERE date = "march 23" |
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,
... | tell me the number of medicaid insurance patients who had procedure icd9 code 4432. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.icd9_code = "4432" |
CREATE TABLE table_64311 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | When against is 797 and wins is more than 10, what is the sum of draws? | SELECT COUNT("Draws") FROM table_64311 WHERE "Against" = '797' AND "Wins" > '10' |
CREATE TABLE table_name_21 (
no_result VARCHAR,
wins INTEGER
) | How many total No Results are recorded for less than 6 wins? | SELECT COUNT(no_result) FROM table_name_21 WHERE wins < 6 |
CREATE TABLE documents_mailed (
document_id number,
mailed_to_address_id number,
mailing_date time
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_description text
)
CREATE TABLE ref_document_status (
document_status_code text,
document_status_description text
)
... | What is the description of document status code 'working'? | SELECT document_status_description FROM ref_document_status WHERE document_status_code = "working" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | find the maximum age of patients whose admission location is emergency room and primary disease is copd exacerbation. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "COPD EXACERBATION" |
CREATE TABLE table_38834 (
"Distance" text,
"Time" text,
"Date" text,
"Location" text,
"Notes" text
) | What's the date when the location is Berlin? | SELECT "Date" FROM table_38834 WHERE "Location" = 'berlin' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | Find the route of administration for medication with a GELCLAIR drug code. | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "GELCLAIR" |
CREATE TABLE table_7725 (
"Nat." text,
"Name" text,
"Moving from" text,
"Type" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text
) | What was the transfer fee for the player ending in 2011 and moving from Thrasyvoulos? | SELECT "Transfer fee" FROM table_7725 WHERE "Ends" = '2011' AND "Moving from" = 'thrasyvoulos' |
CREATE TABLE table_66377 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the attendance in a week earlier than 4, and result is w 31-20? | SELECT AVG("Attendance") FROM table_66377 WHERE "Week" < '4' AND "Result" = 'w 31-20' |
CREATE TABLE table_name_49 (
genre VARCHAR,
developer VARCHAR
) | In what genre did Microvision develop a game? | SELECT genre FROM table_name_49 WHERE developer = "microvision" |
CREATE TABLE table_50446 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Transfer fee" text
) | What is the name of the player with a transfer window in summer, an undisclosed transfer fee, and is moving from brussels? | SELECT "Name" FROM table_50446 WHERE "Transfer window" = 'summer' AND "Transfer fee" = 'undisclosed' AND "Moving from" = 'brussels' |
CREATE TABLE table_31778 (
"Year" real,
"Date" text,
"Event" text,
"Days" text,
"Stages" text,
"Acts" text
) | I want to know the events for 106 bands | SELECT "Event" FROM table_31778 WHERE "Acts" = '106 bands' |
CREATE TABLE table_name_97 (
name VARCHAR,
qual_2 VARCHAR
) | What name has a qual 2 of 1:43.374? | SELECT name FROM table_name_97 WHERE qual_2 = "1:43.374" |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fl... | i'd like the earliest flight from DALLAS 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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... |
CREATE TABLE table_name_92 (
place INTEGER,
year VARCHAR,
clean_and_jerk VARCHAR
) | What was the highest place result in 2010 with a Clean and Jerk weight of 224kg? | SELECT MAX(place) FROM table_name_92 WHERE year = 2010 AND clean_and_jerk = "224kg" |
CREATE TABLE table_28027307_1 (
us_viewers__millions_ VARCHAR,
production_code VARCHAR
) | How many millions of U.S. viewers watched the episode with the production code of 6AKY07? | SELECT us_viewers__millions_ FROM table_28027307_1 WHERE production_code = "6AKY07" |
CREATE TABLE table_name_57 (
origin VARCHAR,
in_service VARCHAR
) | For the vessel with a listed In service of 1, what is the origin given? | SELECT origin FROM table_name_57 WHERE in_service = 1 |
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 demographic (
subject_id text,
hadm_id t... | give the number of patients whose insurance is government and lab test name is hematocrit, other fluid. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Hematocrit, Other Fluid" |
CREATE TABLE table_16748 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | what is the report where the location is kyalami? | SELECT "Report" FROM table_16748 WHERE "Location" = 'Kyalami' |
CREATE TABLE table_15161 (
"Year" text,
"League" text,
"Position" text,
"Leading Scorer" text,
"Goals" real
) | Goals that has a Position of 14th of 24, and a League of football conference has what sum? | SELECT SUM("Goals") FROM table_15161 WHERE "Position" = '14th of 24' AND "League" = 'football conference' |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Visualize a scatter chart about the correlation between Team_ID and School_ID , and group by attribute Team_Name. | SELECT Team_ID, School_ID FROM basketball_match GROUP BY Team_Name |
CREATE TABLE table_name_23 (
location VARCHAR,
name VARCHAR
) | What is the Location when the name is telmatosaurus? | SELECT location FROM table_name_23 WHERE name = "telmatosaurus" |
CREATE TABLE table_25049 (
"Rank Subcontinent" real,
"Rank Asia" real,
"Rank World" real,
"Country" text,
"2011 GDP (PPP) billions of USD" text
) | Name the least rank subcontinent for bangladesh | SELECT MIN("Rank Subcontinent") FROM table_25049 WHERE "Country" = 'Bangladesh' |
CREATE TABLE table_name_89 (
home_team VARCHAR,
away_team VARCHAR
) | Who is the home team when Preston North End is the away team? | SELECT home_team FROM table_name_89 WHERE away_team = "preston north end" |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and the amount of name , and group by attribute name, and rank from high to low by the bars please. | SELECT T2.Name, COUNT(T2.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
CREATE TABLE table_65612 (
"Wimmera FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | How many Byes have Wins smaller than 11, and a Wimmera FL of minyip murtoa, and Losses smaller than 6? | SELECT COUNT("Byes") FROM table_65612 WHERE "Wins" < '11' AND "Wimmera FL" = 'minyip murtoa' AND "Losses" < '6' |
CREATE TABLE table_2518850_4 (
year_of_previous_participation VARCHAR,
prefecture VARCHAR
) | What was the year of previous participation for the school in the Kagoshima prefecture? | SELECT year_of_previous_participation FROM table_2518850_4 WHERE prefecture = "Kagoshima" |
CREATE TABLE table_16617025_1 (
written_by VARCHAR,
season__number VARCHAR
) | Who wrote Season 8? | SELECT written_by FROM table_16617025_1 WHERE season__number = 8 |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 ti... | show me the patient ids who are diagnosed with b-complex defic nec in 2101. | SELECT admissions.subject_id FROM admissions WHERE admissions.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 = 'b-complex defic nec') AND STRFTIME('%y', diagnoses_icd.charttime) = '2101'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.