table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | how much does it cost to get diagnostic of bmi 33.0-33.9,adult? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'bmi 33.0-33.9,adult')) |
CREATE TABLE table_name_38 (
to_par VARCHAR,
country VARCHAR,
place VARCHAR
) | What is the to par of the player from the United States with a t5 place? | SELECT to_par FROM table_name_38 WHERE country = "united states" AND place = "t5" |
CREATE TABLE table_18602462_22 (
round_of_16 VARCHAR,
semifinals VARCHAR
) | The semifinal score of vergeer ( ned ) l 0-6, 1-6 follows a round of 16 result of what? | SELECT round_of_16 FROM table_18602462_22 WHERE semifinals = "Vergeer ( NED ) L 0-6, 1-6" |
CREATE TABLE table_47260 (
"Country" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends F/A" text,
"Stolen Ends For" real,
"Stolen Ends Against" real,
"Shot %" real
) | What is the lowest ends lost when the stolen ends for is less than 13, and stolten ends against is 6? | SELECT MIN("Ends Lost") FROM table_47260 WHERE "Stolen Ends For" < '13' AND "Stolen Ends Against" = '6' |
CREATE TABLE table_29464 (
"#" real,
"Episode" text,
"Air Date" text,
"Rating" text,
"Share" text,
"18-49 (Rating/Share)" text,
"Viewers (m)" text,
"Weekly Rank (#)" text
) | when air date is october 14, 2010 what are all 18-49 (rating/share date. | SELECT "18-49 (Rating/Share)" FROM table_29464 WHERE "Air Date" = 'October 14, 2010' |
CREATE TABLE table_11820086_1 (
directed_by VARCHAR,
us_viewers__millions_ VARCHAR
) | Who directed the episode that was viewed by 2.57 million people in the U.S.? | SELECT directed_by FROM table_11820086_1 WHERE us_viewers__millions_ = "2.57" |
CREATE TABLE table_name_6 (
bronze VARCHAR,
silver VARCHAR,
total VARCHAR
) | What is Bronze, when Silver is less than 89, and when Total is '4'? | SELECT bronze FROM table_name_6 WHERE silver < 89 AND total = 4 |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Questions with title length shorter than 15 characters. | SELECT Id AS "post_link", LENGTH(Title), * FROM Posts WHERE PostTypeId = 1 AND LENGTH(Title) < 15 |
CREATE TABLE table_203_215 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | did ito take 1st in the 10,000 m before or after he took 28th in the 10,000 m ? | SELECT (SELECT "year" FROM table_203_215 WHERE "position" = 1 AND "event" = '10,000m') < (SELECT "year" FROM table_203_215 WHERE "position" = 28 AND "event" = '10,000m') |
CREATE TABLE table_name_14 (
money___ VARCHAR,
to_par VARCHAR
) | How much money has a to par of E? | SELECT COUNT(money___) AS $__ FROM table_name_14 WHERE to_par = "e" |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicatio... | how many patients until 4 years ago were diagnosed with change in mental status during the same month after being diagnosed with esophagitis - regurgitant? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'change in mental status' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year')) AS t1... |
CREATE TABLE table_204_364 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | how many 800m events ? | SELECT COUNT("event") FROM table_204_364 WHERE "event" = 800 |
CREATE TABLE table_name_39 (
end_term INTEGER,
start_term VARCHAR,
name VARCHAR
) | What is the smallest End term with a Start term of 1913, and a Name of ludwig iii? | SELECT MIN(end_term) FROM table_name_39 WHERE start_term = 1913 AND name = "ludwig iii" |
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,... | show me the number of patients on main type of drug prescription who have procedure icd9 code 4523. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "4523" AND prescriptions.drug_type = "MAIN" |
CREATE TABLE table_45394 (
"Rank" text,
"Name" text,
"Height (m)" real,
"Height (ft)" real,
"Floors" text
) | What is the Height of the Canterbury House with 12 Floors and a Rank of 75=? | SELECT AVG("Height (ft)") FROM table_45394 WHERE "Floors" = '12' AND "Rank" = '75=' AND "Name" = 'canterbury house' |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id... | Fast-gun' distribution for a user. | WITH Dates AS (SELECT a.Id, q.CreationDate AS QDate, a.CreationDate AS ADate FROM Posts AS q, Posts AS a WHERE q.Id = a.ParentId AND q.PostTypeId = 1 AND a.PostTypeId = 2 AND a.OwnerUserId = '##UserId##'), Delays AS (SELECT Id, CAST((JULIANDAY(ADate) - JULIANDAY(QDate)) * 1440.0 AS INT) AS Delay FROM Dates) SELECT SUM(... |
CREATE TABLE table_5182 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | Location of brendan byrne arena had what score? | SELECT "Score" FROM table_5182 WHERE "Location" = 'brendan byrne arena' |
CREATE TABLE table_67516 (
"Venue" text,
"City" text,
"State" text,
"Tickets Sold / Available" text,
"Gross Revenue (1982)" text,
"Gross Revenue (2011)" text
) | Which city had a gross revenue in 2011 of $739,578? | SELECT "City" FROM table_67516 WHERE "Gross Revenue (2011)" = '$739,578' |
CREATE TABLE table_67054 (
"BR No." real,
"Name" text,
"Builder" text,
"Whenbuilt" text,
"Withdrawn" text
) | When was moray firth built? | SELECT "Whenbuilt" FROM table_67054 WHERE "Name" = 'moray firth' |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE CL... | Which departments have the top 3 highest number of students? Show the department address and number of students with a pie chart. | SELECT DEPT_ADDRESS, COUNT(*) FROM STUDENT AS T1 JOIN DEPARTMENT AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.DEPT_CODE ORDER BY COUNT(*) DESC LIMIT 3 |
CREATE TABLE table_name_10 (
cpu_chip VARCHAR,
model VARCHAR,
modem VARCHAR,
type VARCHAR
) | What is the CPU chip in the Dishplayer 7100, which is a dish tuner with a v.90 modem? | SELECT cpu_chip FROM table_name_10 WHERE modem = "v.90" AND type = "dish tuner" AND model = "dishplayer 7100" |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | count the number of patients whose year of birth is less than 2200 and lab test name is homocysteine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2200" AND lab.label = "Homocysteine" |
CREATE TABLE table_17482534_1 (
no_in_series VARCHAR,
production_code VARCHAR
) | What number in the series are the episodes with production code 5016/5017? | SELECT no_in_series FROM table_17482534_1 WHERE production_code = "5016/5017" |
CREATE TABLE endowment (
endowment_id int,
School_id int,
donator_name text,
amount real
)
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE budget ... | Compute the total sum enrollment across county as a pie chart. | SELECT County, SUM(Enrollment) FROM School GROUP BY County |
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 varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What are the PreMajor classes ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program.name LIKE '%CS-LSA%' AND program.program_id = program_course.program_id |
CREATE TABLE table_204_982 (
id number,
"party/electoral alliance" text,
"seats" number,
"change" number,
"votes" number,
"%" text
) | total number of parties who lost seats in the argentine chamber of deputies in the legislative election of 1930 | SELECT COUNT("party/electoral alliance") FROM table_204_982 WHERE "change" < 0 |
CREATE TABLE table_69586 (
"Birth" text,
"Marriage" text,
"Became Consort" text,
"Ceased to be Consort" text,
"Death" text,
"Spouse" text
) | Name the marriage of the person who is married for christian viii | SELECT "Marriage" FROM table_69586 WHERE "Spouse" = 'christian viii' |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Courses (
course_id INTEGER,
author_... | Find the number of the enrollment date for all the tests that have 'Pass' result. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" |
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... | provide the number of patients whose admission type is emergency and procedure icd9 code is 9955? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "9955" |
CREATE TABLE table_name_68 (
length VARCHAR,
version VARCHAR
) | What is the length of the UK remix version? | SELECT length FROM table_name_68 WHERE version = "uk remix" |
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,... | provide the number of patients whose gender is m and diagnoses long title is unspecified procedure as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time of procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.long_title = "Unspecified procedure as the cause of abnormal reaction of patient, or of later complication, without mention of misadventure at time ... |
CREATE TABLE table_name_1 (
location VARCHAR,
circuit VARCHAR
) | What is Location, when Circuit is August 16? | SELECT location FROM table_name_1 WHERE circuit = "august 16" |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | when is the last time that patient 006-66713 had the minimum value of heartrate until 2100 days ago? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-66713')) AND NOT vitalperiodic.heartrate IS NUL... |
CREATE TABLE fires (
fire_year number,
discovery_date number,
discovery_doy number,
discovery_time text,
stat_cause_code number,
stat_cause_descr text,
cont_date text,
cont_doy text,
cont_time text,
fire_size number,
fire_size_class text,
latitude number,
longitude nu... | How many wildfires in Gloucester county have been larger than 10 acres? | SELECT COUNT(*) FROM fires WHERE county = "Gloucester" AND fire_size > 10 |
CREATE TABLE artwork (
Id VARCHAR
) | How many artworks are there? | SELECT COUNT(*) FROM artwork |
CREATE TABLE table_4106 (
"Player" text,
"County" text,
"Matches" real,
"Innings" real,
"Runs" real,
"Average" text,
"Highest Score" text,
"100s" real,
"50s" real
) | What is the average for the player from Lancashire 1 100? | SELECT "Average" FROM table_4106 WHERE "County" = 'Lancashire' AND "100s" = '1' |
CREATE TABLE table_name_75 (
shooter VARCHAR,
total VARCHAR
) | Which shooter was the olympic bronze medalist? | SELECT shooter FROM table_name_75 WHERE total = "olympic bronze medalist" |
CREATE TABLE table_64779 (
"Channel" real,
"Video" text,
"Aspect" text,
"PSIP Short Name" text,
"Network" text
) | Which video has a 16:9 aspect? | SELECT "Video" FROM table_64779 WHERE "Aspect" = '16:9' |
CREATE TABLE table_22163 (
"Title" text,
"Developer" text,
"Category" text,
"Function" text,
"Release date" text,
"Version" text
) | What is the function of 1.4 version of Windows live messenger? | SELECT "Function" FROM table_22163 WHERE "Version" = '1.4' AND "Title" = 'Windows Live Messenger' |
CREATE TABLE table_60897 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is To par, when Total is less than 148, and when Country is 'South Africa'? | SELECT "To par" FROM table_60897 WHERE "Total" < '148' AND "Country" = 'south africa' |
CREATE TABLE table_name_35 (
result VARCHAR,
date VARCHAR
) | What was the result of the game played on May 9, 2012? | SELECT result FROM table_name_35 WHERE date = "may 9, 2012" |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Single awarded badges and users. | WITH awarded AS (SELECT COUNT(*) AS num, Name, Class FROM Badges GROUP BY Name, Class HAVING COUNT(*) = 1) SELECT b.Name, b.Class, u.DisplayName FROM Badges AS b JOIN awarded AS a ON a.Name = b.Name AND a.Class = b.Class JOIN Users AS u ON u.Id = b.UserId |
CREATE TABLE table_5658 (
"Club" text,
"Position in 2012\u201313" text,
"First season in top division" text,
"Number of seasons in top division" real,
"Number of seasons in Prva HNL" real,
"First season of current spell in top division" text,
"Top division titles" text,
"Last top divisio... | Name the average number of seasons for Prva HNL of 17 | SELECT AVG("Number of seasons in top division") FROM table_5658 WHERE "Number of seasons in Prva HNL" = '17' |
CREATE TABLE table_1930 (
"Country" text,
"Contestant" text,
"Age" real,
"Height (cm)" real,
"Height (ft)" text,
"Hometown" text
) | When santiago del estero is the hometown who is the contestant? | SELECT "Contestant" FROM table_1930 WHERE "Hometown" = 'Santiago del Estero' |
CREATE TABLE table_26005 (
"Round" real,
"Finishing Date" text,
"Rally Name" text,
"Rally Base" text,
"Surface" text,
"Support Category" text
) | Name the rally base for rallye de france alsace | SELECT "Rally Base" FROM table_26005 WHERE "Rally Name" = 'Rallye de France Alsace' |
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE artist (
artist_id number,
artist text,
age number,
famous_title text,
famous_release_date text
)
CREATE TABLE volume (
volume_i... | What are the famous titles of artists who have not only had volumes that spent more than 2 weeks on top but also volumes that spent less than 2 weeks on top? | SELECT T1.famous_title FROM artist AS T1 JOIN volume AS T2 ON T1.artist_id = T2.artist_id WHERE T2.weeks_on_top > 2 INTERSECT SELECT T1.famous_title FROM artist AS T1 JOIN volume AS T2 ON T1.artist_id = T2.artist_id WHERE T2.weeks_on_top < 2 |
CREATE TABLE table_52527 (
"Munsee Delaware" text,
"Unami Delaware" text,
"De Laet (1633)" text,
"Campanius (ca. 1645)" text,
"Interpreter (1684?)" text,
"Thomas (1698)" text
) | What is the Campanius term for an Unami Delaware term of pal naxk? | SELECT "Campanius (ca. 1645)" FROM table_52527 WHERE "Unami Delaware" = 'palé·naxk' |
CREATE TABLE table_name_59 (
country VARCHAR,
to_par VARCHAR
) | What is the Country of the Player with a To par of +1? | SELECT country FROM table_name_59 WHERE to_par = "+1" |
CREATE TABLE table_62467 (
"Parish (Prestegjeld)" text,
"Sub-Parish (Sokn)" text,
"Church Name" text,
"Year Built" text,
"Location of the Church" text
) | What is the Sub-Parish (Sokn) that was built in 1957 in the location of Stavang? | SELECT "Sub-Parish (Sokn)" FROM table_62467 WHERE "Year Built" = '1957' AND "Location of the Church" = 'stavang' |
CREATE TABLE table_name_28 (
team VARCHAR,
car_no VARCHAR
) | What team operates car 11? | SELECT team FROM table_name_28 WHERE car_no = "11" |
CREATE TABLE table_68244 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which of the opponents has a record of 17-25? | SELECT "Opponent" FROM table_68244 WHERE "Record" = '17-25' |
CREATE TABLE table_33417 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Which player was drafted higher than 374 and went to the school Stephen F. Austin? | SELECT "Player" FROM table_33417 WHERE "Overall" < '374' AND "School/Club Team" = 'stephen f. austin' |
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 are the names and average prices of products for manufacturers whose products cost on average 150 or more?, display in descending by the Name. | SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
CREATE TABLE table_48263 (
"State" text,
"Type" text,
"Name" text,
"Title" text,
"Royal house" text,
"From" text
) | What is State, when From is '830 BC'? | SELECT "State" FROM table_48263 WHERE "From" = '830 bc' |
CREATE TABLE table_29647 (
"Member" text,
"Electorate" text,
"Province" text,
"MPs term" text,
"Election date" text
) | What was the province if the electorate was Collingwood? | SELECT "Province" FROM table_29647 WHERE "Electorate" = 'Collingwood' |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | How many companies in each headquarter? Plot a bar chart, and I want to sort from low to high by the x-axis. | SELECT Headquarters, COUNT(Headquarters) FROM company GROUP BY Headquarters ORDER BY Headquarters |
CREATE TABLE table_41823 (
"Week" real,
"Date" text,
"Time (CST)" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"NFL Recap" text
) | What time (cst) has and NFL recap of recap with october 19, 2008 as the date? | SELECT "Time (CST)" FROM table_41823 WHERE "NFL Recap" = 'recap' AND "Date" = 'october 19, 2008' |
CREATE TABLE table_74411 (
"Rd." text,
"Race" text,
"Pole position" text,
"Fastest lap" text,
"Most laps led" text,
"Winning driver" text,
"Winning team" text
) | Who had the fastest lap(s) when stefan wilson had the pole? | SELECT "Fastest lap" FROM table_74411 WHERE "Pole position" = 'Stefan Wilson' |
CREATE TABLE table_20351295_2 (
high_checkout VARCHAR,
player VARCHAR
) | What's Trina Gulliver's high checkout? | SELECT high_checkout FROM table_20351295_2 WHERE player = "Trina Gulliver" |
CREATE TABLE table_name_39 (
score VARCHAR,
place VARCHAR,
player VARCHAR
) | What is Score, when Place is 'T9', and when Player is 'Jeff Sluman'? | SELECT score FROM table_name_39 WHERE place = "t9" AND player = "jeff sluman" |
CREATE TABLE table_17319931_1 (
car_no VARCHAR,
time_retired VARCHAR
) | How many car numbers were recorded when the time/retired is +4.0019? | SELECT COUNT(car_no) FROM table_17319931_1 WHERE time_retired = "+4.0019" |
CREATE TABLE table_7808 (
"State" text,
"Preliminary Average" text,
"Interview" text,
"Swimsuit" text,
"Evening Gown" text,
"Semifinal Average" text
) | what is the swimsuit score when the semifinal average score is 8.367 (10)? | SELECT "Swimsuit" FROM table_7808 WHERE "Semifinal Average" = '8.367 (10)' |
CREATE TABLE table_19487922_2 (
current_march_20 VARCHAR,
_2010 VARCHAR,
country VARCHAR
) | How many current drivers, as of March 20, 2010 does Denmark have? | SELECT current_march_20, _2010 FROM table_19487922_2 WHERE country = "Denmark" |
CREATE TABLE table_name_89 (
marks VARCHAR,
season VARCHAR
) | How many marks did he get in 2005? | SELECT marks FROM table_name_89 WHERE season = "2005" |
CREATE TABLE table_18600760_20 (
longitude VARCHAR,
township VARCHAR
) | What longitude is tatman township? | SELECT longitude FROM table_18600760_20 WHERE township = "Tatman" |
CREATE TABLE table_67953 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
) | Name the Adelaide for Sydney of yes and Perth of yes | SELECT "Adelaide" FROM table_67953 WHERE "Sydney" = 'yes' AND "Perth" = 'yes' |
CREATE TABLE table_34345 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" real,
"2nd (m)" real,
"Points" real,
"Overall WC points (Rank)" text
) | What is the 2nd (m) value for Gregor Schlierenzauer? | SELECT MIN("2nd (m)") FROM table_34345 WHERE "Name" = 'gregor schlierenzauer' |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
... | when has patient 14836 first received the urine microbiology test in the first hospital visit? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14836 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND microbiologyevents.spec_type_desc = 'urine' ORDER BY microbiology... |
CREATE TABLE table_46862 (
"State" text,
"Type" text,
"Name" text,
"Title" text,
"Royal house" text,
"From" text
) | In which state did Marquis Li rule? | SELECT "State" FROM table_46862 WHERE "Name" = 'li' AND "Title" = 'marquis' |
CREATE TABLE table_64816 (
"Ref#" real,
"Name" text,
"Built" real,
"Location" text,
"Construction" text
) | What is the name of the mill located on Anawan Street with a reference number larger than 8? | SELECT "Name" FROM table_64816 WHERE "Ref#" > '8' AND "Location" = 'anawan street' |
CREATE TABLE table_60502 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" text
) | What is the to par of the player from the United States with a t1 place? | SELECT "To par" FROM table_60502 WHERE "Country" = 'united states' AND "Place" = 't1' |
CREATE TABLE user_profiles (
uid number,
name text,
email text,
partitionid number,
followers number
)
CREATE TABLE tweets (
id number,
uid number,
text text,
createdate time
)
CREATE TABLE follows (
f1 number,
f2 number
) | Find the name and partition id for users who tweeted less than twice. | SELECT T1.name, T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING COUNT(*) < 2 |
CREATE TABLE table_203_416 (
id number,
"school name" text,
"city" text,
"grades" text,
"establishment" number,
"charter" text
) | how many schools are only charter ? | SELECT COUNT("school name") FROM table_203_416 WHERE "charter" = 'charter' |
CREATE TABLE table_name_41 (
date_of_birth__age_ VARCHAR,
caps VARCHAR,
position VARCHAR
) | What is the date of birth of the player that has 11 caps and plays the prop position? | SELECT date_of_birth__age_ FROM table_name_41 WHERE caps = 11 AND position = "prop" |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | Which is the easiest class that fulfills the PreMajor requirement ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM progra... |
CREATE TABLE table_name_33 (
nfl_team VARCHAR,
college VARCHAR
) | Which NFL team has a player that came from a college in Washington? | SELECT nfl_team FROM table_name_33 WHERE college = "washington" |
CREATE TABLE table_33457 (
"Year" real,
"Drivers" text,
"Wins" real,
"Points" text,
"D.C." text
) | Before 2007, how many wins were there when the point total was 48? | SELECT SUM("Wins") FROM table_33457 WHERE "Points" = '48' AND "Year" < '2007' |
CREATE TABLE table_42846 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" real,
"Finish" real,
"Entrant" text
) | What chassis has patrick racing as an entrant, with a start greater than 6? | SELECT "Chassis" FROM table_42846 WHERE "Entrant" = 'patrick racing' AND "Start" > '6' |
CREATE TABLE table_54758 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the least amount of silver medals a team with less than 0 gold medals has? | SELECT MIN("Silver") FROM table_54758 WHERE "Gold" < '0' |
CREATE TABLE table_68308 (
"Name" text,
"Birth" text,
"Marriage" text,
"Became Consort" text,
"Ceased to be Consort" text,
"Spouse" text
) | Name the became consort for christian ix spouse | SELECT "Became Consort" FROM table_68308 WHERE "Spouse" = 'christian ix' |
CREATE TABLE table_name_10 (
inf_stem VARCHAR,
subj_pres VARCHAR
) | What is the infinitive stem that has a subjunctive present of ou? | SELECT inf_stem FROM table_name_10 WHERE subj_pres = "ou" |
CREATE TABLE table_name_30 (
week INTEGER,
date VARCHAR,
attendance VARCHAR
) | How many weeks have a Date of december 4, 1976, and an Attendance larger than 57,366? | SELECT SUM(week) FROM table_name_30 WHERE date = "december 4, 1976" AND attendance > 57 OFFSET 366 |
CREATE TABLE table_43629 (
"Position" real,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the total number of played for the goals against over 44 and a goal difference of 11? | SELECT COUNT("Played") FROM table_43629 WHERE "Goal Difference" = '11' AND "Goals against" > '44' |
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_da... | Show the number of assets and group by asset make in a bar chart, and display in desc by the asset_make. | SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make ORDER BY asset_make DESC |
CREATE TABLE table_10413597_5 (
setting VARCHAR,
no_in_series VARCHAR
) | How many settings where there for episode 29 of the season? | SELECT COUNT(setting) FROM table_10413597_5 WHERE no_in_series = 29 |
CREATE TABLE table_57312 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the average crowd size for Brunswick street oval? | SELECT AVG("Crowd") FROM table_57312 WHERE "Venue" = 'brunswick street oval' |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
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 between BOSTON and SAN FRANCISCO that serve BREAKFAST | 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, food_service WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND f... |
CREATE TABLE table_name_27 (
team VARCHAR,
name VARCHAR
) | Name of sue bird that involves what team? | SELECT team FROM table_name_27 WHERE name = "sue bird" |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, show y-axis in asc order. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(SALARY) |
CREATE TABLE table_2259285_1 (
winning_pct__percentage VARCHAR,
goals_for VARCHAR
) | What was the winning % when there were 322 goals? | SELECT winning_pct__percentage FROM table_2259285_1 WHERE goals_for = 322 |
CREATE TABLE table_65993 (
"Year" real,
"Formula" text,
"Driver" text,
"Constructor" text,
"Location" text,
"Report" text
) | Which formula had a driver of John Moore-Brabazon? | SELECT "Formula" FROM table_65993 WHERE "Driver" = 'john moore-brabazon' |
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 demographic (
subject_id text,
hadm_id t... | calculate the average age of urgent hospital admission patients who were admitted on or after 2179. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.admityear >= "2179" |
CREATE TABLE table_61491 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | What country has player Nick Faldo? | SELECT "Country" FROM table_61491 WHERE "Player" = 'nick faldo' |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
... | Return a histogram on how many professors have a Ph.D. in each department? | SELECT DEPT_CODE, COUNT(*) FROM PROFESSOR WHERE PROF_HIGH_DEGREE = 'Ph.D.' GROUP BY DEPT_CODE |
CREATE TABLE table_21407 (
"Year" real,
"Indians admitted" real,
"Pakistanis admitted" real,
"Sri Lankans admitted" real,
"Bangladeshis admitted" real,
"Nepalis admitted" real
) | How many Indians were admitted in 2001? | SELECT "Indians admitted" FROM table_21407 WHERE "Year" = '2001' |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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,
char... | when was patient 65582 tested for magnesium for the last time this month? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'magnesium') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65582) AND DATETIME(labevents.charttime, 'start of month') = DATETIME(CURR... |
CREATE TABLE table_name_62 (
high_rebounds VARCHAR,
score VARCHAR
) | Which High rebounds has a Score of w 81-69? | SELECT high_rebounds FROM table_name_62 WHERE score = "w 81-69" |
CREATE TABLE table_29122 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Story by" text,
"Teleplay by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | How many viewers watched the episode with a story by david simon & mari kornhauser? | SELECT "U.S. viewers (millions)" FROM table_29122 WHERE "Story by" = 'David Simon & Mari Kornhauser' |
CREATE TABLE table_name_27 (
result VARCHAR,
opponent VARCHAR,
venue VARCHAR
) | What is the result of the match with clyde as the opponent in the h venue? | SELECT result FROM table_name_27 WHERE opponent = "clyde" AND venue = "h" |
CREATE TABLE table_204_568 (
id number,
"pennant" text,
"name" text,
"hull builder" text,
"ordered" text,
"laid down" text,
"launched" text,
"accepted into service" text,
"commissioned" text,
"est. building cost" text,
"fate" text
) | how many boats costed less than # 20m to build ? | SELECT COUNT(*) FROM table_204_568 WHERE "est. building cost" < 20 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.