table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_71344 (
"Molecule" text,
"Percent of Mass" text,
"Mol.Weight (daltons)" text,
"Molecules" text,
"Percent of Molecules" text
) | what is the molecules when the percent mass is 1.0? | SELECT "Molecules" FROM table_71344 WHERE "Percent of Mass" = '1.0' |
CREATE TABLE table_55071 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When did South Melbourne play as the home team? | SELECT "Date" FROM table_55071 WHERE "Home team" = 'south melbourne' |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | what is the unabbreviated version of screening for diphtheria? | SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'screening for diphtheria' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'screening for diphtheria' |
CREATE TABLE table_name_97 (
rank INTEGER,
location VARCHAR,
fastest_time__s_ VARCHAR
) | what is the highest rank in dresden with a time faster than 10.88? | SELECT MAX(rank) FROM table_name_97 WHERE location = "dresden" AND fastest_time__s_ < 10.88 |
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 the songs in volumes, listed in ascending order? | SELECT song FROM volume ORDER BY song |
CREATE TABLE table_25467 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who did the high points in the game played on December 18? | SELECT "High points" FROM table_25467 WHERE "Date" = 'December 18' |
CREATE TABLE table_20906 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original airdate" text,
"Production code" real
) | How many days are associated with production code 210? | SELECT COUNT("Original airdate") FROM table_20906 WHERE "Production code" = '210' |
CREATE TABLE table_37425 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Which Player has a Round smaller than 11, and a Pick smaller than 152, and a Position of guard? | SELECT "Player" FROM table_37425 WHERE "Round" < '11' AND "Pick" < '152' AND "Position" = 'guard' |
CREATE TABLE table_name_66 (
position VARCHAR,
pick__number VARCHAR
) | The position that has a pick # of 16 is what? | SELECT position FROM table_name_66 WHERE pick__number = 16 |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | how many patients were diagnosed with transitory tachypnea of newborn? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Transitory tachypnea of newborn" |
CREATE TABLE table_name_57 (
home_team VARCHAR,
venue VARCHAR
) | What is the home team of lake oval's score? | SELECT home_team AS score FROM table_name_57 WHERE venue = "lake oval" |
CREATE TABLE table_18735 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Who was the incumbent when ran william b. oliver (d) unopposed? | SELECT "Incumbent" FROM table_18735 WHERE "Candidates" = 'William B. Oliver (D) Unopposed' |
CREATE TABLE table_55623 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many laps in total does the driver named Eddie Irvine have? | SELECT COUNT("Laps") FROM table_55623 WHERE "Driver" = 'eddie irvine' |
CREATE TABLE table_name_12 (
aspect VARCHAR,
programming VARCHAR
) | What Aspect has a Programming of Saigon Network Television? | SELECT aspect FROM table_name_12 WHERE programming = "saigon network television" |
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... | Average question size (with word count). | SELECT t.TagName, CEIL(AVG(LENGTH(p.Body)) / 5.1) AS average_word_length FROM Posts AS p INNER JOIN PostTags AS pg ON pg.PostId = p.Id INNER JOIN Tags AS t ON pg.TagId = t.Id WHERE p.PostTypeId = 1 GROUP BY t.TagName, t.Count ORDER BY t.Count DESC |
CREATE TABLE table_name_33 (
rank VARCHAR,
events VARCHAR,
prize_money__$__ VARCHAR
) | What is the rank for the player with events greater than 23 and prize money in excess of $823,783? | SELECT COUNT(rank) FROM table_name_33 WHERE events > 23 AND prize_money__$__ > 823 OFFSET 783 |
CREATE TABLE table_13514348_7 (
umpires VARCHAR,
simpson_medal VARCHAR
) | Who were the umpires when Paul Medhurst (C) won the Simpson Medal? | SELECT umpires FROM table_13514348_7 WHERE simpson_medal = "Paul Medhurst (C)" |
CREATE TABLE table_name_45 (
final_year INTEGER,
notes VARCHAR,
first_year VARCHAR
) | What is the most minimal Final year that has a Notes of replaced by i-75 and m-25, and a First year larger than 1926? | SELECT MIN(final_year) FROM table_name_45 WHERE notes = "replaced by i-75 and m-25" AND first_year > 1926 |
CREATE TABLE table_69712 (
"Player" text,
"Games" text,
"Tries" text,
"Goals" text,
"F. Goals" text,
"Points" text
) | Name the F. Goals for games of 22 22 and points of 012 12 | SELECT "F. Goals" FROM table_69712 WHERE "Games" = '22 22' AND "Points" = '012 12' |
CREATE TABLE table_name_62 (
mintage INTEGER,
issue_price VARCHAR,
artist VARCHAR
) | What was the mintage having an issue price of $1,099.99, artist being Pamela Stagg? | SELECT AVG(mintage) FROM table_name_62 WHERE issue_price = "$1,099.99" AND artist = "pamela stagg" |
CREATE TABLE table_9363 (
"Date" text,
"Series" text,
"Circuit" text,
"City / State" text,
"Winner" text,
"Team" text
) | What is the City / State, when Series is ATCC Round 3? | SELECT "City / State" FROM table_9363 WHERE "Series" = 'atcc round 3' |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients who were admitted before the year 2157 and whose procedure long title is endoscopic sphincterotomy and papillotomy. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2157" AND procedures.long_title = "Endoscopic sphincterotomy and papillotomy" |
CREATE TABLE table_1042 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many touchdowns were scored by players who scored more than 5.0 extra points? | SELECT COUNT("Touchdowns") FROM table_1042 WHERE "Extra points" > '5.0' |
CREATE TABLE table_name_12 (
high_assists VARCHAR,
date VARCHAR
) | What are the High assists for February 2? | SELECT high_assists FROM table_name_12 WHERE date = "february 2" |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the average of manager_id , and group by attribute job_id in a bar chart. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE l... | what is the total intake (ml)-gastrostomy/enterostomy gastrostomy 16 fr. luq dose that on the last icu visit patient 017-59454 has received? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-59454') AND NOT patient.unitdischargetime IS... |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
me... | when has patient 033-3009 gotten a prescription for the last time in 10/last year? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-3009')) AND DATETIME(medication.drugstarttime, 'start of y... |
CREATE TABLE table_42068 (
"Name" text,
"Nationality" text,
"Position" text,
"Appearances" real,
"Goals" real
) | how many appearances did batram suri category:articles with hcards have scoring less than 2 goals? | SELECT COUNT("Appearances") FROM table_42068 WHERE "Name" = 'batram suri category:articles with hcards' AND "Goals" < '2' |
CREATE TABLE table_name_2 (
week INTEGER,
attendance VARCHAR
) | For what week was the attendance 40,429? | SELECT SUM(week) FROM table_name_2 WHERE attendance = 40 OFFSET 429 |
CREATE TABLE table_33185 (
"Positional or Automatic" text,
"Opponents" text,
"Suits" text,
"Material or Non-material" text,
"Count Rectified" text
) | Is it material or non-material when there are 2 suits for either opponent? | SELECT "Material or Non-material" FROM table_33185 WHERE "Suits" = '2' AND "Opponents" = 'either' |
CREATE TABLE table_14226 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of the bronze medals won by south korea? | SELECT SUM("Bronze") FROM table_14226 WHERE "Nation" = 'south korea' |
CREATE TABLE table_19418696_3 (
qb_rating VARCHAR,
completions VARCHAR
) | How many QB ratings for the player with 1069 completions? | SELECT COUNT(qb_rating) FROM table_19418696_3 WHERE completions = 1069 |
CREATE TABLE table_65926 (
"Year" real,
"Venue" text,
"Competition" text,
"Kilkenny score" text,
"Waterford score" text
) | What is the waterford score that has a year prior to 1963, with all-ireland hurling final replay as the competition? | SELECT "Waterford score" FROM table_65926 WHERE "Year" < '1963' AND "Competition" = 'all-ireland hurling final replay' |
CREATE TABLE Rating (
stars INTEGER,
mID VARCHAR
)
CREATE TABLE Movie (
title VARCHAR,
director VARCHAR,
mID VARCHAR
) | Find the title and score of the movie with the lowest rating among all movies directed by each director. | SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.director |
CREATE TABLE table_59524 (
"Rank" real,
"City" text,
"State" text,
"Population" real,
"Metro Population of 4 aspects" real
) | What is the state of the city of denver, which has a rank less than 10? | SELECT "State" FROM table_59524 WHERE "Rank" < '10' AND "City" = 'denver' |
CREATE TABLE table_name_52 (
pommel_horse VARCHAR,
vault VARCHAR,
total VARCHAR,
team VARCHAR
) | How many pommel horses have a Total smaller than 230.019, a Team of china (chn), and a Vault smaller than 38.437? | SELECT COUNT(pommel_horse) FROM table_name_52 WHERE total < 230.019 AND team = "china (chn)" AND vault < 38.437 |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | when did patient 025-28600 last have a microbiology test on their last hospital encounter? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-28600' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... |
CREATE TABLE table_61541 (
"Date" text,
"Opponents" text,
"H / A" text,
"Result F \u2013 A" text,
"Attendance" real
) | How many people attended the game against the Kaizer Chiefs? | SELECT SUM("Attendance") FROM table_61541 WHERE "Opponents" = 'kaizer chiefs' |
CREATE TABLE table_59832 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
) | What is the highest attendance for the opponents Club Brugge in Venue A? | SELECT MAX("Attendance") FROM table_59832 WHERE "Opponent" = 'club brugge' AND "Venue" = 'a' |
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(4)
)
CREATE TABLE classroom (
building varchar(15),
room_number varchar(7),
capacity numeric(4,0)
)
CREATE ... | Give the number of departments with greater than average budget in each building with a bar chart, and rank from high to low by the Y. | SELECT building, COUNT(building) FROM department WHERE budget > (SELECT AVG(budget) FROM department) GROUP BY building ORDER BY COUNT(building) DESC |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_typ... | calculate the two year survival rate of the patients diagnosed with streptococcus group b. | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id... |
CREATE TABLE table_14407512_9 (
points VARCHAR
) | What is the 1st(m) score for the Person who had a total points of 272.7 | SELECT 1 AS st__m_ FROM table_14407512_9 WHERE points = "272.7" |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | what was the five most frequently ordered laboratory tests this year? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY labevents.itemid) AS t1... |
CREATE TABLE instructor (
dept_name VARCHAR,
salary INTEGER
) | Find the names and average salaries of all departments whose average salary is greater than 42000. | SELECT dept_name, AVG(salary) FROM instructor GROUP BY dept_name HAVING AVG(salary) > 42000 |
CREATE TABLE table_22761 (
"Player" text,
"Nat" text,
"Pos" text,
"L Apps" real,
"L G" real,
"C Apps" real,
"Total Apps" real,
"Total G" real
) | Name the nat for total apps for 27 | SELECT "Nat" FROM table_22761 WHERE "Total Apps" = '27' |
CREATE TABLE table_66479 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
) | What class has cbon-fm-23 as the identifier? | SELECT "Class" FROM table_66479 WHERE "Identifier" = 'cbon-fm-23' |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25... | For those employees who did not have any job in the past, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE... | Are there Core class professors appointed for the Winter ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | today, did patient 016-38131 have any bulb #2 output? | 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 = '016-38131')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | For those employees who do not work in departments with managers that have ids between 100 and 200, draw a scatter chart about the correlation between salary and commission_pct . | SELECT SALARY, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
CREATE TABLE table_78939 (
"City" text,
"Country" text,
"Airport" text,
"IATA" text,
"ICAO" text
) | What Airport's ICAO is ENTO? | SELECT "Airport" FROM table_78939 WHERE "ICAO" = 'ento' |
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABLE loan (
loan_id text,
loan_type text,
cust_id text,
branch_id text,
amount number
)
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
... | What city and state is the bank with the name morningside in? | SELECT city, state FROM bank WHERE bname = 'morningside' |
CREATE TABLE table_26617 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
) | When 4 is the week what is the location? | SELECT "Location" FROM table_26617 WHERE "Week" = '4' |
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 admission type is urgent and drug name is tacrolimus? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Tacrolimus" |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | If I were to take EDCURINS 575 , who would be the instructor ? | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EDCURINS' AND course.number = 575 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offeri... |
CREATE TABLE table_name_3 (
round INTEGER,
player VARCHAR
) | what is the round for jake gardiner? | SELECT AVG(round) FROM table_name_3 WHERE player = "jake gardiner" |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by time. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) |
CREATE TABLE table_204_929 (
id number,
"location" text,
"name of mill and\ngrid reference" text,
"type" text,
"maps" text,
"first mention\nor built" text,
"last mention\nor demise" number
) | how many locations have or had at least 2 windmills ? | SELECT COUNT(*) FROM (SELECT "location" FROM table_204_929 GROUP BY "location" HAVING COUNT(*) >= 2) |
CREATE TABLE pilot (
Pilot_Id int(11),
Name varchar(50),
Age int(11)
)
CREATE TABLE aircraft (
Aircraft_ID int(11),
Aircraft varchar(50),
Description varchar(50),
Max_Gross_Weight varchar(50),
Total_disk_area varchar(50),
Max_disk_Loading varchar(50)
)
CREATE TABLE airport (
Ai... | Frequency of the aircrafts that has win an award, across by its name as a pie chart | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft |
CREATE TABLE table_name_45 (
show VARCHAR,
year VARCHAR,
episode_title VARCHAR
) | Which show had a part 3 before 2011? | SELECT show FROM table_name_45 WHERE year < 2011 AND episode_title = "part 3" |
CREATE TABLE table_64119 (
"Date of release" text,
"Title" text,
"Billboard peak" text,
"RIAA cert." text,
"Label" text
) | What was the Billboard peak for the album released on September 12, 2000 by sanctuary? | SELECT "Billboard peak" FROM table_64119 WHERE "Label" = 'sanctuary' AND "Date of release" = 'september 12, 2000' |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(15),
order_date DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Order_Items (
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(15)
)
CREATE TABLE Customer_Contact_Channels (
c... | What are the number of the dates when customers with ids between 10 and 20 became customers? | SELECT date_became_customer, COUNT(date_became_customer) FROM Customers WHERE customer_id BETWEEN 10 AND 20 |
CREATE TABLE table_32766 (
"Freq" real,
"Call" text,
"City" text,
"Owner" text,
"Day Power ( W )" real,
"Night Power" real,
"Format" text,
"Stereo" text
) | What is the Triad frew with a day power of 5,000? | SELECT COUNT("Freq") FROM table_32766 WHERE "Day Power ( W )" = '5,000' AND "Owner" = 'triad' |
CREATE TABLE table_27537518_6 (
decision VARCHAR,
first_star VARCHAR
) | Who made the decisions in the game whose first star was V. Lecavalier? | SELECT decision FROM table_27537518_6 WHERE first_star = "V. Lecavalier" |
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 dementia without behav dist and tested with cerebrospinal fluid (csf) in lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Dementia w/o behav dist" AND lab.fluid = "Cerebrospinal Fluid (CSF)" |
CREATE TABLE table_58592 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Which driver drove in grid 19? | SELECT "Driver" FROM table_58592 WHERE "Grid" = '19' |
CREATE TABLE table_name_28 (
frequency_mhz VARCHAR,
city_of_license VARCHAR
) | Give me the MHz Frequency of Allapattah, Florida. | SELECT frequency_mhz FROM table_name_28 WHERE city_of_license = "allapattah, florida" |
CREATE TABLE table_name_17 (
place VARCHAR,
country VARCHAR,
score VARCHAR
) | What did United States place when the score was 71-70-72-68=281? | SELECT place FROM table_name_17 WHERE country = "united states" AND score = 71 - 70 - 72 - 68 = 281 |
CREATE TABLE table_4142 (
"By-election" real,
"Electorate" text,
"Date" text,
"Incumbent" text,
"Reason" text,
"Winner" text
) | When ihaia tainui is the incumbent what is the date? | SELECT "Date" FROM table_4142 WHERE "Incumbent" = 'Ihaia Tainui' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | did patient 005-4044 ever have a surgery until 2101? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-4044')) AND STRFTIME('%y', treatment.treatmenttime) <= '2101' |
CREATE TABLE block (
blockfloor number,
blockcode number
)
CREATE TABLE medication (
code number,
name text,
brand text,
description text
)
CREATE TABLE trained_in (
physician number,
treatment number,
certificationdate time,
certificationexpires time
)
CREATE TABLE procedures... | Tell me the employee id of the head of the department with the least employees. | SELECT head FROM department GROUP BY departmentid ORDER BY COUNT(departmentid) LIMIT 1 |
CREATE TABLE table_42071 (
"Region" text,
"Province" text,
"Capital" text,
"No. of Communes" real,
"Area" real,
"2002 Population" real
) | What province has a v valpara so region and an area of 927.2? | SELECT "Province" FROM table_42071 WHERE "Region" = 'v valparaíso' AND "Area" = '927.2' |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by weekday. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) |
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
)
... | what is admission time and diagnoses icd9 code of subject id 74032? | SELECT demographic.admittime, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "74032" |
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
)
... | what is procedure short title and procedure long title of procedure icd9 code 5361? | SELECT procedures.short_title, procedures.long_title FROM procedures WHERE procedures.icd9_code = "5361" |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | On Mondays and Wednesdays , am I able to take 995 ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... |
CREATE TABLE table_27537518_6 (
first_star VARCHAR,
record VARCHAR
) | Who was the first star of the game with record of 17-11-5? | SELECT first_star FROM table_27537518_6 WHERE record = "17-11-5" |
CREATE TABLE table_27208311_1 (
episode_no_episode_no_refers_to_the_episodes_number_in_the_overall_series VARCHAR,
_whereas_series_no_refers_to_the_episodes_number_in_this_particular_series VARCHAR,
series_no VARCHAR
) | What is every episode number for the series number 3? | SELECT episode_no_episode_no_refers_to_the_episodes_number_in_the_overall_series, _whereas_series_no_refers_to_the_episodes_number_in_this_particular_series FROM table_27208311_1 WHERE series_no = 3 |
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 job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the sum of employee_id bin hire_date by time, and visualize them by a bar chart. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
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,
... | count the number of patients whose lab test name is lymphs? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Lymphs" |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val... | what new drugs are being prescribed to patient 80555 today vs. yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80555) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE month (
... | may i have a listing of flights on monday from MINNEAPOLIS to LONG BEACH CALIFORNIA please | 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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LONG BEACH' AND date_day.day_number = 21 AND date_day.month_number... |
CREATE TABLE table_7452 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | Which Years in Orlando has a Nationality of united states, and a School/Club Team of illinois? | SELECT "Years in Orlando" FROM table_7452 WHERE "Nationality" = 'united states' AND "School/Club Team" = 'illinois' |
CREATE TABLE table_225204_4 (
date_successor_seated VARCHAR,
district VARCHAR
) | Name the date successor seated for pennsylvania 17th | SELECT date_successor_seated FROM table_225204_4 WHERE district = "Pennsylvania 17th" |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | give me the number of patients whose admission year is less than 2180 and item id is 51362? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2180" AND lab.itemid = "51362" |
CREATE TABLE table_59835 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What was Bernhard Langer's highest score? | SELECT MAX("Score") FROM table_59835 WHERE "Player" = 'bernhard langer' |
CREATE TABLE table_204_335 (
id number,
"outcome" text,
"no." number,
"date" number,
"tournament" text,
"surface" text,
"partner" text,
"opponents in the final" text,
"score in the final" text
) | how many times was jim mcmanus jim osborne 's partner ? | SELECT COUNT(*) FROM table_204_335 WHERE "partner" = 'jim mcmanus' |
CREATE TABLE table_name_71 (
frequency VARCHAR,
genre VARCHAR,
station VARCHAR
) | What frequency is the xfm station, which is part of the talk music genre? | SELECT frequency FROM table_name_71 WHERE genre = "talk music" AND station = "xfm" |
CREATE TABLE table_name_88 (
gold INTEGER,
silver VARCHAR,
total VARCHAR,
bronze VARCHAR
) | How many Gold medals did the Nation with less than 8 Total medals including 1 Bronze and 0 Silver receive? | SELECT MIN(gold) FROM table_name_88 WHERE total < 8 AND bronze < 1 AND silver < 1 |
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS... | How many courses for each office? Show me a stacked bar chart The x-axis is office name and group by course description, and sort by the X-axis from low to high. | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION, PROF_OFFICE ORDER BY PROF_OFFICE |
CREATE TABLE table_71612 (
"Date" text,
"Company" text,
"Business" text,
"Country" text,
"Value ( USD )" text
) | What company has an unknown date and is an energy business? | SELECT "Company" FROM table_71612 WHERE "Business" = 'energy' AND "Date" = 'unknown' |
CREATE TABLE available_policies (
customer_phone VARCHAR
) | Find all the phone numbers. | SELECT customer_phone FROM available_policies |
CREATE TABLE table_1204998_2 (
pinyin VARCHAR,
english_name VARCHAR
) | What is the pinyin for the English name Wuping County? | SELECT pinyin FROM table_1204998_2 WHERE english_name = "Wuping County" |
CREATE TABLE table_38948 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What's the lowest bronze with a 6 rank, smaller than 5 gold, and a total of more than 1? | SELECT MIN("Bronze") FROM table_38948 WHERE "Gold" < '5' AND "Rank" = '6' AND "Total" > '1' |
CREATE TABLE table_32104 (
"Title" text,
"Japan" text,
"North America" text,
"Europe" text,
"Australia" text
) | Tell me the north america for september 18, 2009 | SELECT "North America" FROM table_32104 WHERE "Europe" = 'september 18, 2009' |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname ... | Last semester who were the GSIs for CONDUCT 801 ? | SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course... |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Bod... | Top 10 answered posted with most votes given the specific tag and duration. | SELECT 'http://www.stackoverflow.com/questions/' + CAST(p2.ParentId AS TEXT) AS "URL", SUBSTRING(p2.Body, 1, 30) AS TITLE, Score AS VOTES FROM Posts AS p2, (SELECT p1.Id FROM Posts AS p1, PostTypes AS ptypes1, PostTags AS ptags1, Tags AS t1 WHERE p1.PostTypeId = ptypes1.Id AND ptypes1.Id = 1 AND p1.Id = ptags1.PostId A... |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airp... | show me the flights from PHILADELPHIA to DALLAS that stop in ATLANTA | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND CITY_2.cit... |
CREATE TABLE table_59799 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
) | What season has an away 2-0? | SELECT "Season" FROM table_59799 WHERE "Away" = '2-0' |
CREATE TABLE table_name_13 (
lead_pitch_mm INTEGER,
part_number VARCHAR
) | Which Lead Pitch/mm has a Part Number of tsop24/28? | SELECT MAX(lead_pitch_mm) FROM table_name_13 WHERE part_number = "tsop24/28" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.