table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_80043 (
"Units" text,
"Type" text,
"Period used" text,
"Formed from" text,
"Trailers" text
) | Name the trailers for formed from pan/pul/res cars | SELECT "Trailers" FROM table_80043 WHERE "Formed from" = 'pan/pul/res cars' |
CREATE TABLE table_71473 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What label released a record on December 19, 2001? | SELECT "Label" FROM table_71473 WHERE "Date" = 'december 19, 2001' |
CREATE TABLE table_18590048_1 (
rank INTEGER,
title VARCHAR
) | What rank is Super Mario Land 2: 6 Golden Coins? | SELECT MIN(rank) FROM table_18590048_1 WHERE title = "Super Mario Land 2: 6 Golden Coins" |
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
) | Find the ship type that are used by both ships with Panama and Malta flags. | SELECT type FROM ship WHERE flag = 'Panama' INTERSECT SELECT type FROM ship WHERE flag = 'Malta' |
CREATE TABLE table_name_42 (
location VARCHAR,
college_name VARCHAR
) | Where is the location of the coimbatore medical college? | SELECT location FROM table_name_42 WHERE college_name = "coimbatore medical college" |
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 demographic (... | give me the number of patients whose age is less than 30 and item id is 51001? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "30" AND lab.itemid = "51001" |
CREATE TABLE products (
product_name VARCHAR,
color_code VARCHAR
)
CREATE TABLE ref_colors (
color_code VARCHAR,
color_description VARCHAR
) | List all the product names with the color description 'white'. | SELECT t1.product_name FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "white" |
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 treatment (
treat... | what is the number of patients diagnosed with acute respiratory failure - due to pulmonary infiltrates who didn't come back to the hospital within 2 months? | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure - due to pulmonary infiltrates') AS t1) - (SELECT COUNT(DISTINCT t2.unique... |
CREATE TABLE table_name_89 (
nationality VARCHAR,
goals VARCHAR
) | Which nation had 14 goals? | SELECT nationality FROM table_name_89 WHERE goals = 14 |
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... | What are the dates that have an average sea level pressure between 30.3 and 31, and count them by a line chart | SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 GROUP BY date |
CREATE TABLE table_15824796_3 (
season__number INTEGER,
original_air_date VARCHAR
) | What season began on december 5, 1953? | SELECT MAX(season__number) FROM table_15824796_3 WHERE original_air_date = "December 5, 1953" |
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist... | Please give me a pie chart to show the total number of singers who sang the top 3 most highly rated songs from different countries. | SELECT T1.country, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name GROUP BY T1.country ORDER BY T2.rating DESC LIMIT 3 |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | how many hours has it been since the last time that patient 027-85328 had intake of per iv flush: forearm r 20 gauge on the current icu visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... |
CREATE TABLE table_test_22 (
"id" int,
"ejection_fraction_ef" int,
"pregnancy_or_lactation" bool,
"child_pugh_class" string,
"hbv" bool,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"leukocyte_count" int,
"hiv_infection" bool,
"left_ventricular_dysfunction" bool,
... | with active inflammatory diseases, infectious diseases or known malignancy | SELECT * FROM table_test_22 WHERE active_inflammatory_diseases = 1 OR active_infection = 1 OR malignancy = 1 |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
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
)
... | Return a bar chart about the distribution of meter_200 and the sum of ID , and group by attribute meter_200, and I want to order by the Y from low to high please. | SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY SUM(ID) |
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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,... | was arterial bp [systolic] in patient 12775 normal on 12/24/2105? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst... |
CREATE TABLE table_14332822_1 (
coding VARCHAR,
genbank_id VARCHAR
) | What is the coding for hq021442 genbankid? | SELECT coding FROM table_14332822_1 WHERE genbank_id = "HQ021442" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE a... | when was the first time until 03/2100 that patient 022-109861 had the minimum wbc x 1000 value? | 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 = '022-109861')) AND lab.labname = 'wbc x 1000' AND STRFTIME('%y-%m', lab.labresulttim... |
CREATE TABLE table_name_53 (
attendance VARCHAR,
record VARCHAR
) | What was the attendance for the game that has a record of 1-1? | SELECT attendance FROM table_name_53 WHERE record = "1-1" |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
... | Users w/ More than X Rep. | SELECT * FROM Users WHERE Reputation >= 3000 AND Location LIKE '%OH%' |
CREATE TABLE table_78203 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" real
) | What day did they play before week 2? | SELECT "Date" FROM table_78203 WHERE "Week" < '2' |
CREATE TABLE Accounts (
customer_id VARCHAR
) | Show all customer ids and the number of accounts for each customer. | SELECT customer_id, COUNT(*) FROM Accounts GROUP BY customer_id |
CREATE TABLE table_train_170 (
"id" int,
"alt" float,
"hemoglobin_a1c_hba1c" float,
"ast" float,
"allergy_to_peanuts" bool,
"a1c" float,
"bilirubin" float,
"NOUSE" float
) | hba1c > 5.9 % and < 10 % ; | SELECT * FROM table_train_170 WHERE hemoglobin_a1c_hba1c > 5.9 AND hemoglobin_a1c_hba1c < 10 |
CREATE TABLE table_27094070_4 (
overall_total INTEGER,
team VARCHAR
) | What is the overall total for the Omaha Nighthawks? | SELECT MIN(overall_total) FROM table_27094070_4 WHERE team = "Omaha Nighthawks" |
CREATE TABLE table_25000 (
"Province, Community" text,
"Contestant" text,
"Age" real,
"Height" text,
"Hometown" text,
"Geographical Regions" text
) | Which province is Villa Bison in? | SELECT "Province, Community" FROM table_25000 WHERE "Hometown" = 'Villa Bisonó' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | how many patients diagnosed with short title iatrogenc hypotension nec have sl roue of drug administration? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Iatrogenc hypotnsion NEC" AND prescriptions.route = "SL" |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | For the top 3 days with the largest max gust speeds, please bin the date into day of the week and then sum the mean humidity to visualize a bar chart. | SELECT date, SUM(mean_humidity) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 |
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... | count the number of patients whose death status is 1 and year of birth is less than 2097? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.dob_year < "2097" |
CREATE TABLE table_1507 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | what date is the opponent is chicago bears? | SELECT "Date" FROM table_1507 WHERE "Opponent" = 'Chicago Bears' |
CREATE TABLE table_9795 (
"Actor" text,
"Role" text,
"Status" text,
"Number Of Episodes" text,
"Notes" text
) | What is Number Of Episodes, when Notes is 'Moved to run a farm with boyfriend Jake.'? | SELECT "Number Of Episodes" FROM table_9795 WHERE "Notes" = 'moved to run a farm with boyfriend jake.' |
CREATE TABLE table_50908 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
) | Where was the location where justin robbins fought against billy kidd? | SELECT "Location" FROM table_50908 WHERE "Opponent" = 'billy kidd' |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTME... | For those employees who do not work in departments with managers that have ids between 100 and 200, find last_name and employee_id , and visualize them by a bar chart, show from high to low by the total number. | SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID DESC |
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_model VARCHAR(20),
asset_acquired_date DATETIME,
asset_disposed_date DATETIME,
other_asset_details VARCHAR(255)
)
CREATE TA... | which parts have more than 2 faults? Show the part name and id, and list by the Y from high to low. | SELECT T1.part_name, T1.part_id FROM Parts AS T1 JOIN Part_Faults AS T2 ON T1.part_id = T2.part_id ORDER BY T1.part_id DESC |
CREATE TABLE table_name_2 (
region VARCHAR,
label VARCHAR
) | Which region had a label of Central Station? | SELECT region FROM table_name_2 WHERE label = "central station" |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose marital status is divorced and item id is 51274? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.itemid = "51274" |
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 prescription... | what is the number of patients whose death status is 0 and year of birth is less than 2121? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2121" |
CREATE TABLE table_name_89 (
declination___j2000__ VARCHAR,
ngc_number VARCHAR,
object_type VARCHAR,
constellation VARCHAR
) | What is the declination of the spiral galaxy Pegasus with 7337 NGC | SELECT declination___j2000__ FROM table_name_89 WHERE object_type = "spiral galaxy" AND constellation = "pegasus" AND ngc_number = "7337" |
CREATE TABLE table_28921 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Who was the incumbent in Virginia 3? | SELECT "Incumbent" FROM table_28921 WHERE "District" = 'Virginia 3' |
CREATE TABLE table_name_39 (
primary_conference VARCHAR,
team_nickname VARCHAR
) | What primary conference does the team nicknamed Phoenix belongs to? | SELECT primary_conference FROM table_name_39 WHERE team_nickname = "phoenix" |
CREATE TABLE table_50120 (
"Points" real,
"Score" text,
"Premiers" text,
"Runners Up" text,
"Details" text
) | What's the total sum of points scored by the Brisbane Broncos? | SELECT SUM("Points") FROM table_50120 WHERE "Premiers" = 'brisbane broncos' |
CREATE TABLE table_204_988 (
id number,
"responsible minister(s)" text,
"crown entities" text,
"monitoring department(s)" text,
"category / type" text,
"empowering legislation" text
) | what is the empowering legislation where the responsible minister is broadcasting and the category is ace ? | SELECT "empowering legislation" FROM table_204_988 WHERE "responsible minister(s)" = 'broadcasting' AND "category / type" = 'ace' |
CREATE TABLE table_name_72 (
latitude INTEGER,
water__sqmi_ VARCHAR,
county VARCHAR,
land___sqmi__ VARCHAR,
pop__2010_ VARCHAR
) | Cass county has 0.008 Water (sqmi), less than 35.874 Land (sqmi), more than 35 Pop. (2010), and what average latitude? | SELECT AVG(latitude) FROM table_name_72 WHERE land___sqmi__ < 35.874 AND pop__2010_ > 35 AND county = "cass" AND water__sqmi_ = 0.008 |
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, a bar chart shows the distribution of headquarter and the average of price , and group by attribute headquarter, I want to show total number from high to low order. | SELECT Headquarter, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Price) DESC |
CREATE TABLE table_100518_1 (
weapon VARCHAR,
direction VARCHAR
) | What are the weapons used by guardians for the direction East? | SELECT weapon FROM table_100518_1 WHERE direction = "East" |
CREATE TABLE table_204_939 (
id number,
"year" number,
"chassis" text,
"engine" text,
"start" text,
"finish" text
) | in what year did the buick engine start in 1st ? | SELECT "year" FROM table_204_939 WHERE "engine" = 'buick' AND "start" = 1 |
CREATE TABLE table_name_8 (
away_team VARCHAR,
home_team VARCHAR
) | What is listed as the Away team for the Home team of the Bristol Rovers? | SELECT away_team FROM table_name_8 WHERE home_team = "bristol rovers" |
CREATE TABLE table_2501754_3 (
original_airdate VARCHAR,
prod_code VARCHAR
) | List the 1st air date for the episode with a iceb786e production code. | SELECT original_airdate FROM table_2501754_3 WHERE prod_code = "ICEB786E" |
CREATE TABLE table_name_59 (
opened VARCHAR,
country VARCHAR
) | Name the opened for spain | SELECT opened FROM table_name_59 WHERE country = "spain" |
CREATE TABLE table_name_39 (
airing_date VARCHAR,
number_of_episodes VARCHAR,
genre VARCHAR
) | Which Airing date has a Number of episodes larger than 20, and a Genre of modern drama? | SELECT airing_date FROM table_name_39 WHERE number_of_episodes > 20 AND genre = "modern drama" |
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 diagnoses (
... | how many patients were diagnosed with overdose and their drug route is tp? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "OVERDOSE" AND prescriptions.route = "TP" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | give me the number of patients whose admission location is trsf within this facility and primary disease is upper gi bleed? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "UPPER GI BLEED" |
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 prescriptions... | Calculate the total number of patients with int infection clostrdium dificile who were born before 2065. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2065" AND diagnoses.short_title = "Int inf clstrdium dfcile" |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
sc... | What requirement other than general elective would be fulfilled by MKT 750 ? | SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'MKT' AND course.number = 750 AND program_course.course_id = course.course_id |
CREATE TABLE table_792 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Who were the candidates when the winner was first elected in 1910? | SELECT "Candidates" FROM table_792 WHERE "First elected" = '1910' |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | Samuel Epstein will teach 278 again when ? | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.number = 278 AND course_offering.semester = semester.semester_id AND instructor.name LIKE '%Samuel Epstein%' AND offering_instructor.inst... |
CREATE TABLE table_180802_3 (
planet VARCHAR,
transcription VARCHAR
) | Which planet has the transcription of wan suk? | SELECT planet FROM table_180802_3 WHERE transcription = "wan suk" |
CREATE TABLE table_63109 (
"Round" text,
"Date" text,
"Against" text,
"Score AUFC \u2013 Away" text,
"Attendance" real,
"Weekday" text
) | What date has an against of pohang steelers? | SELECT "Date" FROM table_63109 WHERE "Against" = 'pohang steelers' |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count num... | Top 100 Python Answerers in the last 100 days in Chicago. | SELECT u.Id AS "user_link", number_of_answers = COUNT(*), total_score = SUM(p.Score) FROM Users AS u JOIN Posts AS p ON p.OwnerUserId = u.Id JOIN Posts AS pp ON p.ParentId = pp.Id JOIN PostTags AS pt ON pt.PostId = pp.Id JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName LIKE '%clojure%' AND p.CreationDate > (CURRENT_TI... |
CREATE TABLE table_name_75 (
against INTEGER,
ballarat_fl VARCHAR,
wins VARCHAR
) | What is the lowest against that has bacchus marsh as a ballarat fl, with wins less than 1? | SELECT MIN(against) FROM table_name_75 WHERE ballarat_fl = "bacchus marsh" AND wins < 1 |
CREATE TABLE table_72121 (
"Rd" real,
"Name" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning driver" text,
"Winning team" text,
"Report" text
) | What are the races that johnny rutherford has won? | SELECT "Name" FROM table_72121 WHERE "Winning driver" = 'Johnny Rutherford' |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
... | How many upvotes do I have for each tag by year?. how long before I get tag badges? | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId AND YEAR(Posts.CreationDate) = @Year GROUP BY TagName ORDER BY UpVotes DESC ... |
CREATE TABLE table_31676 (
"Cellist" text,
"Orchestra" text,
"Conductor" text,
"Record Company" text,
"Year of Recording" real,
"Format" text
) | What is the oldest year that the Royal Philharmonic Orchestra released a record with Decca Records? | SELECT MIN("Year of Recording") FROM table_31676 WHERE "Orchestra" = 'royal philharmonic orchestra' AND "Record Company" = 'decca records' |
CREATE TABLE table_22786 (
"Match no." real,
"Match Type" text,
"Team Europe" text,
"Score" text,
"Team USA" text,
"Progressive Total" text
) | What was the score at the end of the match number 4? | SELECT "Score" FROM table_22786 WHERE "Match no." = '4' |
CREATE TABLE table_name_5 (
state VARCHAR,
venue VARCHAR
) | In what state is the Thomas Assembly Center located? | SELECT state FROM table_name_5 WHERE venue = "thomas assembly center" |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_i... | patient 10811's arterial bp mean was normal? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10811)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp mean'... |
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE technician (
technician_id real,
Na... | Show names of technicians and the number of machines they are assigned to repair. | SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name |
CREATE TABLE table_65083 (
"City of license /Market" text,
"Station" text,
"Channel ( TV / RF )" text,
"Owned Since" real,
"Affiliation" text
) | What station was owned since 2011, and a channel (tv/rf) of 27? | SELECT "Station" FROM table_65083 WHERE "Owned Since" = '2011' AND "Channel ( TV / RF )" = '27' |
CREATE TABLE locations (
country_id VARCHAR
) | display the country ID and number of cities for each country. | SELECT country_id, COUNT(*) FROM locations GROUP BY country_id |
CREATE TABLE table_67935 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What was the 2012 result associated with a 2007 finish of 2R and a 2009 of 1R? | SELECT "2012" FROM table_67935 WHERE "2007" = '2r' AND "2009" = '1r' |
CREATE TABLE table_58958 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
) | What team played in the Bundesliga league with an Away record of 2-1? | SELECT "Teams" FROM table_58958 WHERE "League" = 'bundesliga' AND "Away" = '2-1' |
CREATE TABLE table_name_39 (
ihsaa_class VARCHAR,
school VARCHAR
) | What's the IHSAA Class when the school is Seymour? | SELECT ihsaa_class FROM table_name_39 WHERE school = "seymour" |
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 ... | Give me the number of patients less than 62 years of age diagnosed with calculus of bile duct without mention of cholecystitis with obstruction. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "62" AND diagnoses.short_title = "Choledochlith NOS w obst" |
CREATE TABLE table_name_99 (
position VARCHAR,
team_from VARCHAR,
pick__number VARCHAR
) | Which Position has a Team from of ottawa 67's, and a Pick # smaller than 47? | SELECT position FROM table_name_99 WHERE team_from = "ottawa 67's" AND pick__number < 47 |
CREATE TABLE table_6563 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | on january 7 what is the record? | SELECT "Record" FROM table_6563 WHERE "Date" = 'january 7' |
CREATE TABLE table_204_108 (
id number,
"typ" text,
"construction time" text,
"cylinders" text,
"capacity" text,
"power" text,
"top speed" text
) | which typ -lrb- s -rrb- had the longest construction times ? | SELECT "typ" FROM table_204_108 ORDER BY "construction time" - "construction time" DESC LIMIT 1 |
CREATE TABLE table_29599 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"First Star" text,
"Decision" text,
"Location" text,
"Attendance" real,
"Record" text,
"Points" real
) | What was the record in the game whose first star was J. Oduya? | SELECT "Record" FROM table_29599 WHERE "First Star" = 'J. Oduya' |
CREATE TABLE technician (
Name VARCHAR,
technician_id VARCHAR
)
CREATE TABLE repair_assignment (
Name VARCHAR,
technician_id VARCHAR
) | List the names of technicians who have not been assigned to repair machines. | SELECT Name FROM technician WHERE NOT technician_id IN (SELECT technician_id FROM repair_assignment) |
CREATE TABLE table_name_52 (
crowd INTEGER,
away_team VARCHAR
) | What was the largest crowd of a game where Collingwood was the away team? | SELECT MAX(crowd) FROM table_name_52 WHERE away_team = "collingwood" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | provide the number of patients whose marital status is single and procedure long title is transfusion of other serum? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "SINGLE" AND procedures.long_title = "Transfusion of other serum" |
CREATE TABLE table_55518 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In Western Oval, what was the away team score? | SELECT "Away team score" FROM table_55518 WHERE "Venue" = 'western oval' |
CREATE TABLE pitStops (
raceId INTEGER,
driverId INTEGER,
stop INTEGER,
lap INTEGER,
time TEXT,
duration TEXT,
milliseconds INTEGER
)
CREATE TABLE seasons (
year INTEGER,
url TEXT
)
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT... | A bar chart for what are the number of the names of all the Japanese constructors that have earned more than 5 points?, and display x-axis in ascending order. | SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY name |
CREATE TABLE table_15608800_2 (
number_at_pyewipe INTEGER
) | Name the most number of pyewipe | SELECT MAX(number_at_pyewipe) FROM table_15608800_2 |
CREATE TABLE table_69907 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | Which catalog was published on December 19, 2001? | SELECT "Catalog" FROM table_69907 WHERE "Date" = 'december 19, 2001' |
CREATE TABLE table_204_449 (
id number,
"no" number,
"episode" text,
"title" text,
"original airdate" text,
"viewers" number,
"nightly\nrank" number
) | how many episodes had a nightly rank of 11 ? | SELECT COUNT("title") FROM table_204_449 WHERE "nightly\nrank" = 11 |
CREATE TABLE table_203_398 (
id number,
"year" number,
"vidhan sabha" text,
"members of legislative assembly" text,
"winning party" text,
"nearest contesting party" text
) | was there an election in 1980 or 1982 ? | SELECT "year" FROM table_203_398 WHERE "year" IN (1980, 1982) |
CREATE TABLE table_39623 (
"School" text,
"Mascot" text,
"Location" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
) | What school has the greyhounds as mascots? | SELECT "School" FROM table_39623 WHERE "Mascot" = 'greyhounds' |
CREATE TABLE table_76092 (
"Season" real,
"Episodes" real,
"Season Premiere" text,
"Season Finale" text,
"DVD Release Date" text
) | Which season had fewer than 13 episodes and aired its season finale on February 20, 2011? | SELECT COUNT("Season") FROM table_76092 WHERE "Episodes" < '13' AND "Season Finale" = 'february 20, 2011' |
CREATE TABLE table_75141 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | How many Caps does the Club/province Munster, position of lock and Mick O'Driscoll have? | SELECT COUNT("Caps") FROM table_75141 WHERE "Club/province" = 'munster' AND "Position" = 'lock' AND "Player" = 'mick o''driscoll' |
CREATE TABLE table_61553 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What is the to par of the player with a 72-71-65-69=277 score? | SELECT "To par" FROM table_61553 WHERE "Score" = '72-71-65-69=277' |
CREATE TABLE table_7607 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Which Home has a Tie no of 6? | SELECT "Home team" FROM table_7607 WHERE "Tie no" = '6' |
CREATE TABLE table_79555 (
"Date" text,
"Location" text,
"Lineup" text,
"Assist/pass" text,
"Score" text,
"Result" text,
"Competition" text
) | Name the Lineup that has an Assist/pass of carli lloyd,a Competition of 2010 concacaf world cup qualifying group stage? | SELECT "Lineup" FROM table_79555 WHERE "Assist/pass" = 'carli lloyd' AND "Competition" = '2010 concacaf world cup qualifying – group stage' |
CREATE TABLE table_52898 (
"Evaluation average (From February 2011)" real,
"Evaluation average (From April 2009)" text,
"Evaluation average (Before April 2009)" text,
"% of negative evaluations" text,
"Submitting schedule on time" text,
"Punctuality/Attendance issues" text,
"Peak lessons tau... | What is the mean Evaluation number (Before April 2009) when the percentage of negative evaluations was 0.8% and the mean Evaluation number of April 2009 was 4.2? | SELECT "Evaluation average (Before April 2009)" FROM table_52898 WHERE "% of negative evaluations" = '0.8%' AND "Evaluation average (From April 2009)" = '4.2' |
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... | what were the three most frequent diagnoses for the patients of 20s since 2 years ago? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-2 yea... |
CREATE TABLE table_76779 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
) | WHEN has a Result of w 23 17? | SELECT "Date" FROM table_76779 WHERE "Result" = 'w 23–17' |
CREATE TABLE table_name_24 (
date VARCHAR,
opponent VARCHAR,
attendance VARCHAR
) | On what date was there a game in which the opponent was the Detroit Tigers, and the attendance was 38,639? | SELECT date FROM table_name_24 WHERE opponent = "detroit tigers" AND attendance = "38,639" |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | Shortest posts (both questions and answers). | SELECT DATALENGTH(Body) AS length, Id AS "post_link", Score AS Votes, Body AS Contents, Tags FROM Posts WHERE NOT Body IS NULL AND (('##OnlyQuestions:int?0##' = 0 AND PostTypeId = 2) OR PostTypeId = 1) ORDER BY length LIMIT 10 |
CREATE TABLE table_35401 (
"Region" text,
"Employment ( salaries & wages)" text,
"Self employed" text,
"Investment income" text,
"Working tax credit" text,
"State pensions" text,
"Occupational pensions" text,
"Disability benefits" text,
"Other social security benefits" text,
"Oth... | Investment income of 2%, and an other income sources of 3%, and an employment (salaries & wages) of 71% involves which self employed? | SELECT "Self employed" FROM table_35401 WHERE "Investment income" = '2%' AND "Other income sources" = '3%' AND "Employment ( salaries & wages)" = '71%' |
CREATE TABLE table_68044 (
"School" text,
"Team" text,
"Division Record" text,
"Overall Record" text,
"Season Outcome" text
) | What is the Senators' division record? | SELECT "Division Record" FROM table_68044 WHERE "Team" = 'senators' |
CREATE TABLE table_name_45 (
studio_s_ VARCHAR,
director VARCHAR
) | What is the Studio of the Film directed by Paul Greengrass? | SELECT studio_s_ FROM table_name_45 WHERE director = "paul greengrass" |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
... | list flights from LOS ANGELES to ORLANDO | 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 = 'LOS ANGELES' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'OR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.