table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_13044 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
What week was the December 24, 1994 game?
SELECT SUM("Week") FROM table_13044 WHERE "Date" = 'december 24, 1994'
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE countries ( COUNTRY_ID...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the sum of department_id bin hire_date by weekday in a bar chart, and could you order in desc by the Y?
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) DESC
CREATE TABLE table_2668199_2 ( candidates VARCHAR, district VARCHAR )
Who were the candidates in districk Pennsylvania 12?
SELECT candidates FROM table_2668199_2 WHERE district = "Pennsylvania 12"
CREATE TABLE table_6499 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponent" text, "Score" text )
Name the score for 21 may 2011
SELECT "Score" FROM table_6499 WHERE "Date" = '21 may 2011'
CREATE TABLE table_name_67 ( Id VARCHAR )
What is the 2000 value if the 1998 value is 1.5?
SELECT 2000 FROM table_name_67 WHERE 1998 = "1.5"
CREATE TABLE table_name_18 ( frequency__per_hour_ VARCHAR, line VARCHAR, destination VARCHAR )
How many frequencies have a line of East London and destination of Crystal Palace?
SELECT COUNT(frequency__per_hour_) FROM table_name_18 WHERE line = "east london" AND destination = "crystal palace"
CREATE TABLE table_name_24 ( wounded VARCHAR, killed VARCHAR, unit VARCHAR )
How many were Wounded in the Artillery Corps unit while having 0 off 0 men Killed?
SELECT wounded FROM table_name_24 WHERE killed = "0 off 0 men" AND unit = "artillery corps"
CREATE TABLE performers_in_bookings ( order_id number, performer_id number ) CREATE TABLE ref_service_types ( service_type_code text, parent_service_type_code text, service_type_description text ) CREATE TABLE services ( service_id number, service_type_code text, workshop_group_id numb...
Find the city the store named 'FJA Filming' is in.
SELECT T1.city_town FROM addresses AS T1 JOIN stores AS T2 ON T1.address_id = T2.address_id WHERE T2.store_name = "FJA Filming"
CREATE TABLE table_2266762_1 ( date VARCHAR, average_speed__mph_ VARCHAR )
On how many dates was the average speed of the race 91.033 MPH?
SELECT COUNT(date) FROM table_2266762_1 WHERE average_speed__mph_ = "91.033"
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 ...
what is average age of patients whose ethnicity is white and days of hospital stay is 2?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.days_stay = "2"
CREATE TABLE table_36978 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Who is the opponent in the final of the match on 26 March 2006?
SELECT "Opponent in the final" FROM table_36978 WHERE "Date" = '26 march 2006'
CREATE TABLE table_49908 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Name the Place with a Score of 72-68=140?
SELECT "Place" FROM table_49908 WHERE "Score" = '72-68=140'
CREATE TABLE table_14016079_1 ( winner VARCHAR, circuit VARCHAR )
Who was the winner on the Symmons Plains Raceway?
SELECT winner FROM table_14016079_1 WHERE circuit = "Symmons Plains Raceway"
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), ...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the first_name , and list in ascending by the total number.
SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SALARY
CREATE TABLE table_name_70 ( bronze INTEGER, total VARCHAR, gold VARCHAR )
How many bronze medals were won when the total was larger than 2 and the more than 2 gold medals were won?
SELECT SUM(bronze) FROM table_name_70 WHERE total > 2 AND gold > 2
CREATE TABLE table_10093 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which sporting location is where Richmond plays?
SELECT "Venue" FROM table_10093 WHERE "Home team" = 'richmond'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
provide the number of patients whose diagnoses short title is lower extremity embolism and lab test category is blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Lower extremity embolism" AND lab."CATEGORY" = "Blood Gas"
CREATE TABLE table_31324 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
How many millions of U.S viewers are there when the director is andy wolk?
SELECT "U.S. viewers (million)" FROM table_31324 WHERE "Directed by" = 'Andy Wolk'
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE cour...
In order to be on work on time I need to leave by 5:00 P.M. , can you tell me when 596 and 851 will be over ?
SELECT DISTINCT course_offering.end_time, 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 WHERE course.department = 'department0' AND (course.number = 596 OR course.number = 851) AND course_offeri...
CREATE TABLE table_17539 ( "Country" text, "Currency" text, "1 Euro =" text, "1 USD =" text, "Central bank" text )
What's the value of 1 Euro in the country where the value of 1 USD is 483.050 of the local currency?
SELECT "1 Euro =" FROM table_17539 WHERE "1 USD =" = '483.050'
CREATE TABLE table_name_23 ( total INTEGER, nation VARCHAR )
What is the lowest total when the nation is Sweden?
SELECT MIN(total) FROM table_name_23 WHERE nation = "sweden"
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 diagnosis ( diagn...
what intake did patient 025-10988 take since 2170 days ago for the first time?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-10988')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
CREATE TABLE table_12002 ( "Name" text, "District (Region)" text, "Took Office" text, "Left Office" text, "Party" text )
Fran ois Gendron was in which party?
SELECT "Party" FROM table_12002 WHERE "Name" = 'françois gendron'
CREATE TABLE table_26095 ( "Province" text, "Contestant" text, "Age" real, "Height (in)" text, "Height (mt)" text, "Hometown" text )
What is the hometown of contestants who are from the province of Huesca?
SELECT "Hometown" FROM table_26095 WHERE "Province" = 'Huesca'
CREATE TABLE table_204_81 ( id number, "rank" number, "bib" number, "name" text, "country" text, "time" text, "deficit" text )
which players came in a place before lukas bauer ?
SELECT "name" FROM table_204_81 WHERE id < (SELECT id FROM table_204_81 WHERE "name" = 'lukas bauer')
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 me the number of patients whose primary disease is acidosis and age is less than 79?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACIDOSIS" AND demographic.age < "79"
CREATE TABLE table_15459 ( "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text )
What was the margin of victory for the win with a score of 71-69-71-70=281?
SELECT "Margin of victory" FROM table_15459 WHERE "Winning score" = '71-69-71-70=281'
CREATE TABLE table_12051 ( "Points" real, "Name" text, "Club" text, "Apps" real, "Tries" real, "Drop" real )
Who was part of Club Munster with 1 try?
SELECT "Name" FROM table_12051 WHERE "Tries" = '1' AND "Club" = 'munster'
CREATE TABLE playlist_tracks ( playlist_id VARCHAR, track_id VARCHAR ) CREATE TABLE playlists ( name VARCHAR, id VARCHAR )
List the name of playlist which has number of tracks greater than 100.
SELECT T2.name FROM playlist_tracks AS T1 JOIN playlists AS T2 ON T2.id = T1.playlist_id GROUP BY T1.playlist_id HAVING COUNT(T1.track_id) > 100
CREATE TABLE table_66457 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What venue did the 2000 tiger cup take place at on November 10, 2000?
SELECT "Venue" FROM table_66457 WHERE "Competition" = '2000 tiger cup' AND "Date" = 'november 10, 2000'
CREATE TABLE table_53883 ( "Episode" text, "Air Date" text, "Timeslot" text, "Rating" real, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" real, "Rank (Timeslot)" real, "Rank (Night)" text, "Rank (Overall)" real )
How many viewers have an Air Date of march 20, 2008, and an 18-49 (Rating/Share) of 2.3/7?
SELECT "Viewers (m)" FROM table_53883 WHERE "Air Date" = 'march 20, 2008' AND "18-49 (Rating/Share)" = '2.3/7'
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDat...
The lastest questions and answers.
SELECT t1.Id, t1.ParentId, t1.PostTypeId, t1.CreationDate, t1.AcceptedAnswerId, t1.ViewCount, t1.Title, t1.Body, t1.Score, t2.PostTypeId, t2.CreationDate, t2.ViewCount, t2.Title, t2.Body, t2.Score, t1.OwnerUserId, Users.Id, Users.Reputation FROM Posts AS t1 INNER JOIN Posts AS t2 ON t2.Id = t1.ParentId INNER JOIN Users...
CREATE TABLE table_64482 ( "interval name" text, "size (steps)" real, "size (cents)" real, "just ratio" text, "just (cents)" real, "error" text, "audio" text )
What is the value of the size (steps) that has just ratio 10:9 and a size (cents) more than 160
SELECT COUNT("size (steps)") FROM table_64482 WHERE "just ratio" = '10:9' AND "size (cents)" > '160'
CREATE TABLE team ( team_id number, name text ) CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_numb...
Show the season, the player, and the name of the country that player belongs to.
SELECT T2.season, T2.player, T1.country_name FROM country AS T1 JOIN match_season AS T2 ON T1.country_id = T2.country
CREATE TABLE table_20026 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" text )
On what day was the tournament in Alabama?
SELECT "Date" FROM table_20026 WHERE "Location" = 'Alabama'
CREATE TABLE table_204_244 ( id number, "year" number, "album" text, "peak\nus" number, "peak\nus\nholiday" number, "certifications\n(sales threshold)" text )
the oldest year listed is what ?
SELECT "year" FROM table_204_244 ORDER BY "year" LIMIT 1
CREATE TABLE student ( stuid VARCHAR, fname VARCHAR, lname VARCHAR ) CREATE TABLE club ( clubid VARCHAR ) CREATE TABLE member_of_club ( clubid VARCHAR, stuid VARCHAR )
How many clubs does 'Linda Smith' belong to?
SELECT COUNT(*) FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t3.fname = "Linda" AND t3.lname = "Smith"
CREATE TABLE table_79757 ( "Exam" text, "2006 First Time" text, "2006 All" text, "2007 First Time" text, "2007 All" text, "2008 First Time" text, "2008 All" text, "2009 First Time" text, "2009 All" text, "2010 First Time" text, "2011 First Time" text, "2012 First Time" te...
What is the percentage for first time in 2012 when it was 82% for all in 2009?
SELECT "2012 First Time" FROM table_79757 WHERE "2009 All" = '82%'
CREATE TABLE table_name_61 ( country VARCHAR, name VARCHAR )
Which Country has azeri tv tower?
SELECT country FROM table_name_61 WHERE name = "azeri tv tower"
CREATE TABLE table_7959 ( "Team" text, "Location" text, "Venue" text, "Capacity" real, "Position in 2007" text )
What is the venue that is located in zhodino?
SELECT "Venue" FROM table_7959 WHERE "Location" = 'zhodino'
CREATE TABLE table_225100_4 ( vacator VARCHAR, district VARCHAR )
Who is the vacator when south carolina 4th is the district?
SELECT vacator FROM table_225100_4 WHERE district = "South Carolina 4th"
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE ...
Tags which no longer exists (ordered by number of questions).
WITH tagshistory_cte AS (SELECT Id AS phid, REPLACE(value, '>', '') AS TagName FROM PostHistory JOIN LATERAL STRING_SPLIT(Text, '<') WHERE PostHistoryTypeId IN (3, 6, 9) AND LENGTH(value) > 0) SELECT th.TagName, COUNT(DISTINCT ph.PostId) AS "count" FROM tagshistory_cte AS th INNER JOIN PostHistory AS ph ON ph.Id = th.p...
CREATE TABLE table_22207 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
What is the original air date of season 9?
SELECT "Original air date" FROM table_22207 WHERE "Season #" = '9'
CREATE TABLE table_14532_1 ( region VARCHAR, capital VARCHAR )
What is the region where Milan is located?
SELECT region FROM table_14532_1 WHERE capital = "Milan"
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...
let me know the primary disease and diagnosis icd9 code for patient heather vineyard.
SELECT demographic.diagnosis, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Heather Vineyard"
CREATE TABLE table_31235 ( "Round" text, "Clubs remaining" real, "Clubs involved" real, "Winners from previous round" real, "New entries this round" text, "Leagues entering at this round" text )
How many clubs remained when there were 4 winners from the previous round?
SELECT "Clubs remaining" FROM table_31235 WHERE "Winners from previous round" = '4'
CREATE TABLE table_67402 ( "Rank" text, "Bowling" text, "Player" text, "Venue" text, "Date" text )
what venue does tim southee bowl at?
SELECT "Venue" FROM table_67402 WHERE "Player" = 'tim southee'
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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, ...
give me the number of patients whose year of death is less than or equal to 2154 and drug name is prismasate (b22 k4)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2154.0" AND prescriptions.drug = "Prismasate (B22 K4)"
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,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 employees ( EMPLOYEE_ID decimal(6,0),...
For those employees who was hired before 2002-06-21, find job_id and the average of employee_id , and group by attribute job_id, and visualize them by a bar chart, and rank by the X from high to low please.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC
CREATE TABLE table_31747 ( "Nomination" text, "Actor's Name" text, "Film Name" text, "Director" text, "Country" text )
Tell me the actor's name for anastasiya slutskaya belarus
SELECT "Actor's Name" FROM table_31747 WHERE "Film Name" = 'anastasiya slutskaya' AND "Country" = 'belarus'
CREATE TABLE table_22880 ( "Performer" text, "Performances" real, "Category" text, "First performance" text, "Last performance" text )
when was the last performance of the first performance on 11/15/1909
SELECT "Last performance" FROM table_22880 WHERE "First performance" = '11/15/1909'
CREATE TABLE table_2791668_1 ( title VARCHAR, directed_by VARCHAR, no_in_season VARCHAR )
what is the name of the episode whose director is Michael Pressman and the number of that episode in that season is less than 10.0?
SELECT title FROM table_2791668_1 WHERE directed_by = "Michael Pressman" AND no_in_season < 10.0
CREATE TABLE table_70633 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Which opponent has a record of 44-28?
SELECT "Opponent" FROM table_70633 WHERE "Record" = '44-28'
CREATE TABLE table_23008 ( "Team" text, "Games" real, "Wins" real, "Losses" real, "Ties" real, "Win Pct." text, "Playoff berths" real, "Division titles" real, "Postseason record" text, "Super Bowl record" text )
How many division titles are there when the win pc is .558?
SELECT "Division titles" FROM table_23008 WHERE "Win Pct." = '.558'
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
how many patients whose procedure short title is sm bowel endoscopy nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Sm bowel endoscopy NEC"
CREATE TABLE table_203_179 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
who was the next opponent after germany in 2002 ?
SELECT "opponent" FROM table_203_179 WHERE "date" > (SELECT "date" FROM table_203_179 WHERE "opponent" = 'germany') ORDER BY "date" LIMIT 1
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and the sum of price , and group by attribute name.
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
CREATE TABLE table_26860595_2 ( texture___gt__s_ VARCHAR, tdp__watts__gpu_only VARCHAR )
How many texture (gt/s) the card has if the tdp (watts) GPU only is 18?
SELECT COUNT(texture___gt__s_) FROM table_26860595_2 WHERE tdp__watts__gpu_only = "18"
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( c...
tell me the allergies that patient 004-29334 had when they came to the hospital first time?
SELECT allergy.allergyname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-29334' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient...
CREATE TABLE table_37887 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What was the Visitor when the home was toronto maple leafs and the score was 4 1?
SELECT "Visitor" FROM table_37887 WHERE "Home" = 'toronto maple leafs' AND "Score" = '4–1'
CREATE TABLE table_69297 ( "Island" text, "Group" text, "Area ( ha )" text, "Population" text, "Height (m)" real )
What is the Population of the group that has a Height (m) of 15 and an Area (ha) of 00017 17?
SELECT "Population" FROM table_69297 WHERE "Height (m)" = '15' AND "Area ( ha )" = '00017 17'
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
what was the last medication that patient 5553 was prescribed?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5553) ORDER BY prescriptions.startdate DESC LIMIT 1
CREATE TABLE table_16876 ( "Yard Name" text, "Location (city, state)" text, "1st Ship Delivery Date" text, "Ship Types Delivered" text, "Total Number of Ways" text, "total vessels built" text )
What was the delivery date when s2 (lst) type, s2 (frigate) type, c1-m type was delivered?
SELECT "1st Ship Delivery Date" FROM table_16876 WHERE "Ship Types Delivered" = 'S2 (LST) type, S2 (frigate) type, C1-M type'
CREATE TABLE table_74277 ( "Year" real, "FBS Opponent" text, "Result" text, "Opponents Conference" text, "Opponents Head Coach" text, "Coastal Carolina Head Coach" text )
How many head coaches did Kent state golden flashes have?
SELECT COUNT("Opponents Head Coach") FROM table_74277 WHERE "FBS Opponent" = 'Kent State Golden Flashes'
CREATE TABLE table_65509 ( "Club" text, "League/Division" text, "Home Ground" text, "Location" text, "Position in 2012-13" text )
What League/Division has a Location of n/a?
SELECT "League/Division" FROM table_65509 WHERE "Location" = 'n/a'
CREATE TABLE table_dev_61 ( "id" int, "pregnancy_or_lactation" bool, "allergy_to_gadolinium" bool, "renal_disease" bool, "creatinine_clearance_cl" float, "cardiogenic_shock" bool, "hypertension" bool, "NOUSE" float )
patients with uncontrolled ( treated or untreated ) hypertension
SELECT * FROM table_dev_61 WHERE hypertension = 1
CREATE TABLE table_66707 ( "Year" text, "Births (000s)" real, "Deaths" real, "Natural Growth" real, "Total Fertility Rate" text )
What was the total fertility rate that had a death rate larger than 7.8?
SELECT "Total Fertility Rate" FROM table_66707 WHERE "Deaths" > '7.8'
CREATE TABLE table_33679 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the home team's score at corio oval?
SELECT "Home team score" FROM table_33679 WHERE "Venue" = 'corio oval'
CREATE TABLE table_50572 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
What is the To Par when the finish was t16 and the player was Julius Boros?
SELECT "To par" FROM table_50572 WHERE "Finish" = 't16' AND "Player" = 'julius boros'
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
What is the number of patients with atrial septal defect/mitral valve replacement repair atrial-septal defect/sda who have procedure icd9 code 3613?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" AND procedures.icd9_code = "3613"
CREATE TABLE table_name_93 ( runner_s__up VARCHAR, tournament VARCHAR )
Who was the runner-up in the Michelob Light Open at Kingsmill?
SELECT runner_s__up FROM table_name_93 WHERE tournament = "michelob light open at kingsmill"
CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE activity ( actid number, activity_name text ) CREATE TABLE faculty ( facid number, lname text, fname text, rank text, sex text, phone number, room text, building text ) CREATE TABLE student ( ...
What is the name of the activity that has the most faculty members involved in?
SELECT T1.activity_name FROM activity AS T1 JOIN faculty_participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
Of all the courses , which have been taught or will be taught by Neill Mohammad ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Neill Mohammad%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id ...
CREATE TABLE table_32907 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the away team at the game where Footscray was the home team and the crowd was larger than 20,200?
SELECT "Away team" FROM table_32907 WHERE "Crowd" > '20,200' AND "Home team" = 'footscray'
CREATE TABLE table_2598 ( "Market Rank & City of license /Market" text, "Station" text, "Channel TV / DT" text, "Owned since" real, "Affiliation" text )
What market rank and city had the station KABC-TV?
SELECT "Market Rank & City of license /Market" FROM table_2598 WHERE "Station" = 'KABC-TV'
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...
What class can I take during this semester that 's a prerequisite for most other classes ?
SELECT COUNT(DISTINCT COURSE_PREREQUISITEalias0.course_id), COURSEalias0.department, COURSEalias0.name, COURSEalias0.number FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course AS COURSEalias1, course_offering AS COURSE_OFFERINGali...
CREATE TABLE table_name_38 ( rank VARCHAR, silver VARCHAR, bronze VARCHAR )
How many teams won more than 2 silver medals and fewer than 2 Bronze medals?
SELECT COUNT(rank) FROM table_name_38 WHERE silver > 2 AND bronze < 2
CREATE TABLE table_1598533_8 ( annual_change__percentage_of_gdp__2012_ VARCHAR, gdp__percentage_of_eu__2012_ VARCHAR )
What is the annual change of GDP with a 20.5% GDP of EU in 2012?
SELECT annual_change__percentage_of_gdp__2012_ FROM table_1598533_8 WHERE gdp__percentage_of_eu__2012_ = "20.5%"
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what did patient 005-48105 first have as his intake during the previous day?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-48105')) AND intakeoutput.cellpath LIKE '%intake%' AND D...
CREATE TABLE table_name_99 ( tournament VARCHAR, opponent_in_the_final VARCHAR )
What tournament has Samantha Stosur as the opponent in the final?
SELECT tournament FROM table_name_99 WHERE opponent_in_the_final = "samantha stosur"
CREATE TABLE table_59785 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
What is Sweden's lowest score?
SELECT MIN("Score") FROM table_59785 WHERE "Country" = 'sweden'
CREATE TABLE table_name_9 ( points INTEGER, year VARCHAR, engine VARCHAR, entrant VARCHAR )
What is the greatest point of an Entrant of connaught engineering alta straight-4 engine before 1957
SELECT MAX(points) FROM table_name_9 WHERE engine = "alta straight-4" AND entrant = "connaught engineering" AND year < 1957
CREATE TABLE table_78940 ( "City" text, "Country" text, "Airport" text, "IATA" text, "ICAO" text )
What is City of Sandefjord in Norway's IATA?
SELECT "IATA" FROM table_78940 WHERE "Country" = 'norway' AND "City" = 'sandefjord'
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Users ( Id num...
All questions on android things.
SELECT Id, CreationDate, AcceptedAnswerId FROM Posts AS P WHERE (Title LIKE '%androidthings%' OR Title LIKE '%android-things%' OR Title LIKE '%AndroidThings%')
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...
tell me the number of patients with a diagnoses of septic shock who have been discharged to skilled nursing facility.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "REHAB/DISTINCT PART HOSP" AND diagnoses.short_title = "Septic shock"
CREATE TABLE table_name_43 ( season INTEGER, households_viewers__in_millions_ VARCHAR, viewer_rank___number_ VARCHAR )
Which season had less than 25.4 viewers and had a viewer rank of #6?
SELECT MIN(season) FROM table_name_43 WHERE households_viewers__in_millions_ < 25.4 AND viewer_rank___number_ = "#6"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 ) C...
what is minimum age of patients whose insurance is medicaid and primary disease is cerebral aneurysm/sda?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.diagnosis = "CEREBRAL ANEURYSM/SDA"
CREATE TABLE table_name_2 ( b_score INTEGER, total VARCHAR, a_score VARCHAR )
Which B Score has a Total larger than 15.325, and an A Score smaller than 6.4?
SELECT SUM(b_score) FROM table_name_2 WHERE total > 15.325 AND a_score < 6.4
CREATE TABLE table_13125 ( "7:30 am" text, "8:00 am" text, "9:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:30 pm" text, "4:00 pm" text, "4:30 pm" text, "5:00 pm" text, "6:30 pm" text )
What is 1:30 pm, when 8:00 am is 'The Today Show with Katie Couric & Matt Lauer'?
SELECT "1:30 pm" FROM table_13125 WHERE "8:00 am" = 'the today show with katie couric & matt lauer'
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...
provide the number of patients younger than 30 years who have procedure icd9 code 3771.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "30" AND procedures.icd9_code = "3771"
CREATE TABLE table_name_61 ( opponent VARCHAR, week VARCHAR )
I want to know the opponent that ha a week of 3
SELECT opponent FROM table_name_61 WHERE week = "3"
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Users who posted most recent comments.
WITH recent_cte AS (SELECT UserId AS uid, MAX(Id) AS MaxId FROM Comments GROUP BY UserId) SELECT uid AS "user_link", c.CreationDate, MaxId AS "comment_link", c.PostId AS "post_link", c.Text FROM recent_cte INNER JOIN Comments AS c ON MaxId = c.Id ORDER BY c.CreationDate DESC
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 cost ( costid num...
what are the four most commonly given lab tests for patients who have been diagnosed with necrotizing fasciitis - post-op before within 2 months, until 1 year ago?
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'necrotizing fasciitis - post-op' AND DATETIME(diagno...
CREATE TABLE table_name_85 ( lane INTEGER, country VARCHAR, rank VARCHAR )
What is the highest lane for Brazil, ranked less than 8?
SELECT MAX(lane) FROM table_name_85 WHERE country = "brazil" AND rank < 8
CREATE TABLE player ( Player_name VARCHAR, Votes VARCHAR )
What is the name of the player with the largest number of votes?
SELECT Player_name FROM player ORDER BY Votes DESC LIMIT 1
CREATE TABLE table_name_56 ( constellation VARCHAR, declination___j2000__ VARCHAR, right_ascension___j2000__ VARCHAR )
I want the constellation for declination for 45 and right ascension of 07h58m
SELECT constellation FROM table_name_56 WHERE declination___j2000__ = "°45′" AND right_ascension___j2000__ = "07h58m"
CREATE TABLE Skills_Required_To_Fix ( part_fault_id INTEGER, skill_id INTEGER ) CREATE TABLE Assets ( asset_id INTEGER, maintenance_contract_id INTEGER, supplier_company_id INTEGER, asset_details VARCHAR(255), asset_make VARCHAR(20), asset_model VARCHAR(20), asset_acquired_date DATE...
A stacked bar chart showing the number of engineers for different skill description The x-axis is skill description and group by other deteails, display Y-axis in desc order.
SELECT skill_description, COUNT(skill_description) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY other_details, skill_description ORDER BY COUNT(skill_description) DESC
CREATE TABLE table_name_64 ( location VARCHAR, county VARCHAR )
What's the location for the country of platte?
SELECT location FROM table_name_64 WHERE county = "platte"
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location ...
i would like information on flights leaving early monday morning from ATLANTA to BALTIMORE
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 21 AND date_day.month_number = 2 AN...
CREATE TABLE table_train_180 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "systolic_blood_pressure_sbp" int, "hemoglobin_a1c_hba1c" float, "diabetic" string, "post_load_glucose" int, "diastolic_blood_pressure_dbp" int, "impaired_glucose_tolerance" bool, "fasting_gl...
age 18 years or older with clinical type i diabetes for at least one year
SELECT * FROM table_train_180 WHERE age >= 18 AND diabetic = 'i'