answer
stringlengths
6
3.91k
question
stringlengths
7
766
context
stringlengths
27
7.14k
SELECT "rider" FROM table_203_166 ORDER BY "pos" LIMIT 1
who is at the top out of the riders ?
CREATE TABLE table_203_166 ( id number, "pos" text, "no" number, "rider" text, "manufacturer" text, "laps" number, "time" text, "grid" number, "points" number )
SELECT track_ & _field FROM table_16423070_4 WHERE swimming = "Lexington" AND volleyball = "Madison"
which country won swimming track & field when lexington won swimming and madison won volleyball
CREATE TABLE table_16423070_4 (track_ VARCHAR, _field VARCHAR, swimming VARCHAR, volleyball VARCHAR)
SELECT Nationality FROM ship GROUP BY Nationality HAVING COUNT(*) > 2
List the nations that have more than two ships.
CREATE TABLE ship (Nationality VARCHAR)
SELECT TIME_TO_STR(CreationDate, '%h') AS hour, COUNT(CASE WHEN PostTypeId = 1 THEN 1 END) AS questions, COUNT(CASE WHEN PostTypeId = 2 THEN 1 END) AS answers FROM Posts WHERE PostTypeId IN (1, 2) GROUP BY TIME_TO_STR(CreationDate, '%h')
questions answers per hour for user.
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
SELECT COUNT(golf) FROM table_16423070_4 WHERE soccer = "Wooster"
how many teams won at golf when wooster won soccer
CREATE TABLE table_16423070_4 (golf VARCHAR, soccer VARCHAR)
SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE
Show different types of ships and the average tonnage of ships of each type.
CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER)
SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
For those records from the products and each product's manufacturer, find name and the average of revenue , and group by attribute name, and visualize them by a bar chart.
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 soccer FROM table_16423070_4 WHERE volleyball = "Madison" AND cross_country = "Lexington" AND softball = "Orrville"
Who won soccer when madison won volleyball, lexington won cross country and orrville won softball
CREATE TABLE table_16423070_4 (soccer VARCHAR, softball VARCHAR, volleyball VARCHAR, cross_country VARCHAR)
SELECT T1.Code, T1.Fate, T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID
Show codes and fates of missions, and names of ships involved.
CREATE TABLE mission (Code VARCHAR, Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR)
SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code
what are the different card types, and how many transactions have been made with each?
CREATE TABLE Customers ( customer_id INTEGER, customer_first_name VARCHAR(20), customer_last_name VARCHAR(20), customer_address VARCHAR(255), customer_phone VARCHAR(255), customer_email VARCHAR(255), other_customer_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction...
SELECT volleyball FROM table_16423070_4 WHERE basketball = "West Holmes" AND swimming = "Wooster" AND school_year = "2011-12"
Who won volleyball when west holmes won basketball and wooster won swimming in 2011-12
CREATE TABLE table_16423070_4 (volleyball VARCHAR, school_year VARCHAR, basketball VARCHAR, swimming VARCHAR)
SELECT T2.Name FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T1.Launched_Year > 1928
Show names of ships involved in a mission launched after 1928.
CREATE TABLE mission (Ship_ID VARCHAR, Launched_Year INTEGER); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR)
SELECT to_par FROM table_name_55 WHERE player = "tommy bolt"
What is To Par, when Player is 'Tommy Bolt'?
CREATE TABLE table_name_55 ( to_par VARCHAR, player VARCHAR )
SELECT tennis FROM table_16423070_4 WHERE softball = "Ashland" AND volleyball = "Wooster"
who won tennis when ashland won softball and wooster won volleybal
CREATE TABLE table_16423070_4 (tennis VARCHAR, softball VARCHAR, volleyball VARCHAR)
SELECT DISTINCT T1.Fate FROM mission AS T1 JOIN ship AS T2 ON T1.Ship_ID = T2.Ship_ID WHERE T2.Nationality = "United States"
Show the distinct fate of missions that involve ships with nationality "United States"
CREATE TABLE mission (Fate VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Ship_ID VARCHAR, Nationality VARCHAR)
SELECT MAX("Wins") FROM table_20326 WHERE "Success Rate" = '68.75%'
Name the maximum wins for 68.75%
CREATE TABLE table_20326 ( "Year" real, "Matches" real, "Wins" real, "Losses" real, "No Result" real, "Tied" real, "Success Rate" text, "Position" text, "Summary" text )
SELECT basketball FROM table_16423070_4 WHERE track_ & _field = "Ashland" AND cross_country = "Ashland"
who won basketball when ashland won track & field and cross country
CREATE TABLE table_16423070_4 (basketball VARCHAR, cross_country VARCHAR, track_ VARCHAR, _field VARCHAR)
SELECT Name FROM ship WHERE NOT Ship_ID IN (SELECT Ship_ID FROM mission)
List the name of ships that are not involved in any mission
CREATE TABLE mission (Name VARCHAR, Ship_ID VARCHAR); CREATE TABLE ship (Name VARCHAR, Ship_ID VARCHAR)
SELECT home_team FROM table_16388398_2 WHERE ground = "M.C.G."
What is the home team that played on M.C.G. grounds?
CREATE TABLE table_16388398_2 ( home_team VARCHAR, ground VARCHAR )
SELECT location FROM table_16432543_1 WHERE established = 1923
What is the location of the school established in 1923
CREATE TABLE table_16432543_1 (location VARCHAR, established VARCHAR)
SELECT TYPE FROM ship WHERE Tonnage > 6000 INTERSECT SELECT TYPE FROM ship WHERE Tonnage < 4000
Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.
CREATE TABLE ship (TYPE VARCHAR, Tonnage INTEGER)
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) DESC
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and show Y in desc order.
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY...
SELECT COUNT(enrollment) FROM table_16432543_1 WHERE nickname = "Blue Hens"
Total enrollment at the school with the nickname Blue Hens
CREATE TABLE table_16432543_1 (enrollment VARCHAR, nickname VARCHAR)
SELECT COUNT(*) FROM list
Find the number of students in total.
CREATE TABLE list (Id VARCHAR)
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = '...
What are the upper-level elective options for the Spring and Summer ?
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
SELECT nickname FROM table_16432543_1 WHERE established = 1773
Nickname of the school established in 1773
CREATE TABLE table_16432543_1 (nickname VARCHAR, established VARCHAR)
SELECT lastname FROM list WHERE classroom = 111
Find the last names of students studying in room 111.
CREATE TABLE list (lastname VARCHAR, classroom VARCHAR)
SELECT COUNT("Incumbent") FROM table_18607 WHERE "District" = 'New York 10'
How many sitting Representatives are there in the New York 10 polling area?
CREATE TABLE table_18607 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
SELECT established FROM table_16432543_1 WHERE institution = "Rowan University"
What is the year Rowan University was established
CREATE TABLE table_16432543_1 (established VARCHAR, institution VARCHAR)
SELECT firstname FROM list WHERE classroom = 108
Find the first names of students studying in room 108.
CREATE TABLE list (firstname VARCHAR, classroom VARCHAR)
SELECT date FROM table_name_75 WHERE result = "3–0"
What is the Date of the Competition with a Result of 3 0?
CREATE TABLE table_name_75 ( date VARCHAR, result VARCHAR )
SELECT COUNT(nickname) FROM table_16432543_1 WHERE location = "Newark, DE"
How many nicknames does the school in Newark, DE have
CREATE TABLE table_16432543_1 (nickname VARCHAR, location VARCHAR)
SELECT DISTINCT firstname FROM list WHERE classroom = 107
What are the first names of students studying in room 107?
CREATE TABLE list (firstname VARCHAR, classroom VARCHAR)
SELECT high_points FROM table_11960407_5 WHERE game = 49
Who scored the most points in Game 49?
CREATE TABLE table_11960407_5 ( high_points VARCHAR, game VARCHAR )
SELECT location FROM table_16432543_1 WHERE nickname = "Mountaineers"
Location of the school with the nickname Mountaineers
CREATE TABLE table_16432543_1 (location VARCHAR, nickname VARCHAR)
SELECT DISTINCT classroom, grade FROM list
For each classroom report the grade that is taught in it. Report just the classroom number and the grade number.
CREATE TABLE list (classroom VARCHAR, grade VARCHAR)
SELECT "Entrant" FROM table_14649 WHERE "Chassis" = 'mclaren m7c'
Which entrant has a Mclaren m7c Chassis?
CREATE TABLE table_14649 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
SELECT written_by FROM table_16432167_1 WHERE production_code = "942A"
Who wrote the episode with the production code of 942A?
CREATE TABLE table_16432167_1 (written_by VARCHAR, production_code VARCHAR)
SELECT DISTINCT grade FROM list WHERE classroom = 103
Which grade is studying in classroom 103?
CREATE TABLE list (grade VARCHAR, classroom VARCHAR)
SELECT date FROM table_name_30 WHERE opponent = "miami dolphins"
On what date was the opponent the Miami Dolphins?
CREATE TABLE table_name_30 ( date VARCHAR, opponent VARCHAR )
SELECT english_title FROM table_16425614_3 WHERE official__number = 22
What is the English title for the official number 22 episode?
CREATE TABLE table_16425614_3 (english_title VARCHAR, official__number VARCHAR)
SELECT DISTINCT grade FROM list WHERE classroom = 105
Find the grade studying in room 105.
CREATE TABLE list (grade VARCHAR, classroom VARCHAR)
WITH TaggedPosts AS (SELECT ViewCount FROM Posts WHERE PostTypeId = 1 AND Tags LIKE '%##tagSubstring?python##%'), MostViewedQuestions AS (SELECT Count = COUNT(*) FROM TaggedPosts WHERE ViewCount > '##nviews:int?10000##') SELECT Count, CAST(Count AS FLOAT(20, 5)) * 100.0 / (SELECT COUNT(*) FROM TaggedPosts) AS Percentil...
Number of questions with ViewCount > nviews.
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId num...
SELECT cfl_team FROM table_16441561_5 WHERE college = "British Columbia"
Which CFL team did the player from British Columbia get drafted to
CREATE TABLE table_16441561_5 (cfl_team VARCHAR, college VARCHAR)
SELECT DISTINCT classroom FROM list WHERE grade = 4
Which classrooms are used by grade 4?
CREATE TABLE list (classroom VARCHAR, grade VARCHAR)
SELECT "Tally" FROM table_13960 WHERE "Total" > '8' AND "Opposition" = 'waterford'
What is the tally with a total larger than 8, Waterford was the opposition?
CREATE TABLE table_13960 ( "Rank" real, "Player" text, "County" text, "Tally" text, "Total" real, "Opposition" text )
SELECT position FROM table_16441561_5 WHERE college = "Laval"
Which positions had players from Laval college
CREATE TABLE table_16441561_5 (position VARCHAR, college VARCHAR)
SELECT DISTINCT classroom FROM list WHERE grade = 5
Which classrooms are used by grade 5?
CREATE TABLE list (classroom VARCHAR, grade VARCHAR)
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Health Care Markets and Public Policies%' OR course.description LIKE '%Health Care Markets and Public Policies%' OR course.name LIKE '%Health Care Markets and Public Pol...
Which courses involve parts of Integ Microsys Lab and Health Care Markets and Public Policies , can you show me ?
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE offering_instructor ( offering_ins...
SELECT position FROM table_16441561_5 WHERE player = "Gene Stahl"
What position did Gene Stahl play
CREATE TABLE table_16441561_5 (position VARCHAR, player VARCHAR)
SELECT DISTINCT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 5
Find the last names of the teachers that teach fifth grade.
CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR)
SELECT "Weight" FROM table_79053 WHERE "Club" = 'panionios g.c.' AND "Date of Birth" = '1975-05-21'
What is the weight of the player from club panionios g.c. and was born on 1975-05-21?
CREATE TABLE table_79053 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
SELECT player FROM table_16441561_5 WHERE position = "DB"
Which player played DB
CREATE TABLE table_16441561_5 (player VARCHAR, position VARCHAR)
SELECT DISTINCT T2.firstname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE grade = 1
Find the first names of the teachers that teach first grade.
CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR)
SELECT "Player" FROM table_27735 WHERE "MLS Team" = 'Philadelphia Union'
What player was drafted by the philadelphia union?
CREATE TABLE table_27735 ( "Pick #" real, "MLS Team" text, "Player" text, "Position" text, "Affiliation" text )
SELECT MIN(pick__number) FROM table_16441561_5 WHERE position = "LB"
Who was the lowest picked LB
CREATE TABLE table_16441561_5 (pick__number INTEGER, position VARCHAR)
SELECT firstname FROM teachers WHERE classroom = 110
Find the first names of all the teachers that teach in classroom 110.
CREATE TABLE teachers (firstname VARCHAR, classroom VARCHAR)
SELECT "Years of Participation" FROM table_21685 WHERE "School" = 'Pickerington North'
What are the years of participation for pickerington north?
CREATE TABLE table_21685 ( "School" text, "Years of Participation" text, "OCC Championships" real, "Last OCC Championship" text, "Last Outright OCC Championship" text )
SELECT COUNT(position) FROM table_16441561_5 WHERE player = "Jeff Brown"
How many players named Jeff Brown were drafted
CREATE TABLE table_16441561_5 (position VARCHAR, player VARCHAR)
SELECT lastname FROM teachers WHERE classroom = 109
Find the last names of teachers teaching in classroom 109.
CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR)
SELECT AVG("Laps") FROM table_15315 WHERE "Finish" = '23'
What is the average lap of the race with a 23 finish?
CREATE TABLE table_15315 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
SELECT MIN(m_v_ft_s) FROM table_16439764_1 WHERE max_height__ft_ = 23500
How many feet per second does a shell move where the height range is 23500?
CREATE TABLE table_16439764_1 (m_v_ft_s INTEGER, max_height__ft_ VARCHAR)
SELECT DISTINCT firstname, lastname FROM teachers
Report the first name and last name of all the teachers.
CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR)
SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '015-910' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY patient.hospitaladmittime DESC LIMIT 1
when did patient 015-910 come into the hospital for the last time during this year?
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
SELECT shell__lb_ FROM table_16439764_1 WHERE gun = "QF 12 pdr 12 cwt"
If the gun used is the qf 12 pdr 12 cwt, what is the shell weight?
CREATE TABLE table_16439764_1 (shell__lb_ VARCHAR, gun VARCHAR)
SELECT DISTINCT firstname, lastname FROM list
Report the first name and last name of all the students.
CREATE TABLE list (firstname VARCHAR, lastname VARCHAR)
SELECT name FROM table_name_70 WHERE app_gs_sub_ = "14 (8/6)"
Tell what has the App(GS/Sub) of 14 (8/6)
CREATE TABLE table_name_70 ( name VARCHAR, app_gs_sub_ VARCHAR )
SELECT time_to_ft__m__at_25°__seconds_ FROM table_16439764_1 WHERE shell__lb_ = "12.5" AND max_height__ft_ > 20000.0
Where the height range is higher than 20000.0 and the shell weight is 12.5, what is the time to feet ratio at 25 degrees?
CREATE TABLE table_16439764_1 (time_to_ft__m__at_25°__seconds_ VARCHAR, shell__lb_ VARCHAR, max_height__ft_ VARCHAR)
SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER"
Find all students taught by OTHA MOYER. Output the first and last names of the students.
CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT 2 AS __vf_ FROM table_name_75 WHERE verb = "dhoa"
For the verb dhoa, what is the 2VF?
CREATE TABLE table_name_75 ( verb VARCHAR )
SELECT gun FROM table_16439764_1 WHERE time_to_ft__m__at_55°__seconds_ = "18.8"
What gun has a time to feet ratio of 18.8 at 55 degrees?
CREATE TABLE table_16439764_1 (gun VARCHAR, time_to_ft__m__at_55°__seconds_ VARCHAR)
SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "MARROTTE" AND T2.lastname = "KIRK"
Find all students taught by MARROTTE KIRK. Output first and last names of students.
CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT episode_4 FROM table_name_87 WHERE star = "anna powierza"
Which episode 4 has a Star of anna powierza?
CREATE TABLE table_name_87 ( episode_4 VARCHAR, star VARCHAR )
SELECT MAX(m_v_ft_s) FROM table_16439764_1 WHERE time_to_ft__m__at_55°__seconds_ = "22.1"
What is the maximum foot per second speed where time to feet ratio is 22.1 at 55 degrees?
CREATE TABLE table_16439764_1 (m_v_ft_s INTEGER, time_to_ft__m__at_55°__seconds_ VARCHAR)
SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "EVELINA" AND T1.lastname = "BROMLEY"
Find the first and last name of all the teachers that teach EVELINA BROMLEY.
CREATE TABLE teachers (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT "Season" FROM table_14917 WHERE "Points" = '95'
Which Season has 95 Points?
CREATE TABLE table_14917 ( "Season" text, "Series" text, "Races" text, "Wins" text, "Podiums" text, "Points" text, "Final Placing" text )
SELECT m_v_ft_s FROM table_16439764_1 WHERE time_to_ft__m__at_25°__seconds_ = "9.2"
What is the foot per second speed where time to feet ratio is 9.2 at 25 degrees?
CREATE TABLE table_16439764_1 (m_v_ft_s VARCHAR, time_to_ft__m__at_25°__seconds_ VARCHAR)
SELECT T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "GELL" AND T1.lastname = "TAMI"
Find the last names of all the teachers that teach GELL TAMI.
CREATE TABLE teachers (lastname VARCHAR, classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT "peak chart positions\nus" FROM table_200_22 WHERE "single" = 'with david bowie'
what chart position did the single with david bowie reach in the us ?
CREATE TABLE table_200_22 ( id number, "year" number, "single" text, "peak chart positions\nger" number, "peak chart positions\nire" number, "peak chart positions\nuk" number, "peak chart positions\nus" number, "peak chart positions\nus\nmain" number, "peak chart positions\nus\ndance...
SELECT skip FROM table_1644857_2 WHERE pf = 73
Who was skip for the country whose points for (PF) was 73?
CREATE TABLE table_1644857_2 (skip VARCHAR, pf VARCHAR)
SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "LORIA" AND T2.lastname = "ONDERSMA"
How many students does LORIA ONDERSMA teaches?
CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2132.0" AND prescriptions.drug = "Sertraline"
give me the number of patients whose year of death is less than or equal to 2132 and drug name is sertraline?
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
SELECT COUNT(stolen_ends) FROM table_1644857_2 WHERE country = France
How many times is a score for stolen ends recorded for France?
CREATE TABLE table_1644857_2 (stolen_ends VARCHAR, country VARCHAR, France VARCHAR)
SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "KAWA" AND T2.lastname = "GORDON"
How many students does KAWA GORDON teaches?
CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT team FROM table_name_90 WHERE game = 77
What is Team, when Game is 77?
CREATE TABLE table_name_90 ( team VARCHAR, game VARCHAR )
SELECT MAX(Ends) AS lost FROM table_1644857_2 WHERE pf = 87
How many ends were lost by the country whose points for (PF) was 87?
CREATE TABLE table_1644857_2 (Ends INTEGER, pf VARCHAR)
SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "TARRING" AND T2.lastname = "LEIA"
Find the number of students taught by TARRING LEIA.
CREATE TABLE list (classroom VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT "City" FROM table_70836 WHERE "Language" = 'spanish' AND "Website" = 'ultimahora.com'
Which city has spanish news on the website ultimahora.com ?
CREATE TABLE table_70836 ( "Name" text, "Frequency" text, "Language" text, "City" text, "Website" text )
SELECT COUNT(season) FROM table_16446652_1 WHERE treasurer = "Dave Reid"
How many seasons was Dave Reid treasurer?
CREATE TABLE table_16446652_1 (season VARCHAR, treasurer VARCHAR)
SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "CHRISSY" AND T1.lastname = "NABOZNY"
How many teachers does the student named CHRISSY NABOZNY have?
CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT "Producer(s)" FROM table_47475 WHERE "Songwriter(s)" = 'sezen aksu'
Who is sezen aksu's producer?
CREATE TABLE table_47475 ( "Track" real, "Title" text, "Songwriter(s)" text, "Producer(s)" text, "Length" text )
SELECT season FROM table_16446652_1 WHERE president = "Jonny Leadbeater"
When was Jonny Leadbeater President?
CREATE TABLE table_16446652_1 (season VARCHAR, president VARCHAR)
SELECT COUNT(*) FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.firstname = "MADLOCK" AND T1.lastname = "RAY"
How many teachers does the student named MADLOCK RAY have?
CREATE TABLE teachers (classroom VARCHAR); CREATE TABLE list (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT purpose FROM table_name_54 WHERE name = "quay"
What was the purpose of the Quay test blast?
CREATE TABLE table_name_54 ( purpose VARCHAR, name VARCHAR )
SELECT skip FROM table_1644876_2 WHERE stolen_ends = 14
Who was the skip with 14 stolen ends?
CREATE TABLE table_1644876_2 (skip VARCHAR, stolen_ends VARCHAR)
SELECT DISTINCT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 1 EXCEPT SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER"
Find all first-grade students who are NOT taught by OTHA MOYER. Report their first and last names.
CREATE TABLE list (firstname VARCHAR, lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, firstname VARCHAR, lastname VARCHAR)
SELECT TIME_TO_STR(p.CreationDate, '%h'), COUNT(*) FROM Posts AS p WHERE p.OwnerUserId = @UserId AND p.PostTypeId = 2 GROUP BY TIME_TO_STR(p.CreationDate, '%h')
What hour of the day I post the most answers.
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
SELECT MIN(l) FROM table_1644876_2
What is the fewest number of losses?
CREATE TABLE table_1644876_2 (l INTEGER)
SELECT DISTINCT T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T1.grade = 3 AND T2.firstname <> "COVIN" AND T2.lastname <> "JEROME"
Find the last names of the students in third grade that are not taught by COVIN JEROME.
CREATE TABLE list (lastname VARCHAR, classroom VARCHAR, grade VARCHAR); CREATE TABLE teachers (classroom VARCHAR, lastname VARCHAR, firstname VARCHAR)
SELECT "Berlin" FROM table_51004 WHERE "S\u00fcdwest" = 'fk pirmasens' AND "West" = 'westfalia herne'
What was Berlin when fk pirmasens was S dwest and westfalia herne was west?
CREATE TABLE table_51004 ( "Year" real, "Nord" text, "West" text, "S\u00fcdwest" text, "Berlin" text )