table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_61688 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What was the attendance on September 19, 1971, after week 1? | SELECT AVG("Attendance") FROM table_61688 WHERE "Date" = 'september 19, 1971' AND "Week" > '1' |
CREATE TABLE table_57570 (
"Coach" text,
"Season" text,
"Record" text,
"Home" text,
"Away" text,
"Win %" real,
"Average (Total) Home Attendance" text
) | What is the lowest win% in the 1999-2013 season? | SELECT MIN("Win %") FROM table_57570 WHERE "Season" = '1999-2013' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | calculate the maximum days for which patients who died before 2164 stayed in hospital. | SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.dod_year < "2164.0" |
CREATE TABLE table_11391954_3 (
Half VARCHAR,
country VARCHAR
) | Whatis the total number of half marathon (mens) that represented kazakhstan? | SELECT COUNT(Half) AS marathon__mens_ FROM table_11391954_3 WHERE country = "Kazakhstan" |
CREATE TABLE gas_station (
LOCATION VARCHAR
) | Show all locations and the number of gas stations in each location ordered by the count. | SELECT LOCATION, COUNT(*) FROM gas_station GROUP BY LOCATION ORDER BY COUNT(*) |
CREATE TABLE table_11964154_9 (
game INTEGER,
high_points VARCHAR
) | what is the maximum game where high points is micka l gelabale (21) | SELECT MAX(game) FROM table_11964154_9 WHERE high_points = "Mickaël Gelabale (21)" |
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 average age of patients whose insurance is private and discharge location is rehab/distinct part hosp? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.discharge_location = "REHAB/DISTINCT PART HOSP" |
CREATE TABLE table_29283 (
"Position" real,
"Building" text,
"City" text,
"Height" text,
"Number of floors" real,
"Completion" real
) | How many positions does building Costanera Center Torre 1 have? | SELECT COUNT("Position") FROM table_29283 WHERE "Building" = 'Costanera Center Torre 1' |
CREATE TABLE table_2517159_1 (
record VARCHAR,
name_of_bowl VARCHAR
) | Name the record for cotton bowl classic | SELECT record FROM table_2517159_1 WHERE name_of_bowl = "Cotton Bowl Classic" |
CREATE TABLE table_204_102 (
id number,
"name" text,
"location served" text,
"governorate" text,
"utilization" text,
"helipads" number,
"runways" number,
"shelters" number,
"squadrons" text,
"coordinates" text
) | the total number of helipads at hama military airport ? | SELECT "helipads" FROM table_204_102 WHERE "name" = 'hama military airport' |
CREATE TABLE table_16767 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | What is the name of the race in the Modena circuit? | SELECT "Race Name" FROM table_16767 WHERE "Circuit" = 'Modena' |
CREATE TABLE table_2062148_3 (
race VARCHAR,
distance VARCHAR
) | What race has a distance of 1200 m? | SELECT race FROM table_2062148_3 WHERE distance = "1200 m" |
CREATE TABLE table_66431 (
"Millewa" text,
"Wins" real,
"Forfeits" real,
"Losses" real,
"Draws" real,
"Against" real
) | How many Losses have Draws larger than 0? | SELECT MAX("Losses") FROM table_66431 WHERE "Draws" > '0' |
CREATE TABLE table_28453 (
"Episode #" text,
"Season Episode #" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Prod. code" text
) | How many directors were there for season 3 episode 1? | SELECT COUNT("Directed by") FROM table_28453 WHERE "Season Episode #" = '1' |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE i... | when did patient 010-32698 have his or her last surgical procedure? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32698')) ORDER BY treatment.treatmenttime 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... | Give me the comparison about All_Games_Percent over the ACC_Regular_Season , and I want to display by the Y in desc. | SELECT ACC_Regular_Season, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | Fastest users to get to X rep. Fastest user to reach a certain rep score. | SELECT * FROM VoteTypes |
CREATE TABLE table_51595 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | Which city has the ICAO of LIRF? | SELECT "City" FROM table_51595 WHERE "ICAO" = 'lirf' |
CREATE TABLE table_46426 (
"Finished" real,
"Time/ Behind" text,
"Post" real,
"Horse" text,
"Jockey" text,
"Trainer" text,
"Owner" text
) | What is Owner, when Finished is less than 15, when Trainer is 'Steve Asmussen', and when Horse is 'Z Fortune'? | SELECT "Owner" FROM table_46426 WHERE "Finished" < '15' AND "Trainer" = 'steve asmussen' AND "Horse" = 'z fortune' |
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
)
... | find out the number of greek orthodox religious background patients with lab test item id 51288. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "GREEK ORTHODOX" AND lab.itemid = "51288" |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
... | i would like to book an early morning flight from TAMPA to CHARLOTTE on 4 6 | 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 = 'CHARLOTTE' AND date_day.day_number = 6 AND date_day.month_number = 4 AND... |
CREATE TABLE table_60820 (
"Player" text,
"Position" text,
"Ekstraklasa" real,
"Polish Cup" real,
"Puchat Ligi" real,
"UEFA Cup" real,
"Total" real
) | Which Puchat Ligi has a UEFA Cup smaller than 2, and a Player of takesure chinyama? | SELECT MIN("Puchat Ligi") FROM table_60820 WHERE "UEFA Cup" < '2' AND "Player" = 'takesure chinyama' |
CREATE TABLE table_44082 (
"School" text,
"Conference" text,
"Games" real,
"Wins" real,
"Losses" real,
"Winning Pct." real
) | What is the total number of losses of the team with games less than 14, wins less than 3, in the Maac Conference at Fairfield School? | SELECT COUNT("Losses") FROM table_44082 WHERE "Games" < '14' AND "Wins" < '3' AND "Conference" = 'maac' AND "School" = 'fairfield' |
CREATE TABLE election (
Election_ID int,
Representative_ID int,
Date text,
Votes real,
Vote_Percent real,
Seats real,
Place real
)
CREATE TABLE representative (
Representative_ID int,
Name text,
State text,
Party text,
Lifespan text
) | Give me a histogram for what are the different parties of representative? Show the party name and the number of representatives in each party. | SELECT Party, COUNT(*) FROM representative GROUP BY Party |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | is the heart rate in patient 22973 last measured on the first icu visit less than first measured on the first icu visit? | SELECT (SELECT chartevents.valuenum 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 = 22973) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... |
CREATE TABLE table_2259285_1 (
standing VARCHAR,
goals_against VARCHAR
) | What was the standing when goal against were 279? | SELECT standing FROM table_2259285_1 WHERE goals_against = 279 |
CREATE TABLE table_name_36 (
game INTEGER,
team VARCHAR
) | What game was played at Philadelphia? | SELECT AVG(game) FROM table_name_36 WHERE team = "philadelphia" |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Course_Authors_and_Tutors (
author_id IN... | A bar chart for what are the number of the completion dates of all the tests that have result 'Fail'?, and list from high to low by the Y-axis. | SELECT date_of_completion, COUNT(date_of_completion) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" GROUP BY date_of_completion ORDER BY COUNT(date_of_completion) DESC |
CREATE TABLE table_21143 (
"Country" text,
"Name" text,
"Network" text,
"Premiere" text,
"Host(s)" text,
"Judges" text,
"Seasons and Winners" text
) | Name the host for prime | SELECT "Host(s)" FROM table_21143 WHERE "Network" = 'Prime' |
CREATE TABLE table_20508 (
"Region of USSR" text,
"Number of families" real,
"Number of people" real,
"Average family size" text,
"% of total deportees" text
) | What is the most number of families in regions where average family size is 2.7? | SELECT MAX("Number of families") FROM table_20508 WHERE "Average family size" = '2.7' |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | Follow-up edits to my contributions. Shows all posts that I've contributed to, that have also been edited by someone else since my last contribution. Includes only certain types of edits (title/body/tag edits/rollbacks), and excludes edits by the Community user (which are mostly inserting/removing duplicate links and s... | SELECT ph.PostId AS "post_link", ph.CreationDate AS LastEditDate, u.DisplayName AS LastEditor, pht.Name AS LastEditType, ph.Comment FROM PostHistory AS ph JOIN PostHistoryTypes AS pht ON pht.Id = ph.PostHistoryTypeId JOIN Posts AS p ON p.Id = ph.PostId AND p.LastEditDate = ph.CreationDate JOIN Users AS u ON u.Id = ph.U... |
CREATE TABLE table_12794 (
"Location" text,
"Year" real,
"Champion" text,
"Runner-up" text,
"Score" text
) | When John Mcenroe won at Montreal, what was the score? | SELECT "Score" FROM table_12794 WHERE "Location" = 'montreal' AND "Champion" = 'john mcenroe' |
CREATE TABLE building (
building_id text,
Name text,
Street_address text,
Years_as_tallest text,
Height_feet int,
Floors int
)
CREATE TABLE Institution (
Institution_id text,
Institution text,
Location text,
Founded real,
Type text,
Enrollment int,
Team text,
Pri... | Let institution types as the X-axis and the number of institutions for each type as Y-axis, the visualization type is bar chart, could you order in desc by the Y-axis? | SELECT Type, COUNT(*) FROM Institution GROUP BY Type ORDER BY COUNT(*) DESC |
CREATE TABLE table_76540 (
"Tournament" text,
"Surface" text,
"Week" text,
"Winner" text,
"Finalist" text,
"Semifinalists" text
) | What week was the finalist Martina Hingis? | SELECT "Week" FROM table_76540 WHERE "Finalist" = 'martina hingis' |
CREATE TABLE table_203_689 (
id number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"record" text
) | what was the total number of wins ? | SELECT COUNT(*) FROM table_203_689 WHERE "result" = 'win' |
CREATE TABLE table_79760 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | What dates had matches at the venue Sabina Park? | SELECT "Date" FROM table_79760 WHERE "Venue" = 'sabina park' |
CREATE TABLE table_59775 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | What is the broadcast date with 7.0 million viewers? | SELECT "Broadcast date" FROM table_59775 WHERE "Viewers (in millions)" = '7.0' |
CREATE TABLE table_36645 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | How many tries for did the club with a 3 losing bonus and 45 points have? | SELECT "Tries for" FROM table_36645 WHERE "Losing bonus" = '3' AND "Points" = '45' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (... | how many patients admitted to emergency were aged below 71? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.age < "71" |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | List the name for storms and the number of affected regions for each storm, order bars from high to low order. | SELECT Name, COUNT(*) FROM storm AS T1 JOIN affected_region AS T2 ON T1.Storm_ID = T2.Storm_ID GROUP BY T1.Storm_ID ORDER BY Name DESC |
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Faculty_Participates_in (
FacID IN... | Show me a bar chart for how many students are advised by each rank of faculty? List the rank and the number of students. | SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank |
CREATE TABLE table_42499 (
"Year" real,
"Winner" text,
"School" text,
"Position" text,
"Points" text,
"% of Points Possible" text
) | What is the % of points possible of the winner from Penn State? | SELECT "% of Points Possible" FROM table_42499 WHERE "School" = 'penn state' |
CREATE TABLE table_23493 (
"Ostrich" text,
"Hamerkop" text,
"Hadeda Ibis" text,
"African Spoonbill" text,
"Whitefaced Duck" text,
"Knobbilled Duck" text
) | What is the Hadeda Ibis when the Ostrich is Dark Chanting Goshawk? | SELECT "Hadeda Ibis" FROM table_23493 WHERE "Ostrich" = 'Dark Chanting Goshawk' |
CREATE TABLE table_5198 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What is the best time of the team that had a qualifying 1 time of 1:01.043? | SELECT "Best" FROM table_5198 WHERE "Qual 1" = '1:01.043' |
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 who underwent (Aorto)coronary bypass of one coronary artery and died in or before 2138? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2138.0" AND procedures.short_title = "Aortocor bypas-1 cor art" |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | count the number of patients who since 4 years ago have been prescribed 1 ml vial : heparin sodium (porcine) 5000 unit/ml ij soln. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = '1 ml vial : heparin sodium (porcine) 5000 unit/ml ij soln' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-4 year')) |
CREATE TABLE procedures (
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
)
... | calculate the average age of patients who were admitted in emergency room for s/p hanging. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "S/P HANGING" |
CREATE TABLE table_23563 (
"English Name" text,
"Simplified" text,
"Traditional" text,
"Pinyin" text,
"Foochow" text,
"Area" real,
"Population" real,
"Density" real
) | Name the traditional for area 544 | SELECT "Traditional" FROM table_23563 WHERE "Area" = '544' |
CREATE TABLE table_5694 (
"Week 6 Oct 5" text,
"Week 7 Oct 12" text,
"Week 9 Oct 26" text,
"Week 10 Nov 2" text,
"Week 11 Nov 9" text,
"Week 13 Nov 23" text,
"Week 14 Nov 30" text,
"Week 15 (Final) Dec 7" text
) | Which Week 14 Nov 30 has a Week 6 Oct 5 of michigan state (5-1)? | SELECT "Week 14 Nov 30" FROM table_5694 WHERE "Week 6 Oct 5" = 'michigan state (5-1)' |
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 cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id... | what were the three most frequently ordered microbiology tests for patients that had previous fiber-optic bronchoscopy during the same month in 2104? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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 = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... |
CREATE TABLE acceptance (
submission_id number,
workshop_id number,
result text
)
CREATE TABLE workshop (
workshop_id number,
date text,
venue text,
name text
)
CREATE TABLE submission (
submission_id number,
scores number,
author text,
college text
) | How many submissions are there? | SELECT COUNT(*) FROM submission |
CREATE TABLE table_1429629_1 (
episode VARCHAR,
run_time VARCHAR
) | What are all the episodes with an episode run time of 24:01? | SELECT episode FROM table_1429629_1 WHERE run_time = "24:01" |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE T... | show me the flights that leave on THURSDAY mornings from ATLANTA to WASHINGTON and include whether meals are offered and what the prices are | SELECT DISTINCT fare.fare_id, flight.flight_id, flight.meal_code FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_n... |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Des... | Return a line on what are all the calendar dates and day Numbers?, and rank in descending by the X-axis. | SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date DESC |
CREATE TABLE table_62326 (
"Rank" real,
"Name" text,
"Season" text,
"Club" text,
"Goals" real,
"Apps" real,
"Goals per Match" real
) | What is the lowest rank that has goals per match less than 1.237, real madrid as the club, goals less than 53, with apps greater than 40? | SELECT MIN("Rank") FROM table_62326 WHERE "Goals per Match" < '1.237' AND "Club" = 'real madrid' AND "Goals" < '53' AND "Apps" > '40' |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLic... | X reoccurs with Tag, post count. | SELECT reoccurs.TagName AS reoccurs, 'WITH' AS presence, '##occurs:string##' AS occurs, COUNT(DISTINCT Posts.Id) AS nposts FROM Tags AS reoccurs, Posts, PostTags AS ptri WHERE Posts.Id = ptri.PostId AND ptri.TagId = reoccurs.Id AND '##occurs:string##' IN (SELECT TagName FROM Tags AS occurs, PostTags AS pti WHERE occurs... |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | what is the number of patients whose primary disease is complete heart block and year of birth is less than 2200? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "COMPLETE HEART BLOCK" AND demographic.dob_year < "2200" |
CREATE TABLE Courses (
course_id VARCHAR(100),
course_name VARCHAR(120),
course_description VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Candidates (
candidate_id INTEGER,
candidate_details VARCHAR(255)
)
CREATE TABLE People_Addresses (
person_address_id INTEGER,
person_id I... | Bar graph to show the number of last name from different last name, and I want to order in ascending by the bar. | SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name ORDER BY last_name |
CREATE TABLE table_67050 (
"Quarter" text,
"Score" text,
"Club" text,
"Opponent" text,
"Year" text,
"Round" text,
"Venue" text
) | Which opponent has a Club of essendon, and a Score of 13.4.82? | SELECT "Opponent" FROM table_67050 WHERE "Club" = 'essendon' AND "Score" = '13.4.82' |
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_host... | Display a pie chart for how many hosts does each nationality have? List the nationality and the count. | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality |
CREATE TABLE table_25428629_1 (
opponent VARCHAR,
location VARCHAR
) | If the location is Yangon, Myanmar, what is the opponent total number? | SELECT COUNT(opponent) FROM table_25428629_1 WHERE location = "Yangon, Myanmar" |
CREATE TABLE table_13696 (
"Season" text,
"Teams" real,
"Minor Ladder Position" text,
"Finals Qualification" text,
"Final Ladder Position" text,
"ACL Qualification" text,
"ACL Placing" text
) | What is the total teams during the 2012-13 season? | SELECT SUM("Teams") FROM table_13696 WHERE "Season" = '2012-13' |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE employee (
ei... | Draw a bar chart for what are the destinations and number of flights to each one?, I want to list from high to low by the Y-axis. | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY COUNT(*) DESC |
CREATE TABLE table_name_92 (
score VARCHAR,
country VARCHAR
) | What score has south africa as the country? | SELECT score FROM table_name_92 WHERE country = "south africa" |
CREATE TABLE table_203_559 (
id number,
"no." number,
"name" text,
"took office" text,
"left office" text,
"president served under" text,
"notable for" text
) | how many commissioners served under calvin coolidge ? | SELECT COUNT("name") FROM table_203_559 WHERE "president served under" = 'calvin coolidge' |
CREATE TABLE table_31968 (
"Heat Rank" real,
"Lane" real,
"Swimmer" text,
"Country" text,
"Time" real,
"Overall Rank" text
) | For how long did Bolivia have a lane greater than 6? | SELECT COUNT("Time") FROM table_31968 WHERE "Country" = 'bolivia' AND "Lane" > '6' |
CREATE TABLE table_name_12 (
try_bonus VARCHAR,
club VARCHAR
) | What is the try bonus for ynysybwl rfc? | SELECT try_bonus FROM table_name_12 WHERE club = "ynysybwl rfc" |
CREATE TABLE table_75443 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Game has a Score of 4 1? | SELECT SUM("Game") FROM table_75443 WHERE "Score" = '4–1' |
CREATE TABLE table_name_7 (
position VARCHAR,
losses VARCHAR,
wins VARCHAR,
goals_against VARCHAR
) | How many positions have 14 wins, goals against of 61 and fewer than 19 losses? | SELECT COUNT(position) FROM table_name_7 WHERE wins = 14 AND goals_against = 61 AND losses < 19 |
CREATE TABLE table_20396710_1 (
drawn VARCHAR
) | when points against is points again, which are the drawn? | SELECT drawn FROM table_20396710_1 WHERE "points_against" = "points_against" |
CREATE TABLE table_203_735 (
id number,
"rd" number,
"pick" number,
"player" text,
"position" text,
"school" text
) | how many players were from notre dame ? | SELECT COUNT("player") FROM table_203_735 WHERE "school" = 'notre dame' |
CREATE TABLE table_44305 (
"Rank" real,
"Country" text,
"Miss United Continent" real,
"Virreina" real,
"1st RU" real,
"2nd RU" real,
"3rd RU" real,
"4th RU" real,
"Semifinalists" real,
"Total" real
) | How many semifinalists had a total less than 2, 1st RU greater than 0, 2nd RU was 0 and Miss United Continent of 0? | SELECT COUNT("Semifinalists") FROM table_44305 WHERE "Miss United Continent" = '0' AND "2nd RU" = '0' AND "1st RU" > '0' AND "Total" < '2' |
CREATE TABLE race (
name VARCHAR,
date VARCHAR,
track_id VARCHAR
)
CREATE TABLE track (
name VARCHAR,
track_id VARCHAR
) | Show the name and date for each race and its track name. | SELECT T1.name, T1.date, T2.name FROM race AS T1 JOIN track AS T2 ON T1.track_id = T2.track_id |
CREATE TABLE table_name_86 (
position VARCHAR,
team VARCHAR,
college VARCHAR
) | Name the position that has baltimore bullets and college of texas tech | SELECT position FROM table_name_86 WHERE team = "baltimore bullets" AND college = "texas tech" |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | when did patient 027-178495 take an intake for the last time until 230 days ago? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-178495')) AND intakeoutput.cellpath LIKE '%intake... |
CREATE TABLE table_11208143_9 (
capacity INTEGER,
stadium VARCHAR
) | What is Pittodrie Stadium's maximum capacity? | SELECT MAX(capacity) FROM table_11208143_9 WHERE stadium = "Pittodrie" |
CREATE TABLE broadcast (
channel_id number,
program_id number,
time_of_day text
)
CREATE TABLE broadcast_share (
channel_id number,
program_id number,
date text,
share_in_percent number
)
CREATE TABLE channel (
channel_id number,
name text,
owner text,
share_in_percent numb... | Which program is broadcast most frequently? Give me the program name. | SELECT t1.name FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id GROUP BY t2.program_id ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | Get posts starting with '-1'. | SELECT Id AS "post_link" FROM Posts WHERE 'body' LIKE '<p>-1 %' |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
) | Which allergy type has most number of allergies? | SELECT allergytype FROM allergy_type GROUP BY allergytype ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_24906653_5 (
field_goals VARCHAR,
player VARCHAR
) | How many long range shots did tonya edwards make. | SELECT COUNT(field_goals) FROM table_24906653_5 WHERE player = "Tonya Edwards" |
CREATE TABLE table_59413 (
"Year" text,
"Result" text,
"Matches" text,
"Wins" text,
"Draws" text,
"Losses" text
) | What year was the result did not qualify? | SELECT "Year" FROM table_59413 WHERE "Result" = 'did not qualify' |
CREATE TABLE table_name_47 (
champion VARCHAR,
location VARCHAR,
semi_finalist__number2 VARCHAR
) | Which champion was from the location of Morrisville, NC, and whose SemiFinalist #2 of Clemson? | SELECT champion FROM table_name_47 WHERE location = "morrisville, nc" AND semi_finalist__number2 = "clemson" |
CREATE TABLE table_20214 (
"Date" text,
"Cover model" text,
"Centerfold model" text,
"Interview subject" text,
"20 Questions" text,
"Pictorials" text
) | Who was the interview subject in the 2-86 issue? | SELECT "Interview subject" FROM table_20214 WHERE "Date" = '2-86' |
CREATE TABLE table_name_47 (
average VARCHAR,
matches VARCHAR
) | What is the average when the matches are 11? | SELECT average FROM table_name_47 WHERE matches = "11" |
CREATE TABLE table_74914 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
) | What Player is a Wide Receiver? | SELECT "Player" FROM table_74914 WHERE "Position" = 'wide receiver' |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
... | Answer score distribution for a user. Returns the (log 10 of the) distribution of the scores for a given user's answers. | SELECT Score, COUNT(*) FROM Posts WHERE OwnerUserId = '##UserId##' AND PostTypeId = 2 GROUP BY Score ORDER BY Score |
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... | Python Web Framework Trends (# Questions per Tag per Month). | SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ... |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what was the last value of a lab test of bedside glucose since 31 months ago for patient 011-55939? | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-55939')) AND lab.labname = 'bedside glucose' AND DATETIME(lab.labresulttime) >= DAT... |
CREATE TABLE table_204_238 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer (s)" text,
"time" text
) | how many tracks last for more than three minutes ? | SELECT COUNT("title") FROM table_204_238 WHERE "time" >= 3 |
CREATE TABLE table_name_17 (
laps INTEGER,
qual VARCHAR
) | How many laps resulted from a Qual of 165.229? | SELECT MAX(laps) FROM table_name_17 WHERE qual = "165.229" |
CREATE TABLE table_name_28 (
stadium VARCHAR,
week INTEGER
) | What was the stadium that held that game after week 15? | SELECT stadium FROM table_name_28 WHERE week > 15 |
CREATE TABLE table_269888_1 (
area__km²_ VARCHAR,
population__2010_ VARCHAR
) | Name the area for population of 53542 | SELECT area__km²_ FROM table_269888_1 WHERE population__2010_ = 53542 |
CREATE TABLE table_65412 (
"Region" text,
"Date" text,
"Format" text,
"Label" text,
"Edition" text
) | When did Avex Entertainment release a CD? | SELECT "Date" FROM table_65412 WHERE "Format" = 'cd' AND "Label" = 'avex entertainment' |
CREATE TABLE table_name_63 (
venue VARCHAR,
date VARCHAR
) | Where was the 05/09/1973 venue? | SELECT venue FROM table_name_63 WHERE date = "05/09/1973" |
CREATE TABLE table_73907 (
"Municipality" text,
"No. of Barangays" real,
"Area (km\u00b2)" text,
"Population (2010)" real,
"Pop. density (per km\u00b2)" text,
"Income Class (2004)" text
) | List the population density per kilometer for the city of abra de ilog. | SELECT "Pop. density (per km\u00b2)" FROM table_73907 WHERE "Municipality" = 'Abra de Ilog' |
CREATE TABLE table_39403 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | How many picks have an Overall of 114? | SELECT COUNT("Pick #") FROM table_39403 WHERE "Overall" = '114' |
CREATE TABLE table_name_50 (
character VARCHAR,
actor_actress VARCHAR
) | What character did actor Damien Richardson play? | SELECT character FROM table_name_50 WHERE actor_actress = "damien richardson" |
CREATE TABLE table_name_64 (
city_of_license VARCHAR,
call_sign VARCHAR
) | Which City of license has a Call sign of w220ba? | SELECT city_of_license FROM table_name_64 WHERE call_sign = "w220ba" |
CREATE TABLE table_name_38 (
total_score_week VARCHAR,
status VARCHAR,
scores_by_each_individual_judge VARCHAR
) | Which Total score/week has a Status of eliminated, and Scores by each individual judge of 5 + 5 + 4 = 14? | SELECT total_score_week FROM table_name_38 WHERE status = "eliminated" AND scores_by_each_individual_judge = 5 + 5 + 4 = 14 |
CREATE TABLE table_25635 (
"Season" text,
"Junior (South) Winners" text,
"Intermediate (South) Winners" text,
"Minor (South) Winners" text,
"Primary (South) Winners" text
) | What isthe minor (South) winners total number is the primary (South) winners is Mendip Gate? | SELECT COUNT("Minor (South) Winners") FROM table_25635 WHERE "Primary (South) Winners" = 'Mendip Gate' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.