instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
How many wins or losses were there when the record was 3-0?
CREATE TABLE table_20850527_1 (result VARCHAR,record VARCHAR)
SELECT COUNT(result) FROM table_20850527_1 WHERE record = "3-0"
Which Masaaki Mochizuki has a Gran Hamada of hamada (10:47)?
CREATE TABLE table_11753 ("Block A" text,"Gran Hamada" text,"Koji Kanemoto" text,"Jushin Liger" text,"Masaaki Mochizuki" text,"Super Shocker" text,"Tatsuhito Takaiwa" text)
SELECT "Masaaki Mochizuki" FROM table_11753 WHERE "Gran Hamada" = 'hamada (10:47)'
What was the final score at Heinz Field?
CREATE TABLE table_67158 ("Date" text,"Visiting team" text,"Final score" text,"Host team" text,"Stadium" text)
SELECT "Final score" FROM table_67158 WHERE "Stadium" = 'heinz field'
Which country has a rank of 2?
CREATE TABLE table_53506 ("Rank" real,"Player" text,"Country" text,"Earnings($)" real,"Wins" real)
SELECT "Country" FROM table_53506 WHERE "Rank" = '2'
what flights are available from PHILADELPHIA to DENVER on SUNDAY
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE d...
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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'SUNDAY' AND flight.flight_days = days.days_code AND fl...
How many titles does the episode written by Joe Toplyn have?
CREATE TABLE table_28048 ("Series no." real,"No. in season" real,"Title" text,"Written by" text,"Directed by" text,"Original air date" text)
SELECT COUNT("Title") FROM table_28048 WHERE "Written by" = 'Joe Toplyn'
Name the population of maryborough when population of woocoo is 2700
CREATE TABLE table_536 ("Year" real,"Population (Region total)" real,"Population (Maryborough)" real,"Population (Hervey Bay)" real,"Population (Woocoo)" real,"Population (Tiaro)" real)
SELECT "Population (Maryborough)" FROM table_536 WHERE "Population (Woocoo)" = '2700'
What was the record when chicago was the home team?
CREATE TABLE table_name_63 (record VARCHAR,home VARCHAR)
SELECT record FROM table_name_63 WHERE home = "chicago"
calculate the survival rate for three year among the patients who were prescribed nifedipine cr after being diagnosed with renal & ureteral dis nos.
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 prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,dru...
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
What position does Mikhail Kravets play?
CREATE TABLE table_37435 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team" text)
SELECT "Position" FROM table_37435 WHERE "Player" = 'mikhail kravets'
What rank was Peru with a total greater than 3?
CREATE TABLE table_44306 ("Rank" real,"Country" text,"Miss United Continent" real,"Virreina" real,"1st RU" real,"2nd RU" real,"3rd RU" real,"4th RU" real,"Semifinalists" real,"Total" real)
SELECT MAX("Rank") FROM table_44306 WHERE "Country" = 'peru' AND "Total" > '3'
Tell me the total number of attendance for week of 16
CREATE TABLE table_31701 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real)
SELECT COUNT("Attendance") FROM table_31701 WHERE "Week" = '16'
Name the year that Birds of a feather category for most popular actress was nominated
CREATE TABLE table_53439 ("Year" real,"Nominated For" text,"Award" text,"Category" text,"Result" text)
SELECT AVG("Year") FROM table_53439 WHERE "Category" = 'most popular actress' AND "Nominated For" = 'birds of a feather'
In the match where footscray was the home team, how much did they score?
CREATE TABLE table_name_55 (home_team VARCHAR)
SELECT home_team AS score FROM table_name_55 WHERE home_team = "footscray"
What is the highest league goals that have barry endean as the name, wirh FA cup apps greater than 0?
CREATE TABLE table_64902 ("Name" text,"Position" text,"League Apps" text,"League Goals" real,"FA Cup Apps" real,"FA Cup Goals" real,"League Cup Apps" text,"League Cup Goals" real,"Total Apps" text,"Total Goals" real)
SELECT MAX("League Goals") FROM table_64902 WHERE "Name" = 'barry endean' AND "FA Cup Apps" > '0'
Find all the customer information in state NY.
CREATE TABLE CUSTOMER (State VARCHAR)
SELECT * FROM CUSTOMER WHERE State = "NY"
How many sales had a peak position of 1 and a certification of 6x platinum?
CREATE TABLE table_65982 ("Rank" real,"Artist" text,"Album" text,"Peak position" real,"Sales" real,"Certification" text)
SELECT COUNT("Sales") FROM table_65982 WHERE "Peak position" = '1' AND "Certification" = '6x platinum'
what is the season when the third is shawn rojeski?
CREATE TABLE table_name_96 (season VARCHAR,third VARCHAR)
SELECT season FROM table_name_96 WHERE third = "shawn rojeski"
provide the number of patients whose primary disease is acidosis and year of death is less than or equal to 2154?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marita...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ACIDOSIS" AND demographic.dod_year <= "2154.0"
What village has an area of 27.19 km2?
CREATE TABLE table_28164 ("Village" text,"Area km\u00b2" text,"Population (2000 census)" real,"Region" text,"Pop. Density" real)
SELECT "Village" FROM table_28164 WHERE "Area km\u00b2" = '27.19'
How Rich Are The 1%?. Occupy Stack overflow!
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...
WITH percentile AS (SELECT NTILE(100) OVER (ORDER BY Reputation DESC) AS p, Reputation, DisplayName FROM Users) SELECT 'The ' + CASE p WHEN 1 THEN '1' ELSE '99' END + '%' AS Who, SUM(Reputation) AS Rep FROM percentile GROUP BY CASE p WHEN 1 THEN '1' ELSE '99' END
What was the jersey number(s) when the position was SG from North Carolina?
CREATE TABLE table_45995 ("Player" text,"Nationality" text,"Jersey Number(s)" real,"Position" text,"Years" text,"From" text)
SELECT "Jersey Number(s)" FROM table_45995 WHERE "Position" = 'sg' AND "From" = 'north carolina'
Which award was won by Gloria Stuart after 1984?
CREATE TABLE table_52798 ("Superlative" text,"Actress" text,"Record Set" text,"Year" real,"Notes" text)
SELECT "Superlative" FROM table_52798 WHERE "Year" > '1984' AND "Actress" = 'gloria stuart'
What is the Match with Points that are 24?
CREATE TABLE table_name_11 (match VARCHAR,points VARCHAR)
SELECT match FROM table_name_11 WHERE points = 24
show me all round trips from NEW YORK to MIAMI leaving on TUESDAY
CREATE TABLE equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE fare (fare_id int,from_airport varchar,to_airport varchar,fare_basis_code text,fare_airline text,restriction_code text,one_direction_cost int,round_trip_cost int,round_trip_required varchar)CREATE TABLE city (city_code va...
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, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((DAYS_0.day_name = 'TUESDAY' AND DAYS_1.day_name = 'TUESDAY' AND fare_basis.basis_days = DAYS_1.d...
When rank is 5, what is the rowers?
CREATE TABLE table_64184 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text)
SELECT "Rowers" FROM table_64184 WHERE "Rank" = '5'
What are the total amount of numbers on the Toronto team in 2005-06?
CREATE TABLE table_10015132_9 (no VARCHAR,years_in_toronto VARCHAR)
SELECT COUNT(no) FROM table_10015132_9 WHERE years_in_toronto = "2005-06"
Name the episode summary for torae carr
CREATE TABLE table_2140071_12 (episode VARCHAR,coach VARCHAR)
SELECT episode AS Summary FROM table_2140071_12 WHERE coach = "Torae Carr"
What is the id for the employee called Ebba?
CREATE TABLE Employees (employee_ID VARCHAR,employee_name VARCHAR)
SELECT employee_ID FROM Employees WHERE employee_name = "Ebba"
when was the premiere of the episode called 'force recon'?
CREATE TABLE table_25521 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text)
SELECT "Original air date" FROM table_25521 WHERE "Title" = 'Force Recon'
what is the name of a procedure that patient 73713 has been given for two times since 11/2105?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx text,dose_unit_rx text,route text)CREATE TABLE outputevents (row_id number,subject_id number,hadm_id n...
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 737...
what is the cost for glucose, pleural lab testing?
CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location...
SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose, pleural'))
When Anchero Pantaleone was the elector what is under nationality?
CREATE TABLE table_47751 ("Elector" text,"Nationality" text,"Order and title" text,"Elevated" text,"Elevator" text)
SELECT "Nationality" FROM table_47751 WHERE "Elector" = 'anchero pantaleone'
Which Winner has a Trofeo Fast Team of metauro mobili-pinarello, and a General classification of giuseppe saronni?
CREATE TABLE table_name_78 (winner VARCHAR,trofeo_fast_team VARCHAR,general_classification VARCHAR)
SELECT winner FROM table_name_78 WHERE trofeo_fast_team = "metauro mobili-pinarello" AND general_classification = "giuseppe saronni"
How many elections are there?
CREATE TABLE election (Id VARCHAR)
SELECT COUNT(*) FROM election
What college did Francis Bellefroid go to?
CREATE TABLE table_28059992_6 (college VARCHAR,player VARCHAR)
SELECT college FROM table_28059992_6 WHERE player = "Francis Bellefroid"
Posts honored by VoteType 4.
CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoR...
SELECT Id, CreationDate, PostId AS "post_link", 'site://q/' + CAST(PostId AS TEXT) + '|Link' AS "working_link" FROM Votes WHERE VoteTypeId = 4 ORDER BY Id
What's the Proto-Germanic when the Old English is /d/?
CREATE TABLE table_66287 ("Proto-Germanic" text,"West Germanic" text,"Old English" text,"German" text,"Dutch" text)
SELECT "Proto-Germanic" FROM table_66287 WHERE "Old English" = '/d/'
Find the first name and gpa of the students whose gpa is lower than the average gpa of all students Plot them as bar chart, I want to rank by the bar in desc.
CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE STUDENT (STU_NUM int,STU_LNAME varchar(15),STU_FNAME varchar(15),STU_INIT varchar(1),STU_DOB datetime,STU_HRS int,STU_CLASS varchar(2),STU_GPA float(8),STU_TRANSFER numeric,DEPT_CODE varchar(18),...
SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME ORDER BY STU_FNAME DESC
What is the km2 area with more than 8,328 people with a total of 121.14 km2?
CREATE TABLE table_55277 ("Province" text,"Comune" text,"Population (inh.)" real,"Area (km\u00b2)" real,"Total (km\u00b2)" real)
SELECT AVG("Area (km\u00b2)") FROM table_55277 WHERE "Population (inh.)" > '8,328' AND "Total (km\u00b2)" > '121.14'
What is the Total for the Player who won after 1983 with less than 4 To par?
CREATE TABLE table_41509 ("Player" text,"Country" text,"Year won" real,"Total" real,"To par" real)
SELECT AVG("Total") FROM table_41509 WHERE "To par" < '4' AND "Year won" > '1983'
What Country is the John S. McCain Ship from?
CREATE TABLE table_name_47 (country VARCHAR,ship VARCHAR)
SELECT country FROM table_name_47 WHERE ship = "john s. mccain"
Who drove the dodge with a car # less than 5?
CREATE TABLE table_51236 ("Driver" text,"Car #" real,"Make" text,"Points" real,"Laps" real,"Winnings" text)
SELECT "Driver" FROM table_51236 WHERE "Car #" < '5' AND "Make" = 'dodge'
Which college has a defensive end with a round less than 6?
CREATE TABLE table_33955 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text)
SELECT "College" FROM table_33955 WHERE "Round" > '6' AND "Position" = 'defensive end'
On 15/04/07 in the competition Super League XII, what was the score?
CREATE TABLE table_57482 ("Date" text,"Home Team" text,"Score" text,"Away Team" text,"Goals" text,"Attendance" real,"Competition" text)
SELECT "Score" FROM table_57482 WHERE "Competition" = 'super league xii' AND "Date" = '15/04/07'
What is the smallest 8-car sets if 4-car sets is 47?
CREATE TABLE table_2019 ("Fiscal year" real,"2-car sets" real,"4-car sets" real,"6-car sets" real,"8-car sets" real,"Total vehicles" real)
SELECT MIN("8-car sets") FROM table_2019 WHERE "4-car sets" = '47'
What is the smallest decile with an Area of otumoetai?
CREATE TABLE table_name_60 (decile INTEGER,area VARCHAR)
SELECT MIN(decile) FROM table_name_60 WHERE area = "otumoetai"
Which country had a tower destroyed in 1899?
CREATE TABLE table_80263 ("Tower" text,"Year" text,"Country" text,"Town" text,"Pinnacle height" text)
SELECT "Country" FROM table_80263 WHERE "Year" = '1899'
What is the lowest number of top 10 finishes
CREATE TABLE table_1875157_1 (top_10 INTEGER)
SELECT MIN(top_10) FROM table_1875157_1
what episode is called jewboy
CREATE TABLE table_name_20 (episodes VARCHAR,title VARCHAR)
SELECT episodes FROM table_name_20 WHERE title = "jewboy"
What was the date of the game when the record was 66-38?
CREATE TABLE table_name_54 (date VARCHAR,record VARCHAR)
SELECT date FROM table_name_54 WHERE record = "66-38"
What is the nationality of the player kevin stevens?
CREATE TABLE table_3651 ("Pick #" real,"Player" text,"Position" text,"Nationality" text,"NHL team" text,"College/junior/club team" text)
SELECT "Nationality" FROM table_3651 WHERE "Player" = 'Kevin Stevens'
have the arterial bp [diastolic] of patient 739 remained normal on the current intensive care unit visit?
CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE transfers (row_id nu...
SELECT 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 = 739) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items...
give me the number of patients whose ethnicity is hispanic or latino and lab test name is calculated total co2?
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC OR LATINO" AND lab.label = "Calculated Total CO2"
What position belonged to the player from Paramus, New Jersey?
CREATE TABLE table_11677691_10 (position VARCHAR,hometown VARCHAR)
SELECT position FROM table_11677691_10 WHERE hometown = "Paramus, New Jersey"
Which competition occurred after 1980 with a score of 0:5 in Jerusalem?
CREATE TABLE table_name_51 (competition VARCHAR,location VARCHAR,year VARCHAR,score VARCHAR)
SELECT competition FROM table_name_51 WHERE year > 1980 AND score = "0:5" AND location = "jerusalem"
when patient 028-43966 heartrate first measured until 02/05/2105?
CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE lab (labi...
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-43966')) AND NOT vitalperiodic.heartrate IS NUL...
what were the top five most frequent diagnoses for the patients with age 40s since 2100.
CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,dr...
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', diagnosis.diagnosistime) >= '2100' GROUP BY diagnosis....
are there any flights before 1200 on 6 15 from LONG BEACH to COLUMBUS
CREATE TABLE code_description (code varchar,description text)CREATE TABLE compartment_class (compartment varchar,class_type varchar)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,...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 15 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
Name the opponent for week 12
CREATE TABLE table_14418812_1 (opponent VARCHAR,week VARCHAR)
SELECT opponent FROM table_14418812_1 WHERE week = 12
Which home team has an Away team score of 19.12 (126)?
CREATE TABLE table_12021 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Home team" FROM table_12021 WHERE "Away team score" = '19.12 (126)'
How many tree species are there when the total plant species is 113?
CREATE TABLE table_20914 ("Central Forest Reserve" text,"Size in km\u00b2" real,"Total plant species" real,"Tree species" real,"Endemic" real,"Threatened (CR,VU,EN)" real)
SELECT COUNT("Tree species") FROM table_20914 WHERE "Total plant species" = '113'
WHAT IS THE 2011 PERFORMANCE FOR TOURNAMENTS PLAYED?
CREATE TABLE table_name_48 (tournament VARCHAR)
SELECT 2011 FROM table_name_48 WHERE tournament = "tournaments played"
How many games have rebounds larger than 1048?
CREATE TABLE table_48224 ("Rank" real,"Player" text,"Years" text,"Games" real,"Reb. Avg." real,"Total Rebounds" real)
SELECT COUNT("Games") FROM table_48224 WHERE "Total Rebounds" > '1048'
What is the host year of city 'Taizhou ( Zhejiang )'?
CREATE TABLE temperature (city_id number,jan number,feb number,mar number,apr number,jun number,jul number,aug number,sep number,oct number,nov number,dec number)CREATE TABLE city (city_id number,city text,hanzi text,hanyu_pinyin text,regional_population number,gdp number)CREATE TABLE hosting_city (year number,match_id...
SELECT T2.year FROM city AS T1 JOIN hosting_city AS T2 ON T1.city_id = T2.host_city WHERE T1.city = "Taizhou ( Zhejiang )"
Show id and location of railways that are associated with more than one train.
CREATE TABLE train (Railway_ID VARCHAR)CREATE TABLE railway (Location VARCHAR,Railway_ID VARCHAR)
SELECT T2.Railway_ID, T1.Location FROM railway AS T1 JOIN train AS T2 ON T1.Railway_ID = T2.Railway_ID GROUP BY T2.Railway_ID HAVING COUNT(*) > 1
please list the flights taking off and landing on MKE airport
CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_flight_number int,dual_airline varchar,service_name text)CREATE TABLE equipment_sequence (aircraft_code_s...
SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE')
tell me the number of widow patients who have lab test item id 50973.
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.itemid = "50973"
How many extra points catagories are there for the na player?
CREATE TABLE table_3364 ("Player" text,"Touchdowns" real,"Extra points" real,"Field goals" real,"Safeties" real,"Points" real)
SELECT COUNT("Extra points") FROM table_3364 WHERE "Player" = 'na'
What was the final score of the game on June 17?
CREATE TABLE table_54399 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Score" FROM table_54399 WHERE "Date" = 'june 17'
when did patient 017-88691 last have sodium maximum since 12/2105?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number...
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 = '017-88691')) AND lab.labname = 'sodium' AND STRFTIME('%y-%m', lab.labresulttime) >=...
What area has a percentage of other of 3%?
CREATE TABLE table_name_13 (area VARCHAR,_percentage_other VARCHAR)
SELECT area FROM table_name_13 WHERE _percentage_other = "3%"
what's the function / genus with shigella being spa32
CREATE TABLE table_10321124_1 (↓_function___genus_→ VARCHAR,shigella VARCHAR)
SELECT ↓_function___genus_→ FROM table_10321124_1 WHERE shigella = "Spa32"
What opponent has a record of 86-62?
CREATE TABLE table_79724 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text)
SELECT "Opponent" FROM table_79724 WHERE "Record" = '86-62'
What is the Branding with a Callsign DWLL?
CREATE TABLE table_name_99 (branding VARCHAR,callsign VARCHAR)
SELECT branding FROM table_name_99 WHERE callsign = "dwll"
What is the amount of trees, that require replacement when the district is motovilikhinsky?
CREATE TABLE table_10342194_3 (amount_of_trees VARCHAR,_that_require_replacement VARCHAR,district VARCHAR)
SELECT amount_of_trees, _that_require_replacement FROM table_10342194_3 WHERE district = "Motovilikhinsky"
what were the top five most frequent specimen test for patients within the same month after the diagnosis of valvular insufficiency - mitral valve?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,discha...
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'valvular insufficiency - mitral valve') AS t...
On Mondays and Wednesday is 545 available to take ?
CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE program_requirement (program_id int,categor...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
What is Segment B for series episode 12-02?
CREATE TABLE table_19882 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text)
SELECT "Segment B" FROM table_19882 WHERE "Series Ep." = '12-02'
count the number of patients whose procedure long title is thoracentesis and lab test category is blood gas?
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 diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Thoracentesis" AND lab."CATEGORY" = "Blood Gas"
which religious denomination had a higher percentage in 1900 , jewish or roman catholic ?
CREATE TABLE table_203_857 (id number,"denomination" text,"1870" text,"1880" text,"1890" text,"1900" text,"1910" text,"1920" text,"1930" text,"1941" text,"1949" text,"2001" text,"2011" text)
SELECT "denomination" FROM table_203_857 WHERE "denomination" IN ('jewish', 'roman catholic') ORDER BY "1900" DESC LIMIT 1
Name the series for game 5
CREATE TABLE table_name_12 (series VARCHAR,game VARCHAR)
SELECT series FROM table_name_12 WHERE game = "game 5"
count the number of patients whose ethnicity is asian and diagnosis long title is suicide and self-inflicted injury by hanging.
CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "ASIAN" AND diagnoses.long_title = "Suicide and self-inflicted injury by hanging"
Who won a medal at the 2008 Beijing Olympics?
CREATE TABLE table_38770 ("Medal" text,"Name" text,"Games" text,"Sport" text,"Event" text)
SELECT "Name" FROM table_38770 WHERE "Games" = '2008 beijing'
2016 answers by users with no answers before 2016.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,...
SELECT A.Id AS "post_link", A.Score, U.DisplayName FROM Posts AS A JOIN Users AS U ON A.OwnerUserId = U.Id WHERE YEAR(A.CreationDate) = 2017 AND A.PostTypeId = 2 AND NOT EXISTS(SELECT * FROM Posts AS A2 WHERE A2.OwnerUserId = U.Id AND YEAR(A2.CreationDate) < 2016 AND A2.PostTypeId = 2) ORDER BY A.Score DESC
Name the ground for essendon
CREATE TABLE table_72782 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text,"Time" text)
SELECT "Ground" FROM table_72782 WHERE "Home team" = 'Essendon'
how long has she been making films ?
CREATE TABLE table_203_18 (id number,"year" number,"film" text,"role" text,"co-star" text,"director" text,"notes" text)
SELECT (SELECT MAX("year") FROM table_203_18) - (SELECT MIN("year") FROM table_203_18)
What driver has 44 laps?
CREATE TABLE table_54445 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT "Driver" FROM table_54445 WHERE "Laps" = '44'
When 3.29% was the average per candidate, what was the number of average votes per candidate?
CREATE TABLE table_28819393_1 (average_votes_per_candidate INTEGER,average__percentage_of_vote_per_candidate VARCHAR)
SELECT MIN(average_votes_per_candidate) FROM table_28819393_1 WHERE average__percentage_of_vote_per_candidate = "3.29"
What is the Results that was a friendly game and played on June 25?
CREATE TABLE table_name_12 (results¹ VARCHAR,type_of_game VARCHAR,date VARCHAR)
SELECT results¹ FROM table_name_12 WHERE type_of_game = "friendly" AND date = "june 25"
What is Country, when Place is 'T9', and when Player is 'Jay Hebert'?
CREATE TABLE table_46584 ("Place" text,"Player" text,"Country" text,"Score" text,"To Par" text)
SELECT "Country" FROM table_46584 WHERE "Place" = 't9' AND "Player" = 'jay hebert'
Top 1000 users from Colombia.
CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,Paren...
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%colombia%' ORDER BY Reputation DESC LIMIT 1000
what is the yearly average amount of urinary catheter output: coude urethral 14 fr. that patient 006-13677 had since 08/2105?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number...
SELECT AVG(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-13677')) AND intakeoutput.celllabel = 'urina...
What papers has mirella lapata written ?
CREATE TABLE field (fieldid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE venue (venueid int,venuename varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE cite (...
SELECT DISTINCT writes.paperid FROM author, writes WHERE author.authorname = 'mirella lapata' AND writes.authorid = author.authorid
Give me a histogram for what is the lowest salary in departments with average salary greater than the overall average, and could you rank by the x axis in asc?
CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_number varchar(7),time_slot_id varchar(4))CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE instructor (ID varchar(5),name varcha...
SELECT dept_name, MIN(salary) FROM instructor GROUP BY dept_name ORDER BY dept_name
What name has 8 as the number?
CREATE TABLE table_41463 ("Name" text,"Position" text,"Number" text,"Season" text,"Acquisition via" text)
SELECT "Name" FROM table_41463 WHERE "Number" = '8'
What was the Sat 21 Aug time for the rider whose Tues 24 Aug time was 20' 38.40 109.680mph?
CREATE TABLE table_26986076_6 (sat_21_aug VARCHAR,tues_24_aug VARCHAR)
SELECT sat_21_aug FROM table_26986076_6 WHERE tues_24_aug = "20' 38.40 109.680mph"
what is the number of laps when the driver is ron flockhart?
CREATE TABLE table_55763 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT COUNT("Laps") FROM table_55763 WHERE "Driver" = 'ron flockhart'
What year did the player with a t3 finish win?
CREATE TABLE table_60792 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" text,"Finish" text)
SELECT "Year(s) won" FROM table_60792 WHERE "Finish" = 't3'
What safari has 2012 q4 as the period?
CREATE TABLE table_79299 ("Period" text,"Internet Explorer" text,"Firefox" text,"Chrome" text,"Safari" text,"Opera" text,"Other" text)
SELECT "Safari" FROM table_79299 WHERE "Period" = '2012 q4'