instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
which nba team has more retired jerseys than any other nba team ?
CREATE TABLE table_203_348 (id number,"number" number,"name" text,"team" text,"position" text,"years with franchise" text,"note" text)
SELECT "team" FROM table_203_348 GROUP BY "team" ORDER BY COUNT(*) DESC LIMIT 1
Which Visitor was there when the Home game was played in Miami on November 4?
CREATE TABLE table_54349 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Leading scorer" text,"Attendance" real,"Record" text)
SELECT "Visitor" FROM table_54349 WHERE "Home" = 'miami' AND "Date" = 'november 4'
Show all the activity names and the number of faculty involved in each activity in a bar chart, and could you rank total number from low to high order?
CREATE TABLE Activity (actid INTEGER,activity_name varchar(25))CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),Rank VARCHAR(15),Sex VARCHAR(1),Phone INTEGER,Room VARCHAR(5),Building VARCHAR(13))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Maj...
SELECT activity_name, COUNT(*) FROM Activity AS T1 JOIN Faculty_Participates_in AS T2 ON T1.actid = T2.actid GROUP BY T1.actid ORDER BY COUNT(*)
What's the lowest Losses recorded wiht a Wins of 1, Team of Dallas Stars, and a Win % that's smaller than 0.25?
CREATE TABLE table_name_60 (losses INTEGER,win__percentage VARCHAR,wins VARCHAR,team VARCHAR)
SELECT MIN(losses) FROM table_name_60 WHERE wins = 1 AND team = "dallas stars" AND win__percentage < 0.25
For those records from the products and each product's manufacturer, find name and manufacturer , and group by attribute founder, and visualize them by a bar chart, rank Y-axis in descending 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 T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer DESC
Do any upper-level classes not have 575 as a prerequisite ?
CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_cre...
SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%topic0%' OR name LIKE '%topic0%') AND department = 'EECS'
What place did the party finish in the year when they earned 0.86% of the vote?
CREATE TABLE table_21132 ("Election" real,"Candidates fielded" real,"# of seats won" real,"Total votes" real,"% of popular vote" text,"Place" text)
SELECT "Place" FROM table_21132 WHERE "% of popular vote" = '0.86%'
how much is fe?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemsta...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'fe')
what is drug name of drug code digo25?
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 prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "DIGO25"
Who was the crew for the duration of 12 minutes?
CREATE TABLE table_70280 ("Start Date/Time" text,"Duration" text,"End Time" text,"Spacecraft" text,"Crew" text)
SELECT "Crew" FROM table_70280 WHERE "Duration" = '12 minutes'
if there are 30 lifts, what is the name of the ski resort?
CREATE TABLE table_25762852_1 (name VARCHAR,lifts VARCHAR)
SELECT name FROM table_25762852_1 WHERE lifts = 30
Name the number of scm system for nant, visual studio
CREATE TABLE table_22903426_1 (scm_system VARCHAR,windows_builders VARCHAR)
SELECT COUNT(scm_system) FROM table_22903426_1 WHERE windows_builders = "NAnt, Visual Studio"
Segment B of aerospace fuel lines has what segment A?
CREATE TABLE table_name_5 (segment_a VARCHAR,segment_b VARCHAR)
SELECT segment_a FROM table_name_5 WHERE segment_b = "aerospace fuel lines"
What is the average year for a Saar of FK Pirmasens and Hessen of Wormatia Worms?
CREATE TABLE table_63900 ("Year" real,"Main" text,"Hessen" text,"Rhein" text,"Saar" text)
SELECT AVG("Year") FROM table_63900 WHERE "Saar" = 'fk pirmasens' AND "Hessen" = 'wormatia worms'
give me the number of patients whose year of death is less than or equal to 2168 and procedure icd9 code is 3142?
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 WHERE demographic.dod_year <= "2168.0" AND procedures.icd9_code = "3142"
What are the names of body builders?
CREATE TABLE people (Name VARCHAR,People_ID VARCHAR)CREATE TABLE body_builder (People_ID VARCHAR)
SELECT T2.Name FROM body_builder AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID
What was the North Melbourne's score when they played as the home team?
CREATE TABLE table_4739 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team score" FROM table_4739 WHERE "Home team" = 'north melbourne'
Which Opponent has a Attendance of 7,034?
CREATE TABLE table_name_29 (opponent VARCHAR,attendance VARCHAR)
SELECT opponent FROM table_name_29 WHERE attendance = "7,034"
when did the first hospital discharge of patient 14621 in this year?
CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE p...
SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 14621 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') ORDER BY admissions.dischtime LIMIT 1
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and price , and group by attribute name.
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name
Name the control for albany
CREATE TABLE table_2076533_1 (control VARCHAR,main_location VARCHAR)
SELECT control FROM table_2076533_1 WHERE main_location = "Albany"
What is the lowest rank that has university park, pa as the location?
CREATE TABLE table_name_68 (rank INTEGER,location VARCHAR)
SELECT MIN(rank) FROM table_name_68 WHERE location = "university park, pa"
What was the score of the game where the record was 2-2?
CREATE TABLE table_47605 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Score" FROM table_47605 WHERE "Record" = '2-2'
what is the largest city where the province is eastern cape?
CREATE TABLE table_1689 ("Province" text,"Provincial capital" text,"Largest city" text,"Area (km 2)" real,"Population (2013)" real)
SELECT "Largest city" FROM table_1689 WHERE "Province" = 'Eastern Cape'
what is admission time and procedure icd9 code of subject id 98220?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob...
SELECT demographic.admittime, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "98220"
TOP 50 user from india.
CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Review...
SELECT Id, DisplayName, Reputation, WebsiteUrl, Location FROM Users ORDER BY Reputation DESC LIMIT 150
How many pilots are there?
CREATE TABLE pilot (Id VARCHAR)
SELECT COUNT(*) FROM pilot
What is the modified speed (6th gear) when standard torque (lb/ft) is 10.3 and modified torque (lb/ft) is 8.75?
CREATE TABLE table_23166 ("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 speed (6th gear)" FROM table_23166 WHERE "Standard torque (lb/ft)" = '10.3' AND "Modified torque (lb/ft)" = '8.75'
What is the production code of the episode with series #8?
CREATE TABLE table_30860 ("Episode #" real,"Series #" real,"Episode Title" text,"Original air date" text,"Production Code" real)
SELECT "Production Code" FROM table_30860 WHERE "Series #" = '8'
What is the country associated with the date in 2003?
CREATE TABLE table_12902 ("Date" text,"Label" text,"Format" text,"Country" text,"Catalog" text)
SELECT "Country" FROM table_12902 WHERE "Date" = '2003'
Who is the home team on March 5?
CREATE TABLE table_name_52 (home VARCHAR,date VARCHAR)
SELECT home FROM table_name_52 WHERE date = "march 5"
How did the election end for Robert Wexler?
CREATE TABLE table_18144 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text)
SELECT "Results" FROM table_18144 WHERE "Incumbent" = 'Robert Wexler'
What's the sum of the Pick that has the Player of Robert Ingalls?
CREATE TABLE table_35393 ("Round" real,"Pick" real,"Player" text,"Position" text,"School/Club Team" text)
SELECT COUNT("Pick") FROM table_35393 WHERE "Player" = 'robert ingalls'
What was the date that the st. george-illawarra dragons lost?
CREATE TABLE table_16557 ("Season" real,"Grand FinalDate" text,"WinningTeam" text,"Score" text,"LosingTeam" text,"Location" text,"GF Attendance" real,"Clive Churchill Medal" text)
SELECT "Grand FinalDate" FROM table_16557 WHERE "LosingTeam" = 'St. George-Illawarra Dragons'
count the number of patients whose ethnicity is black /haitian and were born before 2175.
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.ethnicity = "BLACK/HAITIAN" AND demographic.dob_year < "2175"
Name the cyrillic name for 518
CREATE TABLE table_27869 ("Settlement" text,"Cyrillic Name Other Names" text,"Type" text,"Population (2011)" real,"Largest ethnic group (2002)" text,"Dominant religion (2002)" text)
SELECT "Cyrillic Name Other Names" FROM table_27869 WHERE "Population (2011)" = '518'
Which fatality was at ankara for the aircraft douglas c-47?
CREATE TABLE table_47707 ("Date" text,"Flight" text,"Aircraft" text,"Registration" text,"Location" text,"Fatalities" real)
SELECT "Fatalities" FROM table_47707 WHERE "Location" = 'ankara' AND "Aircraft" = 'douglas c-47'
Which Cuts made has a Tournament of totals, and Wins smaller than 11?
CREATE TABLE table_35978 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT AVG("Cuts made") FROM table_35978 WHERE "Tournament" = 'totals' AND "Wins" < '11'
What is the releases number under Season 2?
CREATE TABLE table_20661 ("Title" text,"Series" text,"Release" text,"Featuring" text,"Writer" text,"Director" text,"Length" text,"Timeline" text,"Release Date" text)
SELECT "Release" FROM table_20661 WHERE "Timeline" = 'Season 2'
What team has rank 3?
CREATE TABLE table_name_73 (team VARCHAR,rank VARCHAR)
SELECT team FROM table_name_73 WHERE rank = 3
How many vieweres for the episode with a share of 1, a Rating larger than 0.7000000000000001, and a Rank (#) of 100/102?
CREATE TABLE table_name_73 (viewers__m_ VARCHAR,rank___number_ VARCHAR,share VARCHAR,rating VARCHAR)
SELECT viewers__m_ FROM table_name_73 WHERE share = 1 AND rating > 0.7000000000000001 AND rank___number_ = "100/102"
Who is the player from the United States with a score of 71-75=146?
CREATE TABLE table_50016 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Player" FROM table_50016 WHERE "Country" = 'united states' AND "Score" = '71-75=146'
What is the field of the game on July 22?
CREATE TABLE table_11498 ("Date" text,"Opponent" text,"Home/Away" text,"Field" text,"Result" text)
SELECT "Field" FROM table_11498 WHERE "Date" = 'july 22'
What was the date of the game when the record was 27-14?
CREATE TABLE table_25877 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "Date" FROM table_25877 WHERE "Record" = '27-14'
what number of patients with hematology as lab test category had complete atroiventricular block?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
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.long_title = "Atrioventricular block, complete" AND lab."CATEGORY" = "Hematology"
what is the since beginning of big 12 when last 10 meetings is ou, 7-3, neutral site is ou, 2-1, and last 5 meetings is bu, 3-2?
CREATE TABLE table_50605 ("Oklahoma vs." text,"Overall Record" text,"at Norman" text,"at Opponent's Venue" text,"at Neutral Site" text,"Last 5 Meetings" text,"Last 10 Meetings" text,"Current Streak" text,"Since Beginning of Big 12" text)
SELECT "Since Beginning of Big 12" FROM table_50605 WHERE "Last 10 Meetings" = 'ou, 7-3' AND "at Neutral Site" = 'ou, 2-1' AND "Last 5 Meetings" = 'bu, 3-2'
How many schools won their last occ championship in 2006?
CREATE TABLE table_21682 ("School" text,"Years of Participation" text,"OCC Championships" real,"Last OCC Championship" text,"Last Outright OCC Championship" text)
SELECT COUNT("School") FROM table_21682 WHERE "Last OCC Championship" = '2006'
What are the venues prior to 2005 in the World Class category that resulted in a bronze?
CREATE TABLE table_name_57 (venue VARCHAR,result VARCHAR,year VARCHAR,category VARCHAR)
SELECT venue FROM table_name_57 WHERE year < 2005 AND category = "world class" AND result = "bronze"
What was the distance in the Manikato Stakes race?
CREATE TABLE table_28128 ("Result" text,"Date" text,"Race" text,"Venue" text,"Group" text,"Distance" text,"Weight (kg)" text,"Jockey" text,"Winner/2nd" text)
SELECT "Distance" FROM table_28128 WHERE "Race" = 'Manikato Stakes'
Who performed all the high rebounds when craig smith (4) was the lead for high assists?
CREATE TABLE table_17058226_5 (high_rebounds VARCHAR,high_assists VARCHAR)
SELECT high_rebounds FROM table_17058226_5 WHERE high_assists = "Craig Smith (4)"
What is the total amount of money loaned by banks in New York state?
CREATE TABLE loan (loan_id text,loan_type text,cust_id text,branch_id text,amount number)CREATE TABLE bank (branch_id number,bname text,no_of_customers number,city text,state text)CREATE TABLE customer (cust_id text,cust_name text,acc_type text,acc_bal number,no_of_loans number,credit_score number,branch_id number,stat...
SELECT SUM(T2.amount) FROM bank AS T1 JOIN loan AS T2 ON T1.branch_id = T2.branch_id WHERE T1.state = 'New York'
Which Week has a Result of w 23 22?
CREATE TABLE table_name_77 (week VARCHAR,result VARCHAR)
SELECT week FROM table_name_77 WHERE result = "w 23–22"
what number is the episode 'there will be bad blood' in the series?
CREATE TABLE table_28671 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (millions)" text)
SELECT MIN("No. in series") FROM table_28671 WHERE "Title" = 'There Will Be Bad Blood'
Who had the most the most rebounds and how many did they have on April 1?
CREATE TABLE table_27700530_14 (high_rebounds VARCHAR,date VARCHAR)
SELECT high_rebounds FROM table_27700530_14 WHERE date = "April 1"
When waikaia is the electorate what is the highest by-election?
CREATE TABLE table_28898948_3 (by_election INTEGER,electorate VARCHAR)
SELECT MAX(by_election) FROM table_28898948_3 WHERE electorate = "Waikaia"
What is the Attendance of the game with a Result of L 20-14?
CREATE TABLE table_64795 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text)
SELECT "Attendance" FROM table_64795 WHERE "Result" = 'l 20-14'
What were the high rebounds on september 11?
CREATE TABLE table_76378 ("Game" real,"Date" text,"Opponent" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location/Attendance" text,"Record" text)
SELECT "High rebounds" FROM table_76378 WHERE "Date" = 'september 11'
Which date has a Clock of 0.8-1.6ghz?
CREATE TABLE table_name_61 (date VARCHAR,clock VARCHAR)
SELECT date FROM table_name_61 WHERE clock = "0.8-1.6ghz"
find the number of patients who are born before the year 2053 and underwent lab test for rbc count and joint fluid.
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 demographic.dob_year < "2053" AND lab.label = "RBC, Joint Fluid"
what is the team website when the institution is indiana university of pennsylvania?
CREATE TABLE table_name_93 (team_website VARCHAR,institution VARCHAR)
SELECT team_website FROM table_name_93 WHERE institution = "indiana university of pennsylvania"
What is the most common amenity in the dorms?
CREATE TABLE dorm_amenity (amenid number,amenity_name text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE dorm (dormid number,dorm_name text,student_capacity number,gender text)CREATE TABLE lives_in (stuid number,dormid number,room_nu...
SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T1.amenid = T2.amenid GROUP BY T2.amenid ORDER BY COUNT(*) DESC LIMIT 1
Users above given number of upvotes.
CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE Comments (Id number,PostId number,Score number,Te...
SELECT Id AS "user_link", Reputation, CreationDate, DisplayName, LastAccessDate, UpVotes, DownVotes FROM Users WHERE UpVotes > '##votes##' ORDER BY Id
Italian Stackoverflow Users > 99k.
CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate tim...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Location, Reputation FROM Users WHERE Reputation > 99000 AND LOWER(Location) LIKE LOWER('%italy%') ORDER BY Reputation DESC
Who were the candidates in the district where Jerry Costello won?
CREATE TABLE table_72365 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text,"Candidates" text)
SELECT "Candidates" FROM table_72365 WHERE "Incumbent" = 'Jerry Costello'
Show the times used by climbers to climb mountains in Country Uganda.
CREATE TABLE climber (climber_id number,name text,country text,time text,points number,mountain_id number)CREATE TABLE mountain (mountain_id number,name text,height number,prominence number,range text,country text)
SELECT T1.time FROM climber AS T1 JOIN mountain AS T2 ON T1.mountain_id = T2.mountain_id WHERE T2.country = "Uganda"
Answers with a Negative Score Created in the last six months.
CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta...
SELECT P.Id AS "post_link", P.Body FROM Posts AS P, PostTypes AS Pt, Votes AS V, VoteTypes AS Vt WHERE P.Id = V.PostId AND Vt.Id = V.VoteTypeId AND P.Score < -2 AND Pt.Id = 2 AND Vt.Id = 3 AND DATEDIFF(month, P.CreationDate, GETDATE()) < 6 GROUP BY P.Id, P.Body
Which Year has a Competition of commonwealth youth games?
CREATE TABLE table_64740 ("Year" real,"Competition" text,"Venue" text,"Position" text,"Event" text)
SELECT AVG("Year") FROM table_64740 WHERE "Competition" = 'commonwealth youth games'
How much was the first place prize for the American golf classic located in Ohio?
CREATE TABLE table_37503 ("Date" text,"Tournament" text,"Location" text,"Winner" text,"Score" text,"1st prize ($)" text)
SELECT "1st prize ( $ )" FROM table_37503 WHERE "Location" = 'ohio' AND "Tournament" = 'american golf classic'
Show id from each meter 400, and list by the X from high to low.
CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE stadiu...
SELECT meter_400, ID FROM swimmer ORDER BY meter_400 DESC
What is the score from the Sacramento monarchs from the west and the Connecticut sun from the east?
CREATE TABLE table_name_83 (result VARCHAR,western_champion VARCHAR,eastern_champion VARCHAR)
SELECT result FROM table_name_83 WHERE western_champion = "sacramento monarchs" AND eastern_champion = "connecticut sun"
What was the record in the game where the opponent was the cincinnati royals?
CREATE TABLE table_name_60 (record VARCHAR,opponent VARCHAR)
SELECT record FROM table_name_60 WHERE opponent = "cincinnati royals"
Name the club for quevedo
CREATE TABLE table_2454589_1 (club VARCHAR,home_city VARCHAR)
SELECT club FROM table_2454589_1 WHERE home_city = "Quevedo"
What was the Money ($) amount for Lloyd Mangrum?
CREATE TABLE table_name_19 (money___$__ VARCHAR,player VARCHAR)
SELECT money___$__ FROM table_name_19 WHERE player = "lloyd mangrum"
Top 100 most viewed questions. Questions must have at least 1000 views to qualify
CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate ...
SELECT Questions.Id AS "post_link", Questions.Title, Questions.AnswerCount, Questions.ViewCount, Questions.FavoriteCount, Questions.Score, Questions.LastActivityDate, Questions.Tags FROM Posts AS Answers INNER JOIN Posts AS Questions ON Questions.Id = Answers.ParentId INNER JOIN Users AS Users ON Answers.OwnerUserId = ...
Select the name of each manufacturer along with the price of its most expensive product using a bar chart, order y axis from low to high order please.
CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)
SELECT T2.Name, MAX(T1.Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY MAX(T1.Price)
What's the termini of the route with junctions of i-35 fm 3338 sh 255?
CREATE TABLE table_name_2 (termini VARCHAR,junctions VARCHAR)
SELECT termini FROM table_name_2 WHERE junctions = "i-35 fm 3338 sh 255"
Testing CUBE (and ROLLUP) using ISO-Compliant syntax. It seems even though you cannot refer to column names in normal SQL (simple ORDER BY references excepted -- a SQL Extension I believe) you do have to consider the matching expression as a name because although ISNULL(x,y) should never be null, it clearly is in the s...
CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE PostNotices (Id n...
SELECT TIME_TO_STR(CreationDate, '%Y') AS "year", TIME_TO_STR(CreationDate, '%m') AS "date", Score AS "score", COUNT(*) AS CommentCount, SUM(LENGTH(Text)) AS Typed, GROUPING(TIME_TO_STR(CreationDate, '%Y')), GROUPING(TIME_TO_STR(CreationDate, '%m')), GROUPING(Score) FROM Comments WHERE UserId = @UserId GROUP BY CUBE (T...
Show the different countries and the number of members from each.
CREATE TABLE round (round_id number,member_id number,decoration_theme text,rank_in_round number)CREATE TABLE college (college_id number,name text,leader_name text,college_location text)CREATE TABLE member (member_id number,name text,country text,college_id number)
SELECT country, COUNT(*) FROM member GROUP BY country
what is the lowest crowd at kardinia park
CREATE TABLE table_name_50 (crowd INTEGER,venue VARCHAR)
SELECT MIN(crowd) FROM table_name_50 WHERE venue = "kardinia park"
On average , how hard are PreMajor courses ?
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 AVG(workload) FROM program_course WHERE category LIKE '%PreMajor%'
Name the lowest Grid which has a Bike of ducati 1098 rs 08 and a Rider of max biaggi?
CREATE TABLE table_name_24 (grid INTEGER,bike VARCHAR,rider VARCHAR)
SELECT MIN(grid) FROM table_name_24 WHERE bike = "ducati 1098 rs 08" AND rider = "max biaggi"
which patients have sdh primary disease?
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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SDH"
what was the first time patient 004-86136 had a maximum of anion gap in 12/this year?
CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,cellla...
SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-86136')) AND lab.labname = 'anion gap' AND DATETIME(lab.labresulttime, 'start o...
what is the lowest number of ties when the losses is 7 and games played is less than 10?
CREATE TABLE table_53417 ("Team" text,"Games Played" real,"Wins" real,"Losses" real,"Ties" real,"Goals For" real,"Goals Against" real)
SELECT MIN("Ties") FROM table_53417 WHERE "Losses" = '7' AND "Games Played" < '10'
When did Luke S Zettlemoyer publish ?
CREATE TABLE writes (paperid int,authorid int)CREATE TABLE paperfield (fieldid int,paperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE author (authorid int,authorname varchar)CREA...
SELECT DISTINCT paper.year FROM author, paper, writes WHERE author.authorname = 'Luke S Zettlemoyer' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year
What is the chassis when the rank is 3rd?
CREATE TABLE table_42453 ("Year" real,"Team" text,"Chassis" text,"Engine" text,"Rank" text,"Points" real)
SELECT "Chassis" FROM table_42453 WHERE "Rank" = '3rd'
How many sections does each course has Visualize by bar chart, and rank y axis in descending order.
CREATE TABLE ENROLL (CLASS_CODE varchar(5),STU_NUM int,ENROLL_GRADE varchar(50))CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PROF_EXTENSION varchar(4),PROF_HIGH_DEGREE varchar(5))CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DO...
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) DESC
how many shows were on zee tv ?
CREATE TABLE table_203_173 (id number,"year(s)" text,"serial name" text,"role" text,"co-star" text,"note(s)" text,"channel" text)
SELECT COUNT("serial name") FROM table_203_173 WHERE "channel" = 'zee tv'
What is the protein name of the protein with a sequence identity to human protein of 32%?
CREATE TABLE table_name_2 (protein_name VARCHAR,sequence_identity_to_human_protein VARCHAR)
SELECT protein_name FROM table_name_2 WHERE sequence_identity_to_human_protein = "32%"
Who was the winner when the result was 56-0 before 1935?
CREATE TABLE table_48655 ("Year" real,"Date" text,"Winner" text,"Result" text,"Loser" text,"Location" text)
SELECT "Winner" FROM table_48655 WHERE "Year" < '1935' AND "Result" = '56-0'
What date has a Home team score of 11.18 (84)?
CREATE TABLE table_55793 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Date" FROM table_55793 WHERE "Home team score" = '11.18 (84)'
What is Left Office, when Political Party is Ba'ath Party ( Syria Region ), and when Took Office is 7 March 1958?
CREATE TABLE table_name_63 (left_office VARCHAR,political_party VARCHAR,took_office VARCHAR)
SELECT left_office FROM table_name_63 WHERE political_party = "ba'ath party ( syria region )" AND took_office = "7 march 1958"
What home team has a rank greater than 6, and 94,392 as the capacity?
CREATE TABLE table_66045 ("Rank" real,"Stadium" text,"Capacity" text,"Location" text,"Home Team" text)
SELECT "Home Team" FROM table_66045 WHERE "Rank" > '6' AND "Capacity" = '94,392'
What tournament happened on 12 november 2006?
CREATE TABLE table_name_88 (tournament VARCHAR,date VARCHAR)
SELECT tournament FROM table_name_88 WHERE date = "12 november 2006"
What was the SlNo no of contact person SDE (P), Thiruppattur?
CREATE TABLE table_27635 ("SlNo" real,"Name of the City" text,"Address" text,"Contact Person" text,"Telephone No" text,"Facilities Offered" text)
SELECT "SlNo" FROM table_27635 WHERE "Contact Person" = 'SDE (P), Thiruppattur'
Are 2 or 3 lessons per week usually given for 555 ?
CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE ta (campus_job_id int,student_id int,location var...
SELECT DISTINCT course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday, semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND c...
What district was a republican first elected in 2000?
CREATE TABLE table_62254 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Results" text)
SELECT "District" FROM table_62254 WHERE "First elected" = '2000' AND "Party" = 'republican'
What was the place when the score was 65-70-72=207?
CREATE TABLE table_65390 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Place" FROM table_65390 WHERE "Score" = '65-70-72=207'
How many average speeds are listed in the year 2003?
CREATE TABLE table_2268216_1 (average_speed__mph_ VARCHAR,year VARCHAR)
SELECT COUNT(average_speed__mph_) FROM table_2268216_1 WHERE year = "2003"
provide the number of patients whose gender is m and diagnoses short title is cong skin pigment anomal?
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "M" AND diagnoses.short_title = "Cong skin pigment anomal"