table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_5133 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the Final" text,
"Score" text
) | Score of 4 6, 6 4, 6 4 included which tournament? | SELECT "Tournament" FROM table_5133 WHERE "Score" = '4–6, 6–4, 6–4' |
CREATE TABLE table_50435 (
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Attendance" real
) | When the attendance was 3188 what was the score? | SELECT "Score" FROM table_50435 WHERE "Attendance" = '3188' |
CREATE TABLE table_name_63 (
name VARCHAR,
west_or_south_terminus VARCHAR
) | what is the name when the west or south terminus is ne 112 west of blue springs? | SELECT name FROM table_name_63 WHERE west_or_south_terminus = "ne 112 west of blue springs" |
CREATE TABLE table_name_11 (
record VARCHAR,
location VARCHAR,
date VARCHAR
) | What was their record on Wed. Dec. 5, when they played in Boston Garden? | SELECT record FROM table_name_11 WHERE location = "boston garden" AND date = "wed. dec. 5" |
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... | Average Questions Per Users Which Have Posted At Least One Question. | SELECT COUNT(Ids) AS Questioners, SUM(PostCount) AS Questions, (SUM(PostCount) / 1.0) / (COUNT(Ids) / 1.0) AS QsPerPoster FROM (SELECT p.OwnerUserId AS Ids, COUNT(p.Id) AS PostCount FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 GROUP BY p.OwnerUserId) AS q |
CREATE TABLE table_76590 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is Date, when Location Attendance is 'TD Banknorth Garden 18,624'? | SELECT "Date" FROM table_76590 WHERE "Location Attendance" = 'td banknorth garden 18,624' |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDat... | earliest still available date for a tag to show up. | SELECT CreationDate, Text, PostHistoryTypeId, UserId AS "user10926745", PostId AS "post_link" FROM PostHistory WHERE PostHistoryTypeId IN (3, 6, 9) AND Text LIKE '%<drupal>%' ORDER BY CreationDate |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text... | Number of suggested edit votes in the last year. | SELECT COUNT(*) FROM SuggestedEditVotes WHERE CreationDate > DATEADD(year, -1, GETDATE()) AND UserId > -1 |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | what is the maximum total cost of the hospital, which includes the laboratory pressure control test until 2102? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'pressure control')) AND STRFTIME('%y', cost.chargetime) <= '2102' GR... |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId ... | Top 100 Answers by Tag Name. | SELECT q.Id, a.Id, a.Score, q.Tags, u.DisplayName FROM Posts AS q JOIN Posts AS a ON q.AcceptedAnswerId = a.Id JOIN Users AS u ON a.OwnerUserId = u.Id WHERE 0 = 0 AND q.Tags LIKE '%api%' AND q.PostTypeId = 1 AND a.PostTypeId = 2 ORDER BY a.Score DESC LIMIT 100 |
CREATE TABLE table_name_38 (
position VARCHAR,
school VARCHAR,
points VARCHAR
) | What position does the winner from Ohio State with 412 points play? | SELECT position FROM table_name_38 WHERE school = "ohio state" AND points = "412" |
CREATE TABLE table_name_88 (
aggregate VARCHAR
) | What was the 2nd leg score having an aggregate score of 4-2? | SELECT 2 AS nd_leg FROM table_name_88 WHERE aggregate = "4-2" |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
A... | Who were the governors of the parties associated with delegates from district 1, and count them by a bar chart | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor |
CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER,
store_name VARCHAR(80),
store_address VARCHAR(255),
store_phone VARCHAR(80),
store_email VARCHAR(80)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
address_id INTEGER,
date_from DATETIME,
... | Return the names and ids of customers who have TN in their address Show bar chart, and show bar in descending order. | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_name DESC |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | give me the number of patients who underwent procedure with short tilte cardiac rhythm conv nec and were left against medical advice. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" AND procedures.short_title = "Cardiac rhythm conv NEC" |
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(... | Give me a bar chart for employee_id of each last name, and sort by the total number in descending. | SELECT LAST_NAME, EMPLOYEE_ID FROM employees ORDER BY EMPLOYEE_ID DESC |
CREATE TABLE table_name_62 (
intake INTEGER,
dcsf_number VARCHAR,
type VARCHAR,
ofsted_number VARCHAR
) | What is the average primary intake with an Ofsted number of 117433 and a DCSF number greater than 3335? | SELECT AVG(intake) FROM table_name_62 WHERE type = "primary" AND ofsted_number = 117433 AND dcsf_number > 3335 |
CREATE TABLE table_3695 (
"District" text,
"Counties Represented" text,
"Delegate" text,
"Party" text,
"First Elected" real,
"Committee" text
) | What committees do the district 46 members serve on? | SELECT "Committee" FROM table_3695 WHERE "District" = '46' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE... | what is the number of days since patient 17667 received the last magnesium sulfate prescription on this hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 17667 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'magnesium sulfate' ORDER BY prescriptions.sta... |
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
)
CREATE TABLE affected_region (
region_id number,
storm_id number,
number_city_affected number
)
CREATE TABLE region (
region_id number,
r... | Show the name of storms which don't have affected region in record. | SELECT name FROM storm WHERE NOT storm_id IN (SELECT storm_id FROM affected_region) |
CREATE TABLE table_name_22 (
bronze INTEGER,
silver INTEGER
) | What is the most bronze a team with more than 2 silvers has? | SELECT MAX(bronze) FROM table_name_22 WHERE silver > 2 |
CREATE TABLE table_name_48 (
lost VARCHAR,
points VARCHAR
) | Who was the team that lost but had 10 points? | SELECT lost FROM table_name_48 WHERE points = "10" |
CREATE TABLE table_name_99 (
to_par VARCHAR,
year_s__won VARCHAR
) | What is To Par, when Year(s) Won is '1968 , 1971'? | SELECT to_par FROM table_name_99 WHERE year_s__won = "1968 , 1971" |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight (
aircraft_code_sequence... | i'd like to buy a COACH class ticket from DENVER to ATLANTA with a stopover in PITTSBURGH | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, fare, fare_basis, flight, flight_fare, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_nam... |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | What are the upper-level PIBS classes that will be available this Summer ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PIBS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Summer... |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | is heart rate of patient 1918 last measured on the first intensive care unit visit less than first measured on the first intensive care unit 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 = 1918) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemi... |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
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),
fam... | Find personal_name and author_tutor_ATB , and visualize them by a bar chart. | SELECT personal_name, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name |
CREATE TABLE table_name_60 (
employees__world_ VARCHAR,
revenue__mil€_ VARCHAR
) | What is hte nuumber of employees that has a revenue of 104.000? | SELECT employees__world_ FROM table_name_60 WHERE revenue__mil€_ = "104.000" |
CREATE TABLE table_name_75 (
finish VARCHAR,
year VARCHAR
) | What is the finish in 1953? | SELECT finish FROM table_name_75 WHERE year = "1953" |
CREATE TABLE table_204_394 (
id number,
"year" number,
"album" text,
"label" text,
"peak chart\npositions\nus" number,
"peak chart\npositions\nus r&b" number
) | what year was clayton 's first album ? | SELECT MIN("year") FROM table_204_394 |
CREATE TABLE table_57621 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | What was the pick number when mark hayes was drafted? | SELECT "Pick" FROM table_57621 WHERE "Player" = 'mark hayes' |
CREATE TABLE table_name_8 (
date VARCHAR,
opponent VARCHAR
) | What day was the opponent Austria? | SELECT date FROM table_name_8 WHERE opponent = "austria" |
CREATE TABLE table_30722 (
"Athens XI" text,
"PIFA Colaba FC u-17" text,
"Tata Power" text,
"Dadar XI \u2018B\u2019" text,
"IDBI" text,
"World Network Services" text,
"United FC" text,
"Good Shepherd" text
) | what is the dadar xi b where the good shepherd is sea liner fc? | SELECT "Dadar XI \u2018B\u2019" FROM table_30722 WHERE "Good Shepherd" = 'Sea Liner FC' |
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, give me the comparison about the average of code over the headquarter , and group by attribute headquarter, and could you order in desc by the x axis? | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC |
CREATE TABLE table_59176 (
"Week 1" text,
"Week 2" text,
"Week 3" text,
"Week 4" text,
"Week 5" text
) | When Star Zemba was featured in Week 3, who was the cyber girl for Week 2? | SELECT "Week 2" FROM table_59176 WHERE "Week 3" = 'star zemba' |
CREATE TABLE table_name_29 (
college VARCHAR,
cfl_team VARCHAR
) | Which college did the Calgary Stampeders recruit from? | SELECT college FROM table_name_29 WHERE cfl_team = "calgary stampeders" |
CREATE TABLE table_name_10 (
attendance INTEGER,
time VARCHAR
) | What was the least attendance when the time was 3:15? | SELECT MIN(attendance) FROM table_name_10 WHERE time = "3:15" |
CREATE TABLE table_203_465 (
id number,
"name" text,
"population (2002 census)" number,
"population (2007 estimation)" number,
"population (2011 census)" number,
"area (km2)" number,
"density (pop/km2)" number
) | how many people lived in predeal in 2011 ? | SELECT "population (2011 census)" FROM table_203_465 WHERE "name" = 'predeal' |
CREATE TABLE table_name_76 (
drawn INTEGER,
lost VARCHAR,
position VARCHAR,
team VARCHAR
) | How many draws did clitheroe have when their position was less than 12 and they lost less than 4 times? | SELECT SUM(drawn) FROM table_name_76 WHERE position < 12 AND team = "clitheroe" AND lost > 4 |
CREATE TABLE table_16423070_4 (
track_ VARCHAR,
_field VARCHAR,
swimming VARCHAR,
volleyball VARCHAR
) | which country won swimming track & field when lexington won swimming and madison won volleyball | SELECT track_ & _field FROM table_16423070_4 WHERE swimming = "Lexington" AND volleyball = "Madison" |
CREATE TABLE table_11547 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronzes for the nation with 2 golds and ranked below 2? | SELECT SUM("Bronze") FROM table_11547 WHERE "Gold" = '2' AND "Rank" > '2' |
CREATE TABLE table_203_451 (
id number,
"year" number,
"film" text,
"role" text,
"language" text,
"notes" text
) | what other movies was aggarwal in the same year as her role in veera ? | SELECT "film" FROM table_203_451 WHERE "film" <> 'veera' AND "year" = (SELECT "year" FROM table_203_451 WHERE "film" = 'veera') |
CREATE TABLE table_204_585 (
id number,
"year" text,
"player" text,
"high school" text,
"college" text,
"nba/aba draft" text
) | who won the last one ? | SELECT "player" FROM table_204_585 ORDER BY "year" DESC LIMIT 1 |
CREATE TABLE table_21420 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | What was the team's position when the new manager was Lucas Alcaraz? | SELECT "Position in table" FROM table_21420 WHERE "Replaced by" = 'Lucas Alcaraz' |
CREATE TABLE table_52142 (
"Year" real,
"Single" text,
"U.S. Country" text,
"U.S." text,
"U.S. AC" text,
"Album" text
) | What US Country released an album of singles only in 1967? | SELECT "U.S. Country" FROM table_52142 WHERE "Album" = 'singles only' AND "Year" = '1967' |
CREATE TABLE table_name_73 (
name VARCHAR,
laid_down VARCHAR,
commissioned VARCHAR
) | Tell me the name for commissioned of 30 august 1941 and laid down of 22 september 1939 | SELECT name FROM table_name_73 WHERE laid_down = "22 september 1939" AND commissioned = "30 august 1941" |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
... | how many hours has it been since patient 94229 stayed in the careunit tsicu for the first time on their current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL) AND transfers.careunit = 'tsicu' ORDER BY transfers.intime LIMIT 1 |
CREATE TABLE table_56961 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many people attended the game where the home team scored 8.10 (58)? | SELECT MAX("Crowd") FROM table_56961 WHERE "Home team score" = '8.10 (58)' |
CREATE TABLE table_name_58 (
bronze INTEGER,
nation VARCHAR
) | How many total bronze medals did Canada receive? | SELECT MAX(bronze) FROM table_name_58 WHERE nation = "canada" |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | count the number of patients who had been tested until 1 year ago for rbc, ascites. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rbc, ascites') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-1 year')) |
CREATE TABLE table_16677738_1 (
year INTEGER
) | What is the lowest overall year? | SELECT MIN(year) FROM table_16677738_1 |
CREATE TABLE table_75027 (
"Call sign" text,
"Analog channel" text,
"Digital channel" text,
"Virtual channel" text,
"Network" text,
"Station Ownership" text
) | Station Ownership of eicb tv, and a Call sign of ktcj-ld is what virtual network? | SELECT "Virtual channel" FROM table_75027 WHERE "Station Ownership" = 'eicb tv' AND "Call sign" = 'ktcj-ld' |
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
) | Give me a histogram for how old is each gender, on average?, rank in asc by the x-axis. | SELECT gender, AVG(age) FROM Person GROUP BY gender ORDER BY gender |
CREATE TABLE table_name_56 (
score VARCHAR,
tie_no VARCHAR
) | What was the score for the game with a tie no of 1? | SELECT score FROM table_name_56 WHERE tie_no = "1" |
CREATE TABLE route (
station_id VARCHAR,
train_id VARCHAR
)
CREATE TABLE train (
name VARCHAR,
time VARCHAR,
id VARCHAR
)
CREATE TABLE station (
id VARCHAR,
local_authority VARCHAR
) | Find names and times of trains that run through stations for the local authority Chiltern. | SELECT t3.name, t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" |
CREATE TABLE table_name_43 (
nomination VARCHAR,
year INTEGER
) | What was the nomination in a year earlier than 2009? | SELECT nomination FROM table_name_43 WHERE year < 2009 |
CREATE TABLE table_52144 (
"Result" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Location" text
) | What is the result of the fight that had a tko (low kicks)? | SELECT "Result" FROM table_52144 WHERE "Method" = 'tko (low kicks)' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid n... | what is the name of the output that patient 029-16737 first got until 05/06/2104? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16737')) AND intakeoutput.cellpath LIKE '%output%' AND S... |
CREATE TABLE table_13833770_3 (
district VARCHAR,
party VARCHAR,
elected VARCHAR
) | what's the district with party being republican and elected being 1998 | SELECT district FROM table_13833770_3 WHERE party = "Republican" AND elected = 1998 |
CREATE TABLE table_name_14 (
finalist VARCHAR,
week VARCHAR
) | What is the May 7 finalist? | SELECT finalist FROM table_name_14 WHERE week = "may 7" |
CREATE TABLE table_75124 (
"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
) | What's the try bonus that had 423 points? | SELECT "Try bonus" FROM table_75124 WHERE "Points for" = '423' |
CREATE TABLE Catalogs (
catalog_id INTEGER,
catalog_name VARCHAR(50),
catalog_publisher VARCHAR(80),
date_of_publication DATETIME,
date_of_latest_revision DATETIME
)
CREATE TABLE Catalog_Contents_Additional_Attributes (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
attribute_i... | Find the name and capacity of products with price greater than 700 (in USD). Show bar chart. | SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 |
CREATE TABLE table_name_23 (
mascot VARCHAR,
enrollment INTEGER
) | What Mascot has an Enrollment greater than 2,464? | SELECT mascot FROM table_name_23 WHERE enrollment > 2 OFFSET 464 |
CREATE TABLE table_33403 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many silver medals were won with a total medal of 3 and a rank above 9? | SELECT AVG("Silver") FROM table_33403 WHERE "Total" < '3' AND "Rank" > '9' |
CREATE TABLE table_name_41 (
loan_club VARCHAR,
start_source VARCHAR,
ended VARCHAR
) | What is the loan club with bbc sport as the start source and ended in 3 February? | SELECT loan_club FROM table_name_41 WHERE start_source = "bbc sport" AND ended = "3 february" |
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 a pie chart about the proportion of Sex and the amount of Sex. | SELECT Sex, COUNT(Sex) FROM people GROUP BY Sex |
CREATE TABLE table_50482 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
) | What is the venue of the team race that was after 2008? | SELECT "Venue" FROM table_50482 WHERE "Year" > '2008' AND "Notes" = 'team' |
CREATE TABLE table_name_48 (
heat INTEGER,
time VARCHAR,
nationality VARCHAR
) | What was the highest heat with a time slower than 48.87 from sweden? | SELECT MAX(heat) FROM table_name_48 WHERE time > 48.87 AND nationality = "sweden" |
CREATE TABLE table_name_26 (
country VARCHAR,
score VARCHAR
) | What is Country, when Score is 71-71-69=211? | SELECT country FROM table_name_26 WHERE score = 71 - 71 - 69 = 211 |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | what has been the total amount of input patient 006-200601 received on 09/20/2104? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-200601')) AND intakeoutput.cellpath LIKE '%i... |
CREATE TABLE table_1198175_1 (
name VARCHAR,
born VARCHAR
) | What is the name when born is december 30, 1957 detroit, mi? | SELECT name FROM table_1198175_1 WHERE born = "December 30, 1957 Detroit, MI" |
CREATE TABLE table_203_646 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"notes" text
) | where was the last competition held according to this chart ? | SELECT "venue" FROM table_203_646 ORDER BY "year" DESC LIMIT 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... | how many hematological effect of infection - leukocytosis patients since 2104 were diagnosed during the same hospital encounter after being diagnosed with s/p thoracotomy - lung reduction surgery? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hematological effect of infection - leukocytosis' AND STRFTIME('%y', diag... |
CREATE TABLE table_53782 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How low was the attendance at the game that ended with a home team score of 16.13 (109)? | SELECT MIN("Crowd") FROM table_53782 WHERE "Home team score" = '16.13 (109)' |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Is there a 5 -credit Scandinavian Civilization course ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Scandinavian Civilization%' OR name LIKE '%Scandinavian Civilization%') AND credits = 5 |
CREATE TABLE table_name_48 (
version VARCHAR,
length VARCHAR,
remixed_by VARCHAR
) | What is the version shown for the Length of 5:20, and shows Remixed by ? | SELECT version FROM table_name_48 WHERE length = "5:20" AND remixed_by = "—" |
CREATE TABLE table_26621 (
"Reference" text,
"Author" text,
"Section Size" text,
"Violins" real,
"Violas" real,
"Celli" real,
"Basses" real
) | How many cellos are suggested in the reference with section size for 20 players? | SELECT "Celli" FROM table_26621 WHERE "Section Size" = '20 players' |
CREATE TABLE table_72079 (
"Entered office as Head of State or Government" text,
"Began time as senior G8 leader" text,
"Ended time as senior G8 leader" text,
"Person" text,
"Office" text
) | When did the Prime Minister of Italy take office? | SELECT "Entered office as Head of State or Government" FROM table_72079 WHERE "Office" = 'Prime Minister of Italy' |
CREATE TABLE table_name_13 (
venue VARCHAR,
home_team VARCHAR
) | Where was South Melbourne played? | SELECT venue FROM table_name_13 WHERE home_team = "south melbourne" |
CREATE TABLE table_204_662 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number,
"bye" text
) | what is the total number of points scored against the opponents for september ? | SELECT SUM("result") FROM table_204_662 WHERE "date" = 9 |
CREATE TABLE table_name_59 (
to_par VARCHAR,
player VARCHAR
) | What is Justin Leonard's To par? | SELECT to_par FROM table_name_59 WHERE player = "justin leonard" |
CREATE TABLE table_train_104 (
"id" int,
"migraines" bool,
"depression" bool,
"mini_mental_state_examination_mmse" int,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"alzheimer" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"diastolic_blood_pressure_dbp" int,
... | sitting blood pressure > 160 / 100 mm hg. physician evaluation | SELECT * FROM table_train_104 WHERE systolic_blood_pressure_sbp >= 160 OR diastolic_blood_pressure_dbp >= 100 |
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, visualize a bar chart about the distribution of name and the sum of code , and group by attribute name, could you show by the y-axis in descending? | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC |
CREATE TABLE table_name_48 (
venue VARCHAR,
competition VARCHAR
) | What is the Venue of the 2002 World Cup Qualification? | SELECT venue FROM table_name_48 WHERE competition = "2002 world cup qualification" |
CREATE TABLE table_30813 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What is the episode series number of 'St. Joan'? | SELECT "Series #" FROM table_30813 WHERE "Title" = 'St. Joan' |
CREATE TABLE table_name_92 (
the_winner VARCHAR,
the_presenter VARCHAR
) | Who won when the presenter was Tatiana Stefanidou? | SELECT the_winner FROM table_name_92 WHERE the_presenter = "tatiana stefanidou" |
CREATE TABLE table_204_707 (
id number,
"year" number,
"english title" text,
"chinese title" text,
"director" text,
"role" text
) | what was the first film zhao dan starred in ? | SELECT "english title" FROM table_204_707 ORDER BY "year" LIMIT 1 |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
g... | Do you find that PSYCH 405 is more of a challenge than PSYCH 619 ? | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, program_course AS PROGRAM_COURSE_0, program_course AS PROGRAM_COURSE_1 WHERE COURSE_0.department = 'PSYCH' AND COURSE_0.number = 405 AND COURSE_1.department = 'PSYCH' AND COURSE_1.number = 619 AND PROGRAM_COURSE_0.course_id = COURSE_0.course_id AND PROGRA... |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId numb... | The top 100 longest posts on the site. | SELECT Posts.Id AS "post_link", PostTypes.Name AS "type", LENGTH(Body) AS Length, OwnerUserId AS "userlink", CreationDate, Score FROM Posts JOIN PostTypes ON PostTypeId = PostTypes.Id ORDER BY Length DESC LIMIT 100 |
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
gender text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE lives_in (
stuid number,
dorm... | How many students are from each city, and which cities have more than one cities? | SELECT COUNT(*), city_code FROM student GROUP BY city_code HAVING COUNT(*) > 1 |
CREATE TABLE table_6520 (
"Nation" text,
"Removal treaty (year signed)" text,
"Years of major emigration" text,
"Total number emigrated or forcibly removed" text,
"Number stayed in Southeast" text,
"Deaths from warfare" text
) | How many of those who stayed in the southeast had 19,600 emigrated or forcibly removed? | SELECT "Number stayed in Southeast" FROM table_6520 WHERE "Total number emigrated or forcibly removed" = '19,600' |
CREATE TABLE table_name_67 (
home VARCHAR,
date VARCHAR
) | What home has February 10 as the date? | SELECT home FROM table_name_67 WHERE date = "february 10" |
CREATE TABLE company (
Market_Value_in_Billion INTEGER
) | What is the maximum and minimum market value of companies? | SELECT MAX(Market_Value_in_Billion), MIN(Market_Value_in_Billion) FROM company |
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 Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Dorm (
dormid INTEGER,
dor... | What is the total capacity of dorms for each gender? Give me a bar chart. | SELECT gender, SUM(student_capacity) FROM Dorm GROUP BY gender |
CREATE TABLE table_17763 (
"Model Number" text,
"Clock Speed" text,
"L2" text,
"L3" text,
"FSB Speed" text,
"Multiplier" text,
"Cores" real,
"Threads per core" real,
"Voltage" text,
"TDP (W)" text,
"Socket" text,
"Release Date" text,
"Price ( USD )" text
) | What's the price (in USD) of the model whose L3 is 18 mb? | SELECT "Price ( USD )" FROM table_17763 WHERE "L3" = '18 MB' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | what is the number of patients who have drug code vera120sr? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "VERA120SR" |
CREATE TABLE table_name_99 (
attendance INTEGER,
venue VARCHAR,
series VARCHAR
) | Name the most that attendend when the venue was td banknorth garden and the series of montreal leads 3-1 | SELECT MAX(attendance) FROM table_name_99 WHERE venue = "td banknorth garden" AND series = "montreal leads 3-1" |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VA... | Show the number of accounts for all accounts by the customer with first name 'Meaghan' opened in each day. Bin the account open day by weekday in a bar chart. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' |
CREATE TABLE table_name_67 (
Id VARCHAR
) | What is the 2008 result when 2012 and 2005 are both QF? | SELECT 2008 FROM table_name_67 WHERE 2012 = "qf" AND 2005 = "qf" |
CREATE TABLE table_32849 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average total when gold is 0, bronze is 0, and silver is smaller than 1? | SELECT AVG("Total") FROM table_32849 WHERE "Gold" = '0' AND "Bronze" = '0' AND "Silver" < '1' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.