table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_34775 (
"Nation" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"Alternate" text
) | Who is the lead for the team with Nkeiruka Ezekh as second? | SELECT "Lead" FROM table_34775 WHERE "Second" = 'nkeiruka ezekh' |
CREATE TABLE table_33186 (
"Positional or Automatic" text,
"Opponents" text,
"Suits" text,
"Material or Non-material" text,
"Count Rectified" text
) | Which suits have no material or non-material, either opponent, and are positional? | SELECT "Suits" FROM table_33186 WHERE "Material or Non-material" = 'no' AND "Opponents" = 'either' AND "Positional or Automatic" = 'positional' |
CREATE TABLE table_name_66 (
school_colors VARCHAR,
main_campus_location VARCHAR
) | What are the school colors for the college whose main campus is overland park? | SELECT school_colors FROM table_name_66 WHERE main_campus_location = "overland park" |
CREATE TABLE table_45903 (
"Name" text,
"Platform" text,
"Supported databases" text,
"Tracking Method" text,
"Latest stable release" text,
"License" text
) | Which tracking method has a latest stable release of 6.0? | SELECT "Tracking Method" FROM table_45903 WHERE "Latest stable release" = '6.0' |
CREATE TABLE table_name_73 (
guest_host VARCHAR,
episode_number VARCHAR
) | What is the name of the Guest Host for Episode Number of 5? | SELECT guest_host FROM table_name_73 WHERE episode_number = 5 |
CREATE TABLE table_21907770_4 (
country VARCHAR,
versus VARCHAR
) | How many times was the opponent country India? | SELECT COUNT(country) FROM table_21907770_4 WHERE versus = "India" |
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 admission time and procedure short title of subject id 2560? | SELECT demographic.admittime, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" |
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 (... | provide the number of patients whose discharge location is long term care hospital? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP... | Give me a histogram for what are the total number of credits offered by each department? | SELECT DEPT_CODE, SUM(T1.CRS_CREDIT) FROM COURSE AS T1 JOIN CLASS AS T2 ON T1.CRS_CODE = T2.CRS_CODE GROUP BY T1.DEPT_CODE |
CREATE TABLE table_27615445_1 (
audition_city VARCHAR,
episode_air_date VARCHAR
) | How many audition city's are there with an episode air date of June 24, 2010? | SELECT COUNT(audition_city) FROM table_27615445_1 WHERE episode_air_date = "June 24, 2010" |
CREATE TABLE table_18348 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the incumbent for district texas 12 | SELECT "Incumbent" FROM table_18348 WHERE "District" = 'Texas 12' |
CREATE TABLE table_203_763 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | in what years did ramon gonzalez come in first place ? | SELECT "year" FROM table_203_763 WHERE "position" = 1 |
CREATE TABLE table_59509 (
"School" text,
"Suburb/Town" text,
"Years" text,
"Founded" real,
"Website" text
) | What is the year Airds High School was founded? | SELECT "Founded" FROM table_59509 WHERE "School" = 'airds high school' |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is maximum age of patients whose days of hospital stay is 11 and year of death is less than 2154? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "11" AND demographic.dod_year < "2154.0" |
CREATE TABLE table_69894 (
"Rank" real,
"Player" text,
"County" text,
"Tally" text,
"Total" real,
"Opposition" text
) | With a Tally of 0-14, what is the Rank in Kilkenny County? | SELECT COUNT("Rank") FROM table_69894 WHERE "County" = 'kilkenny' AND "Tally" = '0-14' |
CREATE TABLE table_204_735 (
id number,
"rank" number,
"team" text,
"names" text,
"time" text,
"qualification" text
) | how many consecutive rankings are listed ? | SELECT COUNT("rank") FROM table_204_735 |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
... | give me the difference between the total input of patient 10431 and the output of the patient until 12/00/2105. | SELECT (SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10431)) AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) <= '2105-12-00') - (SEL... |
CREATE TABLE table_27987623_4 (
rank_timeslot_ VARCHAR,
airdate VARCHAR
) | what is the total rank on airdate march 30, 2011? | SELECT COUNT(rank_timeslot_) FROM table_27987623_4 WHERE airdate = "March 30, 2011" |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | what flights stop in ATLANTA before 1200 | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight, flight_stop WHERE city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA' AND flight_stop.arrival_time < 1200 AND flight_stop.stop_airport = airport_service.airport_code AND flight.flight_id = flight_stop.flight_id |
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... | A bar chart shows the distribution of Name and Weight . | SELECT Name, Weight FROM people |
CREATE TABLE table_38237 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What is the highest number of draws with 14 points and less than 7 games? | SELECT MAX("Drawn") FROM table_38237 WHERE "Points" = '14' AND "Games" < '7' |
CREATE TABLE table_name_38 (
military_deaths VARCHAR,
total_casualties VARCHAR
) | How many members of the military died in the conflict that had a total of 531 casualties? | SELECT military_deaths FROM table_name_38 WHERE total_casualties = "531" |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What courses on Advanced Al Techniques have 4 credits ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Advanced Al Techniques%' OR name LIKE '%Advanced Al Techniques%') AND credits = 4 |
CREATE TABLE table_51905 (
"Player" text,
"Car." real,
"Yards" real,
"Avg." real,
"TD's" real,
"Long" real
) | Name the total number of TD's for long more than 6 and cars less than 4 | SELECT COUNT("TD's") FROM table_51905 WHERE "Long" > '6' AND "Car." < '4' |
CREATE TABLE table_1341453_15 (
results VARCHAR,
district VARCHAR
) | What was the result in Illinois 7? | SELECT results FROM table_1341453_15 WHERE district = "Illinois 7" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
... | what were the number of definity prescriptions that were made since 4 years ago? | SELECT COUNT(*) FROM medication WHERE medication.drugname = 'definity' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year') |
CREATE TABLE table_22654 (
"Date Released" text,
"Polling institute" text,
"Social Democratic" text,
"Socialist" text,
"Green-Communist" text,
"Democratic and Social Centre" text,
"Lead" text
) | How many socialist have a lead of 12.6%? | SELECT COUNT("Socialist") FROM table_22654 WHERE "Lead" = '12.6%' |
CREATE TABLE table_name_81 (
score VARCHAR,
result VARCHAR
) | Which Score has a Result of 0 2? | SELECT score FROM table_name_81 WHERE result = "0 – 2" |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, and rank by the y-axis in asc. | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) |
CREATE TABLE table_17325580_6 (
high_points VARCHAR,
team VARCHAR
) | What is every high point when the team is Washington? | SELECT high_points FROM table_17325580_6 WHERE team = "Washington" |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Visualize a bar chart about the distribution of All_Home and Team_ID , and group by attribute ACC_Road, I want to order in descending by the Y please. | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY Team_ID DESC |
CREATE TABLE table_11677760_1 (
player VARCHAR,
year VARCHAR,
college VARCHAR,
school VARCHAR
) | what is the player who's college is listed as direct to nba, school is st. vincent st. mary high school and the year is 2001-2002? | SELECT player FROM table_11677760_1 WHERE college = "Direct to NBA" AND school = "St. Vincent – St. Mary High school" AND year = "2001-2002" |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | since 3 years ago, what is the top four most frequent diagnosis that patients were diagnosed with within 2 months after receiving total splenectomy? | 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, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi... |
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
)
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
) | What is the number of locations of the wrestlers? Visualize by a bar chart, and sort by the x-axis from high to low. | SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY Location DESC |
CREATE TABLE table_29673 (
"Week #" text,
"Theme" text,
"Song Choice" text,
"Original Artist" text,
"Order #" text,
"Result" text
) | How many different weeks are there in order number 4 that were judge's choice? | SELECT COUNT("Week #") FROM table_29673 WHERE "Theme" = 'Judge''s Choice' AND "Order #" = '4' |
CREATE TABLE table_204_268 (
id number,
"album/single" text,
"performer" text,
"year" number,
"variant" text,
"notes" text
) | who appeared on more albums , maccoll or kornog ? | SELECT "performer" FROM table_204_268 WHERE "performer" IN ('ewan maccoll', 'kornog') GROUP BY "performer" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_30326 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | Name the number of womens singles for 1999 rio de janeiro | SELECT COUNT("Womens Singles") FROM table_30326 WHERE "Year Location" = '1999 Rio de Janeiro' |
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... | find the number of emergency hospital admitted patients who had neb route of drug administration. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "NEB" |
CREATE TABLE table_36999 (
"Rank" real,
"First quarter" text,
"Second quarter" text,
"Third quarter" text,
"Fourth quarter" text
) | When the third quarter is China Mobile 195,680.4, what is the rank? | SELECT "Rank" FROM table_36999 WHERE "Third quarter" = 'china mobile 195,680.4' |
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
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | how much is the cost of the atrophic vaginitis diagnosing? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atrophic vaginitis')) |
CREATE TABLE table_55800 (
"Name" text,
"Date of birth" text,
"Date of death" text,
"Reign" text,
"Relationship with predecessor" text
) | What was the Date of Death of the person whose Date of Birth was 28 May 1371? | SELECT "Date of death" FROM table_55800 WHERE "Date of birth" = '28 may 1371' |
CREATE TABLE table_59892 (
"Date" text,
"Opponent" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the result of the UEFA Cup, against Palermo? | SELECT "Result" FROM table_59892 WHERE "Competition" = 'uefa cup' AND "Opponent" = 'palermo' |
CREATE TABLE table_36602 (
"Date" text,
"Home Team" text,
"Score" text,
"Visiting Team" text,
"Stadium" text
) | What was the score at CN Centre on April 5, 2008? | SELECT "Score" FROM table_36602 WHERE "Stadium" = 'cn centre' AND "Date" = 'april 5, 2008' |
CREATE TABLE table_18818 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many leading scorers were there in the game against Utah? | SELECT COUNT("High points") FROM table_18818 WHERE "Team" = 'Utah' |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare... | what about a RENTAL CAR in DENVER | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'DENVER' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR' |
CREATE TABLE table_14875671_1 (
date VARCHAR,
attendance VARCHAR
) | What was the date when the attendance was 63995 | SELECT date FROM table_14875671_1 WHERE attendance = 63995 |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
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_da... | i'm requesting flight information on a flight from SAN FRANCISCO to PITTSBURGH on friday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBURGH' AND date_day.day_number = 25 AND date_day.month_number = 6 AN... |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varcha... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, visualize a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and could you list by the X in descending please? | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC |
CREATE TABLE table_name_56 (
record VARCHAR,
games VARCHAR
) | What is the Record of the 1991 Port of Spain Games? | SELECT record FROM table_name_56 WHERE games = "1991 port of spain" |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | calculate the number of male patients whose hospital stay was for more than 2 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.days_stay > "2" |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of founder and the sum of manufacturer , and group by attribute founder, and I want to sort X-axis in asc order. | SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder |
CREATE TABLE table_11951237_3 (
original_air_date VARCHAR,
directed_by VARCHAR
) | What is theoriginal air date of the episode directed by timothy van patten? | SELECT original_air_date FROM table_11951237_3 WHERE directed_by = "Timothy Van Patten" |
CREATE TABLE table_name_51 (
congress VARCHAR,
_number_of_cosponsors VARCHAR
) | Which Congress has a # of cosponsors of 19? | SELECT congress FROM table_name_51 WHERE _number_of_cosponsors = 19 |
CREATE TABLE table_29290 (
"Season" text,
"Coach" text,
"Conf. Record" text,
"Overall" text,
"Standings" text,
"Postseason" text
) | What was the conference record for the Pandas when they were first in the standings in the 2003-04 season? | SELECT "Conf. Record" FROM table_29290 WHERE "Standings" = 'First' AND "Season" = '2003-04' |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' |
CREATE TABLE neighborhood (
id int,
business_id varchar,
neighborhood_name varchar
)
CREATE TABLE user (
uid int,
user_id varchar,
name varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
... | Find all restaurant in ' Los Angeles ' with more than 100 reviews | SELECT business.name FROM business, category WHERE business.city = 'Los Angeles' AND business.review_count > 100 AND category.business_id = business.business_id AND category.category_name = 'restaurant' |
CREATE TABLE csu_fees (
campus number,
year number,
campusfee number
)
CREATE TABLE degrees (
year number,
campus number,
degrees number
)
CREATE TABLE discipline_enrollments (
campus number,
discipline number,
year number,
undergraduate number,
graduate number
)
CREATE TA... | What campuses are located in Chico? | SELECT campus FROM campuses WHERE location = "Chico" |
CREATE TABLE table_204_805 (
id number,
"name" text,
"club" text,
"date of departure" text,
"replacement" text,
"date of appointment" text
) | what is the number of managerial changes that ttm samut sakhon made in 2009 ? | SELECT COUNT(*) FROM table_204_805 WHERE "club" = 'ttm samut sakhon' |
CREATE TABLE table_46430 (
"Finished" real,
"Time/ Behind" text,
"Post" real,
"Horse" text,
"Jockey" text,
"Trainer" text,
"Owner" text
) | What is Jockey, when Horse is 'Eight Belles'? | SELECT "Jockey" FROM table_46430 WHERE "Horse" = 'eight belles' |
CREATE TABLE table_29215 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What college did the player who played DE go to? | SELECT "College" FROM table_29215 WHERE "Position" = 'DE' |
CREATE TABLE table_203_238 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | when was his last competition ? | SELECT "year" FROM table_203_238 ORDER BY "year" DESC LIMIT 1 |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | For the attribute Team_Name and ACC_Percent, show their proportion by a pie chart. | SELECT Team_Name, ACC_Percent FROM basketball_match |
CREATE TABLE table_5592 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | On what date was their record 46-39? | SELECT "Date" FROM table_5592 WHERE "Record" = '46-39' |
CREATE TABLE table_16318 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What's the team of the player from St. Francis Xavier College? | SELECT "CFL Team" FROM table_16318 WHERE "College" = 'St. Francis Xavier' |
CREATE TABLE table_2855 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the score for the game when the record was 37-27? | SELECT "Score" FROM table_2855 WHERE "Record" = '37-27' |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE ReviewTaskResults (
Id number,
Review... | Top users by the number of times they earned 200/day. This query finds the top users by the number of times they've earned 200/day, and gives indication about the progress towards Epic and Legendary badges.
Think of it as the number of times Mortarboard badge could have been earned | SELECT Id AS "user_link", (SELECT COUNT(TotalRep) FROM (SELECT SUM(CASE Votes.VoteTypeId WHEN 1 THEN 15 WHEN 2 THEN 10 WHEN 9 THEN BountyAmount END) AS TotalRep, Votes.CreationDate AS CreationDate FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.OwnerUserId = U.Id AND Posts.CommunityOwnedDate IS NULL ... |
CREATE TABLE table_29399 (
"Model Number" text,
"Frequency" text,
"L2 Cache" text,
"HT" text,
"Mult. 1" text,
"V Core" text,
"TDP" text,
"Socket" text,
"Release Date" text,
"Part Number(s)" text
) | Name the number of v core for model number mobile athlon 64 3000+ | SELECT COUNT("V Core") FROM table_29399 WHERE "Model Number" = 'Mobile Athlon 64 3000+' |
CREATE TABLE table_75070 (
"Rank" real,
"Country/Territory" text,
"Nuestra Belleza Latina" real,
"1st runner-up" real,
"2nd runner-up" real,
"3rd runner-up" real,
"4th runner-up" real,
"5th runner-up" real,
"6th runner-up" real,
"7th runner-up" real,
"8th runner-up" real,
... | What is the 7th runner-up of the country with a 10th runner-up greater than 0, a 9th runner-up greater than 0, and an 8th runner-up greater than 1? | SELECT SUM("7th runner-up") FROM table_75070 WHERE "10th runner-up" > '0' AND "9th runner-up" > '0' AND "8th runner-up" > '1' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | count the number of patients whose insurance is private and year of birth is less than 1887? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dob_year < "1887" |
CREATE TABLE table_name_59 (
country VARCHAR,
city VARCHAR
) | Where is the City of Douala? | SELECT country FROM table_name_59 WHERE city = "douala" |
CREATE TABLE table_4612 (
"Rank" real,
"Heat (Lane)" text,
"Name" text,
"Nationality" text,
"Time" text
) | Which heat and lane was in rank of 22? | SELECT "Heat (Lane)" FROM table_4612 WHERE "Rank" = '22' |
CREATE TABLE table_5482 (
"# 100" real,
"Season" text,
"Playing For" text,
"Against" text,
"Score" text
) | Which sum of # 100 has a Season of 1990, and an Against of warwickshire? | SELECT SUM("# 100") FROM table_5482 WHERE "Season" = '1990' AND "Against" = 'warwickshire' |
CREATE TABLE table_49190 (
"Event" text,
"Time" text,
"Name" text,
"Nation" text,
"Games" text,
"Date" text
) | On what date was the record set with a time of 1:07.18? | SELECT "Date" FROM table_49190 WHERE "Time" = '1:07.18' |
CREATE TABLE table_17335602_1 (
date VARCHAR,
tournament VARCHAR
) | When was the mcdonald's lpga championship? | SELECT date FROM table_17335602_1 WHERE tournament = "McDonald's LPGA Championship" |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Descr... | popular db access programming languages. | SELECT COUNT(DISTINCT P.Id) AS num_questions, t_dbname.TagName FROM Posts AS P INNER JOIN PostTags AS pt ON pt.PostId = P.Id INNER JOIN Tags AS t_lang ON t_lang.Id = pt.TagId INNER JOIN PostTags AS pt_db ON pt_db.PostId = P.Id INNER JOIN Tags AS t_dbname ON t_dbname.Id = pt_db.TagId WHERE t_lang.TagName IN ('c++', 'jav... |
CREATE TABLE table_9522 (
"Name" text,
"Nationality" text,
"Position [F ]" text,
"Date from [G ]" text,
"Date to [H ]" text,
"Appearances" real,
"Goals" real,
"Club source [I ]" text
) | What is Appearances, when Postion [F ] is 'Defender', and when Date to [H ] is '1938'? | SELECT "Appearances" FROM table_9522 WHERE "Position [F ]" = 'defender' AND "Date to [H ]" = '1938' |
CREATE TABLE table_name_51 (
meg_whitman__r_ VARCHAR,
date_s__administered VARCHAR
) | What percent of the vote went to Meg Whitman in the poll taken on October 21, 2010. | SELECT meg_whitman__r_ FROM table_name_51 WHERE date_s__administered = "october 21, 2010" |
CREATE TABLE table_203_568 (
id number,
"town/village" text,
"population" number,
"postal code" text,
"municipality" text,
"island" text,
"location" text
) | how many towns or villages have a population of at least 5 but less than 10 ? | SELECT COUNT("town/village") FROM table_203_568 WHERE "population" >= 5 AND "population" < 10 |
CREATE TABLE table_23399481_3 (
original_air_date VARCHAR,
season__number VARCHAR
) | What is the original air date for episode 4? | SELECT original_air_date FROM table_23399481_3 WHERE season__number = 4 |
CREATE TABLE table_11041 (
"Drobo (1st)" text,
"Drobo (2nd)" text,
"Drobo S" text,
"Drobo S (2nd)" text,
"Drobo FS" text,
"Drobo Mini" text,
"Drobo 5D" text
) | Which Drobo (2nd) has a Drobo S (2nd) of 5? | SELECT "Drobo (2nd)" FROM table_11041 WHERE "Drobo S (2nd)" = '5' |
CREATE TABLE table_name_52 (
hong_kong INTEGER,
brisbane VARCHAR,
kuala_lumpur VARCHAR
) | What is the lowest Hong Kong value with a 0 Brisbane value and a greater than 0 Kuala Lumpur value? | SELECT MIN(hong_kong) FROM table_name_52 WHERE brisbane = 0 AND kuala_lumpur > 0 |
CREATE TABLE table_11658094_3 (
nickname VARCHAR,
enrollment VARCHAR
) | What is the nickname of the school with an enrollment of 2386? | SELECT nickname FROM table_11658094_3 WHERE enrollment = 2386 |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | was there any medicine prescribed since 176 months ago for patient 021-141335? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-141335')) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_T... |
CREATE TABLE ship (
ship_id number,
name text,
type text,
built_year number,
class text,
flag text
)
CREATE TABLE captain (
captain_id number,
name text,
ship_id number,
age text,
class text,
rank text
) | Find the name of the ship that is steered by the youngest captain. | SELECT t1.name FROM ship AS t1 JOIN captain AS t2 ON t1.ship_id = t2.ship_id ORDER BY t2.age LIMIT 1 |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | how many hours has it been since the last time carvedilol 6.25 mg po tabs was prescribed to patient 010-16572 in the current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', medication.drugstarttime)) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-16... |
CREATE TABLE table_203_374 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | who has the most bronze medals ? | SELECT "nation" FROM table_203_374 ORDER BY "bronze" DESC LIMIT 1 |
CREATE TABLE table_275023_1 (
province VARCHAR,
formed_from VARCHAR
) | What provinces were formed from New Munster? | SELECT province FROM table_275023_1 WHERE formed_from = "New Munster" |
CREATE TABLE table_25816476_2 (
team_guest_captain VARCHAR,
episode VARCHAR
) | Who was the team guest captain for episode 2? | SELECT team_guest_captain FROM table_25816476_2 WHERE episode = 2 |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | provide the number of patients whose insurance is medicaid and procedure long title is combined right and left heart angiocardiography? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "Combined right and left heart angiocardiography" |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
c... | Show the account id and the number of transactions for each accoun. Show scatter chart. | SELECT account_id, COUNT(*) FROM Financial_Transactions GROUP BY account_id |
CREATE TABLE finrev_fed_17 (
state_code number,
idcensus number,
school_district text,
nces_id text,
yr_data number,
t_fed_rev number,
c14 number,
c25 number
)
CREATE TABLE finrev_fed_key_17 (
state_code number,
state text,
#_records text
)
CREATE TABLE ndecoreexcel_math_gr... | For each state, when was the last time the average score data was collected? | SELECT state, MAX(year) FROM ndecoreexcel_math_grade8 GROUP BY state |
CREATE TABLE table_79632 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text,
"Arena" text,
"Points" real
) | What is the Record of the game with an Attendance of more than 16,124 and a Score of 6 3? | SELECT "Record" FROM table_79632 WHERE "Attendance" > '16,124' AND "Score" = '6–3' |
CREATE TABLE table_30216 (
"District" text,
"Status" text,
"Date abolished" text,
"Former county" text,
"Successor" text
) | What are the former counties of the Great Grimsby district? | SELECT "Former county" FROM table_30216 WHERE "District" = 'Great Grimsby' |
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... | provide the number of patients whose insurance is government and procedure short title is open reduc-int fix femur? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Open reduc-int fix femur" |
CREATE TABLE table_78928 (
"Elector" text,
"Place of birth" text,
"Cardinalatial title" text,
"Elevated" text,
"Elevator" text
) | What Elector was Elevated on December 18, 1182? | SELECT "Elector" FROM table_78928 WHERE "Elevated" = 'december 18, 1182' |
CREATE TABLE table_31108 (
"Rank 2011" real,
"Country" text,
"Production in 2011 (1,000 ton)" real,
"Share 2011" text,
"Rank 2010" real,
"Production in 2010 (1,000 ton)" real
) | When sweden is the country what is the highest production in 2010 (1,000 ton)? | SELECT MAX("Production in 2010 (1,000 ton)") FROM table_31108 WHERE "Country" = 'Sweden' |
CREATE TABLE table_name_63 (
year_of_recording INTEGER,
orchestra VARCHAR,
record_company VARCHAR
) | What is the oldest year that the Royal Philharmonic Orchestra released a record with Decca Records? | SELECT MIN(year_of_recording) FROM table_name_63 WHERE orchestra = "royal philharmonic orchestra" AND record_company = "decca records" |
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 (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | Among the patients born before the year 2056, how many of them had the lab test for other body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2056" AND lab.fluid = "Other Body Fluid" |
CREATE TABLE table_25348 (
"County" text,
"Population" real,
"Unemployment Rate" text,
"Market Income Per Capita" text,
"Poverty Rate" text,
"Status" text
) | How many counties have a population of 2266? | SELECT COUNT("County") FROM table_25348 WHERE "Population" = '2266' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
... | patient 030-34260 has received a diagnosis in their current hospital encounter? | 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 = '030-34260' AND patient.hospitaldischargetime IS NULL)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.