instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Who is the winner of the European Poker Tour Grand Final? | CREATE TABLE table_name_11 (winner VARCHAR,event VARCHAR) | SELECT winner FROM table_name_11 WHERE event = "european poker tour grand final" |
What was the visiting team on october 23? | CREATE TABLE table_name_10 (visiting_team VARCHAR,date VARCHAR) | SELECT visiting_team FROM table_name_10 WHERE date = "october 23" |
Bin the hire date into the day of week interval, and then calculate the average salary of employees in each day for a bar chart, note that just select those employees without the letter M in their first name, and could you list Y in ascending order? | CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN... | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY) |
which country had the least number of models ? | CREATE TABLE table_204_343 (id number,"nation" text,"model" text,"length" text,"barrel length" text,"weight" text) | SELECT "nation" FROM table_204_343 GROUP BY "nation" ORDER BY COUNT("model") LIMIT 1 |
What was the department that got $626,798 in local investments? | CREATE TABLE table_21337 ("Department" text,"Projects" real,"Municipalities" real,"Farmers" real,"Irrigated Ha" real,"BID/PRONAR Investment (US$)" text,"Local Investment (US$)" text,"Total" text) | SELECT "Department" FROM table_21337 WHERE "Local Investment (US$)" = '626,798' |
Name the first elected for hosea moffitt (f) 57.9% josiah masters (dr) 42.1% | CREATE TABLE table_74004 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "First elected" FROM table_74004 WHERE "Candidates" = 'Hosea Moffitt (F) 57.9% Josiah Masters (DR) 42.1%' |
What is the resulting score for the episodes where Rufus's guest is Sean Lock? | CREATE TABLE table_19930660_3 (winner VARCHAR,rufus_guest VARCHAR) | SELECT winner FROM table_19930660_3 WHERE rufus_guest = "Sean Lock" |
Group and count details for the events using a bar chart, and I want to list by the names in desc. | CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants_in_Events (Event_ID INTEGER... | SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY Event_Details DESC |
Name the least amount of int yards | CREATE TABLE table_72681 ("Player" text,"G" real,"Tackles" real,"Solo" real,"Assts" real,"Sacks" text,"Int" real,"Int yards" real,"Int avg." text,"Int TD" real,"Fum. rec" real,"Fum. rec TD" real) | SELECT MIN("Int yards") FROM table_72681 |
What is the average Year that has a Quantity of 10, and a GWR Numbers of 409, 290, 315, 317 321, 324, 333? | CREATE TABLE table_name_49 (year INTEGER,quantity VARCHAR,gwr_numbers VARCHAR) | SELECT AVG(year) FROM table_name_49 WHERE quantity = 10 AND gwr_numbers = "409, 290, 315, 317–321, 324, 333" |
the difference between yelizaveta bryzhina 's time and ksenija balta 's time ? | CREATE TABLE table_204_401 (id number,"rank" number,"lane" number,"name" text,"nationality" text,"react" number,"time" number,"notes" text) | SELECT ABS((SELECT "time" FROM table_204_401 WHERE "name" = 'yelizaveta bryzhina') - (SELECT "time" FROM table_204_401 WHERE "name" = 'ksenija balta')) |
Questions counted by time to first answer (w/o 24 hr restriction, log/log axis). | 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,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta... | SELECT LOG(10, CAST((JULIANDAY(CreationDate) - JULIANDAY(q.CreationDate)) * 1440.0 AS INT)) AS "Log Time (m)", LOG(10, COUNT(*)) FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id LEFT OUTER JOIN Posts AS a2 ON a.ParentId = a2.ParentId AND a.CreationDate > a2.CreationDate WHERE a2.Id IS NULL AND a.CreationDate ... |
Which Copa Libertadores 1992 has a Supercopa Sudamericana 1992 of round of 16, and a Team of gr mio? | CREATE TABLE table_5223 ("Team" text,"Copa Libertadores 1992" text,"Supercopa Sudamericana 1992" text,"Copa CONMEBOL 1992" text,"Recopa Sudamericana 1992" text,"Intercontinental Cup 1992" text) | SELECT "Copa Libertadores 1992" FROM table_5223 WHERE "Supercopa Sudamericana 1992" = 'round of 16' AND "Team" = 'grêmio' |
Display requirements for a degree in CS-LSA . | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits var... | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id |
What is the Name of the stage with S. Loeb as the Winner with a Length of 13.04km and a Stage of SS12? | CREATE TABLE table_75047 ("Stage" text,"Time" text,"Name" text,"Length" text,"Winner" text) | SELECT "Name" FROM table_75047 WHERE "Winner" = 's. loeb' AND "Length" = '13.04km' AND "Stage" = 'ss12' |
Where is the school located that has mustangs as a mascot? | CREATE TABLE table_14078 ("School" text,"Location" text,"Mascot" text,"Enrollment" real,"IHSAA Class" text,"# / County" text) | SELECT "Location" FROM table_14078 WHERE "Mascot" = 'mustangs' |
Who is the Away captain that played on 11,12,13 Aug 1902? | CREATE TABLE table_42818 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text) | SELECT "Away captain" FROM table_42818 WHERE "Date" = '11,12,13 aug 1902' |
Show different types of ships and the average tonnage of ships of each type Show bar chart, sort Y in asc order. | CREATE TABLE mission (Mission_ID int,Ship_ID int,Code text,Launched_Year int,Location text,Speed_knots int,Fate text)CREATE TABLE ship (Ship_ID int,Name text,Type text,Nationality text,Tonnage int) | SELECT Type, AVG(Tonnage) FROM ship GROUP BY Type ORDER BY AVG(Tonnage) |
Which Vice President has a President of daniel masny, and a Treasurer of rebecca t. altmann? | CREATE TABLE table_55249 ("Year" text,"President" text,"Vice President" text,"Gen.-Secretary" text,"Treasurer" text) | SELECT "Vice President" FROM table_55249 WHERE "President" = 'daniel masny' AND "Treasurer" = 'rebecca t. altmann' |
what's the thursday time with location being hawthorne | CREATE TABLE table_11019212_1 (thursday VARCHAR,location VARCHAR) | SELECT thursday FROM table_11019212_1 WHERE location = "Hawthorne" |
Return the names and ids of all products whose price is between 600 and 700. | 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 text,product_price number)CREATE TABLE staff_departmen... | SELECT product_name, product_id FROM products WHERE product_price BETWEEN 600 AND 700 |
What is the Chassis of the Honda Engine with a Motorola sponsor? | CREATE TABLE table_50547 ("Team" text,"Chassis" text,"Engine" text,"Tire" text,"Sponsor" text) | SELECT "Chassis" FROM table_50547 WHERE "Engine" = 'honda' AND "Sponsor" = 'motorola' |
How many seasons in the top division for the team that finished 005 5th in 2012-2013 | CREATE TABLE table_1510519_1 (number_of_seasons_in_top_division VARCHAR,position_in_2012_13 VARCHAR) | SELECT COUNT(number_of_seasons_in_top_division) FROM table_1510519_1 WHERE position_in_2012_13 = "005 5th" |
A ferrari flat-12 engine with more than 1 point has what kind of chassis? | CREATE TABLE table_67986 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT "Chassis" FROM table_67986 WHERE "Engine" = 'ferrari flat-12' AND "Points" > '1' |
What is the most number of losses for Quetta Zorawar? | CREATE TABLE table_name_15 (lost INTEGER,team VARCHAR) | SELECT MAX(lost) FROM table_name_15 WHERE team = "quetta zorawar" |
Which Description has a Year of Issue of 1983, and a Weight of 3.50grams? | CREATE TABLE table_name_67 (description VARCHAR,year_of_issue VARCHAR,weight VARCHAR) | SELECT description FROM table_name_67 WHERE year_of_issue = 1983 AND weight = "3.50grams" |
whats the sex of patient 1862? | 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 chartevents (row_id number,subject_id number,hadm_id number,icustay_id n... | SELECT patients.gender FROM patients WHERE patients.subject_id = 1862 |
For team #40 chip ganassi racing which top 5 is the highest where top 10 is 5? | CREATE TABLE table_1708014_1 (top_5 INTEGER,top_10 VARCHAR,team_s_ VARCHAR) | SELECT MAX(top_5) FROM table_1708014_1 WHERE top_10 = 5 AND team_s_ = "#40 Chip Ganassi Racing" |
What County has a Median household income of $46,872? | CREATE TABLE table_75627 ("County" text,"Per capita income" text,"Median household income" text,"Median family income" text,"Population" real,"Number of households" real) | SELECT "County" FROM table_75627 WHERE "Median household income" = '$46,872' |
What is the role of the employee named Koby? | CREATE TABLE ROLES (role_description VARCHAR,role_code VARCHAR)CREATE TABLE Employees (role_code VARCHAR,employee_name VARCHAR) | SELECT T1.role_description FROM ROLES AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code WHERE T2.employee_name = "Koby" |
Show the budget type code and description and the corresponding document id. | 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) | 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 |
What date was the Izmir Cup in which lhan played against Somdev Devvarman? | CREATE TABLE table_60743 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Date" FROM table_60743 WHERE "Tournament" = 'izmir cup' AND "Opponent" = 'somdev devvarman' |
how many winners are there ? | 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) | SELECT COUNT(*) FROM table_204_724 WHERE "outcome" = 'winner' |
All my posts in desc. | 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 number,CreationDate time,ApprovalDate time,RejectionDate time,Own... | SELECT COUNT(Id), PostTypeId FROM Posts WHERE OwnerUserId = @UserId AND CreationDate >= '##year##0101' AND CreationDate <= '##year##1231' GROUP BY PostTypeId |
What was the score for the home team who plays their matches at the mcg venue? | CREATE TABLE table_54954 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Home team score" FROM table_54954 WHERE "Venue" = 'mcg' |
what the first height of patient 030-67523 in their last hospital encounter. | 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 (uniquepid text,patienthealthsystemstayid number,patientunit... | 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... |
Which opponent has 63 points? | CREATE TABLE table_36299 ("Game" real,"March" real,"Opponent" text,"Score" text,"Record" text,"Points" real) | SELECT "Opponent" FROM table_36299 WHERE "Points" = '63' |
Who was the visiting team when Winnipeg was the home team? | CREATE TABLE table_name_33 (visitor VARCHAR,home VARCHAR) | SELECT visitor FROM table_name_33 WHERE home = "winnipeg" |
what was the name of the output the last time patient 030-21071 had on last month/21? | 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 number,uniquepid text,patienthealthsystemstayid number,eventt... | 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... |
Show all majors and corresponding number of students. Plot them as scatter chart. | 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 INTEGER,Allergy VARCHAR(20)) | SELECT Major, COUNT(*) FROM Student GROUP BY Major |
what is marital status and date of birth of subject id 2560? | 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 (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT demographic.marital_status, demographic.dob FROM demographic WHERE demographic.subject_id = "2560" |
A bar chart for returning the number of the categories of music festivals that have the result 'Awarded'. | 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,Volume_Issue text,Issue_Date text,Weeks_on_Top real,Song text,Artist_ID ... | SELECT Category, COUNT(Category) FROM music_festival WHERE Result = "Awarded" GROUP BY Category |
What position was pick # 54? | CREATE TABLE table_29228 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text) | SELECT "Position" FROM table_29228 WHERE "Pick #" = '54' |
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. | 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) | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name |
Draw a pie chart about the proportion of ACC_Regular_Season and ACC_Percent. | 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_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT ACC_Regular_Season, ACC_Percent FROM basketball_match |
who are the candidates with district being kansas 4 | CREATE TABLE table_1342359_15 (candidates VARCHAR,district VARCHAR) | SELECT candidates FROM table_1342359_15 WHERE district = "Kansas 4" |
what is the average draw when the place is 5 and points more than 15? | CREATE TABLE table_65353 ("Draw" real,"Language" text,"Artist" text,"Place" real,"Points" real) | SELECT AVG("Draw") FROM table_65353 WHERE "Place" = '5' AND "Points" > '15' |
What is the total score for the 36 arrow finals event? | CREATE TABLE table_name_72 (score VARCHAR,event VARCHAR) | SELECT COUNT(score) FROM table_name_72 WHERE event = "36 arrow finals" |
how many patients were diagnosed since 4 years ago with pleural effusion - right within 2 months after receiving laxatives - enema? | 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 TABLE medication (medicationid number,patientunitstayid nu... | 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 ... |
Which Royal house has a name of ding? | CREATE TABLE table_name_30 (royal_house VARCHAR,name VARCHAR) | SELECT royal_house FROM table_name_30 WHERE name = "ding" |
is k2 taller than kangchenjunga ? | CREATE TABLE table_204_570 (id number,"rank" number,"mountain" text,"height (m)" number,"height (ft)" number,"range" text,"coordinates" text,"prominence (m)" number,"parent mountain" text,"first ascent" number,"ascents (failed attempts) bef.2004" text) | SELECT (SELECT "height (m)" FROM table_204_570 WHERE "mountain" = 'k2') > (SELECT "height (m)" FROM table_204_570 WHERE "mountain" = 'kangchenjunga') |
What is the sum of the glyph with a 38 hexadecimal and a binary less than 111000? | CREATE TABLE table_name_4 (glyph INTEGER,hexadecimal VARCHAR,binary VARCHAR) | SELECT SUM(glyph) FROM table_name_4 WHERE hexadecimal = 38 AND binary < 111000 |
WHat status had an against larger than 6 and a date of 01/02/1975? | CREATE TABLE table_13170 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT "Status" FROM table_13170 WHERE "Against" > '6' AND "Date" = '01/02/1975' |
Name the team for week 1 of 28 | 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) | SELECT "Team" FROM table_75061 WHERE "Week 1" = '28' |
What is the number of cities in each country? Return a bar chart, and list in ascending by the x axis please. | 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,Black real,Amerindian real,Asian real,Multiracial real,Hispanic real) | 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 |
Who lost at schaefer stadium when the Winner was new england patriots, and a Date of october 18? | CREATE TABLE table_name_89 (loser VARCHAR,date VARCHAR,location VARCHAR,winner VARCHAR) | SELECT loser FROM table_name_89 WHERE location = "schaefer stadium" AND winner = "new england patriots" AND date = "october 18" |
Before taking GTBOOKS 331 , what are some useful courses to take ? | 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,student_id int,score int,comment_text varchar)CREATE TABLE ta (c... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'GTBOOKS' AND number = 331 |
What is listed in new points when status is second round lost to xavier malisse? | CREATE TABLE table_31230 ("Seed" real,"Rank" real,"Player" text,"Points" real,"Points defending" real,"Points won" real,"New points" real,"Status" text) | SELECT MIN("New points") FROM table_31230 WHERE "Status" = 'Second round lost to Xavier Malisse' |
what is procedure long title of subject id 14755? | 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,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT procedures.long_title FROM procedures WHERE procedures.subject_id = "14755" |
What is NK Rijeka's away score? | CREATE TABLE table_5969 ("Round" real,"Club" text,"Home" text,"Away" text,"Aggregate" text) | SELECT "Away" FROM table_5969 WHERE "Club" = 'nk rijeka' |
What is the value of the item 'Points' when the value of the item 'Points against' is 272? | 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) | SELECT "Points for" FROM table_75977 WHERE "Points against" = '272' |
What is the time for a lane less than 6, and a heat less than 4 for Joanne Malar? | CREATE TABLE table_name_19 (time VARCHAR,name VARCHAR,lane VARCHAR,heat VARCHAR) | SELECT time FROM table_name_19 WHERE lane < 6 AND heat < 4 AND name = "joanne malar" |
Which record has an Attendance larger than 12,552, and a Score of 7-0? | CREATE TABLE table_15617 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Record" FROM table_15617 WHERE "Attendance" > '12,552' AND "Score" = '7-0' |
What was the score for Footscray when they were the away team? | CREATE TABLE table_name_66 (away_team VARCHAR) | SELECT away_team AS score FROM table_name_66 WHERE away_team = "footscray" |
Return a pie chart on how many medications are prescribed for each brand? | 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 Patient (SSN INTEGER,Name VARCHAR(30),Address VARCHAR(30),Phone... | SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand |
number of tags containing 'java'. | 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,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate ti... | SELECT COUNT(*) FROM Tags WHERE TagName LIKE '%java%' |
What is the production code for episode 96 in the series? | 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) | SELECT MIN("Production code") FROM table_3993 WHERE "No. in series" = '96' |
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. | 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 TABLE player_award_vote (award_id TEXT,year INTEGER,league_id TEXT,p... | 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' |
calculate the total number of patients diagnosed with malig neo ascend colon | 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 (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | 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" |
What was the surface on 23 October 2011? | CREATE TABLE table_name_97 (surface VARCHAR,date VARCHAR) | SELECT surface FROM table_name_97 WHERE date = "23 october 2011" |
What are the Baronies when the area (in acres) is 276? | CREATE TABLE table_30121082_1 (barony VARCHAR,area__acres__ VARCHAR) | SELECT barony FROM table_30121082_1 WHERE area__acres__ = 276 |
Find the total student enrollment for different affiliation type schools. | CREATE TABLE university (affiliation VARCHAR,enrollment INTEGER) | SELECT SUM(enrollment), affiliation FROM university GROUP BY affiliation |
What is the total number of bronze when the total is less than 1? | CREATE TABLE table_77962 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Bronze") FROM table_77962 WHERE "Total" < '1' |
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? | 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 TABLE transfers (row_id number,subject_id number,hadm_id number,icus... | 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... |
A scatter chart shows the correlation between author_id and author_tutor_ATB . | 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_Tests_Taken (registration_id INTEGER,date_test_... | SELECT author_id, author_tutor_ATB FROM Course_Authors_and_Tutors ORDER BY personal_name |
What artist had a mintage of 41,828 before year 2002? | CREATE TABLE table_52214 ("Year" real,"Theme" text,"Artist" text,"Mintage" text,"Issue Price" text) | SELECT "Artist" FROM table_52214 WHERE "Year" < '2002' AND "Mintage" = '41,828' |
what was this team 's next opponent after facing hawthorn on may 22 of this season ? | 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) | SELECT "opponent" FROM table_204_881 WHERE id = (SELECT id FROM table_204_881 WHERE "opponent" = 'hawthorn') + 1 |
Who has Took Office of march 4, 1875? | CREATE TABLE table_52716 ("Name" text,"Took Office" text,"Left Office" text,"Party" text,"District Residence" text) | SELECT "Name" FROM table_52716 WHERE "Took Office" = 'march 4, 1875' |
In 2007, what is the average total matches with points % larger than 33.3? | CREATE TABLE table_31923 ("Year" text,"Total matches" real,"Total W-L-H" text,"Singles W-L-H" text,"Points won" real,"Points %" real) | SELECT AVG("Total matches") FROM table_31923 WHERE "Points %" > '33.3' AND "Year" = '2007' |
return me the number of papers on VLDB conference . | 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 (cid int,homepage varchar,name varchar)CREATE TABLE keyword (keyword varchar,... | SELECT COUNT(DISTINCT (publication.title)) FROM conference, publication WHERE conference.name = 'VLDB' AND publication.cid = conference.cid |
What venue did the away team footscray play at? | CREATE TABLE table_name_63 (venue VARCHAR,away_team VARCHAR) | SELECT venue FROM table_name_63 WHERE away_team = "footscray" |
the top ranked nation for total medals won | CREATE TABLE table_204_822 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "nation" FROM table_204_822 ORDER BY "total" DESC LIMIT 1 |
Dropping fast: Lowest question score per thousand views among questions with score -20 or worse. | 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)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE T... | 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 |
what is the number of patients whose discharge location is long term care hospital and who have undergone a form cutan ileoureterost?? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex... | 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" |
Which episodes have Patrick Lau as the director and Lisa Holdsworth as the writer? | CREATE TABLE table_19256 ("Total#" real,"Series#" real,"Title" text,"Writer" text,"Director" text,"Original air date" text) | SELECT "Title" FROM table_19256 WHERE "Director" = 'Patrick Lau' AND "Writer" = 'Lisa Holdsworth' |
Show the account id and the number of transactions for each account | CREATE TABLE Financial_transactions (account_id VARCHAR) | SELECT account_id, COUNT(*) FROM Financial_transactions GROUP BY account_id |
What was the location and attendance of the game when High Assists were Andre Miller (7)? | CREATE TABLE table_17323042_11 (location_attendance VARCHAR,high_assists VARCHAR) | SELECT location_attendance FROM table_17323042_11 WHERE high_assists = "Andre Miller (7)" |
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. | 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(4,0))CREATE TABLE departments (DEPARTMENT_ID decimal(4,... | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID |
How many people were in the crowd when North Melbourne was the home team? | CREATE TABLE table_name_3 (crowd VARCHAR,home_team VARCHAR) | SELECT crowd FROM table_name_3 WHERE home_team = "north melbourne" |
What are the districts represented by the Democratic Party and a Committee in Economic Matters? | CREATE TABLE table_17748 ("District" text,"Counties Represented" text,"Delegate" text,"Party" text,"First Elected" real,"Committee" text) | SELECT "District" FROM table_17748 WHERE "Committee" = 'Economic Matters' AND "Party" = 'Democratic' |
How many wins? | CREATE TABLE table_18703133_6 (wins INTEGER) | SELECT MAX(wins) FROM table_18703133_6 |
What is the total number of played for the goals against over 44 and a goal difference of 11? | CREATE TABLE table_name_68 (played VARCHAR,goal_difference VARCHAR,goals_against VARCHAR) | SELECT COUNT(played) FROM table_name_68 WHERE goal_difference = 11 AND goals_against > 44 |
How many games were lost by more than 27 but not more 78 with goals less than 300? | CREATE TABLE table_name_61 (games INTEGER,goals_against VARCHAR,lost VARCHAR,points VARCHAR) | SELECT AVG(games) FROM table_name_61 WHERE lost > 27 AND points < 78 AND goals_against < 300 |
give me the total of the output for patient 23929 on 08/25/last year. | 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 number,hadm_id number,icd9_code text,charttime time)CREATE TABLE ... | 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... |
What player has a total of 158/ | CREATE TABLE table_name_54 (player VARCHAR,total VARCHAR) | SELECT player FROM table_name_54 WHERE total = "158" |
Where is Indian Creek school located? | CREATE TABLE table_name_79 (location VARCHAR,school VARCHAR) | SELECT location FROM table_name_79 WHERE school = "indian creek" |
In the year 1992 for the Seibu Lions, the BB + HBP which is larger than 49 was this as a BA (Place)? | CREATE TABLE table_name_70 (ba__place_ VARCHAR,year VARCHAR,team VARCHAR,bb_ VARCHAR,hbp VARCHAR) | SELECT ba__place_ FROM table_name_70 WHERE bb_ + hbp > 49 AND team = "seibu lions" AND year = "1992" |
What is the Hometown for Villanova College? | CREATE TABLE table_name_11 (hometown VARCHAR,college VARCHAR) | SELECT hometown FROM table_name_11 WHERE college = "villanova" |
For next Winter 's Dissertation-Cand , who is the teacher ? | 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,student_id int,location varchar)CREATE TABLE course (course... | 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... |
What is the percentage of all the literate people where females are 73.17? | CREATE TABLE table_14598_9 (literate_persons___percentage_ VARCHAR,females___percentage_ VARCHAR) | SELECT literate_persons___percentage_ FROM table_14598_9 WHERE females___percentage_ = "73.17" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.