instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
What was the result of the game with 9 goals?
CREATE TABLE table_name_49 (result VARCHAR,goal VARCHAR)
SELECT result FROM table_name_49 WHERE goal = 9
Which Set 1 has a Set 2 of 26 24?
CREATE TABLE table_37916 ("Date" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text)
SELECT "Set 1" FROM table_37916 WHERE "Set 2" = '26–24'
When saif saaeed shaheen ( qat ) is the saif saaeed shaheen ( qat ) what is the date on September 3rd, 2004?
CREATE TABLE table_23988726_2 (Id VARCHAR)
SELECT 3 AS _september_2004 FROM table_23988726_2 WHERE "saif_saaeed_shaheen___qat__" = "saif_saaeed_shaheen___qat__"
when did the last laboratory test of patient 97395 take place since 07/2105?
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 prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text...
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97395) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-07' ORDER BY labevents.charttime DESC LIMIT 1
Show the number of documents created in each day and bin document date by year interval and group by document type description with a group line chart, I want to rank x axis in descending order.
CREATE TABLE Documents (Document_ID INTEGER,Document_Type_Code CHAR(15),Project_ID INTEGER,Document_Date DATETIME,Document_Name VARCHAR(255),Document_Description VARCHAR(255),Other_Details VARCHAR(255))CREATE TABLE Ref_Budget_Codes (Budget_Type_Code CHAR(15),Budget_Type_Description VARCHAR(255))CREATE TABLE Statements ...
SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Description ORDER BY Document_Date DESC
who were the 6 teams to play in the first leg of the 2011 caf u-23 championship qualification ?
CREATE TABLE table_204_324 (id number,"team 1" text,"agg." text,"team 2" text,"1st leg" text,"2nd leg" text)
SELECT "team 1", "team 2" FROM table_204_324 WHERE NOT "1st leg" IS NULL
On what date was the race course from Rome to Naples?
CREATE TABLE table_70817 ("Date" text,"Course" text,"Distance" text,"Type" text,"Winner" text,"Race Leader" text)
SELECT "Date" FROM table_70817 WHERE "Course" = 'rome to naples'
What was Olazabal's winning score in the German Masters?
CREATE TABLE table_name_62 (winning_score VARCHAR,tournament VARCHAR)
SELECT winning_score FROM table_name_62 WHERE tournament = "german masters"
who is at least 25 years or older ?
CREATE TABLE table_203_116 (id number,"no." number,"player" text,"birth date" text,"weight" number,"height" number,"position" text,"current club" text)
SELECT "player" FROM table_203_116 WHERE "birth date" >= 25
What is the lowest Total Medals that has madison independent and Bronze Medals larger than 0
CREATE TABLE table_66926 ("Ensemble" text,"Gold Medals" real,"Silver Medals" real,"Bronze Medals" real,"Total Medals" real)
SELECT MIN("Total Medals") FROM table_66926 WHERE "Ensemble" = 'madison independent' AND "Bronze Medals" > '0'
Which Yards has a Attempts of 247
CREATE TABLE table_name_74 (yards VARCHAR,attempts VARCHAR)
SELECT yards FROM table_name_74 WHERE attempts = "247"
What is the Losses at the western conference and the 2004 05 season?
CREATE TABLE table_40424 ("Season" text,"Conference" text,"Division" text,"Finish" text,"Wins" text,"Losses" text)
SELECT "Losses" FROM table_40424 WHERE "Conference" = 'western' AND "Season" = '2004–05'
how many have won at least 2 gold medals ?
CREATE TABLE table_203_308 (id number,"athlete" text,"nation" text,"olympics" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT COUNT(*) FROM table_203_308 WHERE "gold" >= 2
tell me the total dose of d5w (excel bag) that patient 97330 was prescribed in this hospital encounter?
CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,insurance text,language text,marital_status text,ethnicity text,age number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,...
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97330 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'd5w (excel bag)'
what was the organism found in patient 031-24513's first urine, voided specimen microbiology test in 03/last year?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,obs...
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-24513')) AND microlab.culturesite = 'urine, voided specimen' AND DATE...
How many losses did the golden rivers of ultima have when wins were less than 12 and byes larger than 2?
CREATE TABLE table_name_43 (losses VARCHAR,byes VARCHAR,wins VARCHAR,golden_rivers VARCHAR)
SELECT COUNT(losses) FROM table_name_43 WHERE wins < 12 AND golden_rivers = "ultima" AND byes > 2
What tonnage was built in 2007?
CREATE TABLE table_name_75 (tonnage VARCHAR,built VARCHAR)
SELECT tonnage FROM table_name_75 WHERE built = 2007
Name the score for 26 may 1997
CREATE TABLE table_name_4 (score VARCHAR,date VARCHAR)
SELECT score FROM table_name_4 WHERE date = "26 may 1997"
How many total show when silver is 0, bronze is 1, and the rank is less than 3?
CREATE TABLE table_75065 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT COUNT("Total") FROM table_75065 WHERE "Silver" = '0' AND "Bronze" = '1' AND "Rank" < '3'
I want the Grand Final Date for season 1988
CREATE TABLE table_name_40 (grand_finaldate VARCHAR,season VARCHAR)
SELECT grand_finaldate FROM table_name_40 WHERE season = 1988
Which Tournament is in 1993 with a Score in the final of 6 2, 2 6, 7 5?
CREATE TABLE table_6739 ("Date" real,"Tournament" text,"Surface" text,"Partner" text,"Opponent in the final" text,"Score in the final" text)
SELECT "Tournament" FROM table_6739 WHERE "Date" = '1993' AND "Score in the final" = '6–2, 2–6, 7–5'
Which Ofsted has a School of marple hall school, and a Capacity larger than 1711?
CREATE TABLE table_name_63 (ofsted INTEGER,school VARCHAR,capacity VARCHAR)
SELECT MIN(ofsted) FROM table_name_63 WHERE school = "marple hall school" AND capacity > 1711
how many patients have received a blood culture (post-mortem) microbiological test?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE pres...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood culture (post-mortem)')
What is the average # Of National Votes, when the Election is before 1992, when the % Of Prefectural Vote is 39.5%, when Leader is Takeo Fukuda, and when # Of Seats Won is greater than 63?
CREATE TABLE table_48592 ("Election" real,"Leader" text,"# of seats won" real,"# of National votes" real,"% of National vote" text,"# of Prefectural votes" real,"% of Prefectural vote" text)
SELECT AVG("# of National votes") FROM table_48592 WHERE "Election" < '1992' AND "% of Prefectural vote" = '39.5%' AND "Leader" = 'takeo fukuda' AND "# of seats won" > '63'
Add up all the Ends columns that have goals smaller than 0.
CREATE TABLE table_name_65 (ends INTEGER,goals INTEGER)
SELECT SUM(ends) FROM table_name_65 WHERE goals < 0
All posts of a given type.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,R...
SELECT * FROM Posts WHERE PostTypeId = '##type##' ORDER BY Id
what is the name of the place listed before deer park ?
CREATE TABLE table_204_279 (id number,"name of place" text,"number\nof\ncounties" number,"principal\ncounty" text,"zip code\nlower" number,"zip code\nupper" number)
SELECT "name of place" FROM table_204_279 WHERE id = (SELECT id FROM table_204_279 WHERE "name of place" = 'deer park') - 1
What is the name of the winner on 18 may?
CREATE TABLE table_57197 ("Date" text,"Course" text,"Distance" text,"Type" text,"Winner" text)
SELECT "Winner" FROM table_57197 WHERE "Date" = '18 may'
what is the total amount of tries where the points were 325?
CREATE TABLE table_18835 ("Club" text,"Played" text,"Won" 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 COUNT("Tries against") FROM table_18835 WHERE "Points for" = '325'
what is minimum days of hospital stay of patients whose year of birth is greater than 2064?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id 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,marita...
SELECT MIN(demographic.days_stay) FROM demographic WHERE demographic.dob_year > "2064"
How many Points have a Rank of 17th, and Wins larger than 0?
CREATE TABLE table_name_29 (points VARCHAR,rank VARCHAR,wins VARCHAR)
SELECT COUNT(points) FROM table_name_29 WHERE rank = "17th" AND wins > 0
get me the number of patients less than 62 years who have prescription for clobetasol propionate 0.05% ointment.
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 procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "62" AND prescriptions.drug = "Clobetasol Propionate 0.05% Ointment"
How many States have an Indian population of 30947?
CREATE TABLE table_15934 ("State/Territory" text,"Asian American Population (2010 Census)" real,"Chinese" real,"Filipino" real,"Indian" real,"Japanese" real,"Korean" real,"Vietnamese" real,"Other Asian" real)
SELECT COUNT("Filipino") FROM table_15934 WHERE "Indian" = '30947'
How old is the average person for each job Show bar chart, sort by the X in ascending.
CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job
Do all of the upper-level classes have 17 credits ?
CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i...
SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 17 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id
The plural word of following lines or pages has what plural abbreviation?
CREATE TABLE table_name_21 (plural_abbreviation VARCHAR,plural_word VARCHAR)
SELECT plural_abbreviation FROM table_name_21 WHERE plural_word = "following lines or pages"
what are the draft pick numbers and draft classes for players who play the Defender position?
CREATE TABLE team (Team_id int,Name text)CREATE TABLE match_season (Season real,Player text,Position text,Country int,Team int,Draft_Pick_Number int,Draft_Class text,College text)CREATE TABLE country (Country_id int,Country_name text,Capital text,Official_native_language text)CREATE TABLE player (Player_ID int,Player t...
SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender"
In the match against Marcus Aur lio with a method of decision (unanimous), what was the results?
CREATE TABLE table_50136 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Event" text,"Round" real,"Time" text,"Location" text)
SELECT "Res." FROM table_50136 WHERE "Method" = 'decision (unanimous)' AND "Opponent" = 'marcus aurélio'
What is the largest number of students?
CREATE TABLE table_142950_1 (total_number_of_students INTEGER)
SELECT MAX(total_number_of_students) FROM table_142950_1
What is the score of player mark hayes?
CREATE TABLE table_name_14 (score VARCHAR,player VARCHAR)
SELECT score FROM table_name_14 WHERE player = "mark hayes"
How many byes when there are 11 wins and fewer than 5 losses?
CREATE TABLE table_name_63 (byes INTEGER,wins VARCHAR,losses VARCHAR)
SELECT SUM(byes) FROM table_name_63 WHERE wins = 11 AND losses < 5
What is Jolene Anderson's Rank?
CREATE TABLE table_13073 ("Actor/actress" text,"Character" text,"Rank" text,"Tenure" text,"Episodes" text)
SELECT "Rank" FROM table_13073 WHERE "Actor/actress" = 'jolene anderson'
Show me about the distribution of Team_Name and School_ID in a bar chart, and display in desc by the Y-axis.
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 Team_Name, School_ID FROM basketball_match ORDER BY School_ID DESC
How big is the area that has a population density of 113 and a population larger than 184,531?
CREATE TABLE table_76332 ("District" text,"Population" real,"Area" real,"Pop. Dens." real,"No.of Settlements" real)
SELECT COUNT("Area") FROM table_76332 WHERE "Pop. Dens." = '113' AND "Population" > '184,531'
find the duration of hospital stay and discharge time of kurt buczek.
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 demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.name = "Kurt Buczek"
Find the titles of all movies that have no ratings.
CREATE TABLE Rating (title VARCHAR,mID VARCHAR)CREATE TABLE Movie (title VARCHAR,mID VARCHAR)
SELECT title FROM Movie WHERE NOT mID IN (SELECT mID FROM Rating)
Where was the game on September 12 played when the Dallas Cowboys was the visiting team?
CREATE TABLE table_11238 ("Date" text,"Visiting Team" text,"Final Score" text,"Host Team" text,"Stadium" text)
SELECT "Stadium" FROM table_11238 WHERE "Visiting Team" = 'dallas cowboys' AND "Date" = 'september 12'
n-th question (excluding posts migrated here).
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number...
WITH base AS (SELECT DISTINCT q.Id AS qid FROM Posts AS q JOIN PostHistory AS ph ON (q.Id = ph.PostId) WHERE (q.PostTypeId = 1) AND (ph.PostHistoryTypeId != 36)), ordered AS (SELECT ROW_NUMBER() OVER (ORDER BY qid) AS rownumber, qid FROM base) SELECT rownumber, qid AS "post_link" FROM ordered WHERE rownumber = '##num##...
Name the least week for opponent of washington redskins
CREATE TABLE table_name_87 (week INTEGER,opponent VARCHAR)
SELECT MIN(week) FROM table_name_87 WHERE opponent = "washington redskins"
had patient 12726's arterial bp [systolic] today been ever greater than 187.0?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE d_labitems (row_id number,itemid number,label 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 inputevents_cv (row...
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12726)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [syst...
What is the short stem for the word that has a perfect stem of poztu?
CREATE TABLE table_name_56 (short_stem VARCHAR,perfect_stem VARCHAR)
SELECT short_stem FROM table_name_56 WHERE perfect_stem = "poztu"
Which season is rank 4?
CREATE TABLE table_9252 ("Rank" text,"Runs" text,"Opponent" text,"Venue" text,"Season" text)
SELECT "Season" FROM table_9252 WHERE "Rank" = '4'
Who was the offensive award winner the week when Bob Watson was given the overall award?
CREATE TABLE table_19151 ("Month" text,"Week" real,"Overall" text,"Offensive" text,"Defensive" text,"Transition" text,"Rookie" text)
SELECT "Offensive" FROM table_19151 WHERE "Overall" = 'Bob Watson'
What Rider had a Time of +1:08.291?
CREATE TABLE table_38883 ("Rider" text,"Bike" text,"Laps" real,"Time" text,"Grid" real)
SELECT "Rider" FROM table_38883 WHERE "Time" = '+1:08.291'
What is the home team score of St Kilda?
CREATE TABLE table_name_4 (home_team VARCHAR)
SELECT home_team AS score FROM table_name_4 WHERE home_team = "st kilda"
What was the away team when the game was at corio oval?
CREATE TABLE table_74749 ("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_74749 WHERE "Venue" = 'corio oval'
What is the lowest and highest rating star?
CREATE TABLE rating (rid number,mid number,stars number,ratingdate time)CREATE TABLE reviewer (rid number,name text)CREATE TABLE movie (mid number,title text,year number,director text)
SELECT MAX(stars), MIN(stars) FROM rating
Compute the total maximal product price across product type code as a pie chart.
CREATE TABLE Customer_Orders (order_id INTEGER,customer_id INTEGER,order_status_code VARCHAR(10),order_date DATETIME)CREATE TABLE Customers (customer_id INTEGER,payment_method_code VARCHAR(10),customer_code VARCHAR(20),customer_name VARCHAR(80),customer_address VARCHAR(255),customer_phone VARCHAR(80),customer_email VAR...
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code
i'd like to fly from ATLANTA to DENVER on 8 29
CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,co...
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 = 'DENVER' AND date_day.day_number = 29 AND date_day.month_number = 8 AND da...
what rank did the nation with the most total medals receive ?
CREATE TABLE table_204_34 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number)
SELECT "rank" FROM table_204_34 ORDER BY "total" DESC LIMIT 1
What Opponent in the final had a match with a Score in the final of 7 5, 6 2?
CREATE TABLE table_42096 ("Outcome" text,"Date" real,"Championship" text,"Surface" text,"Opponent in the final" text,"Score in the final" text)
SELECT "Opponent in the final" FROM table_42096 WHERE "Score in the final" = '7–5, 6–2'
What's the average attendance of the leagues in the season of 2013?
CREATE TABLE table_16345 ("League" text,"Sport" text,"Country" text,"Season" text,"Games" real,"Average attendance" real,"Total attendance" real)
SELECT MIN("Average attendance") FROM table_16345 WHERE "Season" = '2013'
Which Grades has an Enrollment larger htan 443 with a Student body of Co-ed?
CREATE TABLE table_71166 ("School" text,"Grades" text,"Affiliation" text,"Student Body" text,"Enrollment" real)
SELECT "Grades" FROM table_71166 WHERE "Enrollment" > '443' AND "Student Body" = 'co-ed'
What was the name of the catalog released on 19 July 2008?
CREATE TABLE table_8274 ("Date" text,"Label" text,"Region" text,"Format" text,"Catalog" text)
SELECT "Catalog" FROM table_8274 WHERE "Date" = '19 july 2008'
who was in office previous to abdullah jaafar ?
CREATE TABLE table_204_668 (id number,"#" number,"menteri besar" text,"took office" text,"left office" text,"party" text)
SELECT "menteri besar" FROM table_204_668 WHERE "took office" < (SELECT "took office" FROM table_204_668 WHERE "menteri besar" = 'abdullah jaafar') ORDER BY "took office" DESC LIMIT 1
Who lost on July 20 with 42,607 attending?
CREATE TABLE table_11576 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" real,"Record" text)
SELECT "Loss" FROM table_11576 WHERE "Attendance" > '42,607' AND "Date" = 'july 20'
questions closed by mods vs community.
CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,T...
SELECT UserId, UserId AS "user_link", COUNT(PostId) FROM PostHistory WHERE PostHistoryTypeId = 10 GROUP BY UserId
Name the date with loss of carman (3-12)
CREATE TABLE table_75607 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Save" text)
SELECT "Date" FROM table_75607 WHERE "Loss" = 'carman (3-12)'
Tell me the position for pick of 47
CREATE TABLE table_31543 ("Pick" text,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "Position" FROM table_31543 WHERE "Pick" = '47'
Which player has figures of 4/14?
CREATE TABLE table_68114 ("Player" text,"Overs" real,"Figures" text,"Opponent" text,"Ground" text)
SELECT "Player" FROM table_68114 WHERE "Figures" = '4/14'
Which Third has a Second of scott pfeifer?
CREATE TABLE table_76523 ("Season" text,"Skip" text,"Third" text,"Second" text,"Lead" text)
SELECT "Third" FROM table_76523 WHERE "Second" = 'scott pfeifer'
What is the total number of points of driver enrique bernoldi (r)?
CREATE TABLE table_14108 ("Driver" text,"Team" text,"Laps" real,"Time/Retired" text,"Grid" real,"Points" real)
SELECT COUNT("Points") FROM table_14108 WHERE "Driver" = 'enrique bernoldi (r)'
what is the lowest grid with laps larger than 23?
CREATE TABLE table_name_85 (grid INTEGER,laps INTEGER)
SELECT MIN(grid) FROM table_name_85 WHERE laps > 23
tell me the total amount of urine that patient 002-74856 has on 09/03/2105.
CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname...
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-74856')) AND intakeoutput.celllabel = 'urine...
Name the high assists for 70 game
CREATE TABLE table_21207 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High assists" FROM table_21207 WHERE "Game" = '70'
What pole position did 2006 gehl championship finale have?
CREATE TABLE table_name_82 (pole_position VARCHAR,race_name VARCHAR)
SELECT pole_position FROM table_name_82 WHERE race_name = "2006 gehl championship finale"
What builder has a 2001-02 order year?
CREATE TABLE table_60637 ("Order Year" text,"Builder" text,"Model" text,"Length (ft.)" text,"Engine/Transmission" text)
SELECT "Builder" FROM table_60637 WHERE "Order Year" = '2001-02'
what is the date when the home team is st kilda?
CREATE TABLE table_name_26 (date VARCHAR,home_team VARCHAR)
SELECT date FROM table_name_26 WHERE home_team = "st kilda"
What is the lowest decile with 1-6 years and area of Maitland?
CREATE TABLE table_69790 ("Name" text,"Years" text,"Gender" text,"Area" text,"Authority" text,"Decile" real,"Roll" real)
SELECT MIN("Decile") FROM table_69790 WHERE "Years" = '1-6' AND "Area" = 'maitland'
Who was the runner up at the Volvo Masters Andalucia?
CREATE TABLE table_1615980_4 (runner_s__up VARCHAR,tournament VARCHAR)
SELECT runner_s__up FROM table_1615980_4 WHERE tournament = "Volvo Masters Andalucia"
Create a bar chart showing how many allergytype across allergytype, and list in descending by the how many allergytype.
CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))
SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(AllergyType) DESC
Who was the semi-final television commentator when the spokesperson was Colin Berry and the final television commentator was Pete Murray?
CREATE TABLE table_21902 ("Year(s)" real,"Final television commentator" text,"Radio commentator" text,"Spokesperson" text,"Semi-final television commentator" text,"Semi-final second television commentator" text)
SELECT "Semi-final television commentator" FROM table_21902 WHERE "Spokesperson" = 'Colin Berry' AND "Final television commentator" = 'Pete Murray'
The Athlete Shin Yeong-eun with a rank larger than 3 and notes of FD had what time?
CREATE TABLE table_name_79 (time VARCHAR,athlete VARCHAR,rank VARCHAR,notes VARCHAR)
SELECT time FROM table_name_79 WHERE rank > 3 AND notes = "fd" AND athlete = "shin yeong-eun"
Where did Hawthorn play an away game?
CREATE TABLE table_10619 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_10619 WHERE "Away team" = 'hawthorn'
what are the three most frequent drugs prescribed to the patients with the age of 60 or above during the same hospital encounter after they were diagnosed with alcoh dep nec/nos-contin?
CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)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 number,hadm_id number,icustay_id number,first_careunit text,last...
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
Name the number of pictorials for 5-85
CREATE TABLE table_1566848_6 (pictorials VARCHAR,date VARCHAR)
SELECT COUNT(pictorials) FROM table_1566848_6 WHERE date = "5-85"
How many different outcomes of the French Championships were there?
CREATE TABLE table_2201724_2 (outcome VARCHAR,championship VARCHAR)
SELECT COUNT(outcome) FROM table_2201724_2 WHERE championship = "French championships"
What was bruce baldwin's pick #?
CREATE TABLE table_73734 ("Pick #" real,"NFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "Pick #" FROM table_73734 WHERE "Player" = 'Bruce Baldwin'
How many gas stations dors each manager have? Plot a bar chart, and sort from high to low by the y-axis.
CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value real)CREATE TABLE gas_station (Station_ID int,Open_Year int,Location text,Manager_Name text,Vice_Manager_Name text,Representative_Name text)CREATE TABL...
SELECT Manager_Name, COUNT(Manager_Name) FROM gas_station GROUP BY Manager_Name ORDER BY COUNT(Manager_Name) DESC
How many classes are taken in the third year when pag-unawa was taken in the first year?
CREATE TABLE table_12148147_2 (third_year VARCHAR,first_year VARCHAR)
SELECT COUNT(third_year) FROM table_12148147_2 WHERE first_year = "Pag-unawa"
What was the highest rink for Kingston?
CREATE TABLE table_name_94 (rank INTEGER,location VARCHAR)
SELECT MAX(rank) FROM table_name_94 WHERE location = "kingston"
Users with highest median answer score.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Users (Id number,Reputation number,Creati...
SELECT Users.Id, DisplayName, COUNT(Posts.Id) AS Questions, (SELECT MAX(Score) FROM (SELECT percent AS Score FROM Posts AS PU WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND PU.OwnerUserId = Users.Id ORDER BY Score LIMIT 50) AS t) AS MedianQuestionScore FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHER...
Which 9 -credit Water Quality and Human the Great Lakes Basin classes are there ?
CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student (student_id int,lastname varchar,firstname varcha...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Water Quality and Human the Great Lakes Basin%' OR name LIKE '%Water Quality and Human the Great Lakes Basin%') AND credits = 9
Which stadium held the game that 65,677 people attended?
CREATE TABLE table_33633 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Stadium" text,"Record" text,"Attendance" text)
SELECT "Stadium" FROM table_33633 WHERE "Attendance" = '65,677'
What is the To par when the score was 72-67-68-71=278?
CREATE TABLE table_46403 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money ($)" text)
SELECT "To par" FROM table_46403 WHERE "Score" = '72-67-68-71=278'
What is the lowest number of Gold, when the number of Bronze is less than 36, when the Rank is 2, and when Silver is less than 37?
CREATE TABLE table_name_97 (gold INTEGER,silver VARCHAR,bronze VARCHAR,rank VARCHAR)
SELECT MIN(gold) FROM table_name_97 WHERE bronze < 36 AND rank = "2" AND silver < 37
When was the delevery date when there were 12 ways of delivery?
CREATE TABLE table_11552751_2 (total_number_of_ways VARCHAR)
SELECT 1 AS st_ship_delivery_date FROM table_11552751_2 WHERE total_number_of_ways = "12 ways"
WHAT IS THE APPOINTMENT DATE FOR AC HORSENS?
CREATE TABLE table_45977 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text,"Position in table" text)
SELECT "Date of appointment" FROM table_45977 WHERE "Team" = 'ac horsens'
Ben Crenshaw has what To par?
CREATE TABLE table_9482 ("Place" text,"Player" text,"Country" text,"Score" real,"To par" text)
SELECT "To par" FROM table_9482 WHERE "Player" = 'ben crenshaw'
review stats for each review queue.
CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE T...
SELECT CASE ReviewTaskTypeId WHEN 1 THEN 'Suggested edits' WHEN 2 THEN 'Close Votes' WHEN 3 THEN 'Low Quality Posts' WHEN 4 THEN 'First Posts' WHEN 5 THEN 'Late Answers' WHEN 6 THEN 'Reopen Votes' WHEN 7 THEN 'Community Evaluation' WHEN 8 THEN 'Link Validation' WHEN 9 THEN 'Flagged Posts' WHEN 10 THEN 'Triage' WHEN 11 ...