table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_1889 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Name who directed the episode that was viewed by 4.22 million
SELECT "Directed by" FROM table_1889 WHERE "U.S. viewers (million)" = '4.22'
CREATE TABLE table_5625 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Location" text )
Which Round has a Method of decision (unanimous), and an Event of ufc 145?
SELECT "Round" FROM table_5625 WHERE "Method" = 'decision (unanimous)' AND "Event" = 'ufc 145'
CREATE TABLE table_name_87 ( goals VARCHAR, apps VARCHAR, club VARCHAR )
How many goals did he score with under 26 appearances for werder bremen?
SELECT COUNT(goals) FROM table_name_87 WHERE apps < 26 AND club = "werder bremen"
CREATE TABLE table_39732 ( "Code" text, "Years" text, "Displacement (bore x stroke)/Type" text, "Power@rpm" text, "torque@rpm" text, "Compression (:1)" text )
Code of 1.6 duratec ti-vct, and a Power@rpm of ps (kw; hp)@6000 has what torque@rpm?
SELECT "torque@rpm" FROM table_39732 WHERE "Code" = '1.6 duratec ti-vct' AND "Power@rpm" = 'ps (kw; hp)@6000'
CREATE TABLE table_42157 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Points" text, "Position" text )
How many Wins in the Year with more than 16 Races?
SELECT "Wins" FROM table_42157 WHERE "Races" > '16'
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTask...
Number of users from Brazil.
SELECT COUNT(*) FROM Users WHERE LOWER(Location) LIKE '%brazil' OR LOWER(Location) LIKE '%brasil'
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, flight_number...
show me the flights from DAL
SELECT DISTINCT flight.flight_id FROM airport, flight WHERE airport.airport_code = 'DAL' AND flight.from_airport = airport.airport_code
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...
count the number of patients whose marital status is single and diagnoses short title is personality disorder nos?
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.short_title = "Personality disorder NOS"
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
Show the total number from each flag, display the total number in desc order.
SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag ORDER BY COUNT(*) DESC
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalpe...
how many times had patient 027-146673 visited icu in 2105?
SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-146673') AND STRFTIME('%y', patient.unitadmittime) = '2105'
CREATE TABLE table_name_36 ( tournament VARCHAR )
What is the 2007 value with 1r in 2009 and 2r in 2011 at the Tournament of Wimbledon?
SELECT 2007 FROM table_name_36 WHERE 2009 = "1r" AND 2011 = "2r" AND tournament = "wimbledon"
CREATE TABLE table_name_58 ( starts INTEGER, money_list_rank VARCHAR, top_25 VARCHAR )
What is the average number of starts when the money list rank is 108 and the rank in the top 25 is greater than 4?
SELECT AVG(starts) FROM table_name_58 WHERE money_list_rank = "108" AND top_25 > 4
CREATE TABLE table_name_47 ( mccain_number INTEGER, obama_number VARCHAR, others_percentage VARCHAR, mccain_percentage VARCHAR )
What is the highest number of votes for McCain in a county that voted 1.6% for other, 40.5% for McCain, and fewer than 256,299 votes for Obama?
SELECT MAX(mccain_number) FROM table_name_47 WHERE others_percentage = "1.6%" AND mccain_percentage = "40.5%" AND obama_number < 256 OFFSET 299
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number...
Users with gold Tag badges Based.
SELECT u.Id AS "user_link", MAX(b.Name) AS "One of the gold badges they have", COUNT(*) AS "Number of gold badges" FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Class = 1 AND TagBased = 1 GROUP BY u.Id ORDER BY 'Number of gold badges' DESC
CREATE TABLE table_name_61 ( total INTEGER, finish VARCHAR )
What is the highest total with a t12 finish?
SELECT MAX(total) FROM table_name_61 WHERE finish = "t12"
CREATE TABLE table_name_1 ( to_par VARCHAR, player VARCHAR )
How many to par for Greg Norman?
SELECT to_par FROM table_name_1 WHERE player = "greg norman"
CREATE TABLE table_23248940_9 ( high_assists VARCHAR, date VARCHAR )
Who did the most high assists during the game played on February 6?
SELECT high_assists FROM table_23248940_9 WHERE date = "February 6"
CREATE TABLE table_51289 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
When the laps are 31 and the constructor was honda, what's the sum of all grid values?
SELECT SUM("Grid") FROM table_51289 WHERE "Constructor" = 'honda' AND "Laps" = '31'
CREATE TABLE table_29126507_1 ( date VARCHAR, home_team VARCHAR )
When did Fitzroy play as the home team?
SELECT date FROM table_29126507_1 WHERE home_team = "Fitzroy"
CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE channel ( channel_id number, name text, owner text, share_in_percent number, rating_in_percent number ) CREATE TABLE broadcast_share ( channel_id number, program_id number, date t...
list all the names of programs, ordering by launch time.
SELECT name FROM program ORDER BY launch
CREATE TABLE table_48285 ( "Athlete" text, "Event" text, "Swim (1.5km)" text, "Trans 1" text, "Bike (40km)" text, "Trans 2" text, "Run (10km)" text, "Total Time" text, "Rank" real )
How long did the trans 1 take when 2:00:40.20 is the total time?
SELECT "Trans 1" FROM table_48285 WHERE "Total Time" = '2:00:40.20'
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE student_record ( student_id int, course_id int, semester int, ...
Who has taught , is teaching , or will teach RCCORE 104 ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'RCCORE' AND course.number = 104 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering...
CREATE TABLE table_65157 ( "Rank" real, "Athlete" text, "Country" text, "Time" text, "Notes" text )
Which athlete had a rank of 6 and notes of sc/d?
SELECT "Athlete" FROM table_65157 WHERE "Notes" = 'sc/d' AND "Rank" = '6'
CREATE TABLE table_26397277_3 ( brand__to_ VARCHAR, pick__number VARCHAR )
Name the brand for pick number 15
SELECT brand__to_ FROM table_26397277_3 WHERE pick__number = 15
CREATE TABLE table_name_33 ( school_year VARCHAR )
What is 02-03, when School Year is % Learning In Latvian?
SELECT 02 AS _03 FROM table_name_33 WHERE school_year = "% learning in latvian"
CREATE TABLE table_name_85 ( score VARCHAR, attendance VARCHAR )
What is the score of the game attended by 25,034?
SELECT score FROM table_name_85 WHERE attendance = "25,034"
CREATE TABLE table_1204 ( "No" real, "Date" text, "Round" text, "Circuit" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Report" text )
How many people won in No. 12
SELECT COUNT("Race Winner") FROM table_1204 WHERE "No" = '12'
CREATE TABLE movie ( movie_id int, Title text, Year int, Director text, Budget_million real, Gross_worldwide int ) CREATE TABLE book_club ( book_club_id int, Year int, Author_or_Editor text, Book_Title text, Publisher text, Category text, Result text ) CREATE TABLE ...
Show all director names who have a movie in the year 1999 or 2000, and count them by a bar chart, order by the Y-axis in desc.
SELECT Director, COUNT(Director) FROM movie WHERE Year = 1999 OR Year = 2000 GROUP BY Director ORDER BY COUNT(Director) DESC
CREATE TABLE table_name_5 ( tyre VARCHAR, race VARCHAR )
What is the Tyre for the united states grand prix?
SELECT tyre FROM table_name_5 WHERE race = "united states grand prix"
CREATE TABLE table_name_87 ( loser VARCHAR, winner VARCHAR )
Who was the loser of the fight against antonio silva?
SELECT loser FROM table_name_87 WHERE winner = "antonio silva"
CREATE TABLE table_70363 ( "Rank" text, "Margin" text, "Club" text, "Opponent" text, "Year" text, "Round" text, "Venue" text )
which round has a margin of 178?
SELECT "Round" FROM table_70363 WHERE "Margin" = '178'
CREATE TABLE table_68028 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What was the score on 6 February 2008?
SELECT "Score" FROM table_68028 WHERE "Date" = '6 february 2008'
CREATE TABLE table_4692 ( "Played" real, "Lost" real, "Drawn" real, "Tries" real, "Points" real, "% Won" real )
How many tries for the player whose number is greater than 2 and losses are smaller than 0?
SELECT COUNT("Tries") FROM table_4692 WHERE "Played" > '2' AND "Lost" < '0'
CREATE TABLE table_22914 ( "Fiscal year" real, "2-car sets" real, "3-car sets" real, "4-car sets" real, "6-car sets" real, "8-car sets" real, "Total vehicles" real )
Name the 4 car sets for 6 car sets being 44
SELECT MIN("4-car sets") FROM table_22914 WHERE "6-car sets" = '44'
CREATE TABLE table_29728596_2 ( competition VARCHAR, away_team VARCHAR )
What were the competitions when the away team was fk kozara gradiska?
SELECT competition FROM table_29728596_2 WHERE away_team = "FK Kozara Gradiska"
CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_season int, Title text, Directed_by text, Original_air_date text, Production_code text ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule...
Show each location and the number of cinemas there by a bar chart, and I want to show bar in asc order.
SELECT Location, COUNT(*) FROM cinema GROUP BY Location ORDER BY Location
CREATE TABLE table_name_98 ( surface VARCHAR, semifinalists VARCHAR )
Which Surface has a Semifinalist of stefan edberg thomas muster?
SELECT surface FROM table_name_98 WHERE semifinalists = "stefan edberg thomas muster"
CREATE TABLE table_name_32 ( winner VARCHAR, date VARCHAR )
who won on 29 may?
SELECT winner FROM table_name_32 WHERE date = "29 may"
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, h...
provide the daily maximum amount of po intake that patient 23436 has received on the first icu visit.
SELECT MAX(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23436) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND inputevents_...
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(2...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a line chart about the change of employee_id over hire_date , rank by the X-axis in ascending.
SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
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,...
count the number of patients whose admission type is urgent and procedure long title is combined right and left heart cardiac catheterization?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "URGENT" AND procedures.long_title = "Combined right and left heart cardiac catheterization"
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod...
how many hours have passed since patient 28447 has been admitted to icu?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND icustays.outtime IS NULL
CREATE TABLE table_204_143 ( id number, "national park" text, "region" text, "land area (km2)" number, "established" number, "visitation (2009)" number, "coordinates" text )
which of finland 's national parks has the least number of yearly visitors ?
SELECT "national park" FROM table_204_143 ORDER BY "visitation (2009)" LIMIT 1
CREATE TABLE table_51524 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What date did the home team of footscray play?
SELECT "Date" FROM table_51524 WHERE "Home team" = 'footscray'
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 times that patient 1249 had had a pe 20 fs po intake in 03/2102?
SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1249)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pe 20 fs po' ...
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
Which of the lab tests was conducted for patient id 18480? Also specify the lab test category
SELECT lab.label, lab."CATEGORY" FROM lab WHERE lab.subject_id = "18480"
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...
Which upper-level courses does Deborah Keller-cohen teach ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins...
CREATE TABLE table_name_3 ( average VARCHAR, rank VARCHAR )
What is the average that has 2 for the rank?
SELECT average FROM table_name_3 WHERE rank = "2"
CREATE TABLE table_16344 ( "League" text, "Sport" text, "Country" text, "Season" text, "Games" real, "Average attendance" real, "Total attendance" real )
What's the minimum total attendance of the Premier League association football?
SELECT MIN("Total attendance") FROM table_16344 WHERE "Sport" = 'Association football' AND "League" = 'Premier League'
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ...
select * from tags where id = 'R';.
WITH rtag AS (SELECT Id AS tagid FROM Tags WHERE TagName = 'r') SELECT TIME_TO_STR(CreationDate, '%Y') AS year, TIME_TO_STR(CreationDate, '%m') AS month, COUNT(DISTINCT Comments.Id) AS numcomments FROM Tags INNER JOIN PostTags ON (Tags.Id = PostTags.TagId AND TagName IN ('r', 'r-faq', 'r-factor', 'r-tree', 'r-commander...
CREATE TABLE table_13166 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
How many points have Goals for smaller than 33, and Draws larger than 9?
SELECT SUM("Points") FROM table_13166 WHERE "Goals for" < '33' AND "Draws" > '9'
CREATE TABLE table_name_39 ( region VARCHAR, catalog VARCHAR )
What Region is the MHCL-20004 Catalog?
SELECT region FROM table_name_39 WHERE catalog = "mhcl-20004"
CREATE TABLE table_203_207 ( id number, "site name" text, "reason for designation\nbiological interest" number, "reason for designation\ngeological interest" number, "area\nhectares" number, "area\nacres" number, "coordinates & grid ref" text, "year in which notified" number, "other ...
how many sites were notified after 2000 ?
SELECT COUNT("site name") FROM table_203_207 WHERE "year in which notified" > 2000
CREATE TABLE table_name_21 ( home_team VARCHAR, away_team VARCHAR )
What is the home team that had an away team of lincoln city?
SELECT home_team FROM table_name_21 WHERE away_team = "lincoln city"
CREATE TABLE table_34161 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text )
What 1992 has atp masters series for the 1995?
SELECT "1992" FROM table_34161 WHERE "1995" = 'atp masters series'
CREATE TABLE table_name_29 ( attendance INTEGER, score VARCHAR )
Which Attendance has a Score of 0:2?
SELECT MAX(attendance) FROM table_name_29 WHERE score = "0:2"
CREATE TABLE table_48498 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Who played Blackpool when Blackpool was at home?
SELECT "Away team" FROM table_48498 WHERE "Home team" = 'blackpool'
CREATE TABLE table_40106 ( "Championship" text, "Current champion(s)" text, "Previous champion(s)" text, "Date won" text, "Location" text )
Who is the current champion in the NECW Heavyweight Championship?
SELECT "Current champion(s)" FROM table_40106 WHERE "Championship" = 'necw heavyweight champion'
CREATE TABLE table_4430 ( "Pick" text, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Who is the player from Canada with a 199 pick?
SELECT "Player" FROM table_4430 WHERE "Nationality" = 'canada' AND "Pick" = '199'
CREATE TABLE table_name_18 ( played INTEGER, first_game INTEGER )
What is the number of games played in the season before 2005?
SELECT SUM(played) FROM table_name_18 WHERE first_game < 2005
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
What is the last name of each student who is not allergic to any type of food? Count them with a bar chart, and show by the X in desc.
SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName ORDER BY LName DESC
CREATE TABLE table_name_41 ( tournament VARCHAR )
What is Tournament, when 2009 is 'Grand Slam Tournaments'?
SELECT tournament FROM table_name_41 WHERE 2009 = "grand slam tournaments"
CREATE TABLE table_71739 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
What is on at 8:00 when etalk is on at 7:00?
SELECT "8:00" FROM table_71739 WHERE "7:00" = 'etalk'
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
List of Most reputed users in a given location - Case Sensitive. Gets a list of most reputed users from a given location.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, CreationDate, LastAccessDate, UpVotes, DownVotes FROM Users WHERE Location LIKE '%##Location##%' ORDER BY Reputation DESC LIMIT 100
CREATE TABLE table_30120761_1 ( area__acres__ VARCHAR, townland VARCHAR )
How many acres in the townland of Coomroe?
SELECT COUNT(area__acres__) FROM table_30120761_1 WHERE townland = "Coomroe"
CREATE TABLE table_name_23 ( result VARCHAR, nominee_s_ VARCHAR )
Nominee Neal Baer had what result?
SELECT result FROM table_name_23 WHERE nominee_s_ = "neal baer"
CREATE TABLE degrees ( year number, campus number, degrees number ) CREATE TABLE csu_fees ( campus number, year number, campusfee number ) CREATE TABLE enrollments ( campus number, year number, totalenrollment_ay number, fte_ay number ) CREATE TABLE faculty ( campus number...
Which campus has the most faculties in year 2003?
SELECT T1.campus FROM campuses AS T1 JOIN faculty AS T2 ON T1.id = T2.campus WHERE T2.year = 2003 ORDER BY T2.faculty DESC LIMIT 1
CREATE TABLE table_66928 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What is the location of the match where the method was submission (armbar) and Mayra Conde was the opponent?
SELECT "Location" FROM table_66928 WHERE "Method" = 'submission (armbar)' AND "Opponent" = 'mayra conde'
CREATE TABLE table_72271 ( "Year" real, "Mens singles" text, "Womens singles" text, "Mens doubles" text, "Womens doubles" text, "Mixed doubles" text )
What are the womens singles of naoko fukuman kurumi yonao?
SELECT "Womens singles" FROM table_72271 WHERE "Womens doubles" = 'Naoko Fukuman Kurumi Yonao'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
provide the number of patients whose admission year is less than 2168 and item id is 51436?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2168" AND lab.itemid = "51436"
CREATE TABLE table_29959 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who and what were the high points player for the game against Detroit?
SELECT "High points" FROM table_29959 WHERE "Team" = 'Detroit'
CREATE TABLE table_70467 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Which gender has Years of 1 8, an Authority of state, a Roll less than 184, and a Name of matatoki school?
SELECT "Gender" FROM table_70467 WHERE "Years" = '1–8' AND "Authority" = 'state' AND "Roll" < '184' AND "Name" = 'matatoki school'
CREATE TABLE table_16886076_1 ( coronie VARCHAR, marowijne VARCHAR )
Name the coronie for marowijne being 6.8%
SELECT coronie FROM table_16886076_1 WHERE marowijne = "6.8%"
CREATE TABLE table_54405 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
If the Away team scored 18.8 (116), what was the Home team's score?
SELECT "Home team score" FROM table_54405 WHERE "Away team score" = '18.8 (116)'
CREATE TABLE table_52296 ( "Year" real, "Award" text, "Category" text, "Nominee" text, "Result" text )
What was nominee nominated for outstanding featured actor in a musical?
SELECT "Nominee" FROM table_52296 WHERE "Category" = 'outstanding featured actor in a musical' AND "Result" = 'nominated'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is average days of hospital stay of patients whose primary disease is st-segment elevation myocardial infarction\cardiac cath?
SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "ST-SEGMENT ELEVATION MYOCARDIAL INFARCTION\CARDIAC CATH"
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 )
Display a bar chart for what is the total revenue of companies started by founder?, and rank by the Y-axis in desc.
SELECT Founder, SUM(Revenue) FROM Manufacturers GROUP BY Founder ORDER BY SUM(Revenue) DESC
CREATE TABLE table_name_11 ( play_by_play VARCHAR, color_commentator_s_ VARCHAR, year VARCHAR )
What was the Play-by-play when the color commentator was Eric Wynalda, earlier than 2005?
SELECT play_by_play FROM table_name_11 WHERE color_commentator_s_ = "eric wynalda" AND year < 2005
CREATE TABLE table_10493 ( "Date" text, "Champion" text, "2nd Place" text, "Score" text, "Stadium" text )
What was the score when the Vikings won the championship at Namyangju Stadium?
SELECT "Score" FROM table_10493 WHERE "Champion" = 'vikings' AND "Stadium" = 'namyangju stadium'
CREATE TABLE table_15681686_4 ( rank__timeslot_ VARCHAR, viewers__millions_ VARCHAR )
what is the total number of rank where viewers is 9.38?
SELECT COUNT(rank__timeslot_) FROM table_15681686_4 WHERE viewers__millions_ = "9.38"
CREATE TABLE table_71927 ( "Album or Song" text, "Band" text, "Memebrship" text, "Role" text, "Year" real )
Which band plays Self Versus Self - Immersion?
SELECT "Band" FROM table_71927 WHERE "Album or Song" = 'self versus self - immersion'
CREATE TABLE actor ( actor_id number, name text, musical_id number, character text, duration text, age number ) CREATE TABLE musical ( musical_id number, name text, year number, award text, category text, nominee text, result text )
How many actors are there?
SELECT COUNT(*) FROM actor
CREATE TABLE hotels ( hotel_id number, star_rating_code text, pets_allowed_yn text, price_range number, other_hotel_details text ) CREATE TABLE photos ( photo_id number, tourist_attraction_id number, name text, description text, filename text, other_details text ) CREATE TA...
What is the address of the location 'UK Gallery'?
SELECT address FROM locations WHERE location_name = "UK Gallery"
CREATE TABLE table_14965 ( "Home" text, "Score" text, "Away" text, "Venue" text, "Golden point(s) scorer" text )
What Golden point(s) scorer has the Away Sydney Roosters and Home Cronulla Sharks?
SELECT "Golden point(s) scorer" FROM table_14965 WHERE "Away" = 'sydney roosters' AND "Home" = 'cronulla sharks'
CREATE TABLE table_45652 ( "Class" text, "Team" text, "Driver" text, "Chassis \u2013 Engine" text, "Laps" real )
How many Laps did Bob Wollek have?
SELECT AVG("Laps") FROM table_45652 WHERE "Driver" = 'bob wollek'
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, Creation...
select * from Users where id = <975271>.
SELECT * FROM Users WHERE Id = 975271
CREATE TABLE table_71490 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" text )
What school with a decile of 7 is in upper hutt?
SELECT "Name" FROM table_71490 WHERE "Decile" = '7' AND "Area" = 'upper hutt'
CREATE TABLE table_name_58 ( games_won VARCHAR, points_for VARCHAR, points_against VARCHAR, bonus_points VARCHAR, points_difference VARCHAR )
Which Games won has Bonus points larger than 1, a Points difference smaller than 50, Points against of 106, and Points for smaller than 152?
SELECT COUNT(games_won) FROM table_name_58 WHERE bonus_points > 1 AND points_difference < 50 AND points_against = 106 AND points_for < 152
CREATE TABLE table_name_15 ( week_1_sept_7 VARCHAR, preseason VARCHAR )
What is the Week 1 result of Colorado State?
SELECT week_1_sept_7 FROM table_name_15 WHERE preseason = "colorado state"
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
provide the age and the health insurance that covers patient with patient id 31066.
SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "31066"
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 inputevents_cv ( row_id number, subject_id number, ...
what are the top five most common diagnoses that followed within 2 months for those who received inject/infuse nec?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissi...
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(...
For all employees who have the letters D or S in their first name, return a scatter chart about the correlation between employee_id and department_id .
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
CREATE TABLE table_42567 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
In what round was the first outside linebacker picked?
SELECT MIN("Round") FROM table_42567 WHERE "Position" = 'outside linebacker'
CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id num...
what is the drug that patient 25696 prescribed with during the same hospital encounter after undergoing insert endotracheal tube in 03/last year?
SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 25696 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce...
CREATE TABLE table_56881 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
Name the winning driver for belgian grand prix
SELECT "Winning driver" FROM table_56881 WHERE "Race" = 'belgian grand prix'
CREATE TABLE table_204_627 ( id number, "date" text, "opponent" text, "score" text, "top scorer (total points)" text, "venue (location)" text )
this team faced sta . lucia and had who as their top scorer which was the same top scoerer as their game against coca cola ?
SELECT "top scorer (total points)" FROM table_204_627 WHERE "opponent" = 'coca cola'
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ...
how many patients with protestant quaker religion are below 70 years of age?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "PROTESTANT QUAKER" AND demographic.age < "70"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
find the number of white-russian patients who were hospitalized for more than 43 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.days_stay > "43"
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 medication ( medi...
what is the daily maximum urine output that patient 017-59454 has had on the last hospital encounter?
SELECT MAX(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 = '017-59454' AND NOT patient.hospitaldischargetime...
CREATE TABLE visitors ( tourist_id number, tourist_details text ) CREATE TABLE museums ( museum_id number, museum_details text ) CREATE TABLE tourist_attractions ( tourist_attraction_id number, attraction_type_code text, location_id number, how_to_get_there text, name text, des...
What are the names and descriptions of the photos taken at the tourist attraction 'film festival'?
SELECT T1.name, T1.description FROM photos AS T1 JOIN tourist_attractions AS T2 ON T1.tourist_attraction_id = T2.tourist_attraction_id WHERE T2.name = "film festival"