instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
which wrestler is previous from vacant | CREATE TABLE table_204_854 (id number,"#" number,"wrestlers" text,"reign" number,"date" text,"days\nheld" number,"location" text,"notes" text) | SELECT "wrestlers" FROM table_204_854 WHERE id = (SELECT id FROM table_204_854 WHERE "wrestlers" = 'vacant') - 1 |
Who was the opponent on August 30? | CREATE TABLE table_name_16 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_16 WHERE date = "august 30" |
Find All_Home and Team_ID , and group by attribute ACC_Road, and visualize them by a bar chart. | 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 All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home |
What is the total number of Gold, when Silver is 2, and when Total is less than 7? | CREATE TABLE table_name_34 (gold VARCHAR,silver VARCHAR,total VARCHAR) | SELECT COUNT(gold) FROM table_name_34 WHERE silver = 2 AND total < 7 |
Where did they play the San Diego Chargers? | CREATE TABLE table_18037 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real) | SELECT "Game site" FROM table_18037 WHERE "Opponent" = 'San Diego Chargers' |
how many teams have the color red in their team colors ? | CREATE TABLE table_203_664 (id number,"club" text,"town" text,"founded" number,"nickname" text,"colours" text,"home ground" text,"titles" number,"website" text) | SELECT COUNT("club") FROM table_203_664 WHERE "colours" = 'red' |
What is Drawn, when Club is Newport RFC? | CREATE TABLE table_46323 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Points difference" text,"Bonus Points" text,"Points" text) | SELECT "Drawn" FROM table_46323 WHERE "Club" = 'newport rfc' |
Score of 6 4, and a Opponent of @ marlins had what record? | CREATE TABLE table_35977 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text) | SELECT "Record" FROM table_35977 WHERE "Score" = '6–4' AND "Opponent" = '@ marlins' |
to the Latin of f, y, u/v/w? | CREATE TABLE table_47935 ("Hangul" text,"\u2019Phagspa" text,"Tibetan" text,"Phoenician" text,"Greek" text,"Latin" text) | SELECT "Greek" FROM table_47935 WHERE "Latin" = 'f, y, u/v/w' |
find the drug type and dose for oxacillin. | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT prescriptions.drug_type, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Oxacillin" |
Bar chart x axis position y axis how many position, and I want to list total number in desc order. | CREATE TABLE club (Club_ID int,name text,Region text,Start_year text)CREATE TABLE club_rank (Rank real,Club_ID int,Gold real,Silver real,Bronze real,Total real)CREATE TABLE competition_result (Competition_ID int,Club_ID_1 int,Club_ID_2 int,Score text)CREATE TABLE player (Player_ID int,name text,Position text,Club_ID in... | SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC |
how many days has passed since patient 31088 had a white blood cells laboratory test for the first time on the current hospital encounter? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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 inputevents_cv (row_id ... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31088 AND a... |
count the number of patients diagnosed with angioneurotic edema who had abnormal lab test status. | 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 demographic (subject_id text,hadm_id text,name text,marita... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Angioneurotic edema" AND lab.flag = "abnormal" |
how many people entered office in 1970 ? | CREATE TABLE table_204_782 (id number,"state" text,"title" text,"name" text,"entered office" text) | SELECT COUNT(*) FROM table_204_782 WHERE "entered office" = 1970 |
The earliest year is 1996. | CREATE TABLE table_423 ("Year" real,"Product" text,"Production" text,"Consumption" text,"Import" text,"Export" text) | SELECT MIN("Year") FROM table_423 |
Tell me the venue for record of 2-7 | CREATE TABLE table_31822 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Venue" text,"Attendance" real,"Record" text) | SELECT "Venue" FROM table_31822 WHERE "Record" = '2-7' |
Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841. | CREATE TABLE status (statusid number,status text)CREATE TABLE results (resultid number,raceid number,driverid number,constructorid number,number number,grid number,position number,positiontext text,positionorder number,points number,laps number,time text,milliseconds number,fastestlap number,rank number,fastestlaptime ... | SELECT DISTINCT driverid, stop FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841) |
What was the score for the away team when they played collingwood? | CREATE TABLE table_name_57 (away_team VARCHAR,home_team VARCHAR) | SELECT away_team AS score FROM table_name_57 WHERE home_team = "collingwood" |
Users with 2K rep who visited in the last 30 days. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId numbe... | SELECT Id AS "user_link", DATEDIFF(day, LastAccessDate, GETDATE()) AS DaysSinceLastVisit FROM Users WHERE Reputation >= 2000 AND DATEDIFF(day, LastAccessDate, GETDATE()) < 30 ORDER BY DaysSinceLastVisit |
Which loss happened april 18? | CREATE TABLE table_name_87 (loss VARCHAR,date VARCHAR) | SELECT loss FROM table_name_87 WHERE date = "april 18" |
What height is player number 9? | CREATE TABLE table_12962773_12 (height VARCHAR,no VARCHAR) | SELECT height FROM table_12962773_12 WHERE no = 9 |
what was the length of stay in patient 26195's first hospital stay? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum ... | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 26195 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 |
Which song has more than 66 points, a draw greater than 3, and is ranked 3rd? | CREATE TABLE table_name_25 (song VARCHAR,rank VARCHAR,points VARCHAR,draw VARCHAR) | SELECT song FROM table_name_25 WHERE points > 66 AND draw > 3 AND rank = "3rd" |
what was the first time that patient 57023 got a microbiology test during a month before? | 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 d_icd_procedures (row_id number,icd9_code text,short_title tex... | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY microbiologyevent... |
what is primary disease and lab test fluid of subject id 18372? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT demographic.diagnosis, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "18372" |
How many rounds had a selection of 165? | CREATE TABLE table_name_74 (round INTEGER,selection VARCHAR) | SELECT SUM(round) FROM table_name_74 WHERE selection = 165 |
until 2102 what were the four most common lab tests? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE prescriptio... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE STRFTIME('%y', labevents.charttime) <= '2102' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 4) |
i would like information on flights from SAN FRANCISCO to PITTSBURGH leaving after 2000 monday night | CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE time_interval (period text,begin_time int,end_time i... | 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 ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... |
What country did Derek Black come from? | CREATE TABLE table_1473672_6 (nationality VARCHAR,player VARCHAR) | SELECT nationality FROM table_1473672_6 WHERE player = "Derek Black" |
what is the ground transportation from BOS airport to BOSTON downtown | CREATE TABLE code_description (code varchar,description text)CREATE TABLE food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE flight_fare (f... | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BOSTON' AND ground_service.airpor... |
Does it have something interesting about the manager id and the salary? Show me a scatter chart first. | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,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 regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE dep... | SELECT T1.SALARY, 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 |
Where was the series that the Kansas City Royals lost? | CREATE TABLE table_40442 ("Year" real,"Series" text,"Winning team" text,"Losing team" text,"Score" text,"Site" text) | SELECT "Site" FROM table_40442 WHERE "Winning team" = 'kansas city royals' |
What was the rank of the car who had more than 182 laps, gris less than 3, with a qual time of more than 134.14 and a time/retired of +14:21.72? | CREATE TABLE table_name_78 (rank INTEGER,grid VARCHAR,time_retired VARCHAR,laps VARCHAR,qual VARCHAR) | SELECT MIN(rank) FROM table_name_78 WHERE laps > 182 AND qual > 134.14 AND time_retired = "+14:21.72" AND grid < 3 |
count the number of patients whose diagnoses short title is hx of bladder malignancy 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 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 te... | 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.short_title = "Hx of bladder malignancy" AND prescriptions.drug_type = "ADDITIVE" |
Who has a term that expires on December 31, 2020 and Terry Branstad for an appointing governor? | CREATE TABLE table_11792 ("Name" text,"Appointed/Elected" text,"Term expires" text,"Appointing Governor" text,"Governor's Party Affiliation" text) | SELECT "Name" FROM table_11792 WHERE "Term expires" = 'december 31, 2020' AND "Appointing Governor" = 'terry branstad' |
What are the different dorm amenity names in alphabetical order? | CREATE TABLE dorm_amenity (amenid number,amenity_name text)CREATE TABLE has_amenity (dormid number,amenid number)CREATE TABLE dorm (dormid number,dorm_name text,student_capacity number,gender text)CREATE TABLE lives_in (stuid number,dormid number,room_number number)CREATE TABLE student (stuid number,lname text,fname te... | SELECT amenity_name FROM dorm_amenity ORDER BY amenity_name |
what's the edo flight with duration being 17 days, 15 hours, 53 minutes, 18 seconds | CREATE TABLE table_14118521_1 (edo_flight VARCHAR,duration VARCHAR) | SELECT edo_flight FROM table_14118521_1 WHERE duration = "17 days, 15 hours, 53 minutes, 18 seconds" |
What school did Conor Jackson attend? | CREATE TABLE table_15058 ("Pick" real,"Player" text,"Team" text,"Position" text,"School" text) | SELECT "School" FROM table_15058 WHERE "Player" = 'conor jackson' |
What was the time for the bout against Amanda Lavoy, which went under 3 rounds? | CREATE TABLE table_40203 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text) | SELECT "Time" FROM table_40203 WHERE "Round" < '3' AND "Opponent" = 'amanda lavoy' |
What are the game modes for the game released in 2007? | CREATE TABLE table_20594 ("Western Title" text,"Chinese Title" text,"Pinyin" text,"Released Date" text,"Genre" text,"Game Modes" text) | SELECT "Game Modes" FROM table_20594 WHERE "Released Date" = '2007' |
Median accept-rate excluding 0 and 100.. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PendingFlags (Id num... | WITH ByUser AS (SELECT OwnerUserId, CAST(COUNT(AcceptedAnswerId) AS FLOAT) / CAST(COUNT(*) AS FLOAT) AS AcceptRate FROM Posts AS p WHERE p.PostTypeId = 1 AND CommunityOwnedDate IS NULL AND EXISTS(SELECT 1 FROM Posts WHERE ParentId = p.Id) GROUP BY OwnerUserId HAVING COUNT(*) >= 4), FirstStep AS (SELECT AcceptRate, ROW_... |
How many papers are written by authors from the institution 'University of Pennsylvania'? | CREATE TABLE authorship (authid number,instid number,paperid number,authorder number)CREATE TABLE inst (instid number,name text,country text)CREATE TABLE papers (paperid number,title text)CREATE TABLE authors (authid number,lname text,fname text) | SELECT COUNT(DISTINCT t1.title) FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "University of Pennsylvania" |
A bar chart about how many songs were released for each format?, and list X in ascending order. | CREATE TABLE artist (artist_name varchar2(50),country varchar2(20),gender varchar2(20),preferred_genre varchar2(50))CREATE TABLE song (song_name varchar2(50),artist_name varchar2(50),country varchar2(20),f_id number(10),genre_is varchar2(20),rating number(10),languages varchar2(20),releasedate Date,resolution number(10... | SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats |
Kevin lucas appears in which seasons? | CREATE TABLE table_12441518_1 (recurring_cast_seasons VARCHAR,character VARCHAR) | SELECT recurring_cast_seasons FROM table_12441518_1 WHERE character = "Kevin Lucas" |
Which Club has a Drawn of 0, and Points of 26? | CREATE TABLE table_8550 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Club" FROM table_8550 WHERE "Drawn" = '0' AND "Points" = '26' |
Name the record for bobcats | CREATE TABLE table_10383 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Record" text) | SELECT "Record" FROM table_10383 WHERE "Home" = 'bobcats' |
The round that had the final, what was the result? | CREATE TABLE table_38322 ("Event" text,"Round" text,"Result" text,"Opponent" text,"Score" text) | SELECT "Result" FROM table_38322 WHERE "Round" = 'final' |
What is the winning total from 1976? | CREATE TABLE table_71915 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real) | SELECT MAX("Total") FROM table_71915 WHERE "Year(s) won" = '1976' |
give me the number of white-russian ethnic background patients who have base type drug prescription. | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.drug_type = "BASE" |
Jon Ericson's 'voting currency' equation. https://hermeneutics.meta.stackexchange.com/questions/132/what-does-a-vote-mean-on-the-biblical-hermeneutics-stack-exchange#comment423_181
It seems to me that (very roughly) if you have reputation > 10*votes you are getting more 'voting currency' from the system than you are... | CREATE TABLE VoteTypes (Id number,Name text)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,LastEditD... | SELECT Id AS "user_link", Reputation, (10 * UpVotes) AS "10 * UpVotesCast", CAST(10 * UpVotes AS FLOAT) / Reputation AS ratio FROM Users WHERE Reputation > 1 ORDER BY ratio DESC LIMIT 200000000 |
What was the average if the game played during 1990-91 is 40 and the points are less than 121.0? | CREATE TABLE table_22049 ("Team" text,"Average" text,"Points" real,"Played" real,"1988-89" text,"1989-90" text,"1990-1991" real) | SELECT "Average" FROM table_22049 WHERE "1990-1991" = '40' AND "Points" < '121.0' |
how many hours have been elapsed since patient 27172 was admitted to the hospital? | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,chart... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', admissions.admittime)) FROM admissions WHERE admissions.subject_id = 27172 AND admissions.dischtime IS NULL |
When 1872-10-10 is the founding date what are the canadian chapters? | CREATE TABLE table_28436909_4 (canadian_chapters VARCHAR,founding_date VARCHAR) | SELECT canadian_chapters FROM table_28436909_4 WHERE founding_date = "1872-10-10" |
Name the stgae with winner of robbie mcewen | CREATE TABLE table_67466 ("Stage" text,"Winner" text,"General classification" text,"Points Classification" text,"Team Classification" text) | SELECT "Stage" FROM table_67466 WHERE "Winner" = 'robbie mcewen' |
How many times did they play the pittsburgh penguins? | CREATE TABLE table_29570 ("Game" real,"March" real,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text,"Points" real,"Decision" text) | SELECT COUNT("March") FROM table_29570 WHERE "Opponent" = 'Pittsburgh Penguins' |
How many Weeks are on september 8, 1980 and Attendances larger than 55,045? Question 4 | CREATE TABLE table_36949 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT COUNT("Week") FROM table_36949 WHERE "Date" = 'september 8, 1980' AND "Attendance" > '55,045' |
Call sign of k33ln-ld, and a Virtual channel of 33.5 is what network? | CREATE TABLE table_name_52 (network VARCHAR,call_sign VARCHAR,virtual_channel VARCHAR) | SELECT network FROM table_name_52 WHERE call_sign = "k33ln-ld" AND virtual_channel = "33.5" |
What is the total number of rounds that had draft pick 97, duncan mccoll? | CREATE TABLE table_name_62 (round VARCHAR,player VARCHAR,pick VARCHAR) | SELECT COUNT(round) FROM table_name_62 WHERE player = "duncan mccoll" AND pick < 97 |
How many tracks are titled M Sukoshi T ku? | CREATE TABLE table_11839306_2 (track VARCHAR,rōmaji_title VARCHAR) | SELECT COUNT(track) FROM table_11839306_2 WHERE rōmaji_title = "Mō Sukoshi Tōku" |
provide the number of patients whose days of hospital stay is greater than 16 and drug name is sw? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.drug = "SW" |
What is the average fleet size for the Shunter type introduced in 1959? | CREATE TABLE table_name_3 (fleet_size INTEGER,type VARCHAR,introduced VARCHAR) | SELECT AVG(fleet_size) FROM table_name_3 WHERE type = "shunter" AND introduced = "1959" |
How many netflow version are there when the vendor and type is enterasys switches? | CREATE TABLE table_17402 ("Vendor and type" text,"Models" text,"NetFlow Version" text,"Implementation" text,"Comments" text) | SELECT COUNT("NetFlow Version") FROM table_17402 WHERE "Vendor and type" = 'Enterasys Switches' |
What conference was the churchill chargers team in? | CREATE TABLE table_16456 ("Team" text,"Location" text,"Joined" real,"Conference" text,"Division" text,"Previous Conference" text) | SELECT "Conference" FROM table_16456 WHERE "Team" = 'Churchill Chargers' |
What is the pennant for 4 may 1943? | CREATE TABLE table_1220125_4 (pennant VARCHAR,laid_down VARCHAR) | SELECT pennant FROM table_1220125_4 WHERE laid_down = "4 May 1943" |
Name the score for indiana | CREATE TABLE table_27723228_12 (score VARCHAR,team VARCHAR) | SELECT score FROM table_27723228_12 WHERE team = "Indiana" |
all the questions with jira in the title and tag. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE ... | SELECT Id AS "post_link", Title, Body, Tags FROM Posts WHERE Tags LIKE '%jira%' OR Title LIKE '%JIRA%' |
Which County has a Size larger than 258, and a Mascot of commodores? | CREATE TABLE table_name_95 (county VARCHAR,size VARCHAR,mascot VARCHAR) | SELECT county FROM table_name_95 WHERE size > 258 AND mascot = "commodores" |
Which Record has an Opponent of milwaukee bucks? | CREATE TABLE table_name_93 (record VARCHAR,opponent VARCHAR) | SELECT record FROM table_name_93 WHERE opponent = "milwaukee bucks" |
what is the name of the trainer of the first place horse ? | CREATE TABLE table_204_13 (id number,"finished" text,"post" number,"horse" text,"jockey" text,"trainer" text,"owner" text,"time / behind" text) | SELECT "trainer" FROM table_204_13 WHERE "finished" = 1 |
Who attended the school in 2008, that Deandria Hill attended in 2005? | CREATE TABLE table_name_15 (Id VARCHAR) | SELECT 2008 FROM table_name_15 WHERE 2005 = "deandria hill" |
who had high rebounds when score is w 111 92 (ot) | CREATE TABLE table_13762472_4 (high_rebounds VARCHAR,score VARCHAR) | SELECT high_rebounds FROM table_13762472_4 WHERE score = "W 111–92 (OT)" |
Which Played is the highest one that has an Against smaller than 18, and Points smaller than 10? | CREATE TABLE table_name_92 (played INTEGER,against VARCHAR,points VARCHAR) | SELECT MAX(played) FROM table_name_92 WHERE against < 18 AND points < 10 |
What was the away team when the venue was Lake Oval? | CREATE TABLE table_58529 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Away team" FROM table_58529 WHERE "Venue" = 'lake oval' |
what are the five most frequent output event during a year before? | CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE admissions (r... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT t1.itemid FROM (SELECT outputevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM outputevents WHERE DATETIME(outputevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY outputevents.itemid) AS... |
Name the Date has a Competition of welsh rugby union challenge trophy and a Result of 34-34? Question 1 | CREATE TABLE table_60771 ("Date" text,"Nationality / Opponent" text,"Ground" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_60771 WHERE "Competition" = 'welsh rugby union challenge trophy' AND "Result" = '34-34' |
What are the distinct move in dates of the residents, and count them by a bar chart, and list by the Y in desc. | CREATE TABLE Organizations (organization_id INTEGER,parent_organization_id INTEGER,organization_details VARCHAR(255))CREATE TABLE Customer_Event_Notes (Customer_Event_Note_ID INTEGER,Customer_Event_ID INTEGER,service_type_code CHAR(15),resident_id INTEGER,property_id INTEGER,date_moved_in DATETIME)CREATE TABLE Customer... | SELECT date_moved_in, COUNT(date_moved_in) FROM Residents ORDER BY COUNT(date_moved_in) DESC |
Segment B of aerospace fuel lines is what netflix episode? | CREATE TABLE table_name_99 (netflix VARCHAR,segment_b VARCHAR) | SELECT netflix FROM table_name_99 WHERE segment_b = "aerospace fuel lines" |
What is the most recent year founded that has a nickname of bruins? | CREATE TABLE table_46241 ("School" text,"Location" text,"Founded" real,"Enrollment" real,"Nickname" text) | SELECT MAX("Founded") FROM table_46241 WHERE "Nickname" = 'bruins' |
what is the year that the position was 1st in paris? | CREATE TABLE table_51760 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text) | SELECT "Year" FROM table_51760 WHERE "Position" = '1st' AND "Venue" = 'paris' |
What is the release date for the Chinese title ? | CREATE TABLE table_40842 ("Western Title" text,"Chinese Title" text,"Pinyin" text,"Released Date" text,"Genre" text,"Game Modes" text) | SELECT "Released Date" FROM table_40842 WHERE "Chinese Title" = '摸摸瓦力欧制造' |
What was the score on March 23? | CREATE TABLE table_name_2 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_2 WHERE date = "march 23" |
The River Hawks belonged to what current conference? | CREATE TABLE table_67252 ("Institution" text,"Location" text,"Nickname" text,"Current Conference" text,"Classification" text) | SELECT "Current Conference" FROM table_67252 WHERE "Nickname" = 'river hawks' |
what was the first id of patient 1457's ward the last year? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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)C... | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1457) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY transfers.intime LIMIT 1 |
what is the number of patients whose days of hospital stay is greater than 16 and procedure long title is continuous intra-arterial blood gas monitoring? | 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 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 ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "16" AND procedures.long_title = "Continuous intra-arterial blood gas monitoring" |
What is the total number of top fives when casey mears had more than 1 poles and top tens less than 9? | CREATE TABLE table_9372 ("Year" text,"Starts" real,"Wins" real,"Top Fives" real,"Top Tens" real,"Poles" real,"Rank" text) | SELECT SUM("Top Fives") FROM table_9372 WHERE "Poles" > '1' AND "Top Tens" < '9' |
What club had a points difference of -24? | CREATE TABLE table_8599 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Points difference" text,"Points" text) | SELECT "Club" FROM table_8599 WHERE "Points difference" = '-24' |
What was the election date for H. Brent Coles? | CREATE TABLE table_18048 ("Incumbent" text,"Reason for Vacancy" text,"Appointed Successor" text,"Date of Appointment" text,"Elected Successor" text,"Date of Election" text) | SELECT "Date of Election" FROM table_18048 WHERE "Appointed Successor" = 'H. Brent Coles' |
Who Eliminated Kane? | CREATE TABLE table_name_63 (eliminated_by VARCHAR,wrestler VARCHAR) | SELECT eliminated_by FROM table_name_63 WHERE wrestler = "kane" |
Show how many courses in 2008 for every instructor with a bar chart, display Y-axis from high to low order. | CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar(4))CREATE TABLE instructor (ID varchar(5),name varchar(20),dept_name varchar(20),salary numeric(8,2))CREATE TABLE time_slot (time_slot_id varchar(4),day var... | SELECT name, COUNT(name) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY name ORDER BY COUNT(name) DESC |
In the Fall can I take SOC 370 ? | CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE program_course (program_id int,course_id int,workload int,category varch... | SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN... |
what is the years for the displacement 4.0l (242cid)? | CREATE TABLE table_name_35 (years VARCHAR,displacement VARCHAR) | SELECT years FROM table_name_35 WHERE displacement = "4.0l (242cid)" |
had patient 016-27397 had any chest tube output: mediastinal l anterior output during this hospital encounter? | 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 intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397' AND patient.hospitaldischargetime IS NULL)) AND intakeoutpu... |
what is the minimum number of yearly diagnosed cases of abdom aortic aneurysm? | CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE prescriptions (r... | SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'abdom aortic aneurysm') GROUP BY STRFTIME('%y', diagnoses_icd.charttime)) AS t1 |
what year was the film polio water released ? | CREATE TABLE table_200_1 (id number,"year" number,"title" text,"role" text,"notes" text) | SELECT "year" FROM table_200_1 WHERE "title" = 'polio water' |
Selecting closed opinion-based questions on SO. | CREATE TABLE ReviewTaskTypes (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 PostNoticeTypes (Id number,ClassId number,Name text,Body text,I... | SELECT p.Id AS "post_link", p.Score FROM Posts AS p INNER JOIN PostHistory AS ph ON ph.PostId = p.Id INNER JOIN CloseReasonTypes AS crt ON crt.Id = CAST(ph.Comment AS INT) INNER JOIN PostTags ON PostTags.PostId = p.Id INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName IN ('elm') AND ph.PostHistoryTypeId = 1... |
Find the number of students who is older than 20 in each dorm. | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE has_amenity (dormid number,amenid number)CREATE TABLE dorm (dormid number,dorm_name text,student_capacity number,gender text)CREATE TABLE lives_in (stuid number,dormid number,room_number ... | SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name |
What nationality has a year larger than 2009 with a position of power forward? | CREATE TABLE table_33519 ("Year" real,"Player" text,"Nationality" text,"Position" text,"Team" text) | SELECT "Nationality" FROM table_33519 WHERE "Year" > '2009' AND "Position" = 'power forward' |
How large was the crowd at Carlton's home game? | CREATE TABLE table_name_10 (crowd VARCHAR,home_team VARCHAR) | SELECT COUNT(crowd) FROM table_name_10 WHERE home_team = "carlton" |
Who was the winner in the competition in which the runner-up was Rosenborg? | CREATE TABLE table_52278 ("Years" text,"Winners" text,"Runners-Up" text,"Score" text,"Third" text) | SELECT "Winners" FROM table_52278 WHERE "Runners-Up" = 'rosenborg' |
For each aircraft that has won an award, what is its name and how many time has it won Plot them as bar chart, show in desc by the X-axis please. | CREATE TABLE airport (Airport_ID int,Airport_Name text,Total_Passengers real,%_Change_2007 text,International_Passengers real,Domestic_Passengers real,Transit_Passengers real,Aircraft_Movements real,Freight_Metric_Tonnes real)CREATE TABLE aircraft (Aircraft_ID int(11),Aircraft varchar(50),Description varchar(50),Max_Gr... | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY Aircraft DESC |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.