table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_36172 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text
) | What was the record at the game on November 13, 1932? | SELECT "Record" FROM table_36172 WHERE "Date" = 'november 13, 1932' |
CREATE TABLE table_2509113_2 (
quillacollo_municipality INTEGER,
vinto_municipality VARCHAR
) | If the Vinto Municipality is 18630, what is the Quillacollo Municipality? | SELECT MAX(quillacollo_municipality) FROM table_2509113_2 WHERE vinto_municipality = 18630 |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | How many injured players not suffering from injury of 'Knee problem' in each match? Show me a bar chart grouping by number of matches, and sort y-axis in desc order please. | SELECT Number_of_matches, COUNT(Number_of_matches) FROM injury_accident WHERE Injury <> 'Knee problem' GROUP BY Number_of_matches ORDER BY COUNT(Number_of_matches) DESC |
CREATE TABLE table_name_73 (
sydney VARCHAR,
auckland VARCHAR,
perth VARCHAR
) | Which Sydney has Auckland cancelled and Perth yes? | SELECT sydney FROM table_name_73 WHERE auckland = "cancelled" AND perth = "yes" |
CREATE TABLE table_name_53 (
home_team VARCHAR
) | What is south melbourne's home side score? | SELECT home_team AS score FROM table_name_53 WHERE home_team = "south melbourne" |
CREATE TABLE table_name_82 (
mountain_range VARCHAR,
region VARCHAR,
location VARCHAR
) | Which Mountain Range has a Region of haiti, and a Location of 18.3601 n 71.9764 w? | SELECT mountain_range FROM table_name_82 WHERE region = "haiti" AND location = "18.3601°n 71.9764°w" |
CREATE TABLE table_name_46 (
attendance INTEGER,
home VARCHAR,
visitor VARCHAR
) | What was the attendance of the Florida vs. Montreal game? | SELECT AVG(attendance) FROM table_name_46 WHERE home = "florida" AND visitor = "montreal" |
CREATE TABLE table_37899 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
) | What is First elected that has republican Party and a Result of retired democratic gain? | SELECT "First elected" FROM table_37899 WHERE "Party" = 'republican' AND "Result" = 'retired democratic gain' |
CREATE TABLE table_name_71 (
diameter__km_ VARCHAR,
longitude VARCHAR,
latitude VARCHAR,
name VARCHAR
) | What in Xenia's Diameter in km, with a latitude of 14 and a longitude of 249.4? | SELECT COUNT(diameter__km_) FROM table_name_71 WHERE latitude < 14 AND name = "xenia" AND longitude > 249.4 |
CREATE TABLE table_41370 (
"Party" text,
"Marplan" text,
"Gallup" text,
"National Opinion Polls (NOP)" text,
"Opinion Research Centre (OPC)" text,
"Harris" text
) | What is Opinion Research Centre (OPC), when Party is Conservative? | SELECT "Opinion Research Centre (OPC)" FROM table_41370 WHERE "Party" = 'conservative' |
CREATE TABLE table_name_11 (
legs_lost VARCHAR,
player VARCHAR,
played VARCHAR
) | How many legs were lost for Trina Gulliver with more than 3 played? | SELECT COUNT(legs_lost) FROM table_name_11 WHERE player = "trina gulliver" AND played > 3 |
CREATE TABLE table_2226817_9 (
production_code VARCHAR,
written_by VARCHAR
) | What is the production code of the episode directed by Stacie Lipp? | SELECT production_code FROM table_2226817_9 WHERE written_by = "Stacie Lipp" |
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... | Next Winter , what special topics classes are there ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E... |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients whose ethnicity is hispanic/latino - puerto rican and year of birth is less than 2200? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND demographic.dob_year < "2200" |
CREATE TABLE table_73445 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
) | What is the market income per capita of the county with the 9.4% poverty rate? | SELECT "Market Income Per Capita" FROM table_73445 WHERE "Poverty Rate" = '9.4%' |
CREATE TABLE table_36442 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | In what City was Bulgaria the Opponent with Results of 1:0? | SELECT "City" FROM table_36442 WHERE "Results\u00b9" = '1:0' AND "Opponent" = 'bulgaria' |
CREATE TABLE table_204_64 (
id number,
"place" text,
"code" number,
"area (km2)" number,
"population" number,
"most spoken language" text
) | is the population of brandfort the same as the population of boipatong ? | SELECT (SELECT "population" FROM table_204_64 WHERE "place" = 'brandfort') = (SELECT "population" FROM table_204_64 WHERE "place" = 'boipatong') |
CREATE TABLE publication (
Publication_ID int,
Book_ID int,
Publisher text,
Publication_Date text,
Price real
)
CREATE TABLE book (
Book_ID int,
Title text,
Issues real,
Writer text
) | A bar chart showing the number of publication dates of books, sort Y from high to low order. | SELECT Publication_Date, COUNT(Publication_Date) FROM publication GROUP BY Publication_Date ORDER BY COUNT(Publication_Date) DESC |
CREATE TABLE table_name_88 (
rank INTEGER,
athlete VARCHAR
) | what is the rank for athlete hauffe, seifert, kaeufer, adamski? | SELECT SUM(rank) FROM table_name_88 WHERE athlete = "hauffe, seifert, kaeufer, adamski" |
CREATE TABLE table_49709 (
"Exit Date" text,
"Pos." text,
"Player" text,
"To club" text,
"Transfer fee" text
) | Teerasil Dangda who had a to club of released plays what position? | SELECT "Pos." FROM table_49709 WHERE "To club" = 'released' AND "Player" = 'teerasil dangda' |
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 allergy (
allergy... | during this year, what were the top five most frequent procedures that patients received during the same month after receiving a antibacterials - linezolid (zyvox)? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacterials - linezolid (zyvox)' AND ... |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime ... | is the white blood cells level of patient 15945 last measured on the current hospital visit greater than it was first measured on the current hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15945 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') ORDER BY labevents.... |
CREATE TABLE table_51240 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | On the date April 11, what is the total game number? | SELECT COUNT("Game") FROM table_51240 WHERE "Date" = 'april 11' |
CREATE TABLE table_53461 (
"Area in m\u00b2" text,
"Completion" text,
"City" text,
"Country" text,
"Denomination" text
) | What is the country with area of 3,170 in m ? | SELECT "Country" FROM table_53461 WHERE "Area in m\u00b2" = '3,170' |
CREATE TABLE table_24989 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | What team had average speed of 107.063 mph? | SELECT "Team" FROM table_24989 WHERE "Average Speed (mph)" = '107.063' |
CREATE TABLE table_name_27 (
goal INTEGER,
venue VARCHAR
) | What was the highest number of goals for a game held at Hannover? | SELECT MAX(goal) FROM table_name_27 WHERE venue = "hannover" |
CREATE TABLE table_78860 (
"Week" real,
"Event" text,
"Air Date" text,
"Winning team" text,
"Winners club" text
) | Which Week has an Air Date of august 2, 2008? | SELECT "Week" FROM table_78860 WHERE "Air Date" = 'august 2, 2008' |
CREATE TABLE table_name_90 (
position VARCHAR,
mls_team VARCHAR
) | Which position is the MLS team, Los Angeles Galaxy in? | SELECT position FROM table_name_90 WHERE mls_team = "los angeles galaxy" |
CREATE TABLE table_29773 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the largest game number? | SELECT MAX("Game") FROM table_29773 |
CREATE TABLE table_name_40 (
total_goals VARCHAR,
fa_cup_goals VARCHAR,
total_apps VARCHAR,
name VARCHAR
) | how many times is the total apps 1 and the fa cup goals less than 0 for bob mountain? | SELECT COUNT(total_goals) FROM table_name_40 WHERE total_apps = "1" AND name = "bob mountain" AND fa_cup_goals < 0 |
CREATE TABLE table_name_41 (
opponent VARCHAR,
date VARCHAR
) | What team was the opponent on 03/18/08? | SELECT opponent FROM table_name_41 WHERE date = "03/18/08" |
CREATE TABLE table_name_69 (
gloss VARCHAR,
pronunciation VARCHAR
) | Name the gloss for [ d m] | SELECT gloss FROM table_name_69 WHERE pronunciation = "[χdəm]" |
CREATE TABLE table_73754 (
"Season" real,
"Winner" text,
"Runner-Up" text,
"Third Place" text,
"Contestants" real
) | How many contestants were there when the runner-up was S rgio Abreu? | SELECT MAX("Contestants") FROM table_73754 WHERE "Runner-Up" = 'Sérgio Abreu' |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a scatter chart about the correlation between Team_ID and School_ID , and group by attribute ACC_Road. | SELECT Team_ID, School_ID FROM basketball_match GROUP BY ACC_Road |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,... | give me the total amount of lr ivf that patient 006-70268 took on 04/13/this year. | 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 = '006-70268')) AND intakeoutput.celllabel = 'lr iv... |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | count the number of patients whose admission year is 2129 and lab test item id is 50993. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2129" AND lab.itemid = "50993" |
CREATE TABLE table_203_60 (
id number,
"outcome" text,
"no." number,
"date" text,
"championship" text,
"surface" text,
"opponent in the final" text,
"score in the final" text
) | what were the total number of times the championship was held in italy ? | SELECT COUNT(*) FROM table_203_60 WHERE "championship" = 'italy' |
CREATE TABLE table_train_165 (
"id" int,
"gender" string,
"hemoglobin_a1c_hba1c" float,
"visual_impairment" bool,
"blood_glucose" int,
"body_mass_index_bmi" float,
"a1c" float,
"age" float,
"NOUSE" float
) | male or female > 60 years of age. | SELECT * FROM table_train_165 WHERE (gender = 'male' OR gender = 'female') AND age > 60 |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | count the number of patients whose ethnicity is black/cape verdean and days of hospital stay is greater than 10? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.days_stay > "10" |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | Plot the total number by grouped by city code as a bar graph, could you list by the Y-axis in descending? | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
... | when was the last microbiological sputum, expectorated test of patient 025-44495 performed this month? | 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-44495')) AND microlab.culturesite = 'sputum, expectorated' AN... |
CREATE TABLE table_16777 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | What's the report for the Silverstone circuit? | SELECT "Report" FROM table_16777 WHERE "Circuit" = 'Silverstone' |
CREATE TABLE table_name_42 (
college VARCHAR,
round VARCHAR,
position VARCHAR
) | Which College has a Round of 11, and a Position of wr? | SELECT college FROM table_name_42 WHERE round = 11 AND position = "wr" |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a bar chart about the distribution of ACC_Road and the sum of School_ID , and group by attribute ACC_Road, display in asc by the total number of school id. | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(School_ID) |
CREATE TABLE table_3846 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | How many teams were there when chris bosh , lebron james (8) had the high rebounds? | SELECT COUNT("Team") FROM table_3846 WHERE "High rebounds" = 'Chris Bosh , LeBron James (8)' |
CREATE TABLE table_65370 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | Which Year has a Position of 2nd, and Notes of -63kg, and a Venue of manchester? | SELECT "Year" FROM table_65370 WHERE "Position" = '2nd' AND "Notes" = '-63kg' AND "Venue" = 'manchester' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | provide the number of patients whose admission type is urgent and diagnoses short title is hyperacusis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "URGENT" AND diagnoses.short_title = "Hyperacusis" |
CREATE TABLE table_204_70 (
id number,
"pick #" number,
"nfl team" text,
"player" text,
"position" text,
"college" text
) | how many defensive backs are there ? | SELECT COUNT(*) FROM table_204_70 WHERE "position" = 'defensive back' |
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(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | What are the job titles, and range of salaries for jobs with maximum salary between 12000 and 18000 Plot them as bar chart, and I want to list by the names from low to high. | SELECT JOB_TITLE, MAX_SALARY - MIN_SALARY FROM jobs WHERE MAX_SALARY BETWEEN 12000 AND 18000 ORDER BY JOB_TITLE |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | how did patient 70516 last come to the hospital since 2104? | SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 70516 AND STRFTIME('%y', admissions.admittime) >= '2104' ORDER BY admissions.admittime DESC LIMIT 1 |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(4... | For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time, and I want to display in desc by the Y-axis. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(DEPARTMENT_ID) DESC |
CREATE TABLE table_5126 (
"Race" text,
"Length" text,
"Class" text,
"Circuit" text,
"Date" text
) | What is the date of the Mosport Park circuit? | SELECT "Date" FROM table_5126 WHERE "Circuit" = 'mosport park' |
CREATE TABLE table_25345002_1 (
date_of_death VARCHAR,
date_of_birth VARCHAR
) | What are the dates of death of those politicians whose date of birth 1938-08-30 30 august 1938? | SELECT COUNT(date_of_death) FROM table_25345002_1 WHERE date_of_birth = "1938-08-30 30 August 1938" |
CREATE TABLE table_11803648_20 (
player VARCHAR,
round VARCHAR
) | Which player is in round 5? | SELECT player FROM table_11803648_20 WHERE round = 5 |
CREATE TABLE table_name_98 (
royal_house VARCHAR,
state VARCHAR
) | Which royal house is in the state of chu? | SELECT royal_house FROM table_name_98 WHERE state = "chu" |
CREATE TABLE table_24018112_1 (
frequency VARCHAR,
brand_name VARCHAR
) | What frequency does the Pentium processor use? | SELECT frequency FROM table_24018112_1 WHERE brand_name = "Pentium" |
CREATE TABLE table_name_94 (
score VARCHAR,
competition VARCHAR,
date VARCHAR
) | On 15/04/07 in the competition Super League XII, what was the score? | SELECT score FROM table_name_94 WHERE competition = "super league xii" AND date = "15/04/07" |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid... | what changes have been made to the arterial bp mean in patient 14203's last measured on the first icu visit compared to the second to last value measured on the first icu visit? | SELECT (SELECT chartevents.valuenum 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 = 14203) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... |
CREATE TABLE table_59583 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is the home team of the game with a 2-0 record? | SELECT "Home" FROM table_59583 WHERE "Record" = '2-0' |
CREATE TABLE table_40136 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"Socialist Labor ticket" text,
"Prohibition ticket" text,
"Independent Citizens' ticket" text
) | What kind of Republican ticket has a Prohibition ticket of stephen mead wing? | SELECT "Republican ticket" FROM table_40136 WHERE "Prohibition ticket" = 'stephen mead wing' |
CREATE TABLE table_203_654 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
) | how many teams had more points than silex ? | SELECT COUNT("team") FROM table_203_654 WHERE "points" > (SELECT "points" FROM table_203_654 WHERE "team" = 'silex') |
CREATE TABLE table_18602462_21 (
quarterfinals VARCHAR,
athlete VARCHAR
) | When bas van erp was the athlete what was the quarterfinals? | SELECT quarterfinals FROM table_18602462_21 WHERE athlete = "Bas van Erp" |
CREATE TABLE table_34071 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text
) | What is the leading scorer of the game with an attendance of 14,096? | SELECT "Leading scorer" FROM table_34071 WHERE "Attendance" = '14,096' |
CREATE TABLE table_59061 (
"Place" text,
"Competitor" text,
"Downhill points" real,
"Slalom points" text,
"Total" text
) | What are the total points for the skier with 3.18 slalom points? | SELECT "Total" FROM table_59061 WHERE "Slalom points" = '3.18' |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_leg (
flight_id int,
... | show me US flights from SAN FRANCISCO to PITTSBURGH on tuesday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 A... |
CREATE TABLE table_51439 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Can you tell me the Away team that has the Away team score of 6.11 (47)? | SELECT "Away team" FROM table_51439 WHERE "Away team score" = '6.11 (47)' |
CREATE TABLE table_name_26 (
attendance INTEGER,
venue VARCHAR,
round VARCHAR
) | What is the average attendance at a game held at Firhill for the 5(r) round? | SELECT AVG(attendance) FROM table_name_26 WHERE venue = "firhill" AND round = "5(r)" |
CREATE TABLE table_10786 (
"Player" text,
"Att." real,
"Yards" real,
"Avg." real,
"Long" real,
"FumL" real
) | Tell me the most Att with a long of 27 with yards longer than 27 | SELECT MAX("Att.") FROM table_10786 WHERE "Long" = '27' AND "Yards" > '27' |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | what is the cost of drug name aspirin chew tab 81 mg? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'aspirin chew tab 81 mg') |
CREATE TABLE table_name_85 (
team__league_ VARCHAR,
player VARCHAR,
reg_gp VARCHAR,
pick__number VARCHAR
) | Which team has a Reg GP of 0, a pick number under 136 with a player named Regan Darby? | SELECT team__league_ FROM table_name_85 WHERE reg_gp = 0 AND pick__number < 136 AND player = "regan darby" |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TA... | Votes on deleted posts by year. | SELECT COUNT(*) FROM Votes WHERE PostId IS NULL |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label te... | what are the five most commonly prescribed medications in the same month to the female patients aged 20s after having been diagnosed with chf nos until 2104? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... |
CREATE TABLE table_name_39 (
points INTEGER,
chassis VARCHAR,
year VARCHAR
) | What is the most points that the Maserati 250F chassis scored in years after 1955? | SELECT MAX(points) FROM table_name_39 WHERE chassis = "maserati 250f" AND year > 1955 |
CREATE TABLE table_21690339_1 (
country VARCHAR,
_percentage_cut VARCHAR
) | What country had a 100% cut? | SELECT country FROM table_21690339_1 WHERE _percentage_cut = "100%" |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
... | please give me round trip fares from PITTSBURGH to PHILADELPHIA | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... |
CREATE TABLE table_name_98 (
father VARCHAR,
husband VARCHAR
) | Which father had william iv as a husband? | SELECT father FROM table_name_98 WHERE husband = "william iv" |
CREATE TABLE table_204_476 (
id number,
"name" text,
"date built" number,
"builder" text,
"works no." number,
"wheels" text,
"cylinders" text,
"notes" text,
"withdrawn" number
) | was no. 1 or veteran built in 1847 ? | SELECT "name" FROM table_204_476 WHERE "name" IN ('no.1', 'veteran') AND "date built" = 1847 |
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_office text,
Left_office text,
Region_ID int,
Party_name text
)
CREATE TABLE member (
Member_ID int,
Member_Name tex... | Give me a histogram for how many members are in each party?, and rank from low to high by the bar. | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_... | For those days with the 3 largest maximum gust speeds, can you plot a bar chart to compare the total mean humidity of each day of the weeks? | SELECT date, SUM(mean_humidity) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 |
CREATE TABLE table_name_19 (
chassis VARCHAR,
entrant VARCHAR
) | What is the company that made the chassis for the entrant danka arrows yamaha? | SELECT chassis FROM table_name_19 WHERE entrant = "danka arrows yamaha" |
CREATE TABLE table_31088 (
"Year" real,
"Number of tropical storms" real,
"Number of hurricanes" real,
"Number of major hurricanes" real,
"Deaths" text,
"Strongest storm" text
) | How many deaths did the year with 10 hurricanes and exactly 1 major hurricane have? | SELECT "Deaths" FROM table_31088 WHERE "Number of hurricanes" = '10' AND "Number of major hurricanes" = '1' |
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age... | What are the last year of the parties whose theme is 'Spring' or 'Teqnology'? Count the last year for a bar chart, I want to rank y axis in desc order. | SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" GROUP BY Last_year ORDER BY COUNT(Last_year) DESC |
CREATE TABLE table_name_92 (
category VARCHAR,
year VARCHAR,
award VARCHAR
) | Tell me the category for 2012 and drama league award | SELECT category FROM table_name_92 WHERE year = 2012 AND award = "drama league award" |
CREATE TABLE table_23670057_4 (
year_born INTEGER,
player VARCHAR
) | What is the date of birth for basket baller called ido kozikaro | SELECT MAX(year_born) FROM table_23670057_4 WHERE player = "Ido Kozikaro" |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | Deletable questions with a tag. | SELECT p.Id FROM Posts AS p WHERE (p.PostTypeId = 1 AND NOT p.ClosedDate IS NULL AND p.Score <= '##maxscore##' AND p.ViewCount <= '##maxviews##' AND p.Tags LIKE '%##tag##%' AND DATEDIFF(day, p.ClosedDate, GETDATE()) >= '##mindays##' AND '##maxscore##' >= ALL (SELECT a.Score FROM Posts AS a WHERE (a.ParentId = p.Id)) AN... |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose diagnoses short title is subarachnoid hemorrhage and lab test fluid is pleural? | 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 = "Subarachnoid hemorrhage" AND lab.fluid = "Pleural" |
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 the number of patients whose gender is m and year of birth is less than 2024? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.dob_year < "2024" |
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... | Percentage of Posts w/ Scores of >1, 0 and <1, by Post Type. | SELECT pt.Name AS "Type", COUNT(p.Id) AS "Total", CAST(ROUND(COUNT(CASE WHEN p.Score > 0 THEN 1 ELSE NULL END) / CAST(COUNT(p.Id) AS FLOAT) * 100, 4) AS TEXT(7)) + '%' AS "+", CAST(ROUND(COUNT(CASE WHEN p.Score = 0 THEN 1 ELSE NULL END) / CAST(COUNT(p.Id) AS FLOAT) * 100, 4) AS TEXT(7)) + '%' AS "0", CAST(ROUND(COUNT(C... |
CREATE TABLE table_36751 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | How much Played has a Lost larger than 14, and Drawn of 8, and a Team of ipatinga? | SELECT SUM("Played") FROM table_36751 WHERE "Lost" > '14' AND "Drawn" = '8' AND "Team" = 'ipatinga' |
CREATE TABLE constructorStandings (
constructorid VARCHAR
) | What are the numbers of races for each constructor id? | SELECT COUNT(*), constructorid FROM constructorStandings GROUP BY constructorid |
CREATE TABLE table_64466 (
"Season" real,
"Level" text,
"Division" text,
"Administration" text,
"Position" text
) | What Level has a Season larger than 2010? | SELECT "Level" FROM table_64466 WHERE "Season" > '2010' |
CREATE TABLE table_59313 (
"Portland DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the average entry in the against column with draws smaller than 0? | SELECT AVG("Against") FROM table_59313 WHERE "Draws" < '0' |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | what is the daily average amount of actual patient fluid removal that patient 028-30487 had in 05/this year? | SELECT AVG(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 = '028-30487')) AND intakeoutput.celllabel = 'actua... |
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,
... | what is the last ward id of patient 009-424 on the first hospital visit? | SELECT patient.wardid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-424' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) ORDER BY patient.unitadmittime DESC LIMIT 1 |
CREATE TABLE table_train_186 (
"id" int,
"language" string,
"diabetic" string,
"regular_alcohol_intake" int,
"allergy_to_drug" bool,
"alcohol_abuse" bool,
"age" float,
"NOUSE" float
) | history of hypersensitivity to the trial drug or to drugs with similar chemical structures. | SELECT * FROM table_train_186 WHERE allergy_to_drug = 1 |
CREATE TABLE table_204_634 (
id number,
"tour" number,
"official title" text,
"venue" text,
"city" text,
"date\nstart" text,
"date\nfinish" text,
"prize money\nusd" number,
"report" text
) | which has the same prize money as the french super series ? | SELECT "official title" FROM table_204_634 WHERE "official title" <> 'french super series' AND "prize money\nusd" = (SELECT "prize money\nusd" FROM table_204_634 WHERE "official title" = 'french super series') |
CREATE TABLE table_24471 (
"Team" text,
"Sport" text,
"League" text,
"Established" real,
"Began in St. Louis" real,
"Venue" text,
"Championships in St. Louis" text,
"Left St. Louis" real
) | How many championships were won for arena football? | SELECT "Championships in St. Louis" FROM table_24471 WHERE "Sport" = 'Arena Football' |
CREATE TABLE table_203_694 (
id number,
"#" number,
"name" text,
"took office" text,
"left office" text,
"party" text
) | who was the only prime minister to be in office three times ? | SELECT "name" FROM table_203_694 GROUP BY "name" HAVING COUNT(*) >= 3 |
CREATE TABLE table_2417 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Midshipmen points" real,
"Opponents" real,
"Record" text
) | Name the most opponents for 8-1 record | SELECT MAX("Opponents") FROM table_2417 WHERE "Record" = '8-1' |
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, visualize a bar chart about the distribution of founder and the sum of revenue , and group by attribute founder, and display by the y-axis in ascending. | SELECT Founder, SUM(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY SUM(Revenue) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.