answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT COUNT(*) FROM inst
How many institutions are there?
CREATE TABLE inst (Id VARCHAR)
SELECT Team_Name, ACC_Percent FROM basketball_match
Visualize a pie chart about the proportion of Team_Name and ACC_Percent.
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...
SELECT losing_bonus FROM table_15467476_3 WHERE points_difference = "-99"
What is the losing bonus for the team with a point difference of -99?
CREATE TABLE table_15467476_3 (losing_bonus VARCHAR, points_difference VARCHAR)
SELECT COUNT(*) FROM papers
How many papers are published in total?
CREATE TABLE papers (Id VARCHAR)
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 (((date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_tim...
please show me flights from PITTSBURGH to BOSTON on saturday morning after 800
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 restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_...
SELECT played FROM table_15467476_3 WHERE points_for = "277"
How many games played for teams with 277 points?
CREATE TABLE table_15467476_3 (played VARCHAR, points_for VARCHAR)
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Jeremy" AND t1.lname = "Gibbons"
What are the titles of papers published by "Jeremy Gibbons"?
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
SELECT "Name" FROM table_38483 WHERE "Qual 2" > '58.669' AND "Team" = 'team australia'
Who had a Qualifying 2 time over 58.669 for Team Australia?
CREATE TABLE table_38483 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" real, "Best" real )
SELECT won FROM table_15467476_3 WHERE tries_against = "49"
How many games won for teams with 49 tries against?
CREATE TABLE table_15467476_3 (won VARCHAR, tries_against VARCHAR)
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Aaron" AND t1.lname = "Turon"
Find all the papers published by "Aaron Turon".
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WESTCHESTER COUNTY' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_nam...
flights from WESTCHESTER COUNTY to ST. PAUL
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text,...
SELECT COUNT(points_difference) FROM table_15467476_3 WHERE tries_against = "62"
How many teams have 62 tries against?
CREATE TABLE table_15467476_3 (points_difference VARCHAR, tries_against VARCHAR)
SELECT COUNT(*) FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Atsushi" AND t1.lname = "Ohori"
How many papers have "Atsushi Ohori" published?
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE papers (paperid VARCHAR)
SELECT COUNT(DISTINCT title) FROM vocals AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE TYPE = "shared"
How many songs have a shared vocal?
CREATE TABLE vocals ( songid VARCHAR ) CREATE TABLE songs ( songid VARCHAR )
SELECT tries_for FROM table_15467476_3 WHERE club = "Cambrian Welfare RFC"
How many tries for, for club cambrian welfare rfc?
CREATE TABLE table_15467476_3 (tries_for VARCHAR, club VARCHAR)
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Matthias" AND t1.lname = "Blume"
What is the name of the institution that "Matthias Blume" belongs to?
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR)
SELECT MIN("Kazakhstan") FROM table_74485 WHERE "Kyrghizstan" = '4.62' AND "Belarus" < '2.46'
Tell me the lowest kazakhstan for kyrghizstan of 4.62 and belarus less than 2.46
CREATE TABLE table_74485 ( "Year" real, "Azerbaijan" real, "Armenia" real, "Belarus" real, "Georgia" real, "Kazakhstan" real, "Kyrghizstan" real, "Latvia" real, "Lithuania" real, "Moldova" real, "Russia" real, "Tajikistan" real, "Turkmenikstan" real, "Uzbekistan" ...
SELECT COUNT(points_difference) FROM table_15467476_3 WHERE tries_for = "21"
How many teams have 21 tries for?
CREATE TABLE table_15467476_3 (points_difference VARCHAR, tries_for VARCHAR)
SELECT DISTINCT t3.name FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t1.fname = "Katsuhiro" AND t1.lname = "Ueno"
Which institution does "Katsuhiro Ueno" belong to?
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR); CREATE TABLE inst (name VARCHAR, instid VARCHAR)
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 = 19428 AND admissions.dischtime IS NULL) AND transfers.careunit = 'ccu' ORDER BY transfers.intime LIMIT 1
how many hours has it been since the first time patient 19428 stayed in careunit ccu in their current hospital visit.
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, s...
SELECT COUNT(chassis) FROM table_15491596_1 WHERE no = 34
How many chassis used number 34?
CREATE TABLE table_15491596_1 (chassis VARCHAR, no VARCHAR)
SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Oxford"
Who belong to the institution "University of Oxford"? Show the first names and last names.
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR)
SELECT COUNT(*) FROM table_204_418
how many games were played in total ?
CREATE TABLE table_204_418 ( id number, "date" text, "opponent" text, "score" text, "overall record" text, "scba record" text )
SELECT constructor FROM table_15491596_1 WHERE no = 22
Who was the constructor of car 22?
CREATE TABLE table_15491596_1 (constructor VARCHAR, no VARCHAR)
SELECT DISTINCT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
Which authors belong to the institution "Google"? Show the first names and last names.
CREATE TABLE authorship (authid VARCHAR, instid VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR); CREATE TABLE inst (instid VARCHAR, name VARCHAR)
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
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, give me the comparison about the average of employee_id over the hire_date bin hire_date by weekday by a bar chart.
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID...
SELECT COUNT(engine) FROM table_15491596_1 WHERE no = 48
How many cars used number 48?
CREATE TABLE table_15491596_1 (engine VARCHAR, no VARCHAR)
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Binders Unbound"
What are the last names of the author of the paper titled "Binders Unbound"?
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR)
SELECT "institution" FROM table_204_442 ORDER BY "enrollment" DESC LIMIT 1
which institution has the highest amount of enrollment ?
CREATE TABLE table_204_442 ( id number, "institution" text, "location" text, "enrollment" number, "nickname" text, "varsity\nsports" number, "rugby\nsince" text, "head coach" text )
SELECT driver FROM table_15491596_1 WHERE no = 44
Who drove car 44?
CREATE TABLE table_15491596_1 (driver VARCHAR, no VARCHAR)
SELECT t1.fname, t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title = "Nameless , Painless"
Find the first and last name of the author(s) who wrote the paper "Nameless, Painless".
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authors (fname VARCHAR, lname VARCHAR, authid VARCHAR)
SELECT league_division FROM table_name_29 WHERE location = "n/a"
What League/Division has a Location of n/a?
CREATE TABLE table_name_29 ( league_division VARCHAR, location VARCHAR )
SELECT COUNT(year) FROM table_1547951_3 WHERE outcome = "Runner-up" AND championship = "US Open"
Name the total number of years where runner-up and championship is us open
CREATE TABLE table_1547951_3 (year VARCHAR, outcome VARCHAR, championship VARCHAR)
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
What are the papers published under the institution "Indiana University"?
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
SELECT "Conference Record" FROM table_75478 WHERE "Year" = '1971'
What is the conference record for the year of 1971?
CREATE TABLE table_75478 ( "Year" text, "Overall Record" text, "Conference Record" text, "Coach" text, "Conference" text )
SELECT surface FROM table_1547951_3 WHERE outcome = "Runner-up" AND championship = "US Open"
Name the surfaace where outcome is runner-up and championship is us open
CREATE TABLE table_1547951_3 (surface VARCHAR, outcome VARCHAR, championship VARCHAR)
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Google"
Find all the papers published by the institution "Google".
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "POSA200L"
what is the drug type and route prescribed for the drug code posa200l?
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 ) ...
SELECT partner FROM table_1547951_3 WHERE opponents = "Mark Woodforde Martina Navratilova"
Name the partner for mark woodforde martina navratilova
CREATE TABLE table_1547951_3 (partner VARCHAR, opponents VARCHAR)
SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Tokohu University"
How many papers are published by the institution "Tokohu University"?
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
SELECT "Years" FROM table_47224 WHERE "From" = 'connecticut'
What years were from Connecticut?
CREATE TABLE table_47224 ( "Player" text, "Nationality" text, "Jersey Number(s)" text, "Position" text, "Years" text, "From" text )
SELECT score FROM table_1547951_3 WHERE opponents = "Rick Leach Zina Garrison"
Name the score for rick leach zina garrison
CREATE TABLE table_1547951_3 (score VARCHAR, opponents VARCHAR)
SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania"
Find the number of papers published by the institution "University of Pennsylvania".
CREATE TABLE inst (instid VARCHAR, name VARCHAR); CREATE TABLE authorship (paperid VARCHAR, instid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
SELECT message FROM table_name_75 WHERE designation_hd = "hd 186408"
What message has hd 186408 as a designation HD?
CREATE TABLE table_name_75 ( message VARCHAR, designation_hd VARCHAR )
SELECT swimsuit FROM table_15532342_2 WHERE state = "Arizona"
Name the swimsuit for arizona
CREATE TABLE table_15532342_2 (swimsuit VARCHAR, state VARCHAR)
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Olin" AND t1.lname = "Shivers"
Find the papers which have "Olin Shivers" as an author.
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) DESC
What are the number of the facility codes of the apartments with more than four bedrooms?, and list by the y axis from high to low.
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE Apartment_Bookings ( apt_bookin...
SELECT driver FROM table_15530244_5 WHERE race_2 = "7"
Name the driver for race 2 7
CREATE TABLE table_15530244_5 (driver VARCHAR, race_2 VARCHAR)
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Stephanie" AND t1.lname = "Weirich"
Which papers have "Stephanie Weirich" as an author?
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE authors (authid VARCHAR, fname VARCHAR, lname VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Hemochromatosis due to repeated red blood cell transfusions"
among patients diagnosed with hemochromatosis due to repeated red blood cell transfusions, how many of them were unmarried?
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 ) ...
SELECT COUNT(qualifying) FROM table_15530244_5 WHERE race_3 = "3"
Name the total number of qualifiying for race 3 being 3
CREATE TABLE table_15530244_5 (qualifying VARCHAR, race_3 VARCHAR)
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "USA" AND t2.authorder = 2 AND t1.lname = "Turon"
Which paper is published in an institution in "USA" and have "Turon" as its second author?
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR)
SELECT COUNT(value__) AS $m_ FROM table_name_21 WHERE revenue__$m_ > 193 AND rank < 12 AND team = "manchester united"
Name the total number of value for revenue more than 193 and rank less than 12 for manchester united
CREATE TABLE table_name_21 ( value__ VARCHAR, team VARCHAR, revenue__$m_ VARCHAR, rank VARCHAR )
SELECT driver FROM table_15530244_5 WHERE race_2 = "2"
Name the driver for race 2 2
CREATE TABLE table_15530244_5 (driver VARCHAR, race_2 VARCHAR)
SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid JOIN inst AS t4 ON t2.instid = t4.instid WHERE t4.country = "Japan" AND t2.authorder = 1 AND t1.lname = "Ohori"
Find the titles of papers whose first author is affiliated with an institution in the country "Japan" and has last name "Ohori"?
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR, instid VARCHAR, authorder VARCHAR); CREATE TABLE authors (authid VARCHAR, lname VARCHAR); CREATE TABLE papers (title VARCHAR, paperid VARCHAR); CREATE TABLE inst (instid VARCHAR, country VARCHAR)
SELECT "Home team" FROM table_49867 WHERE "Score" = '85-101'
Which home team had a score of 85-101?
CREATE TABLE table_49867 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
SELECT race_1 FROM table_15530244_5 WHERE race_3 = "8"
Name the race 1 when race 3 is 8
CREATE TABLE table_15530244_5 (race_1 VARCHAR, race_3 VARCHAR)
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.fname, t1.lname ORDER BY COUNT(*) DESC LIMIT 1
What is the last name of the author that has published the most papers?
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR)
SELECT p.OwnerUserId, u.DisplayName, DATE(p.CreationDate) AS "Date", CAST(p.CreationDate AS TIMESTAMP) AS "Time", p.ParentId FROM Posts AS p, Users AS u WHERE p.PostTypeId = 2 AND p.ParentId = @Question AND u.Id = OwnerUserId ORDER BY p.CreationDate
Find out who answered first.. Answered in the same second as someone else? No problem, check out the number of milliseconds it differs.
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTasks ( Id num...
SELECT race_2 FROM table_15530244_5 WHERE driver = "James Winslow"
Name the race 2 for james winslow
CREATE TABLE table_15530244_5 (race_2 VARCHAR, driver VARCHAR)
SELECT t1.country FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.country ORDER BY COUNT(*) DESC LIMIT 1
Retrieve the country that has published the most papers.
CREATE TABLE inst (country VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR)
SELECT T1.Allergy, COUNT(T1.Allergy) FROM Allergy_Type AS T1 JOIN Has_Allergy AS T2 ON T1.Allergy = T2.Allergy JOIN Student AS T3 ON T3.StuID = T2.StuID WHERE T3.Fname = "Lisa" GROUP BY T1.Allergy
What is the number of each allergie that the student with first name Lisa has? Draw a bar chart.
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 Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
SELECT COUNT(pos) FROM table_15530244_5 WHERE race_1 = "2"
Name the total number of positions for race 1 being 2
CREATE TABLE table_15530244_5 (pos VARCHAR, race_1 VARCHAR)
SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1
Find the name of the organization that has published the largest number of papers.
CREATE TABLE inst (name VARCHAR, instid VARCHAR); CREATE TABLE authorship (instid VARCHAR, paperid VARCHAR); CREATE TABLE papers (paperid VARCHAR)
SELECT "Opponent" FROM table_25437 WHERE "Result" = '3–6, 4–6, 6–1, 6–7 (7–9)'
Name the opponent for 3 6, 4 6, 6 1, 6 7 (7 9)
CREATE TABLE table_25437 ( "Edition" text, "Round" text, "Date" text, "Against" text, "Surface" text, "Opponent" text, "W\u2013L" text, "Result" text )
SELECT report FROM table_15511178_3 WHERE pole_position = "Carl Skerlong" AND winning_team = "Newman Wachs Racing"
Did the race get reported where the winning team was Newman Wachs racing and the pole belonged to Carl Skerlong
CREATE TABLE table_15511178_3 (report VARCHAR, pole_position VARCHAR, winning_team VARCHAR)
SELECT title FROM papers WHERE title LIKE "%ML%"
Find the titles of the papers that contain the word "ML".
CREATE TABLE papers (title VARCHAR)
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'allergic rhinitis nos') AND STRFTIME('%y', diagnoses_icd.charttime) <= '2104' GROUP BY STRFTIME('%y', ...
what is the minimum yearly number of patients that are suffering from allergic rhinitis nos until 2104?
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, ...
SELECT report FROM table_15511178_3 WHERE rd = 8
Did the round 8 race get reported
CREATE TABLE table_15511178_3 (report VARCHAR, rd VARCHAR)
SELECT title FROM papers WHERE title LIKE "%Database%"
Which paper's title contains the word "Database"?
CREATE TABLE papers (title VARCHAR)
SELECT high_rebounds FROM table_name_86 WHERE high_assists = "delonte west (10)"
What is High Rebounds, when High Assists is 'Delonte West (10)'?
CREATE TABLE table_name_86 ( high_rebounds VARCHAR, high_assists VARCHAR )
SELECT race FROM table_15511178_3 WHERE winning_team = "Mathiasen Motorsports" AND pole_position = "Jonathan Bomarito"
Which race was the winning team mathiasen motorsports and the pole belonged to jonathan bomarito
CREATE TABLE table_15511178_3 (race VARCHAR, winning_team VARCHAR, pole_position VARCHAR)
SELECT t1.fname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Functional%"
Find the first names of all the authors who have written a paper with title containing the word "Functional".
CREATE TABLE authors (fname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR); CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR)
SELECT DISTINCT year FROM Movie AS T1 JOIN Rating AS T2 ON T1.mID = T2.mID WHERE T2.stars >= 4 ORDER BY T1.year
Find all years that have a movie that received a rating of 4 or 5, and sort them in increasing order of year.
CREATE TABLE Movie ( mID VARCHAR, year VARCHAR ) CREATE TABLE Rating ( mID VARCHAR, stars VARCHAR )
SELECT COUNT(winning_driver) FROM table_15511178_3 WHERE rd = 8
how many winners were in round 8
CREATE TABLE table_15511178_3 (winning_driver VARCHAR, rd VARCHAR)
SELECT t1.lname FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t3.title LIKE "%Monadic%"
Find the last names of all the authors that have written a paper with title containing the word "Monadic".
CREATE TABLE authorship (authid VARCHAR, paperid VARCHAR); CREATE TABLE authors (lname VARCHAR, authid VARCHAR); CREATE TABLE papers (paperid VARCHAR, title VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Influenza Virus Vaccine"
what is the number of patients whose ethnicity is hispanic/latino - puerto rican and drug name is influenza virus vaccine?
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
SELECT channel_tv___dt__ FROM table_1553485_1 WHERE station = "KPIX"
What channel tv (dt) plays the KPIX station?
CREATE TABLE table_1553485_1 (channel_tv___dt__ VARCHAR, station VARCHAR)
SELECT t2.title FROM authorship AS t1 JOIN papers AS t2 ON t1.paperid = t2.paperid WHERE t1.authorder = (SELECT MAX(authorder) FROM authorship)
Retrieve the title of the paper that has the largest number of authors.
CREATE TABLE authorship (authorder INTEGER); CREATE TABLE authorship (paperid VARCHAR, authorder INTEGER); CREATE TABLE papers (title VARCHAR, paperid VARCHAR)
SELECT "First Class Team" FROM table_77939 WHERE "Player" = 'sanath jayasuriya'
What first class team does sanath jayasuriya play for?
CREATE TABLE table_77939 ( "Player" text, "Date of Birth" text, "Batting Style" text, "Bowling Style" text, "First Class Team" text )
SELECT city_of_license__market FROM table_1553485_1 WHERE channel_tv___dt__ = "3 (26)"
Which city of license/market has 3 (26) as their channel tv (dt)?
CREATE TABLE table_1553485_1 (city_of_license__market VARCHAR, channel_tv___dt__ VARCHAR)
SELECT fname FROM authors WHERE lname = "Ueno"
What is the first name of the author with last name "Ueno"?
CREATE TABLE authors (fname VARCHAR, lname VARCHAR)
SELECT COUNT("Verbs") FROM table_23315 WHERE "Yo" = 'sienta'
how many verbs have the yo form as sienta?
CREATE TABLE table_23315 ( "Verbs" text, "Yo" text, "T\u00fa" text, "Vos (*)" text, "\u00c9l / Ella / Usted" text, "Nosotros / Nosotras" text, "Vosotros / Vosotras" text, "Ellos / Ellas / Ustedes" text )
SELECT channel_tv___dt__ FROM table_1553485_1 WHERE city_of_license__market = "San Francisco - Oakland - San Jose"
Which channel tv (dt) plays in San Francisco - Oakland - San Jose?
CREATE TABLE table_1553485_1 (channel_tv___dt__ VARCHAR, city_of_license__market VARCHAR)
SELECT lname FROM authors WHERE fname = "Amal"
Find the last name of the author with first name "Amal".
CREATE TABLE authors (lname VARCHAR, fname VARCHAR)
SELECT ABS((SELECT "gdp (usd bln, 2012)" FROM table_203_530 WHERE "country" = 'albania') - (SELECT "gdp (usd bln, 2012)" FROM table_203_530 WHERE "country" = 'algeria'))
what is the difference in 2012 gdp between albania and algeria ?
CREATE TABLE table_203_530 ( id number, "country" text, "gdp (usd bln, 2012)" number, "gdp (usd bln, 2017)" number, "gdp (usd ppp bln, 2012)" number, "gdp (usd ppp bln, 2017)" number, "per capita (usd, 2012)" number, "per capita (usd, 2017)" number, "per capita (usd ppp, 2012)" numbe...
SELECT COUNT(years_owned) FROM table_1553485_1 WHERE station = "KPIX"
How many years has station KPIX been owned?
CREATE TABLE table_1553485_1 (years_owned VARCHAR, station VARCHAR)
SELECT fname FROM authors ORDER BY fname
Find the first names of all the authors ordered in alphabetical order.
CREATE TABLE authors (fname VARCHAR)
SELECT (SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-8658' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1) AND NOT patient.admissionweight IS NULL ORD...
how much different is patient 016-8658's weight last measured on the first hospital visit compared to the value first measured on the first hospital visit?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
SELECT current_affiliation FROM table_1553485_1 WHERE city_of_license__market = "San Francisco - Oakland - San Jose"
Who currently affiliates in San Francisco - Oakland - San Jose?
CREATE TABLE table_1553485_1 (current_affiliation VARCHAR, city_of_license__market VARCHAR)
SELECT lname FROM authors ORDER BY lname
Retrieve all the last names of authors in alphabetical order.
CREATE TABLE authors (lname VARCHAR)
SELECT COUNT(*) FROM Users
Number of users on SO.
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDa...
SELECT condition FROM table_1555308_1 WHERE bleeding_time = "Prolonged" AND prothrombin_time = "Unaffected"
In which condition(s) is bleeding time prolonged and prothrombin time unaffected?
CREATE TABLE table_1555308_1 (condition VARCHAR, bleeding_time VARCHAR, prothrombin_time VARCHAR)
SELECT fname, lname FROM authors ORDER BY lname
Retrieve all the first and last names of authors in the alphabetical order of last names.
CREATE TABLE authors (fname VARCHAR, lname VARCHAR)
SELECT DISTINCT location_name FROM locations
Show all distinct location names.
CREATE TABLE ref_attraction_types ( attraction_type_code text, attraction_type_description text ) CREATE TABLE features ( feature_id number, feature_details text ) CREATE TABLE tourist_attraction_features ( tourist_attraction_id number, feature_id number ) CREATE TABLE staff ( staff_id nu...
SELECT COUNT(prothrombin_time) FROM table_1555308_1 WHERE platelet_count = "Decreased or unaffected"
How many entries for prothrombin time are there where platelet count is "decreased or unaffected"?
CREATE TABLE table_1555308_1 (prothrombin_time VARCHAR, platelet_count VARCHAR)
SELECT COUNT(DISTINCT last_name) FROM actor
How many different last names do the actors and actresses have?
CREATE TABLE actor (last_name VARCHAR)
SELECT representative FROM table_name_59 WHERE termination_of_mission = "mar 25, 1976"
Which representative has a Termination of MIssion date Mar 25, 1976?
CREATE TABLE table_name_59 ( representative VARCHAR, termination_of_mission VARCHAR )
SELECT bleeding_time FROM table_1555308_1 WHERE platelet_count = "Decreased" AND prothrombin_time = "Unaffected"
How is the bleeding time wherein platelet count is decreased and prothrombin time is unaffected?
CREATE TABLE table_1555308_1 (bleeding_time VARCHAR, platelet_count VARCHAR, prothrombin_time VARCHAR)
SELECT first_name FROM actor GROUP BY first_name ORDER BY COUNT(*) DESC LIMIT 1
What is the most popular first name of the actors?
CREATE TABLE actor (first_name VARCHAR)