table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_29 (
position VARCHAR,
player VARCHAR
) | Which Position has a Player of gibril wilson? | SELECT position FROM table_name_29 WHERE player = "gibril wilson" |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE requirement (
requiremen... | In the next 2 years , will 470 be offered ? | SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 470 AND semester.semester_id = course_offering.semester AND semester.year IN (2016, 2017) |
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Products (
product_id INTEGER,
color_code VARCHAR(15),
product_category_code VARCHAR(15),
product_name VARCHAR(80),
typical_buying_price VARCHAR(20),
... | What are the descriptions of the categories that products with product descriptions that contain the letter t are in, and count them by a bar chart, display by the y-axis from high to low. | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY COUNT(product_category_description) DESC |
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... | what is days of hospital stay and death status of subject name brooke coleman? | SELECT demographic.days_stay, demographic.expire_flag FROM demographic WHERE demographic.name = "Brooke Coleman" |
CREATE TABLE table_18991 (
"Country/Region" text,
"Local title" text,
"Television network" text,
"Seasons and winners" text,
"Judges" text,
"Presenters" text
) | who is the the judges with local title being x factor and presenters being heikki paasonen jukka rossi (xtra factor) | SELECT "Judges" FROM table_18991 WHERE "Local title" = 'X Factor' AND "Presenters" = 'Heikki Paasonen Jukka Rossi (Xtra Factor)' |
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
) | For those records from the products and each product's manufacturer, give me the comparison about price over the name , and group by attribute founder, list by the y axis in asc please. | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price |
CREATE TABLE table_25386974_1 (
podiums INTEGER,
position VARCHAR
) | What is the most podiums Pedro Nunes had when in 17th position? | SELECT MAX(podiums) FROM table_25386974_1 WHERE position = "17th" |
CREATE TABLE table_36835 (
"Surname" text,
"First" text,
"D.O.B." text,
"Bats" text,
"Throws" text,
"Position" text
) | Which First has Bats of r, and Throws of l, and a DOB of 12 october 1977? | SELECT "First" FROM table_36835 WHERE "Bats" = 'r' AND "Throws" = 'l' AND "D.O.B." = '12 october 1977' |
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 patient (
uniquep... | was patient 003-30817 diagnosed with an anemia - acute blood loss anemia? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '003-30817')) AND diagnosis.diagnosisname = 'anemia - acute blood loss anemia... |
CREATE TABLE table_56712 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" real,
"Record" text
) | Who was the visiting team on December 17? | SELECT "Visitor" FROM table_56712 WHERE "Date" = 'december 17' |
CREATE TABLE table_39149 (
"Date" text,
"Race" text,
"Distance" text,
"Venue" text,
"Radio" text
) | What is the distance of the race at the Atlanta Motor Speedway? | SELECT "Distance" FROM table_39149 WHERE "Venue" = 'atlanta motor speedway' |
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 diagnoses icd9 code is 29281 and lab test abnormal status is delta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "29281" AND lab.flag = "delta" |
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary VARCHAR(255),
recommendations VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Addresses (
addr... | Give me the comparison about the sum of monthly_rental over the date_address_from bin date_address_from by time. | SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC |
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
)
... | provide the number of patients whose admission year is less than 2175 and diagnoses short title is poison-psychotropic agt? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2175" AND diagnoses.short_title = "Poison-psychotropic agt" |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_... | show me the evening flights from ATLANTA to WASHINGTON on WEDNESDAY | 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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'WASHINGTON' AND days.day_name = 'WEDNESDAY' AND flight.flight_days = days.days_cod... |
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating nu... | What is the average rating of songs for each language Plot them as bar chart, I want to sort languages in ascending order. | SELECT languages, AVG(rating) FROM song GROUP BY languages ORDER BY languages |
CREATE TABLE table_name_79 (
celebrity VARCHAR,
finished VARCHAR
) | What celebrity finished 6th? | SELECT celebrity FROM table_name_79 WHERE finished = "6th" |
CREATE TABLE table_name_62 (
venue VARCHAR,
home_team VARCHAR
) | What venue featured fitzroy as the home squad? | SELECT venue FROM table_name_62 WHERE home_team = "fitzroy" |
CREATE TABLE table_203_717 (
id number,
"number" number,
"year built" number,
"livery" text,
"current status" text,
"notes" text
) | how many cars were created before 1960 ? | SELECT COUNT(*) FROM table_203_717 WHERE "year built" < 1960 |
CREATE TABLE table_14345690_5 (
exited VARCHAR,
celebrity VARCHAR
) | What is the exited day where the celebrity is vic reeves? | SELECT exited FROM table_14345690_5 WHERE celebrity = "Vic Reeves" |
CREATE TABLE table_204_293 (
id number,
"district" number,
"name" text,
"party" text,
"district office" text,
"first elected" number
) | how many total senators are there ? | SELECT COUNT("name") FROM table_204_293 |
CREATE TABLE table_77634 (
"YEAR" real,
"Seniors" text,
"Reserves" text,
"Thirds (Under 17's)" text,
"Fourths (Under 14's)" text
) | Which Seniors have YEAR before 2006, and Fourths (Under 14's) of kiewa-sandy creek? | SELECT "Seniors" FROM table_77634 WHERE "YEAR" < '2006' AND "Fourths (Under 14's)" = 'kiewa-sandy creek' |
CREATE TABLE table_name_19 (
round INTEGER,
name VARCHAR,
overall VARCHAR
) | With an Overall larger than 107, in what Round was Jim Duncan picked? | SELECT SUM(round) FROM table_name_19 WHERE name = "jim duncan" AND overall > 107 |
CREATE TABLE table_name_31 (
uni_number VARCHAR,
bats VARCHAR,
position VARCHAR
) | How many Uni numbers have Bats of s, and a Position of utl? | SELECT COUNT(uni_number) FROM table_name_31 WHERE bats = "s" AND position = "utl" |
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 varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(... | Just show the employee's last name and their manager's id using a bar chart. | SELECT LAST_NAME, MANAGER_ID FROM employees |
CREATE TABLE table_1459 (
"Institution" text,
"Location" text,
"Nickname" text,
"Enrollment" real,
"Established" real
) | what is the enrollment for the Cavaliers? | SELECT MAX("Enrollment") FROM table_1459 WHERE "Nickname" = 'Cavaliers' |
CREATE TABLE table_55510 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many grids had more than 61 laps? | SELECT SUM("Grid") FROM table_55510 WHERE "Laps" > '61' |
CREATE TABLE table_name_23 (
length VARCHAR,
date VARCHAR
) | What is the length of the race on August 15? | SELECT length FROM table_name_23 WHERE date = "august 15" |
CREATE TABLE table_55044 (
"Tournament" text,
"1980" text,
"1981" text,
"1982" text,
"1983" text,
"1984" text,
"1985" text,
"1986" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text... | What is the 1988 value when the 1987 value was 1r? | SELECT "1988" FROM table_55044 WHERE "1987" = '1r' |
CREATE TABLE flight (
id int,
Vehicle_Flight_number text,
Date text,
Pilot text,
Velocity real,
Altitude real,
airport_id int,
company_id int
)
CREATE TABLE operate_company (
id int,
name text,
Type text,
Principal_activities text,
Incorporated_in text,
Group_Equ... | What are the ids and names of the companies that operated more than one flight. | SELECT T1.name, T1.id FROM operate_company AS T1 JOIN flight AS t2 ON T1.id = T2.company_id |
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
de... | What are the names for all aircrafts with at least 2 flights? | SELECT T2.name FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid HAVING COUNT(*) >= 2 |
CREATE TABLE table_15417 (
"Season" text,
"Games" real,
"Lost" real,
"Tied" real,
"Points" real,
"Goals for" real,
"Goals against" real,
"Standing" text
) | Name the most games for standing of 5th, lebel and goals against larger than 220 with lost more than 52 | SELECT MAX("Games") FROM table_15417 WHERE "Standing" = '5th, lebel' AND "Goals against" > '220' AND "Lost" > '52' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid n... | how many patients until 4 years ago received a endotracheal tube - insertion after the first therapeutic antibacterials - vancomycin procedure in the same hospital visit? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - vancomycin' AND DATETIME(treatment.treatment... |
CREATE TABLE table_name_65 (
Id VARCHAR
) | What shows for 2002 when 2006 is Grand Slam Tournaments? | SELECT 2002 FROM table_name_65 WHERE 2006 = "grand slam tournaments" |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number... | how many patients who had been diagnosed with other apnea of newborn since 1 year ago? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_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 = 'other apnea of newborn') AND DATETIME(diagnoses_icd.chartt... |
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 (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of patients whose ethnicity is american indian/alaska native and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug_type = "MAIN" |
CREATE TABLE table_29494395_3 (
originalair_date VARCHAR,
director VARCHAR,
writer VARCHAR
) | What is the original air date when the director is Rowan Woods and the writer is Peter Duncan? | SELECT originalair_date FROM table_29494395_3 WHERE director = "Rowan Woods" AND writer = "Peter Duncan" |
CREATE TABLE table_17120964_7 (
man_of_the_match VARCHAR,
result VARCHAR
) | Who was the man of the match when they lost 2-4? | SELECT man_of_the_match FROM table_17120964_7 WHERE result = "Lost 2-4" |
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 ... | Create a pie chart showing the total number across county. | SELECT County, COUNT(*) FROM School GROUP BY County |
CREATE TABLE table_name_13 (
leading_scorer VARCHAR,
date VARCHAR
) | Name the leading scorer for april 12, 2008 | SELECT leading_scorer FROM table_name_13 WHERE date = "april 12, 2008" |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit te... | how many patients until 2 years ago were staying in the 8 ward? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 8 AND DATETIME(transfers.intime) <= DATETIME(CURRENT_TIME(), '-2 year')) |
CREATE TABLE table_name_44 (
game INTEGER,
record VARCHAR
) | What is the smallest game number with a record of 16-7-2? | SELECT MIN(game) FROM table_name_44 WHERE record = "16-7-2" |
CREATE TABLE table_26943 (
"Name" text,
"Position" text,
"Period" text,
"Appearances\u00b9" real,
"Goals\u00b9" real,
"Nationality\u00b2" text
) | What positions correspond to the name Thierry Morin? | SELECT "Position" FROM table_26943 WHERE "Name" = 'Thierry Morin' |
CREATE TABLE table_204_828 (
id number,
"whitworth size (in)" number,
"core diameter (in)" number,
"threads per inch" number,
"pitch (in)" number,
"tapping drill size" text
) | what is the total of the first two core diameters ? | SELECT SUM("core diameter (in)") FROM table_204_828 WHERE id <= 2 |
CREATE TABLE table_14003020_5 (
average INTEGER,
highest VARCHAR
) | what is the minimum average with highest being 2363 | SELECT MIN(average) FROM table_14003020_5 WHERE highest = 2363 |
CREATE TABLE table_72636 (
"Rank" real,
"Country/Territory" text,
"Miss World" real,
"1st Runner-up" real,
"2nd Runner-up" real,
"3rd Runner-up" real,
"4th Runner-up" real,
"5th Runner-up" real,
"6th Runner-up" real,
"Semifinalists" real,
"Total" real
) | Which countries have a 5th runner-up ranking is 2 and the 3rd runner-up ranking is 0 | SELECT "Total" FROM table_72636 WHERE "5th Runner-up" = '2' AND "3rd Runner-up" = '0' |
CREATE TABLE table_name_44 (
industry INTEGER,
agriculture INTEGER
) | What is the average Industry, when Agriculture is greater than 11? | SELECT AVG(industry) FROM table_name_44 WHERE agriculture > 11 |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | count the number of patients whose age is less than 58 and lab test fluid is urine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "58" AND lab.fluid = "Urine" |
CREATE TABLE table_204_940 (
id number,
"year" number,
"tournaments\nplayed" number,
"cuts\nmade" number,
"wins" number,
"2nd" number,
"3rd" number,
"top 10s" number,
"best\nfinish" text,
"earnings\n(\u20ac)" number,
"money\nlist rank" number,
"scoring\naverage" number,
... | which one is the least with scoring average | SELECT "year" FROM table_204_940 ORDER BY "scoring\naverage" LIMIT 1 |
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 (... | give me the number of patients whose age is less than 27 and diagnoses long title is tietze's disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "27" AND diagnoses.long_title = "Tietze's disease" |
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,
... | i mean how many days has it been since the last time patient 007-15837 had a levophed (ml): intake on the current intensive care unit visit? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =... |
CREATE TABLE table_75838 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the highest Total with a Rank that is smaller than 4 and a Nation of tunisia (tun) with a Gold that is smaller than 2? | SELECT MAX("Total") FROM table_75838 WHERE "Rank" < '4' AND "Nation" = 'tunisia (tun)' AND "Gold" < '2' |
CREATE TABLE table_45187 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text,
"Man of the Match" text
) | What is the attendance of the match on the 2nd with the slough jets as the opponent? | SELECT "Attendance" FROM table_45187 WHERE "Opponent" = 'slough jets' AND "Date" = '2nd' |
CREATE TABLE table_39806 (
"Airline" text,
"ICAO" text,
"IATA" text,
"Callsign" text,
"Commenced operations" real,
"Fleet size" real,
"Headquarters" text
) | Which ICAO has a Commenced operations larger than 2011? | SELECT "ICAO" FROM table_39806 WHERE "Commenced operations" > '2011' |
CREATE TABLE table_204_652 (
id number,
"title" text,
"year" number,
"director" text,
"country" text,
"genre" text,
"notes" text
) | what is the total number of lesbian , gay , bisexual , or transgender related films were there in the year 2000 ? | SELECT COUNT("title") FROM table_204_652 |
CREATE TABLE table_44018 (
"Team" text,
"Driver" text,
"Class" text,
"Chassis" text,
"Rounds" text
) | How many rounds did Nil Montserrat drive in? | SELECT "Rounds" FROM table_44018 WHERE "Driver" = 'nil montserrat' |
CREATE TABLE table_name_45 (
date VARCHAR,
winner VARCHAR,
competition_round VARCHAR,
venue VARCHAR,
season VARCHAR
) | On what date did Universitario win the Torneo Apertura round after 2003 at Estadio Alejandro Villanueva? | SELECT date FROM table_name_45 WHERE venue = "estadio alejandro villanueva" AND season > 2003 AND competition_round = "torneo apertura" AND winner = "universitario" |
CREATE TABLE table_71104 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
) | Which Set 3 has a Time of 10:00, and a Set 2 of 25 19? | SELECT "Set 3" FROM table_71104 WHERE "Time" = '10:00' AND "Set 2" = '25–19' |
CREATE TABLE table_14961 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Name the least attendance for 52-37 record | SELECT MIN("Attendance") FROM table_14961 WHERE "Record" = '52-37' |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
... | what time patient 13536 had last had the maximum arterial bp [systolic] value until 05/09/2105? | SELECT chartevents.charttime FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13536)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial... |
CREATE TABLE table_name_88 (
total_goals INTEGER,
league_cup_goals VARCHAR,
playoff_apps VARCHAR,
fa_cup_apps VARCHAR
) | How many total goals did the squad with 2 playoff apps, 2 FA Cup Apps, and 0 League Cup goals get? | SELECT SUM(total_goals) FROM table_name_88 WHERE playoff_apps = "2" AND fa_cup_apps = "2" AND league_cup_goals < 0 |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),... | For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by time, could you rank by the total number in desc? | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(DEPARTMENT_ID) DESC |
CREATE TABLE table_2093995_1 (
stations VARCHAR,
parking VARCHAR
) | Which station has park & ride lot parking? | SELECT stations FROM table_2093995_1 WHERE parking = "Park & Ride Lot" |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE... | Short/thank you comments on ru/pt SO. | SELECT c.Id AS "comment_link" FROM Comments AS c WHERE c.Text LIKE '%racias%' AND LENGTH(c.Text) < 20 ORDER BY c.CreationDate LIMIT 1000 |
CREATE TABLE table_45042 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What country was the player with the score line 69-71-72-69=281 from? | SELECT "Country" FROM table_45042 WHERE "Score" = '69-71-72-69=281' |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE route (
train_id int,
... | Draw a bar chart for what is the average high temperature for each day of week?, and sort from low to high by the total number please. | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week ORDER BY AVG(high_temperature) |
CREATE TABLE table_61573 (
"Name" text,
"Type" text,
"R.A. ( J2000 )" text,
"Dec. ( J2000 )" text,
"Redshift (km/ s )" text,
"Apparent Magnitude" real
) | Which Name has Apparent Magnitude smaller than 11.4, and R.A. (J2000) of 04h17m35.8s? | SELECT "Name" FROM table_61573 WHERE "Apparent Magnitude" < '11.4' AND "R.A. ( J2000 )" = '04h17m35.8s' |
CREATE TABLE table_204_159 (
id number,
"name" text,
"nation" text,
"position" text,
"league apps" number,
"league goals" number,
"fa cup apps" number,
"fa cup goals" number,
"total apps" number,
"total goals" number
) | the least number of total appearances | SELECT MIN("total apps") FROM table_204_159 |
CREATE TABLE table_36599 (
"Date" text,
"Home Team" text,
"Score" text,
"Visiting Team" text,
"Stadium" text
) | What was the score on April 6, 2008? | SELECT "Score" FROM table_36599 WHERE "Date" = 'april 6, 2008' |
CREATE TABLE table_11981 (
"Airing date" text,
"English title (Chinese title)" text,
"Number of episodes" real,
"HD format" text,
"Highest average point ratings" real,
"Genre" text,
"Official website" text
) | What was the highest average point rating for a modern suspense show with 21 episodes? | SELECT SUM("Highest average point ratings") FROM table_11981 WHERE "Genre" = 'modern suspense' AND "Number of episodes" = '21' |
CREATE TABLE table_name_93 (
fis_nordic_world_ski_championships VARCHAR,
winter_olympics VARCHAR
) | What is the FIS Nordic World Ski Championship years when the winter Olympics took place in 1968? | SELECT fis_nordic_world_ski_championships FROM table_name_93 WHERE winter_olympics = 1968 |
CREATE TABLE SECTION (
building VARCHAR,
room_number VARCHAR,
semester VARCHAR,
year VARCHAR,
course_id VARCHAR
)
CREATE TABLE course (
course_id VARCHAR,
dept_name VARCHAR,
title VARCHAR
) | Find the building, room number, semester and year of all courses offered by Psychology department sorted by course titles. | SELECT T2.building, T2.room_number, T2.semester, T2.year FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title |
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 COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
... | What is the first name and GPA of every student that has a GPA lower than average. Show bar chart. | SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME |
CREATE TABLE table_49210 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What is High Rebounds, when Location Attendance is 'Madison Square Garden Unknown', and when Date is 'May 18'? | SELECT "High rebounds" FROM table_49210 WHERE "Location Attendance" = 'madison square garden unknown' AND "Date" = 'may 18' |
CREATE TABLE Scientists (
SSN int,
Name Char(30)
)
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
) | Give me a histogram for what are the names of projects that require more than 300 hours, and how many scientists are assigned to each? | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name |
CREATE TABLE table_name_85 (
game VARCHAR,
year VARCHAR
) | What game was in 2005? | SELECT game FROM table_name_85 WHERE year = 2005 |
CREATE TABLE table_48969 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"Location Attendance" text,
"Record" text
) | Who was the high scorer in the Toronto game? | SELECT "High points" FROM table_48969 WHERE "Team" = 'toronto' |
CREATE TABLE table_1341598_44 (
incumbent VARCHAR,
district VARCHAR
) | What incumbent won the district of texas 22? | SELECT incumbent FROM table_1341598_44 WHERE district = "Texas 22" |
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,... | what is the number of patients whose ethnicity is black/african american and diagnoses short title is acute respiratry failure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.short_title = "Acute respiratry failure" |
CREATE TABLE table_name_51 (
lijsttrekker VARCHAR,
year VARCHAR,
chair VARCHAR
) | What is Lijsttrekker, when Year is after 1990, and when Chair is 'Ingrid Van Engelshoven'? | SELECT lijsttrekker FROM table_name_51 WHERE year > 1990 AND chair = "ingrid van engelshoven" |
CREATE TABLE table_15630 (
"Season" text,
"Games" real,
"Lost" real,
"Tied" text,
"Points" real,
"Goals for" real,
"Goals against" real,
"Standing" text
) | How many goals have Lost larger than 35, and Games smaller than 80? | SELECT COUNT("Goals for") FROM table_15630 WHERE "Lost" > '35' AND "Games" < '80' |
CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER,
store_name VARCHAR(80),
store_address VARCHAR(255),
store_phone VARCHAR(80),
store_email VARCHAR(80)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
... | Show the average of price supplied by supplier id 3 for different product type code in a bar chart, I want to show X in desc order. | SELECT product_type_code, AVG(product_price) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code ORDER BY product_type_code DESC |
CREATE TABLE train_station (
Train_ID int,
Station_ID int
)
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,
... | Show the total number of platforms of locations in each location in a bar chart. | SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location |
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
)
... | Bring the number of patients less than 85 years who have colangitis as their primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COLANGITIS" AND demographic.age < "85" |
CREATE TABLE table_79309 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | What were the notes in 2011? | SELECT "Notes" FROM table_79309 WHERE "Year" = '2011' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
... | what is the difference of weight last measured on the first hospital visit compared to the second to last value measured on the first hospital visit of patient 006-161415? | SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-161415' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL O... |
CREATE TABLE table_19851 (
"Category" text,
"Type" text,
"Attribute" text,
"Description" text,
"Bubbles" text,
"Cancelable" text
) | What are the attributes when the type is 'DOMNodeRemoved'? | SELECT "Attribute" FROM table_19851 WHERE "Type" = 'DOMNodeRemoved' |
CREATE TABLE table_65238 (
"Title" text,
"Series" text,
"Characters" text,
"Production Num." real,
"Release date" text
) | What is the smallest production number for the LT series with the Dumb Patrol title? | SELECT MIN("Production Num.") FROM table_65238 WHERE "Series" = 'lt' AND "Title" = 'dumb patrol' |
CREATE TABLE table_204_394 (
id number,
"year" number,
"album" text,
"label" text,
"peak chart\npositions\nus" number,
"peak chart\npositions\nus r&b" number
) | first album released | SELECT "album" FROM table_204_394 ORDER BY "year" LIMIT 1 |
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... | what is diagnoses short title of subject name jane dillard? | SELECT diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Jane Dillard" |
CREATE TABLE table_22666 (
"Doctor" text,
"Season" text,
"Story no." text,
"Serial" text,
"Number of episodes" text,
"Total footage remaining from missing episodes (mm:ss)" text,
"Missing episodes with recovered footage" text,
"Country/Territory" text,
"Source" text,
"Format" tex... | When 00:02 is the total footage (mm:ss) what is the story number? | SELECT "Story no." FROM table_22666 WHERE "Total footage (mm:ss)" = '00:02' |
CREATE TABLE table_204_420 (
id number,
"month" text,
"song" text,
"artist" text,
"aggregate points" number,
"total downloads" number,
"year-end chart" number
) | what artist previous to july made blue ? | SELECT "artist" FROM table_204_420 WHERE "month" < 7 AND "song" = '"blue"' |
CREATE TABLE table_34625 (
"Award" text,
"Year" real,
"Category" text,
"Work" text,
"Result" text
) | How many years have an Award of press award? | SELECT COUNT("Year") FROM table_34625 WHERE "Award" = 'press award' |
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,... | Specify the number of patients who had a family history of other specified malignant neoplasm that were treated with base drug | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Family history of other specified malignant neoplasm" AND prescriptions.drug_type = "BASE" |
CREATE TABLE table_name_1 (
morse_taper_number INTEGER,
d__max_ VARCHAR,
b__max_ VARCHAR
) | What's the total of the Morse Taper number when the D (max) is 20 and the B (max) greater than 94? | SELECT SUM(morse_taper_number) FROM table_name_1 WHERE d__max_ = 20 AND b__max_ > 94 |
CREATE TABLE table_58824 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What player has t7 as the place, with tje United States as the country? | SELECT "Player" FROM table_58824 WHERE "Place" = 't7' AND "Country" = 'united states' |
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 year of birth is less than 2065 and procedure icd9 code is 9604? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2065" AND procedures.icd9_code = "9604" |
CREATE TABLE table_name_44 (
results VARCHAR,
choreographer VARCHAR
) | What is the Result of the dance Choreographed by Kelly Aykers? | SELECT results FROM table_name_44 WHERE choreographer = "kelly aykers" |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_... | had patient 27392 given a lab test of total protein, body fluid in 2105? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'total protein, body fluid') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27392) AND STRFTIME('%y', labevents.charttime) = '2105' |
CREATE TABLE table_name_57 (
winning_score VARCHAR,
year VARCHAR
) | What is the Winning score in 1956? | SELECT winning_score FROM table_name_57 WHERE year = 1956 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.