table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
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 prescriptions...
what number of patients who were born before the year 2107 had diagnoses titled elev transaminase/ldh?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2107" AND diagnoses.short_title = "Elev transaminase/ldh"
CREATE TABLE table_70494 ( "Venue" text, "City" text, "Tickets Sold / Available" text, "Gross Revenue (1986)" text, "Gross Revenue (2011)" text )
How many tickets were sold/available when the gross revenue (2011) was $366,916?
SELECT "Tickets Sold / Available" FROM table_70494 WHERE "Gross Revenue (2011)" = '$366,916'
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit te...
since 3 years ago how many patients were diagnosed with epilep nos w/o intr epil in the same hospital encounter after the previous diagnosis of subarachnoid hem-no coma?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title =...
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 prescriptions ( subject_id text, hadm_id...
count the number of patients whose admission location is emergency room admit and diagnoses short title is long-term use anticoagul?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND diagnoses.short_title = "Long-term use anticoagul"
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE admissions ( row_id num...
what is the average monthly number of patients that are suffering from carrier nec until 4 years ago?
SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'carrier nec') AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY ST...
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId...
How to search linked question with specific tag?. https://meta.stackoverflow.com/questions/371789/how-to-search-linked-question-with-specific-tag
SELECT CONCAT('site://q/', q.Id, '|', q.Title) AS "linked_post" FROM PostLinks AS pl INNER JOIN Posts AS q ON q.Id = pl.PostId INNER JOIN PostTags AS pt ON pt.PostId = q.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE RelatedPostId = '##postid:int?588004##' AND t.TagName = '##tagname:string?php##' AND LinkTypeId = 1
CREATE TABLE table_63232 ( "School" text, "Location" text, "Mascot" text, "County" real, "Enrollment" text, "IHSAA Class" text, "Year Joined" real, "Previous Conference" text )
What is the IHSAA class of the county that is less than 228?
SELECT "IHSAA Class" FROM table_63232 WHERE "County" < '228'
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Employees ( Employee_ID INTEGER, Role_Code CHAR(15), Employee_Name VARCHAR(255), Gender_MFU CHAR(1), Date_of_Birth DATETIME, Other_Details VARCHAR(255) ) CREATE TABLE Ref_L...
Show the number of documents for each location code in a bar chart, I want to order from high to low by the bars.
SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code DESC
CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), HIRE_DATE date, JOB_ID varchar(10), SALARY decimal(8,2), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
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, a scatter chart shows the correlation between manager_id and department_id .
SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
CREATE TABLE table_22118197_1 ( result VARCHAR, english_title VARCHAR )
What was the result for the film with the English name of Morning Undersea?
SELECT result FROM table_22118197_1 WHERE english_title = "Morning Undersea"
CREATE TABLE table_68213 ( "Year" real, "Manufacturer" text, "Start" real, "Finish" real, "Team" text )
Name the sum of year when start is less than 30
SELECT SUM("Year") FROM table_68213 WHERE "Start" < '30'
CREATE TABLE table_42592 ( "Rank" real, "Name" text, "Years" text, "Games" real, "Goals" real, "Goals/Games" real )
What is the highest Rank for more than 220 goals in 1965 1978-78?
SELECT MAX("Rank") FROM table_42592 WHERE "Goals" > '220' AND "Years" = '1965–1978-78'
CREATE TABLE table_name_59 ( location VARCHAR, record VARCHAR )
Which Location has a Record of 0-1?
SELECT location FROM table_name_59 WHERE record = "0-1"
CREATE TABLE table_32678 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the size of the crowd when Essendon was the away team?
SELECT "Crowd" FROM table_32678 WHERE "Away team" = 'essendon'
CREATE TABLE table_name_6 ( wins VARCHAR, points VARCHAR )
What is the number of wins when there are 7 points?
SELECT wins FROM table_name_6 WHERE points = 7
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
when did patient 021-100763 since 12/2105 have the minimum fio2 for the first time?
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 = '021-100763')) AND lab.labname = 'fio2' AND STRFTIME('%y-%m', lab.labresulttime) >= ...
CREATE TABLE table_69000 ( "Engine code" text, "Displacement" text, "Power, Torque@rpm" text, "Redline (rpm)" real, "Year" real )
From what year is the engine with engine code M57D30?
SELECT "Year" FROM table_69000 WHERE "Engine code" = 'm57d30'
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 ...
Which classes are useful to take before taking ORALPATH 696 ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'ORALPATH' AND number = 696
CREATE TABLE table_25771 ( "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 (millions)" text )
What's the production code of the episode seen by 7.49 million people in the US?
SELECT "Production code" FROM table_25771 WHERE "U.S. viewers (millions)" = '7.49'
CREATE TABLE table_name_10 ( nationality VARCHAR, player VARCHAR )
What is John Flatters' nationality?
SELECT nationality FROM table_name_10 WHERE player = "john flatters"
CREATE TABLE table_name_12 ( opponent VARCHAR, method VARCHAR, record VARCHAR )
What opponent used the Ko method, and a 6-0 record?
SELECT opponent FROM table_name_12 WHERE method = "ko" AND record = "6-0"
CREATE TABLE table_34353 ( "Season" text, "Player" text, "Position" text, "Nationality" text, "Team" text )
What position did the kr team player play?
SELECT "Position" FROM table_34353 WHERE "Team" = 'kr'
CREATE TABLE table_54498 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Date has a Venue of junction oval?
SELECT "Date" FROM table_54498 WHERE "Venue" = 'junction oval'
CREATE TABLE table_204_455 ( id number, "rd." number, "grand prix" text, "date" text, "location" text, "pole position" text, "fastest lap" text, "winning driver" text, "constructor" text, "report" text )
how many times was ayrton senna in pole position ?
SELECT COUNT(*) FROM table_204_455 WHERE "pole position" = 'ayrton senna'
CREATE TABLE table_17288825_10 ( high_points VARCHAR, location_attendance VARCHAR )
How many different items appear in the high points column when the location attendance was US Airways Center 18,422?
SELECT COUNT(high_points) FROM table_17288825_10 WHERE location_attendance = "US Airways Center 18,422"
CREATE TABLE table_65416 ( "Branding" text, "Call-Sign" text, "Frequency" text, "Power (kw)" text, "Location" text )
What's the call sign if the branding is 1062 DXKI Koronadal?
SELECT "Call-Sign" FROM table_65416 WHERE "Branding" = '1062 dxki koronadal'
CREATE TABLE table_name_16 ( series VARCHAR, winner VARCHAR )
Which series was won by Paul Morris?
SELECT series FROM table_name_16 WHERE winner = "paul morris"
CREATE TABLE table_64271 ( "Period" text, "Internet Explorer" text, "Chrome" text, "Firefox" text, "Safari" text, "Opera" text, "Other Mozilla" text )
What period has 0.25% as the other mozilla?
SELECT "Period" FROM table_64271 WHERE "Other Mozilla" = '0.25%'
CREATE TABLE table_17510803_2 ( club VARCHAR, points VARCHAR )
How many clubs have 62 points?
SELECT COUNT(club) FROM table_17510803_2 WHERE points = "62"
CREATE TABLE ship ( ship_id number, name text, type text, nationality text, tonnage number ) CREATE TABLE mission ( mission_id number, ship_id number, code text, launched_year number, location text, speed_knots number, fate text )
Show the types of ships that have both ships with tonnage larger than 6000 and ships with tonnage smaller than 4000.
SELECT type FROM ship WHERE tonnage > 6000 INTERSECT SELECT type FROM ship WHERE tonnage < 4000
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 ...
find out the number of patients admitted before 2150 who had free calcium lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2150" AND lab.label = "Free Calcium"
CREATE TABLE table_71849 ( "7:00" text, "7:30" text, "8:00" text, "8:30" text, "9:00" text, "9:30" text, "10:00" text )
What show comes on at 9:00 on the channel that shows the Insider at 7:00?
SELECT "9:00" FROM table_71849 WHERE "7:00" = 'the insider'
CREATE TABLE table_name_71 ( score VARCHAR, date VARCHAR )
What score has october 16, 2000 as the date?
SELECT score FROM table_name_71 WHERE date = "october 16, 2000"
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Count num...
Who Hated on My Answer?.
SELECT V.Id, V.PostId AS "post_link", V.UserId AS "user_link", CAST(DATEDIFF(day, P.CreationDate, CreationDate) AS VARCHAR) + ' days later' AS "hater_eta" FROM Votes AS V, VoteTypes AS Vt, Posts AS P, PostTypes AS Pt WHERE P.Id = V.PostId AND Pt.Id = P.PostTypeId AND Vt.Id = V.VoteTypeId AND Pt.Id = 2 AND Vt.Id = 3
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 prescriptions ( row_id number, subject_id number, h...
what is the organism that was detected in patient 53176's last urine microbiology test this month?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 53176) AND microbiologyevents.spec_type_desc = 'urine' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime, 'start of ...
CREATE TABLE table_name_34 ( position INTEGER, drawn VARCHAR, played VARCHAR )
Which Position has Drawn larger than 1, and a Played smaller than 14?
SELECT MAX(position) FROM table_name_34 WHERE drawn > 1 AND played < 14
CREATE TABLE table_56916 ( "Year" text, "2010" real, "2009" real, "2008" real, "2005" real, "2000" real )
Name the sum of 2010 for 2000 of 17 and 2005 more than 16
SELECT SUM("2010") FROM table_56916 WHERE "2000" = '17' AND "2005" > '16'
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAno...
JavaScript Trends (# of Questions per Month).
SELECT DATEADD(mm, (YEAR(Posts.CreationDate) - 1900) * 12 + MONTH(Posts.CreationDate) - 1, 0) AS Month, Tags.TagName, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName IN ...
CREATE TABLE SportsInfo ( StuID INTEGER, SportName VARCHAR(32), HoursPerWeek INTEGER, GamesPlayed INTEGER, OnScholarship VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, ...
Bar chart x axis sportname y axis the total number, rank X-axis from high to low order please.
SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY SportName DESC
CREATE TABLE table_19463 ( "Rnd" real, "Race Name" text, "Circuit" text, "City/Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text, "Report" text )
how many winning team with circuit being road america
SELECT COUNT("Winning team") FROM table_19463 WHERE "Circuit" = 'Road America'
CREATE TABLE table_name_54 ( date_of_replacement VARCHAR, reason_of_departure VARCHAR, team VARCHAR )
On what date did the manager for PSIS Semarang take over for the manager that was sacked?
SELECT date_of_replacement FROM table_name_54 WHERE reason_of_departure = "sacked" AND team = "psis semarang"
CREATE TABLE table_55964 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What Venue had Carlton has the Away team?
SELECT "Venue" FROM table_55964 WHERE "Away team" = 'carlton'
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 demographic (...
How many patients with orthostatic hypotension are hispanic or latino?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND diagnoses.long_title = "Orthostatic hypotension"
CREATE TABLE table_12321870_32 ( goals VARCHAR, player_name VARCHAR )
How many goals have been scored by Tiago Gomes?
SELECT goals FROM table_12321870_32 WHERE player_name = "Tiago Gomes"
CREATE TABLE list ( grade VARCHAR, classroom VARCHAR )
For each grade, report the grade, the number of classrooms in which it is taught and the total number of students in the grade.
SELECT grade, COUNT(DISTINCT classroom), COUNT(*) FROM list GROUP BY grade
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimme...
Find meter_200 and the amount of meter_200 , and group by attribute meter_200, and visualize them by a bar chart, show in ascending by the bar.
SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY meter_200
CREATE TABLE table_572 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What was the amount won with tries against at 54?
SELECT "Won" FROM table_572 WHERE "Tries against" = '54'
CREATE TABLE table_name_15 ( pick VARCHAR, school VARCHAR )
Which pick was from Lamar High School?
SELECT pick FROM table_name_15 WHERE school = "lamar high school"
CREATE TABLE table_name_28 ( winner VARCHAR, jockey VARCHAR, owner VARCHAR )
which winner has a jockery containing jerry bailey and the owner of overbrook farm?
SELECT winner FROM table_name_28 WHERE jockey = "jerry bailey" AND owner = "overbrook farm"
CREATE TABLE table_name_97 ( silver VARCHAR, gold VARCHAR )
How many silver metals are possessed by countries with 2 gold medals?
SELECT COUNT(silver) FROM table_name_97 WHERE gold = 2
CREATE TABLE table_19917 ( "Series Ep." text, "Episode" real, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
Name the number of episods for segment c being s oyster
SELECT COUNT("Episode") FROM table_19917 WHERE "Segment C" = 's Oyster'
CREATE TABLE table_203_222 ( id number, "category" text, "#" number, "name" text, "hanzi" text, "hanyu pinyin" text, "population (2010 census)" number, "area (km2)" number, "density (/km2)" number )
which area has the largest population ?
SELECT "name" FROM table_203_222 ORDER BY "population (2010 census)" DESC LIMIT 1
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefin...
Questions favorited 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 VoteTypeId = 5 AND Posts.PostTypeId = 1 AND Posts.OwnerUserId = Votes.UserId ORDER BY Posts.CreationDate DESC
CREATE TABLE table_name_74 ( total VARCHAR, year_won VARCHAR, to_par VARCHAR )
What is the total of the player who won before 1991 and has a to par less than 14?
SELECT COUNT(total) FROM table_name_74 WHERE year_won < 1991 AND to_par < 14
CREATE TABLE table_name_43 ( source VARCHAR, chrome VARCHAR )
Which source reported 32.60% of browsers used Chrome?
SELECT source FROM table_name_43 WHERE chrome = "32.60%"
CREATE TABLE table_name_73 ( score VARCHAR, date VARCHAR )
What was the score for the April 12 game?
SELECT score FROM table_name_73 WHERE date = "april 12"
CREATE TABLE table_17085981_2 ( date_of_appointment VARCHAR, outgoing_manager VARCHAR )
What was the date of appointment when J rgen Kohler was the outgoing manager?
SELECT date_of_appointment FROM table_17085981_2 WHERE outgoing_manager = "Jürgen Kohler"
CREATE TABLE table_67576 ( "Status" text, "Name" text, "First Performance" text, "Last Performance" text, "Style" text )
who had a last performance of 3 july 2011?
SELECT "Name" FROM table_67576 WHERE "Last Performance" = '3 july 2011'
CREATE TABLE tags ( index number, id number, tag text ) CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number )
How many downloads of ep and album respectively?
SELECT SUM(totalsnatched) FROM torrents WHERE releasetype = "ep" UNION SELECT SUM(totalsnatched) FROM torrents WHERE releasetype = "album"
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, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, ...
whats the unabbreviated version of blood inf dt cen ven cth.
SELECT d_icd_diagnoses.long_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'blood inf dt cen ven cth' UNION SELECT d_icd_procedures.long_title FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'blood inf dt cen ven cth'
CREATE TABLE table_204_344 ( id number, "player" text, "games played" number, "field goals" number, "free throws" number, "points" number )
who had the most points scored for the 191617 illinois fighting illini men 's basketball team ?
SELECT "player" FROM table_204_344 ORDER BY "points" DESC LIMIT 1
CREATE TABLE table_204_235 ( id number, "season" text, "team" text, "country" text, "competition" text, "matches" number, "goals" number )
what country is team djurg rdens if not from ?
SELECT "country" FROM table_204_235 WHERE "team" = 'djurgardens if'
CREATE TABLE table_name_75 ( score VARCHAR, result VARCHAR, record VARCHAR )
WHAT SCORE HAD A LOSS AND RECORD OF 1-1?
SELECT score FROM table_name_75 WHERE result = "loss" AND record = "1-1"
CREATE TABLE table_16647 ( "#" real, "Episode" text, "Air Date" text, "Rating" text, "Share" real, "Rating/Share 18\u201349" text, "Viewers (m)" text, "Timeslot Rank" real, "Night Rank" text, "Overall Rank" real )
what's the night rank with viewers (m) of 6.63
SELECT "Night Rank" FROM table_16647 WHERE "Viewers (m)" = '6.63'
CREATE TABLE table_name_52 ( team VARCHAR, position_in_table VARCHAR, manner_of_departure VARCHAR )
What Team's Pre-Season Manager's manner of departure was the end of tenure as caretaker?
SELECT team FROM table_name_52 WHERE position_in_table = "pre-season" AND manner_of_departure = "end of tenure as caretaker"
CREATE TABLE table_name_15 ( bronze INTEGER, rank VARCHAR )
What is the high bronze total for nations ranked 12?
SELECT MAX(bronze) FROM table_name_15 WHERE rank = "12"
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 admitted before 2182 who had a granulocyte count test done.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2182" AND lab.label = "Granulocyte Count"
CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE market ( Mar...
Return the low and high estimates for all film markets in a scatter chart
SELECT Low_Estimate, High_Estimate FROM film_market_estimation
CREATE TABLE table_47685 ( "Rider" text, "Manufacturer" text, "Laps" text, "Time/Retired" text, "Grid" text )
WHAT IS THE MANUFACTURER WITH 24 LAPS AND GRID 27?
SELECT "Manufacturer" FROM table_47685 WHERE "Laps" = '24' AND "Grid" = '27'
CREATE TABLE people ( People_ID int, District text, Name text, Party text, Age int ) CREATE TABLE debate_people ( Debate_ID int, Affirmative int, Negative int, If_Affirmative_Win bool ) CREATE TABLE debate ( Debate_ID int, Date text, Venue text, Num_of_Audience int ...
A bar chart showing the number of debates in each venue for those on the affirmative side, rank Y-axis from high to low order.
SELECT Venue, COUNT(Venue) FROM debate_people AS T1 JOIN debate AS T2 ON T1.Debate_ID = T2.Debate_ID JOIN people AS T3 ON T1.Affirmative = T3.People_ID GROUP BY Venue ORDER BY COUNT(Venue) DESC
CREATE TABLE table_204_948 ( id number, "year" number, "award" text, "category" text, "film" text, "result" text )
how many results are indicated as won ?
SELECT COUNT("result") FROM table_204_948 WHERE "result" = 'won'
CREATE TABLE table_72988 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Raiders points" real, "Opponents" real, "Raiders first downs" real, "Record" text, "Attendance" real )
How many opponents played 1 game with a result win?
SELECT MAX("Opponents") FROM table_72988 WHERE "Result" = 'Win' AND "Game" = '1'
CREATE TABLE table_name_12 ( Id VARCHAR )
What was the position for 2008, where 2012 was q1, and 2010 was 1r?
SELECT 2008 FROM table_name_12 WHERE 2012 = "q1" AND 2010 = "1r"
CREATE TABLE table_28889 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
What is Samuel Smith's party?
SELECT "Party" FROM table_28889 WHERE "Incumbent" = 'Samuel Smith'
CREATE TABLE table_16387700_1 ( crowd INTEGER, date VARCHAR )
Name the most crowd for saturday 16 february
SELECT MAX(crowd) FROM table_16387700_1 WHERE date = "Saturday 16 February"
CREATE TABLE Engineer_Visits ( engineer_visit_id INTEGER, contact_staff_id INTEGER, engineer_id INTEGER, fault_log_entry_id INTEGER, fault_status VARCHAR(10), visit_start_datetime DATETIME, visit_end_datetime DATETIME, other_visit_details VARCHAR(255) ) CREATE TABLE Fault_Log ( faul...
How many engineers did each staff contact? List both the contact staff name and number of engineers contacted in a bar chart, and rank x-axis in descending order please.
SELECT staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name ORDER BY staff_name DESC
CREATE TABLE table_name_90 ( location VARCHAR, call_sign VARCHAR )
Which Location has a Call sign of cjtw-fm?
SELECT location FROM table_name_90 WHERE call_sign = "cjtw-fm"
CREATE TABLE table_9262 ( "Date" text, "Event" text, "Home Team" text, "Away Team" text, "Score" text )
Which away team played on June 9, 2015 with a home team of f1?
SELECT "Away Team" FROM table_9262 WHERE "Date" = 'june 9, 2015' AND "Home Team" = 'f1'
CREATE TABLE table_name_31 ( opponent VARCHAR, record VARCHAR )
What opponent does she fight when she is 10-1?
SELECT opponent FROM table_name_31 WHERE record = "10-1"
CREATE TABLE table_name_17 ( position VARCHAR, name VARCHAR )
Which Position has a Name of john taft?
SELECT position FROM table_name_17 WHERE name = "john taft"
CREATE TABLE table_14345690_15 ( series VARCHAR, main_presenter VARCHAR )
What series have Caroline Flack as a main presenter?
SELECT series FROM table_14345690_15 WHERE main_presenter = "Caroline Flack"
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE SuggestedEdits ( Id number, PostId numb...
Average of time between posts and accepted answer creation, by months.
SELECT STR_TO_TIME(CONCAT(YEAR(p.CreationDate), '-', MONTH(p.CreationDate), '-01'), '%Y-%m-%d %H:%M:%S') AS Mes, CAST(AVG(CAST((JULIANDAY(ans.CreationDate) - JULIANDAY(p.CreationDate)) * 24.0 AS INT)) AS FLOAT) / 24 AS dias FROM Posts AS p JOIN Posts AS ans ON ans.Id = p.AcceptedAnswerId WHERE p.AcceptedAnswerId > 0 GR...
CREATE TABLE table_name_88 ( transfer_fee VARCHAR, transfer_window VARCHAR, name VARCHAR )
Name the transfer fee with a transfer window of summer for schollen
SELECT transfer_fee FROM table_name_88 WHERE transfer_window = "summer" AND name = "schollen"
CREATE TABLE Claims ( Claim_ID INTEGER, Policy_ID INTEGER, Date_Claim_Made DATE, Date_Claim_Settled DATE, Amount_Claimed INTEGER, Amount_Settled INTEGER ) CREATE TABLE Customers ( Customer_ID INTEGER, Customer_Details VARCHAR(255) ) CREATE TABLE Settlements ( Settlement_ID INTEGER,...
Plot the number of payment method code by grouped by payment method code as a bar graph, and show by the Payment_Method_Code from low to high.
SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code ORDER BY Payment_Method_Code
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TI...
For all employees who have the letters D or S in their first name, show me about the correlation between salary and manager_id in a scatter chart.
SELECT SALARY, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
CREATE TABLE Elimination ( Elimination_ID text, Wrestler_ID text, Team text, Eliminated_By text, Elimination_Move text, Time text ) CREATE TABLE wrestler ( Wrestler_ID int, Name text, Reign text, Days_held text, Location text, Event text )
What is the number of their teams in elimination? Draw a bar chart, and order in ascending by the y axis please.
SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team ORDER BY COUNT(Team)
CREATE TABLE table_1164 ( "Rnd" real, "Pick" real, "Player name" text, "Position" text, "College" text, "Height" text, "Weight" text )
How many heights does chad henne have?
SELECT COUNT("Height") FROM table_1164 WHERE "Player name" = 'Chad Henne'
CREATE TABLE table_1613 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
On what date did Canty (6) receive high assists?
SELECT "Date" FROM table_1613 WHERE "High assists" = 'Canty (6)'
CREATE TABLE table_name_21 ( season INTEGER, venue VARCHAR, second VARCHAR )
What is the sum of season when the venue was donington park, and Brazil came in second?
SELECT SUM(season) FROM table_name_21 WHERE venue = "donington park" AND second = "brazil"
CREATE TABLE table_13452 ( "Name" text, "Party" text, "Member of" text, "First elected" text, "Constiuency" text )
What is Myron Walwyn with a Territorial at-large Constiuency's First Elected Date
SELECT "First elected" FROM table_13452 WHERE "Constiuency" = 'territorial at-large' AND "Name" = 'myron walwyn'
CREATE TABLE table_name_82 ( team VARCHAR, start VARCHAR, finish VARCHAR )
What team had a finish of 25 in a smaller than 28?
SELECT team FROM table_name_82 WHERE start < 28 AND finish = 25
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS va...
For those employees who was hired before 2002-06-21, find hire_date and the average of manager_id bin hire_date by weekday, and visualize them by a bar chart, and order by the y-axis in descending.
SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(MANAGER_ID) DESC
CREATE TABLE table_204_202 ( id number, "year" number, "tournament" text, "venue" text, "result" text, "rank" text, "event" text )
did kaseorg compete in the decathlon or the heptathlon in his first race ?
SELECT "event" FROM table_204_202 WHERE id = 1
CREATE TABLE table_name_79 ( floors INTEGER, building_type VARCHAR, sr_no VARCHAR )
what is the least floors when the building type is residential and the sr no is 8?
SELECT MIN(floors) FROM table_name_79 WHERE building_type = "residential" AND sr_no = 8
CREATE TABLE table_22713796_14 ( sprint_classification VARCHAR, winner VARCHAR )
Name the sprint classification being alejandro valverde
SELECT sprint_classification FROM table_22713796_14 WHERE winner = "Alejandro Valverde"
CREATE TABLE table_27901 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
What is the lowest overall amount of no votes?
SELECT MIN("NO votes") FROM table_27901
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 ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a scatter chart about the correlation between manager_id and department_id .
SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
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...
Answered questions for a tag.
SELECT Id AS "post_link", Tags AS "tags", Title AS "title", Score, ViewCount AS Views, CreationDate AS "date_asked" FROM Posts WHERE Tags LIKE '%<' + '##TagName:string##' + '>%' AND ClosedDate IS NULL AND (AnswerCount = 1)
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, ...
when on 12/30/this year patient 12927 had an intake for the last time?
SELECT inputevents_cv.charttime 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 = 12927)) AND DATETIME(inputevents_cv.charttime, 'start of year') = DATETIME(CURRENT_TIME(), '...
CREATE TABLE table_59737 ( "Year" text, "Winner" text, "Runner-up" text, "Venue" text, "Location" text )
Who is the winner in des moines, iowa where p.h. finkbank was the runner-up?
SELECT "Winner" FROM table_59737 WHERE "Location" = 'des moines, iowa' AND "Runner-up" = 'p.h. finkbank'