table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_49 (
headquarters VARCHAR,
primary_industry VARCHAR,
name VARCHAR
) | Where is Exxon Mobil, an oil and gas corporation, headquartered? | SELECT headquarters FROM table_name_49 WHERE primary_industry = "oil and gas" AND name = "exxon mobil" |
CREATE TABLE table_41441 (
"Pos." text,
"Player" text,
"Free Agent Type" text,
"2007 Team" text,
"Contract" text
) | What is the 2007 Team with player Deshaun Foster? | SELECT "2007 Team" FROM table_41441 WHERE "Player" = 'deshaun foster' |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | What are the names of products with price at most 200, and count them by a bar chart, display how many name in desc order. | SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name ORDER BY COUNT(Name) DESC |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
... | Top 50 users with most number of comments containing given text. | SELECT ROW_NUMBER() OVER (ORDER BY COUNT(Id) DESC) AS "#", UserId AS "user_link", COUNT(Id) AS c FROM Comments WHERE Text LIKE '%##CommentText##%' AND LENGTH(Text) <= '##CommentLength##' AND NOT UserId IS NULL GROUP BY UserId ORDER BY c DESC LIMIT 50 |
CREATE TABLE table_25493 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the score for 49-31 | SELECT "Score" FROM table_25493 WHERE "Record" = '49-31' |
CREATE TABLE table_71875 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Which result has a Date of november 2, 2007? | SELECT "Result" FROM table_71875 WHERE "Date" = 'november 2, 2007' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | what procedure was performed on patient 017-30133 for the last time on the last hospital visit? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-30133' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... |
CREATE TABLE table_42643 (
"Date" text,
"Location" text,
"Country" text,
"Event" text,
"Winner" text,
"Runner-up" text
) | Who was the Runner-up in Hossegor? | SELECT "Runner-up" FROM table_42643 WHERE "Location" = 'hossegor' |
CREATE TABLE table_name_59 (
date VARCHAR,
venue VARCHAR
) | When was the game played at Moorabbin Oval? | SELECT date FROM table_name_59 WHERE venue = "moorabbin oval" |
CREATE TABLE table_72185 (
"Week" text,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff [a ]" text,
"Game site" text,
"TV" text,
"Attendance" text,
"Record" text
) | Give me the kickoff time of the game that was aired on CBS against the St. Louis Cardinals. | SELECT "Kickoff [a ]" FROM table_72185 WHERE "TV" = 'CBS' AND "Opponent" = 'St. Louis Cardinals' |
CREATE TABLE table_name_11 (
venue VARCHAR,
date VARCHAR
) | what was the venue on 7 october 2011? | SELECT venue FROM table_name_11 WHERE date = "7 october 2011" |
CREATE TABLE table_name_99 (
week_3 VARCHAR,
team VARCHAR
) | Name the week 3 for team of mark/jennifer | SELECT week_3 FROM table_name_99 WHERE team = "mark/jennifer" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | has patient 028-22327 taken a cl flush: non-tunneled, pressure/power inj subclav drug in 06/this year? | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-22327')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutpu... |
CREATE TABLE table_203_370 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | which competition is listed the most in this chart ? | SELECT "competition" FROM table_203_370 GROUP BY "competition" ORDER BY COUNT(*) DESC LIMIT 1 |
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 drug name is milrinone? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Milrinone" |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose discharge location is dead/expired and age is less than 41? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "DEAD/EXPIRED" AND demographic.age < "41" |
CREATE TABLE ref_calendar (
calendar_date time,
day_number number
)
CREATE TABLE roles (
role_code text,
role_name text,
role_description text
)
CREATE TABLE ref_document_types (
document_type_code text,
document_type_name text,
document_type_description text
)
CREATE TABLE documents_... | Show all role codes with at least 3 employees. | SELECT role_code FROM employees GROUP BY role_code HAVING COUNT(*) >= 3 |
CREATE TABLE movie (
movie_id number,
title text,
year number,
director text,
budget_million number,
gross_worldwide number
)
CREATE TABLE culture_company (
company_name text,
type text,
incorporated_in text,
group_equity_shareholding number,
book_club_id text,
movie_id ... | Return the publisher that has published the most books. | SELECT publisher FROM book_club GROUP BY publisher ORDER BY COUNT(*) DESC LIMIT 1 |
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... | Upvoted, but not accepted Answers.. | SELECT b.Id AS "post_link", 'site://questions/' + CAST(MAX(a.Id) AS TEXT) AS "answer_link" FROM Posts AS a INNER JOIN Posts AS b ON a.ParentId = b.Id INNER JOIN Posts AS c ON c.ParentId = b.Id WHERE a.PostTypeId = 2 AND a.OwnerUserId = @UserId AND b.PostTypeId = 1 AND b.AcceptedAnswerId IS NULL AND c.PostTypeId = 2 AND... |
CREATE TABLE table_name_30 (
Id VARCHAR
) | What is 2000, when 1996 is 'A', when 1997 is 'A', and when 2007 is 'A'? | SELECT 2000 FROM table_name_30 WHERE 1996 = "a" AND 1997 = "a" AND 2007 = "a" |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | how much does patient 018-86978 weigh based on the first measurement until 4 months ago? | SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-86978') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-4 month') ORDER BY patient.unitad... |
CREATE TABLE table_19013 (
"Rank" real,
"Airport" text,
"Total Passengers 2008" real,
"Total Passengers 2009" real,
"Change 2008/09" text,
"Aircraft movements 2009" real
) | what's the airport with total passengers 2009 being 157933 | SELECT "Airport" FROM table_19013 WHERE "Total Passengers 2009" = '157933' |
CREATE TABLE table_66609 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"County" text
) | Where is the lacrosse school located? | SELECT "Location" FROM table_66609 WHERE "School" = 'lacrosse' |
CREATE TABLE table_name_39 (
crowd INTEGER,
venue VARCHAR
) | Tell me the most crowd for arden street oval venue | SELECT MAX(crowd) FROM table_name_39 WHERE venue = "arden street oval" |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | Posts that have ever had [game-systems]. | SELECT Posts.Id AS "post_link", Posts.Tags, PostHistory.CreationDate FROM Posts, PostHistory WHERE Posts.Id = PostHistory.PostId AND PostHistory.Text LIKE '%<game-systems>%' ORDER BY Posts.Id DESC, PostHistory.CreationDate |
CREATE TABLE table_72579 (
"Cardinal direction" text,
"Burmese" text,
"Sanskrit" text,
"English" text,
"Planet" text,
"Sign" text
) | What is the Burmese term for Thursday? | SELECT "Burmese" FROM table_72579 WHERE "English" = 'Thursday' |
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, what is the relationship between code and revenue , and group by attribute founder? | SELECT T1.Code, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational... | Is there anyone else who teaches Medieval Literature besides Prof. Navvab ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Medieval Literature%' AND NOT instructor.name LIKE '%Navvab%' AND offering_instructor.instructor_id = ins... |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients are diagnosed with primary disease left colon cancer and are below age 76? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LEFT COLON CANCER" AND demographic.age < "76" |
CREATE TABLE table_1404456_1 (
area__km_2__ VARCHAR,
population_census_2009 VARCHAR
) | what's the area (km 2 ) with population census 2009 being 939370 | SELECT area__km_2__ FROM table_1404456_1 WHERE population_census_2009 = 939370 |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CRE... | Top users from Paris, France. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%paris%' OR UPPER(Location) LIKE '%PARIS%' ORDER BY Reputation DESC |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varch... | Is it always Prof. Aghapi Mordovanakis or Prof. Pj Mcgann who teaches SAC 440 ? | SELECT COUNT(*) = 0 FROM course, course_offering, instructor, offering_instructor WHERE (NOT instructor.name LIKE '%Aghapi Mordovanakis%' AND NOT instructor.name LIKE '%Pj Mcgann%') AND course.course_id = course_offering.course_id AND course.department = 'SAC' AND course.number = 440 AND offering_instructor.instructor_... |
CREATE TABLE table_56430 (
"Episode #" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text
) | Who directed the episode 'Approaching Zero'? | SELECT "Directed by" FROM table_56430 WHERE "Title" = 'approaching zero' |
CREATE TABLE table_70145 (
"Year" text,
"Starts" real,
"Cuts made" real,
"Wins" real,
"Top 10" real,
"Top 25" real,
"Earnings (\u20ac)" real,
"Money list rank" real
) | What is the sum of Top 10 performances that have more than 2 wins and is higher than number 16 in the Top 25? | SELECT SUM("Top 10") FROM table_70145 WHERE "Wins" > '2' AND "Top 25" < '16' |
CREATE TABLE table_name_24 (
strain VARCHAR,
species VARCHAR
) | What is the Strain name of Species Thiomicrospira crunogena? | SELECT strain FROM table_name_24 WHERE species = "thiomicrospira crunogena" |
CREATE TABLE table_31357 (
"Season" text,
"Division" text,
"League Apps" real,
"League Goals" real,
"FA Cup Apps" real,
"FA Cup Goals" real,
"Other Apps" real,
"Other Goals" real,
"Total Apps" real,
"Total Goals" real
) | How many league goals did Dunne have in the season where he had 2 league apps? | SELECT "League Goals" FROM table_31357 WHERE "League Apps" = '2' |
CREATE TABLE table_name_53 (
game INTEGER,
score VARCHAR
) | What is the lowest game when the score is 102-104? | SELECT MIN(game) FROM table_name_53 WHERE score = "102-104" |
CREATE TABLE table_42382 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | How many years was the 400 m event in the olympic games? | SELECT COUNT("Year") FROM table_42382 WHERE "Competition" = 'olympic games' AND "Event" = '400 m' |
CREATE TABLE table_60579 (
"Year (Ceremony)" text,
"Original title" text,
"Film title used in nomination" text,
"Director" text,
"Result" text
) | What's the original title of the nomination title, 'brecha en el silencio'? | SELECT "Original title" FROM table_60579 WHERE "Film title used in nomination" = 'brecha en el silencio' |
CREATE TABLE table_name_60 (
event VARCHAR,
games VARCHAR
) | What were the events in the 1976 Innsbruck Games? | SELECT event FROM table_name_60 WHERE games = "1976 innsbruck" |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId... | Number of Meta users with non-deleted posts in the last year. | SELECT COUNT(DISTINCT OwnerUserId) FROM Posts WHERE CreationDate > DATEADD(year, -1, GETDATE()) |
CREATE TABLE table_name_12 (
to_par VARCHAR,
player VARCHAR
) | What is fuzzy zoeller's to par? | SELECT to_par FROM table_name_12 WHERE player = "fuzzy zoeller" |
CREATE TABLE table_27383 (
"Language" text,
"Punata Municipality" real,
"Villa Rivero Municipality" real,
"San Benito Municipality" real,
"Tacachi Municipality" real,
"Cuchumuela Municipality" real
) | What is the language total number if the Tacachi Municipality is 3? | SELECT COUNT("Language") FROM table_27383 WHERE "Tacachi Municipality" = '3' |
CREATE TABLE table_27450976_1 (
title VARCHAR,
production_code VARCHAR
) | What is the title of the episode with a production code of 2j5504? | SELECT title FROM table_27450976_1 WHERE production_code = "2J5504" |
CREATE TABLE table_203_123 (
id number,
"year" number,
"title" text,
"b-side" text,
"mediums" text,
"label (catalog)" text
) | what title is listed next in the table after autumn beds ? | SELECT "title" FROM table_203_123 WHERE id = (SELECT id FROM table_203_123 WHERE "title" = '"autumn beds"') + 1 |
CREATE TABLE table_48017 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
) | What round was the game against Cedric Marks? | SELECT "Round" FROM table_48017 WHERE "Opponent" = 'cedric marks' |
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 demographic (... | Count the number of patients less than 47 years who had a urine fluid lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "47" AND lab.fluid = "Urine" |
CREATE TABLE table_26074 (
"Round" text,
"Clubs remaining" real,
"Clubs involved" real,
"Winners from previous round" text,
"New entries this round" text,
"Leagues entering at this round" text
) | Which round had 24 new entries? | SELECT "Round" FROM table_26074 WHERE "New entries this round" = '24' |
CREATE TABLE table_name_52 (
cuts_made INTEGER,
events VARCHAR,
top_5 VARCHAR,
top_10 VARCHAR
) | What is the most cuts made for events with 1 top-5, 2 top-10s, and more than 13 total events? | SELECT MAX(cuts_made) FROM table_name_52 WHERE top_5 = 1 AND top_10 = 2 AND events > 13 |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | what is the total minimum cost of a hospital that includes a drug called naloxone 0.4 mg/ml inj soln since 1 year ago? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'naloxone 0.4 mg/ml inj soln')) AND DATETIME(co... |
CREATE TABLE broadcast (
channel_id VARCHAR,
time_of_day VARCHAR
)
CREATE TABLE channel (
name VARCHAR,
channel_id VARCHAR
) | Find the names of the channels that are broadcast in the morning. | SELECT t1.name FROM channel AS t1 JOIN broadcast AS t2 ON t1.channel_id = t2.channel_id WHERE t2.time_of_day = 'Morning' |
CREATE TABLE table_6888 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What was the sum of Events, when Wins were less than 1, when Top-25 was 3, and when Top-5 was less than 1? | SELECT SUM("Events") FROM table_6888 WHERE "Wins" < '1' AND "Top-25" = '3' AND "Top-5" < '1' |
CREATE TABLE customer (
cust_ID varchar(3),
cust_name varchar(20),
acc_type char(1),
acc_bal int,
no_of_loans int,
credit_score int,
branch_ID int,
state varchar(20)
)
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state ... | Show a bar chart to show different names and credit scores of customers who have taken a loan, and I want to display cust_name in desc order. | SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_name DESC |
CREATE TABLE table_29765 (
"Stadium" text,
"City" text,
"Capacity" real,
"Matches played" real,
"Overall attendance" real,
"Average attendance per match" real,
"Average attendance as % of Capacity" text,
"Overall goals scored" real,
"Average goals scored per match" text,
"Elevati... | what is the average attendance per match wheree the elevation is 1500 m? | SELECT "Average attendance per match" FROM table_29765 WHERE "Elevation" = '1500 m' |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | Return a bar chart showing the total number of ships' nationalities, and list in desc by the total number. | SELECT Nationality, COUNT(Nationality) FROM ship GROUP BY Nationality ORDER BY COUNT(Nationality) DESC |
CREATE TABLE table_23285805_8 (
date VARCHAR,
location_attendance VARCHAR
) | On which datebis arco arena 17361 the location attendance? | SELECT date FROM table_23285805_8 WHERE location_attendance = "Arco Arena 17361" |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
h... | did patient 25216 get a diagnosis of atrial flutter since 6 years ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atrial flutter') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25216) AND DATETIME(diagnoses_icd.char... |
CREATE TABLE table_name_75 (
team__number1 VARCHAR
) | What is the 1st leg that has hapoel jerusalem? | SELECT 1 AS st_leg FROM table_name_75 WHERE team__number1 = "hapoel jerusalem" |
CREATE TABLE table_203_270 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | how many consecutive years did pavel loskutov run in the joongang seoul marathon ? | SELECT COUNT("year") FROM table_203_270 WHERE "competition" = 'joongang seoul marathon' |
CREATE TABLE table_55723 (
"Yard Name" text,
"Location (City, State)" text,
"1st Ship Delivery Date" text,
"Ship Types Delivered" text,
"Total Number of Ways" text
) | What types of ships were made at the Froemming Brothers ship yard? | SELECT "Ship Types Delivered" FROM table_55723 WHERE "Yard Name" = 'froemming brothers' |
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 prescriptions (
subject_id text,
hadm_id... | what is the number of patients whose ethnicity is american indian/alaska native and year of birth is less than 2083? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.dob_year < "2083" |
CREATE TABLE table_21801 (
"Year" real,
"Domestic freight" real,
"Domestic mail" real,
"International freight" real,
"International mail" real,
"Total freight and mail" real,
"Change" text
) | Name the number of international frieghts for domestic mail of 260 | SELECT COUNT("International freight") FROM table_21801 WHERE "Domestic mail" = '260' |
CREATE TABLE table_28628309_8 (
player VARCHAR,
category VARCHAR
) | What is the name of the player when the category is listed as field goal percentage? | SELECT player FROM table_28628309_8 WHERE category = "Field goal percentage" |
CREATE TABLE table_34406 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | Which Position has a Nationality of canada, and a Player of pat janostin? | SELECT "Position" FROM table_34406 WHERE "Nationality" = 'canada' AND "Player" = 'pat janostin' |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE c... | what is the yearly maximum chloride, whole blood value for patient 1205? | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1205) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'chloride, whole blood') GROUP BY STRFTIME('%y', labevents.charttime) |
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
) | Return a bar chart on what is the total revenue of each manufacturer?, could you list Y-axis in descending order? | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY SUM(Revenue) DESC |
CREATE TABLE table_3875 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many games were played on october 16? | SELECT COUNT("High points") FROM table_3875 WHERE "Date" = 'October 16' |
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 cost (
costid num... | when did patient 006-10390 enter the hospital for the first time this year? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '006-10390' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime LIMIT 1 |
CREATE TABLE table_21679 (
"Date" text,
"Opponent" text,
"Home / Away" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | Name the date for score of 95-101 | SELECT "Date" FROM table_21679 WHERE "Score" = '95-101' |
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 age is less than 70 and procedure short title is arterial catheterization? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "70" AND procedures.short_title = "Arterial catheterization" |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
... | show me flights from PITTSBURGH to PHILADELPHIA on wednesday morning | 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 (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_nam... |
CREATE TABLE region (
region_name VARCHAR,
region_id VARCHAR
)
CREATE TABLE affected_region (
region_id VARCHAR,
storm_id VARCHAR
)
CREATE TABLE storm (
storm_id VARCHAR,
number_deaths VARCHAR
) | What are the region names affected by the storm with a number of deaths of least 10? | SELECT T2.region_name FROM affected_region AS T1 JOIN region AS T2 ON T1.region_id = T2.region_id JOIN storm AS T3 ON T1.storm_id = T3.storm_id WHERE T3.number_deaths >= 10 |
CREATE TABLE table_751 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What candidates were in the election when james patrick sutton was incumbent? | SELECT "Candidates" FROM table_751 WHERE "Incumbent" = 'James Patrick Sutton' |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | select * from Posts where rand() <= .3. | SELECT * FROM Posts WHERE RAND() = 0.3 |
CREATE TABLE table_17588 (
"Rank" real,
"Peak" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Isolation (km)" real,
"Municipality" text,
"County" text
) | What is the number of rank of peak fresvikbreen? | SELECT COUNT("Rank") FROM table_17588 WHERE "Peak" = 'Fresvikbreen' |
CREATE TABLE table_20174050_24 (
format VARCHAR,
author VARCHAR
) | how many formats of books authored by day, martin martin day | SELECT COUNT(format) FROM table_20174050_24 WHERE author = "Day, Martin Martin Day" |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number... | since 2 years ago, patient 50286 has been diagnosed with acute kidney failure nos? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'acute kidney failure nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50286) AND DATETIME(diagnose... |
CREATE TABLE table_60957 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
) | What is the median household income for Cape Girardeau? | SELECT "Median household income" FROM table_60957 WHERE "County" = 'cape girardeau' |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE t... | How many locations? Draw a bar chart. | SELECT Location, COUNT(Location) FROM station GROUP BY Location |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Stateme... | Give me a histogram for how many documents are there of each type?, and rank from high to low by the bar. | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY Document_Type_Code DESC |
CREATE TABLE table_1057316_1 (
operational_owner_s_ VARCHAR,
build_date VARCHAR
) | Who were the operational owners during the construction date of April 1892? | SELECT operational_owner_s_ FROM table_1057316_1 WHERE build_date = "April 1892" |
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 urgent hospital admission patients who have unspecified myelodysplastic syndrome diagnoses. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Myelodysplastic synd NOS" |
CREATE TABLE table_2181798_1 (
position VARCHAR,
avg_start VARCHAR
) | Name the position for 23.7 avg start | SELECT COUNT(position) FROM table_2181798_1 WHERE avg_start = "23.7" |
CREATE TABLE table_203_84 (
id number,
"rank" number,
"name" text,
"height\nft (m)" text,
"floors" number,
"year" text,
"coordinates" text,
"notes" text
) | how many total floors is the ordway building ? | SELECT "floors" FROM table_203_84 WHERE "name" = 'ordway building' |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,... | Calculate the average of amount for all the payments processed with Visa by each year using a bar chart. | SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' |
CREATE TABLE table_51366 (
"Year" real,
"Property Taxes" text,
"Investment Earnings" text,
"Other Local Sources" text,
"State & Federal" text,
"Total Revenue" text
) | What were the investment earnings in a year when other local sources were $2,670,060 after 2001? | SELECT "Investment Earnings" FROM table_51366 WHERE "Year" > '2001' AND "Other Local Sources" = '$2,670,060' |
CREATE TABLE table_name_73 (
tie_no VARCHAR,
away_team VARCHAR
) | What is the tie number when the away team is Lewes? | SELECT tie_no FROM table_name_73 WHERE away_team = "lewes" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | tell me the number of elective hospital admission patients who have been prescribed milk of magnesia. | 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 = "Milk of Magnesia" |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | what's the number of patients who had a pantoprazole (ns)-in intake until 2104? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'pantoprazole (ns)-in' AND intakeoutput.cellpath LIKE '%input%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2104') |
CREATE TABLE table_name_73 (
laps INTEGER,
class VARCHAR,
driver VARCHAR
) | What was the highest amount of laps for class c1 and driver Derek Bell? | SELECT MAX(laps) FROM table_name_73 WHERE class = "c1" AND driver = "derek bell" |
CREATE TABLE table_name_68 (
circuit VARCHAR,
team VARCHAR,
series VARCHAR
) | Which circuit did winfield team nissan win for the tooheys 1000? | SELECT circuit FROM table_name_68 WHERE team = "winfield team nissan" AND series = "tooheys 1000" |
CREATE TABLE table_37035 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
) | Total smaller than 285, and a To par larger than 1 belongs to what player? | SELECT "Player" FROM table_37035 WHERE "Total" < '285' AND "To par" > '1' |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE T... | answers that are possibly link only which were posted by new users. | SELECT p.Id AS "post_link", LEN(p.Body) AS BodyLength, p.ParentId, parentUser.DisplayName AS ParentOwner, p.Body FROM Posts AS p INNER JOIN Users AS u ON u.Id = p.OwnerUserId INNER JOIN Posts AS parentPost ON parentPost.Id = p.ParentId INNER JOIN Users AS parentUser ON parentUser.Id = parentPost.OwnerUserId WHERE p.Pos... |
CREATE TABLE table_44059 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"GPU frequency" text,
"L2 cache" text,
"I/O bus" text,
"Memory" text,
"Voltage" text,
"Socket" text,
"Release date" text,
"Part number(s)" text,
"Release price ( USD )" text
) | What is the model number for the GPU and 320 mhz? | SELECT "Model number" FROM table_44059 WHERE "GPU frequency" = '320 mhz' |
CREATE TABLE table_67535 (
"Country" text,
"2012" real,
"2011" real,
"2010" real,
"2009" real,
"2008" real,
"2007" real,
"2006" real,
"2005" real,
"2004" real,
"2003" real,
"2002" real,
"2001" real,
"2000" real,
"1999" real,
"1998" real,
"1997" real,
... | what is the average for 2005 when 1995 is more than 3, 1996 is less than 4, and 2011 is more than 5? | SELECT AVG("2005") FROM table_67535 WHERE "1995" > '3' AND "1996" < '4' AND "2011" > '5' |
CREATE TABLE student (
city_code VARCHAR,
age INTEGER
) | Find the average age of all students living in the each city. | SELECT AVG(age), city_code FROM student GROUP BY city_code |
CREATE TABLE table_48461 (
"Year" text,
"Date" text,
"Circuit" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | Which circuit did Jim Clark win in 1962? | SELECT "Circuit" FROM table_48461 WHERE "Winning driver" = 'jim clark' AND "Year" = '1962' |
CREATE TABLE table_58230 (
"Production no." real,
"Episode no." real,
"Original Airdate" text,
"Episode Title" text,
"Host" text
) | What is the episode number of the episode that originally aired on February 4, 2008? | SELECT "Episode no." FROM table_58230 WHERE "Original Airdate" = 'february 4, 2008' |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Bookin... | How many apartment bookings for each weekday? Draw a bar chart binning booking start date by weekday interval, I want to list by the total number from low to high. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) |
CREATE TABLE table_12981 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | What Week 5 has a Week 1 of mysti sherwood? | SELECT "Week 5" FROM table_12981 WHERE "Week 1" = 'mysti sherwood' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.