table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | how many patients whose age is less than 59 and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "59" AND lab."CATEGORY" = "Blood Gas" |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
Cr... | Worst Posts (according to votes). | SELECT Score, Id AS "post_link" FROM Posts WHERE PostTypeId = 1 ORDER BY Score LIMIT 10 |
CREATE TABLE table_name_16 (
home VARCHAR,
date VARCHAR
) | Which home has a Date of november 7? | SELECT home FROM table_name_16 WHERE date = "november 7" |
CREATE TABLE table_20848569_9 (
no INTEGER,
total_goals VARCHAR,
total_apps VARCHAR
) | Where total goals is 1 and total apps is 33, what is the smallest no.? | SELECT MIN(no) FROM table_20848569_9 WHERE total_goals = 1 AND total_apps = 33 |
CREATE TABLE table_name_91 (
opponent VARCHAR,
series VARCHAR
) | Which Opponent has a Series of bruins lead 2 1? | SELECT opponent FROM table_name_91 WHERE series = "bruins lead 2–1" |
CREATE TABLE table_79257 (
"Railroad (quantity)" text,
"Class" text,
"Road numbers" text,
"Builder" text,
"Build year" text
) | what is the road numbers when the build year is 1943, the railroad (quantity) is clinchfield railroad (12 new, 6 secondhand)? | SELECT "Road numbers" FROM table_79257 WHERE "Build year" = '1943' AND "Railroad (quantity)" = 'clinchfield railroad (12 new, 6 secondhand)' |
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 departments (
DEPARTME... | 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, for employee_id, hire_date, visualize the trend, and sort X from high to low order. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE DESC |
CREATE TABLE table_22575 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What is the title of the production code 1acx09? | SELECT "Title" FROM table_22575 WHERE "Production code" = '1ACX09' |
CREATE TABLE table_27350 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | How many colleges provided players with positions LB? | SELECT COUNT("College") FROM table_27350 WHERE "Position" = 'LB' |
CREATE TABLE table_869 (
"Draft Year" real,
"Player" text,
"Position" text,
"Round" real,
"Overall" real,
"NFL Team" text
) | What team drafted steve scifres? | SELECT "NFL Team" FROM table_869 WHERE "Player" = 'Steve Scifres' |
CREATE TABLE table_14747043_1 (
class_a VARCHAR,
class_aAAAA VARCHAR,
Weslaco VARCHAR,
class_aAAA VARCHAR,
Brownwood VARCHAR
) | Which is the class A when Weslaco was the class AAAAA and brownwood was the class AAAA | SELECT class_a FROM table_14747043_1 WHERE class_aAAAA = Weslaco AND class_aAAA = Brownwood |
CREATE TABLE table_name_61 (
byes INTEGER,
draws VARCHAR,
against VARCHAR,
losses VARCHAR
) | What is the highest value for Byes, when Against is less than 1794, when Losses is '6', and when Draws is less than 0? | SELECT MAX(byes) FROM table_name_61 WHERE against < 1794 AND losses = 6 AND draws < 0 |
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 class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE ... | i need a flight from DENVER to PHILADELPHIA on saturday | 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 = 'PHILADELPHIA' AND date_day.day_number = 26 AND date_day.month_number = 7 ... |
CREATE TABLE table_name_1 (
version VARCHAR,
length VARCHAR
) | What is the version shown for the Length of 4:58? | SELECT version FROM table_name_1 WHERE length = "4:58" |
CREATE TABLE table_70129 (
"Player" text,
"Test Career" text,
"Tests" real,
"Catches" real,
"Stumpings" real,
"Total Dismissals" real
) | Who has a career that has test larger than 41, catches over 33, and a total dismissals rate of 147? | SELECT "Test Career" FROM table_70129 WHERE "Tests" > '41' AND "Catches" > '33' AND "Total Dismissals" = '147' |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | Next Winter who is going to teach ULCS classes ? | 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 stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | Return a bar chart about the distribution of meter_200 and the sum of ID , and group by attribute meter_200, I want to list from high to low by the total number. | SELECT meter_200, SUM(ID) FROM swimmer GROUP BY meter_200 ORDER BY SUM(ID) DESC |
CREATE TABLE table_name_26 (
score VARCHAR,
date VARCHAR,
decision VARCHAR,
visitor VARCHAR
) | Decision of parent, and a Visitor of Philadelphia, and a Date of January 27 had what score? | SELECT score FROM table_name_26 WHERE decision = "parent" AND visitor = "philadelphia" AND date = "january 27" |
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 aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,... | i would like the cheapest flight from PITTSBURGH to ATLANTA leaving 4 25 and returning may sixth | SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, ... |
CREATE TABLE table_68774 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was score of the Blue Jays' game versus the Indians when their record was 21-19? | SELECT "Score" FROM table_68774 WHERE "Opponent" = 'indians' AND "Record" = '21-19' |
CREATE TABLE table_31002 (
"Movies" text,
"December 25" text,
"December 26" text,
"December 27" text,
"December 28" text,
"December 25-28 total" text,
"Total 2-week Gross" text
) | How many figures are provided for December 28 for Rosario? | SELECT COUNT("December 28") FROM table_31002 WHERE "Movies" = 'Rosario' |
CREATE TABLE table_19704392_1 (
modified_torque__lb_ft_ VARCHAR,
standard_hp VARCHAR
) | What is the modified torque (lb/ft) when the standard hp n/a? | SELECT COUNT(modified_torque__lb_ft_) FROM table_19704392_1 WHERE standard_hp = "n/a" |
CREATE TABLE table_43472 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the earliest day that had a game against the Boston Bruins? | SELECT MIN("February") FROM table_43472 WHERE "Opponent" = 'boston bruins' |
CREATE TABLE table_name_94 (
third_place VARCHAR,
winner VARCHAR,
runner_up VARCHAR
) | What person is in the third place when Thomas Enqvist won and a Runner-up was guy forget? | SELECT third_place FROM table_name_94 WHERE winner = "thomas enqvist" AND runner_up = "guy forget" |
CREATE TABLE table_48135 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | what is the country for the city of cardiff? | SELECT "Country" FROM table_48135 WHERE "City" = 'cardiff' |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE out... | what is the total output of patient 8116 in a day before? | SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8116)) AND DATETIME(outputevents.charttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of ... |
CREATE TABLE table_name_38 (
date VARCHAR,
score VARCHAR
) | Name the date for score of 1-5 | SELECT date FROM table_name_38 WHERE score = "1-5" |
CREATE TABLE table_name_95 (
time VARCHAR,
name VARCHAR
) | What was Derek Graham's time? | SELECT time FROM table_name_95 WHERE name = "derek graham" |
CREATE TABLE table_15157 (
"Game" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Series" text
) | Who has Series of 2 3? | SELECT "Visitor" FROM table_15157 WHERE "Series" = '2 – 3' |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_date DATETIME,
order_status_code VARCHAR(15)
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1_number_building VARCHAR(80),
city VARCHAR(50),
zip_postcode VARCHAR(20),
state_province_county VARCHAR(50),
... | Show the number of addrens history for each customer in a bar chart, rank in asc by the bar. | SELECT T2.customer_name, COUNT(T2.customer_name) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY T2.customer_name ORDER BY T2.customer_name |
CREATE TABLE table_22654073_13 (
game VARCHAR,
date VARCHAR
) | How many games were there on May 1? | SELECT COUNT(game) FROM table_22654073_13 WHERE date = "May 1" |
CREATE TABLE table_12562214_1 (
notes VARCHAR,
date__from_ VARCHAR
) | what are the notes for date (from) 12 august 1897? | SELECT notes FROM table_12562214_1 WHERE date__from_ = "12 August 1897" |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
C... | How many answers per month?. | SELECT u.DisplayName, MONTH(p.CreationDate) + YEAR(p.CreationDate) * 100 AS "mdate", COUNT(u.DisplayName) AS "num" FROM Posts AS p, Users AS u WHERE p.PostTypeId = 2 AND p.OwnerUserId IN ('##uid##') AND p.OwnerUserId = u.Id GROUP BY MONTH(p.CreationDate) + YEAR(p.CreationDate) * 100, u.DisplayName ORDER BY Num DESC |
CREATE TABLE table_204_621 (
id number,
"no." number,
"date" text,
"tournament" text,
"winning score" text,
"margin\nof victory" text,
"runner(s)-up" text
) | what is the total margin of victory in 1963 tucson open invitational ? | SELECT "margin\nof victory" FROM table_204_621 WHERE "date" = 1963 AND "tournament" = 'tucson open invitational' |
CREATE TABLE table_name_87 (
resolution VARCHAR,
official_website VARCHAR,
callsign VARCHAR
) | Name the resolution for ketftv.com and callsign of kldo-dt2 | SELECT resolution FROM table_name_87 WHERE official_website = "ketftv.com" AND callsign = "kldo-dt2" |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
... | when was the first other microbiology test performed during this hospital visit for patient 031-3355? | 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 = '031-3355' AND patient.hospitaldischargetime IS NULL)) AND microla... |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | how many patients have received vasopressors - norepinephrine > 0.1 micrograms/kg/min within the same hospital visit after the first treatment of stress ulcer prophylaxis - pantoprazole in 2105? | 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 = 'stress ulcer prophylaxis - pantoprazole' AND STRFTIME('%y', treatment.tre... |
CREATE TABLE table_name_60 (
wins INTEGER,
goals_conceded VARCHAR,
club VARCHAR,
points VARCHAR,
goals_scored VARCHAR
) | For the club Minija Kretinga, what's the lowest number of wins with points smaller than 25, goals at 22 and goals conceded below 39? | SELECT MIN(wins) FROM table_name_60 WHERE points < 25 AND goals_scored = 22 AND club = "minija kretinga" AND goals_conceded < 39 |
CREATE TABLE table_13912 (
"Year(s)" text,
"Selection show" text,
"Venue" text,
"National final main host" text,
"National final co host" text,
"Semi final/heat host" text
) | What was the venue when David Jacobs was the host? | SELECT "Venue" FROM table_13912 WHERE "Semi final/heat host" = 'david jacobs' |
CREATE TABLE table_10420 (
"7:00 PM" text,
"8:00 PM" text,
"8:30 PM" text,
"9:00 PM" text,
"9:30 PM" text,
"10:00 PM" text
) | What shows for 7:00 PM when the 8:30 PM is tout le monde en parle? | SELECT "7:00 PM" FROM table_10420 WHERE "8:30 PM" = 'tout le monde en parle' |
CREATE TABLE table_name_34 (
track VARCHAR,
date VARCHAR
) | Where was the race on 09-13-2008? | SELECT track FROM table_name_34 WHERE date = "09-13-2008" |
CREATE TABLE table_name_7 (
away_team VARCHAR,
home_team VARCHAR
) | What is the name of the away team who play Collingwood? | SELECT away_team FROM table_name_7 WHERE home_team = "collingwood" |
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 2156 and diagnoses icd9 code is 5990? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2156" AND diagnoses.icd9_code = "5990" |
CREATE TABLE table_24349 (
"Type of Record" text,
"Attendance" real,
"Date/Year" text,
"Stadium" text,
"Result/Games" text
) | What is the maximal number of people that attended any of these games? | SELECT MAX("Attendance") FROM table_24349 |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejectio... | Number of members based on their ages. | SELECT Age, COUNT(Age) AS "number_of_members" FROM Users GROUP BY Age ORDER BY COUNT(Age) DESC |
CREATE TABLE table_name_95 (
rank VARCHAR,
director_s_ VARCHAR
) | What Rank is the director of maximilian jezo-parovsky? | SELECT rank FROM table_name_95 WHERE director_s_ = "maximilian jezo-parovsky" |
CREATE TABLE table_63 (
"Crop (kilotonnes)" text,
"New South Wales" real,
"Victoria" real,
"Queensland" real,
"Western Australia" real,
"South Australia" real,
"Tasmania" real,
"Total" real
) | what's the total number of tasmania with new south wales crop of 190 kilotonnes | SELECT COUNT("Tasmania") FROM table_63 WHERE "New South Wales" = '190' |
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE railway_manage (
R... | Create a bar chart showing how many arrival across arrival, sort x-axis in asc order. | SELECT Arrival, COUNT(Arrival) FROM train GROUP BY Arrival ORDER BY Arrival |
CREATE TABLE table_name_67 (
proximity VARCHAR,
plural VARCHAR
) | What is Proximity, when Plural is amader (our)? | SELECT proximity FROM table_name_67 WHERE plural = "amader (our)" |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of phone_number and manager_id , order by the x axis in descending. | SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | since 2104 what was the four most frequent specimen tests given to patients within 2 months after the diagnosis of hypoxemia? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypoxemia' AND STRFTIME('%y', diagnosis.diag... |
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,
... | find the number of patients under the age of 31 whose drug route is ivpca. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "31" AND prescriptions.route = "IVPCA" |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename... | How many papers by ali farhadi and steve seitz | SELECT DISTINCT COUNT(1) FROM author AS AUTHOR_0, author AS AUTHOR_1, writes AS WRITES_0, writes AS WRITES_1 WHERE AUTHOR_0.authorname = 'ali farhadi' AND AUTHOR_1.authorname = 'steve seitz' AND WRITES_0.authorid = AUTHOR_0.authorid AND WRITES_1.authorid = AUTHOR_1.authorid AND WRITES_1.paperid = WRITES_0.paperid |
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),
... | Use a histogram to show the department's id and corresponding employees' first name, I want to display by the y axis in ascending. | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_ID |
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 medication (
medi... | what are the three most frequently ordered procedures for patients with ages 40s? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3 |
CREATE TABLE table_39626 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What is the record of game 7? | SELECT "Record" FROM table_39626 WHERE "Game" = '7' |
CREATE TABLE table_1773908_3 (
dsl_type VARCHAR,
provider VARCHAR
) | What are all the dsl type offered by the M-Net telecom company? | SELECT dsl_type FROM table_1773908_3 WHERE provider = "M-net" |
CREATE TABLE game (
stadium_id number,
id number,
season number,
date text,
home_team text,
away_team text,
score text,
competition text
)
CREATE TABLE injury_accident (
game_id number,
id number,
player text,
injury text,
number_of_matches text,
source text
)
C... | How many games are free of injury accidents? | SELECT COUNT(*) FROM game WHERE NOT id IN (SELECT game_id FROM injury_accident) |
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 marital status is divorced and lab test name is vancomycin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Vancomycin" |
CREATE TABLE table_18064020_21 (
ast VARCHAR,
avg VARCHAR
) | How many tackle assists for the player who averages 23.7? | SELECT ast FROM table_18064020_21 WHERE avg = "23.7" |
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 intakeoutput (
in... | what medical procedure did patient 025-39356 last receive in 2104? | SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-39356')) AND STRFTIME('%y', treatment.treatmenttime) = '2104'... |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Show avg(weight) vs minimal weight as scatter plot use a different color for each Sex | SELECT AVG(Weight), MIN(Weight) FROM people GROUP BY Sex |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Visualize a bar chart about the distribution of ACC_Regular_Season and ACC_Percent , show in descending by the y-axis. | SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match ORDER BY ACC_Percent DESC |
CREATE TABLE table_11014 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the Time/Retired for less than 52 laps in grid 19? | SELECT "Time/Retired" FROM table_11014 WHERE "Laps" < '52' AND "Grid" = '19' |
CREATE TABLE table_61482 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | Who played against the away team hereford united? | SELECT "Home team" FROM table_61482 WHERE "Away team" = 'hereford united' |
CREATE TABLE Parking_Fines (
council_tax_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE Benefits_Overpayments (
council_tax_id INTEGER,
cmi_cross_ref_id INTEGER
)
CREATE TABLE CMI_Cross_References (
cmi_cross_ref_id INTEGER,
master_customer_id INTEGER,
source_system_code CHAR(15)
)
C... | List the council tax ids and their related cmi cross references of all the parking fines. | SELECT council_tax_id, cmi_cross_ref_id FROM Parking_Fines |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | provide the number of patients whose admission year is less than 2168 and diagnoses long title is hepatitis, unspecified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2168" AND diagnoses.long_title = "Hepatitis, unspecified" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | what was the five most commonly prescribed drugs that were prescribed to patients in the same hospital visit after having been diagnosed until 2103 with sepsis? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'sepsis' AND STR... |
CREATE TABLE table_19220 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | What are all the episodes with an episode run time of 24:01? | SELECT "Episode" FROM table_19220 WHERE "Run time" = '24:01' |
CREATE TABLE table_2562572_22 (
cyrillic_name_other_names VARCHAR,
settlement VARCHAR
) | Name the number of cyrillic name for stani i | SELECT COUNT(cyrillic_name_other_names) FROM table_2562572_22 WHERE settlement = "Stanišić" |
CREATE TABLE table_6240 (
"Year" real,
"Manufacturer" text,
"Start" text,
"Finish" text,
"Team" text
) | Which Finish has a Start of 15, and a Team of bahari? | SELECT "Finish" FROM table_6240 WHERE "Start" = '15' AND "Team" = 'bahari' |
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Nu... | Show the name for regions and the number of storms for each region by a bar chart, display in ascending by the X-axis. | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY Region_name |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE airline (
... | what is CVG | SELECT DISTINCT airport_code FROM airport WHERE airport_code = 'CVG' |
CREATE TABLE table_name_88 (
branding VARCHAR,
frequency VARCHAR
) | Tell me the branding for frequency of 680 khz | SELECT branding FROM table_name_88 WHERE frequency = "680 khz" |
CREATE TABLE table_3801 (
"Stage" real,
"Winner" text,
"General classification" text,
"Mountains Classification" text,
"Points classification" text,
"Sprints Classification" text,
"Team Classification" text
) | If the stage is smaller than 5.0, and the points classification is by Marco Marcato, who is the General classification by? | SELECT "General classification" FROM table_3801 WHERE "Points classification" = 'Marco Marcato' AND "Stage" < '5.0' |
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... | how many of the patients who had a lab test for urine volume are married? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "MARRIED" AND lab.label = "Urine Volume" |
CREATE TABLE table_20800 (
"Institution" text,
"Location" text,
"Nickname" text,
"Enrollment" real,
"Established" real
) | Total enrollment at the school with the nickname Blue Hens | SELECT COUNT("Enrollment") FROM table_20800 WHERE "Nickname" = 'Blue Hens' |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAno... | Ratio between downvoted and commented posts. | SELECT u.Id AS "user_link", u.DownVotes, COUNT(DISTINCT c.PostId) AS CommentedPosts, CAST(u.DownVotes AS FLOAT) / CAST(COUNT(DISTINCT c.PostId) AS FLOAT) AS Ratio FROM Users AS u INNER JOIN Comments AS c ON c.UserId = u.Id WHERE u.DownVotes > '##min?100##' GROUP BY u.Id, u.DownVotes ORDER BY CAST(u.DownVotes AS FLOAT) ... |
CREATE TABLE table_30133_3 (
gap_from_thailand_as_of_1980__times_ VARCHAR
) | What is the max 2010 value for a 1980 gap value is 2.43? | SELECT MAX(2010) FROM table_30133_3 WHERE gap_from_thailand_as_of_1980__times_ = "2.43" |
CREATE TABLE table_50946 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the highest number of Laps that have a Time of +18.366, and a Grid lower than 13? | SELECT MAX("Laps") FROM table_50946 WHERE "Grid" < '13' AND "Time" = '+18.366' |
CREATE TABLE table_71034 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What date was the game with a record of 47 39? | SELECT "Date" FROM table_71034 WHERE "Record" = '47–39' |
CREATE TABLE table_name_1 (
speed VARCHAR,
rider VARCHAR
) | What is Brian Mateer's Speed? | SELECT speed FROM table_name_1 WHERE rider = "brian mateer" |
CREATE TABLE table_26922 (
"Rnd" real,
"Date" text,
"Race Name" text,
"Track" text,
"Location" text,
"Pole position" text,
"Fastest lap" text,
"Most Laps Led" text,
"Winner" text
) | In what race did Buddy Rice hav fastest lap? | SELECT "Race Name" FROM table_26922 WHERE "Fastest lap" = 'Buddy Rice' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperio... | how many times did patient 008-32147 have a tacrolimus intake until 03/21/2103? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-32147')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput.ce... |
CREATE TABLE table_name_80 (
copa_sudamericana INTEGER,
others INTEGER
) | What is the largest copa sudamericana number when the others number is less than 0? | SELECT MAX(copa_sudamericana) FROM table_name_80 WHERE others < 0 |
CREATE TABLE table_62415 (
"Date" text,
"Opponent" text,
"Score" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the score when the decision was Raycroft, with attendance larger than 18,277, on February 11? | SELECT "Score" FROM table_62415 WHERE "Decision" = 'raycroft' AND "Attendance" > '18,277' AND "Date" = 'february 11' |
CREATE TABLE table_59921 (
"Week 8 Oct 26" text,
"Week 10 Nov 9" text,
"Week 11 Nov 16" text,
"Week 12 Nov 23" text,
"Week 13 Nov 30" text,
"Week 14 (Final) Dec 7" text
) | What is the week 11 nov 16 standing with wisconsin (10-1) on week 13 Nov 30? | SELECT "Week 11 Nov 16" FROM table_59921 WHERE "Week 13 Nov 30" = 'wisconsin (10-1)' |
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,
... | Provide the number of patients who have been diagnosed with acute pancreatitis and have a prescription for additive drug types. | 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.short_title = "Acute pancreatitis" AND prescriptions.drug_type = "ADDITIVE" |
CREATE TABLE table_name_36 (
surface VARCHAR,
score VARCHAR,
date VARCHAR
) | What surface was played on with a score of 6 4, 6 3 and on 4 May 1992? | SELECT surface FROM table_name_36 WHERE score = "6–4, 6–3" AND date = "4 may 1992" |
CREATE TABLE table_203_862 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
) | what song is listed in the table right before layla layla ? | SELECT "song" FROM table_203_862 WHERE id = (SELECT id FROM table_203_862 WHERE "song" = '"layla layla"') - 1 |
CREATE TABLE table_65359 (
"Place" text,
"Code" real,
"Area (km 2 )" real,
"Population" real,
"Most spoken language" text
) | What is the Most Spoken language in the Place with Code 70403 with an Area (km 2) larger than 3.79 and a Population larger than 73,283? | SELECT "Most spoken language" FROM table_65359 WHERE "Code" > '70403' AND "Area (km 2 )" > '3.79' AND "Population" > '73,283' |
CREATE TABLE table_204_612 (
id number,
"draft order\nround" number,
"draft order\nchoice" number,
"player" text,
"position" text,
"height" text,
"weight" text,
"college" text
) | what is the total of players under 6 ft tall ? | SELECT COUNT("player") FROM table_204_612 WHERE "height" < 6 |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide the number of patients whose admission location is clinic referral/premature and admission year is less than 2124? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2124" |
CREATE TABLE table_name_60 (
event VARCHAR,
games VARCHAR,
medal VARCHAR
) | Name the Event of the Games of 1950 auckland and a Medal of bronze? | SELECT event FROM table_name_60 WHERE games = "1950 auckland" AND medal = "bronze" |
CREATE TABLE table_name_49 (
country VARCHAR,
total VARCHAR
) | Which country had a total of 295? | SELECT country FROM table_name_49 WHERE total = 295 |
CREATE TABLE table_9589 (
"School" text,
"Base" text,
"Bask" text,
"Golf" text,
"Soccer" text,
"Swimming" text,
"Tennis" text,
"Indoor track" text
) | What is the basketball status for Valparaiso who has an indoor track status of yes? | SELECT "Bask" FROM table_9589 WHERE "Indoor track" = 'yes' AND "School" = 'valparaiso' |
CREATE TABLE table_name_54 (
caps INTEGER,
player VARCHAR
) | What is the greatest number of caps for Bruce Djite? | SELECT MAX(caps) FROM table_name_54 WHERE player = "bruce djite" |
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
)
... | give me the number of patients whose admission location is clinic referral/premature and drug code is keto15i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.formulary_drug_cd = "KETO15I" |
CREATE TABLE table_57837 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who played in lake oval while away? | SELECT "Away team" FROM table_57837 WHERE "Venue" = 'lake oval' |
CREATE TABLE table_4342 (
"Country/Region" text,
"Name" text,
"Host" text,
"Network" text,
"Premiere" text,
"Prize" text
) | Tell me the prize for belgium | SELECT "Prize" FROM table_4342 WHERE "Country/Region" = 'belgium' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.