instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
when is the last direct antigen test for herpes simplex virus types 1 & 2 microbiological test on patient 50065 since 107 months ago? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE chartevents (row_id number,s... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50065) AND microbiologyevents.spec_type_desc = 'direct antigen test for herpes simplex virus types 1 & 2' AND DATETIME(microbiologyevents.charttime) >=... |
When portsmouth is the city of license who is the licensee? | CREATE TABLE table_1949746_1 (licensee VARCHAR,city_of_license VARCHAR) | SELECT licensee FROM table_1949746_1 WHERE city_of_license = "Portsmouth" |
what year had the least us peak chart positions ? | CREATE TABLE table_203_11 (id number,"title" text,"year" number,"peak chart positions\nus" number,"peak chart positions\nus r&b" number,"peak chart positions\nus rap" number,"peak chart positions\nuk" number,"certifications" text,"album" text) | SELECT "year" FROM table_203_11 ORDER BY "peak chart positions\nus r&b" DESC LIMIT 1 |
Find identical titles (no closed questions, same owner). We also show the creation date of the posts. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score ... | SELECT a.Id AS "post_link", a.CreationDate AS "First Date", b.Id AS "post_link", b.CreationDate AS "Second Date" FROM Posts AS a JOIN Posts AS b ON a.Title = b.Title AND a.OwnerUserId = b.OwnerUserId WHERE a.Id < b.Id AND a.ClosedDate IS NULL AND b.ClosedDate IS NULL |
What is the lowest Poles with a Season that is larger than 2009? | CREATE TABLE table_5415 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"Position" text) | SELECT MIN("Poles") FROM table_5415 WHERE "Season" > '2009' |
What is Opposing Teams, when Against is less than 6? | CREATE TABLE table_59749 ("Opposing Teams" text,"Against" real,"Date" text,"Venue" text,"Status" text) | SELECT "Opposing Teams" FROM table_59749 WHERE "Against" < '6' |
Which department has the largest number of employees? | CREATE TABLE undergoes (patient number,procedures number,stay number,dateundergoes time,physician number,assistingnurse number)CREATE TABLE trained_in (physician number,treatment number,certificationdate time,certificationexpires time)CREATE TABLE appointment (appointmentid number,patient number,prepnurse number,physic... | SELECT name FROM department GROUP BY departmentid ORDER BY COUNT(departmentid) DESC LIMIT 1 |
Name the location attendance for dirk nowitzki , caron butler (17) | CREATE TABLE table_23284271_11 (location_attendance VARCHAR,high_points VARCHAR) | SELECT location_attendance FROM table_23284271_11 WHERE high_points = "Dirk Nowitzki , Caron Butler (17)" |
Name the least births for conversion being 26,333 | CREATE TABLE table_30289 ("Religion" text,"Births" real,"Conversions" text,"New adherents per year" real,"Growth rate" text) | SELECT MIN("Births") FROM table_30289 WHERE "Conversions" = '26,333' |
Which player is the centre for the Detroit Red Wings? | CREATE TABLE table_30870 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Player" FROM table_30870 WHERE "Position" = 'Centre' AND "NHL team" = 'Detroit Red Wings' |
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of headquarter and the average of code , and group by attribute headquarter, and could you show from low to high by the bar? | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter |
In what week number was the attendance 74716? | CREATE TABLE table_21002 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real) | SELECT COUNT("Week") FROM table_21002 WHERE "Attendance" = '74716' |
Visualize a bar chart about the distribution of All_Home and the average of School_ID , and group by attribute All_Home, and could you sort in descending by the x-axis? | 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_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT All_Home, AVG(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC |
which flights depart LOS ANGELES destination CHARLOTTE that leave on a monday morning | CREATE TABLE date_day (month_number int,day_number int,year int,day_name varchar)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,o... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHARLOTTE' AND date_day.day_number = 21 AND date_day.month_number = 2 AN... |
What is the score of the game where Wrexham is the home team and the date is Blackpool? | CREATE TABLE table_8252 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text) | SELECT "Score" FROM table_8252 WHERE "Home team" = 'wrexham' AND "Date" = 'blackpool' |
In what Year was the Rank 14.0 14? | CREATE TABLE table_52860 ("Rank" text,"Name" text,"Height ft (m)" text,"Floors" real,"Year" real) | SELECT SUM("Year") FROM table_52860 WHERE "Rank" = '14.0 14' |
provide the number of patients whose admission type is newborn and discharge location is snf? | 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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "NEWBORN" AND demographic.discharge_location = "SNF" |
how many patients whose year of birth is less than 2087 and lab test fluid is joint fluid? | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2087" AND lab.fluid = "Joint Fluid" |
Answers on closed questions by a specific user. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE Tags (Id numbe... | SELECT q.Id AS "post_link", a.Id AS "post_link", q.Score, a.Score, q.ViewCount, q.Tags FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE (NOT q.ClosedDate IS NULL) AND (a.OwnerUserId = '##userId##') ORDER BY q.Id DESC |
What is the year 2007 earnings per share? | CREATE TABLE table_50330 ("Year ended" text,"Revenue (\u00a3million)" real,"Profit/(loss) before tax (\u00a3m)" real,"Net profit (\u00a3m)" real,"Earnings per share (p)" real) | SELECT "Earnings per share (p)" FROM table_50330 WHERE "Year ended" = '2007' |
Name the sum of rank for silver less than 0 | CREATE TABLE table_name_55 (rank INTEGER,silver INTEGER) | SELECT SUM(rank) FROM table_name_55 WHERE silver < 0 |
tell me the birth date of patient 23002? | 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 cost (row_id number,subject_id number,hadm_id number,event_type t... | SELECT patients.dob FROM patients WHERE patients.subject_id = 23002 |
what's the stadium with record being 1 1 | CREATE TABLE table_14102379_4 (stadium VARCHAR,record VARCHAR) | SELECT stadium FROM table_14102379_4 WHERE record = "1–1" |
Name the most number when tournament is madrid masters | CREATE TABLE table_1590652_4 (no INTEGER,tournament VARCHAR) | SELECT MAX(no) FROM table_1590652_4 WHERE tournament = "Madrid Masters" |
When li fuyu is the stage winner who is the general classification? | CREATE TABLE table_19867 ("Stage" real,"Stage winner" text,"General classification" text,"Points classification" text,"Mountains classification" text,"Malaysian rider classification" text,"Team classification" text) | SELECT "General classification" FROM table_19867 WHERE "Stage winner" = 'Li Fuyu' |
Tell me the 3rd component for bp azeo of 62.1 | CREATE TABLE table_name_49 (bp_azeo__˚c_ VARCHAR) | SELECT 3 AS rd_component FROM table_name_49 WHERE bp_azeo__˚c_ = "62.1" |
What is the rounds of rider Mika Kallio 1 of the Ducati Marlboro team? | CREATE TABLE table_38941 ("Team" text,"Constructor" text,"Motorcycle" text,"Rider" text,"Rounds" text) | SELECT "Rounds" FROM table_38941 WHERE "Team" = 'ducati marlboro team' AND "Rider" = 'mika kallio 1' |
How many points when pole are 1? | CREATE TABLE table_2545 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" text,"Position" text) | SELECT "Points" FROM table_2545 WHERE "Poles" = '1' |
Give me a bar chart about the number of countries in the artist table, and could you display by the bars in descending? | CREATE TABLE artist (Artist_ID int,Name text,Country text,Year_Join int,Age int)CREATE TABLE exhibition (Exhibition_ID int,Year int,Theme text,Artist_ID int,Ticket_Price real)CREATE TABLE exhibition_record (Exhibition_ID int,Date text,Attendance int) | SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country DESC |
When did the length of 60 minutes air? | CREATE TABLE table_name_46 (airdate VARCHAR,length VARCHAR) | SELECT airdate FROM table_name_46 WHERE length = "60 minutes" |
Answer (Up/Down) Votes from a specific Question. | CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment tex... | SELECT COUNT(v.PostId) AS "DV count", v.PostId AS "post_link", p.Body FROM Votes AS v INNER JOIN Posts AS p ON p.Id = v.PostId WHERE p.ParentId = @ParentId AND p.PostTypeId = 2 AND v.VoteTypeId = @kind GROUP BY v.PostId, p.Body ORDER BY 'DV count' DESC |
Show all game names played by at least 1000 hours. | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE plays_games (stuid number,gameid number,hours_played number)CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek number,gamesplayed number,onscholarship text)CREATE TABLE vid... | SELECT gname FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000 |
What is team Yamaha with 3 points ranked? | CREATE TABLE table_name_8 (rank VARCHAR,team VARCHAR,points VARCHAR) | SELECT rank FROM table_name_8 WHERE team = "yamaha" AND points = 3 |
what is the total number of standard and broad gauges ? | CREATE TABLE table_204_816 (id number,"locomotive" text,"named" text,"serial no" text,"entered service" text,"gauge" text,"livery" text) | SELECT COUNT(*) FROM table_204_816 WHERE "gauge" IN ('standard', 'broad') |
has any microbiological tests been conducted on patient 1918's blood culture until 1 year ago? | CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE patients (row_id number,subject_id number,gender te... | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1918) AND microbiologyevents.spec_type_desc = 'blood culture' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') |
Which Result has an Opponent of minnesota vikings? | CREATE TABLE table_name_85 (result VARCHAR,opponent VARCHAR) | SELECT result FROM table_name_85 WHERE opponent = "minnesota vikings" |
what is insurance and death status of subject name wayne shelton? | 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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT demographic.insurance, demographic.expire_flag FROM demographic WHERE demographic.name = "Wayne Shelton" |
Bar graph to show the number of nationality from different nationality, and rank from low to high by the Y. | CREATE TABLE event (Event_ID int,Date text,Venue text,Name text,Event_Attendance int)CREATE TABLE journalist (journalist_ID int,Name text,Nationality text,Age text,Years_working int)CREATE TABLE news_report (journalist_ID int,Event_ID int,Work_Type text) | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY COUNT(Nationality) |
What was the result of the Oregon 5 District incumbent who was first elected in 1996? | CREATE TABLE table_79150 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text) | SELECT "Results" FROM table_79150 WHERE "First elected" = '1996' AND "District" = 'oregon 5' |
What event was Rob Vine riding? | CREATE TABLE table_79852 ("Rider" text,"Date" text,"Place" text,"Race" text,"Event" text,"Machine" text) | SELECT "Event" FROM table_79852 WHERE "Rider" = 'rob vine' |
List of Not-Closed Community Wiki Posts. List of Not-Closed Community Wiki Posts
Get all Question and Answer that are Community Wiki but not closed.
Don't list all answers of a Community Wiki Question because they are all Community Wiki anyway. | CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)C... | SELECT PostTypes.Name, Posts.Id AS "post_link", Posts.Score AS Score, Posts.CreationDate FROM Posts INNER JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id LEFT JOIN Posts AS ParentPosts ON Posts.ParentId = ParentPosts.Id WHERE Posts.PostTypeId IN (1, 2) AND NOT (Posts.CommunityOwnedDate IS NULL) AND (ParentPosts.Commu... |
What position did the sheffield eagles finish in? | CREATE TABLE table_13018091_1 (position INTEGER,club VARCHAR) | SELECT MAX(position) FROM table_13018091_1 WHERE club = "Sheffield Eagles" |
Show all destinations and the number of flights to each destination Plot them as bar chart, list by the x axis in ascending. | CREATE TABLE aircraft (aid number(9,0),name varchar2(30),distance number(6,0))CREATE TABLE flight (flno number(4,0),origin varchar2(20),destination varchar2(20),distance number(6,0),departure_date date,arrival_date date,price number(7,2),aid number(9,0))CREATE TABLE employee (eid number(9,0),name varchar2(30),salary nu... | SELECT destination, COUNT(*) FROM flight GROUP BY destination ORDER BY destination |
until 2104 what is the four most commonly taken lab test for patients 60 or above? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE lab (labid number,patientunitstayid nu... | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age >= 60) AND STRFTIME('%y', lab.labresulttime) <= '2104' GROUP BY lab.labname) AS t1 WHERE t1.c1 <= 4 |
which format had the most releases ? | CREATE TABLE table_203_607 (id number,"catalogue number" text,"artist" text,"release title" text,"format" text,"release date" text) | SELECT "format" FROM table_203_607 GROUP BY "format" ORDER BY COUNT("release title") DESC LIMIT 1 |
What is the place of To par of e when Arron Oberholser was the player ? | CREATE TABLE table_name_66 (place VARCHAR,to_par VARCHAR,player VARCHAR) | SELECT place FROM table_name_66 WHERE to_par = "e" AND player = "arron oberholser" |
For all employees who have the letters D or S in their first name, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by weekday, and order y-axis in ascending order. | CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE 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... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(DEPARTMENT_ID) |
How many distinct allergies are there? | CREATE TABLE has_allergy (stuid number,allergy text)CREATE TABLE allergy_type (allergy text,allergytype text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text) | SELECT COUNT(DISTINCT allergytype) FROM allergy_type |
Who were D rr's opponents in the final on year 1968? | CREATE TABLE table_24152 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Partner" text,"Opponents in the final" text,"Score in the final" text) | SELECT "Opponents in the final" FROM table_24152 WHERE "Year" = '1968' |
Which country does the player pele belong to? | CREATE TABLE table_name_85 (country VARCHAR,name VARCHAR) | SELECT country FROM table_name_85 WHERE name = "pele" |
Name the wins for draws pk is 3/0 | CREATE TABLE table_22564 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws P.K. Wins / P.K. Losses" text,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT "Wins" FROM table_22564 WHERE "Draws P.K. Wins / P.K. Losses" = '3/0' |
Who is the mInister who left office during 1960? | CREATE TABLE table_name_58 (minister VARCHAR,left_office VARCHAR) | SELECT minister FROM table_name_58 WHERE left_office = "1960" |
how many episodes are there total ? | CREATE TABLE table_204_981 (id number,"ep#" number,"title" text,"broadcast date" text,"written by" text,"directed by" text) | SELECT COUNT("ep#") FROM table_204_981 |
What is the sum of Against values for teams with 5 losses and 0 draws? | CREATE TABLE table_name_8 (against INTEGER,losses VARCHAR,draws VARCHAR) | SELECT SUM(against) FROM table_name_8 WHERE losses = 5 AND draws < 0 |
What role was played in 2007? | CREATE TABLE table_name_37 (role VARCHAR,year VARCHAR) | SELECT role FROM table_name_37 WHERE year = 2007 |
How many people were in attendance when the group position was 3rd? | CREATE TABLE table_name_56 (attendance VARCHAR,group_position VARCHAR) | SELECT attendance FROM table_name_56 WHERE group_position = "3rd" |
What type had a course of Grosseto To Rieti? | CREATE TABLE table_name_18 (type VARCHAR,course VARCHAR) | SELECT type FROM table_name_18 WHERE course = "grosseto to rieti" |
What is the home of fc st. gallen (asl) geust? | CREATE TABLE table_49428 ("Date" text,"Time" text,"Home" text,"Geust" text,"Result" text) | SELECT "Home" FROM table_49428 WHERE "Geust" = 'fc st. gallen (asl)' |
What are the ids of the courses that are registered or attended by the student whose id is 121? | CREATE TABLE people_addresses (person_address_id number,person_id number,address_id number,date_from time,date_to time)CREATE TABLE candidate_assessments (candidate_id number,qualification text,assessment_date time,asessment_outcome_code text)CREATE TABLE people (person_id number,first_name text,middle_name text,last_n... | SELECT course_id FROM student_course_registrations WHERE student_id = 121 UNION SELECT course_id FROM student_course_attendance WHERE student_id = 121 |
When was the build date for ff20 PRR class and erie built builder's model? | CREATE TABLE table_name_14 (build_date VARCHAR,prr_class VARCHAR,builder’s_model VARCHAR) | SELECT build_date FROM table_name_14 WHERE prr_class = "ff20" AND builder’s_model = "erie built" |
Just show the first name and the manager id with a bar chart, and sort total number from high to low order. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPART... | SELECT T1.FIRST_NAME, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID ORDER BY T1.MANAGER_ID DESC |
Ubuntu / Linux in question title. | CREATE TABLE ReviewTaskResultTypes (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,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayN... | SELECT Id, Title, Tags, LastActivityDate, ClosedDate FROM Posts WHERE Title LIKE '%buntu%' OR Title LIKE '%inux%' ORDER BY LastActivityDate DESC |
What was the cyclone's pressure in the storm that death was equal to 95km/h (60mph)? | CREATE TABLE table_10602294_1 (pressure VARCHAR,deaths VARCHAR) | SELECT pressure FROM table_10602294_1 WHERE deaths = "95km/h (60mph)" |
In what prefecture is Nihon Bunri located? | CREATE TABLE table_2518850_4 (prefecture VARCHAR,high_school_name VARCHAR) | SELECT prefecture FROM table_2518850_4 WHERE high_school_name = "Nihon Bunri" |
What type has the characters ? | CREATE TABLE table_62902 ("Name (pinyin)" text,"Name (Wade Giles)" text,"Characters" text,"Type" text,"Construction" text) | SELECT "Type" FROM table_62902 WHERE "Characters" = '廣利' |
Who is the away team for the tome team Leeds United, at the League Cup Competition? | CREATE TABLE table_42845 ("Date" text,"Home team" text,"Score" text,"Away team" text,"Venue" text,"Competition" text) | SELECT "Away team" FROM table_42845 WHERE "Home team" = 'leeds united' AND "Competition" = 'league cup' |
what are the newly prescribed medicines of patient 003-10080 today compared to that yesterday? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyste... | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '003-10080') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medica... |
What is the Champion with a Year that is 2008? | CREATE TABLE table_42910 ("Year" real,"Champion" text,"Runner-up" text,"Third place" text,"Fourth place" text,"Jack Tompkins Trophy (MVP)" text) | SELECT "Champion" FROM table_42910 WHERE "Year" = '2008' |
what is a number of times that patient 17638 has had an l nephrostomy's output in 05/2105? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_labitems (row_id number,itemid number,label text)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)CREATE TABLE... | SELECT COUNT(*) 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 = 17638)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'l nephrostomy' AND... |
ELECT * FROM posts WHERE Id < 50000. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId num... | SELECT * FROM Posts WHERE Id > 50000 AND Id < 10000 |
What is Winning Team, when Most Laps Led is Alex Tagliani? | CREATE TABLE table_40551 ("Race" text,"Pole position" text,"Fastest lap" text,"Most laps led" text,"Winning driver" text,"Winning team" text,"Report" text) | SELECT "Winning team" FROM table_40551 WHERE "Most laps led" = 'alex tagliani' |
What is the mascot for South Bend Clay? | CREATE TABLE table_71238 ("School" text,"Location" text,"Mascot" text,"County" text,"Enrollment IHSAA Class" text,"Joined" real,"Previous Conference" text) | SELECT "Mascot" FROM table_71238 WHERE "School" = 'south bend clay' |
Which Goals have a Club of hallelujah fc, and a Rank of 7? | CREATE TABLE table_38077 ("Rank" text,"Scorer" text,"Club" text,"Goals" real,"Matches" text) | SELECT SUM("Goals") FROM table_38077 WHERE "Club" = 'hallelujah fc' AND "Rank" = '7' |
Name the old bulgarian name for ruen, ruy | CREATE TABLE table_19979 ("No." real,"English name" text,"Bulgarian name" text,"Bulgarian name (Transliteration)" text,"Old Bulgarian Names" text,"Old Bulgarian name (Transliteration)" text,"Old Bulgarian name - Meaning" text) | SELECT "Old Bulgarian name - Meaning" FROM table_19979 WHERE "Old Bulgarian name (Transliteration)" = 'Ruen, Ruy' |
search the number of aurelia questions. | CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PostHistory (Id number... | SELECT COUNT(Id) FROM Posts WHERE Tags LIKE '%angular%' |
how many tracks were at least 3 minutes or more in length ? | CREATE TABLE table_203_701 (id number,"#" number,"title" text,"featured guest(s)" text,"producer(s)" text,"length" text) | SELECT COUNT("title") FROM table_203_701 WHERE "length" >= '3' |
When did St Kilda play a home game? | CREATE TABLE table_10204 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_10204 WHERE "Home team" = 'st kilda' |
what flights go from DALLAS to DENVER leaving after 1500 | CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,depa... | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.departure_time > 1500 AND flight.to_airport = AIRPORT_SERVICE_1.airpor... |
What label has brol 34531 as it's catalogue? | CREATE TABLE table_name_31 (label VARCHAR,catalogue VARCHAR) | SELECT label FROM table_name_31 WHERE catalogue = "brol 34531" |
What dates does Alex Munter have 25% and the polling firm of Decima? | CREATE TABLE table_name_41 (polling_dates VARCHAR,alex_munter VARCHAR,polling_firm VARCHAR) | SELECT polling_dates FROM table_name_41 WHERE alex_munter = "25%" AND polling_firm = "decima" |
what is the number of patients whose diagnoses long title is other and unspecified coagulation defects and drug type is additive? | 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 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,sho... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Other and unspecified coagulation defects" AND prescriptions.drug_type = "ADDITIVE" |
What is the venue of season 1983, which had alianza lima as the home team? | CREATE TABLE table_49957 ("Season" real,"Date" text,"Home team" text,"Score" text,"Away team" text,"Venue" text,"Competition round" text) | SELECT "Venue" FROM table_49957 WHERE "Home team" = 'alianza lima' AND "Season" = '1983' |
I want to see the requirements for a CS-LSA degree . | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments ... | 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 |
How many years was the individual winner from the United States was Tiger Woods? | CREATE TABLE table_42127 ("Year" real,"Country" text,"Team" text,"Individual" text,"Location" text,"Runners-up" text) | SELECT COUNT("Year") FROM table_42127 WHERE "Country" = 'united states' AND "Individual" = 'tiger woods' |
What is the earliest closed year in the country of france? | CREATE TABLE table_66330 ("Stadium" text,"Capacity" real,"City" text,"Country" text,"Home team/s" text,"Closed (as a RL stadium)" real) | SELECT MIN("Closed (as a RL stadium)") FROM table_66330 WHERE "Country" = 'france' |
What is the largest ethnic group in 2002 when the population is 200? | CREATE TABLE table_27872 ("Settlement" text,"Cyrillic Name Other Names" text,"Type" text,"Population (2011)" real,"Largest ethnic group (2002)" text,"Dominant religion (2002)" text) | SELECT "Largest ethnic group (2002)" FROM table_27872 WHERE "Population (2011)" = '200' |
What is the weight and dimensions of an N800? | CREATE TABLE table_46731 ("Model" text,"Memory (RAM)" text,"Storage (flash)" text,"Operating system version" text,"Memory card" text,"Weight,dimensions" text,"Retail availability" text) | SELECT "Weight, dimensions" FROM table_46731 WHERE "Model" = 'n800' |
What's the lowest attendance recorded for week 15? | CREATE TABLE table_name_88 (attendance INTEGER,week VARCHAR) | SELECT MIN(attendance) FROM table_name_88 WHERE week = 15 |
What was the finish of the winner of the 2000 Masters? | CREATE TABLE table_69771 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text) | SELECT "Finish" FROM table_69771 WHERE "Year(s) won" = '2000' |
Where was the London Marathon held? | CREATE TABLE table_13503 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text) | SELECT "Venue" FROM table_13503 WHERE "Event" = 'marathon' AND "Competition" = 'london marathon' |
For those employees who was hired before 2002-06-21, give me the comparison about the sum of department_id over the job_id , and group by attribute job_id by a bar chart. | 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 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... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID |
Show the names of buildings except for those having an institution founded in 2003. | CREATE TABLE building (name VARCHAR,building_id VARCHAR)CREATE TABLE institution (building_id VARCHAR,founded VARCHAR) | SELECT name FROM building EXCEPT SELECT T1.name FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded = 2003 |
Which Thumb stick has a Wrist pad of no, and a Supplier of sharkoon? | CREATE TABLE table_name_76 (thumb_stick VARCHAR,wrist_pad VARCHAR,supplier VARCHAR) | SELECT thumb_stick FROM table_name_76 WHERE wrist_pad = "no" AND supplier = "sharkoon" |
What are the number of storms where fog is lower than 74, and sunshine is 2 668? | CREATE TABLE table_42844 ("Sunshine (hrs/year)" text,"Rain (mm/year)" text,"Snow (days/year)" real,"Storms (days/year)" real,"Fog (days/year)" real) | SELECT COUNT("Storms (days/year)") FROM table_42844 WHERE "Fog (days/year)" < '74' AND "Sunshine (hrs/year)" = '2 668' |
Find the balance of the checking account belonging to an owner whose name contains 'ee'. | CREATE TABLE accounts (custid number,name text)CREATE TABLE checking (custid number,balance number)CREATE TABLE savings (custid number,balance number) | SELECT T2.balance FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T1.name LIKE '%ee%' |
Which text has Wade-Giles translation of ai-ma hsin-y an? | CREATE TABLE table_name_85 (text VARCHAR,wade_giles VARCHAR) | SELECT text FROM table_name_85 WHERE wade_giles = "ai-ma … hsin-yüan" |
Which Written by has a Code of 1.2 1.3? | CREATE TABLE table_name_57 (written_by VARCHAR,code VARCHAR) | SELECT written_by FROM table_name_57 WHERE code = "1.2 1.3" |
Finding my Low Quality Answers. This will rank your Questions by the length of the post. | CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostType... | SELECT OwnerUserId AS "user_link", Id AS "post_link", LENGTH(Body) AS "length_of_post" FROM Posts WHERE NOT ParentId IS NULL AND OwnerUserId = '##UserId##' ORDER BY 'length_of_post' |
What is the total number of 2nd place finishes for riders active in years 2009-2010 and more than 0 wins? | CREATE TABLE table_14884 ("Rider" text,"Years active" text,"Races" real,"Wins" real,"2nd pl." real,"3rd pl." real,"Titles." real) | SELECT SUM("2nd pl.") FROM table_14884 WHERE "Years active" = '2009-2010' AND "Wins" > '0' |
What is the average operation beginning with a length of ampang and over 27 stations? | CREATE TABLE table_77986 ("Line" text,"Began operation" real,"Stations" real,"Length (km)" text,"Terminals" text) | SELECT AVG("Began operation") FROM table_77986 WHERE "Length (km)" = 'ampang' AND "Stations" > '27' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.