table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE supplier_addresses ( supplier_id number, address_id number, date_from time, date_to time ) CREATE TABLE department_store_chain ( dept_store_chain_id number, dept_store_chain_name text ) CREATE TABLE products ( product_id number, product_type_code text, product_name tex...
Return the names and ids of all products whose price is between 600 and 700.
SELECT product_name, product_id FROM products WHERE product_price BETWEEN 600 AND 700
CREATE TABLE table_50547 ( "Team" text, "Chassis" text, "Engine" text, "Tire" text, "Sponsor" text )
What is the Chassis of the Honda Engine with a Motorola sponsor?
SELECT "Chassis" FROM table_50547 WHERE "Engine" = 'honda' AND "Sponsor" = 'motorola'
CREATE TABLE table_1510519_1 ( number_of_seasons_in_top_division VARCHAR, position_in_2012_13 VARCHAR )
How many seasons in the top division for the team that finished 005 5th in 2012-2013
SELECT COUNT(number_of_seasons_in_top_division) FROM table_1510519_1 WHERE position_in_2012_13 = "005 5th"
CREATE TABLE table_67986 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
A ferrari flat-12 engine with more than 1 point has what kind of chassis?
SELECT "Chassis" FROM table_67986 WHERE "Engine" = 'ferrari flat-12' AND "Points" > '1'
CREATE TABLE table_name_15 ( lost INTEGER, team VARCHAR )
What is the most number of losses for Quetta Zorawar?
SELECT MAX(lost) FROM table_name_15 WHERE team = "quetta zorawar"
CREATE TABLE table_name_67 ( description VARCHAR, year_of_issue VARCHAR, weight VARCHAR )
Which Description has a Year of Issue of 1983, and a Weight of 3.50grams?
SELECT description FROM table_name_67 WHERE year_of_issue = 1983 AND weight = "3.50grams"
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE charte...
whats the sex of patient 1862?
SELECT patients.gender FROM patients WHERE patients.subject_id = 1862
CREATE TABLE table_1708014_1 ( top_5 INTEGER, top_10 VARCHAR, team_s_ VARCHAR )
For team #40 chip ganassi racing which top 5 is the highest where top 10 is 5?
SELECT MAX(top_5) FROM table_1708014_1 WHERE top_10 = 5 AND team_s_ = "#40 Chip Ganassi Racing"
CREATE TABLE table_75627 ( "County" text, "Per capita income" text, "Median household income" text, "Median family income" text, "Population" real, "Number of households" real )
What County has a Median household income of $46,872?
SELECT "County" FROM table_75627 WHERE "Median household income" = '$46,872'
CREATE TABLE ROLES ( role_description VARCHAR, role_code VARCHAR ) CREATE TABLE Employees ( role_code VARCHAR, employee_name VARCHAR )
What is the role of the employee named Koby?
SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby"
CREATE TABLE Documents_with_expenses ( document_id VARCHAR, budget_type_code VARCHAR ) CREATE TABLE Ref_budget_codes ( budget_type_code VARCHAR, budget_type_description VARCHAR )
Show the budget type code and description and the corresponding document id.
SELECT T2.budget_type_code, T2.budget_type_description, T1.document_id FROM Documents_with_expenses AS T1 JOIN Ref_budget_codes AS T2 ON T1.budget_type_code = T2.budget_type_code
CREATE TABLE table_60743 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What date was the Izmir Cup in which lhan played against Somdev Devvarman?
SELECT "Date" FROM table_60743 WHERE "Tournament" = 'izmir cup' AND "Opponent" = 'somdev devvarman'
CREATE TABLE table_204_724 ( id number, "outcome" text, "no." number, "date" text, "tournament" text, "surface" text, "partner" text, "opponents in the final" text, "score in the final" text )
how many winners are there ?
SELECT COUNT(*) FROM table_204_724 WHERE "outcome" = 'winner'
CREATE TABLE table_54954 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score for the home team who plays their matches at the mcg venue?
SELECT "Home team score" FROM table_54954 WHERE "Venue" = 'mcg'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( ...
what the first height of patient 030-67523 in their last hospital encounter.
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-67523' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1) AND NOT patient.admissionheight IS NULL ORDER...
CREATE TABLE table_36299 ( "Game" real, "March" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
Which opponent has 63 points?
SELECT "Opponent" FROM table_36299 WHERE "Points" = '63'
CREATE TABLE table_name_33 ( visitor VARCHAR, home VARCHAR )
Who was the visiting team when Winnipeg was the home team?
SELECT visitor FROM table_name_33 WHERE home = "winnipeg"
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 was the name of the output the last time patient 030-21071 had on last month/21?
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 = '030-21071')) AND intakeoutput.cellpath LIKE '%output%' AND D...
CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGE...
Show all majors and corresponding number of students. Plot them as scatter chart.
SELECT Major, COUNT(*) FROM Student GROUP BY Major
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 prescriptions...
what is marital status and date of birth of subject id 2560?
SELECT demographic.marital_status, demographic.dob FROM demographic WHERE demographic.subject_id = "2560"
CREATE TABLE music_festival ( ID int, Music_Festival text, Date_of_ceremony text, Category text, Volume int, Result text ) CREATE TABLE artist ( Artist_ID int, Artist text, Age int, Famous_Title text, Famous_Release_date text ) CREATE TABLE volume ( Volume_ID int, V...
A bar chart for returning the number of the categories of music festivals that have the result 'Awarded'.
SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category
CREATE TABLE table_29228 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
What position was pick # 54?
SELECT "Position" FROM table_29228 WHERE "Pick #" = '54'
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, draw a bar chart about the distribution of name and the sum of code , and group by attribute name.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Draw a pie chart about the proportion of ACC_Regular_Season and ACC_Percent.
SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match
CREATE TABLE table_1342359_15 ( candidates VARCHAR, district VARCHAR )
who are the candidates with district being kansas 4
SELECT candidates FROM table_1342359_15 WHERE district = "Kansas 4"
CREATE TABLE table_65353 ( "Draw" real, "Language" text, "Artist" text, "Place" real, "Points" real )
what is the average draw when the place is 5 and points more than 15?
SELECT AVG("Draw") FROM table_65353 WHERE "Place" = '5' AND "Points" > '15'
CREATE TABLE table_name_72 ( score VARCHAR, event VARCHAR )
What is the total score for the 36 arrow finals event?
SELECT COUNT(score) FROM table_name_72 WHERE event = "36 arrow finals"
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
how many patients were diagnosed since 4 years ago with pleural effusion - right within 2 months after receiving laxatives - enema?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'laxatives - enema' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-4 year')) AS t1 JOIN ...
CREATE TABLE table_name_30 ( royal_house VARCHAR, name VARCHAR )
Which Royal house has a name of ding?
SELECT royal_house FROM table_name_30 WHERE name = "ding"
CREATE TABLE table_name_4 ( glyph INTEGER, hexadecimal VARCHAR, binary VARCHAR )
What is the sum of the glyph with a 38 hexadecimal and a binary less than 111000?
SELECT SUM(glyph) FROM table_name_4 WHERE hexadecimal = 38 AND binary < 111000
CREATE TABLE table_13170 ( "Opposing Teams" text, "Against" real, "Date" text, "Venue" text, "Status" text )
WHat status had an against larger than 6 and a date of 01/02/1975?
SELECT "Status" FROM table_13170 WHERE "Against" > '6' AND "Date" = '01/02/1975'
CREATE TABLE table_75061 ( "Team" text, "Week 1" text, "Week 2" text, "Week 3" text, "Week 4" text, "Week 5" text, "Week 6" text, "Week 7" text, "Week 8 Final" text )
Name the team for week 1 of 28
SELECT "Team" FROM table_75061 WHERE "Week 1" = '28'
CREATE TABLE county_public_safety ( County_ID int, Name text, Population int, Police_officers int, Residents_per_officer int, Case_burden int, Crime_rate real, Police_force text, Location text ) CREATE TABLE city ( City_ID int, County_ID int, Name text, White real, ...
What is the number of cities in each country? Return a bar chart, and list in ascending by the x axis please.
SELECT T2.Name, COUNT(T2.Name) FROM city AS T1 JOIN county_public_safety AS T2 ON T1.County_ID = T2.County_ID GROUP BY T2.Name ORDER BY T2.Name
CREATE TABLE table_name_89 ( loser VARCHAR, date VARCHAR, location VARCHAR, winner VARCHAR )
Who lost at schaefer stadium when the Winner was new england patriots, and a Date of october 18?
SELECT loser FROM table_name_89 WHERE location = "schaefer stadium" AND winner = "new england patriots" AND date = "october 18"
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
Before taking GTBOOKS 331 , what are some useful courses to take ?
SELECT DISTINCT advisory_requirement FROM course WHERE department = 'GTBOOKS' AND number = 331
CREATE TABLE table_31230 ( "Seed" real, "Rank" real, "Player" text, "Points" real, "Points defending" real, "Points won" real, "New points" real, "Status" text )
What is listed in new points when status is second round lost to xavier malisse?
SELECT MIN("New points") FROM table_31230 WHERE "Status" = 'Second round lost to Xavier Malisse'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is procedure long title of subject id 14755?
SELECT procedures.long_title FROM procedures WHERE procedures.subject_id = "14755"
CREATE TABLE table_5969 ( "Round" real, "Club" text, "Home" text, "Away" text, "Aggregate" text )
What is NK Rijeka's away score?
SELECT "Away" FROM table_5969 WHERE "Club" = 'nk rijeka'
CREATE TABLE table_75977 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Tries For" text, "Tries Against" text )
What is the value of the item 'Points' when the value of the item 'Points against' is 272?
SELECT "Points for" FROM table_75977 WHERE "Points against" = '272'
CREATE TABLE table_name_19 ( time VARCHAR, name VARCHAR, lane VARCHAR, heat VARCHAR )
What is the time for a lane less than 6, and a heat less than 4 for Joanne Malar?
SELECT time FROM table_name_19 WHERE lane < 6 AND heat < 4 AND name = "joanne malar"
CREATE TABLE table_15617 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which record has an Attendance larger than 12,552, and a Score of 7-0?
SELECT "Record" FROM table_15617 WHERE "Attendance" > '12,552' AND "Score" = '7-0'
CREATE TABLE table_name_66 ( away_team VARCHAR )
What was the score for Footscray when they were the away team?
SELECT away_team AS score FROM table_name_66 WHERE away_team = "footscray"
CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUndergoes DATETIME, Physician INTEGER, AssistingNurse INTEGER ) CREATE TABLE Pa...
Return a pie chart on how many medications are prescribed for each brand?
SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostHistory ( Id number, Po...
number of tags containing 'java'.
SELECT COUNT(*) FROM Tags WHERE TagName LIKE '%java%'
CREATE TABLE table_3993 ( "No. in series" text, "No. in season" text, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What is the production code for episode 96 in the series?
SELECT MIN("Production code") FROM table_3993 WHERE "No. in series" = '96'
CREATE TABLE postseason ( year INTEGER, round TEXT, team_id_winner TEXT, league_id_winner TEXT, team_id_loser TEXT, league_id_loser TEXT, wins INTEGER, losses INTEGER, ties INTEGER ) CREATE TABLE player_college ( player_id TEXT, college_id TEXT, year INTEGER ) CREATE TA...
Show me the frequency of those years (bin year into year interval) that the team Boston Red Stockings won in the postseasons with a bar chart.
SELECT year, COUNT(year) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings'
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 ( ...
calculate the total number of patients diagnosed with malig neo ascend colon
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Malig neo ascend colon"
CREATE TABLE table_name_97 ( surface VARCHAR, date VARCHAR )
What was the surface on 23 October 2011?
SELECT surface FROM table_name_97 WHERE date = "23 october 2011"
CREATE TABLE table_30121082_1 ( barony VARCHAR, area__acres__ VARCHAR )
What are the Baronies when the area (in acres) is 276?
SELECT barony FROM table_30121082_1 WHERE area__acres__ = 276
CREATE TABLE university ( affiliation VARCHAR, enrollment INTEGER )
Find the total student enrollment for different affiliation type schools.
SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation
CREATE TABLE table_77962 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total number of bronze when the total is less than 1?
SELECT SUM("Bronze") FROM table_77962 WHERE "Total" < '1'
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
what percentile of a red blood cells is at 4.1 among a patient at the same age as patient 65582 in their current hospital encounter?
SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'red blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissio...
CREATE TABLE Course_Authors_and_Tutors ( author_id INTEGER, author_tutor_ATB VARCHAR(3), login_name VARCHAR(40), password VARCHAR(40), personal_name VARCHAR(80), middle_name VARCHAR(80), family_name VARCHAR(80), gender_mf VARCHAR(1), address_line_1 VARCHAR(80) ) CREATE TABLE Student...
A scatter chart shows the correlation between author_id and author_tutor_ATB .
SELECT author_id, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name
CREATE TABLE table_52214 ( "Year" real, "Theme" text, "Artist" text, "Mintage" text, "Issue Price" text )
What artist had a mintage of 41,828 before year 2002?
SELECT "Artist" FROM table_52214 WHERE "Year" < '2002' AND "Mintage" = '41,828'
CREATE TABLE table_204_881 ( id number, "round" number, "date" text, "score" text, "opponent" text, "opponent's score" text, "result" text, "venue" text, "attendance" number, "best on ground" text, "team" text )
what was this team 's next opponent after facing hawthorn on may 22 of this season ?
SELECT "opponent" FROM table_204_881 WHERE id = (SELECT id FROM table_204_881 WHERE "opponent" = 'hawthorn') + 1
CREATE TABLE table_52716 ( "Name" text, "Took Office" text, "Left Office" text, "Party" text, "District Residence" text )
Who has Took Office of march 4, 1875?
SELECT "Name" FROM table_52716 WHERE "Took Office" = 'march 4, 1875'
CREATE TABLE table_31923 ( "Year" text, "Total matches" real, "Total W-L-H" text, "Singles W-L-H" text, "Points won" real, "Points %" real )
In 2007, what is the average total matches with points % larger than 33.3?
SELECT AVG("Total matches") FROM table_31923 WHERE "Points %" > '33.3' AND "Year" = '2007'
CREATE TABLE domain_keyword ( did int, 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 domain_publication ( did int, pid int ) CREATE TABLE conference ( ci...
return me the number of papers on VLDB conference .
SELECT COUNT(DISTINCT (publication.title)) FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid
CREATE TABLE table_name_63 ( venue VARCHAR, away_team VARCHAR )
What venue did the away team footscray play at?
SELECT venue FROM table_name_63 WHERE away_team = "footscray"
CREATE TABLE table_204_822 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
the top ranked nation for total medals won
SELECT "nation" FROM table_204_822 ORDER BY "total" DESC LIMIT 1
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Dropping fast: Lowest question score per thousand views among questions with score -20 or worse.
SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Score, ViewCount, Score * 1000 / ViewCount AS "Score per Thousand Views" FROM Posts WHERE Score <= -20 AND PostTypeId = 1 ORDER BY Score * 1000 / ViewCount LIMIT 1000
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 prescription...
what is the number of patients whose discharge location is long term care hospital and who have undergone a form cutan ileoureterost??
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "LONG TERM CARE HOSPITAL" AND procedures.short_title = "Form cutan ileoureterost"
CREATE TABLE table_19256 ( "Total#" real, "Series#" real, "Title" text, "Writer" text, "Director" text, "Original air date" text )
Which episodes have Patrick Lau as the director and Lisa Holdsworth as the writer?
SELECT "Title" FROM table_19256 WHERE "Director" = 'Patrick Lau' AND "Writer" = 'Lisa Holdsworth'
CREATE TABLE Financial_transactions ( account_id VARCHAR )
Show the account id and the number of transactions for each account
SELECT account_id, COUNT(*) FROM Financial_transactions GROUP BY account_id
CREATE TABLE table_17323042_11 ( location_attendance VARCHAR, high_assists VARCHAR )
What was the location and attendance of the game when High Assists were Andre Miller (7)?
SELECT location_attendance FROM table_17323042_11 WHERE high_assists = "Andre Miller (7)"
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 who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id.
SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID
CREATE TABLE table_name_3 ( crowd VARCHAR, home_team VARCHAR )
How many people were in the crowd when North Melbourne was the home team?
SELECT crowd FROM table_name_3 WHERE home_team = "north melbourne"
CREATE TABLE table_17748 ( "District" text, "Counties Represented" text, "Delegate" text, "Party" text, "First Elected" real, "Committee" text )
What are the districts represented by the Democratic Party and a Committee in Economic Matters?
SELECT "District" FROM table_17748 WHERE "Committee" = 'Economic Matters' AND "Party" = 'Democratic'
CREATE TABLE table_18703133_6 ( wins INTEGER )
How many wins?
SELECT MAX(wins) FROM table_18703133_6
CREATE TABLE table_name_68 ( played VARCHAR, goal_difference VARCHAR, goals_against VARCHAR )
What is the total number of played for the goals against over 44 and a goal difference of 11?
SELECT COUNT(played) FROM table_name_68 WHERE goal_difference = 11 AND goals_against > 44
CREATE TABLE table_name_61 ( games INTEGER, goals_against VARCHAR, lost VARCHAR, points VARCHAR )
How many games were lost by more than 27 but not more 78 with goals less than 300?
SELECT AVG(games) FROM table_name_61 WHERE lost > 27 AND points < 78 AND goals_against < 300
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE procedures_icd ( row_id number, subject_id...
give me the total of the output for patient 23929 on 08/25/last year.
SELECT SUM(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23929)) AND DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start o...
CREATE TABLE table_name_54 ( player VARCHAR, total VARCHAR )
What player has a total of 158/
SELECT player FROM table_name_54 WHERE total = "158"
CREATE TABLE table_name_79 ( location VARCHAR, school VARCHAR )
Where is Indian Creek school located?
SELECT location FROM table_name_79 WHERE school = "indian creek"
CREATE TABLE table_name_70 ( ba__place_ VARCHAR, year VARCHAR, team VARCHAR, bb_ VARCHAR, hbp VARCHAR )
In the year 1992 for the Seibu Lions, the BB + HBP which is larger than 49 was this as a BA (Place)?
SELECT ba__place_ FROM table_name_70 WHERE bb_ + hbp > 49 AND team = "seibu lions" AND year = "1992"
CREATE TABLE table_name_11 ( hometown VARCHAR, college VARCHAR )
What is the Hometown for Villanova College?
SELECT hometown FROM table_name_11 WHERE college = "villanova"
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int,...
For next Winter 's Dissertation-Cand , who is the teacher ?
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN cou...
CREATE TABLE table_14598_9 ( literate_persons___percentage_ VARCHAR, females___percentage_ VARCHAR )
What is the percentage of all the literate people where females are 73.17?
SELECT literate_persons___percentage_ FROM table_14598_9 WHERE females___percentage_ = "73.17"
CREATE TABLE train_station ( Train_ID int, Station_ID int ) CREATE TABLE station ( Station_ID int, Name text, Annual_entry_exit real, Annual_interchanges real, Total_Passengers real, Location text, Main_Services text, Number_of_Platforms int ) CREATE TABLE train ( Train_ID ...
Show all locations and the total number of platforms for all train stations in each location in a pie chart.
SELECT Location, SUM(Number_of_Platforms) FROM station GROUP BY Location
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
how much was enoxaparin sodium first prescribed to patient 27362 in 06/2104?
SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27362) AND prescriptions.drug = 'enoxaparin sodium' AND STRFTIME('%y-%m', prescriptions.startdate) = '2104-06' ORDER BY prescriptions.startdate LIMIT 1
CREATE TABLE table_name_8 ( date VARCHAR, opponent VARCHAR )
What was the game date when the opponent was Houston?
SELECT date FROM table_name_8 WHERE opponent = "houston"
CREATE TABLE table_26282750_1 ( film_festival VARCHAR, participants_recipients VARCHAR )
What Film Festival had participants/recipients of Isao Tomita?
SELECT film_festival FROM table_26282750_1 WHERE participants_recipients = "Isao Tomita"
CREATE TABLE table_name_67 ( surface VARCHAR, opponent_in_the_final VARCHAR )
What was the surface that Laura Golarsa and her opponent played on in the final?
SELECT surface FROM table_name_67 WHERE opponent_in_the_final = "laura golarsa"
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
had patient 8888 excreted gastric gastric tube in 12/2105?
SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric gastric...
CREATE TABLE table_name_65 ( week VARCHAR, opponent VARCHAR )
How many weeks has the opponent been san francisco 49ers?
SELECT COUNT(week) FROM table_name_65 WHERE opponent = "san francisco 49ers"
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE requirement ( ...
Who 's this Spring 's CZECH 142 teacher ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester...
CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREA...
Languages having most negative rated questions.
SELECT P.Tags, SUM(P.Score) AS "Suma" FROM Posts AS P GROUP BY P.Tags ORDER BY Suma
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 ...
count the number of patients whose ethnicity is american indian/alaska native and primary disease is femoral artery thrombosis.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS"
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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, JO...
For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, order by the y-axis from low to high.
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID)
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 demographic ( subject_id text, hadm_id t...
How many patients were admitted with transfer from hosp/extram and diagnosed with the primary disease hyperglcemia hyponatremia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.diagnosis = "HYPERGLYCEMIA;HYPONATREMIA"
CREATE TABLE table_77940 ( "Player" text, "Date of Birth" text, "Batting Style" text, "Bowling Style" text, "First Class Team" text )
When was roshan mahanama born?
SELECT "Date of Birth" FROM table_77940 WHERE "Player" = 'roshan mahanama'
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number...
Avg Q & A' AVERAGE SCORES YEARLY comparison.
SELECT YEAR(CreationDate) AS "postyear", CAST(SUM(CASE WHEN PostTypeId = 1 THEN Score ELSE 0 END) AS FLOAT) / SUM(CASE WHEN PostTypeId = 1 THEN 1 ELSE 0 END) AS "q", CAST(SUM(CASE WHEN PostTypeId = 2 THEN Score ELSE 0 END) AS FLOAT) / SUM(CASE WHEN PostTypeId = 2 THEN 1 ELSE 0 END) AS "a", CAST(SUM(Score) AS FLOAT) / S...
CREATE TABLE table_2088 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
Name the position of glenn goldup
SELECT "Position" FROM table_2088 WHERE "Player" = 'Glenn Goldup'
CREATE TABLE table_35140 ( "Hand" text, "1 credit" text, "2 credits" text, "3 credits" text, "4 credits" text, "5 credits" text )
What is listed for the Hand that has a 1 credit of 1?
SELECT "Hand" FROM table_35140 WHERE "1 credit" = '1'
CREATE TABLE airlines ( alid integer, name text, iata varchar(2), icao varchar(3), callsign text, country text, active varchar(2) ) CREATE TABLE airports ( apid integer, name text, city text, country text, x real, y real, elevation bigint, iata character varc...
Find the altitude (or elevation) of the airports in the city of New York with a bar chart, and I want to rank in descending by the bar.
SELECT name, elevation FROM airports WHERE city = 'New York' ORDER BY name DESC
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients whose admission location is transfer from hosp/extram and days of hospital stay is greater than 34?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND demographic.days_stay > "34"
CREATE TABLE table_52780 ( "Place (Posici\u00f3n)" real, "Team (Equipo)" text, "Played (PJ)" real, "Won (PG)" real, "Draw (PE)" real, "Lost (PP)" real, "Goals Scored (GF)" real, "Goals Conceded (GC)" real, "+/- (Dif.)" real, "Points (Pts.)" real )
What is the points for a team with more than 9 wins and more than 40 goals?
SELECT SUM("Points (Pts.)") FROM table_52780 WHERE "Won (PG)" > '9' AND "Goals Scored (GF)" > '40'
CREATE TABLE table_37378 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What date is the visitor Ottawa?
SELECT "Date" FROM table_37378 WHERE "Visitor" = 'ottawa'
CREATE TABLE table_name_40 ( field_goals INTEGER, touchdowns VARCHAR, points VARCHAR )
Who had the lowest field goals if they had 12 touchdowns and more than 72 points?
SELECT MIN(field_goals) FROM table_name_40 WHERE touchdowns = 12 AND points > 72
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 prescriptions...
count the number of patients whose age is less than 81 and drug route is ivpca?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.route = "IVPCA"