table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_32900 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | When was the Browns' game that over 36,796 attended? | SELECT "Date" FROM table_32900 WHERE "Attendance" > '36,796' |
CREATE TABLE table_31641 (
"Census year" real,
"Total" real,
"Macedonians" real,
"Albanians" real,
"Turks" real,
"Roma" real,
"Vlachs" real,
"Serbs" real,
"Bosniaks" real,
"Other" real
) | Tell me the highest bosniaks for year more than 2002 | SELECT MAX("Bosniaks") FROM table_31641 WHERE "Census year" > '2002' |
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... | show the date of birth and insurance type of lawrence wibbens. | SELECT demographic.dob, demographic.insurance FROM demographic WHERE demographic.name = "Lawrence Wibbens" |
CREATE TABLE table_name_72 (
top_5 INTEGER,
tournament VARCHAR,
cuts_made VARCHAR
) | What is the average Top-5, when Tournament is U.S. Open, and when Cuts Made is greater than 10? | SELECT AVG(top_5) FROM table_name_72 WHERE tournament = "u.s. open" AND cuts_made > 10 |
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
) | For each manufacturer name, what are the names and prices of their most expensive product? | SELECT T1.name, MAX(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name |
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... | A bar chart shows the distribution of All_Home and the average of Team_ID , and group by attribute All_Home, rank by the y-axis from low to high. | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(Team_ID) |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purc... | only show CO flights | SELECT DISTINCT flight_id FROM flight WHERE airline_code = 'CO' |
CREATE TABLE table_11058 (
"Year" real,
"Competition" text,
"Date" text,
"Surface" text,
"Location" text,
"Score" text,
"Result" text
) | Which competition has a Year of 2008, a Surface of carpet, and a Date of 31 jan? | SELECT "Competition" FROM table_11058 WHERE "Year" = '2008' AND "Surface" = 'carpet' AND "Date" = '31 jan' |
CREATE TABLE table_name_18 (
crowd INTEGER,
home_team VARCHAR
) | What was the smallest crowd that Melbourne played for at home? | SELECT MIN(crowd) FROM table_name_18 WHERE home_team = "melbourne" |
CREATE TABLE table_68979 (
".308 Winchester cartridge type" text,
"100 m group (mm)" text,
"100 m group ( MOA )" text,
"300 m group (mm)" text,
"300 m group ( MOA )" text
) | Which of the .308 Winchester cartridge type has a 100 m group of 14 and also a 300 m group of 0.63? | SELECT ".308 Winchester cartridge type" FROM table_68979 WHERE "100 m group (mm)" = '14' AND "300 m group ( MOA )" = '0.63' |
CREATE TABLE table_1745843_7 (
part_4 VARCHAR,
part_3 VARCHAR
) | What's the part 4 for the verb whose part 3 is borgen? | SELECT part_4 FROM table_1745843_7 WHERE part_3 = "borgen" |
CREATE TABLE table_name_18 (
width INTEGER,
frame_size VARCHAR,
height VARCHAR
) | What is the smallest width for a frame size of 5k and a height shorter than 2700? | SELECT MIN(width) FROM table_name_18 WHERE frame_size = "5k" AND height < 2700 |
CREATE TABLE table_63918 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the Total number of medals for the Nation with 7 or less Bronze medals and 1 Silver medal with a Rank of 9 or larger? | SELECT MIN("Total") FROM table_63918 WHERE "Bronze" < '7' AND "Silver" = '1' AND "Rank" > '9' |
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... | Visualize the relationship between Height and Weight , and group by attribute Sex. | SELECT Height, Weight FROM people GROUP BY Sex |
CREATE TABLE table_65441 (
"Position" text,
"Drivers" text,
"Entrant" text,
"Class" text,
"Laps" real
) | For what class is the laps 66? | SELECT "Class" FROM table_65441 WHERE "Laps" = '66' |
CREATE TABLE manufacturers (
code VARCHAR,
name VARCHAR
)
CREATE TABLE products (
name VARCHAR
) | Find number of products which Sony does not make. | SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony') |
CREATE TABLE table_203_506 (
id number,
"opponent" text,
"played" number,
"won" number,
"lost" number,
"drawn" number,
"% won overall" text
) | name two countries that the england women 's rfu have played above thirty games against . | SELECT "opponent" FROM table_203_506 WHERE "played" >= 30 |
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 intakeoutput (
intakeo... | during this month has patient 012-4131 received a potassium test? | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-4131')) AND lab.labname = 'potassium' AND DATETIME(lab.labresulttime, 'start of mont... |
CREATE TABLE table_73783 (
"Song" text,
"Singer" text,
"Co-Singers" text,
"Music Director" text,
"Lyricist" text,
"Co-Stars" text,
"Movie/Album" text,
"Year" real,
"Additional Info" text
) | What movie did Bela Bose co-star in? | SELECT "Movie/Album" FROM table_73783 WHERE "Co-Stars" = 'Bela Bose' |
CREATE TABLE table_36730 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text
) | Who is the Incumbent that has a District of ohio 13 in Democratic Party? | SELECT "Incumbent" FROM table_36730 WHERE "District" = 'ohio 13' |
CREATE TABLE table_69011 (
"Year" text,
"Venue" text,
"Winners" text,
"Runner-up" text,
"3rd place" text
) | What shows for 3rd place when Runner-up shows as runner-up? | SELECT "3rd place" FROM table_69011 WHERE "Runner-up" = 'runner-up' |
CREATE TABLE table_name_96 (
fifth VARCHAR,
sixth VARCHAR,
second VARCHAR,
first VARCHAR
) | What team placed fifth during the season where Victoria placed second, Tasmania placed first, and South Australia placed sixth? | SELECT fifth FROM table_name_96 WHERE second = "victoria" AND first = "tasmania" AND sixth = "south australia" |
CREATE TABLE table_18620 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the first elected with candidates being joe starnes (d) 100.0% george bogus ( w/i ) 0.003% | SELECT "First elected" FROM table_18620 WHERE "Candidates" = 'Joe Starnes (D) 100.0% George Bogus ( W/I ) 0.003%' |
CREATE TABLE table_67936 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What was the 2009 result associated with a 2012 of 1R and a 2007 of 2R? | SELECT "2009" FROM table_67936 WHERE "2012" = '1r' AND "2007" = '2r' |
CREATE TABLE table_name_24 (
away_team VARCHAR,
venue VARCHAR
) | What away team played at Kardinia Park? | SELECT away_team FROM table_name_24 WHERE venue = "kardinia park" |
CREATE TABLE table_1602858_1 (
margin_of_victory VARCHAR,
winning_score VARCHAR
) | What was the margin of victory with the winning score '63-68-68-68=267'? | SELECT margin_of_victory FROM table_1602858_1 WHERE winning_score = 63 - 68 - 68 - 68 = 267 |
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id ... | Return a bar chart on what are the id and name of the mountains that have at least 2 photos?, and could you order in desc by the id please? | SELECT T1.name, T1.id FROM mountain AS T1 JOIN photos AS T2 ON T1.id = T2.mountain_id ORDER BY T1.id DESC |
CREATE TABLE table_54857 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | Tell me the college that paul davis went to | SELECT "College" FROM table_54857 WHERE "Player" = 'paul davis' |
CREATE TABLE table_76671 (
"Driver" text,
"Team" text,
"Race 1" text,
"Race 2" text,
"Points" real
) | Which team received 4 in race 1? | SELECT "Team" FROM table_76671 WHERE "Race 1" = '4' |
CREATE TABLE table_44781 (
"Year" real,
"Month" text,
"Single" text,
"Album" text,
"Record label" text
) | What's the earliest year listed for 'where are you going to my love' from the album united we stand? | SELECT MIN("Year") FROM table_44781 WHERE "Album" = 'united we stand' AND "Single" = 'where are you going to my love' |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEG... | Find the number of male students (with sex M) from each city in a bar chart. | SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code |
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 program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | For the COMM 311 course , what are the morning times ? | SELECT DISTINCT course_offering.end_time, course_offering.start_time, semester.semester, semester.year FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'COMM' AND cou... |
CREATE TABLE table_name_16 (
member VARCHAR,
electorate VARCHAR
) | Which member has Cook as the electorate? | SELECT member FROM table_name_16 WHERE electorate = "cook" |
CREATE TABLE table_name_4 (
soap_opera VARCHAR,
duration VARCHAR,
character VARCHAR
) | what is the soap opera when the duration is 18 years and the character is miley byrne? | SELECT soap_opera FROM table_name_4 WHERE duration = "18 years" AND character = "miley byrne" |
CREATE TABLE ndecoreexcel_math_grade8 (
year number,
state text,
all_students text,
average_scale_score number
)
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
... | How much federal funding does Pecatonia Area School district get? | SELECT t_fed_rev FROM finrev_fed_17 WHERE school_district LIKE "%Pecatonia Area%" |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal... | 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 average of salary , and group by attribute job_id, sort by the JOB_ID from low to high. | SELECT JOB_ID, AVG(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID |
CREATE TABLE table_12496 (
"Lexton Plains" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | Which against has 14 losses? | SELECT "Against" FROM table_12496 WHERE "Losses" = '14' |
CREATE TABLE table_7184 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | What is HDTV, when Content is Cinema, when Package/Option is Sky Cinema + Sky HD, and when Television Service is Sky Cinema Passion HD? | SELECT "HDTV" FROM table_7184 WHERE "Content" = 'cinema' AND "Package/Option" = 'sky cinema + sky hd' AND "Television service" = 'sky cinema passion hd' |
CREATE TABLE table_59052 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To Par" text
) | Which Score has a To Par of 1? | SELECT MIN("Score") FROM table_59052 WHERE "To Par" = '–1' |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | what has been patient 027-120551's allergies? | SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-120551')) |
CREATE TABLE table_name_20 (
fumble_force VARCHAR,
solo VARCHAR,
player VARCHAR
) | How many forced fumbles for jim laney with under 2 solo tackles? | SELECT COUNT(fumble_force) FROM table_name_20 WHERE solo < 2 AND player = "jim laney" |
CREATE TABLE table_204_13 (
id number,
"finished" text,
"post" number,
"horse" text,
"jockey" text,
"trainer" text,
"owner" text,
"time / behind" text
) | what is the name of the top horse 's trainer ? | SELECT "trainer" FROM table_204_13 ORDER BY "finished" LIMIT 1 |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | Who has friends that are older than the average age? Print their name and their ages as well using a bar chart, and list by the X in ascending. | SELECT T1.name, T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age > (SELECT AVG(age) FROM Person) ORDER BY T1.name |
CREATE TABLE table_name_98 (
nation VARCHAR,
rank VARCHAR,
gold VARCHAR,
bronze VARCHAR
) | What is the nation when gold is 0, bronze is more than 0 and rank is 16? | SELECT nation FROM table_name_98 WHERE gold = 0 AND bronze > 0 AND rank = "16" |
CREATE TABLE table_name_42 (
location VARCHAR,
record VARCHAR
) | What was the location of the fight when Sara McMann's record was 1-0? | SELECT location FROM table_name_42 WHERE record = "1-0" |
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... | how many patient have died after they were diagnosed with hematological effect of infection - leukocytosis during the same hospital encounter until 2 years ago? | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime, t1.patienthealthsystemstayid FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = ... |
CREATE TABLE table_35272 (
"7:00" text,
"7:30" text,
"8:00" text,
"8:30" text,
"9:00" text,
"9:30" text,
"10:00" text,
"10:30" text
) | What is the 9:00 show that will be aired on the station that airs Dawson's Creek at 8:00? | SELECT "9:00" FROM table_35272 WHERE "8:00" = 'dawson''s creek' |
CREATE TABLE table_29106 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer" text,
"Original air date" text
) | Who wrote 'Monica's bad day'? | SELECT "Writer" FROM table_29106 WHERE "Title" = 'Monica''s Bad Day' |
CREATE TABLE table_203_250 (
id number,
"name" text,
"type" text,
"r.a. (j2000)" text,
"dec. (j2000)" text,
"redshift (km/s)" text,
"apparent magnitude" number
) | what number of irregular types are there ? | SELECT COUNT(*) FROM table_203_250 WHERE "type" = 'irregular' |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Suggested edits by a specific user. | SELECT Id AS "suggested_edit_link" FROM SuggestedEdits WHERE OwnerUserId = '##UserId##' |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
... | how many times did patient 021-196241 during this year go to the icu? | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-196241') AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') |
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
)
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
) | Give me a pie to show how many country from different country. | SELECT Country, COUNT(Country) FROM member GROUP BY Country |
CREATE TABLE table_train_57 (
"id" int,
"bleeding" int,
"in_another_study" bool,
"hiv_infection" bool,
"hepatitis_c_infection" bool,
"receiving_vasopressor" bool,
"hypotension" bool,
"NOUSE" float
) | hypotension requiring vasopressor therapy, despite fluid resuscitation of at least 30 cc / kg and lactate > 2 mmol / l | SELECT * FROM table_train_57 WHERE hypotension = 1 AND receiving_vasopressor = 1 |
CREATE TABLE table_26448179_4 (
title VARCHAR,
production_code VARCHAR
) | What is the title of the episode with production code 305? | SELECT title FROM table_26448179_4 WHERE production_code = 305 |
CREATE TABLE organizations (
organization_id number,
date_formed time,
organization_name text,
uk_vat_number text
)
CREATE TABLE organization_contact_individuals (
individual_id number,
organization_id number,
date_contact_from time,
date_contact_to time
)
CREATE TABLE addresses (
... | Find the payment method and phone of the party with email 'enrico09@example.com'. | SELECT payment_method_code, party_phone FROM parties WHERE party_email = "enrico09@example.com" |
CREATE TABLE table_58211 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | What is the NBA draft result of the player from Dunbar High School? | SELECT "NBA Draft" FROM table_58211 WHERE "School" = 'dunbar high school' |
CREATE TABLE table_name_34 (
player VARCHAR,
college VARCHAR
) | What player belongs to Northwestern College? | SELECT player FROM table_name_34 WHERE college = "northwestern" |
CREATE TABLE table_204_881 (
id number,
"round" number,
"date" text,
"score" text,
"opponent" text,
"opponent's score" text,
"result" text,
"venue" text,
"attendance" number,
"best on ground" text,
"team" text
) | who was the opponent after hawthorn ? | SELECT "opponent" FROM table_204_881 WHERE id = (SELECT id FROM table_204_881 WHERE "opponent" = 'hawthorn') + 1 |
CREATE TABLE table_16891 (
"Name of ground" text,
"Location" text,
"First-class span" text,
"Worcs f-c matches" real,
"List A span" text,
"Worcs LA matches" real
) | There were 68 worcs f-c matches played on Chester Road North Ground. | SELECT "Worcs f-c matches" FROM table_16891 WHERE "Name of ground" = 'Chester Road North Ground' |
CREATE TABLE table_204_558 (
id number,
"name" text,
"location" text,
"city" text,
"listing date" text
) | what is the total number of locations in the city of algonac ? | SELECT COUNT("location") FROM table_204_558 WHERE "city" = 'algonac' |
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... | i would like to find a flight from PITTSBURGH to BOSTON on wednesday and i have to be in BOSTON by one so i'd like a flight out of here no later than 1100 | 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 (((flight.arrival_time <= 1300 AND flight.departure_time <= 1100) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = ... |
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 are the course numbers Dr. William Gehring is teaching next semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%William Gehring%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o... |
CREATE TABLE table_4223 (
"Quartier" text,
"% 0-19 years" text,
"% 20-39 years" text,
"% 40-59 years" text,
"% 60-74 years" text,
"% 75 years and +" text
) | How many o-19% are where the quartier is in saint-loup? | SELECT "% 0-19 years" FROM table_4223 WHERE "Quartier" = 'Saint-Loup' |
CREATE TABLE table_204_500 (
id number,
"year" number,
"title" text,
"peak chart positions\nus country" number,
"peak chart positions\nus" number,
"album" text
) | how many singles did kitty wells release before 1952 ? | SELECT COUNT("title") FROM table_204_500 WHERE "year" < 1952 |
CREATE TABLE table_name_74 (
position VARCHAR,
player VARCHAR
) | What position is Jeff Brown? | SELECT position FROM table_name_74 WHERE player = "jeff brown" |
CREATE TABLE table_name_54 (
goals VARCHAR,
score VARCHAR
) | Tell me the goals for score of 38-28 | SELECT goals FROM table_name_54 WHERE score = "38-28" |
CREATE TABLE table_204_48 (
id number,
"date" text,
"race name" text,
"location" text,
"uci rating" text,
"winner" text,
"team" text
) | who won more races , the usa or canada ? | SELECT "winner" FROM table_204_48 WHERE "winner" IN ('usa', 'canada') GROUP BY "winner" ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_26758 (
"Player" text,
"Group Legs won" real,
"Play-Off Legs won" real,
"Winners Group Legs won" real,
"Winners Play-Off Legs won" real,
"Final position money won*" text,
"Total money won" text
) | What is the highest amount of group legs won when the prize money was 21,850? | SELECT MAX("Winners Group Legs won") FROM table_26758 WHERE "Total money won" = '£21,850' |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate ti... | Average Reputation of SO Users n Manchester, United Kingdom. | SELECT AVG(Reputation) AS "average_reputation", COUNT(Id) AS "total_users" FROM Users WHERE LOWER(Location) LIKE '%manchester, united kingdom' AND Reputation > 1 |
CREATE TABLE table_name_12 (
gold VARCHAR,
total VARCHAR,
silver VARCHAR,
nation VARCHAR
) | Tell me the number of gold for albania with a silver of 1 and total less than 1 | SELECT COUNT(gold) FROM table_name_12 WHERE silver = 1 AND nation = "albania" AND total < 1 |
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 born before the year 2094 have diagnosis short title anemia in chronic kidney disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2094" AND diagnoses.short_title = "Anemia in chr kidney dis" |
CREATE TABLE table_55082 (
"Season" text,
"Club" text,
"National League" text,
"National Cup" text,
"European Cup" text
) | What is the club that has the turkish basketball cup and fiba eurochallenge (3rd tier)? | SELECT "Club" FROM table_55082 WHERE "National Cup" = 'turkish basketball cup' AND "European Cup" = 'fiba eurochallenge (3rd tier)' |
CREATE TABLE table_name_38 (
population INTEGER,
name_of_city VARCHAR
) | What is the population of Chimbote? | SELECT SUM(population) FROM table_name_38 WHERE name_of_city = "chimbote" |
CREATE TABLE table_name_51 (
winning_score VARCHAR,
year VARCHAR
) | What was the winning score in 1980? | SELECT winning_score FROM table_name_51 WHERE year = 1980 |
CREATE TABLE premises (
premises_type VARCHAR
) | Show each premise type and the number of premises in that type. | SELECT premises_type, COUNT(*) FROM premises GROUP BY premises_type |
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 PostHistoryTypes (
Id number,
Name te... | How many questions & answers last edited by Mat(635608) in a time range. | SELECT COUNT(*) FROM Posts WHERE LastEditorUserId = 635608 AND OwnerUserId != 635608 AND LastEditDate > '2013-05-03 12:00:00 AM' |
CREATE TABLE table_14062 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | What is the total number of positions having 1 loss and more than 9 conceded? | SELECT COUNT("Position") FROM table_14062 WHERE "Losses" = '1' AND "Conceded" > '9' |
CREATE TABLE table_3594 (
"Team" text,
"Manager" text,
"Chairman" text,
"Team captain" text,
"Kit maker" text,
"Sponsor" text
) | Who is the chairman of Mark Robins team? | SELECT "Chairman" FROM table_3594 WHERE "Manager" = 'Mark Robins' |
CREATE TABLE table_62794 (
"Name" text,
"Population (2011)" real,
"Population (2006)" real,
"Change (%)" real,
"Land area (km\u00b2)" real,
"Population density (per km\u00b2)" real
) | Which Land area (km ) has a Population density (per km ) larger than 112.6, and a Population (2006) larger than 785, and a Name of pinehouse? | SELECT MAX("Land area (km\u00b2)") FROM table_62794 WHERE "Population density (per km\u00b2)" > '112.6' AND "Population (2006)" > '785' AND "Name" = 'pinehouse' |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime ti... | what percentile is red blood cells 3.61 among patients of the same age as patient 15209 during their current hospital visit? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissio... |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | how many times did patient 005-46456 receive surgery consultation in 2104? | SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-46456')) AND treatment.treatmentname = 'surgery consultation' AND STRFTIME('... |
CREATE TABLE table_name_14 (
record VARCHAR,
location VARCHAR,
visitor VARCHAR
) | What record has montreal, qc as the location, with boston bruins as the visitor? | SELECT record FROM table_name_14 WHERE location = "montreal, qc" AND visitor = "boston bruins" |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | Find coincident activity between two users. | WITH Interesting(UserId) AS (SELECT 342852 UNION ALL SELECT 57611) SELECT PostId = p.Id, QuestionId = COALESCE(a.Id, p.Id), AnswerId = CASE WHEN p.PostTypeId = 2 THEN p.Id ELSE NULL END FROM Posts AS p LEFT JOIN Posts AS a ON p.PostTypeId = 2 AND p.ParentId = a.Id WHERE EXISTS(SELECT * FROM Interesting AS i WHERE p.Own... |
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 with primary disease bowel obstruction died in or before 2174? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.dod_year <= "2174.0" |
CREATE TABLE table_21020 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"GPU frequency" text,
"L2 cache" text,
"I/O bus" text,
"Memory" text,
"Voltage" text,
"TDP" text,
"Socket" text,
"Release date" text,
"Part number(s)" text,
"Release price ( USD )" ... | Name the memory for meodel number for atom e640t | SELECT "Memory" FROM table_21020 WHERE "Model number" = 'Atom E640T' |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Plays_Games (
StuID INTEGER,
GameID INTEGER,
Hours_Played INTEGER
)
CREATE TABLE Video_Games (
Ga... | Visualize a bar chart for how many students play each sport?, and show total number from low to high order. | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY COUNT(*) |
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
)
... | how many patients have anemia in chronic kidney disease as their diagnosis long title? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Anemia in chronic kidney disease" |
CREATE TABLE table_77441 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
) | What is the Game site week 1? | SELECT "Game site" FROM table_77441 WHERE "Week" = '1' |
CREATE TABLE table_name_70 (
rank INTEGER,
gold INTEGER
) | What is the rank where the gold is 0? | SELECT AVG(rank) FROM table_name_70 WHERE gold < 0 |
CREATE TABLE table_name_72 (
sample_size INTEGER,
date VARCHAR,
margin_of_error VARCHAR
) | What was the sample size for the poll from Nov 9-11, 2007 with a margin of error less than 4.3? | SELECT MAX(sample_size) FROM table_name_72 WHERE date = "nov 9-11, 2007" AND margin_of_error < 4.3 |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
... | what is patient 22295's yearly maximum level of glucose? | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22295) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') GROUP BY STRFTIME('%y', labevents.charttime) |
CREATE TABLE table_name_73 (
score VARCHAR,
player VARCHAR
) | What is the score for Billy Andrade? | SELECT score FROM table_name_73 WHERE player = "billy andrade" |
CREATE TABLE table_64419 (
"School" text,
"Location" text,
"Mascot" text,
"Size" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
) | Which IHSAA class has a mascot of the Raiders? | SELECT "IHSAA Class" FROM table_64419 WHERE "Mascot" = 'raiders' |
CREATE TABLE table_20032 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"For" real,
"Against" real,
"Difference" real
) | How many under the category of Against have a Difference of 11 | SELECT COUNT("Against") FROM table_20032 WHERE "Difference" = '11' |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
... | Users by Downvotes (top 100). | SELECT * FROM Users ORDER BY DownVotes DESC LIMIT 100 |
CREATE TABLE table_18820 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what's the game with date being march 7 | SELECT "Game" FROM table_18820 WHERE "Date" = 'March 7' |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABL... | what are the four most frequently ordered laboratory tests for patients of age 20s? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 20 AND 29) GROUP BY labevents.itemid) AS ... |
CREATE TABLE table_2155 (
"Country" text,
"1948/49 ($ millions)" real,
"1949/50 ($ millions)" real,
"1950/51 ($ millions)" real,
"Cumulative ($ millions)" real
) | What's the 1949/50 expenditure (in $ millions) in the country where the 1948/49 expenditure was 232$ millions? | SELECT MAX("1949/50 ($ millions)") FROM table_2155 WHERE "1948/49 ($ millions)" = '232' |
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 the number of patients who died on or before 2148 that had complete heart block as their primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dod_year <= "2148.0" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
... | what were the five most frequent drugs that were prescribed within 2 months to the hypotension / pressor dependent female patients with age 30s after they have been diagnosed with hypotension / pressor dependent, this year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypotension / pressor dependent' AND DATETIME(diag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.