table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE market (
Mar... | List the studios of each film and the number of films produced by that studio Show bar chart, could you list by the X from low to high? | SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio |
CREATE TABLE table_29792 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code(s)" real,
"U.S. viewers (millions)" text
) | how many millions of north american viewers had the episode whose director was Michael Lembeck? | SELECT "U.S. viewers (millions)" FROM table_29792 WHERE "Directed by" = 'Michael Lembeck' |
CREATE TABLE table_name_82 (
try_bonus VARCHAR,
tries_against VARCHAR
) | With 37 tries against, what is the try bonus? | SELECT try_bonus FROM table_name_82 WHERE tries_against = "37" |
CREATE TABLE table_203_345 (
id number,
"name" text,
"party" text,
"took office" number,
"left office" number
) | who was the last representative to take office ? | SELECT "name" FROM table_203_345 ORDER BY "took office" DESC LIMIT 1 |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
PROF_HIGH_DEGREE varchar(5)
)
CREATE TABLE STUDENT ... | Return a bar chart on what is the number of professors for different school?, and sort from high to low by the the total number . | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY COUNT(*) DESC |
CREATE TABLE table_name_16 (
matches VARCHAR,
clubs VARCHAR
) | What is the total number of Matches, when Clubs is 588 406? | SELECT COUNT(matches) FROM table_name_16 WHERE clubs = "588 → 406" |
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | Find meter_400 and ID , and visualize them by a bar chart, and list by the Y from high to low please. | SELECT meter_400, ID FROM swimmer ORDER BY ID DESC |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about employee_id over the last_name , show by the Y-axis in ascending. | SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID |
CREATE TABLE table_name_83 (
week INTEGER,
attendance VARCHAR,
result VARCHAR
) | What is the Week of the game with an Attendance of 64,900 and a Result of L 34-13? | SELECT MAX(week) FROM table_name_83 WHERE attendance = "64,900" AND result = "l 34-13" |
CREATE TABLE table_70730 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Hole" text
) | What is the To par has the presence of Vijay Singh? | SELECT "To par" FROM table_70730 WHERE "Player" = 'vijay singh' |
CREATE TABLE personfriend (
name text,
friend text,
year number
)
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
) | What are the names of everybody who has exactly one friend? | SELECT name FROM personfriend GROUP BY name HAVING COUNT(*) = 1 |
CREATE TABLE table_name_37 (
in_service INTEGER,
aircraft VARCHAR
) | How many Antonov An-2 Colt aircraft are in service? | SELECT AVG(in_service) FROM table_name_37 WHERE aircraft = "antonov an-2 colt" |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar... | i want to fly from MIAMI to CHICAGO on AA and arrive at around 5 o'clock in the afternoon show me all flights | 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 (((flight.arrival_time <= 1730 AND flight.arrival_time >= 1630) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND flight.to... |
CREATE TABLE table_57816 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | Who is the opponent in the Tournament of Lahore final? | SELECT "Opponent in the final" FROM table_57816 WHERE "Tournament" = 'lahore' |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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 varc... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the average of manager_id bin hire_date by time. | 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) |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE key... | papers about crowdsourcing in acl 2015 | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'crowdsourcing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2015 AND venue.venueid = paper.venueid AND venue.venuename = 'acl' |
CREATE TABLE table_34195 (
"Club" text,
"Nickname" text,
"Years in Competition" text,
"No. of Premierships" real,
"Premiership Years" text
) | What was the Years in competition that had a Premiership of 1982, 1984, 1999, 2002-03, 2008-09-10? | SELECT "Years in Competition" FROM table_34195 WHERE "Premiership Years" = '1982, 1984, 1999, 2002-03, 2008-09-10' |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id ... | what is the change in the hemoglobin of patient 88191's value second measured on the first hospital visit compared to the value first measured on the first hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88191 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label ... |
CREATE TABLE table_204_649 (
id number,
"rank" number,
"name" text,
"image" number,
"height\nft (m)" text,
"floors" number,
"year" number,
"notes" text
) | when the key tower was built in 1991 , what was the previous tallest building constructed ? | SELECT "name" FROM table_204_649 WHERE "year" < 1991 ORDER BY "height\nft (m)" DESC LIMIT 1 |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalp... | when did patient 015-59871 receive procedures for the first time during their last hospital visit? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-59871' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... |
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 was the total amount of output amt-jackson pratt drain patient 021-250695 produced on 11/18/last 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 = '021-250695')) AND intakeoutput.celllabel = 'outp... |
CREATE TABLE table_name_92 (
score VARCHAR,
date VARCHAR
) | What scored is recorded on April 24? | SELECT score FROM table_name_92 WHERE date = "april 24" |
CREATE TABLE table_name_14 (
matches VARCHAR,
lose VARCHAR,
draw VARCHAR,
lost_point VARCHAR
) | I want the total number of matches for draw less than 7 and lost point of 16 with lose more than 4 | SELECT COUNT(matches) FROM table_name_14 WHERE draw < 7 AND lost_point = 16 AND lose > 4 |
CREATE TABLE table_17780 (
"Day (see Irregularities )" text,
"Monday First Day" text,
"Tuesday Second Day" text,
"Wednesday Third Day" text,
"Thursday Fourth Day" text,
"Friday Fifth Day" text,
"Saturday Sixth Day" text,
"Sunday Seventh Day" text
) | What's the Slovene word for Thursday? | SELECT "Thursday Fourth Day" FROM table_17780 WHERE "Day (see Irregularities )" = 'Slovene' |
CREATE TABLE table_name_38 (
overall INTEGER,
name VARCHAR,
pick__number VARCHAR
) | What is the average overall of John Ayres, who had a pick # greater than 4? | SELECT AVG(overall) FROM table_name_38 WHERE name = "john ayres" AND pick__number > 4 |
CREATE TABLE table_1137707_2 (
date VARCHAR,
location VARCHAR
) | What is the date of the circuit gilles villeneuve? | SELECT date FROM table_1137707_2 WHERE location = "Circuit Gilles Villeneuve" |
CREATE TABLE table_11545282_11 (
position VARCHAR,
years_for_jazz VARCHAR
) | What is the position for the years 1998-99 | SELECT position FROM table_11545282_11 WHERE years_for_jazz = "1998-99" |
CREATE TABLE table_name_54 (
theme VARCHAR,
year VARCHAR,
artist VARCHAR,
issue_price VARCHAR
) | What is the Theme of Christie Paquet after 2004 with an Issue Price of $34.95? | SELECT theme FROM table_name_54 WHERE artist = "christie paquet" AND issue_price = "$34.95" AND year > 2004 |
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... | find the admission time of jerry deberry. | SELECT demographic.admittime FROM demographic WHERE demographic.name = "Jerry Deberry" |
CREATE TABLE table_12641 (
"South West DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the sum of Against, when Wins is greater than 8, and when Losses is greater than 6? | SELECT SUM("Against") FROM table_12641 WHERE "Wins" > '8' AND "Losses" > '6' |
CREATE TABLE table_59730 (
"Name (year commissioned)" text,
"Owner/operator" text,
"Length" text,
"Maximum diameter" text,
"From/to" text,
"Licence number" text
) | Who is the owner operator who has license number PL 59? | SELECT "Owner/operator" FROM table_59730 WHERE "Licence number" = 'pl 59' |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 regions (
REGION_... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of email and department_id , display from high to low by the DEPARTMENT_ID. | SELECT EMAIL, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC |
CREATE TABLE table_18483171_1 (
institution VARCHAR,
team_nickname VARCHAR
) | List all institutions with a team name of the Cardinals. | SELECT institution FROM table_18483171_1 WHERE team_nickname = "Cardinals" |
CREATE TABLE table_22390 (
"Episode" text,
"Garfield Episode 1" text,
"U.S. Acres Episode" text,
"Garfield Episode 2" text,
"Original Airdate" text
) | What is the name of the US Acres episode following the Garfield episode titled Robodie II? | SELECT "U.S. Acres Episode" FROM table_22390 WHERE "Garfield Episode 1" = 'Robodie II' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | how many patients whose diagnoses icd9 code is 59080 and drug route is neb? | 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.icd9_code = "59080" AND prescriptions.route = "NEB" |
CREATE TABLE table_15463188_17 (
school_club_team VARCHAR,
name VARCHAR
) | Which school/club team has a player named Mark Sanford? | SELECT school_club_team FROM table_15463188_17 WHERE name = "Mark Sanford" |
CREATE TABLE table_20195922_3 (
prize__eur_ VARCHAR,
number_of_winning_tickets VARCHAR
) | What are the prizes when 1 is the number of winning tickets? | SELECT prize__eur_ FROM table_20195922_3 WHERE number_of_winning_tickets = 1 |
CREATE TABLE table_55789 (
"Ordinary income rate" text,
"Long-term capital gain rate" text,
"Short-term capital gain rate" text,
"Long-term gain on commercial buildings*" text,
"Long-term gain on collectibles" text
) | What long-term gain for collectibles coincides with ordinary income rate 15%? | SELECT "Long-term gain on collectibles" FROM table_55789 WHERE "Ordinary income rate" = '15%' |
CREATE TABLE table_name_67 (
player VARCHAR,
place VARCHAR
) | Who is the player with a t8 place? | SELECT player FROM table_name_67 WHERE place = "t8" |
CREATE TABLE table_23248 (
"Rank" real,
"Couple" text,
"Judges" real,
"Public" real,
"Total" real,
"Vote percentage" text,
"Result" text
) | When ellery and frankie are the couple what is the highest total? | SELECT MAX("Total") FROM table_23248 WHERE "Couple" = 'Ellery and Frankie' |
CREATE TABLE table_46824 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What was the label in the region of Canada? | SELECT "Label" FROM table_46824 WHERE "Region" = 'canada' |
CREATE TABLE table_name_21 (
density_per_km² INTEGER,
number__map_ VARCHAR,
area_in_km² VARCHAR
) | Which Density per km is the lowest one that has a Number (map) smaller than 13, and an Area in km of 11.1? | SELECT MIN(density_per_km²) FROM table_name_21 WHERE number__map_ < 13 AND area_in_km² = 11.1 |
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 three year survival probability for the leukocytosis - leukemoid reaction patients diagnosed? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... |
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 are below 50 years of age and diagnosed with coronary atherosclerosis of native coronary artery? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.long_title = "Coronary atherosclerosis of native coronary artery" |
CREATE TABLE table_203_701 (
id number,
"#" number,
"title" text,
"featured guest(s)" text,
"producer(s)" text,
"length" text
) | what track was next after all i got ? | SELECT "title" FROM table_203_701 WHERE "#" = (SELECT "#" FROM table_203_701 WHERE "title" = '"all i got"') + 1 |
CREATE TABLE table_47364 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | What is Score, when Visitor is 'Pittsburgh', and when Points is greater than 18? | SELECT "Score" FROM table_47364 WHERE "Visitor" = 'pittsburgh' AND "Points" > '18' |
CREATE TABLE table_name_14 (
manager VARCHAR,
team VARCHAR
) | Which manager has Manchester City as the team? | SELECT manager FROM table_name_14 WHERE team = "manchester city" |
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 me minimal weight by sex in a histogram, I want to order names in ascending order please. | SELECT Sex, MIN(Weight) FROM people GROUP BY Sex ORDER BY Sex |
CREATE TABLE table_name_16 (
ends_lost INTEGER,
stolen_ends_for VARCHAR,
stolen_ends_against VARCHAR
) | What is the lowest ends lost when the stolen ends for is less than 13, and stolten ends against is 6? | SELECT MIN(ends_lost) FROM table_name_16 WHERE stolen_ends_for < 13 AND stolen_ends_against = 6 |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | how many days has it been since patient 021-111547's admission to icu? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '021-111547' AND patient.unitdischargetime IS NULL |
CREATE TABLE table_2248991_2 (
gdp_per_capita VARCHAR,
nation VARCHAR
) | How many items are listed under gdp per capita under the nation of Burkina Faso? | SELECT COUNT(gdp_per_capita) FROM table_2248991_2 WHERE nation = "Burkina Faso" |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
... | what is the name of the drug prescribed to patient 8098 within 2 days after diagnosis of hemododialysis hypotensn in 01/last year? | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 8098 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hemodod... |
CREATE TABLE table_name_55 (
time VARCHAR,
owner VARCHAR
) | What time contains the owner of maine chance farm? | SELECT time FROM table_name_55 WHERE owner = "maine chance farm" |
CREATE TABLE table_18946749_2 (
col__m_ INTEGER,
peak VARCHAR
) | What is the col (m) of the Barurumea Ridge peak? | SELECT MAX(col__m_) FROM table_18946749_2 WHERE peak = "Barurumea Ridge" |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | how many patients who were admitted before the year 2150 had an iv bolus as the drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2150" AND prescriptions.route = "IV BOLUS" |
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 whose drug name is bethanechol? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Bethanechol" |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | Anonymous feedback votes over time. | SELECT COUNT(*) FROM PostFeedback |
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 female patients are American Indian/Alaska native? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" |
CREATE TABLE table_name_30 (
gold INTEGER,
nation VARCHAR,
silver VARCHAR
) | With less than 7 Silver medals, how many Gold medals did Canada receive? | SELECT MAX(gold) FROM table_name_30 WHERE nation = "canada" AND silver < 7 |
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 had the diagnosis icd9 code 53190? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.icd9_code = "53190" |
CREATE TABLE table_name_73 (
home_team VARCHAR,
away_team VARCHAR
) | What home team played against Footscray as the away team? | SELECT home_team FROM table_name_73 WHERE away_team = "footscray" |
CREATE TABLE table_27581 (
"Player" text,
"Games Played" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | What is every value for points if rebounds is 6 and blocks is 0? | SELECT "Points" FROM table_27581 WHERE "Rebounds" = '6' AND "Blocks" = '0' |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE SuggestedEdits (
Id n... | Percentage of Questions Upvoted Lower than the Highest Upvoted Answer. | SELECT ROUND(AVG(CASE WHEN QuestionScore < HighestAnswerScore THEN 100.0 ELSE 0.0 END), 2) AS "Percentage" FROM (SELECT q.Id, MAX(q.Score) AS QuestionScore, MAX(a.Score) AS HighestAnswerScore FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id GROUP BY q.Id) AS Scores |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | What is the total number of each fate? Give me the result in a bar graph, and could you order Y-axis from low to high order? | SELECT Fate, COUNT(Fate) FROM mission GROUP BY Fate ORDER BY COUNT(Fate) |
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... | How many patients are admitted before the year 2162 with procedure left heart cardiac cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2162" AND procedures.short_title = "Left heart cardiac cath" |
CREATE TABLE table_24244 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What were the outcomes of matches with bill tilden florence ballin as opponents? | SELECT "Outcome" FROM table_24244 WHERE "Opponents" = 'Bill Tilden Florence Ballin' |
CREATE TABLE table_75362 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Points have a Score of 4 1, and a Record of 18 10 8 1, and a January larger than 2? | SELECT AVG("Points") FROM table_75362 WHERE "Score" = '4–1' AND "Record" = '18–10–8–1' AND "January" > '2' |
CREATE TABLE table_37218 (
"Player" text,
"Position" text,
"Date of Birth (Age)" text,
"Caps" real,
"Club/province" text
) | What is the date of birth for the player from Ulster and plays at Centre position? | SELECT "Date of Birth (Age)" FROM table_37218 WHERE "Club/province" = 'ulster' AND "Position" = 'centre' |
CREATE TABLE table_32614 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Matches" real,
"Average" real
) | What is the highest rank for championships with christy heffernan with over 4 matches? | SELECT MAX("Rank") FROM table_32614 WHERE "Player" = 'christy heffernan' AND "Matches" > '4' |
CREATE TABLE table_train_40 (
"id" int,
"bone_marrow_transplant" bool,
"organ_transplantation" bool,
"systolic_blood_pressure_sbp" int,
"do_not_resuscitate_dnr" bool,
"autoimmune_disease" bool,
"steroid_therapy" bool,
"intention_to_central_venous_catheter" bool,
"hematologic_disease"... | any absolute contraindication to central venous catheterization | SELECT * FROM table_train_40 WHERE intention_to_central_venous_catheter = 0 |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLic... | Downvoted questions in the [row] tag. | SELECT Id, Score, Title FROM Posts WHERE Tags LIKE '%<row>%' AND ClosedDate IS NULL AND Score < 0 ORDER BY Score |
CREATE TABLE table_1040 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | What is the least amount of touchdowns scored on the chart? | SELECT MIN("Touchdowns") FROM table_1040 |
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... | My answers in POPULAR QUESTIONS. | SELECT SUM(q.ViewCount) AS views, q.Id AS "post_link", a.Score FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE a.OwnerUserId = '##userid##' HAVING SUM(q.ViewCount) > 1000 ORDER BY views DESC |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | what is the number of patients whose discharge location is home health care and age is less than 41? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME HEALTH CARE" AND demographic.age < "41" |
CREATE TABLE table_39386 (
"Year" real,
"Championship" text,
"54 holes" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | What is the Winning score in 1956? | SELECT "Winning score" FROM table_39386 WHERE "Year" = '1956' |
CREATE TABLE table_43055 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Assists" real
) | How many Games for Rank 2 Terrell McIntyre? | SELECT MIN("Games") FROM table_43055 WHERE "Name" = 'terrell mcintyre' AND "Rank" > '2' |
CREATE TABLE table_name_94 (
finish VARCHAR,
player VARCHAR,
total VARCHAR,
to_par VARCHAR
) | In what place did Nick Faldo, who had more than 284 points and a to par score of +5, finish? | SELECT finish FROM table_name_94 WHERE total > 284 AND to_par = "+5" AND player = "nick faldo" |
CREATE TABLE candidate (
Candidate_ID VARCHAR,
oppose_rate VARCHAR
) | Find the id of the candidate who got the lowest oppose rate. | SELECT Candidate_ID FROM candidate ORDER BY oppose_rate LIMIT 1 |
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_name VARCHAR(255),
gender VARCHAR(1),
other_staff_details VARCHAR(255)
)
... | A stacked bar chart showing the number of faults for different fault short name and skills required to fix them The x-axis is falut short name and group by skill description, and order in ascending by the X. | SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY skill_description, fault_short_name ORDER BY fault_short_name |
CREATE TABLE table_180802_3 (
transcription VARCHAR,
sanskrit_word VARCHAR
) | What is the transcription of the sanskrit word chandra? | SELECT transcription FROM table_180802_3 WHERE sanskrit_word = "Chandra" |
CREATE TABLE table_11916083_1 (
mintage__bu_ VARCHAR,
_clarification_needed_ VARCHAR,
artist VARCHAR,
issue_price__proof_ VARCHAR
) | What is the mintage (bu) with the artist Royal Canadian Mint Staff and has an issue price (proof) of $54.95? | SELECT mintage__bu_ AS "_clarification_needed_" FROM table_11916083_1 WHERE artist = "Royal Canadian Mint Staff" AND issue_price__proof_ = "$54.95" |
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_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | I want a bar chart to show the frequency of the dates that have the 5 highest cloud cover rates each day, and could you sort in descending by the Y-axis? | SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) DESC |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date... | Trend for relevant questions (Tag and Searchstring). | SELECT COUNT(UniqueId), WeekStart FROM (SELECT Posts.Id AS UniqueId, DATEADD(week, DATEDIFF(day, '20000109', CreationDate) / 7, '20000109') AS WeekStart FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Tags.TagName = @Tag AND (Posts.Body LIKE @Searchstring O... |
CREATE TABLE table_name_52 (
tie_no VARCHAR,
home_team VARCHAR
) | what is the tie number that has Portsmouth Home team | SELECT tie_no FROM table_name_52 WHERE home_team = "portsmouth" |
CREATE TABLE table_60415 (
"Knight" text,
"Weapon/item" text,
"External weapon" text,
"Shield animal" text,
"Cart" text
) | What cart has a serpent shield animal? | SELECT "Cart" FROM table_60415 WHERE "Shield animal" = 'serpent' |
CREATE TABLE table_13476 (
"Class" text,
"Wheel arrangement" text,
"Fleet number(s)" text,
"Manufacturer" text,
"Serial numbers" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
) | What is the quantity made number for the quantity preserved 4-6-0 ooooo ten-wheeler? | SELECT "Quantity made" FROM table_13476 WHERE "Quantity preserved" = '4-6-0 — ooooo — ten-wheeler' |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insuranc... | what are the procedures that are the top four most common in 2100? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE STRFTIME('%y', procedures_icd.charttime) = '2100' GROUP BY procedures_icd.icd9_code) AS t1 ... |
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 prescriptions (
row_id number,
subject_id number,
h... | what is the name of the procedure that patient 1912 has undergone two times in 02/last year? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 191... |
CREATE TABLE table_name_92 (
award VARCHAR,
role VARCHAR,
year VARCHAR
) | Which award was given for the role of Elphaba in 2009? | SELECT award FROM table_name_92 WHERE role = "elphaba" AND year = "2009" |
CREATE TABLE table_76719 (
"Newspaper/Magazine" text,
"Type" text,
"Language" text,
"Headquarter" text,
"Status" text
) | What is Headquarter, when Newspaper/Magazine is Al-Ayyam? | SELECT "Headquarter" FROM table_76719 WHERE "Newspaper/Magazine" = 'al-ayyam' |
CREATE TABLE table_58653 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What is the Score when the set 3 is 26 28? | SELECT "Score" FROM table_58653 WHERE "Set 3" = '26–28' |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostNoticeTypes (
Id... | Search for posts by deleted user. | SELECT CreationDate, Id AS "post_link" FROM Posts AS p WHERE OwnerDisplayName = '##Name:string##' ORDER BY CreationDate |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiolo... | tell me the time of hospital admission of patient 51577 until 2104? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 51577 AND STRFTIME('%y', admissions.admittime) <= '2104' |
CREATE TABLE table_name_8 (
drawn INTEGER,
played INTEGER
) | What is the largest drawn that has a played less than 38? | SELECT MAX(drawn) FROM table_name_8 WHERE played < 38 |
CREATE TABLE table_25180 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
) | How many locations are listed for the winner Temple? | SELECT COUNT("Tournament Venue (City)") FROM table_25180 WHERE "Tournament Winner" = 'Temple' |
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 lab (
subject_id text,
hadm_id text,
... | provide the number of patients whose primary disease is newborn and year of death is less than or equal to 2112? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEWBORN" AND demographic.dod_year <= "2112.0" |
CREATE TABLE table_49891 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
) | What college was the draft pick from who plays center position? | SELECT "College" FROM table_49891 WHERE "Position" = 'center' |
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
) | Visualize a bar chart for what are the naems of all the projects, and how many scientists were assigned to each of them? | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name |
CREATE TABLE table_name_59 (
pick__number INTEGER,
college VARCHAR,
overall VARCHAR
) | How many Picks have a College of tennessee, and an Overall smaller than 270? | SELECT SUM(pick__number) FROM table_name_59 WHERE college = "tennessee" AND overall < 270 |
CREATE TABLE table_name_28 (
pole_position VARCHAR,
race VARCHAR
) | What is the Pole Position of the Brazilian Grand Prix race? | SELECT pole_position FROM table_name_28 WHERE race = "brazilian grand prix" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.