table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_11988 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest rank when the metal total is 1 and the nation is the United Kingdom? | SELECT MAX("Rank") FROM table_11988 WHERE "Total" = '1' AND "Nation" = 'united kingdom' |
CREATE TABLE table_15269 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | When has an Attendance larger than 20,066 in tampa bay? | SELECT "Date" FROM table_15269 WHERE "Attendance" > '20,066' AND "Home" = 'tampa bay' |
CREATE TABLE table_1449176_1 (
altitude__mslm_ VARCHAR,
area__km_2__ VARCHAR
) | How many altitudes does the common with an area of 130.7 km^2 have? | SELECT COUNT(altitude__mslm_) FROM table_1449176_1 WHERE area__km_2__ = "130.7" |
CREATE TABLE table_name_61 (
object_type VARCHAR,
ngc_number VARCHAR,
right_ascension___j2000__ VARCHAR
) | What type of object has an NGC number higher than 2090 and has a right ascension (J2000) of 05h52m19s? | SELECT object_type FROM table_name_61 WHERE ngc_number > 2090 AND right_ascension___j2000__ = "05h52m19s" |
CREATE TABLE customers (
payment_method VARCHAR
) | What are all the payment methods? | SELECT DISTINCT payment_method FROM customers |
CREATE TABLE table_71183 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the result of the match on January 26, 2006? | SELECT "Result" FROM table_71183 WHERE "Date" = 'january 26, 2006' |
CREATE TABLE table_50164 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | What is 1st Leg, when Team #2 is 'Emelec'? | SELECT "1st leg" FROM table_50164 WHERE "Team #2" = 'emelec' |
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 aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | show me flights from PHILADELPHIA to OAKLAND on friday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OAKLAND' AND date_day.day_number = 25 AND date_day.month_number = 6 AND d... |
CREATE TABLE table_37467 (
"Team" text,
"Location" text,
"Venue" text,
"Capacity" real,
"Position in 2003" text
) | What is the Location for Belshina? | SELECT "Location" FROM table_37467 WHERE "Team" = 'belshina' |
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE appellations (
no numbe... | Find the appelations that produce wines after the year of 2008 but not in Central Coast area. | SELECT appelation FROM wine WHERE year > 2008 EXCEPT SELECT appelation FROM appellations WHERE area = "Central Coast" |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_labitems... | what drug has patient 77177 been prescribed two or more times? | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 77177) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 >= 2 |
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 prescriptions (
subject_id text,
hadm_id... | count the number of patients whose gender is f and diagnoses icd9 code is 2809? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "2809" |
CREATE TABLE Documents_Mailed (
mailing_date VARCHAR,
document_id VARCHAR
) | What is the mail date of the document with id 7? | SELECT mailing_date FROM Documents_Mailed WHERE document_id = 7 |
CREATE TABLE table_59660 (
"Name" text,
"Residence" text,
"Party" text,
"Years in Assembly" text,
"Years in Senate" text
) | Which Years in Senate has a Years in Assembly of 2010 present, and toni atkins? | SELECT "Years in Senate" FROM table_59660 WHERE "Years in Assembly" = '2010–present' AND "Name" = 'toni atkins' |
CREATE TABLE table_40181 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" real,
"Year" text,
"Hometown (Previous school)" text
) | What is the Year of the person who is 6'1', and weighs more than 165? | SELECT "Year" FROM table_40181 WHERE "Height" = '6''1' AND "Weight" > '165' |
CREATE TABLE table_14544 (
"Tournament" text,
"2007" text,
"2008" text,
"2009" text,
"2011" text,
"2012" text,
"2013" text
) | How many sets were played in the 2011 tournament, in which 2R were played in 2008? | SELECT "2011" FROM table_14544 WHERE "2008" = '2r' |
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... | Users above 1k rep, sorted by highest rep. | SELECT u.DisplayName, u.Reputation, a.AnswersCount, u.Reputation / a.AnswersCount AS RepPerAnswer FROM Users AS u JOIN (SELECT COUNT(1) AS AnswersCount, OwnerUserId FROM Posts WHERE PostTypeId = 2 GROUP BY OwnerUserId) AS a ON u.Id = a.OwnerUserId WHERE u.Reputation > 1000 ORDER BY u.Reputation DESC |
CREATE TABLE table_17429 (
"Model/Engine" text,
"Capacity" text,
"Cylinders/Valves" text,
"Power/rpm" text,
"Torque (Nm)/rpm" text
) | For the model with torque of n m (lb ft)/*n m (lb ft) @1750, what is the power? | SELECT "Power/rpm" FROM table_17429 WHERE "Torque (Nm)/rpm" = 'N·m (lb·ft)/*N·m (lb·ft) @1750' |
CREATE TABLE table_64685 (
"Time" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text
) | What time did the match with an away team of Happy Valley Team B start? | SELECT "Time" FROM table_64685 WHERE "Away team" = 'happy valley team b' |
CREATE TABLE table_204_556 (
id number,
"rank" number,
"athlete" text,
"country" text,
"time" text,
"notes" text
) | how many athletes are from east germany ? | SELECT COUNT("athlete") FROM table_204_556 WHERE "country" = 'east germany' |
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 prescriptions (
subject_id text,
hadm_id... | how many patients whose diagnoses long title is cerebral thrombosis with cerebral infarction and lab test fluid is cerebrospinal fluid (csf)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Cerebral thrombosis with cerebral infarction" AND lab.fluid = "Cerebrospinal Fluid (CSF)" |
CREATE TABLE table_name_34 (
segment_a VARCHAR,
segment_d VARCHAR
) | Which items in segment A have a segment D of marble sculptures? | SELECT segment_a FROM table_name_34 WHERE segment_d = "marble sculptures" |
CREATE TABLE table_name_46 (
korean VARCHAR,
hanja VARCHAR
) | What's Korean for Hanja? | SELECT korean FROM table_name_46 WHERE hanja = "南楊州" |
CREATE TABLE table_204_799 (
id number,
"name" text,
"built" text,
"listed" text,
"location" text,
"county" text,
"type" text
) | what is the next name after bayou pierre bridge ? | SELECT "name" FROM table_204_799 WHERE id = (SELECT id FROM table_204_799 WHERE "name" = 'bayou pierre bridge' ORDER BY id DESC LIMIT 1) + 1 |
CREATE TABLE table_40560 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the average Events when the top-25 is 12 and there are less than 0 wins? | SELECT AVG("Events") FROM table_40560 WHERE "Top-25" = '12' AND "Wins" < '0' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | when was patient 021-111547 prescribed a enoxaparin and methylprednisolone 40 mg inj at the same time for the first time? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'enoxaparin' AND patient.uniquepid = '021-111547') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM med... |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE... | Plot id by grouped by name as a bar graph, show by the x-axis in descending please. | SELECT name, ID FROM swimmer ORDER BY name DESC |
CREATE TABLE table_204_35 (
id number,
"season" text,
"tier" number,
"division" text,
"place" text
) | how many times did sd ponferradina b come in better than 5th place ? | SELECT COUNT(*) FROM table_204_35 WHERE "place" < 5 |
CREATE TABLE table_27337 (
"2013/14" real,
"2012/13" real,
"2011/12" real,
"2010/11" real,
"Institute" text,
"Region" text
) | Name the number of regions for 2013/14 being 27 | SELECT COUNT("Region") FROM table_27337 WHERE "2013/14" = '27' |
CREATE TABLE table_51021 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Location Attendance" text,
"Record" text
) | When the team is @ Milwaukee, what is the name of the location where the game is played? | SELECT "Location Attendance" FROM table_51021 WHERE "Team" = '@ milwaukee' |
CREATE TABLE section (
course_id text,
sec_id text,
semester text,
year number,
building text,
room_number text,
time_slot_id text
)
CREATE TABLE time_slot (
time_slot_id text,
day text,
start_hr number,
start_min number,
end_hr number,
end_min number
)
CREATE TABLE... | What are the names and salaries of instructors who advise students in the Math department? | SELECT T2.name, T2.salary FROM advisor AS T1 JOIN instructor AS T2 ON T1.i_id = T2.id JOIN student AS T3 ON T1.s_id = T3.id WHERE T3.dept_name = 'Math' |
CREATE TABLE table_name_19 (
opponent VARCHAR,
date VARCHAR
) | Which Opponent is on april 28? | SELECT opponent FROM table_name_19 WHERE date = "april 28" |
CREATE TABLE table_name_96 (
area__km_2__ VARCHAR,
population VARCHAR,
place VARCHAR
) | What is the total number of area listed for cannonvale with a population less than 409? | SELECT COUNT(area__km_2__) FROM table_name_96 WHERE population < 409 AND place = "cannonvale" |
CREATE TABLE table_name_27 (
total_votes VARCHAR,
members VARCHAR
) | What were Holly Scouler's total votes? | SELECT total_votes FROM table_name_27 WHERE members = "holly scouler" |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | tell me what the top three most common specimen tests were until 1 year ago? | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 3 |
CREATE TABLE table_20079931_4 (
round VARCHAR,
circuit_location VARCHAR,
pole_position VARCHAR
) | How many rounds were there in Karlskoga Motorstadion with Roger Eriksson at the pole position? | SELECT COUNT(round) FROM table_20079931_4 WHERE circuit_location = "Karlskoga Motorstadion" AND pole_position = "Roger Eriksson" |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | what's the maximum cost of a hospital with hydromorphone 1 mg/1 ml syr? | SELECT MAX(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 medication.patientunitstayid FROM medication WHERE medication.drugname = 'hydromorphone 1 mg/1 ml syr')) GROUP BY cost.p... |
CREATE TABLE table_name_79 (
nationality VARCHAR,
position VARCHAR
) | What is the nationality of the C? | SELECT nationality FROM table_name_79 WHERE position = "c" |
CREATE TABLE table_36986 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Wins" real
) | How many wins for team mv agusta, over 10 points, and after 1957? | SELECT SUM("Wins") FROM table_36986 WHERE "Team" = 'mv agusta' AND "Points" > '10' AND "Year" > '1957' |
CREATE TABLE table_76653 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | When rider John Hopkins had 21 laps, what was the grid? | SELECT "Grid" FROM table_76653 WHERE "Laps" = '21' AND "Rider" = 'john hopkins' |
CREATE TABLE table_name_65 (
director VARCHAR,
country VARCHAR
) | What director is from Poland? | SELECT director FROM table_name_65 WHERE country = "poland" |
CREATE TABLE table_name_90 (
number INTEGER,
hometown VARCHAR
) | What is the lowest number of the player with a hometown of Bellwood, IL? | SELECT MIN(number) FROM table_name_90 WHERE hometown = "bellwood, il" |
CREATE TABLE table_203_584 (
id number,
"date" text,
"race name" text,
"d(f)" number,
"course" text,
"prize (\u00a3)" number,
"odds" text,
"runners" number,
"place" number,
"margin" number,
"winner/runner-up" text,
"time" text,
"jockey" text
) | how many times was first place won ? | SELECT COUNT(*) FROM table_203_584 WHERE "place" = 1 |
CREATE TABLE table_33699 (
"Episode Number" real,
"Title" text,
"Podcast Date" text,
"Run time" text,
"Historical References" text
) | What is the date of the episode that is before 307, run time equals 5:48 and has P.T. Barnum as the topic? | SELECT "Podcast Date" FROM table_33699 WHERE "Episode Number" < '307' AND "Historical References" = 'p.t. barnum' AND "Run time" = '5:48' |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the average of salary over the hire_date bin hire_date by time by a bar chart. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
CREATE TABLE region (
region_id number,
region_name text,
date text,
label text,
format text,
catalogue text
)
CREATE TABLE member (
member_id number,
member_name text,
party_id text,
in_office text
)
CREATE TABLE party_events (
event_id number,
event_name text,
par... | What are the names of parties that have no members? | SELECT party_name FROM party WHERE NOT party_id IN (SELECT party_id FROM member) |
CREATE TABLE invoices (
id number,
customer_id number,
invoice_date time,
billing_address text,
billing_city text,
billing_state text,
billing_country text,
billing_postal_code text,
total number
)
CREATE TABLE tracks (
id number,
name text,
album_id number,
media_ty... | What is the first and last name of the employee who reports to Nancy Edwards? | SELECT T2.first_name, T2.last_name FROM employees AS T1 JOIN employees AS T2 ON T1.id = T2.reports_to WHERE T1.first_name = "Nancy" AND T1.last_name = "Edwards" |
CREATE TABLE table_43554 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Location" text
) | What's the callsign of Mom's Radio 101.9 Zamboanga? | SELECT "Callsign" FROM table_43554 WHERE "Branding" = 'mom''s radio 101.9 zamboanga' |
CREATE TABLE table_75799 (
"Name" text,
"Novelty" text,
"Status" text,
"Authors" text,
"Location" text,
"Notes" text
) | What is the Novelty of the dinosaur that was named by the Author, Zhiming, and whose Notes are, 'carcharodontosaurid'? | SELECT "Novelty" FROM table_75799 WHERE "Authors" = 'zhiming' AND "Notes" = 'carcharodontosaurid' |
CREATE TABLE table_name_75 (
team VARCHAR,
laps VARCHAR,
time_retired VARCHAR
) | What team had 159 laps and a Time/Retired of 6:30:02.3733? | SELECT team FROM table_name_75 WHERE laps = 159 AND time_retired = "6:30:02.3733" |
CREATE TABLE table_name_13 (
finish INTEGER,
year VARCHAR,
team VARCHAR,
start VARCHAR
) | Lowest finish for ganassi at smaller than 19 start for smaller than 2004 year? | SELECT MIN(finish) FROM table_name_13 WHERE team = "ganassi" AND start < 19 AND year < 2004 |
CREATE TABLE table_4569 (
"Higher harmonics" text,
"Darwin" text,
"Period" text,
"Speed" text,
"Doodson coefficients" text,
"NOAA" text
) | Which higher harmonics have a speed of 0.0821373? | SELECT "Higher harmonics" FROM table_4569 WHERE "Speed" = '0.0821373' |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | provide the number of patients whose diagnoses icd9 code is 4142 and lab test fluid is joint fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "4142" AND lab.fluid = "Joint Fluid" |
CREATE TABLE table_name_92 (
Id VARCHAR
) | What is the 1991 for 2R 1999? | SELECT 1991 FROM table_name_92 WHERE 1999 = "2r" |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE city (
city_code varchar,
... | round trip fares from DENVER to PHILADELPHIA under 1000 dollars | 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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city... |
CREATE TABLE table_name_31 (
lane VARCHAR,
time VARCHAR,
rank VARCHAR
) | What is the lane with a time of 1:56.64, and a tank smaller than 7? | SELECT COUNT(lane) FROM table_name_31 WHERE time = "1:56.64" AND rank < 7 |
CREATE TABLE table_name_11 (
title VARCHAR,
name VARCHAR
) | What title did Mentuhotep IV have? | SELECT title FROM table_name_11 WHERE name = "mentuhotep iv" |
CREATE TABLE table_7191 (
"Outcome" text,
"Date" real,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | Who were the Opponents in the final in the match with a Score in the final of 1 6, 6 3, 2 6? | SELECT "Opponents in the final" FROM table_7191 WHERE "Score in the final" = '1–6, 6–3, 2–6' |
CREATE TABLE table_name_32 (
score VARCHAR,
home_team VARCHAR
) | What was the score of the game when Sheffield Wednesday was the home team? | SELECT score FROM table_name_32 WHERE home_team = "sheffield wednesday" |
CREATE TABLE prescribes (
physician number,
patient number,
medication number,
date time,
appointment number,
dose text
)
CREATE TABLE undergoes (
patient number,
procedures number,
stay number,
dateundergoes time,
physician number,
assistingnurse number
)
CREATE TABLE ... | List the name of physicians who took some appointment. | SELECT T2.name FROM appointment AS T1 JOIN physician AS T2 ON T1.physician = T2.employeeid |
CREATE TABLE table_name_47 (
to_par VARCHAR,
player VARCHAR,
country VARCHAR,
place VARCHAR
) | What is the to par of player Tim Herron from the United States with a t3 place? | SELECT to_par FROM table_name_47 WHERE country = "united states" AND place = "t3" AND player = "tim herron" |
CREATE TABLE table_28934 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | When was the incumbent first elected in the district where the result was a democratic-republican gain? | SELECT "First elected" FROM table_28934 WHERE "Result" = 'Democratic-Republican gain' |
CREATE TABLE table_50005 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is High Assists, when Team is '@ Milwaukee'? | SELECT "High assists" FROM table_50005 WHERE "Team" = '@ milwaukee' |
CREATE TABLE table_name_52 (
Id VARCHAR
) | What 1953 has 2 for 1947, and dne as 1938? | SELECT 1953 FROM table_name_52 WHERE 1947 = "2" AND 1938 = "dne" |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime ... | how many times did patient 30307 had received a umbilical vein cath since 2101? | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'umbilical vein cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30307) AND STRFTIME('%y', proce... |
CREATE TABLE table_name_66 (
attendance VARCHAR,
week VARCHAR
) | For week 15, what was the total number of attendance recorded? | SELECT COUNT(attendance) FROM table_name_66 WHERE week = 15 |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationD... | PM - Questions raised per week days. | SELECT DATENAME(dw, CreationDate), COUNT(1) FROM Posts WHERE CreationDate > DATEADD(DAY, -120, CURRENT_TIMESTAMP()) AND ParentId IS NULL GROUP BY DATENAME(dw, CreationDate) ORDER BY COUNT(1) |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Comments (
Id number,... | Collect aggregate results for users. | SELECT u.Id, u.Reputation, (SELECT COUNT(*) FROM Votes WHERE VoteTypeId IN (2, 3) AND PostId IN (SELECT Id FROM Posts WHERE PostTypeId = 1 AND OwnerUserId = u.Id)) AS "aggregate_number_of_votes_received_on_questions" FROM Users AS u WHERE u.Id IN (83, 2926, 3289, 5862, 6292, 8705) |
CREATE TABLE table_1341598_44 (
first_elected INTEGER,
candidates VARCHAR
) | What year were the election results tom loeffler (r) 80.6% joe sullivan (d) 19.4%? | SELECT MIN(first_elected) FROM table_1341598_44 WHERE candidates = "Tom Loeffler (R) 80.6% Joe Sullivan (D) 19.4%" |
CREATE TABLE table_50832 (
"Year" text,
"Team" text,
"Attempts" text,
"Completions" text,
"Completion %" text,
"Yards" text
) | What team did James Vanderberg belong to when the Completions had a status of redshirt? | SELECT "Team" FROM table_50832 WHERE "Completions" = 'redshirt' |
CREATE TABLE table_27703902_9 (
high_points VARCHAR,
game VARCHAR
) | Who had the high points in game is 81? | SELECT high_points FROM table_27703902_9 WHERE game = 81 |
CREATE TABLE table_15676 (
"Artist" text,
"Country of origin" text,
"Period active" text,
"Release-year of first charted record" real,
"Genre" text,
"Claimed sales" text
) | What is the number of claimed sales in the rock genre? | SELECT "Claimed sales" FROM table_15676 WHERE "Genre" = 'rock' |
CREATE TABLE table_name_81 (
game INTEGER,
date VARCHAR
) | Which game is on mar 12? | SELECT AVG(game) FROM table_name_81 WHERE date = "mar 12" |
CREATE TABLE table_15401 (
"Frame size" text,
"Width" real,
"Height" real,
"Mpix" real,
"Aspect Ratio" text,
"max. fps" real,
"lowest possible REDCODE at 24 fps" text
) | What frame size corresponds the selection with a max fps of 120, a width of 2048, and height of 1024? | SELECT "Frame size" FROM table_15401 WHERE "max. fps" = '120' AND "Width" = '2048' AND "Height" = '1024' |
CREATE TABLE table_2668243_25 (
party VARCHAR,
incumbent VARCHAR
) | What party did john s. barbour represent? | SELECT party FROM table_2668243_25 WHERE incumbent = "John S. Barbour" |
CREATE TABLE table_name_37 (
starts INTEGER,
winnings VARCHAR,
wins VARCHAR
) | Can you tell me the sum of Starts that the Winnings of $139,774, and the Wins smaller than 0? | SELECT SUM(starts) FROM table_name_37 WHERE winnings = "$139,774" AND wins < 0 |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | Give the number of patients diagnosed for injury-hanging had discharge location as rehab/distinct part hosp. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND diagnoses.short_title = "Injury-hanging" |
CREATE TABLE table_49379 (
"Result" text,
"Race" text,
"Distance" text,
"Weight" real,
"Winner or 2nd" text,
"Pos'n" text
) | What is the result of the sajc king's cup race, which has a weight heavier than 8.1? | SELECT "Result" FROM table_49379 WHERE "Weight" > '8.1' AND "Race" = 'sajc king''s cup' |
CREATE TABLE table_10539 (
"Episode #" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text
) | What was the original air date when ed horowitz wrote it? | SELECT "Original airdate" FROM table_10539 WHERE "Written by" = 'ed horowitz' |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
... | what type of ground transportation is available at BOSTON airport | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city, ground_service WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'BOSTON' AND ground_service.airport_code = airport.airport_code |
CREATE TABLE route (
train_id int,
station_id int
)
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 train (
id int,
train_number int,
name text,
origin text,... | A bar graph listing the local authorities and how many local authorities provided by all stations, and show from low to high by the x axis please. | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY local_authority ORDER BY local_authority |
CREATE TABLE table_name_85 (
route VARCHAR,
elevation VARCHAR
) | Elevation of 11,158 feet 3401 m had what route? | SELECT route FROM table_name_85 WHERE elevation = "11,158 feet 3401 m" |
CREATE TABLE table_16091 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
) | Who was Class AAA during the school year of 2000-01? | SELECT "Class AAA" FROM table_16091 WHERE "School Year" = '2000-01' |
CREATE TABLE claims (
claim_id number,
fnol_id number,
effective_date time
)
CREATE TABLE first_notification_of_loss (
fnol_id number,
customer_id number,
policy_id number,
service_id number
)
CREATE TABLE services (
service_id number,
service_name text
)
CREATE TABLE settlements ... | What are the open and close dates of all the policies used by the customer who have 'Diana' in part of their names? | SELECT t2.date_opened, t2.date_closed FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id WHERE t1.customer_name LIKE "%Diana%" |
CREATE TABLE table_23242933_2 (
no_in_series INTEGER,
written_by VARCHAR
) | What's the series number of the episode written by Dan Vebber? | SELECT MAX(no_in_series) FROM table_23242933_2 WHERE written_by = "Dan Vebber" |
CREATE TABLE table_train_12 (
"id" int,
"sequential_organ_failure_assessment_sofa" int,
"active_infection" bool,
"taking_pioglitazone" bool,
"taking_rosiglitazone" bool,
"body_weight" float,
"diabetic" string,
"organ_failure" bool,
"age" float,
"NOUSE" float
) | at least 13 years of age | SELECT * FROM table_train_12 WHERE age >= 13 |
CREATE TABLE table_name_45 (
away VARCHAR,
attendance VARCHAR
) | What team was the away team for the game with 916 in attendance? | SELECT away FROM table_name_45 WHERE attendance = 916 |
CREATE TABLE table_name_36 (
record VARCHAR,
game_site VARCHAR,
date VARCHAR
) | What record has candlestick park as the game site, and october 12, 2008 as the date? | SELECT record FROM table_name_36 WHERE game_site = "candlestick park" AND date = "october 12, 2008" |
CREATE TABLE table_name_9 (
transfer_fee VARCHAR,
country VARCHAR,
transfer_window VARCHAR,
type VARCHAR
) | What is the transfer fee when summer is the transfer window, the type is transfer and the country is Hun? | SELECT transfer_fee FROM table_name_9 WHERE transfer_window = "summer" AND type = "transfer" AND country = "hun" |
CREATE TABLE table_204_374 (
id number,
"event" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number,
"ranking" text
) | only year in which switzerland earned 9 silver medals | SELECT "event" FROM table_204_374 WHERE "silver" = 9 |
CREATE TABLE table_13673 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is the date when the tournament is san diego and the opponent is ann grossman? | SELECT "Date" FROM table_13673 WHERE "Tournament" = 'san diego' AND "Opponent" = 'ann grossman' |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Top 1000 Users according to Reputation. | SELECT Users.Id AS "user_link", Users.Reputation AS UserReputation FROM Users GROUP BY Users.Id, DisplayName, Users.Reputation ORDER BY UserReputation DESC LIMIT 1000 |
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 gender is f and ethnicity is asian? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "ASIAN" |
CREATE TABLE table_9952 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ($)" text
) | What is the Place of the Player with a Score of 70-75-70-74=289? | SELECT "Place" FROM table_9952 WHERE "Score" = '70-75-70-74=289' |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | when is the last time that patient 029-30149 has received a wbc x 1000 lab test since 45 months ago? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-30149')) AND lab.labname = 'wbc x 1000' AND DATETIME(lab.labresulttime) >= DATE... |
CREATE TABLE table_name_37 (
opponent VARCHAR,
game VARCHAR
) | What team were the Opponent in Game 29? | SELECT opponent FROM table_name_37 WHERE game = 29 |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,... | how many times does patient 26612 come in to the icu until 2103? | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26612) AND STRFTIME('%y', icustays.intime) <= '2103' |
CREATE TABLE table_50337 (
"Team" text,
"Winners" real,
"Runners-Up" real,
"Years Won" text,
"Years Runner-Up" text
) | When there are more than 1 winners and the team playing is pachuca, what's the lowest runners-up found? | SELECT MIN("Runners-Up") FROM table_50337 WHERE "Team" = 'pachuca' AND "Winners" > '1' |
CREATE TABLE station (
station_id number,
name text,
annual_entry_exit number,
annual_interchanges number,
total_passengers number,
location text,
main_services text,
number_of_platforms number
)
CREATE TABLE train_station (
train_id number,
station_id number
)
CREATE TABLE tra... | Show the number of trains | SELECT COUNT(*) FROM train |
CREATE TABLE table_13862 (
"Competition" text,
"Total" real,
"Al Ahly wins" real,
"Draws" real,
"El Zamalek wins" real
) | Which competition had 2 draws? | SELECT "Competition" FROM table_13862 WHERE "Draws" = '2' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.