table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_1213511_7 (
pick__number VARCHAR,
nhl_team VARCHAR
) | what is the total number of pick # where nhl team is philadelphia flyers | SELECT COUNT(pick__number) FROM table_1213511_7 WHERE nhl_team = "Philadelphia Flyers" |
CREATE TABLE procedures (
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 ... | what is minimum age of patients whose insurance is self pay and primary disease is left colon cancer? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "LEFT COLON CANCER" |
CREATE TABLE table_69698 (
"Name" text,
"Championship" real,
"League Cup" real,
"FA Cup" real,
"Total" real
) | How many FA cups for the player with under 5 champs, 0 league cups, and over 3 total? | SELECT SUM("FA Cup") FROM table_69698 WHERE "Championship" < '5' AND "League Cup" = '0' AND "Total" > '3' |
CREATE TABLE table_30338 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Story & Storyboards by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What's the title of the episode with series number 36? | SELECT "Title" FROM table_30338 WHERE "No. in series" = '36' |
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 average age of patients whose primary disease is hypoxia and age is greater than or equal to 80? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.diagnosis = "HYPOXIA" AND demographic.age >= "80" |
CREATE TABLE table_name_22 (
date VARCHAR,
home VARCHAR
) | What is the Date, when the home team is the NY Rangers? | SELECT date FROM table_name_22 WHERE home = "ny rangers" |
CREATE TABLE table_78650 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To Par" real,
"Money ( $ )" text
) | What was the score for t9 place for Harold Mcspaden? | SELECT "Score" FROM table_78650 WHERE "Place" = 't9' AND "Player" = 'harold mcspaden' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | what are the five most frequently ordered procedures for patients that have previously been diagnosed with splenic trauma - with hematoma within 2 months in a year before? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'splenic trauma - with hematoma' AND DATE... |
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 diagnosis (
diagnosisid num... | what was the last value of a lab test of mpv when they came to the hospital first time for patient 022-163354? | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-163354' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmi... |
CREATE TABLE table_77739 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did the away team score when playing North Melbourne? | SELECT "Away team score" FROM table_77739 WHERE "Home team" = 'north melbourne' |
CREATE TABLE table_14222 (
"T-35" text,
"T-100" text,
"KV-1 M1940" text,
"KV-1 M1941" text,
"KV-1 M1942" text,
"KV-1S M1942" text,
"KV-85 M1943" text,
"IS-2 M1945" text,
"IS-3 M1945" text
) | What's the IS-3 when the KV-1S is 45? | SELECT "IS-3 M1945" FROM table_14222 WHERE "KV-1S M1942" = '45' |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | when did patient 017-88691 have the last systemicmean to be less than 91.0 since 12/31/2105? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-88691')) AND vitalperiodic.systemicmean < 91.0 ... |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of price , and group by attribute name, could you show in descending by the the average of price please? | SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price DESC |
CREATE TABLE table_55047 (
"Name" text,
"Model" text,
"Park" text,
"Opened" text,
"Status" text
) | What is the status of the junior coaster model that opened in 2008? | SELECT "Status" FROM table_55047 WHERE "Opened" = '2008' AND "Model" = 'junior coaster' |
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,... | show me flights from FORT WORTH to SAN JOSE | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'FORT WORTH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN... |
CREATE TABLE table_name_60 (
years INTEGER,
tied VARCHAR,
total_games VARCHAR
) | What is the average number of years associated with 51 games tied and over 1184 total games? | SELECT AVG(years) FROM table_name_60 WHERE tied = 51 AND total_games > 1184 |
CREATE TABLE table_15872814_3 (
score VARCHAR,
team VARCHAR
) | Name the score for washington | SELECT score FROM table_15872814_3 WHERE team = "Washington" |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Tit... | Top 2500 SO Users from Germany. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%deutschland%' OR LOWER(Location) LIKE '%germany%' ORDER BY Reputation DESC LIMIT 2500 |
CREATE TABLE table_203_758 (
id number,
"no." number,
"dub no." number,
"english dubbed title / english subbed title\noriginal japanese title" text,
"original air date" text,
"english air date" text
) | how many episodes aired originally but not in english ? | SELECT COUNT("english dubbed title / english subbed title\noriginal japanese title") FROM table_203_758 WHERE NOT "original air date" IS NULL AND "english air date" IS NULL |
CREATE TABLE table_name_52 (
surface VARCHAR,
opponent_in_the_final VARCHAR,
year VARCHAR
) | Which Surface has an Opponent in the final of don mcneill, and a Year of 1940? | SELECT surface FROM table_name_52 WHERE opponent_in_the_final = "don mcneill" AND year = 1940 |
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 prescriptions... | give me the number of patients whose admission type is emergency and insurance is medicaid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.insurance = "Medicaid" |
CREATE TABLE table_25208 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race time" text,
"Average speed (mph)" text,
"Report" text
) | Name the report for 2003 | SELECT "Report" FROM table_25208 WHERE "Year" = '2003' |
CREATE TABLE table_name_87 (
score VARCHAR
) | What score has 15.0% as the 2012? | SELECT score FROM table_name_87 WHERE 2012 = "15.0%" |
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type text
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance... | Visualize a bar chart, count and group by nationality from the journalist table, list X in descending order please. | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY Nationality DESC |
CREATE TABLE table_name_41 (
visiting_team VARCHAR,
date VARCHAR
) | Who was the visiting team that played on September 15? | SELECT visiting_team FROM table_name_41 WHERE date = "september 15" |
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 job_history (
EMPLOYEE... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the phone_number , display by the x axis in asc. | SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER |
CREATE TABLE table_52747 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Who was the visiting team in the game against the Dallas Cowboys? | SELECT "Visiting Team" FROM table_52747 WHERE "Host Team" = 'dallas cowboys' |
CREATE TABLE table_78030 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the average crowd size of the away team who scored 9.6 (60)? | SELECT AVG("Crowd") FROM table_78030 WHERE "Away team score" = '9.6 (60)' |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | Number of active users last month. | SELECT COUNT(*) AS ActiveUsersLastMonth FROM Users WHERE LastAccessDate >= DATEADD(month, -1, (SELECT MAX(LastAccessDate) FROM Users)) |
CREATE TABLE table_name_34 (
status VARCHAR,
name VARCHAR
) | What is the status of the Cub/John locomotive? | SELECT status FROM table_name_34 WHERE name = "the cub/john" |
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
product_characteristic_value VARCHAR(50)
)
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Characteristics (
characteri... | A bar chart for what are the number of the descriptions of the categories that products with product descriptions that contain the letter t are in? | 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 |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For those employees who was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday, could you sort in asc by the total number? | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) |
CREATE TABLE table_43257 (
"Season" text,
"Staffel A" text,
"Staffel B" text,
"Staffel C" text,
"Staffel D" text,
"Staffel E" text
) | What is the Staffel B that has Hallescher Fc Chemie as Staffel C? | SELECT "Staffel B" FROM table_43257 WHERE "Staffel C" = 'hallescher fc chemie' |
CREATE TABLE table_name_86 (
college VARCHAR,
pick__number VARCHAR
) | Which college has 41 picks? | SELECT college FROM table_name_86 WHERE pick__number = 41 |
CREATE TABLE table_204_104 (
id number,
"title" text,
"genre" text,
"sub\u00addivisions" text,
"libretto" text,
"premiere date" text,
"place, theatre" text,
"notes" text
) | l'inganno innocente premiered in 1701 . what was the previous title released ? | SELECT "title" FROM table_204_104 WHERE "premiere date" < (SELECT "premiere date" FROM table_204_104 WHERE "title" = "l'inganno innocente") ORDER BY "premiere date" DESC LIMIT 1 |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | what are the top four most frequent procedures that patients received within the same hospital visit after they were diagnosed with av block in 2105? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, 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 = 'av bl... |
CREATE TABLE table_64821 (
"Name (pinyin)" text,
"Name (Wade Giles)" text,
"Characters" text,
"Type" text,
"Construction" text
) | which Construction is named heng-hai? | SELECT "Construction" FROM table_64821 WHERE "Name (Wade Giles)" = 'heng-hai' |
CREATE TABLE table_16388506_1 (
home_team VARCHAR,
away_team VARCHAR
) | What are the home team scores when fremantle is the away team? | SELECT home_team AS score FROM table_16388506_1 WHERE away_team = "Fremantle" |
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... | How many of the patients belonging to white russian ethnic origin were married? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.ethnicity = "WHITE - RUSSIAN" |
CREATE TABLE table_name_29 (
commissioned VARCHAR,
nvr_page VARCHAR
) | What is the Commissioned date of the ship in NVR Page MCM02? | SELECT commissioned FROM table_name_29 WHERE nvr_page = "mcm02" |
CREATE TABLE table_name_89 (
csa_5_20_09 VARCHAR,
ifop__la_croix_5_15_09 VARCHAR
) | Which Ipsos 5/16/09 has an Ifop- La Croix 5/15/09 of 26%? | SELECT csa_5_20_09 FROM table_name_89 WHERE ifop__la_croix_5_15_09 = "26%" |
CREATE TABLE instruments (
songid number,
bandmateid number,
instrument text
)
CREATE TABLE performance (
songid number,
bandmate number,
stageposition text
)
CREATE TABLE songs (
songid number,
title text
)
CREATE TABLE band (
id number,
firstname text,
lastname text
)
C... | Find the number of bands. | SELECT COUNT(*) FROM band |
CREATE TABLE table_name_34 (
season INTEGER,
team VARCHAR,
series VARCHAR
) | What is the most recent season for the Prema Powerteam with a Masters of Formula Three series? | SELECT MAX(season) FROM table_name_34 WHERE team = "prema powerteam" AND series = "masters of formula three" |
CREATE TABLE table_name_40 (
lead VARCHAR,
season VARCHAR
) | Which lead had a season of 2009-10? | SELECT lead FROM table_name_40 WHERE season = "2009-10" |
CREATE TABLE table_name_51 (
current_club VARCHAR,
apps VARCHAR,
debut_year VARCHAR
) | What is the current club with more than 368 apps and a debut year earlier than 1994? | SELECT current_club FROM table_name_51 WHERE apps > 368 AND debut_year < 1994 |
CREATE TABLE table_name_30 (
long INTEGER,
name VARCHAR
) | What is the sum of Long for derrick locke? | SELECT SUM(long) FROM table_name_30 WHERE name = "derrick locke" |
CREATE TABLE table_name_25 (
manufacturer VARCHAR,
grid VARCHAR
) | Which manufacturer has a grid of 6? | SELECT manufacturer FROM table_name_25 WHERE grid = "6" |
CREATE TABLE table_11667 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | How many attended the game with a Record of 21 22 2? | SELECT COUNT("Attendance") FROM table_11667 WHERE "Record" = '21–22–2' |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE course (
c... | Which courses are prerequisite to taking GEOSCI 109 ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT... |
CREATE TABLE table_11465521_2 (
opponent VARCHAR,
attendance VARCHAR
) | How many opponents were there at the game with 64,087 people in attendance? | SELECT COUNT(opponent) FROM table_11465521_2 WHERE attendance = "64,087" |
CREATE TABLE table_47797 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the Place of the Player from Zimbabwe? | SELECT "Place" FROM table_47797 WHERE "Country" = 'zimbabwe' |
CREATE TABLE table_name_52 (
points_for VARCHAR,
tries_for VARCHAR,
try_bonus VARCHAR
) | How many points did the Club score that has a try bonus of 7 and 52 tries for ? | SELECT points_for FROM table_name_52 WHERE tries_for = "52" AND try_bonus = "7" |
CREATE TABLE table_73139 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the result for new york 8 | SELECT "Result" FROM table_73139 WHERE "District" = 'New York 8' |
CREATE TABLE table_name_2 (
attendance INTEGER,
home VARCHAR
) | What is the average attendance for matches where the home team was vida? | SELECT AVG(attendance) FROM table_name_2 WHERE home = "vida" |
CREATE TABLE table_name_74 (
dist__f_ INTEGER,
odds VARCHAR,
placing VARCHAR
) | Name the highest Dist (f) with Odds of 11/4 and a Placing larger than 1? | SELECT MAX(dist__f_) FROM table_name_74 WHERE odds = "11/4" AND placing > 1 |
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
teacher_id INTEGER,
datetime_detention_start DATETIME,
datetime_detention_end DATETIME,
detention_summary VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHA... | Visualize a bar chart about the distribution of date_address_from and the amount of date_address_from bin date_address_from by time. | SELECT date_address_from, COUNT(date_address_from) FROM Student_Addresses ORDER BY monthly_rental DESC |
CREATE TABLE table_1299 (
"Country" text,
"Uranium required 2006-08" text,
"% of world demand" text,
"Indigenous mining production 2006" text,
"Deficit (-surplus)" text
) | What is the deficit (-surplus) of France? | SELECT "Deficit (-surplus)" FROM table_1299 WHERE "Country" = 'France' |
CREATE TABLE table_name_35 (
avg_g INTEGER,
gain VARCHAR
) | With a gain of 1,380, what is the highest Avg/G? | SELECT MAX(avg_g) FROM table_name_35 WHERE gain = 1 OFFSET 380 |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE weather (
date TEX... | Find the ids and names of stations from which at least 200 trips started, and list y-axis in descending order please. | SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_id DESC |
CREATE TABLE table_42549 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What is the Score for 09-oct-2006? | SELECT "Score" FROM table_42549 WHERE "Date" = '09-oct-2006' |
CREATE TABLE table_12095519_1 (
train_name VARCHAR,
origin VARCHAR
) | How many trains leave from puri? | SELECT COUNT(train_name) FROM table_12095519_1 WHERE origin = "Puri" |
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 procedures (
... | How many patients with item id 51438 were 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.itemid = "51438" |
CREATE TABLE table_12828723_3 (
tries_against VARCHAR,
tries_for VARCHAR
) | what's the tries against with tries for being 47 | SELECT tries_against FROM table_12828723_3 WHERE tries_for = "47" |
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,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the average of manager_id bin hire_date by time, and visualize them by a bar chart, and could you sort Y-axis in ascending order? | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(MANAGER_ID) |
CREATE TABLE table_2413 (
"Broadcast scope" text,
"Broadcast network" text,
"Broadcast term" text,
"Broadcast day and timings (in JST )" text,
"Broadcast format" text
) | Name the broadcast network for chiba prefecture | SELECT "Broadcast network" FROM table_2413 WHERE "Broadcast scope" = 'Chiba Prefecture' |
CREATE TABLE table_3002 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
) | When troy is the regular season winner what is the conference tournament? | SELECT "Conference Tournament" FROM table_3002 WHERE "Regular Season Winner" = 'Troy' |
CREATE TABLE table_name_9 (
record VARCHAR,
opponent VARCHAR,
res VARCHAR,
round VARCHAR
) | What record has loss as the res., 1 for the round, and akira maeda as the opponent? | SELECT record FROM table_name_9 WHERE res = "loss" AND round = "1" AND opponent = "akira maeda" |
CREATE TABLE table_204_855 (
id number,
"year" number,
"date" text,
"winner" text,
"result" text,
"loser" text,
"attendance" number,
"location" text
) | what number of dates were won by the chicago bears ? | SELECT COUNT("date") FROM table_204_855 WHERE "winner" = 'chicago bears' |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId numb... | Highest upvote of question, answer - MSE. | SELECT * FROM Votes LIMIT 10 |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDis... | Top 2000 users ranked by average answer score. | SELECT Users.Id AS "user_link", SUM(Posts.Score) AS "Upvotes", COUNT(*) AS "Answers", 1.0 * SUM(Posts.Score) / COUNT(*) AS "Ave. score", MAX(Posts.Score) AS "Highest score", 1.0 * MAX(Posts.Score) / SUM(Posts.Score) AS "Fraction votes from highest scoring answer" FROM Posts LEFT JOIN Users ON Posts.OwnerUserId = Users.... |
CREATE TABLE table_name_71 (
game INTEGER,
team VARCHAR
) | What was the total score where Toronto was played? | SELECT SUM(game) FROM table_name_71 WHERE team = "toronto" |
CREATE TABLE table_30120555_1 (
poor_law_union VARCHAR,
townland VARCHAR
) | What poor law union is Curradonohoe a part of? | SELECT poor_law_union FROM table_30120555_1 WHERE townland = "Curradonohoe" |
CREATE TABLE table_name_38 (
venue VARCHAR,
status VARCHAR,
against VARCHAR
) | What is the venue for the Status of Five Nations and 0 againts? | SELECT venue FROM table_name_38 WHERE status = "five nations" AND against = 0 |
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 text,
Party_ID text,
In_office text
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date ... | Plot how many minister by grouped by minister as a bar graph, display y-axis in ascending order. | SELECT Minister, COUNT(Minister) FROM party GROUP BY Minister ORDER BY COUNT(Minister) |
CREATE TABLE table_name_77 (
album VARCHAR,
year INTEGER
) | what is the album when the year is later than 2008? | SELECT album FROM table_name_77 WHERE year > 2008 |
CREATE TABLE college (
college_id TEXT,
name_full TEXT,
city TEXT,
state TEXT,
country TEXT
)
CREATE TABLE manager_award (
player_id TEXT,
award_id TEXT,
year INTEGER,
league_id TEXT,
tie TEXT,
notes NUMERIC
)
CREATE TABLE batting (
player_id TEXT,
year INTEGER,
... | count yearid for visualizing a line chart, and sort X in asc order. | SELECT yearid, COUNT(yearid) FROM hall_of_fame ORDER BY yearid |
CREATE TABLE table_73306 (
"Region" text,
"Population" text,
"Country" text,
"Language" text,
"N" real,
"Total%" text,
"R1b1c (R-V88)" text,
"R1b1a2 (R-M269)" text,
"R1b1c* (R-V88*)" text,
"R1b1c4 (R-V69)" text
) | How many n are listed for berbers from siwa? | SELECT COUNT("N") FROM table_73306 WHERE "Population" = 'Berbers from Siwa' |
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... | How many patients living patients operated with circumcission? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Circumcision" |
CREATE TABLE table_203_425 (
id number,
"season" number,
"driver" text,
"equipment" text,
"position" number,
"points" number,
"races" number,
"wins" number,
"second" number,
"third" number
) | what is the number of races won in in 2012 by etienne bax ? | SELECT "wins" FROM table_203_425 WHERE "season" = 2012 AND "driver" = 'etienne bax' |
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE keyword (
keyword varchar,
kid int
)
CREATE TABLE domain_author (
aid int,
did int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE domain_keyword (
did int,
kid int
)
CREATE TABLE journal (
home... | return me all the organizations in Databases area . | SELECT organization.name FROM author, domain, domain_author, organization WHERE domain_author.aid = author.aid AND domain.did = domain_author.did AND domain.name = 'Databases' AND organization.oid = author.oid |
CREATE TABLE table_name_81 (
score VARCHAR,
record VARCHAR
) | What is the score for the team with a record of 2-1? | SELECT score FROM table_name_81 WHERE record = "2-1" |
CREATE TABLE table_17010 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" real,
"Left" real,
"Current Conference" text
) | What year did a school leave that was founded in 1880? | SELECT "Left" FROM table_17010 WHERE "Founded" = '1880' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | what was the drug patient 009-7776 was prescribed for the first time using the iv push route in this month? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-7776')) AND medication.routeadmin = 'iv push' AND DATETIME(medi... |
CREATE TABLE table_test_30 (
"id" int,
"ejection_fraction_ef" int,
"multiple_long_bone_fractures" bool,
"extracellular_volume_expansion" bool,
"pregnancy_or_lactation" bool,
"bleeding" int,
"serum_potassium" float,
"prosthetic_heart_valve" bool,
"hbg" int,
"anticoagulation" bool,... | previous hemorrhagic stroke | SELECT * FROM table_test_30 WHERE previous_hemorrhagic_stroke = 1 |
CREATE TABLE table_78978 (
"Place" real,
"Name" text,
"All Around" real,
"Clubs" real,
"Total" real
) | What is the highest total that has andrea sinko as the name, with an all around greater than 9.65? | SELECT MAX("Total") FROM table_78978 WHERE "Name" = 'andrea sinko' AND "All Around" > '9.65' |
CREATE TABLE table_49191 (
"Event" text,
"Time" text,
"Name" text,
"Nation" text,
"Games" text,
"Date" text
) | On what date was a record set in the team pursuit (8 laps) event? | SELECT "Date" FROM table_49191 WHERE "Event" = 'team pursuit (8 laps)' |
CREATE TABLE table_204_125 (
id number,
"state" text,
"type" text,
"name" text,
"title" text,
"royal house" text,
"from" text,
"to" text
) | which king ruled the longest ? | SELECT "name" FROM table_204_125 ORDER BY "from" - "to" DESC LIMIT 1 |
CREATE TABLE table_64536 (
"Rank" text,
"Group" text,
"Name" text,
"Nationality" text,
"Mark" text
) | What is the mark for Grenada in group A? | SELECT "Mark" FROM table_64536 WHERE "Group" = 'a' AND "Nationality" = 'grenada' |
CREATE TABLE table_28456 (
"Year" real,
"Championship" text,
"54 holes" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | what is the space where the next one was mike turnesa | SELECT "Margin" FROM table_28456 WHERE "Runner(s)-up" = 'Mike Turnesa' |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 regions (
REGION_ID... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me the trend about department_id over hire_date with a line chart, show by the X in desc. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | Just show the first name of the employee and list their manager's id in the Y-axis of the bar chart, could you sort in asc by the x-axis? | SELECT FIRST_NAME, MANAGER_ID FROM employees ORDER BY FIRST_NAME |
CREATE TABLE table_77131 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Which Round has a School/Club Team of cal-poly slo, and a Pick smaller than 238? | SELECT MAX("Round") FROM table_77131 WHERE "School/Club Team" = 'cal-poly slo' AND "Pick" < '238' |
CREATE TABLE table_name_42 (
date VARCHAR,
result VARCHAR
) | Which Date has a Result of 0 0? | SELECT date FROM table_name_42 WHERE result = "0–0" |
CREATE TABLE table_name_11 (
to_par VARCHAR,
score VARCHAR
) | What is the to par for the score 72-69-68=209? | SELECT to_par FROM table_name_11 WHERE score = 72 - 69 - 68 = 209 |
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,
... | what is admission type and diagnoses short title of subject id 91588? | SELECT demographic.admission_type, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "91588" |
CREATE TABLE table_name_34 (
laps VARCHAR,
time_retired VARCHAR
) | How many laps have a +0.4865 time/retired? | SELECT laps FROM table_name_34 WHERE time_retired = "+0.4865" |
CREATE TABLE table_name_53 (
vote__percentage INTEGER,
election VARCHAR
) | Name the most vote % with election of 1946 | SELECT MAX(vote__percentage) FROM table_name_53 WHERE election = "1946" |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id int,
medicine_id int,
interaction_type text
)
CREATE TABLE medicine (
id int,
name text,
Trade_Name text,
FDA_approved text
)
CREATE TABLE enzyme (
id int,
name text,
Location text,
Product text,
Chromosome text,
... | what is the id and trade name of the medicines can interact with at least 3 enzymes?, and I want to show by the x axis from high to low. | SELECT Trade_Name, id FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id ORDER BY Trade_Name DESC |
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_host... | Create a bar chart showing how many location across location | SELECT Location, COUNT(Location) FROM party GROUP BY Location |
CREATE TABLE table_75609 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
) | Name the opponent with loss of sanderson (9-8) | SELECT "Opponent" FROM table_75609 WHERE "Loss" = 'sanderson (9-8)' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.