table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_7 (
runners_up VARCHAR,
club VARCHAR
) | Who were the runners-up for the FC Viktoria Plze club? | SELECT runners_up FROM table_name_7 WHERE club = "fc viktoria plzeň" |
CREATE TABLE table_64901 (
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" real,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"Total Apps" text,
"Total Goals" real
) | What are the average league goals that have 2 (1) as the total apps? | SELECT AVG("League Goals") FROM table_64901 WHERE "Total Apps" = '2 (1)' |
CREATE TABLE table_69431 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text
) | What is the 9:30 feature with la porte des toiles at 8:30? | SELECT "9:30" FROM table_69431 WHERE "8:30" = 'la porte des étoiles' |
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 were tested for triiodothyronine (t3)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Triiodothyronine (T3)" |
CREATE TABLE table_name_34 (
killed INTEGER,
perpetrator VARCHAR
) | How many kills did basobas, florentino have? | SELECT MAX(killed) FROM table_name_34 WHERE perpetrator = "basobas, florentino" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | had patient 012-26564 in their last hospital visit been diagnosed with tricyclic overdose - with respiratory depression? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-26564' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.ho... |
CREATE TABLE table_66780 (
"Outcome" text,
"Date" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Who is the opponent for the winner outcome on a hard surface on August 27, 2011? | SELECT "Opponent" FROM table_66780 WHERE "Outcome" = 'winner' AND "Surface" = 'hard' AND "Date" = 'august 27, 2011' |
CREATE TABLE table_47932 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What day was the surface clay and the score 6 1, 6 4? | SELECT "Date" FROM table_47932 WHERE "Surface" = 'clay' AND "Score" = '6–1, 6–4' |
CREATE TABLE table_75486 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Bronze is the highest one that has a Rank larger than 1, and a Nation of dominican republic, and a Total larger than 4? | SELECT MAX("Bronze") FROM table_75486 WHERE "Rank" > '1' AND "Nation" = 'dominican republic' AND "Total" > '4' |
CREATE TABLE table_76425 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Record" text
) | What is the Record on July 12? | SELECT "Record" FROM table_76425 WHERE "Date" = 'july 12' |
CREATE TABLE table (
r VARCHAR,
coppa_italia INTEGER
) | Name the total number of r for coppa italia larger than 1.0 | SELECT COUNT(r) FROM table WHERE coppa_italia > 1.0 |
CREATE TABLE table_11970261_2 (
interview VARCHAR,
swimsuit VARCHAR
) | what's the interview with swimsuit being 9.140 | SELECT interview FROM table_11970261_2 WHERE swimsuit = "9.140" |
CREATE TABLE table_24066 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | What is he archive for the episode with a run time of 24:05? | SELECT "Archive" FROM table_24066 WHERE "Run time" = '24:05' |
CREATE TABLE table_name_25 (
record VARCHAR,
opponent VARCHAR,
points VARCHAR,
game VARCHAR
) | What's the record for a game past 44 against the Dallas Stars with more than 54 points? | SELECT record FROM table_name_25 WHERE points > 54 AND game > 44 AND opponent = "dallas stars" |
CREATE TABLE table_31458 (
"Station" text,
"Metlink code" text,
"Line(s)" text,
"Service(s)" text,
"Serves" text,
"km from Wellington" text,
"Fare zone(s)" text,
"Opened" text
) | what is the metlink code that opened in 1908? | SELECT "Metlink code" FROM table_31458 WHERE "Opened" = '1908' |
CREATE TABLE table_18283 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | To which party does Robert W. Edgar belong? | SELECT "Party" FROM table_18283 WHERE "Incumbent" = 'Robert W. Edgar' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
... | what is the top five most common diagnosis for which patients were diagnosed during the same month after being diagnosed until 2103 with tracheostomy status? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... |
CREATE TABLE table_20963 (
"Wicket" text,
"Runs" real,
"Batting partners" text,
"Batting team" text,
"Fielding team" text,
"Venue" text,
"Season" text
) | Who are the batting partners for the 1997 season? | SELECT "Batting partners" FROM table_20963 WHERE "Season" = '1997' |
CREATE TABLE table_name_29 (
visitor VARCHAR,
home VARCHAR
) | Who was the visitor in the game that had Ottawa as the home team? | SELECT visitor FROM table_name_29 WHERE home = "ottawa" |
CREATE TABLE table_5103 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | How many Played have a Lost smaller than 3, and a Difference of 6, and Points larger than 6? | SELECT COUNT("Played") FROM table_5103 WHERE "Lost" < '3' AND "Difference" = '6' AND "Points" > '6' |
CREATE TABLE table_58748 (
"South West DFL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | How many byes did they have against smaller than 1544, 13 wins, and draws larger than 0? | SELECT COUNT("Byes") FROM table_58748 WHERE "Against" < '1544' AND "Wins" = '13' AND "Draws" > '0' |
CREATE TABLE table_68896 (
"Stage" text,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Young rider classification" text,
"Trofeo Fast Team" text
) | Who had the Points classification for Stage 13? | SELECT "Points classification" FROM table_68896 WHERE "Stage" = '13' |
CREATE TABLE table_73902 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text
) | how many categories fall under the category of britons? | SELECT COUNT("Type") FROM table_73902 WHERE "Nickname" = 'Britons' |
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, show me about the distribution of name and the amount of name , and group by attribute name in a bar chart, rank in ascending by the Y-axis. | SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY COUNT(T1.Name) |
CREATE TABLE table_203_764 (
id number,
"name" text,
"date" number,
"nation" text,
"displacement" text,
"speed" text,
"number" number,
"notes" text
) | how many tons of displacement does type b have ? | SELECT "displacement" FROM table_203_764 WHERE "name" = 'type b' |
CREATE TABLE table_34980 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | For an ICAO of VCCT, what is the IATA? | SELECT "IATA" FROM table_34980 WHERE "ICAO" = 'vcct' |
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
)
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
) | Compute the total the total number across type as a pie chart. | SELECT Type, COUNT(*) FROM ship GROUP BY Type |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | how many patients born before the year 1821 had an urgent admission type? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.dob_year < "1821" |
CREATE TABLE table_name_85 (
writer VARCHAR,
producer_executive_producer VARCHAR
) | Which writer had a producer DKA, JL, AS? | SELECT writer FROM table_name_85 WHERE producer_executive_producer = "dka, jl, as" |
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 decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, show by the bars in descending. | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
CREATE TABLE table_name_37 (
score VARCHAR,
opponent VARCHAR
) | What is the score of the tournament with younes el aynaoui as the opponent? | SELECT score FROM table_name_37 WHERE opponent = "younes el aynaoui" |
CREATE TABLE table_80148 (
"Designation" text,
"Constellation" text,
"Date sent" text,
"Arrival date" text,
"Message" text
) | Where is Hip 4872? | SELECT "Constellation" FROM table_80148 WHERE "Designation" = 'hip 4872' |
CREATE TABLE hall_of_fame (
player_id TEXT,
yearid INTEGER,
votedby TEXT,
ballots NUMERIC,
needed NUMERIC,
votes NUMERIC,
inducted TEXT,
category TEXT,
needed_note TEXT
)
CREATE TABLE manager_award_vote (
award_id TEXT,
year INTEGER,
league_id TEXT,
player_id TEXT,
... | Show me the trend about what is the average number of attendance at home games for each year?, sort in asc by the x-axis. | SELECT year, AVG(attendance) FROM home_game GROUP BY year ORDER BY year |
CREATE TABLE item (
i_id number,
title text
)
CREATE TABLE review (
a_id number,
u_id number,
i_id number,
rating number,
rank number
)
CREATE TABLE useracct (
u_id number,
name text
)
CREATE TABLE trust (
source_u_id number,
target_u_id number,
trust number
) | Find the titles of items that received any rating below 5. | SELECT T1.title FROM item AS T1 JOIN review AS T2 ON T1.i_id = T2.i_id WHERE T2.rating < 5 |
CREATE TABLE table_name_16 (
result VARCHAR,
week VARCHAR,
date VARCHAR
) | what is the result for the week higher than 7 on november 4, 1979? | SELECT result FROM table_name_16 WHERE week > 7 AND date = "november 4, 1979" |
CREATE TABLE table_66061 (
"Chassis code" text,
"Model Years" text,
"Model" text,
"Engine" text,
"No. built" real
) | What's the years that has a chassis code of W116.025 and number built was more than 150,593? | SELECT "Model Years" FROM table_66061 WHERE "No. built" > '150,593' AND "Chassis code" = 'w116.025' |
CREATE TABLE table_name_46 (
date_of_departure VARCHAR,
name VARCHAR
) | When did Brendan Rodgers depart his position? | SELECT date_of_departure FROM table_name_46 WHERE name = "brendan rodgers" |
CREATE TABLE table_43816 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
) | What event had a win, record of 8-1 and n/a round? | SELECT "Event" FROM table_43816 WHERE "Res." = 'win' AND "Round" = 'n/a' AND "Record" = '8-1' |
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,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | when was patient 88079 last admitted to the hospital via phys referral/normal deli since 3 years ago? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 88079 AND admissions.admission_location = 'phys referral/normal deli' AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year') ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE table_name_36 (
score VARCHAR,
date VARCHAR
) | Name the score for december 5 | SELECT score FROM table_name_36 WHERE date = "december 5" |
CREATE TABLE table_5505 (
"Name" text,
"Lifespan" text,
"Country" text,
"Wins" real,
"Majors" real,
"Winning span" text,
"Span (years)" text
) | What lifespan has a majors greater than 1, and fuzzy zoeller as the name? | SELECT "Lifespan" FROM table_5505 WHERE "Majors" > '1' AND "Name" = 'fuzzy zoeller' |
CREATE TABLE table_67614 (
"Year" real,
"Series title" text,
"Chinese title" text,
"Role" text,
"Channel" text
) | The highest year for the series titled dragon laws ii: kidnapped is what? | SELECT MAX("Year") FROM table_67614 WHERE "Series title" = 'dragon laws ii: kidnapped' |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | For those employees who did not have any job in the past, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart, and could you list by the Y in descending please? | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) DESC |
CREATE TABLE table_name_97 (
competition VARCHAR,
date VARCHAR
) | What competition was held on the date 6/7/03 | SELECT competition FROM table_name_97 WHERE date = "6/7/03" |
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
medicine_id number,
interaction_type text
)
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosome text,
omim number,
porphyria text
)
CREATE TABLE medicine (
id number,
name text,... | What are the ids, names and FDA approval status of medicines in descending order of the number of enzymes that it can interact with. | SELECT T1.id, T1.name, T1.fda_approved FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC |
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 (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, find phone_number and commission_pct , and visualize them by a bar chart, and could you sort y-axis in ascending order? | 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 COMMISSION_PCT |
CREATE TABLE table_13907 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text,
"Report" text
) | What time has a Set 1 of 18 25? | SELECT "Time" FROM table_13907 WHERE "Set 1" = '18–25' |
CREATE TABLE table_59983 (
"Tie no" real,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | How many people on average attended when Eastwood Town was the away team, and the tie number was less than 8? | SELECT AVG("Attendance") FROM table_59983 WHERE "Tie no" < '8' AND "Away team" = 'eastwood town' |
CREATE TABLE table_name_3 (
casualties VARCHAR,
intensity VARCHAR,
epicenter VARCHAR
) | How many casualties were in the earthquake with an unknown intensity and an epicenter in the bou ra province? | SELECT casualties FROM table_name_3 WHERE intensity = "unknown" AND epicenter = "bouïra province" |
CREATE TABLE table_name_26 (
mountains_classification VARCHAR,
points_classification VARCHAR,
general_classification VARCHAR
) | What's the mountains classification when the points classification is Alessandro Petacchi and the general classification is Danilo Di Luca? | SELECT mountains_classification FROM table_name_26 WHERE points_classification = "alessandro petacchi" AND general_classification = "danilo di luca" |
CREATE TABLE table_name_6 (
team VARCHAR,
date VARCHAR
) | What is the name of the team leading on August 17? | SELECT team FROM table_name_6 WHERE date = "august 17" |
CREATE TABLE table_14559 (
"Opponent" text,
"OVERALL" text,
"HOME" text,
"AWAY" text,
"PLYFF" text
) | Which Overall has a playoff record of (0-1) and an away record of (1-1)? | SELECT "OVERALL" FROM table_14559 WHERE "PLYFF" = '(0-1)' AND "AWAY" = '(1-1)' |
CREATE TABLE county (
county_id number,
county_name text,
population number,
zip_code text
)
CREATE TABLE election (
election_id number,
counties_represented text,
district number,
delegate text,
party number,
first_elected number,
committee text
)
CREATE TABLE party (
... | Show the 3 counties with the smallest population. | SELECT county_name FROM county ORDER BY population LIMIT 3 |
CREATE TABLE TRACK (
GenreId VARCHAR
)
CREATE TABLE GENRE (
GenreId VARCHAR,
Name VARCHAR
) | What are the duration of the longest and shortest pop tracks in milliseconds? | SELECT MAX(Milliseconds), MIN(Milliseconds) FROM GENRE AS T1 JOIN TRACK AS T2 ON T1.GenreId = T2.GenreId WHERE T1.Name = "Pop" |
CREATE TABLE table_name_27 (
time VARCHAR,
opponent VARCHAR
) | How long was his fight against kim kyoung-suk? | SELECT time FROM table_name_27 WHERE opponent = "kim kyoung-suk" |
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 the number of patients diagnosed under icd9 code 25013 whose death status is 1? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "25013" |
CREATE TABLE table_2562572_56 (
settlement VARCHAR
) | What is the settlement destiny in Aleksandrovo? | SELECT settlement AS destiny FROM table_2562572_56 WHERE settlement = "Aleksandrovo" |
CREATE TABLE table_name_89 (
finish VARCHAR,
year VARCHAR
) | What was the finish for 1992? | SELECT finish FROM table_name_89 WHERE year = 1992 |
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... | Draw a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home, and could you show by the X in descending? | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY ACC_Road DESC |
CREATE TABLE table_42571 (
"Match" real,
"Date" text,
"Home/Away" text,
"Opponent team" text,
"Score" text
) | What was the highest match when the away opponent was Dalian Shide Siwu? | SELECT MAX("Match") FROM table_42571 WHERE "Opponent team" = 'dalian shide siwu' AND "Home/Away" = 'away' |
CREATE TABLE table_17650725_1 (
internal_transfers INTEGER
) | Name the least internal transfers | SELECT MIN(internal_transfers) FROM table_17650725_1 |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREA... | What are the ids and details of events that have more than one participants Visualize by bar chart, and I want to display by the names from high to low please. | SELECT T1.Event_Details, T1.Event_ID FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY T1.Event_Details ORDER BY T1.Event_Details DESC |
CREATE TABLE table_13093 (
"Place" real,
"Team" text,
"Played" real,
"Draw" real,
"Lost" real,
"Goals Scored" real,
"Goals Conceded" real,
"Points" real
) | Whate place has 18 points with lost less than 8? | SELECT COUNT("Place") FROM table_13093 WHERE "Points" = '18' AND "Lost" < '8' |
CREATE TABLE Products (
product_id INTEGER,
product_details VARCHAR(255)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_address_from DATETIME,
address_type VARCHAR(15),
date_address_to DATETIME
)
CREATE TABLE Customer_Contact_Channels (
customer_id IN... | Find the number of customers that use email as the contact channel for each year Visualize with a bar chart, display by the the number of active from date in desc. | SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' ORDER BY COUNT(active_from_date) DESC |
CREATE TABLE country (
country_id number,
country_name text,
capital text,
official_native_language text
)
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE team (
team_id ... | Show the name of colleges that have at least two players in descending alphabetical order. | SELECT college FROM match_season GROUP BY college HAVING COUNT(*) >= 2 ORDER BY college DESC |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | what is the number of patients with lab test item id 51248? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51248" |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE fare_basis (
fare_basis_cod... | what 's the cheapest flight from DENVER to PITTSBURGH | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... |
CREATE TABLE table_29147 (
"No. in total" text,
"No. in series" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What is the number in series of the episode titled 'beauty and the beast'? | SELECT "No. in series" FROM table_29147 WHERE "Title" = 'Beauty and the Beast' |
CREATE TABLE medicine (
name VARCHAR,
trade_name VARCHAR
)
CREATE TABLE enzyme (
id VARCHAR,
product VARCHAR
)
CREATE TABLE medicine_enzyme_interaction (
medicine_id VARCHAR,
enzyme_id VARCHAR
) | Show the medicine names and trade names that cannot interact with the enzyme with product 'Heme'. | SELECT name, trade_name FROM medicine EXCEPT SELECT T1.name, T1.trade_name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id JOIN enzyme AS T3 ON T3.id = T2.enzyme_id WHERE T3.product = 'Protoporphyrinogen IX' |
CREATE TABLE table_26202847_6 (
no VARCHAR,
date VARCHAR
) | On the date October 21, 2007, what is the No.? | SELECT no FROM table_26202847_6 WHERE date = "October 21, 2007" |
CREATE TABLE table_40294 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" real,
"Result" text
) | Which original artist had 5 as their order #? | SELECT "Original artist" FROM table_40294 WHERE "Order #" = '5' |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_i... | had the heart rate of patient 20603 been in 10/this year ever greater than 83.0? | SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20603)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rate' AND d... |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREA... | i need flight information for a flight departing from CLEVELAND to MILWAUKEE wednesday after 1800 | SELECT DISTINCT flight_id FROM flight WHERE (((departure_time > 1800 AND flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 23 AND DATE_DAYalias0.month_number = 4 AND DATE_DAYa... |
CREATE TABLE table_4832 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people are in the crowd in south melbourne? | SELECT COUNT("Crowd") FROM table_4832 WHERE "Home team" = 'south melbourne' |
CREATE TABLE table_3823 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | Name the number of team for 19th position | SELECT COUNT("Team") FROM table_3823 WHERE "Position in table" = '19th' |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text... | Top users from Saarbr cken, Germany. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%saarbr%cken%' AND Reputation >= 1000 ORDER BY Reputation DESC |
CREATE TABLE table_name_54 (
predecessor VARCHAR,
date VARCHAR,
district VARCHAR,
congress VARCHAR
) | What predecessor has a district less than 11, 68th as the Congress, and may 1, 1923 as the date? | SELECT predecessor FROM table_name_54 WHERE district < 11 AND congress = "68th" AND date = "may 1, 1923" |
CREATE TABLE table_name_13 (
car_no VARCHAR,
points VARCHAR
) | What car number had 24 points? | SELECT car_no FROM table_name_13 WHERE points = "24" |
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 the total number of patients on medicare insurance who had a lab test for atypical lymphocytes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Medicare" AND lab.label = "Atypical Lymphocytes" |
CREATE TABLE table_name_72 (
term_end VARCHAR,
governments VARCHAR,
minister VARCHAR
) | When did the term end for the term that had government 27 and Minister Tzachi Hanegbi? | SELECT term_end FROM table_name_72 WHERE governments = "27" AND minister = "tzachi hanegbi" |
CREATE TABLE table_14834801_1 (
mandate VARCHAR,
list_pct VARCHAR
) | Name the mandate for list pct 12.39% | SELECT mandate FROM table_14834801_1 WHERE list_pct = "12.39%" |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Top 300 SO Users from India. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users ORDER BY Reputation DESC LIMIT 300 |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicatio... | how many patients were diagnosed with obesity they did not come to the hospital during the same month? | SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'obesity') AS t1) - (SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.di... |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | At what times will Lean Manufacturing and Services be offered ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... |
CREATE TABLE table_name_10 (
rank INTEGER,
nation VARCHAR,
gold VARCHAR
) | What is the rank that when Serbia is the nation, and gold is larger than 0? | SELECT SUM(rank) FROM table_name_10 WHERE nation = "serbia" AND gold > 0 |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
... | total reputation for all users on site. | SELECT SUM(Reputation) / COUNT(Id) AS "average_rep", COUNT(Id) AS "number_of_users" FROM Users |
CREATE TABLE table_name_84 (
city VARCHAR,
school VARCHAR,
ihsaa_football_class VARCHAR,
enrollment VARCHAR
) | Which city is Lawrenceburg school, with an IHSAA football class of aaa and less than 676 enrollments, located in? | SELECT city FROM table_name_84 WHERE ihsaa_football_class = "aaa" AND enrollment < 676 AND school = "lawrenceburg" |
CREATE TABLE table_4167 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Who wrote the episode titled 'There Goes the Neighborhood'? | SELECT "Written by" FROM table_4167 WHERE "Title" = 'There Goes the Neighborhood' |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TA... | how many patients were prescribed potassium chloride crys er 20 meq po tbcr within the same month after diagnosis of anemia? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'anemia') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medi... |
CREATE TABLE table_72609 (
"Episode #" text,
"Country" text,
"City" text,
"Martial Art/Style" text,
"Masters" text,
"Original Airdate" text
) | Which masters fought in hapkido style? | SELECT "Masters" FROM table_72609 WHERE "Martial Art/Style" = 'Hapkido' |
CREATE TABLE table_name_13 (
studio VARCHAR,
title VARCHAR
) | Which studio did The Oregon Trail? | SELECT studio FROM table_name_13 WHERE title = "the oregon trail" |
CREATE TABLE table_name_63 (
recorded VARCHAR,
time VARCHAR,
song_title VARCHAR
) | What is the date recorded for I Want to Be Free with a length of 2:12? | SELECT recorded FROM table_name_63 WHERE time = "2:12" AND song_title = "i want to be free" |
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_address_from time,
address_type text,
date_address_to time
)
CREATE TABLE products (
product_id number,
product_details text
)
CREATE TABLE customer_contact_channels (
customer_id number,
channel_code tex... | Find the payment method that is used most frequently. | SELECT payment_method FROM customers GROUP BY payment_method ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_48654 (
"Year" real,
"Date" text,
"Winner" text,
"Result" text,
"Loser" text,
"Location" text
) | What was the location on October 16? | SELECT "Location" FROM table_48654 WHERE "Date" = 'october 16' |
CREATE TABLE table_203_200 (
id number,
"region" text,
"seed" number,
"team" text,
"coach" text,
"finished" text,
"final opponent" text,
"score" text
) | north carolina and unlv each made it to which round ? | SELECT "finished" FROM table_203_200 WHERE "team" = 'north carolina' |
CREATE TABLE table_203_396 (
id number,
"year" number,
"domestic passengers" number,
"international passengers" number,
"total passengers" number,
"change" text
) | how many times was the total number of passengers at least 800,000 or more ? | SELECT COUNT(*) FROM table_203_396 WHERE "total passengers" >= 800000 |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE instructor (
instructo... | Do upper-level classes all have exams ? | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' |
CREATE TABLE table_43143 (
"Date" text,
"Time" text,
"Home" text,
"Away" text,
"Score" text,
"Ground" text
) | What was the date for the 130-56 game? | SELECT "Date" FROM table_43143 WHERE "Score" = '130-56' |
CREATE TABLE table_20093 (
"Name" text,
"Position" text,
"Number" real,
"School/Club Team" text,
"Season" text,
"Acquisition via" text
) | How many school/club teams have a player named Manuel Luis Quezon? | SELECT COUNT("Number") FROM table_20093 WHERE "School/Club Team" = 'Manuel Luis Quezon' |
CREATE TABLE table_62503 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real,
"Finish" text
) | What year did the player with a total less than 300 and a to par of 9 have a win? | SELECT "Year(s) won" FROM table_62503 WHERE "Total" < '300' AND "To par" = '9' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.