table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_18503 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What was the final result for Craig Hosmer? | SELECT "Result" FROM table_18503 WHERE "Incumbent" = 'Craig Hosmer' |
CREATE TABLE table_37596 (
"Date" text,
"Event" text,
"Circuit" text,
"Driver" text,
"Race" text
) | Which Driver has a Date of 16th september 1951, and a Race of dns? | SELECT "Driver" FROM table_37596 WHERE "Date" = '16th september 1951' AND "Race" = 'dns' |
CREATE TABLE table_31718 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text
) | Who is the owner of the branding gx94? | SELECT "Owner" FROM table_31718 WHERE "Branding" = 'gx94' |
CREATE TABLE table_20520 (
"Member State" text,
"Population in millions" text,
"Population % of EU" text,
"Area km 2" real,
"Area % of EU" text,
"Pop. density People/km 2" text
) | Name the population density where population % is 1.1% for slovakia | SELECT "Pop. density People/km 2" FROM table_20520 WHERE "Population % of EU" = '1.1%' AND "Member State" = 'Slovakia' |
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 int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | great now what i want to find out is on 4 20 from WASHINGTON to DENVER do you have a flight least expensive fare around 5 o'clock in the morning | SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, ... |
CREATE TABLE table_38691 (
"Career Card" text,
"Starting career/salary" text,
"2nd career/salary" text,
"3rd career/salary" text,
"4th career/salary" text,
"5th career/salary" text,
"6th career/salary" text
) | 2nd career/salary of substitute teacher ($20,000) involves what 6th career/salary? | SELECT "6th career/salary" FROM table_38691 WHERE "2nd career/salary" = 'substitute teacher ($20,000)' |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
... | Getting List of All users. | SELECT * FROM Users WHERE Location = 'Tehran' |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
De... | Top 50 Users of a Tag (based on upvotes). | SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, Users.Id AS "user_link", COUNT(*) AS UpVotes, Reputation AS TotalReputation FROM Users INNER JOIN Tags ON Tags.TagName = '##TagName##' INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes... |
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 state (
state_code text,
state_name text,
country_name text
)
CREATE T... | could you please tell me the cheapest fare from ATLANTA to BOSTON | 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, fare, flight, flight_fare 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... |
CREATE TABLE table_48706 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | Which Game has a Home Team of san francisco, and a Date of april 22? | SELECT "Game" FROM table_48706 WHERE "Home Team" = 'san francisco' AND "Date" = 'april 22' |
CREATE TABLE table_52930 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When did the home team score 19.17 (131)? | SELECT "Date" FROM table_52930 WHERE "Home team score" = '19.17 (131)' |
CREATE TABLE table_48029 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the score when the away team was brighton & hove albion? | SELECT "Score" FROM table_48029 WHERE "Away team" = 'brighton & hove albion' |
CREATE TABLE table_name_64 (
new_conference VARCHAR,
location VARCHAR
) | Which new conference is located in Greentown? | SELECT new_conference FROM table_name_64 WHERE location = "greentown" |
CREATE TABLE table_56390 (
"Product" text,
"2004" text,
"2003" text,
"2002" text,
"2001" text
) | What was the amount of grain in 2001? | SELECT "2001" FROM table_56390 WHERE "Product" = 'grain' |
CREATE TABLE table_203_573 (
id number,
"name" text,
"rank - 2000" number,
"number" number,
"country of origin" text,
"england - 2001" text
) | which name had the highest number ? | SELECT "name" FROM table_203_573 ORDER BY "number" DESC LIMIT 1 |
CREATE TABLE table_name_9 (
read_by VARCHAR,
un__abridged VARCHAR,
author VARCHAR
) | Who read the unabridged book written by Gary Paulsen? | SELECT read_by FROM table_name_9 WHERE un__abridged = "unabridged" AND author = "gary paulsen" |
CREATE TABLE table_19744915_22 (
total VARCHAR,
rank VARCHAR
) | How many different total points does the couple ranked at number 5 have? | SELECT COUNT(total) FROM table_19744915_22 WHERE rank = 5 |
CREATE TABLE book (
book_id number,
title text,
issues number,
writer text
)
CREATE TABLE publication (
publication_id number,
book_id number,
publisher text,
publication_date text,
price number
) | List the titles of books that are not published. | SELECT title FROM book WHERE NOT book_id IN (SELECT book_id FROM publication) |
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
t... | Next semester what classes will Dr. Stephanie Bolz be teaching ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Stephanie Bolz%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of... |
CREATE TABLE table_name_96 (
location VARCHAR,
opponent VARCHAR,
time VARCHAR
) | Where did the Lightning play the NY Rangers at 7:00 pm? | SELECT location FROM table_name_96 WHERE opponent = "ny rangers" AND time = "7:00 pm" |
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Maintenance_Engineers (
engineer_id INTEGER,
company_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
other_details VARCHAR(255)
)
CREATE TABLE Assets (
... | how many assets does each maintenance contract contain? List the number and the contract id. | SELECT COUNT(*), T1.maintenance_contract_id FROM Maintenance_Contracts AS T1 JOIN Assets AS T2 ON T1.maintenance_contract_id = T2.maintenance_contract_id GROUP BY T1.maintenance_contract_id |
CREATE TABLE table_name_24 (
played VARCHAR,
club VARCHAR
) | How many matches have Rhymney RFC played? | SELECT played FROM table_name_24 WHERE club = "rhymney rfc" |
CREATE TABLE table_name_48 (
country VARCHAR,
name VARCHAR
) | WHAT IS THE COUNTRY WITH NAME OF KANU? | SELECT country FROM table_name_48 WHERE name = "kanu" |
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 Financial_Transactions (
transaction_id INTEGER,
previous_transa... | Draw a bar chart of transaction type versus the total number | SELECT transaction_type, COUNT(*) FROM Financial_Transactions GROUP BY transaction_type |
CREATE TABLE table_75436 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
) | Which December has a Record of 4-3-6? | SELECT "December" FROM table_75436 WHERE "Record" = '4-3-6' |
CREATE TABLE table_name_69 (
name VARCHAR,
location VARCHAR
) | What bridge is in Mcville? | SELECT name FROM table_name_69 WHERE location = "mcville" |
CREATE TABLE table_name_2 (
gold_coast VARCHAR,
auckland VARCHAR,
melbourne VARCHAR,
adelaide VARCHAR
) | yes or no for the gold coast with yes for melbourne, yes for adelaide, yes for auckland? | SELECT gold_coast FROM table_name_2 WHERE melbourne = "yes" AND adelaide = "yes" AND auckland = "yes" |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id num... | what are the three most commonly prescribed medications for patients who have been diagnosed with aortocoronary bypass before during the same month, until 3 years ago? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 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 ... |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | get me the time of admission and discharge for patient with patient id 53707. | SELECT demographic.admittime, demographic.dischtime FROM demographic WHERE demographic.subject_id = "53707" |
CREATE TABLE table_204_561 (
id number,
"fence" number,
"name" text,
"jockey" text,
"age" number,
"handicap (st-lb)" text,
"starting price" text,
"fate" text
) | which horse was older , brown diamond or flamecap ? | SELECT "name" FROM table_204_561 WHERE "name" IN ('brown diamond', 'flamecap') ORDER BY "age" DESC LIMIT 1 |
CREATE TABLE table_204_296 (
id number,
"rank" number,
"athlete" text,
"qual" number,
"final" number,
"total" number,
"notes" text
) | which athlete has the most total ? | SELECT "athlete" FROM table_204_296 ORDER BY "total" DESC LIMIT 1 |
CREATE TABLE table_22893781_6 (
score VARCHAR,
location_attendance VARCHAR
) | Name the score for madison square garden 18,828 | SELECT score FROM table_22893781_6 WHERE location_attendance = "Madison Square Garden 18,828" |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
... | Posts with images hosted on ImageShack and 10+ score. | SELECT Posts.Id, Posts.Id AS "post_link", PostTypes.Name AS "type", Posts.Score, Posts.CreationDate, Posts.Tags FROM Posts JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Body LIKE '%<img%.https://archive.org/details/imageshack.us-20130319-043120%' AND Score >= 10 LIMIT 1000 |
CREATE TABLE table_1817879_2 (
length__miles_ VARCHAR,
endpoints VARCHAR
) | What is the lenth (miles) of endpoints westlake/macarthur park to wilshire/western? | SELECT length__miles_ FROM table_1817879_2 WHERE endpoints = "Westlake/MacArthur Park to Wilshire/Western" |
CREATE TABLE table_31396 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (million)" text
) | Who wrote the episode that was watched by 2.97 million U.S. viewers? | SELECT "Written by" FROM table_31396 WHERE "U.S. viewers (million)" = '2.97' |
CREATE TABLE table_train_280 (
"id" int,
"fpg" float,
"hemoglobin_a1c_hba1c" float,
"heart_disease" bool,
"renal_disease" bool,
"hba1c" float,
"body_mass_index_bmi" float,
"NOUSE" float
) | subjects should have fpg in the range of 6 to 11 mmol / l at screening and hba1c less than 10 % ( hba1c value according to international dcct standard ) . | SELECT * FROM table_train_280 WHERE fpg >= 6 AND fpg <= 11 AND hemoglobin_a1c_hba1c < 10 |
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... | provide the number of patients whose admission type is elective and drug name is fluconazole? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Fluconazole" |
CREATE TABLE table_197638_6 (
player VARCHAR,
us_open VARCHAR
) | Who won the US Open in 1937? | SELECT player FROM table_197638_6 WHERE us_open = 1937 |
CREATE TABLE table_20782 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | What was the kickoff time on monday, may 13? | SELECT "Kickoff" FROM table_20782 WHERE "Date" = 'Monday, May 13' |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | Provide the number of patients who were admitted before the year 2123 and had a lab test nonsquamous epithelial cell. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2123" AND lab.label = "NonSquamous Epithelial Cell" |
CREATE TABLE table_25321 (
"Game" text,
"Date" text,
"Champion" text,
"Score" text,
"Runner Up" text,
"Stadium" text,
"City" text,
"Ted Morris Memorial Trophy (Game MVP)" text,
"Bruce Coulter Award" text
) | Name the bruce coulter award for forrest kennerd | SELECT "Bruce Coulter Award" FROM table_25321 WHERE "Ted Morris Memorial Trophy (Game MVP)" = 'Forrest Kennerd' |
CREATE TABLE table_62404 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the to par for Fred Couples when the score is 68-66=134? | SELECT "To par" FROM table_62404 WHERE "Score" = '68-66=134' AND "Player" = 'fred couples' |
CREATE TABLE table_name_25 (
northumberland_senior_benevolent_bowl VARCHAR,
northumberland_minor_cup VARCHAR
) | Who won the Northumberland Senior Benevolent Bowl, when the Northumberland Minor Cup was won by Whitley Bay 'a'? | SELECT northumberland_senior_benevolent_bowl FROM table_name_25 WHERE northumberland_minor_cup = "whitley bay 'a'" |
CREATE TABLE table_204_177 (
id number,
"player" text,
"years played" text,
"total w-l" text,
"singles w-l" text,
"doubles w-l" text
) | who played for the most years ? | SELECT "player" FROM table_204_177 ORDER BY "years played" DESC LIMIT 1 |
CREATE TABLE table_46998 (
"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
) | What is Points, when Drawn is '1', and when Lost is '5'? | SELECT "Points" FROM table_46998 WHERE "Drawn" = '1' AND "Lost" = '5' |
CREATE TABLE table_48458 (
"Year" text,
"Date" text,
"Circuit" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | Which circuit did Peter Whitehead win? | SELECT "Circuit" FROM table_48458 WHERE "Winning driver" = 'peter whitehead' |
CREATE TABLE table_18871 (
"District" text,
"2010 Population (000)" real,
"2008 GDP (USD bn) a" text,
"2008 GDP per capita (USD) a" real,
"Agri culture b" text,
"Mining b" text,
"Manufac turing b" text,
"Services & cons truction b" text,
"Exports (USD mn) 2011" real,
"Median mo. ... | How low was the San Juan income? | SELECT "Income poverty f" FROM table_18871 WHERE "District" = 'San Juan' |
CREATE TABLE table_name_52 (
model VARCHAR,
cpu_speed VARCHAR
) | Which model has a CPU speed of 133mhz? | SELECT model FROM table_name_52 WHERE cpu_speed = "133mhz" |
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE election (
... | Compute the total population across county name as a pie chart. | SELECT County_name, Population FROM county |
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_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | Create a bar chart showing the total number across city, and I want to order by the bar in ascending. | SELECT city, COUNT(*) FROM station GROUP BY city ORDER BY city |
CREATE TABLE table_name_82 (
points INTEGER,
game INTEGER
) | How many points was before game 14? | SELECT SUM(points) FROM table_name_82 WHERE game < 14 |
CREATE TABLE table_name_69 (
pole_position VARCHAR,
race VARCHAR
) | Who had Pole position for the French Grand Prix? | SELECT pole_position FROM table_name_69 WHERE race = "french grand prix" |
CREATE TABLE table_name_15 (
category VARCHAR,
year VARCHAR
) | Name the category for 2013 | SELECT category FROM table_name_15 WHERE year = "2013" |
CREATE TABLE table_78890 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | What is the lowest drawn for entries with a lost of 13? | SELECT MIN("Drawn") FROM table_78890 WHERE "Lost" = '13' |
CREATE TABLE table_46818 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Who scored 74-70-67=211 and placed t5? | SELECT "Player" FROM table_46818 WHERE "Place" = 't5' AND "Score" = '74-70-67=211' |
CREATE TABLE table_name_60 (
total INTEGER,
to_par VARCHAR,
country VARCHAR
) | Can you tell me the average Total that has the To par smaller than 10, and the Country of south korea? | SELECT AVG(total) FROM table_name_60 WHERE to_par < 10 AND country = "south korea" |
CREATE TABLE table_name_77 (
rider_status VARCHAR,
team_country VARCHAR,
year VARCHAR
) | What is the rider status for the 1971 netherlands team? | SELECT rider_status FROM table_name_77 WHERE team_country = "netherlands" AND year = 1971 |
CREATE TABLE table_name_36 (
stage INTEGER,
finish VARCHAR,
year VARCHAR,
leader_at_the_summit VARCHAR
) | What is the highest stage number for a year later than 1948, leader at the summit was group, and finish was Bagn res-De-Bigorre? | SELECT MAX(stage) FROM table_name_36 WHERE year > 1948 AND leader_at_the_summit = "group" AND finish = "bagnères-de-bigorre" |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDat... | Users With the Highest Quality Posts (filter num posts). Enter the minimum number of posts that a user must have, and this will show the
users who have the highest reputation per post in that group. | SELECT Id AS "user_link", Reputation, Reputation * 1.0 / C.Cnt AS "rep_per_post" FROM Users AS U INNER JOIN (SELECT OwnerUserId, Cnt = COUNT(*) FROM Posts GROUP BY OwnerUserId HAVING COUNT(*) >= '##MinNumberOfPosts##') AS C ON U.Id = C.OwnerUserId ORDER BY 'rep_per_post' DESC |
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number
)
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_from time,
date_to time
)
CREATE TABLE staff (
staff_id number,
staff_gender text,
staff_name text
)
CREATE TABLE... | What are the ids of all products that were either ordered more than 3 times or have a cumulative amount purchased of above 80000? | SELECT product_id FROM order_items GROUP BY product_id HAVING COUNT(*) > 3 UNION SELECT product_id FROM product_suppliers GROUP BY product_id HAVING SUM(total_amount_purchased) > 80000 |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
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,
tough_... | How often does the class YIDDISH 531 meet ? | SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_i... |
CREATE TABLE table_44706 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
) | What was the away team that scored 63-69? | SELECT "Away team" FROM table_44706 WHERE "Score" = '63-69' |
CREATE TABLE Premises (
premise_id INTEGER,
premises_type VARCHAR(15),
premise_details VARCHAR(255)
)
CREATE TABLE Mailshot_Campaigns (
mailshot_id INTEGER,
product_category VARCHAR(15),
mailshot_name VARCHAR(80),
mailshot_start_date DATETIME,
mailshot_end_date DATETIME
)
CREATE TABLE ... | Show me the total number by outcome code in a histogram, and sort by the bar in descending. | SELECT outcome_code, COUNT(*) FROM Mailshot_Customers GROUP BY outcome_code ORDER BY outcome_code DESC |
CREATE TABLE Acceptance (
Submission_ID int,
Workshop_ID int,
Result text
)
CREATE TABLE workshop (
Workshop_ID int,
Date text,
Venue text,
Name text
)
CREATE TABLE submission (
Submission_ID int,
Scores real,
Author text,
College text
) | Show each author and the number of workshops they submitted to Show bar chart, show in asc by the total number. | SELECT Author, COUNT(DISTINCT T1.Workshop_ID) FROM Acceptance AS T1 JOIN submission AS T2 ON T1.Submission_ID = T2.Submission_ID ORDER BY COUNT(DISTINCT T1.Workshop_ID) |
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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients were admitted in emergency for hemodialysis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Hemodialysis" |
CREATE TABLE table_name_43 (
winner VARCHAR,
year VARCHAR,
date VARCHAR
) | Who was the winning team before 1956 on October 21? | SELECT winner FROM table_name_43 WHERE year < 1956 AND date = "october 21" |
CREATE TABLE table_5402 (
"Score" real,
"Opposition" text,
"Venue" text,
"City" text,
"Year" real
) | Which Score is the lowest one that has a Year of 1868? | SELECT MIN("Score") FROM table_5402 WHERE "Year" = '1868' |
CREATE TABLE table_22822559_4 (
location_attendance VARCHAR,
game VARCHAR
) | List the location and number of fans in attendance for game 7/ | SELECT COUNT(location_attendance) FROM table_22822559_4 WHERE game = 7 |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | calculate the number of patients who had had a creatinine lab test. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'creatinine') |
CREATE TABLE table_name_61 (
enrollment VARCHAR,
ihsaa_class VARCHAR
) | What is the total enrollment of the aa IHSAA class? | SELECT COUNT(enrollment) FROM table_name_61 WHERE ihsaa_class = "aa" |
CREATE TABLE table_37464 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the record for April 22? | SELECT "Record" FROM table_37464 WHERE "Date" = 'april 22' |
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 newborn patients had an oral drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.route = "ORAL" |
CREATE TABLE table_72725 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by:" text,
"Written by:" text,
"Original air date" text
) | Who was 'The Magic Necklace' written by? | SELECT "Written by:" FROM table_72725 WHERE "Title" = 'The Magic Necklace' |
CREATE TABLE table_14286908_1 (
year_of_last_win VARCHAR,
total_finals VARCHAR
) | In what year was the total finals at 10? | SELECT year_of_last_win FROM table_14286908_1 WHERE total_finals = 10 |
CREATE TABLE table_67664 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What is the record after the April 6 game? | SELECT "Record" FROM table_67664 WHERE "Date" = 'april 6' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | when did the first time patient 027-188709 had a intracranial/cerebral perfusion pressure monitoring - ventriculostomy performed on the current hospital encounter? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-188709' AND patient.hospitaldischargetime IS NULL)) AND treat... |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | tell me the average systemicsystolic of patient 005-87465 on this month/20? | SELECT AVG(vitalperiodic.systemicsystolic) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465')) AND NOT vitalperiodic.systemicsy... |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuest... | Find all users above given reputation. | SELECT Id AS "user_link", Reputation, CreationDate, DisplayName, LastAccessDate FROM Users WHERE (Reputation > '##rep##') AND (DisplayName LIKE '%user%') ORDER BY Reputation |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE restriction (
restriction_c... | get last flight from OAKLAND to SALT LAKE CITY on wednesday or first flight from OAKLAND to SALT LAKE CITY on thursday | SELECT DISTINCT flight_id FROM flight WHERE ((((departure_time = (SELECT MAX(FLIGHTalias1.departure_time) FROM flight AS FLIGHTalias1 WHERE ((FLIGHTalias1.flight_days IN (SELECT DAYSalias1.days_code FROM days AS DAYSalias1 WHERE DAYSalias1.day_name IN (SELECT DATE_DAYalias1.day_name FROM date_day AS DATE_DAYalias1 WHER... |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Cou... | Questions for which the accepted answer was posted on the same day they were asked. | SELECT datasource.SameDayAcceptedAnswer, datasource.TotalQuestions, CAST(datasource.SameDayAcceptedAnswer AS FLOAT) / CAST(datasource.TotalQuestions AS FLOAT) AS Ratio FROM (SELECT COUNT(acceptedresponses.questionid) AS SameDayAcceptedAnswer, allquestions.totalcount AS TotalQuestions FROM (SELECT question.Id AS questio... |
CREATE TABLE table_70228 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Pos." text,
"Class Pos." text
) | Which class has a Team of kouros racing team? | SELECT "Class" FROM table_70228 WHERE "Team" = 'kouros racing team' |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text... | show me the flights from DAL to other airports | SELECT DISTINCT flight.flight_id FROM airport, flight WHERE airport.airport_code = 'DAL' AND flight.from_airport = airport.airport_code |
CREATE TABLE airport (
id VARCHAR,
country VARCHAR,
name VARCHAR
)
CREATE TABLE flight (
pilot VARCHAR,
airport_id VARCHAR
) | What are the different pilot names who had piloted a flight in the country 'United States' or in the airport named 'Billund Airport'? | SELECT DISTINCT T2.pilot FROM airport AS T1 JOIN flight AS T2 ON T1.id = T2.airport_id WHERE T1.country = 'United States' OR T1.name = 'Billund Airport' |
CREATE TABLE table_50848 (
"Ride" text,
"Year Opened" real,
"Ride Manufacturer and Type" text,
"Minimum Height" text,
"Rating" real
) | What year has the ride flight deck and a rating of less than 5? | SELECT COUNT("Year Opened") FROM table_50848 WHERE "Ride" = 'flight deck' AND "Rating" < '5' |
CREATE TABLE table_1840 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | How many different people directed the episode titled 'Born under a bad sign'? | SELECT COUNT("Directed by") FROM table_1840 WHERE "Title" = 'Born Under a Bad Sign' |
CREATE TABLE table_204_428 (
id number,
"season" text,
"east superleague" text,
"east premier league" text,
"east region south division" text,
"east region central division" text,
"east region north division" text
) | which team has made the roll of honor more times in the east region south division : fauldhouse united or newtongrange star ? | SELECT "east region south division" FROM table_204_428 WHERE "east region south division" IN ('fauldhouse united', 'newtongrange star') GROUP BY "east region south division" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_22247 (
"Name" text,
"Notability" text,
"Reason for Seeking Refuge" text,
"Country" text,
"City" text,
"Missions Country" text,
"Start Date" text,
"End Date" text,
"Resolution" text
) | Which city has the missions city of Australia? | SELECT "City" FROM table_22247 WHERE "Missions Country" = 'Australia' |
CREATE TABLE table_name_83 (
drawn INTEGER,
games INTEGER
) | What is the lowest drawn that has games less than 7? | SELECT MIN(drawn) FROM table_name_83 WHERE games < 7 |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | Mentioned Ciro Santilli on AboutMe or DisplayName. | SELECT Id AS "user_link", Reputation, DisplayName, AboutMe FROM Users WHERE LOWER(AboutMe) LIKE '%ciro santilli%' OR LOWER(DisplayName) LIKE '%ciro santilli%' OR LOWER(AboutMe) LIKE '%895245%' OR LOWER(DisplayName) LIKE '%895245%' ORDER BY Reputation DESC LIMIT 256 |
CREATE TABLE table_name_96 (
team VARCHAR,
game VARCHAR
) | What is Team, when Game is '32'? | SELECT team FROM table_name_96 WHERE game = 32 |
CREATE TABLE table_204_217 (
id number,
"camp" text,
"div sec\ndivision" text,
"admin\ndistrict" text,
"9 feb" number,
"11 feb" number,
"16 feb" number,
"25 feb" number,
"27 feb" number,
"2 mar" number,
"4 mar" number,
"6 mar" number,
"11 mar" number,
"13 mar" num... | which one is the top camp on feb. .9 | SELECT "camp" FROM table_204_217 ORDER BY "9 feb" DESC LIMIT 1 |
CREATE TABLE table_name_40 (
shooter VARCHAR,
score_points VARCHAR
) | Which Shooter has Score points of olympic silver medalist? | SELECT shooter FROM table_name_40 WHERE score_points = "olympic silver medalist" |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABL... | count the number of patients who were diagnosed with unarmed fight or brawl within 2 months after being diagnosed with renal & ureteral dis nos in 2102. | 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 = 'unarmed fight or b... |
CREATE TABLE table_1123802_1 (
_takeoff VARCHAR,
power VARCHAR,
engine VARCHAR
) | When the engine is Wasp Jr. T1B2, what is the number needed for takeoff power? | SELECT COUNT(power), _takeoff FROM table_1123802_1 WHERE engine = "Wasp Jr. T1B2" |
CREATE TABLE table_name_64 (
games INTEGER,
assists INTEGER
) | What's the highest amount of Games recorded that have more than 10 assists? | SELECT MAX(games) FROM table_name_64 WHERE assists > 10 |
CREATE TABLE table_42934 (
"State" text,
"White (%)" real,
"Brown (%)" real,
"Black (%)" real,
"Asian or Amerindian (%)" real
) | What is the sum of White (%), when Black (%) is less than 5,8, and when Asian or Amerindian (%) is less than 0,2? | SELECT SUM("White (%)") FROM table_42934 WHERE "Black (%)" < '5,8' AND "Asian or Amerindian (%)" < '0,2' |
CREATE TABLE table_name_76 (
guest VARCHAR,
score__first_match_ VARCHAR
) | Who were the guest team wehn the match score was 3:0 (0:2)? | SELECT guest FROM table_name_76 WHERE score__first_match_ = "3:0 (0:2)" |
CREATE TABLE table_name_86 (
opponent VARCHAR,
score VARCHAR
) | What team was the opponent when the score was 7 1? | SELECT opponent FROM table_name_86 WHERE score = "7–1" |
CREATE TABLE table_15135 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | On which surface was the score w/o? | SELECT "Surface" FROM table_15135 WHERE "Score" = 'w/o' |
CREATE TABLE table_203_581 (
id number,
"club" text,
"chinese" text,
"city" text,
"home stadium" text,
"capacity" number,
"average attendance" number
) | how many clubs are listed in the table ? | SELECT COUNT("club") FROM table_203_581 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.