instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
A bar chart about how films are produced by each studio?, and show by the x-axis from low to high. | CREATE TABLE market (Market_ID int,Country text,Number_cities int)CREATE TABLE film (Film_ID int,Title text,Studio text,Director text,Gross_in_dollar int)CREATE TABLE film_market_estimation (Estimation_ID int,Low_Estimate real,High_Estimate real,Film_ID int,Type text,Market_ID int,Year int) | SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio |
What is the sum of the bronze medals when there were more than 2 silver medals and a rank larger than 6? | CREATE TABLE table_name_89 (bronze INTEGER,silver VARCHAR,rank VARCHAR) | SELECT SUM(bronze) FROM table_name_89 WHERE silver > 2 AND rank > 6 |
What is the distance for the train nameno is hapa sup express /12997? | CREATE TABLE table_3636 ("No" real,"Origin City (Country)" text,"Destination City (Country)" text,"Train Name No" text,"Operator Name" text,"Distance" text,"No. of Stops" text,"Frequency" text,"Scheduled running time" text) | SELECT "Distance" FROM table_3636 WHERE "Train Name No" = 'Hapa sup Express /12997' |
What districts of Bihar have a sex ratio in 1991 of 864? | CREATE TABLE table_23097 ("Districts of Bihar" text,"Total Population 2001" real,"Male Population 2001" real,"Female Population 2001" real,"Growth Rate 1981-91" text,"Growth Rate 1991-01" text,"Sex Ratio \u2021 1991" real,"Sex Ratio \u2021 2001" real,"Population density \u2020 1991" real,"Population density \u2020 2001... | SELECT "Districts of Bihar" FROM table_23097 WHERE "Sex Ratio \u2021 1991" = '864' |
What is Term Start, when Born-Died is Prime Ministers 1939 - 1943? | CREATE TABLE table_46081 ("Name" text,"Born-Died" text,"Term start" text,"Term end" text,"Political Party" text) | SELECT "Term start" FROM table_46081 WHERE "Born-Died" = 'prime ministers 1939 - 1943' |
What story title was included in Issue #8? | CREATE TABLE table_name_47 (story VARCHAR,issue VARCHAR) | SELECT story FROM table_name_47 WHERE issue = "#8" |
how many patients are procedured with icd9 code 5771 and suggested with additive drug type? | 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,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5771" AND prescriptions.drug_type = "ADDITIVE" |
What stadium is in the city of Debrecen? | CREATE TABLE table_name_81 (stadium VARCHAR,city VARCHAR) | SELECT stadium FROM table_name_81 WHERE city = "debrecen" |
(A) Torzija was nominated in which category? | CREATE TABLE table_15382 ("Category" text,"Film" text,"Director(s)" text,"Country" text,"Nominating Festival" text) | SELECT "Category" FROM table_15382 WHERE "Film" = '(a) torzija' |
Questions eligible for APL bounty by Bubbler. | CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,Accepte... | SELECT Q.Id AS "post_link", Q.Score, Q.AnswerCount FROM Posts AS Q WHERE Q.AnswerCount = 1 ORDER BY Q.Score DESC |
What was date of the bye week 11? | CREATE TABLE table_32416 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Date" FROM table_32416 WHERE "Attendance" = 'bye' AND "Week" = '11' |
What is the record for the game against team @ Minnesota? | CREATE TABLE table_27713583_2 (record VARCHAR,team VARCHAR) | SELECT record FROM table_27713583_2 WHERE team = "@ Minnesota" |
give me the number of patients whose drug route is id? | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "ID" |
Name the partner for opponents of franti ek erm k michal merti k | CREATE TABLE table_name_46 (partner VARCHAR,opponents_in_the_final VARCHAR) | SELECT partner FROM table_name_46 WHERE opponents_in_the_final = "františek čermák michal mertiňák" |
what is the category that has the people's choice awards? | CREATE TABLE table_name_38 (category VARCHAR,award VARCHAR) | SELECT category FROM table_name_38 WHERE award = "people's choice awards" |
What is the Japanese orthography for the abbreviation of ndmc? | CREATE TABLE table_52947 ("English Name" text,"Japanese orthography" text,"Pronouciation" text,"abbreviation" text,"Provider(national government)" text,"Foundation" real) | SELECT "Japanese orthography" FROM table_52947 WHERE "abbreviation" = 'ndmc' |
What is the Tie no when Chester is the away team? | CREATE TABLE table_name_83 (tie_no VARCHAR,away_team VARCHAR) | SELECT tie_no FROM table_name_83 WHERE away_team = "chester" |
Which class has a frequency of 91.9 fm? | CREATE TABLE table_name_31 (class VARCHAR,frequency VARCHAR) | SELECT class FROM table_name_31 WHERE frequency = "91.9 fm" |
What year were the Grizzlies in Providence? | CREATE TABLE table_8682 ("Player" text,"Nationality" text,"Position" text,"Years for Grizzlies" text,"School/Club Team" text) | SELECT "Years for Grizzlies" FROM table_8682 WHERE "School/Club Team" = 'providence' |
What is the week 13 Nov 30 standing with USC (7-3) on week 11 Nov 16? | CREATE TABLE table_59922 ("Week 8 Oct 26" text,"Week 10 Nov 9" text,"Week 11 Nov 16" text,"Week 12 Nov 23" text,"Week 13 Nov 30" text,"Week 14 (Final) Dec 7" text) | SELECT "Week 13 Nov 30" FROM table_59922 WHERE "Week 11 Nov 16" = 'usc (7-3)' |
How many storms occured in each region. Visualize by bar chart. | CREATE TABLE affected_region (Region_id int,Storm_ID int,Number_city_affected real)CREATE TABLE region (Region_id int,Region_code text,Region_name text)CREATE TABLE storm (Storm_ID int,Name text,Dates_active text,Max_speed int,Damage_millions_USD real,Number_Deaths int) | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id |
provide the number of patients whose discharge location is disch-tran to psych hosp and procedure short title is conduit left ventr-aorta? | 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 demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Conduit left ventr-aorta" |
When the standard torque (lb/ft) is 11.53 how much does more is the modified hp? | CREATE TABLE table_23168 ("RPM" real,"Standard HP" text,"Standard torque (lb/ft)" text,"Standard speed (6th gear)" text,"Modified speed (6th gear)" real,"Modified HP" text,"Modified torque (lb/ft)" text) | SELECT "Modified HP" FROM table_23168 WHERE "Standard torque (lb/ft)" = '11.53' |
TOP 10 USERS FOR COUNTRY. | CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance t... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE LOWER('%##CountryName##%') ORDER BY Reputation DESC LIMIT 10 |
For those records from the products and each product's manufacturer, show me about the distribution of name and the sum of code , and group by attribute name in a bar chart, and sort y-axis in desc order. | 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 ORDER BY T1.Code DESC |
What is the total of all to par with player Bob Rosburg? | CREATE TABLE table_name_65 (to_par INTEGER,player VARCHAR) | SELECT SUM(to_par) FROM table_name_65 WHERE player = "bob rosburg" |
how much is the yearly maximum value of rdw for patient 4758 since 2105? | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_... | SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4758) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND STRFTIME('%y', labevents.charttime) >= '2105' GROUP BY STRFTIME('%... |
Show the themes of parties and the names of the party hosts. | CREATE TABLE HOST (Name VARCHAR,Host_ID VARCHAR)CREATE TABLE party_host (Host_ID VARCHAR,Party_ID VARCHAR)CREATE TABLE party (Party_Theme VARCHAR,Party_ID VARCHAR) | SELECT T3.Party_Theme, T2.Name FROM party_host AS T1 JOIN HOST AS T2 ON T1.Host_ID = T2.Host_ID JOIN party AS T3 ON T1.Party_ID = T3.Party_ID |
I want a bar chart to show the frequency of the dates that have the 5 highest cloud cover rates each year, display how many date in asc order please. | CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_... | SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) |
Which Date has a Score of 0 3, and a Set 2 of 16 25? | CREATE TABLE table_name_49 (date VARCHAR,score VARCHAR,set_2 VARCHAR) | SELECT date FROM table_name_49 WHERE score = "0–3" AND set_2 = "16–25" |
what was the date of the last episode that was broadcast ? | CREATE TABLE table_204_958 (id number,"episode" number,"original broadcast date" text,"average" number,"rank" number,"remarks" text) | SELECT "original broadcast date" FROM table_204_958 ORDER BY "episode" DESC LIMIT 1 |
What position did the #94 pick play? | CREATE TABLE table_74352 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text) | SELECT "Position" FROM table_74352 WHERE "Pick #" = '94' |
How many stolen ends against where there when Thomas Dufour was skip? | CREATE TABLE table_20957 ("Country" text,"Skip" text,"W" real,"L" real,"PF" real,"PA" real,"Ends Won" real,"Ends Lost" real,"Blank Ends F/A" text,"Stolen Ends For" real,"Stolen Ends Against" real,"Shot %" real) | SELECT "Stolen Ends Against" FROM table_20957 WHERE "Skip" = 'Thomas Dufour' |
Who were the candidates when gregory w. meeks was the incumbent | CREATE TABLE table_673 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Candidates" FROM table_673 WHERE "Incumbent" = 'Gregory W. Meeks' |
What is the highest attendance for the game after week 1 against the New York Jets? | CREATE TABLE table_name_87 (attendance INTEGER,week VARCHAR,opponent VARCHAR) | SELECT MAX(attendance) FROM table_name_87 WHERE week > 1 AND opponent = "new york jets" |
Which details of journey had simon hoggart as a narrator? | CREATE TABLE table_37798 ("Episode No." real,"Episode Title" text,"UK Broadcast Date" text,"Narrator" text,"Writer" text,"Details of Journey" text,"Countries Visited" text) | SELECT "Details of Journey" FROM table_37798 WHERE "Narrator" = 'simon hoggart' |
Which 3 players won the most player awards? List their full name and id. | CREATE TABLE player (name_first VARCHAR,name_last VARCHAR,player_id VARCHAR)CREATE TABLE player_award (player_id VARCHAR) | SELECT T1.name_first, T1.name_last, T1.player_id FROM player AS T1 JOIN player_award AS T2 ON T1.player_id = T2.player_id GROUP BY T1.player_id ORDER BY COUNT(*) DESC LIMIT 3 |
For which season is Tim Mikkelson player of the year? | CREATE TABLE table_13335 ("Season" text,"Rounds" real,"Champion" text,"Most tries" text,"Player of the Year" text) | SELECT "Season" FROM table_13335 WHERE "Player of the Year" = 'tim mikkelson' |
java tag question with at least one answer. | CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat... | SELECT COUNT(Title) FROM Posts WHERE Tags LIKE '%java%' AND NOT Tags LIKE '%javascript%' AND AnswerCount > 0 AND LOWER(Title) LIKE '%?' AND LOWER(Title) LIKE '%how%' |
What is the date of the game with 40,005 in attendance? | CREATE TABLE table_36150 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Record" text,"Game Site" text,"Attendance" text) | SELECT "Date" FROM table_36150 WHERE "Attendance" = '40,005' |
count the number of living patients who underwent endoscopic sphincterotomy and papillotomy. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id 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... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Endoscopic sphincterotomy and papillotomy" |
how many male patients had 102 as their procedure icd9 code? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "102" |
What Globalizing Consumer Cultures classes have no prerequisites ? | 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 int,respected int,participation int,heavy_reading int,tough_grade... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Globalizing Consumer Cultures%' OR course.description LIKE '%Globalizing Consumer Cultures%' OR course.name LIKE '%Globalizing Consumer Cultures%') AND course.enforced_r... |
What is the total number of years that has a chassis of Ferrari 625 and 2 points? | CREATE TABLE table_name_24 (year VARCHAR,chassis VARCHAR,points VARCHAR) | SELECT COUNT(year) FROM table_name_24 WHERE chassis = "ferrari 625" AND points = "2" |
The rep for the owner, commenter and replier. http://meta.stackexchange.com/questions/228620/querying-for-reputation-of-the-commenter-and-its-addressee-using-sede/234278#234278 | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE FlagTypes (Id... | SELECT c.Id, PostId, 'text', STR_POSITION('text', '@') AS at1, STR_POSITION('text', ' ', STR_POSITION('text', '@')) AS at1Token, SUBSTRING('text', STR_POSITION('text', '@') + 1, STR_POSITION('text', ' ', STR_POSITION('text', '@')) - (STR_POSITION('text', '@') + 1)) AS atreply, u.Id, u.DisplayName, owner.Id, owner.Displ... |
suggested edits with most rejection reasons. | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId... | SELECT rt.SuggestedEditId AS "suggested_edit_link", COUNT(DISTINCT rr.RejectionReasonId) AS n FROM ReviewTasks AS rt INNER JOIN ReviewTaskResults AS rr ON rr.ReviewTaskId = rt.Id WHERE rt.ReviewTaskTypeId = 1 GROUP BY rt.SuggestedEditId ORDER BY COUNT(DISTINCT rr.RejectionReasonId) DESC LIMIT 200 |
What is the minimum 2010 GDP if the 2009 GDP is larger than 3,749, 1995 GDP is 876 and 2008 GDP is larger than 4,885? | CREATE TABLE table_52808 ("Year" text,"2010" real,"2009" real,"2008" real,"2005" real,"2000" real,"1995" real,"1990" real,"1985" real) | SELECT MIN("2010") FROM table_52808 WHERE "2009" > '3,749' AND "1995" = '876' AND "2008" > '4,885' |
when was patient 1114 prescribed a medication via oral route the first time in 12/this year? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1114) AND prescriptions.route = 'oral' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m'... |
What is the lowest gold that has a silver less than 2, Zimbabwe as the nation, and a bronze less than 1? | CREATE TABLE table_14121 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT MIN("Gold") FROM table_14121 WHERE "Silver" < '2' AND "Nation" = 'zimbabwe' AND "Bronze" < '1' |
What is the line of Mangalore station? | CREATE TABLE table_name_54 (line VARCHAR,name VARCHAR) | SELECT line FROM table_name_54 WHERE name = "mangalore" |
What day did the race in 1974 take place on? | CREATE TABLE table_1963459_2 (date VARCHAR,year VARCHAR) | SELECT date FROM table_1963459_2 WHERE year = 1974 |
what is the circuit when the date is 16 april? | CREATE TABLE table_45416 ("Race Title" text,"Circuit" text,"City / State" text,"Date" text,"Winner" text,"Team" text) | SELECT "Circuit" FROM table_45416 WHERE "Date" = '16 april' |
What driver had the highest grid position with a time of +0.283? | CREATE TABLE table_76930 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real) | SELECT MAX("Grid") FROM table_76930 WHERE "Time" = '+0.283' |
what is the one thing patient 86792 was diagnosed with on the last hospital visit for the last time? | CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)C... | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86792 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime D... |
Which Rank has a Silver larger than 1 and a Total larger than 13? | CREATE TABLE table_38433 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT "Rank" FROM table_38433 WHERE "Silver" > '1' AND "Total" > '13' |
What was the value in 2011 for United States? | CREATE TABLE table_34209 ("Rank" text,"Country" text,"2009" text,"2010" text,"2011" text) | SELECT "2011" FROM table_34209 WHERE "Country" = 'united states' |
What place is S.K. Ho in? | CREATE TABLE table_62492 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Place" FROM table_62492 WHERE "Player" = 's.k. ho' |
Who won women's singles in 1985? | CREATE TABLE table_6955 ("Year" real,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Women's singles" FROM table_6955 WHERE "Year" = '1985' |
Who won the Women's doubles in the year that Billy Gilliland Karen Puttick won the Mixed doubles? | CREATE TABLE table_80382 ("Year" text,"Men's singles" text,"Women's singles" text,"Men's doubles" text,"Women's doubles" text,"Mixed doubles" text) | SELECT "Women's doubles" FROM table_80382 WHERE "Mixed doubles" = 'billy gilliland karen puttick' |
What is the result for district pennsylvania 6? | CREATE TABLE table_28856 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text,"Candidates" text) | SELECT "Result" FROM table_28856 WHERE "District" = 'Pennsylvania 6' |
What was the record in the game in which Jeff Green (14) did the most high rebounds? | CREATE TABLE table_23286112_6 (record VARCHAR,high_rebounds VARCHAR) | SELECT record FROM table_23286112_6 WHERE high_rebounds = "Jeff Green (14)" |
What is the most recent year with a position of 3rd? | CREATE TABLE table_name_68 (year INTEGER,position VARCHAR) | SELECT MAX(year) FROM table_name_68 WHERE position = "3rd" |
What is the high score for the player with 0 stumps, 4 catches, more than 14 inns and an average smaller than 56.1? | CREATE TABLE table_name_52 (high_score INTEGER,inns VARCHAR,average VARCHAR,stump VARCHAR,catches VARCHAR) | SELECT SUM(high_score) FROM table_name_52 WHERE stump = 0 AND catches = 4 AND average < 56.1 AND inns > 14 |
what is diagnoses icd9 code and procedure short title of subject id 23602? | 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 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 tex... | SELECT diagnoses.icd9_code, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "23602" |
Count the number of patients admitted before 2124 categorized under chemistry lab tests. | 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2124" AND lab."CATEGORY" = "Chemistry" |
which patients have lab test item id 51457? | 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 diagnoses (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,marital... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51457" |
Which Country has a To par smaller than 7, and a Place of 1? | CREATE TABLE table_name_99 (country VARCHAR,to_par VARCHAR,place VARCHAR) | SELECT country FROM table_name_99 WHERE to_par < 7 AND place = "1" |
What position is Philadelphia Fury? | CREATE TABLE table_237757_9 (position VARCHAR,nasl_club_s_ VARCHAR) | SELECT position FROM table_237757_9 WHERE nasl_club_s_ = "Philadelphia Fury" |
What Season had Dundee United as a Winner? | CREATE TABLE table_name_87 (season VARCHAR,winners VARCHAR) | SELECT season FROM table_name_87 WHERE winners = "dundee united" |
What is Date, when Points is 13, and when Location is RBC Center? | CREATE TABLE table_8735 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Attendance" real,"Record" text,"Points" real) | SELECT "Date" FROM table_8735 WHERE "Points" = '13' AND "Location" = 'rbc center' |
we will limit the bmi to < 40 kg / m2 because of weight limits of the scanner bed and width limits of the mri. | CREATE TABLE table_train_75 ("id" int,"pregnancy_or_lactation" bool,"alzheimer" bool,"alzheimer_family_history" bool,"body_mass_index_bmi" float,"age" float,"NOUSE" float) | SELECT * FROM table_train_75 WHERE body_mass_index_bmi < 40 |
what was the number of attendees for the september 19 game ? | CREATE TABLE table_204_180 (id number,"date" text,"opponent#" text,"rank#" text,"site" text,"result" text,"attendance" number) | SELECT "attendance" FROM table_204_180 WHERE "date" = 'september 19' |
Find the name of customers who do not have an saving account. | CREATE TABLE customer (cust_name VARCHAR,acc_type VARCHAR) | SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' |
A bar chart for what are the number of the names of the technicians by ascending order of age? | CREATE TABLE machine (Machine_ID int,Making_Year int,Class text,Team text,Machine_series text,value_points real,quality_rank int)CREATE TABLE technician (technician_id real,Name text,Team text,Starting_Year real,Age int)CREATE TABLE repair_assignment (technician_id int,repair_ID int,Machine_ID int)CREATE TABLE repair (... | SELECT Name, COUNT(Name) FROM technician GROUP BY Name ORDER BY Age |
How many parties of the time they took office, binning the took office into WEEKDAY interval | CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE member (Member_ID int,Member_Name text,Party_ID text,In_office text)CREATE TABLE party_events (E... | SELECT Took_office, COUNT(Took_office) FROM party |
calculate the total number of unmarried male patients. | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.gender = "M" |
how long is the last stay of patient 16992 in the icu? | 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 number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE transfers (row_id nu... | SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16992) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1 |
How many seasons for Monaco? | CREATE TABLE table_19487922_1 (seasons VARCHAR,country VARCHAR) | SELECT seasons FROM table_19487922_1 WHERE country = "Monaco" |
count the number of patients who have received a destruct peritoneal tiss procedure within the same month after having received a insert endotracheal tube in 2101. | 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 patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,ic... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'insert endo... |
Which season has Caps lower than 36 for the Club of NAC Breda? | CREATE TABLE table_name_35 (season VARCHAR,caps VARCHAR,club VARCHAR) | SELECT season FROM table_name_35 WHERE caps < 36 AND club = "nac breda" |
What is the earliest year for 9 points? | CREATE TABLE table_57858 ("Year" real,"Chassis" text,"Engine" text,"Tyres" text,"Points" real) | SELECT MIN("Year") FROM table_57858 WHERE "Points" = '9' |
Which Manufacturer has a Time of accident and a Grid greater than 15? | CREATE TABLE table_76513 ("Rider" text,"Manufacturer" text,"Laps" real,"Time" text,"Grid" real) | SELECT "Manufacturer" FROM table_76513 WHERE "Time" = 'accident' AND "Grid" > '15' |
Show all ages and corresponding number of students. Show the correlation. | CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy 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)) | SELECT Age, COUNT(*) FROM Student GROUP BY Age |
What date was the Competition of rothmans cup? | CREATE TABLE table_32231 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_32231 WHERE "Competition" = 'rothmans cup' |
What's the greek designation of the city riverside? | CREATE TABLE table_60720 ("Greek Designation" text,"Collegiate Institution" text,"Charter Date" text,"Status" text,"City" text,"U.S. State/District" text) | SELECT "Greek Designation" FROM table_60720 WHERE "City" = 'riverside' |
How many rounds had a position of kicker? | CREATE TABLE table_47331 ("Round" real,"Pick" real,"Player" text,"Position" text,"School" text) | SELECT SUM("Round") FROM table_47331 WHERE "Position" = 'kicker' |
What is the car make for Sterling Marlin? | CREATE TABLE table_29582 ("Pos" real,"SP" real,"No." real,"Driver" text,"Car Name" text,"Car Make" text,"Entrant" text,"Laps" real,"Status" text) | SELECT "Car Make" FROM table_29582 WHERE "Driver" = 'Sterling Marlin' |
Who was featured in 20 questions on 4-03? | CREATE TABLE table_1566852_4 (date VARCHAR) | SELECT 20 AS _questions FROM table_1566852_4 WHERE date = "4-03" |
With a North Melbourne away team, what is the average crowd? | CREATE TABLE table_name_35 (crowd INTEGER,away_team VARCHAR) | SELECT AVG(crowd) FROM table_name_35 WHERE away_team = "north melbourne" |
Show the official names of the cities that have hosted more than one competition. | CREATE TABLE farm_competition (Host_city_ID VARCHAR)CREATE TABLE city (Official_Name VARCHAR,City_ID VARCHAR) | SELECT T1.Official_Name FROM city AS T1 JOIN farm_competition AS T2 ON T1.City_ID = T2.Host_city_ID GROUP BY T2.Host_city_ID HAVING COUNT(*) > 1 |
What was the loss of the game with a record of 84-71? | CREATE TABLE table_68521 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Loss" FROM table_68521 WHERE "Record" = '84-71' |
What is the Term in office with an Order that is 9? | CREATE TABLE table_name_21 (term_in_office VARCHAR,order VARCHAR) | SELECT term_in_office FROM table_name_21 WHERE order = "9" |
what is the average cost to the hospital which involves stricture of artery until 2104. | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE icustays (row_id number,subject_id n... | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'stricture of artery')) AND STRFTIME('%y', cost.chargetime) <= '... |
Who was the visiting team when the record was 51 12 4? | CREATE TABLE table_6086 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Visitor" FROM table_6086 WHERE "Record" = '51–12–4' |
Who directed the episode with a title of ' old friend '? | CREATE TABLE table_3431 ("Series #" real,"Season #" real,"Title" text,"Director" text,"Writer(s)" text,"Airdate" text) | SELECT "Director" FROM table_3431 WHERE "Title" = ' Old Friend ' |
count the number of times patient 3369 was given a other skin & subq i & d in the first hospital encounter. | 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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id numb... | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'other skin & subq i & d') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 3369 AND NOT admissions.dis... |
All badges by day-of-week (2011). | 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 Name, CASE Class WHEN 1 THEN '1-Gold' WHEN 2 THEN '2-Silver' WHEN 3 THEN '3-Bronze' END AS Class, TagBased, COUNT(Id) AS BadgeTotal FROM Badges WHERE YEAR(Date) = 2011 GROUP BY Name, Class, TagBased |
For those records from the products and each product's manufacturer, give me the comparison about the amount of headquarter over the headquarter , and group by attribute headquarter, and could you order in descending by the Y please? | 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 Headquarter, COUNT(Headquarter) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY COUNT(Headquarter) DESC |
how many days have it been since the first stay of patient 002-34744 on this hospital visit in the ward 83? | CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicm... | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '002-34744' AND patient.wardid = 83 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1 |
Which Floors have a Pinnacle height ft (m) of 1,136 (346), and a Pinn Rank larger than 4? | CREATE TABLE table_name_9 (floors INTEGER,pinnacle_height_ft__m_ VARCHAR,pinn_rank VARCHAR) | SELECT AVG(floors) FROM table_name_9 WHERE pinnacle_height_ft__m_ = "1,136 (346)" AND pinn_rank > 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.