table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_19766_1 ( country VARCHAR )
How many millions of $ were spent in Iceland in 1948/49?
SELECT MAX(1948 AS _49__) AS $_millions_ FROM table_19766_1 WHERE country = "Iceland"
CREATE TABLE table_28613 ( "#" real, "Player" text, "Points" real, "Rebounds" real, "Assists" real, "Opponent" text, "Date" text )
List the number of assists against illinois-chicago.
SELECT "Assists" FROM table_28613 WHERE "Opponent" = 'Illinois-Chicago'
CREATE TABLE song ( song_name VARCHAR, releasedate VARCHAR )
What is the name of the song that was released in the most recent year?
SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1
CREATE TABLE table_14392 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
When is the lane less than 5 and is named gnes kov cs?
SELECT "Time" FROM table_14392 WHERE "Lane" < '5' AND "Name" = 'ágnes kovács'
CREATE TABLE table_44504 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
Which Date has a Set 1 of 21 25?
SELECT "Date" FROM table_44504 WHERE "Set 1" = '21–25'
CREATE TABLE table_558 ( "Basic stem (root)" text, "Present stem" text, "Non-present stem" text, "Participle" text, "Verbal noun" text, "Short stem" text, "Meaning" text )
What is the verbal noun connected to the participle e-duki?
SELECT "Verbal noun" FROM table_558 WHERE "Participle" = 'e-duki'
CREATE TABLE table_name_18 ( gold INTEGER, nation VARCHAR, rank VARCHAR )
What is the total gold from New zealand and a rank less than 14?
SELECT SUM(gold) FROM table_name_18 WHERE nation = "new zealand" AND rank < 14
CREATE TABLE farm_competition ( Competition_ID int, Year int, Theme text, Host_city_ID int, Hosts text ) CREATE TABLE city ( City_ID int, Official_Name text, Status text, Area_km_2 real, Population real, Census_Ranking text ) CREATE TABLE farm ( Farm_ID int, Year in...
I want to know the proportion of the average population for each status.
SELECT Status, AVG(Population) FROM city GROUP BY Status
CREATE TABLE pilot ( Pilot_ID int, Pilot_name text, Rank int, Age int, Nationality text, Position text, Join_Year int, Team text ) CREATE TABLE pilot_record ( Record_ID int, Pilot_ID int, Aircraft_ID int, Date text ) CREATE TABLE aircraft ( Aircraft_ID int, Orde...
What is the proportion of positions of pilots?
SELECT Position, COUNT(Position) FROM pilot GROUP BY Position
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE...
is glucose patient 28443 has last measured on the current hospital visit greater than it was second to last measured on the current hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') ORDER BY labevents.charttime ...
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number...
Number of users with 10k+ rep.
SELECT COUNT(*) FROM Users WHERE Reputation >= 10000
CREATE TABLE Roles ( role_code VARCHAR(15), role_description VARCHAR(80) ) CREATE TABLE Functional_Areas ( functional_area_code VARCHAR(15), parent_functional_area_code VARCHAR(15), functional_area_description VARCHAR(80) ) CREATE TABLE Users ( user_id INTEGER, role_code VARCHAR(15), u...
What are the different role codes for users, and how many users have each Show bar chart, show from low to high by the X-axis please.
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code ORDER BY role_code
CREATE TABLE table_name_48 ( losing_bonus VARCHAR, points_for VARCHAR, club VARCHAR )
For Ynysybwl RFC, what was the losing bonus for 416 points?
SELECT losing_bonus FROM table_name_48 WHERE points_for = "416" AND club = "ynysybwl rfc"
CREATE TABLE table_1682865_1 ( irish_name VARCHAR, £1_fraction VARCHAR )
What is the Irish name for the 1 fraction of 1/240?
SELECT irish_name FROM table_1682865_1 WHERE £1_fraction = "1/240"
CREATE TABLE table_name_14 ( opponent VARCHAR, date VARCHAR )
what team played on august 25
SELECT opponent FROM table_name_14 WHERE date = "august 25"
CREATE TABLE nuclear_power_plants ( id text, name text, latitude text, longitude text, country text, status text, reactortype text, reactormodel text, constructionstartat text, operationalfrom text, operationalto text, capacity text, lastupdatedat text, source tex...
How many nuclear power plants were shut down now?
SELECT COUNT(*) FROM nuclear_power_plants WHERE status = "Shutdown"
CREATE TABLE table_21482 ( "Year" real, "West Manila" text, "East Manila" text, "Consumer Price Index (2005=100)" text, "West Manila as a share of 1996 real tariff" text, "East Manila as a share of 1996 real tariff" text )
What was West Manila's tariff increase when its CPI is 60.6?
SELECT "West Manila" FROM table_21482 WHERE "Consumer Price Index (2005=100)" = '60.6'
CREATE TABLE table_31416 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
In what game was the attendance at the America West Arena 18,756?
SELECT MAX("Game") FROM table_31416 WHERE "Location Attendance" = 'America West Arena 18,756'
CREATE TABLE table_1211545_2 ( light_vehicle VARCHAR, heavy_vehicle__2_axles_ VARCHAR )
What is the toll for light vehicles at the plaza where the toll for heavy vehicles with 2 axles is r87.00?
SELECT light_vehicle FROM table_1211545_2 WHERE heavy_vehicle__2_axles_ = "R87.00"
CREATE TABLE table_name_78 ( year VARCHAR, group VARCHAR )
What is the number of years that Kim was nominated at the Sitges Film Festival?
SELECT COUNT(year) FROM table_name_78 WHERE group = "sitges film festival"
CREATE TABLE table_6282 ( "Runs" real, "Match" real, "City/Country" text, "Venue" text, "Year" real )
How many matches have a City/Country of karachi, pakistan, and a Year larger than 1996?
SELECT COUNT("Match") FROM table_6282 WHERE "City/Country" = 'karachi, pakistan' AND "Year" > '1996'
CREATE TABLE sampledata15 ( sample_pk number, state text, year text, month text, day text, site text, commod text, source_id text, variety text, origin text, country text, disttype text, commtype text, claim text, quantity number, growst text, packst t...
Rank the country of product origins in terms of pesticide residues detection.
SELECT T1.country FROM sampledata15 AS T1 JOIN resultsdata15 AS T2 ON T1.sample_pk = T2.sample_pk GROUP BY T1.country ORDER BY T2.concen
CREATE TABLE table_name_50 ( opponents VARCHAR, date VARCHAR )
Who competed on may 6, 2006?
SELECT opponents FROM table_name_50 WHERE date = "may 6, 2006"
CREATE TABLE table_44151 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Average 1" real, "Points 2" real )
What is the sum of Altrincham's Points 2 when they had more than 52 Goals For?
SELECT SUM("Points 2") FROM table_44151 WHERE "Goals For" > '52' AND "Team" = 'altrincham'
CREATE TABLE table_203_594 ( id number, "canal" text, "length (miles)" number, "locks" number, "max length (ft)" number, "width (ft)" number, "year opened" number, "year abandoned" number, "year restored" number )
which was the first canal opened in scotland ?
SELECT "canal" FROM table_203_594 ORDER BY "year opened" LIMIT 1
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_cod...
AA flights to HOUSTON from CINCINNATI
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, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'HOUSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CINCI...
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
no of users every year.
SELECT SUM(a.Reputation) FROM (SELECT TOP(2415565) AS Reputation FROM Users ORDER BY Reputation) AS a
CREATE TABLE table_name_33 ( plural VARCHAR, singular VARCHAR )
What is Plural, when Singular is tor (your)?
SELECT plural FROM table_name_33 WHERE singular = "tor (your)"
CREATE TABLE table_21531764_1 ( october_2012 VARCHAR, october_2010 VARCHAR )
For the area which was 9.1 in October 2010, what is the figure for October 2012?
SELECT october_2012 FROM table_21531764_1 WHERE october_2010 = "9.1"
CREATE TABLE table_54551 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which home team score has an Away team score of 15.9 (99)?
SELECT "Home team score" FROM table_54551 WHERE "Away team score" = '15.9 (99)'
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...
give me the number of patients whose admission location is clinic referral/premature and item id is 50863?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.itemid = "50863"
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, give me the comparison about the average of code over the headquarter , and group by attribute headquarter by a bar chart, I want to order by the y axis from low to high please.
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
CREATE TABLE table_name_74 ( week_2 VARCHAR, week_3 VARCHAR )
Which week 2 had a week 3 of Cidney Carson?
SELECT week_2 FROM table_name_74 WHERE week_3 = "cidney carson"
CREATE TABLE table_53421 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
How many people attended the game on February 3, 2008?
SELECT SUM("Attendance") FROM table_53421 WHERE "Date" = 'february 3, 2008'
CREATE TABLE table_76998 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Kickoff Time" text, "Attendance" text )
What is the average number of weeks that the opponent was the Denver Broncos?
SELECT AVG("Week") FROM table_76998 WHERE "Opponent" = 'denver broncos'
CREATE TABLE table_14246 ( "Elector" text, "Place of birth" text, "Cardinalatial title" text, "Elevated" text, "Elevator" text )
What's the Place of birth listed that has an Elevator of ALexander III, and an Elector of Ruggiero Di San Severino?
SELECT "Place of birth" FROM table_14246 WHERE "Elevator" = 'alexander iii' AND "Elector" = 'ruggiero di san severino'
CREATE TABLE table_29904 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the most assists and how many did they have in game 35?
SELECT "High assists" FROM table_29904 WHERE "Game" = '35'
CREATE TABLE table_66264 ( "Event" text, "Performance" text, "Athlete" text, "Nation" text, "Place" text, "Date" text )
What place had 14:11.15 as the performance?
SELECT "Place" FROM table_66264 WHERE "Performance" = '14:11.15'
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE d...
what's the output of patient 028-53285 for the first time until 1700 days ago?
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 = '028-53285')) AND intakeoutput.cellpath LIKE '%output%' AND D...
CREATE TABLE table_66247 ( "Rank" real, "Heat" real, "Name" text, "Nationality" text, "Result" text )
What is the Name of the Player with a Rank of 23 or less, Heat of 4 and Result of 55.91?
SELECT "Name" FROM table_66247 WHERE "Heat" = '4' AND "Rank" < '23' AND "Result" = '55.91'
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id ...
give me the top four most common diagnostics during the last year?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '...
CREATE TABLE table_name_76 ( player VARCHAR, score VARCHAR )
WHAT IS THE PLAYER WITH A SCORE OF 66?
SELECT player FROM table_name_76 WHERE score = 66
CREATE TABLE table_15678 ( "Artist" text, "Country of origin" text, "Period active" text, "Release-year of first charted record" real, "Genre" text, "Claimed sales" text )
What was the active period for the pop genre?
SELECT "Period active" FROM table_15678 WHERE "Genre" = 'pop'
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 all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the job_id , and group by attribute job_id, and could you sort X-axis in descending order?
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC
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...
Bring the list of patients admitted before 2170 who had a clopidogrel bisulfate drug prescription.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2170" AND prescriptions.drug = "Clopidogrel Bisulfate"
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 gsi ( course_offering_id int, student_id int ) CREATE TABLE instructor ( ...
What is the length of time that the BE 900 has been offered for ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BE' AND course.number = 900 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, ...
what was the first time that patient 033-22108 had the maximum value of the heartrate on the current intensive care unit visit?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108') AND patient.unitdischargetime IS NULL) ...
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number,...
User with most famous/notable/popular badges.
SELECT UserId AS "user_link", SUM(CASE WHEN Class = 1 THEN 1 ELSE 0 END) AS gold, SUM(CASE WHEN Class = 2 THEN 1 ELSE 0 END) AS silver, SUM(CASE WHEN Class = 3 THEN 1 ELSE 0 END) AS bronze, COUNT(Id) AS total FROM Badges WHERE (Name = '##name1?Famous Question##') OR (Name = '##name2?Notable Question##') OR (Name = '##n...
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, ...
what is the minimum number of patients diagnosed with inf mcrg rstn pncllins yearly since 2103?
SELECT MIN(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 = 'inf mcrg rstn pncllins') AND STRFTIME('%y', diagnoses_icd.charttime) >= '2103' GROUP BY STRFTIME('%y',...
CREATE TABLE flight ( id int, Vehicle_Flight_number text, Date text, Pilot text, Velocity real, Altitude real, airport_id int, company_id int ) CREATE TABLE operate_company ( id int, name text, Type text, Principal_activities text, Incorporated_in text, Group_Equ...
Show me the total number by country in a histogram
SELECT Country, COUNT(*) FROM airport GROUP BY Country
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id...
how many patients until 2100 had received a spinal struct repair nec procedure?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'spinal struct repair nec') AND STRFTIME('%y', proced...
CREATE TABLE table_name_37 ( losses VARCHAR, goal_difference VARCHAR, position VARCHAR )
What is the number of losses when the goal difference was -8, and position is smaller than 10?
SELECT COUNT(losses) FROM table_name_37 WHERE goal_difference = -8 AND position < 10
CREATE TABLE player ( Player_ID int, Player text, Years_Played text, Total_WL text, Singles_WL text, Doubles_WL text, Team int ) CREATE TABLE match_season ( Season real, Player text, Position text, Country int, Team int, Draft_Pick_Number int, Draft_Class text, ...
Show me a bar chart for what are the draft pick numbers and draft classes for players who play the Defender position?, and list from low to high by the y axis please.
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" ORDER BY Draft_Pick_Number
CREATE TABLE table_60198 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
what is the sum of bronze when the rank is 5, the nation is poland and gold is less than 0?
SELECT SUM("Bronze") FROM table_60198 WHERE "Rank" = '5' AND "Nation" = 'poland' AND "Gold" < '0'
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, ...
Answers with the lowest score.
SELECT r.Score AS rRep, q.Score AS qRep, 'http://scifi.stackexchange.com/a/' + CAST(r.Id AS TEXT) + '/4918|' + q.Title AS link, q.Tags AS tags, COALESCE(r.LastEditDate, r.CreationDate) AS rDate FROM Posts AS r, Posts AS q WHERE q.Id = r.ParentId AND r.PostTypeId = 2 AND r.Score < -10 ORDER BY rRep
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 ) ...
what is the number of patients whose days of hospital stay is greater than 23 and procedure icd9 code is 3606?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "23" AND procedures.icd9_code = "3606"
CREATE TABLE table_name_86 ( tournament VARCHAR )
What is the value in 2009 at the French Open?
SELECT 2009 FROM table_name_86 WHERE tournament = "french open"
CREATE TABLE table_13059 ( "Season" text, "League" text, "Teams" text, "Home" text, "Away" text )
What teams has a home of 5-0?
SELECT "Teams" FROM table_13059 WHERE "Home" = '5-0'
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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), CO...
For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of first_name and manager_id , and display in asc by the Y-axis please.
SELECT FIRST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID
CREATE TABLE table_name_14 ( genre VARCHAR, game VARCHAR )
What is the genre of the Mass Effect game?
SELECT genre FROM table_name_14 WHERE game = "mass effect"
CREATE TABLE table_204_145 ( id number, "representative" text, "state" text, "district(s)" text, "served" text, "party" text, "date of birth" text, "date of death" text, "age" text )
who died first : sala burton or harold earthman ?
SELECT "representative" FROM table_204_145 WHERE "representative" IN ('sala burton', 'harold earthman') ORDER BY "date of death" LIMIT 1
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, chart...
when has patient 85027 last received a procedure since 2105?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85027) AND STRFTIME('%y', procedures_icd.charttime) >= '2105' ORDER BY procedures_icd.charttime DESC LIMIT 1
CREATE TABLE table_8037 ( "Date" text, "H/A/N" text, "Opponent" text, "Score" text, "Record" text )
On what date did the Cavaliers have a record of 9-14?
SELECT "Date" FROM table_8037 WHERE "Record" = '9-14'
CREATE TABLE table_name_1 ( week_8_oct_26 VARCHAR, week_12_nov_23 VARCHAR )
What is the week 8 Oct 26 standing with georgia tech (8-2) on week 12 Nov 23?
SELECT week_8_oct_26 FROM table_name_1 WHERE week_12_nov_23 = "georgia tech (8-2)"
CREATE TABLE table_203_689 ( id number, "date" text, "opponent" text, "score" text, "result" text, "record" text )
what was the number of baskets houston scored on may 25th ?
SELECT "score" FROM table_203_689 WHERE "date" = 'may 25'
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 Teachers ( teach...
Visualize a bar chart about the distribution of date_address_to and the average of monthly_rental , and group by attribute other_details and bin date_address_to by time.
SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
CREATE TABLE table_name_95 ( season VARCHAR, away_result VARCHAR )
Away result of 1-2 has what season?
SELECT season FROM table_name_95 WHERE away_result = "1-2"
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose days of hospital stay is greater than 6 and procedure long title is (aorto)coronary bypass of two coronary arteries?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "6" AND procedures.long_title = "(Aorto)coronary bypass of two coronary arteries"
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 PostHistoryTypes ( Id number, Name te...
Language Trends (# Questions per Tag 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 table_name_53 ( score VARCHAR, runner_up VARCHAR, tournament VARCHAR )
what was the score when goran ivani evi was runner up and the tournament was in algarve?
SELECT score FROM table_name_53 WHERE runner_up = "goran ivanišević" AND tournament = "algarve"
CREATE TABLE bank ( branch_id number, bname text, no_of_customers number, city text, state text ) CREATE TABLE customer ( cust_id text, cust_name text, acc_type text, acc_bal number, no_of_loans number, credit_score number, branch_id number, state text ) CREATE TABL...
How many bank branches are there?
SELECT COUNT(*) FROM bank
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 diagnoses ( ...
what is death status and admission time of subject id 17570?
SELECT demographic.expire_flag, demographic.admittime FROM demographic WHERE demographic.subject_id = "17570"
CREATE TABLE table_name_33 ( production_number INTEGER, title VARCHAR )
What is the production number of From Hare to Heir?
SELECT SUM(production_number) FROM table_name_33 WHERE title = "from hare to heir"
CREATE TABLE table_74010 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Name the party for john randolph redistricted from the 15th district
SELECT "Party" FROM table_74010 WHERE "Incumbent" = 'John Randolph Redistricted from the 15th district'
CREATE TABLE table_name_88 ( result VARCHAR, date VARCHAR )
What was the score of the game on September 14, 2008?
SELECT result FROM table_name_88 WHERE date = "september 14, 2008"
CREATE TABLE payments ( payment_id number, settlement_id number, payment_method_code text, date_payment_made time, amount_payment number ) CREATE TABLE customer_policies ( policy_id number, customer_id number, policy_type_code text, start_date time, end_date time ) CREATE TABLE...
Tell me the the claim date and settlement date for each settlement case.
SELECT date_claim_made, date_claim_settled FROM settlements
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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varcha...
For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of department_id bin hire_date by time.
SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
CREATE TABLE table_58761 ( "Team Name" text, "Schools" text, "Sports" text, "Host" text, "Nickname(s)" text, "Colors" text, "Enrollment (2013/14)" real )
What is the name of the team from goreville vienna school?
SELECT "Team Name" FROM table_58761 WHERE "Schools" = 'goreville vienna'
CREATE TABLE product ( product_id number, product text, dimensions text, dpi number, pages_per_minute_color number, max_page_size text, interface text ) CREATE TABLE store ( store_id number, store_name text, type text, area_size number, number_of_product_category number,...
Find the names of districts where have both city mall and village store type stores.
SELECT t3.district_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id WHERE t1.type = "City Mall" INTERSECT SELECT t3.district_name FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_...
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABL...
Most popular StackOverflow tags in time range.
SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS TimePeriodRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS TimePeriodQuestions, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id...
CREATE TABLE table_23052 ( "Series #" real, "Episode #" real, "Title" text, "Written by" text, "Directed by" text, "Viewers" real, "Original airdate" text )
What is the title of the episode written by Vanessa Bates?
SELECT "Title" FROM table_23052 WHERE "Written by" = 'Vanessa Bates'
CREATE TABLE table_name_31 ( home VARCHAR, season VARCHAR )
For the 1948-49 season, what was the At Home record?
SELECT home FROM table_name_31 WHERE season = "1948-49"
CREATE TABLE table_64403 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text, "Arena" text, "Points" real )
Which Date has an Attendance larger than 16,186, and Points smaller than 52, and a Record of 21 16 9?
SELECT "Date" FROM table_64403 WHERE "Attendance" > '16,186' AND "Points" < '52' AND "Record" = '21–16–9'
CREATE TABLE table_13564702_3 ( club VARCHAR, tries_for VARCHAR )
Name the club when tries for is 83
SELECT club FROM table_13564702_3 WHERE tries_for = "83"
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 diagnoses ( ...
how many patients admitted before year 2182 had the primary disease aortic insufficiency\re-do sternotomy; aortic valve replacement?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.admityear < "2182"
CREATE TABLE table_61006 ( "Position" real, "Club" text, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
WHAT ARE THE TOTAL NUMBER OF POINTS WITH WINS SMALLER THAN 14, AT SD INDAUCHU, POSITION BIGGER THAN 12?
SELECT COUNT("Points") FROM table_61006 WHERE "Wins" < '14' AND "Club" = 'sd indauchu' AND "Position" > '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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
what is the number of patients whose discharge location is home and procedure long title is endoscopic sphincterotomy and papillotomy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME" AND procedures.long_title = "Endoscopic sphincterotomy and papillotomy"
CREATE TABLE table_1606 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
What was the date of vacancy when Viorel Moldovan replaced a manager?
SELECT "Date of vacancy" FROM table_1606 WHERE "Replaced by" = 'Viorel Moldovan'
CREATE TABLE publication_keyword ( kid int, pid int ) CREATE TABLE keyword ( keyword varchar, kid int ) CREATE TABLE publication ( abstract varchar, cid int, citation_num int, jid int, pid int, reference_num int, title varchar, year int ) CREATE TABLE conference ( ...
return me the journals, which have papers by ' H. V. Jagadish ' .
SELECT journal.name FROM author, journal, publication, writes WHERE author.name = 'H. V. Jagadish' AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid
CREATE TABLE table_name_56 ( laps INTEGER, driver VARCHAR, grid VARCHAR )
Name the sum of Laps for lance reventlow with grid more than 16
SELECT SUM(laps) FROM table_name_56 WHERE driver = "lance reventlow" AND grid > 16
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) ...
what was the drug that patient 21110 had been prescribed two times a month before.
SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21110) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 ...
CREATE TABLE table_203_446 ( id number, "name" text, "gender" text, "age" number, "from" text, "occupation" text, "prize money (usd)" text, "status" text )
what was the total prize money earned by contestants ?
SELECT SUM("prize money (usd)") FROM table_203_446
CREATE TABLE table_19612 ( "Hand" text, "1 credit" real, "2 credits" real, "3 credits" real, "4 credits" real, "5 credits" real )
Name the least 2 credits for flush
SELECT MIN("2 credits") FROM table_19612 WHERE "Hand" = 'Flush'
CREATE TABLE player_attributes ( id number, player_fifa_api_id number, player_api_id number, date text, overall_rating number, potential number, preferred_foot text, attacking_work_rate text, defensive_work_rate text, crossing number, finishing number, heading_accuracy nu...
What is the average weight of all players?
SELECT AVG(weight) FROM player
CREATE TABLE table_64200 ( "Province" text, "Inhabitants" real, "established" real, "President" text, "Party" text, "Election" real )
What is the average election result for the province of Grosseto from 1766 and prior?
SELECT AVG("Election") FROM table_64200 WHERE "Province" = 'grosseto' AND "established" < '1766'
CREATE TABLE table_43263 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text )
Who were the semi finalists when the runner-up was Alexandra Fusai Wiltrud Probst?
SELECT "Semi finalists" FROM table_43263 WHERE "Runner-up" = 'alexandra fusai wiltrud probst'
CREATE TABLE table_27233 ( "Week" real, "Date" text, "Kickoff" text, "Opponent" text, "Final score" text, "Team record" text, "Game site" text, "Attendance" real )
What opponents played Waldstadion in a game?
SELECT "Opponent" FROM table_27233 WHERE "Game site" = 'Waldstadion'
CREATE TABLE table_204_920 ( id number, "goal" number, "date" text, "location" text, "opponent" text, "lineup" text, "min" number, "assist/pass" text, "score" text, "result" text, "competition" text )
who was the only opponent to be scored against with an assist from wambach ?
SELECT "opponent" FROM table_204_920 WHERE "assist/pass" = 'wambach'
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE gsi ( c...
For what length of time has MUSTHTRE 141 been offered ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'MUSTHTRE' AND course.number = 141 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
CREATE TABLE table_203_751 ( id number, "year" number, "title" text, "peak chart positions\nus\nair" number, "peak chart positions\nus\nmain" number, "peak chart positions\nus\nmod" number, "album" text )
how many singles were released as part of an album ?
SELECT COUNT("title") FROM table_203_751 WHERE "album" <> 'non-album single'