table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_24859 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
How many viewers in millions watched the episode with the production code 6acx16?
SELECT "U.S. viewers (million)" FROM table_24859 WHERE "Production code" = '6ACX16'
CREATE TABLE table_name_67 ( pick VARCHAR, round VARCHAR, position VARCHAR )
What is the pick number for the tight end who was picked after round 6?
SELECT COUNT(pick) FROM table_name_67 WHERE round > 6 AND position = "tight end"
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...
when did patient 035-6788 receive the last test of a lab?
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-6788')) ORDER BY lab.labresulttime DESC LIMIT 1
CREATE TABLE table_30166 ( "Series episode" real, "Season episode" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (in million)" text )
What was the episode number for the episode viewed by 5.68 million viewers?
SELECT "Season episode" FROM table_30166 WHERE "U.S. viewers (in million)" = '5.68'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( ...
what's the name of the diagnosis that patient 006-80884 was given for the last time since 2105?
SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-80884')) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2105...
CREATE TABLE table_3283 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
What is the smallest number of extra points?
SELECT MIN("Extra points") FROM table_3283
CREATE TABLE table_name_68 ( winner VARCHAR, season VARCHAR )
Who had the women's win when Norway was the winner overall in season 2001/02?
SELECT winner AS Women FROM table_name_68 WHERE winner = "norway" AND season = "2001/02"
CREATE TABLE driverstandings ( driverstandingsid number, raceid number, driverid number, points number, position number, positiontext text, wins number ) CREATE TABLE qualifying ( qualifyid number, raceid number, driverid number, constructorid number, number number, ...
Find the names of all races held in 2017.
SELECT name FROM races WHERE year = 2017
CREATE TABLE table_name_44 ( males VARCHAR, percentage___percentage_ VARCHAR )
Which language do 87.5% of males speak?
SELECT males FROM table_name_44 WHERE percentage___percentage_ = "87.5"
CREATE TABLE table_77980 ( "Player" text, "Height" text, "School" text, "Hometown" text, "College" text, "NBA Draft" text )
Which height is associated with Franklin High School?
SELECT "Height" FROM table_77980 WHERE "School" = 'franklin high school'
CREATE TABLE table_3260 ( "Date" text, "Time (ET)" text, "Event #" real, "Event" text, "Winner" text, "Prize" text, "Entries" text, "Prize Pool" text, "Elapsed Time" text )
Name the prize pool for 706 (481 r, 346 a)
SELECT "Prize Pool" FROM table_3260 WHERE "Entries" = '706 (481 R, 346 A)'
CREATE TABLE table_1969634_1 ( enrollment VARCHAR, location VARCHAR )
What is the total enrollment for the school in garden city, new york?
SELECT enrollment FROM table_1969634_1 WHERE location = "Garden City, New York"
CREATE TABLE table_20494 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Bills points" real, "Opponents" real, "Bills first downs" real, "Record" text )
How many points did the bills score when their opponent had 14
SELECT "Bills points" FROM table_20494 WHERE "Opponents" = '14'
CREATE TABLE table_26758262_1 ( judges_residence VARCHAR, municipalities_served VARCHAR )
Where does the judge who serves Beacon Falls , Naugatuck , Middlebury , Prospect reside?
SELECT judges_residence FROM table_26758262_1 WHERE municipalities_served = "Beacon Falls , Naugatuck , Middlebury , Prospect"
CREATE TABLE table_14606 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
Who did the Blue Jays lose to on July 16?
SELECT "Loss" FROM table_14606 WHERE "Date" = 'july 16'
CREATE TABLE Behavior_Incident ( incident_id INTEGER, incident_type_code VARCHAR(10), student_id INTEGER, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary VARCHAR(255), recommendations VARCHAR(255), other_details VARCHAR(255) ) CREATE TABLE Ref_Address_Types ( ...
Draw a bar chart about the distribution of date_address_from and the sum of monthly_rental bin date_address_from by time.
SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses ORDER BY monthly_rental DESC
CREATE TABLE table_79810 ( "Club" text, "Manager" text, "Captain" text, "Manufacturer" text, "Sponsor" text )
Who is the captain of Middlesbrough?
SELECT "Captain" FROM table_79810 WHERE "Club" = 'middlesbrough'
CREATE TABLE table_75857 ( "Date" text, "Time" text, "Home" text, "Away" text, "Score" text, "Ground" text )
What is the Date with a Home that is hamilton wildcats?
SELECT "Date" FROM table_75857 WHERE "Home" = 'hamilton wildcats'
CREATE TABLE table_name_46 ( venue VARCHAR, home_team VARCHAR )
What venue is the home field of Richmond?
SELECT venue FROM table_name_46 WHERE home_team = "richmond"
CREATE TABLE table_57423 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What Venue has an Away Team Score of 9.12 (66)?
SELECT "Venue" FROM table_57423 WHERE "Away team score" = '9.12 (66)'
CREATE TABLE table_9969 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text )
What is the sum of March, when Score is '2 - 2', and when Game is greater than 67?
SELECT SUM("March") FROM table_9969 WHERE "Score" = '2 - 2' AND "Game" > '67'
CREATE TABLE table_79861 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real )
yankee stadium (i), and a Time of 3:00 has what attendance for this location?
SELECT "Attendance" FROM table_79861 WHERE "Location" = 'yankee stadium (i)' AND "Time" = '3:00'
CREATE TABLE table_67021 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text, "Entrant" text )
What Engine had a Finish of 27?
SELECT "Engine" FROM table_67021 WHERE "Finish" = '27'
CREATE TABLE table_70364 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Name the average total for gold less than 1 and rank less than 5
SELECT AVG("Total") FROM table_70364 WHERE "Gold" < '1' AND "Rank" < '5'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
tell me the price of a vancomycin - trough lab test?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'vancomycin - trough')
CREATE TABLE table_30049462_4 ( location_attendance VARCHAR, team VARCHAR )
What was the location and it's corresponding attendance during the game against Los Angeles?
SELECT location_attendance FROM table_30049462_4 WHERE team = "Los Angeles"
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, ...
Latest activity across all sites..
SELECT DisplayName, ProfileImageUrl FROM Users WHERE DisplayName LIKE '%M%' AND ProfileImageUrl != ''
CREATE TABLE table_204_318 ( id number, "date" text, "opponent" text, "venue" text, "result" text, "attendance" number, "scorers" text )
how many people attended the game in november against sunderland ?
SELECT "attendance" FROM table_204_318 WHERE "date" = 11 AND "opponent" = 'sunderland'
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 )
For those records from the products and each product's manufacturer, show me about the distribution of name and the average of code , and group by attribute name in a bar chart, and order total number in descending order please.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC
CREATE TABLE table_61671 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What Player has a To par of 2?
SELECT "Player" FROM table_61671 WHERE "To par" = '–2'
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE...
Are any other requirements fulfilled for POLISH 432 besides general elective ?
SELECT DISTINCT program_course.category FROM course, program_course WHERE course.department = 'POLISH' AND course.number = 432 AND program_course.course_id = course.course_id
CREATE TABLE table_16966 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
Which located featured the first prize of 33500?
SELECT "Location" FROM table_16966 WHERE "1st Prize( $ )" = '33500'
CREATE TABLE table_16449 ( "1973 Democratic initial primary" text, "Manhattan" text, "The Bronx" text, "Brooklyn" text, "Queens" text, "Richmond [Staten Is.]" text, "Total" real, "%" text )
What is the queens where richmond staten is 42%?
SELECT "Queens" FROM table_16449 WHERE "Richmond [Staten Is.]" = '42%'
CREATE TABLE table_63326 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What's the tie number of Chelsea when they were home?
SELECT "Tie no" FROM table_63326 WHERE "Home team" = 'chelsea'
CREATE TABLE table_50038 ( "Year" real, "Round" text, "Player" text, "Nationality" text, "Position" text, "College/High School/Club" text )
What is the round of the pf position player from 1996 and the college/high school/club mississippi state?
SELECT "Round" FROM table_50038 WHERE "Position" = 'pf' AND "Year" = '1996' AND "College/High School/Club" = 'mississippi state'
CREATE TABLE table_29285 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
How many date of appointment entries are there when the team is khazar lankaran?
SELECT COUNT("Date of appointment") FROM table_29285 WHERE "Team" = 'Khazar Lankaran'
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATIO...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, I want to show by the the average of employee id in asc.
SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(EMPLOYEE_ID)
CREATE TABLE table_80078 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
Where is the school with state authority that has a roll of more than 157 students?
SELECT "Area" FROM table_80078 WHERE "Authority" = 'state' AND "Roll" > '157'
CREATE TABLE table_name_44 ( opponents_in_the_final VARCHAR, partnering VARCHAR )
Who are the finals opponents for the match with partner Ricardo Hocevar?
SELECT opponents_in_the_final FROM table_name_44 WHERE partnering = "ricardo hocevar"
CREATE TABLE table_204_775 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
what is the only nation to receive three gold medals ?
SELECT "nation" FROM table_204_775 WHERE "gold" = 3
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 prescription...
get me the long title of diagnoses and primary disease of patient betty campbell.
SELECT demographic.diagnosis, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Betty Campbell"
CREATE TABLE table_name_27 ( republican_ticket VARCHAR, prohibition_ticket VARCHAR )
What kind of Republican ticket has a Prohibition ticket of stephen mead wing?
SELECT republican_ticket FROM table_name_27 WHERE prohibition_ticket = "stephen mead wing"
CREATE TABLE table_16429 ( "Rnd" real, "Race Name" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Report" text )
Who drove the fastest lap at the Tenneco Automotive Grand Prix of Detroit?
SELECT "Fastest lap" FROM table_16429 WHERE "Race Name" = 'Tenneco Automotive Grand Prix of Detroit'
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostTypes ( Id number, Name text ) C...
Tags Without Excerpt or Wiki (unbalanced).
SELECT c.TagName, c.CountPosts AS "Number of Posts", e.Body AS "Excerpt", w.Body AS "Wiki" FROM (SELECT t.TagName, t.ExcerptPostId, t.WikiPostId, COUNT(*) AS CountPosts FROM Tags AS t LEFT OUTER JOIN TagSynonyms AS s ON (t.TagName = s.SourceTagName) INNER JOIN PostTags AS p ON (p.TagId = t.Id) WHERE s.ApprovalDate IS N...
CREATE TABLE table_name_82 ( visitor VARCHAR, leading_scorer VARCHAR )
Which team was the visitor when Milt Palacio (15) was the leading scorer?
SELECT visitor FROM table_name_82 WHERE leading_scorer = "milt palacio (15)"
CREATE TABLE table_226619_12 ( points VARCHAR, respect_toward_opponents VARCHAR )
Name the points for 212 respect toward opponents
SELECT points FROM table_226619_12 WHERE respect_toward_opponents = 212
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 ) ...
what is the number of patients whose diagnoses short title is mv collision nos-driver and drug route is id?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Mv collision NOS-driver" AND prescriptions.route = "ID"
CREATE TABLE table_76307 ( "Season" text, "Series" text, "Team Name" text, "Races" real, "Wins" real, "Poles" real, "F.L." real, "Podiums" real, "Points" text, "Position" text )
What is the race in the 8th position?
SELECT "Races" FROM table_76307 WHERE "Position" = '8th'
CREATE TABLE table_43314 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
What was the pick number for the wide receiver drafted from Michigan State?
SELECT "Pick #" FROM table_43314 WHERE "Position" = 'wide receiver' AND "College" = 'michigan state'
CREATE TABLE table_1140117_5 ( report VARCHAR, race_name VARCHAR )
What's the report for the race name, XIII Grand Prix de l'Albigeois?
SELECT report FROM table_1140117_5 WHERE race_name = "XIII Grand Prix de l'Albigeois"
CREATE TABLE table_46750 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What Country is Rocco Mediate from?
SELECT "Country" FROM table_46750 WHERE "Player" = 'rocco mediate'
CREATE TABLE table_28116528_1 ( original_air_date VARCHAR, production_code VARCHAR )
What date did the episode with a production code of 3x6316 originally air?
SELECT original_air_date FROM table_28116528_1 WHERE production_code = "3X6316"
CREATE TABLE table_name_68 ( attendance INTEGER, home VARCHAR )
What was the lowest attendance at a game when Pittsburgh was the home team?
SELECT MIN(attendance) FROM table_name_68 WHERE home = "pittsburgh"
CREATE TABLE table_31528 ( "Episode no." real, "US Airdate" text, "US Total viewers" text, "UK Airdate" text, "UK Total viewers" text )
How many viewers in the UK did episode 50 have?
SELECT "UK Total viewers" FROM table_31528 WHERE "Episode no." = '50'
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId numb...
How many users have a location in their profile.
SELECT HasLocation, COUNT(*) FROM (SELECT Id AS "user_link", CASE WHEN Location IS NULL THEN 'No' ELSE 'Yes' END AS HasLocation FROM Users) AS t GROUP BY HasLocation
CREATE TABLE table_1165 ( "Team" text, "Copa Libertadores 1992" text, "Supercopa Sudamericana 1992" text, "Copa CONMEBOL 1992" text, "Recopa Sudamericana 1992" text, "Intercontinental Cup 1992" text )
Name the recopa sudamericana 1992 for did not qualify for libertadores 1992 and round of 16 for bragantino
SELECT "Recopa Sudamericana 1992" FROM table_1165 WHERE "Copa Libertadores 1992" = 'Did not qualify' AND "Copa CONMEBOL 1992" = 'Round of 16' AND "Team" = 'Bragantino'
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Questions with negative score favorited only by the OP.
SELECT Posts.Id AS "post_link", Posts.FavoriteCount, Posts.Score, Posts.CreationDate, Votes.UserId AS "user_link" FROM Votes JOIN Posts ON (Posts.Id = Votes.PostId) WHERE Posts.FavoriteCount = 1 AND Posts.Score < 0 AND VoteTypeId = 5 AND Posts.PostTypeId = 1 AND Posts.OwnerUserId = Votes.UserId ORDER BY Posts.CreationD...
CREATE TABLE table_name_37 ( opponent VARCHAR, home_away VARCHAR, result VARCHAR )
Name the opponent when the result is w 16-15 and has home/away of home
SELECT opponent FROM table_name_37 WHERE home_away = "home" AND result = "w 16-15"
CREATE TABLE table_name_79 ( notes VARCHAR, title VARCHAR )
What are the notes for Happy Camp?
SELECT notes FROM table_name_79 WHERE title = "happy camp"
CREATE TABLE table_36968 ( "Frequency (kHz)" real, "Call letters" text, "Licensed location" text, "Type" text, "Format" text )
What is the smallest frequency (kHz) that is in the location of Longview?
SELECT MIN("Frequency (kHz)") FROM table_36968 WHERE "Licensed location" = 'longview'
CREATE TABLE table_8818 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What was Raymond Floyd's score?
SELECT "Score" FROM table_8818 WHERE "Player" = 'raymond floyd'
CREATE TABLE table_name_18 ( score VARCHAR, record VARCHAR, game VARCHAR, decision VARCHAR )
What's the score for a game over 56 with a record of 29-24-7 with a lundqvist decision?
SELECT score FROM table_name_18 WHERE game > 56 AND decision = "lundqvist" AND record = "29-24-7"
CREATE TABLE WINE ( Name VARCHAR, price VARCHAR )
List the names of all distinct wines ordered by price.
SELECT DISTINCT Name FROM WINE ORDER BY price
CREATE TABLE table_name_95 ( tournament VARCHAR, opponents_in_the_final VARCHAR )
What tournament had an opponent of Els Callens Nancy Feber?
SELECT tournament FROM table_name_95 WHERE opponents_in_the_final = "els callens nancy feber"
CREATE TABLE table_10015132_9 ( school_club_team VARCHAR, player VARCHAR )
What school/club team is Trey Johnson on?
SELECT school_club_team FROM table_10015132_9 WHERE player = "Trey Johnson"
CREATE TABLE table_19130829_4 ( team__number2 VARCHAR )
What's the 2nd leg result in the round where Panionios is team #2?
SELECT 2 AS nd_leg FROM table_19130829_4 WHERE team__number2 = "Panionios"
CREATE TABLE table_name_61 ( total_seats INTEGER, share_of_votes VARCHAR )
When the share of votes equals 21.8%, what's the sum of the total amount of seats?
SELECT SUM(total_seats) FROM table_name_61 WHERE share_of_votes = "21.8%"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
Calculate the total number of patients who had icd9 code v1006 and a duration of stay in hospital of more than 17 days
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "17" AND diagnoses.icd9_code = "V1006"
CREATE TABLE table_204_938 ( id number, "year" number, "edmonton\nhundred" number, "elthorne\nhundred" number, "gore\nhundred" number, "isleworth\nhundred" number, "ossulstone\nhundred\nholborn\ndivision" number, "ossulstone\nhundred\nfinsbury\ndivision" number, "ossulstone\nhundred\...
what was the total population in 1801 ?
SELECT "total" FROM table_204_938 WHERE "year" = 1801
CREATE TABLE table_name_28 ( number_ VARCHAR, _name VARCHAR, date INTEGER )
What's the number & name for the date after 1954?
SELECT number_ & _name FROM table_name_28 WHERE date > 1954
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
during this year was patient 009-10007 prescribed pantoprazole sodium 40 mg po tbec?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-10007')) AND medication.drugname = 'pantoprazole sodium 40 mg po tbec'...
CREATE TABLE table_33181 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What was the attendance in week 6?
SELECT "Attendance" FROM table_33181 WHERE "Week" = '6'
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 ) ...
provide the number of patients whose insurance is private and lab test name is bilirubin, indirect?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Private" AND lab.label = "Bilirubin, Indirect"
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
what is the name of the treatment that patient 006-43795 had been given two times during the first hospital encounter?
SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
CREATE TABLE table_67030 ( "Number" text, "Player" text, "Position" text, "Height" text, "Weight" text, "Home Town" text )
Which player's home town is Swift Current, AB?
SELECT "Player" FROM table_67030 WHERE "Home Town" = 'swift current, ab'
CREATE TABLE table_train_83 ( "id" int, "systolic_blood_pressure_sbp" int, "renal_disease" bool, "diabetic" string, "estimated_glomerular_filtration_rate_egfr" int, "iq" int, "geriatric_depression_scale_gds" int, "NOUSE" float )
systolic blood pressure ( supine ) >= 100 mmhg;
SELECT * FROM table_train_83 WHERE systolic_blood_pressure_sbp >= 100
CREATE TABLE city ( Status VARCHAR )
Please show the different statuses, ordered by the number of cities that have each.
SELECT Status FROM city GROUP BY Status ORDER BY COUNT(*)
CREATE TABLE table_name_58 ( long INTEGER, avg_g VARCHAR, loss VARCHAR, gain VARCHAR )
How much Long has a Loss larger than 2, and a Gain of 157, and an Avg/G smaller than 129?
SELECT SUM(long) FROM table_name_58 WHERE loss > 2 AND gain = 157 AND avg_g < 129
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
What are the different ship flags, and how many ships have each. Show a pie chart.
SELECT Flag, COUNT(*) FROM Ship GROUP BY Flag
CREATE TABLE table_name_79 ( perfect_stem VARCHAR, future_stem VARCHAR )
What is the perfect stem for the word that has a future stem of emango?
SELECT perfect_stem FROM table_name_79 WHERE future_stem = "emango"
CREATE TABLE competition_result ( Competition_ID int, Club_ID_1 int, Club_ID_2 int, Score text ) CREATE TABLE club ( Club_ID int, name text, Region text, Start_year text ) CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) C...
For each position, what is the average number of points for players in that position Plot them as bar chart, could you show y axis from low to high order?
SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY AVG(Points)
CREATE TABLE table_75591 ( "Tournament" text, "Wins" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is his low win total when he has over 3 top 25s and under 9 cuts made?
SELECT MIN("Wins") FROM table_75591 WHERE "Top-25" = '3' AND "Cuts made" < '9'
CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_...
how much does a FIRST class ticket cost from BOSTON to SAN FRANCISCO round trip
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND...
CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_status_code VARCHAR(10), order_date DATETIME ) CREATE TABLE Department_Store_Chain ( dept_store_chain_id INTEGER, dept_store_chain_nam...
What is the lowest price of product, grouped by product type? Show a bar chart.
SELECT product_type_code, MIN(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code
CREATE TABLE table_75388 ( "Game" real, "December" real, "Opponent" text, "Score" text, "Record" text )
Game smaller than 34, and a December smaller than 14, and a Score of 10 - 6 has what opponent?
SELECT "Opponent" FROM table_75388 WHERE "Game" < '34' AND "December" < '14' AND "Score" = '10 - 6'
CREATE TABLE table_31649 ( "Year" real, "Championship" text, "Winning score" text, "Margin" text, "Runner(s)-up" text )
What is the margin at the Nabisco Championship?
SELECT "Margin" FROM table_31649 WHERE "Championship" = 'nabisco championship'
CREATE TABLE table_name_27 ( bronze INTEGER, gold VARCHAR, silver VARCHAR, total VARCHAR )
Name the average bronze with silver more than 0, total of 6 and gold more than 0
SELECT AVG(bronze) FROM table_name_27 WHERE silver > 0 AND total = 6 AND gold > 0
CREATE TABLE table_57476 ( "Name" text, "Block" text, "Launch date/time (UTC)" text, "COSPAR ID" text, "Rocket" text )
What block has a COSPAR ID of 1995-060a?
SELECT "Block" FROM table_57476 WHERE "COSPAR ID" = '1995-060a'
CREATE TABLE table_45790 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
On what date is Jerilyn Britz the runner-up?
SELECT "Date" FROM table_45790 WHERE "Runner(s)-up" = 'jerilyn britz'
CREATE TABLE table_2718 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
Name the number of conference tournament for james madison
SELECT COUNT("Conference Tournament") FROM table_2718 WHERE "Tournament Winner" = 'James Madison'
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 diagnosis short title is ath ext ntv at w claudct.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Ath ext ntv at w claudct"
CREATE TABLE table_train_273 ( "id" int, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "body_weight" float, "hba1c" float, "insulin_requirement" float, "body_mass_index_bmi" float, "NOUSE" float )
body mass index ( bmi ) of 27 to 45 kg / m2 with weight < / = 136 kg ( 300 lbs.
SELECT * FROM table_train_273 WHERE body_mass_index_bmi >= 27 AND body_mass_index_bmi <= 45 AND body_weight <= 136
CREATE TABLE Settlements ( Settlement_ID INTEGER, Claim_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER, Customer_Policy_ID INTEGER ) CREATE TABLE Payments ( Payment_ID INTEGER, Settlement_ID INTEGER, Payment_Method_Code ...
For those payments processed with Visa, bin the payment day into Year interval and compute the average amount payment as the Y-axis.
SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa'
CREATE TABLE Order_Items ( Order_Item_ID INTEGER, Order_ID INTEGER, Product_ID INTEGER, Order_Quantity VARCHAR(288), Other_Item_Details VARCHAR(255) ) CREATE TABLE Bookings ( Booking_ID INTEGER, Customer_ID INTEGER, Workshop_Group_ID VARCHAR(100), Status_Code CHAR(15), Store_ID ...
Show all payment method codes and the number of orders for each code in a bar chart, show by the payment_method_code in descending please.
SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY payment_method_code DESC
CREATE TABLE table_name_28 ( seats INTEGER, _percentage_change VARCHAR, _percentage_votes VARCHAR )
What are the fewest seats with a -3.7% change and more than 4.7% votes?
SELECT MIN(seats) FROM table_name_28 WHERE _percentage_change = -3.7 AND _percentage_votes > 4.7
CREATE TABLE table_69873 ( "Year" text, "Team" text, "Number" text, "BB +HBP" real, "BA (Place)" text )
In the year 1992 for the Seibu Lions, the BB + HBP which is larger than 49 was this as a BA (Place)?
SELECT "BA (Place)" FROM table_69873 WHERE "BB +HBP" > '49' AND "Team" = 'seibu lions' AND "Year" = '1992'
CREATE TABLE table_76915 ( "Year" real, "Film" text, "Role" text, "Director" text, "Studio" text )
What is the Year of the Film Klondike Annie?
SELECT SUM("Year") FROM table_76915 WHERE "Film" = 'klondike annie'
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 demographic ( subject_id text, hadm_id t...
what is drug name and drug route of drug code asa325?
SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ASA325"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
give the number of patients who were admitted before the year 2158 and whose diagnosis long title is unspecified pleural effusion.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2158" AND diagnoses.long_title = "Unspecified pleural effusion"
CREATE TABLE table_46528 ( "car model" text, "displacement & configuration" text, "max. motive power @ rpm" text, "max. torque @ rpm" text, "max. speed" text, "emissions CO2" text )
What is the displacement & configuration with CO2 of 204 g/km emissions?
SELECT "displacement & configuration" FROM table_46528 WHERE "emissions CO2" = '204 g/km'