instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Name the result for already famous
CREATE TABLE table_21790203_1 (result VARCHAR,film_title_used_in_nomination VARCHAR)
SELECT result FROM table_21790203_1 WHERE film_title_used_in_nomination = "Already Famous"
What player went to montreal college?
CREATE TABLE table_20170644_5 (player VARCHAR,college VARCHAR)
SELECT player FROM table_20170644_5 WHERE college = "Montreal"
Can you tell me the Location Attendance that has the High assists of luke ridnour (10), and the Date of december 3?
CREATE TABLE table_name_10 (location_attendance VARCHAR,high_assists VARCHAR,date VARCHAR)
SELECT location_attendance FROM table_name_10 WHERE high_assists = "luke ridnour (10)" AND date = "december 3"
Who's the Republican ticket with a Democratic ticket of m. william bray?
CREATE TABLE table_name_67 (republican_ticket VARCHAR,democratic_ticket VARCHAR)
SELECT republican_ticket FROM table_name_67 WHERE democratic_ticket = "m. william bray"
What percent did GR NE get in Tyrol where RETT got 0.6%?
CREATE TABLE table_60666 ("State" text,"GR\u00dcNE" text,"FRITZ" text,"RETT\u00d6" text,"LINKE" text,"STARK" text)
SELECT "GR\u00dcNE" FROM table_60666 WHERE "RETT\u00d6" = '0.6%' AND "State" = 'tyrol'
List how many students in each last name who majored in 600 using a bar chart, and I want to rank by the Y in desc.
CREATE TABLE Restaurant (ResID INTEGER,ResName VARCHAR(100),Address VARCHAR(100),Rating INTEGER)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 Type_Of_Restaurant (ResID INTEGER,ResTypeID INTEGER)CREATE TA...
SELECT LName, COUNT(LName) FROM Student WHERE Major = 600 GROUP BY LName ORDER BY COUNT(LName) DESC
Which 2003 has a 2012 of 1r, and a 2008 of 1r?
CREATE TABLE table_35150 ("Tournament" text,"1998" text,"2000" text,"2001" text,"2002" text,"2003" text,"2004" text,"2005" text,"2006" text,"2007" text,"2008" text,"2009" text,"2010" text,"2011" text,"2012" text,"Career SR" text,"Career Win-Loss" text)
SELECT "2003" FROM table_35150 WHERE "2012" = '1r' AND "2008" = '1r'
until 2 years ago what are the top four most frequent diagnoses that patients were given during the same hospital encounter after being diagnosed with hyperglycemia?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE microlab (microlabid number,patientunitstayid number,culturesite text,organism text,culturetakentime time)CREATE TABLE cost (costid number,uniquepid text,pati...
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hyper...
when did patient 030-34260 the last time had voided amount output yesterday?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyna...
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-34260')) AND intakeoutput.cellpath LIKE '%output%...
has hypocalcemia been diagnosed with patient 015-57922?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiasto...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-57922')) AND diagnosis.diagnosisname = 'hypocalcemia'
What is Country, when Player is 'Rives McBee'?
CREATE TABLE table_51133 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text)
SELECT "Country" FROM table_51133 WHERE "Player" = 'rives mcbee'
Who was the winner in philadelphia municipal stadium in 1939?
CREATE TABLE table_name_31 (winner VARCHAR,location VARCHAR,year VARCHAR)
SELECT winner FROM table_name_31 WHERE location = "philadelphia municipal stadium" AND year = 1939
Are there upper level classes that have projects but no exams ?
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 DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND course.has_projects = 'Y' AND program_course.category LIKE 'ULCS'
What was the date of the game against Hayes & Yeading United?
CREATE TABLE table_name_60 (date VARCHAR,opponent VARCHAR)
SELECT date FROM table_name_60 WHERE opponent = "hayes & yeading united"
Opponents of sheffield wednesday had what date?
CREATE TABLE table_35286 ("Date" text,"Opponents" text,"Venue" text,"Result" text,"Score F\u2013A" text)
SELECT "Date" FROM table_35286 WHERE "Opponents" = 'sheffield wednesday'
what are the four most common microbiology tests that patients had in the same month after receiving antiarrhythmics - atropine during the last year?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patie...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antiarrhythmics - atropine' AND DATETIME(tre...
When the opponent scored 96 points after game 61, what was the streak?
CREATE TABLE table_48063 ("Game" real,"Date" text,"Opponent" text,"Result" text,"Nets points" real,"Opponent score" real,"Record" text,"Streak" text)
SELECT "Streak" FROM table_48063 WHERE "Game" > '61' AND "Opponent score" = '96'
show flights between BOSTON and DENVER
CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE fli...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER'...
When was the earliest first game with 11 played and 12 games lost?
CREATE TABLE table_15288 ("First game" real,"Played" real,"Drawn" real,"Lost" real,"Percentage" text)
SELECT MIN("First game") FROM table_15288 WHERE "Played" > '11' AND "Lost" = '12'
with race of ranvet stakes what is the group?
CREATE TABLE table_4989 ("Result" text,"Date" text,"Race" text,"Venue" text,"Group" text,"Distance" text,"Weight (kg)" real,"Jockey" text,"Winner/2nd" text)
SELECT "Group" FROM table_4989 WHERE "Race" = 'ranvet stakes'
What is the sum of the numbers in series written by sam meikle, which have 21 numbers in the season?
CREATE TABLE table_name_5 (no_in_series INTEGER,written_by VARCHAR,no_in_season VARCHAR)
SELECT SUM(no_in_series) FROM table_name_5 WHERE written_by = "sam meikle" AND no_in_season = 21
Which Japanese name has a Korean name of ( ) gyeongchip?
CREATE TABLE table_75545 ("Longi- tude" text,"Usual translation" text,"Chinese name \u00b9" text,"Japanese name" text,"Korean name \u00b2" text,"Vietnamese name" text,"Date \u00b3" text)
SELECT "Japanese name" FROM table_75545 WHERE "Korean name \u00b2" = '경칩 (驚蟄) gyeongchip'
What is the name of the venue where the game played had an away team of Melbourne?
CREATE TABLE table_name_5 (venue VARCHAR,away_team VARCHAR)
SELECT venue FROM table_name_5 WHERE away_team = "melbourne"
how many of the patients aged below 58 had a lab test for d-dimer?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "58" AND lab.label = "D-Dimer"
What is Case Suffix (Case), when English Meaning is 'to Georgia, in Georgia'?
CREATE TABLE table_76301 ("noun root (meaning)" text,"case suffix (case)" text,"postposition" text,"full word" text,"English meaning" text)
SELECT "case suffix (case)" FROM table_76301 WHERE "English meaning" = 'to georgia, in georgia'
Show party names and the number of events for each party, and rank Party_name in asc order.
CREATE TABLE party (Party_ID int,Minister text,Took_office text,Left_office text,Region_ID int,Party_name text)CREATE TABLE party_events (Event_ID int,Event_Name text,Party_ID int,Member_in_charge_ID int)CREATE TABLE region (Region_ID int,Region_name text,Date text,Label text,Format text,Catalogue text)CREATE TABLE mem...
SELECT Party_name, COUNT(*) FROM party_events AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID ORDER BY Party_name
Who is the player of the round with 80 fixtures?
CREATE TABLE table_21937 ("Round" text,"Main date" text,"Number of fixtures" real,"Clubs" text,"New entries this round" text,"Prize money" text,"Player of the Round" text)
SELECT "Player of the Round" FROM table_21937 WHERE "Number of fixtures" = '80'
what is diagnoses short title and procedure short title of subject id 25167?
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 diagnoses.short_title, procedures.short_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "25167"
What competition did the maccabi haifa fc club play?
CREATE TABLE table_name_87 (competition VARCHAR,club VARCHAR)
SELECT competition FROM table_name_87 WHERE club = "maccabi haifa fc"
My score on the algorithm tag.
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 Comments (Id number,PostId number,Score number,Text text,Creati...
SELECT SUM(A.Score) FROM Posts AS A JOIN Posts AS Q ON A.ParentId = Q.Id JOIN PostTags ON PostTags.PostId = Q.Id JOIN Tags ON PostTags.TagId = Tags.Id WHERE A.OwnerUserId = '##UserId##' AND A.PostTypeId = 2 AND Q.PostTypeId = 1 AND TagName = 'algorithm'
give me some restaurants in the bay area ?
CREATE TABLE geographic (city_name varchar,county varchar,region varchar)CREATE TABLE restaurant (id int,name varchar,food_type varchar,city_name varchar,rating "decimal)CREATE TABLE location (restaurant_id int,house_number int,street_name varchar,city_name varchar)
SELECT location.house_number, restaurant.name FROM location, restaurant WHERE restaurant.city_name IN (SELECT GEOGRAPHICalias0.city_name FROM geographic AS GEOGRAPHICalias0 WHERE GEOGRAPHICalias0.region = 'bay area') AND restaurant.id = location.restaurant_id
is ludvika ffl a d3 or a d2 ?
CREATE TABLE table_204_846 (id number,"tie no" number,"home team" text,"score" text,"away team" text,"attendance" number)
SELECT "away team" FROM table_204_846 WHERE "away team" = 'ludvika ffi'
What is the fleet size of the Vanguard 0-6-0dh class?
CREATE TABLE table_57524 ("Class" text,"Type" text,"Introduced" text,"Fleet Size" real,"Numbers" text)
SELECT "Fleet Size" FROM table_57524 WHERE "Class" = 'vanguard 0-6-0dh'
List all the participant ids and their details using a bar chart, and I want to order in asc by the bar.
CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Services (Service_ID INTEGER,Service_Type_Code CHAR(15))CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Eve...
SELECT Participant_Details, Participant_ID FROM Participants ORDER BY Participant_Details
PostTypeId of C++ Tag Wiki and Excerpt.
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 'Tag Wiki', PostTypeId FROM Posts WHERE Id = 3606997 UNION ALL SELECT 'Excerpt', PostTypeId FROM Posts WHERE Id = 3624963
What date has wrexham as the home team?
CREATE TABLE table_13314 ("Tie no" text,"Home team" text,"Score" text,"Away team" text,"Date" text)
SELECT "Date" FROM table_13314 WHERE "Home team" = 'wrexham'
Loss of lyon (5-4) had what score?
CREATE TABLE table_name_17 (score VARCHAR,loss VARCHAR)
SELECT score FROM table_name_17 WHERE loss = "lyon (5-4)"
among patients who were prescribed metoprolol tartrate 25 mg tablet after having been diagnosed with pancreatitis - with pseudocyst formation calculate the three year survival rate.
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,...
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
What tournament was Laura Davies the runner-up?
CREATE TABLE table_name_50 (tournament VARCHAR,runner_s__up VARCHAR)
SELECT tournament FROM table_name_50 WHERE runner_s__up = "laura davies"
What is the smallest rank for an industry of banking, a company of bank of america, and profits (billion $) larger than 16.47?
CREATE TABLE table_name_36 (rank INTEGER,profits__billion_$_ VARCHAR,industry VARCHAR,company VARCHAR)
SELECT MIN(rank) FROM table_name_36 WHERE industry = "banking" AND company = "bank of america" AND profits__billion_$_ > 16.47
count the number of medicines that have been prescribed to patient 033-7332 since 32 months ago.
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean num...
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-7332')) AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(),...
what is the total number of census designated places with a population of 10581?
CREATE TABLE table_2741 ("Rank" real,"Census-designated place" text,"Metropolitan area" text,"State" text,"Population (2000 census)" real,"Land area (mi 2)" text,"Population density (people per mi 2)" text)
SELECT COUNT("Census-designated place") FROM table_2741 WHERE "Population (2000 census)" = '10581'
how many patients died after being diagnosed this year with chr osteomyelit-l/leg within 2 months?
CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type t...
SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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_icd_diagnoses WHERE d_icd_di...
Please give me a pie chart to show the number of home cities of all drivers, show by the x axis from low to high.
CREATE TABLE driver (Driver_ID int,Name text,Party text,Home_city text,Age int)CREATE TABLE school (School_ID int,Grade text,School text,Location text,Type text)CREATE TABLE school_bus (School_ID int,Driver_ID int,Years_Working int,If_full_time bool)
SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city ORDER BY Home_city
Draw a bar chart for what is minimum age for different job title?, and I want to rank in desc by the y axis.
CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT)CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)
SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY MIN(age) DESC
Bar chart of the total number from each headquarters, order in asc by the Headquarters.
CREATE TABLE gas_station (Station_ID int,Open_Year int,Location text,Manager_Name text,Vice_Manager_Name text,Representative_Name text)CREATE TABLE station_company (Station_ID int,Company_ID int,Rank_of_the_Year int)CREATE TABLE company (Company_ID int,Rank int,Company text,Headquarters text,Main_Industry text,Sales_bi...
SELECT Headquarters, COUNT(*) FROM company GROUP BY Headquarters ORDER BY Headquarters
What day was the score 3-0 after 2011?
CREATE TABLE table_11542 ("Year" real,"Date" text,"Location" text,"Score" text,"Result" text)
SELECT "Date" FROM table_11542 WHERE "Score" = '3-0' AND "Year" = '2011'
What is Date, when Team is Holden Racing Team, and when Circuit is Eastern Creek Raceway?
CREATE TABLE table_44748 ("Date" text,"Series" text,"Circuit" text,"City / State" text,"Winner" text,"Team" text)
SELECT "Date" FROM table_44748 WHERE "Team" = 'holden racing team' AND "Circuit" = 'eastern creek raceway'
What was the result for the total of 12?
CREATE TABLE table_73945 ("Rank" real,"Couple" text,"Judges" real,"Public" real,"Total" real,"Vote percentage" text,"Result" text)
SELECT "Result" FROM table_73945 WHERE "Total" = '12'
What circuit did Innes Ireland win at for the I lombank trophy?
CREATE TABLE table_name_35 (circuit VARCHAR,winning_driver VARCHAR,race_name VARCHAR)
SELECT circuit FROM table_name_35 WHERE winning_driver = "innes ireland" AND race_name = "i lombank trophy"
What was the result of the game seen by 31095 people?
CREATE TABLE table_18207285_2 (result VARCHAR,attendance VARCHAR)
SELECT result FROM table_18207285_2 WHERE attendance = 31095
What kind of Social Sec Leeds has a Media Officer of jason james and a Treasurer of james davidson?
CREATE TABLE table_8085 ("Season" text,"President" text,"General Sec" text,"Treasurer" text,"Fixtures Sec" text,"Social Sec Bradford" text,"Social Sec Leeds" text,"Media Officer" text)
SELECT "Social Sec Leeds" FROM table_8085 WHERE "Media Officer" = 'jason james' AND "Treasurer" = 'james davidson'
how many patients whose diagnoses icd9 code is 57450 and lab test abnormal status is delta?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "57450" AND lab.flag = "delta"
What is the largest overall where the position was linebacker and the pick number was more than 9?
CREATE TABLE table_34290 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT MAX("Overall") FROM table_34290 WHERE "Position" = 'linebacker' AND "Pick #" > '9'
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the trend about commission_pct over hire_date .
CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),CO...
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
What is the smallest number of medals a country with more than 14 silver has?
CREATE TABLE table_name_78 (total INTEGER,silver INTEGER)
SELECT MIN(total) FROM table_name_78 WHERE silver > 14
On buses ranging in numbr 401-484, what is the lowest width that one longer thna 25 feet can have?
CREATE TABLE table_10327 ("Year" text,"Builder and model name" text,"Length (feet)" real,"Width (inches)" real,"Engine" text,"Numbers" text,"Retired" text)
SELECT MIN("Width (inches)") FROM table_10327 WHERE "Length (feet)" > '25' AND "Numbers" = '401-484'
who had the high rebounds when the game number was 6?
CREATE TABLE table_77549 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High rebounds" FROM table_77549 WHERE "Game" = '6'
What is the average total 0 are nominated by the Taoiseach and the agricultural panel is greater than 5?
CREATE TABLE table_41098 ("Administrative Panel" real,"Agricultural Panel" real,"Cultural and Educational Panel" real,"Industrial and Commercial Panel" real,"Labour Panel" real,"National University of Ireland" real,"University of Dublin" real,"Nominated by the Taoiseach" real,"Total" real)
SELECT AVG("Total") FROM table_41098 WHERE "Nominated by the Taoiseach" = '0' AND "Agricultural Panel" > '5'
Which conventional plan has a POS of 13%?
CREATE TABLE table_7111 ("Year" real,"Conventional plans" text,"HMOs" text,"PPOs" text,"POS plans" text)
SELECT "Conventional plans" FROM table_7111 WHERE "POS plans" = '13%'
tell me the amount of output (ml)-icp/ventriculostomy ventricular drainage catheter with icp microsensor right frontal region patient 006-232560 had until 11 days ago.
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,disch...
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 = '006-232560')) AND intakeoutput.celllabel = 'outp...
What was the overall pick for Doug Sproule of the United States?
CREATE TABLE table_56996 ("Round" real,"Overall" real,"Player" text,"Nationality" text,"Club team" text)
SELECT "Overall" FROM table_56996 WHERE "Nationality" = 'united states' AND "Player" = 'doug sproule'
Draw a bar chart about the distribution of other_details and the average of monthly_rental , and group by attribute other_details.
CREATE TABLE Ref_Detention_Type (detention_type_code VARCHAR(10),detention_type_description VARCHAR(80))CREATE TABLE Addresses (address_id INTEGER,line_1 VARCHAR(120),line_2 VARCHAR(120),line_3 VARCHAR(120),city VARCHAR(80),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VARCHAR(50),other_address_det...
SELECT other_details, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC
Which Run 3 has a Run 1 of 2:20.10?
CREATE TABLE table_45518 ("Rank" text,"Team" text,"Athletes" text,"Run 1" text,"Run 2" text,"Run 3" text,"Run 4" text,"Final" text)
SELECT "Run 3" FROM table_45518 WHERE "Run 1" = '2:20.10'
What Source has an Attack of 9,77%?
CREATE TABLE table_name_8 (source VARCHAR,attack VARCHAR)
SELECT source FROM table_name_8 WHERE attack = "9,77%"
What is the average number of cuts made in events with fewer than 1 win and exactly 11 top-10s?
CREATE TABLE table_39581 ("Tournament" text,"Wins" real,"Top-5" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT AVG("Cuts made") FROM table_39581 WHERE "Top-10" = '11' AND "Wins" < '1'
what's the party with opponent being marcy kaptur (d) 75.3% randy whitman (r) 24.7%
CREATE TABLE table_690 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Status" text,"Opponent" text)
SELECT "Party" FROM table_690 WHERE "Opponent" = 'Marcy Kaptur (D) 75.3% Randy Whitman (R) 24.7%'
late answers that were accepted and most likely have highest score.
CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE FlagTypes (Id number,Na...
SELECT COUNT(DISTINCT (q.Id)) FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id INNER JOIN Posts AS aa ON aa.ParentId = q.Id WHERE q.PostTypeId = 1 AND a.PostTypeId = 2 AND aa.PostTypeId = 2 AND q.AcceptedAnswerId = a.Id AND q.AnswerCount >= 2 AND DATEDIFF(DAY, q.CreationDate, CreationDate) <= 7 AND DATEDIFF(D...
What is the President with a Year larger than 2011, and a Date with 23 may?
CREATE TABLE table_name_31 (president VARCHAR,year VARCHAR,date VARCHAR)
SELECT president FROM table_name_31 WHERE year > 2011 AND date = "23 may"
What is the average number of draws that have a total of 1 and a goal difference of 2:0?
CREATE TABLE table_name_67 (draws INTEGER,total VARCHAR,goal_difference VARCHAR)
SELECT AVG(draws) FROM table_name_67 WHERE total = 1 AND goal_difference = "2:0"
What are the fewest partial failures associated with 1 launch, India, gslv type, and a Rocket of gslv mk ii?
CREATE TABLE table_37281 ("Rocket" text,"Country" text,"Type" text,"Launches" real,"Successes" real,"Failures" real,"Partial failures" real)
SELECT MIN("Partial failures") FROM table_37281 WHERE "Launches" = '1' AND "Country" = 'india' AND "Type" = 'gslv' AND "Rocket" = 'gslv mk ii'
What is the first year for Popgun?
CREATE TABLE table_name_41 (first_year VARCHAR,title VARCHAR)
SELECT first_year FROM table_name_41 WHERE title = "popgun"
For MKT 601 what are the course prerequisites ?
CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comm...
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'MKT' AND COURSE_0.number =...
what is the maximum yearly number of patients who had s/p thoracotomy - decortication until 2104?
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 vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number...
SELECT MAX(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 's/p thoracotomy - decortication' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104' GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1
What is Updated In Past 30 Days, when Registration is 'Open to people 13 and over'?
CREATE TABLE table_47182 ("Name" text,"Year Began" text,"s Registered user" text,"Updated in past 30 days" text,"Registration" text,"Ability to syndicate off-site feeds" text,"Userpics Free" text,"Userpics Paid" text,"Monthly Cost for Paid Account" text,"Yearly Cost for Paid Account" text,"Permanent Account" text)
SELECT "Updated in past 30 days" FROM table_47182 WHERE "Registration" = 'open to people 13 and over'
What was the original airdate of episode #733?
CREATE TABLE table_3378 ("Episode #" real,"The W\u00f8rd" text,"Guest" text,"Introductory phrase" text,"Original airdate" text,"Production code" real)
SELECT "Original airdate" FROM table_3378 WHERE "Episode #" = '733'
When dydek (11) has the highest rebounds what is the date?
CREATE TABLE table_18904831_6 (date VARCHAR,high_rebounds VARCHAR)
SELECT date FROM table_18904831_6 WHERE high_rebounds = "Dydek (11)"
Top viewed posts with suck in the title.
CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance...
SELECT Id AS "post_link", Score, ViewCount FROM Posts WHERE Title LIKE '%##Word##%' ORDER BY ViewCount DESC LIMIT 50
What venue has 3 & 2 as the score, and 1965 as the year?
CREATE TABLE table_name_83 (venue VARCHAR,score VARCHAR,year VARCHAR)
SELECT venue FROM table_name_83 WHERE score = "3 & 2" AND year = "1965"
When is the earliest began operation with a length of sultan ismail and over 27 stations?
CREATE TABLE table_name_7 (began_operation INTEGER,length__km_ VARCHAR,stations VARCHAR)
SELECT MIN(began_operation) FROM table_name_7 WHERE length__km_ = "sultan ismail" AND stations > 27
For all employees who have the letters D or S in their first name, return a scatter chart about the correlation between salary and manager_id .
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME varchar(25))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STAT...
SELECT SALARY, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
what is the grid when the time/retired is +9 laps and the laps is larger than 91?
CREATE TABLE table_name_18 (grid VARCHAR,time_retired VARCHAR,laps VARCHAR)
SELECT COUNT(grid) FROM table_name_18 WHERE time_retired = "+9 laps" AND laps > 91
i want to find the first flight from BALTIMORE to BOSTON that serves a meal
CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_miles int,pressurized varchar)CREATE TABLE food_service (meal_code tex...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight, food_service WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_airport = AIRPORT_SERVICE_1.airport_code AND food_se...
What is the year with 116 laps?
CREATE TABLE table_name_48 (year VARCHAR,laps VARCHAR)
SELECT year FROM table_name_48 WHERE laps = 116
Display the first name, and department number for all employees whose last name is 'McEwen'.
CREATE TABLE employees (first_name VARCHAR,department_id VARCHAR,last_name VARCHAR)
SELECT first_name, department_id FROM employees WHERE last_name = 'McEwen'
Find user with given email.
CREATE TABLE VoteTypes (Id number,Name text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE...
SELECT * FROM Users
Which position had a pick larger than 80 and Walt Mainer as a player?
CREATE TABLE table_name_7 (position VARCHAR,pick VARCHAR,player VARCHAR)
SELECT position FROM table_name_7 WHERE pick > 80 AND player = "walt mainer"
Name the represents for los alcarrizos
CREATE TABLE table_26301697_2 (represents VARCHAR,hometown VARCHAR)
SELECT represents FROM table_26301697_2 WHERE hometown = "Los Alcarrizos"
During which years did player number 35 play for Jazz?
CREATE TABLE table_255 ("Player" text,"No." text,"Nationality" text,"Position" text,"Years for Jazz" text,"School/Club Team" text)
SELECT "Years for Jazz" FROM table_255 WHERE "No." = '35'
What was the nationality of the winner on December 8, 1968?
CREATE TABLE table_name_99 (country VARCHAR,date VARCHAR)
SELECT country FROM table_name_99 WHERE date = "december 8, 1968"
What championship after 1997 was the score 1 6, 4 6, 7 5, 5 7?
CREATE TABLE table_77240 ("Outcome" text,"Year" real,"Championship" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Championship" FROM table_77240 WHERE "Year" > '1997' AND "Score" = '1–6, 4–6, 7–5, 5–7'
Visualize a pie chart with what are the different role codes for users, and how many users have each?
CREATE TABLE Documents (document_code VARCHAR(15),document_structure_code VARCHAR(15),document_type_code VARCHAR(15),access_count INTEGER,document_name VARCHAR(80))CREATE TABLE Images (image_id INTEGER,image_alt_text VARCHAR(80),image_name VARCHAR(40),image_url VARCHAR(255))CREATE TABLE Document_Sections (section_id IN...
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code
how did patient 26849 first enter the hospital a year before.
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)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)C...
SELECT admissions.admission_type FROM admissions WHERE admissions.subject_id = 26849 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.admittime LIMIT 1
what is the minimum age of patients who are diagnosed with primary disease aortic insufficiency\re-do sternotomy aortic valve replacement and stayed in hospital for 20 days?
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT MIN(demographic.age) FROM demographic WHERE demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " AND demographic.days_stay = "20"
What is the highest number of points for a position less than 3 and less than 1 loss?
CREATE TABLE table_39868 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text)
SELECT MAX("Points") FROM table_39868 WHERE "Position" < '3' AND "Lost" < '1'
What is the hometown of the player who is headed to Duke?
CREATE TABLE table_name_83 (hometown VARCHAR,college VARCHAR)
SELECT hometown FROM table_name_83 WHERE college = "duke"
Who is the s color commentator when the pregame host is jon sciambi?
CREATE TABLE table_2941848_10 (s_color_commentator VARCHAR,pregame_hosts VARCHAR)
SELECT s_color_commentator FROM table_2941848_10 WHERE pregame_hosts = "Jon Sciambi"
What is the position for the player becchio?
CREATE TABLE table_29423 ("R" real,"Player" text,"Position" text,"The Championship" real,"FA Cup" real,"League Cup" real,"Total" real)
SELECT "Position" FROM table_29423 WHERE "Player" = 'Becchio'
How many entries are there for cyrillic name other names where settlement is idvor?
CREATE TABLE table_27877 ("Settlement" text,"Cyrillic Name Other Names" text,"Type" text,"Population (2011)" real,"Largest ethnic group (2002)" text,"Dominant religion (2002)" text)
SELECT COUNT("Cyrillic Name Other Names") FROM table_27877 WHERE "Settlement" = 'Idvor'
What is the item id of Paul Edwards?
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 lab.itemid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Paul Edwards"