answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT partner FROM table_18268930_1 WHERE location = "Tamara, HON"
Who's the partner at Tamara, Hon?
CREATE TABLE table_18268930_1 (partner VARCHAR, location VARCHAR)
SELECT budget_type_code, COUNT(*) FROM Documents_with_expenses GROUP BY budget_type_code
Show budget type codes and the number of documents in each budget type.
CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR)
SELECT COUNT(finish) FROM table_256862_1 WHERE entries = "15" AND winning_yacht = "L'Esprit d'Equipe"
Name the number of finishes for 15 entries 15 and l'esprit d'equipe
CREATE TABLE table_256862_1 ( finish VARCHAR, entries VARCHAR, winning_yacht VARCHAR )
SELECT MIN(votes_khuzestan) FROM table_1827900_1 WHERE _percentage_of_votes_khuzestan = "34.50"
How many votes Khuzestan were there when the percentage was 34.50?
CREATE TABLE table_1827900_1 (votes_khuzestan INTEGER, _percentage_of_votes_khuzestan VARCHAR)
SELECT budget_type_code FROM Documents_with_expenses GROUP BY budget_type_code ORDER BY COUNT(*) DESC LIMIT 1
What is the budget type code with most number of documents.
CREATE TABLE Documents_with_expenses (budget_type_code VARCHAR)
SELECT Country, COUNT(*) FROM perpetrator GROUP BY Country ORDER BY Country
What are the countries of perpetrators? Show each country and the corresponding number of perpetrators there Plot them as bar chart, I want to show names from low to high order.
CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, "Home Town" text ) CREATE TABLE perpetrator ( Perpetrator_ID int, People_ID int, Date text, Year real, Location text, Country text, Killed int, Injured int )
SELECT COUNT(votes_khuzestan) FROM table_1827900_1 WHERE _percentage_of_votes_khuzestan = "34.50"
How many figures for votes Khuzestan were there when the percentage was 34.50?
CREATE TABLE table_1827900_1 (votes_khuzestan VARCHAR, _percentage_of_votes_khuzestan VARCHAR)
SELECT document_id FROM Documents EXCEPT SELECT document_id FROM Documents_with_expenses
What are the ids of documents which don't have expense budgets?
CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_id VARCHAR)
SELECT "Attendance" FROM table_33344 WHERE "Week" = '6'
What was the attendance of the game in week 6?
CREATE TABLE table_33344 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
SELECT _percentage_of_votes_nationally FROM table_1827900_1 WHERE candidates = "Mahmoud Ahmadinejad"
What was the percentage of national votes for Mahmoud Ahmadinejad?
CREATE TABLE table_1827900_1 (_percentage_of_votes_nationally VARCHAR, candidates VARCHAR)
SELECT document_id FROM Documents WHERE document_type_code = "CV" EXCEPT SELECT document_id FROM Documents_with_expenses
Show ids for all documents in type CV without expense budgets.
CREATE TABLE Documents_with_expenses (document_id VARCHAR, document_type_code VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_type_code VARCHAR)
SELECT MIN(crowd) FROM table_name_38 WHERE home_team = "melbourne"
What is the smallest crowd for a game when Melbourne is the home team?
CREATE TABLE table_name_38 ( crowd INTEGER, home_team VARCHAR )
SELECT revenue__£million_ FROM table_18304259_1 WHERE earnings_per_share__p_ = "8.9"
Name the revenue for eps being 8.9
CREATE TABLE table_18304259_1 (revenue__£million_ VARCHAR, earnings_per_share__p_ VARCHAR)
SELECT T1.document_id FROM Documents AS T1 JOIN Documents_with_expenses AS T2 ON T1.document_id = T2.document_id WHERE T1.document_name LIKE '%s%'
What are the ids of documents with letter 's' in the name with any expense budgets.
CREATE TABLE Documents_with_expenses (document_id VARCHAR); CREATE TABLE Documents (document_id VARCHAR, document_name VARCHAR)
SELECT COUNT(*) FROM table_203_364 WHERE "driver" = 'jimmie johnson'
jimmy johnson won how many consecutive espy awards ?
CREATE TABLE table_203_364 ( id number, "year" number, "driver" text, "nation of citizenship" text, "racing series" text, "type of vehicle" text )
SELECT COUNT(year_to_april) FROM table_18304259_1 WHERE ebit__£m_ = "24.5"
Name the total number of year to april for ebit being 24.5
CREATE TABLE table_18304259_1 (year_to_april VARCHAR, ebit__£m_ VARCHAR)
SELECT COUNT(*) FROM Documents WHERE NOT document_id IN (SELECT document_id FROM Documents_with_expenses)
How many documents do not have any expense?
CREATE TABLE Documents (document_id VARCHAR); CREATE TABLE Documents_with_expenses (document_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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 20 AND date_day.month_number = 1 AND...
i need a flight tomorrow from ATLANTA to BALTIMORE
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
SELECT earnings_per_share__p_ FROM table_18304259_1 WHERE net_profit__£m_ = "39.2"
Name the eps for net profit being 39.2
CREATE TABLE table_18304259_1 (earnings_per_share__p_ VARCHAR, net_profit__£m_ VARCHAR)
SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'GV' INTERSECT SELECT T1.document_date FROM Documents AS T1 JOIN Documents_with_Expenses AS T2 ON T1.document_id = T2.document_id WHERE T2.budget_type_code = 'SF'
What are the dates for the documents with both 'GV' type and 'SF' type expenses?
CREATE TABLE Documents_with_Expenses (document_id VARCHAR, budget_type_code VARCHAR); CREATE TABLE Documents (document_date VARCHAR, document_id VARCHAR)
SELECT theme FROM table_26250199_1 WHERE episode = "Top 16 (8 Men)"
In episode Top 16 (8 Men), what are the themes?
CREATE TABLE table_26250199_1 ( theme VARCHAR, episode VARCHAR )
SELECT ebit__£m_ FROM table_18304259_1 WHERE earnings_per_share__p_ = "10.6"
Name the ebit for eps being 10.6
CREATE TABLE table_18304259_1 (ebit__£m_ VARCHAR, earnings_per_share__p_ VARCHAR)
SELECT MAX(Account_details) FROM Accounts UNION SELECT Account_details FROM Accounts WHERE Account_details LIKE "%5%"
What are the account details with the largest value or with value having char '5' in it?
CREATE TABLE Accounts (Account_details INTEGER)
SELECT order FROM table_name_84 WHERE species_authority = "hydrochaeris hydrochaeris (linnaeus, 1766)"
What order has the Species Authority of hydrochaeris hydrochaeris (linnaeus, 1766)?
CREATE TABLE table_name_84 ( order VARCHAR, species_authority VARCHAR )
SELECT pop_density__km_2__ FROM table_1828368_1 WHERE area__km_2__ = "28.3"
What are the population densities of all communes with an are of 28.3 sq.km.?
CREATE TABLE table_1828368_1 (pop_density__km_2__ VARCHAR, area__km_2__ VARCHAR)
SELECT COUNT(*) FROM scientists
Find the total number of scientists.
CREATE TABLE scientists (Id VARCHAR)
SELECT AVG(extra_points) FROM table_name_35 WHERE touchdowns < 2 AND player = "herrnstein" AND field_goals < 0
How many extra points are there that Herrnstein had with less than 2 touchdowns and less than 0 field goals?
CREATE TABLE table_name_35 ( extra_points INTEGER, field_goals VARCHAR, touchdowns VARCHAR, player VARCHAR )
SELECT commune FROM table_1828368_1 WHERE area__km_2__ = "12.4"
What commune has an area of 12.4 sq.km.?
CREATE TABLE table_1828368_1 (commune VARCHAR, area__km_2__ VARCHAR)
SELECT SUM(hours) FROM projects
Find the total hours of all projects.
CREATE TABLE projects (hours INTEGER)
SELECT "Gold" FROM table_69599 WHERE "Silver" > '30' AND "Total" < '107'
What Gold has a Silver greater than 30 and a Total less than 107?
CREATE TABLE table_69599 ( "Event" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real, "Ranking" text )
SELECT city FROM table_18299148_1 WHERE resolution = "Negotiated exile in Austria"
Which city has a resolution that is negotiated exile in Austria?
CREATE TABLE table_18299148_1 (city VARCHAR, resolution VARCHAR)
SELECT COUNT(DISTINCT scientist) FROM assignedto
How many different scientists are assigned to any project?
CREATE TABLE assignedto (scientist VARCHAR)
SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
Next semester how many classes are offered ?
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE course_offering ( offering_id int, course_id int, ...
SELECT COUNT(Missions) AS country FROM table_18299148_1 WHERE notability = "President of Burundi"
How many missions countries have notability with president of burundi?
CREATE TABLE table_18299148_1 (Missions VARCHAR, notability VARCHAR)
SELECT COUNT(DISTINCT name) FROM projects
Find the number of distinct projects.
CREATE TABLE projects (name VARCHAR)
SELECT type FROM table_name_42 WHERE artist = "hiroyuki takami"
What Type has the Artist of Hiroyuki Takami?
CREATE TABLE table_name_42 ( type VARCHAR, artist VARCHAR )
SELECT nickname_s_ FROM table_18304058_2 WHERE enrollment__2013_14_ = 436
What is the nickname of the team whose 2013/2014 enrollment is 436?
CREATE TABLE table_18304058_2 (nickname_s_ VARCHAR, enrollment__2013_14_ VARCHAR)
SELECT AVG(hours) FROM projects
Find the average hours of all projects.
CREATE TABLE projects (hours INTEGER)
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-198713')) AND STRFTIME('%y-%m', allergy.allergytime) >= '2105-06'
since 06/2105 has patient 022-198713 had any allergies?
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
SELECT team_name FROM table_18304058_2 WHERE sports = "Football" AND schools = "Elverado Trico"
What is the name of the team from the Elverado Trico school in football?
CREATE TABLE table_18304058_2 (team_name VARCHAR, sports VARCHAR, schools VARCHAR)
SELECT name FROM projects ORDER BY hours DESC LIMIT 1
Find the name of project that continues for the longest time.
CREATE TABLE projects (name VARCHAR, hours VARCHAR)
SELECT venue FROM table_name_4 WHERE date = "november 26"
What was the Venue on November 26?
CREATE TABLE table_name_4 ( venue VARCHAR, date VARCHAR )
SELECT years_of_kindergarten AS provided FROM table_1831309_1 WHERE canton = "Ticino"
How many years of kindergarten is provided in Ticino?
CREATE TABLE table_1831309_1 (years_of_kindergarten VARCHAR, canton VARCHAR)
SELECT name FROM projects WHERE hours > (SELECT AVG(hours) FROM projects)
List the name of all projects that are operated longer than the average working hours of all projects.
CREATE TABLE projects (name VARCHAR, hours INTEGER)
SELECT "Written by" FROM table_29793 WHERE "Production code(s)" = '225560'
who are the writers of the episode whose production code(s) is 225560?
CREATE TABLE table_29793 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code(s)" real, "U.S. viewers (millions)" text )
SELECT MAX(length_of_mandatory_secondary_school) FROM table_1831309_1
What is the longest length of mandatory secondary school?
CREATE TABLE table_1831309_1 (length_of_mandatory_secondary_school INTEGER)
SELECT T1.name, T1.hours FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T2.project ORDER BY COUNT(*) DESC LIMIT 1
Find the name and hours of project that has the most number of scientists.
CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, hours VARCHAR, code VARCHAR)
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57050) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2105-03'
calculate the number of medicines that patient 57050 had been prescribed since 03/2105.
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
SELECT writer_s FROM table_18305523_2 WHERE cover_date = "19 October 1985"
Who wrote the story that is cover date 19 October 1985?
CREATE TABLE table_18305523_2 (writer_s VARCHAR, cover_date VARCHAR)
SELECT T2.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name LIKE '%Smith%'
Find the name of the project for which a scientist whose name contains ‘Smith’ is assigned to.
CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR)
SELECT no FROM table_10015132_14 WHERE player = "Patrick O'Bryant"
Which number was Patrick O'Bryant?
CREATE TABLE table_10015132_14 ( no VARCHAR, player VARCHAR )
SELECT COUNT(cover_date) FROM table_18305523_2 WHERE story_title = "DEVASTATION DERBY! (Part 1)"
How many cover dates does the story "Devastation Derby! (part 1)" have?
CREATE TABLE table_18305523_2 (cover_date VARCHAR, story_title VARCHAR)
SELECT SUM(T2.hours) FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T3.name = 'Michael Rogers' OR T3.name = 'Carol Smith'
Find the total hours of the projects that scientists named Michael Rogers or Carol Smith are assigned to.
CREATE TABLE scientists (SSN VARCHAR, name VARCHAR); CREATE TABLE projects (hours INTEGER, code VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR)
SELECT AVG(attendance) FROM table_name_98 WHERE score = "0:0 - 4:1 (pen)"
How many Attendance in a match which scores 0:0 - 4:1 (pen)
CREATE TABLE table_name_98 ( attendance INTEGER, score VARCHAR )
SELECT comments FROM table_18305523_2 WHERE cover_date = "14 March 1987"
What is the comment on the issue dated 14 March 1987?
CREATE TABLE table_18305523_2 (comments VARCHAR, cover_date VARCHAR)
SELECT name FROM projects WHERE hours BETWEEN 100 AND 300
Find the name of projects that require between 100 and 300 hours of work.
CREATE TABLE projects (name VARCHAR, hours INTEGER)
SELECT "Date" FROM table_80096 WHERE "Venue" = 'firhill' AND "Opponent" = 'ayr united'
What day was the game held at Firhill against AYR United?
CREATE TABLE table_80096 ( "Round" text, "Date" text, "Opponent" text, "Venue" text, "Attendance" real )
SELECT story_title FROM table_18305523_2 WHERE artist_s = "Barry Kitson and Farmer"
What is the title of the issue where the art was done by Barry Kitson and Farmer?
CREATE TABLE table_18305523_2 (story_title VARCHAR, artist_s VARCHAR)
SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'Matter of Time' INTERSECT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.name = 'A Pu...
Find the name of the scientist who worked on both a project named 'Matter of Time' and a project named 'A Puzzling Parallax'.
CREATE TABLE projects (code VARCHAR, name VARCHAR); CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR)
SELECT SUM(points) FROM table_name_16 WHERE performer = "partners in crime"
What is the total sum of points for songs performed by Partners in Crime?
CREATE TABLE table_name_16 ( points INTEGER, performer VARCHAR )
SELECT MIN(_number) FROM table_18305523_1
What is the minimum number which is for title The Enemy Within part 1?
CREATE TABLE table_18305523_1 (_number INTEGER)
SELECT name FROM scientists ORDER BY name
List the names of all scientists sorted in alphabetical order.
CREATE TABLE scientists (name VARCHAR)
SELECT date_of_birth FROM table_name_61 WHERE pos = "cb" AND height = "m (ft 4in)"
What is the Date of Birth of the CB Player with a Height of m (ft 4in)?
CREATE TABLE table_name_61 ( date_of_birth VARCHAR, pos VARCHAR, height VARCHAR )
SELECT hydroxymatairesinol FROM table_1831262_2 WHERE sesamin = "62724"
what is the number of hydroxymatairesinol where sesamin is 62724?
CREATE TABLE table_1831262_2 (hydroxymatairesinol VARCHAR, sesamin VARCHAR)
SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project GROUP BY T1.name
Find the number of scientists involved for each project name.
CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR)
SELECT COUNT(lost) FROM table_name_39 WHERE points < 12 AND drawn > 1
Which Lost has Points smaller than 12, and a Drawn larger than 1?
CREATE TABLE table_name_39 ( lost VARCHAR, points VARCHAR, drawn VARCHAR )
SELECT sesamin FROM table_1831262_2 WHERE secoisolariciresinol = 240
what is the total number of sesamin were secoisolariciresinol is 240?
CREATE TABLE table_1831262_2 (sesamin VARCHAR, secoisolariciresinol VARCHAR)
SELECT COUNT(*), T1.name FROM projects AS T1 JOIN assignedto AS T2 ON T1.code = T2.project WHERE T1.hours > 300 GROUP BY T1.name
Find the number of scientists involved for the projects that require more than 300 hours.
CREATE TABLE assignedto (project VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER)
SELECT DISTINCT course_offering.end_time, course_offering.section_number, course_offering.start_time FROM course, course_offering, semester WHERE course_offering.start_time > '16:30' AND course.course_id = course_offering.course_id AND course.department = 'PHYSIOL' AND course.number = 545 AND semester.semester = 'WN' A...
Does PHYSIOL 545 offer a section after 16:30 P.M. ?
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TA...
SELECT MAX(pinoresinol) FROM table_1831262_2 WHERE foodstuff = "Wheat bran"
what is the maximum number of pinorinol in wheat bran?
CREATE TABLE table_1831262_2 (pinoresinol INTEGER, foodstuff VARCHAR)
SELECT COUNT(*), T1.name FROM scientists AS T1 JOIN assignedto AS T2 ON T1.ssn = T2.scientist GROUP BY T1.name
Find the number of projects which each scientist is working on and scientist's name.
CREATE TABLE scientists (name VARCHAR, ssn VARCHAR); CREATE TABLE assignedto (scientist VARCHAR)
SELECT circuit FROM table_name_10 WHERE event = "international procar meeting"
Which Circuit has an Event of international procar meeting?
CREATE TABLE table_name_10 ( circuit VARCHAR, event VARCHAR )
SELECT sesamin FROM table_1831262_2 WHERE foodstuff = "Sesame seed"
how much sesamin is in sesame seed?
CREATE TABLE table_1831262_2 (sesamin VARCHAR, foodstuff VARCHAR)
SELECT T3.ssn, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)
Find the SSN and name of scientists who are assigned to the project with the longest hours.
CREATE TABLE scientists (ssn VARCHAR, name VARCHAR, SSN VARCHAR); CREATE TABLE projects (code VARCHAR, hours INTEGER); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (hours INTEGER)
SELECT T2.Name, AVG(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
Draw a bar chart for what are the names and average prices of products for manufacturers whose products cost on average 150 or more?, and list in descending by the Name.
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
SELECT MIN(lariciresinol) FROM table_1831262_2 WHERE matairesinol = 440
what is the minimum number is lariciresinol where matairesinol number is 440?
CREATE TABLE table_1831262_2 (lariciresinol INTEGER, matairesinol VARCHAR)
SELECT T2.name FROM assignedto AS T1 JOIN scientists AS T2 ON T1.scientist = T2.ssn
Find the name of scientists who are assigned to some project.
CREATE TABLE assignedto (scientist VARCHAR); CREATE TABLE scientists (name VARCHAR, ssn VARCHAR)
SELECT Id, TagName FROM Tags LIMIT 90
SELECT * From Badges LEFT JOIN Users on Badges.Id = Users.Id.
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Na...
SELECT calling_at FROM table_18332845_2 WHERE arrival = "18.42"
What was the calling for the 18.42 arrival time?
CREATE TABLE table_18332845_2 (calling_at VARCHAR, arrival VARCHAR)
SELECT Name FROM Projects WHERE NOT Code IN (SELECT Project FROM AssignedTo)
Select the project names which are not assigned yet.
CREATE TABLE Projects (Name VARCHAR, Code VARCHAR, Project VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, Code VARCHAR, Project VARCHAR)
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 = 7241)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit wt' ...
what was patient 7241's weight the last time in 05/2103?
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id...
SELECT arrival FROM table_18332845_2 WHERE calling_at = "Wansford, Peterborough East"
What was the arrival for Wansford, Peterborough East?
CREATE TABLE table_18332845_2 (arrival VARCHAR, calling_at VARCHAR)
SELECT Name FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
Find the name of scientists who are not assigned to any project.
CREATE TABLE scientists (Name VARCHAR, ssn VARCHAR, scientist VARCHAR); CREATE TABLE AssignedTo (Name VARCHAR, ssn VARCHAR, scientist VARCHAR)
SELECT COUNT("Points for") FROM table_29400 WHERE "Played" = 'Played'
Name the total number of points for for played
CREATE TABLE table_29400 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Points" text )
SELECT departure FROM table_18332845_2 WHERE arrival = "14.40"
What was the departure time when the arrival was 14.40?
CREATE TABLE table_18332845_2 (departure VARCHAR, arrival VARCHAR)
SELECT COUNT(*) FROM scientists WHERE NOT ssn IN (SELECT scientist FROM AssignedTo)
Find the number of scientists who are not assigned to any project.
CREATE TABLE AssignedTo (ssn VARCHAR, scientist VARCHAR); CREATE TABLE scientists (ssn VARCHAR, scientist VARCHAR)
SELECT opponent FROM table_name_25 WHERE week < 7 AND game_site = "tulane stadium"
Who did the Giants play before week 7 in Tulane Stadium?
CREATE TABLE table_name_25 ( opponent VARCHAR, week VARCHAR, game_site VARCHAR )
SELECT departure FROM table_18332845_2 WHERE going_to = "Peterborough East" AND arrival = "12.40"
What is the departure for Peterborough East whose arrival time is 12.40?
CREATE TABLE table_18332845_2 (departure VARCHAR, going_to VARCHAR, arrival VARCHAR)
SELECT name FROM scientists EXCEPT SELECT T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MAX(hours) FROM projects)
Find the names of scientists who are not working on the project with the highest hours.
CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (code VARCHAR, hours INTEGER); CREATE TABLE scientists (name VARCHAR, hours INTEGER); CREATE TABLE projects (name VARCHAR, hours INTEGER)
SELECT ravg FROM table_name_27 WHERE ratt = "9"
What is the RAvg of the year with Ratt of 9?
CREATE TABLE table_name_27 ( ravg VARCHAR, ratt VARCHAR )
SELECT calling_at FROM table_18332845_2 WHERE departure = "09.50"
What is the calling at for the 09.50 departure?
CREATE TABLE table_18332845_2 (calling_at VARCHAR, departure VARCHAR)
SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name, T1.Name
List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name.
CREATE TABLE AssignedTo (Scientist VARCHAR, Project VARCHAR); CREATE TABLE Projects (Name VARCHAR, Hours VARCHAR, Code VARCHAR); CREATE TABLE Scientists (Name VARCHAR, SSN VARCHAR)
SELECT tries_for FROM table_name_3 WHERE points = "5" AND tries_against = "2"
How many tries for are associated with 5 points and 2 tries against?
CREATE TABLE table_name_3 ( tries_for VARCHAR, points VARCHAR, tries_against VARCHAR )
SELECT going_to FROM table_18332845_2 WHERE departure = "20.35"
Where is the train going to when departing at 20.35?
CREATE TABLE table_18332845_2 (going_to VARCHAR, departure VARCHAR)
SELECT T2.name, T3.name FROM assignedto AS T1 JOIN projects AS T2 ON T1.project = T2.code JOIN scientists AS T3 ON T1.scientist = T3.SSN WHERE T2.hours = (SELECT MIN(hours) FROM projects)
Find name of the project that needs the least amount of time to finish and the name of scientists who worked on it.
CREATE TABLE scientists (name VARCHAR, SSN VARCHAR); CREATE TABLE assignedto (project VARCHAR, scientist VARCHAR); CREATE TABLE projects (name VARCHAR, code VARCHAR, hours INTEGER); CREATE TABLE projects (hours INTEGER)
SELECT MAX(no_in_season) FROM table_18268826_1 WHERE us_viewers__million_ = "3.19"
What's the season number of the episode viewed by 3.19 million people in the US?
CREATE TABLE table_18268826_1 ( no_in_season INTEGER, us_viewers__million_ VARCHAR )
SELECT 3 AS _dart_average FROM table_18317531_1 WHERE player = "Michael van Gerwen"
Name the 3 dart average for michael van gerwen
CREATE TABLE table_18317531_1 (player VARCHAR)
SELECT Name FROM WINE ORDER BY Score LIMIT 1
What is the name of the highest rated wine?
CREATE TABLE WINE (Name VARCHAR, Score VARCHAR)
SELECT * FROM PostHistory AS ph WHERE ph.PostId = (SELECT t.WikiPostId FROM Tags AS t WHERE t.TagName = '##TagName:string##') ORDER BY CreationDate
Search tag wiki history example.
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...
SELECT COUNT(calling_at) FROM table_18333678_2 WHERE arrival = "09.06"
how many callings of trains arriving at 09.06
CREATE TABLE table_18333678_2 (calling_at VARCHAR, arrival VARCHAR)