table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_train_95 ( "id" int, "serum_potassium" float, "mini_mental_state_examination_mmse" int, "systolic_blood_pressure_sbp" int, "resting_heart_rate" int, "diastolic_blood_pressure_dbp" int, "NOUSE" float )
resting heart rate ( hr ) <= 50 or >= 100 beats / min;
SELECT * FROM table_train_95 WHERE resting_heart_rate <= 50 OR resting_heart_rate >= 100
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions...
show me the number of government health insurance patients who were ordered to get blasts lab test.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Blasts"
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_p...
In Spring 2018 , in the afternoon , will 101 be available ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 101 AND semester.semester = 'Spring' AND semester.semester_id = course_offering.semester AND semester.year = 2018
CREATE TABLE table_204_301 ( id number, "nationality" text, "name" text, "term as a deputy judge" text, "reason for termination" text )
what is the total number of deputy judges that were post abolished ?
SELECT COUNT("name") FROM table_204_301 WHERE "reason for termination" = 'post abolished'
CREATE TABLE table_name_32 ( lead_supporting_vocal VARCHAR, time VARCHAR )
Who was the lead supporting vocalist on the song that was 4:54 long?
SELECT lead_supporting_vocal FROM table_name_32 WHERE time = "4:54"
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE airline ( airline_code varchar, airline_name ...
what flights go from DALLAS to DENVER after 1500
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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND flight.departure_time > 1500 AND flight.to_airport = AIRPORT_SERVICE_1.airpor...
CREATE TABLE table_13114949_3 ( final_rank VARCHAR, event VARCHAR, competition VARCHAR )
what is the final-rank for the uneven bars and the competition is u.s. championships?
SELECT final_rank FROM table_13114949_3 WHERE event = "Uneven Bars" AND competition = "U.S. Championships"
CREATE TABLE table_21627 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text )
What is the original air date of the episode directed by Terrence Nightingall?
SELECT "Original air date" FROM table_21627 WHERE "Directed by" = 'Terrence Nightingall'
CREATE TABLE table_47763 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text )
What is the Status of the Paris with a Census Ranking of 3,474 of 5,008?
SELECT "Status" FROM table_47763 WHERE "Census Ranking" = '3,474 of 5,008'
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 number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit te...
what is the minimum hospital bill that includes retention urine nos the previous year?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'retention urine nos')) AND DATETIME(cost.chargetime, 'start of ...
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 ) C...
provide the number of patients whose gender is f and days of hospital stay is greater than 2?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.days_stay > "2"
CREATE TABLE table_23308178_5 ( score VARCHAR, record VARCHAR )
How many different scores are there for the game with 10-3-4 record?
SELECT COUNT(score) FROM table_23308178_5 WHERE record = "10-3-4"
CREATE TABLE table_75820 ( "Player" text, "FG Pct" real, "3FGA" real, "3FGM" real, "3FG Pct" real, "FT Pct" real, "Off Reb" real, "Def Reb" real, "Total Reb" real, "Asst" real )
What is the total number of offensive rebounds for players with more than 124 3-point attempts?
SELECT COUNT("Off Reb") FROM table_75820 WHERE "3FGA" > '124'
CREATE TABLE table_41242 ( "Name" text, "Novelty" text, "Status" text, "Authors" text, "Unit" text, "Location" text )
What unit has gen et sp nov as the novelty?
SELECT "Unit" FROM table_41242 WHERE "Novelty" = 'gen et sp nov'
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, ...
what is drug code of drug name d5ns?
SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "D5NS"
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int,...
What are the required classes I need before taking PIBS 501 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
what were the changes in respiration in patient 016-18575 second measured on the current intensive care unit visit compared to the value first measured on the current intensive care unit visit?
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-18575') AND patient.unitdischargetime IS NU...
CREATE TABLE table_name_45 ( opponent VARCHAR, round VARCHAR, record VARCHAR )
Who was the opponent with a record of 14-4-1 and has a round of 1?
SELECT opponent FROM table_name_45 WHERE round = "1" AND record = "14-4-1"
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 ) ...
provide the number of patients whose year of birth is less than 2103 and drug type is additive?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2103" AND prescriptions.drug_type = "ADDITIVE"
CREATE TABLE table_name_6 ( away_team VARCHAR, home_team VARCHAR )
What is the Away Team Score of the Hawthorn Home Team?
SELECT away_team AS score FROM table_name_6 WHERE home_team = "hawthorn"
CREATE TABLE table_1963459_2 ( year INTEGER, average_speed__mph_ VARCHAR )
What year was the average speed 145.24
SELECT MAX(year) FROM table_1963459_2 WHERE average_speed__mph_ = "145.24"
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 lab ( subject_id text, hadm_id text, ...
provide the number of patients whose admission year is less than 2133 and diagnoses short title is ulcer other part of foot?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2133" AND diagnoses.short_title = "Ulcer other part of foot"
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number...
calculate the length of stay of patient 15135 during the last hospital stay.
SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 15135 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
CREATE TABLE member ( Name VARCHAR, Member_ID VARCHAR ) CREATE TABLE member_attendance ( Name VARCHAR, Member_ID VARCHAR )
List the names of members who did not attend any performance.
SELECT Name FROM member WHERE NOT Member_ID IN (SELECT Member_ID FROM member_attendance)
CREATE TABLE table_75230 ( "Season" text, "Oberliga Bayern" text, "Oberliga Hessen" text, "Oberliga Baden-W\u00fcrttemberg" text, "Oberliga S\u00fcdwest" text )
Which Oberliga Bayern has a Season of 1981-82?
SELECT "Oberliga Bayern" FROM table_75230 WHERE "Season" = '1981-82'
CREATE TABLE table_68619 ( "Date" text, "Location" text, "Nature of incident" text, "Circumstances" text, "Casualties" text )
What happened on 2009-03-14?
SELECT "Circumstances" FROM table_68619 WHERE "Date" = '2009-03-14'
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what are the newly prescribed medicines of patient 42473 today compared to that yesterday?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42473) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE...
CREATE TABLE savings ( custid VARCHAR, balance VARCHAR ) CREATE TABLE checking ( custid VARCHAR, balance VARCHAR ) CREATE TABLE accounts ( name VARCHAR, custid VARCHAR )
Find the name of account that has the lowest total checking and saving balance.
SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid JOIN savings AS T3 ON T1.custid = T3.custid ORDER BY T2.balance + T3.balance LIMIT 1
CREATE TABLE table_79899 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What was the record at the game against the Indians with a loss of Camacho (1-4)?
SELECT "Record" FROM table_79899 WHERE "Opponent" = 'indians' AND "Loss" = 'camacho (1-4)'
CREATE TABLE table_name_11 ( top_25 INTEGER, events VARCHAR, top_10 VARCHAR )
What is the highest top-25 of the tournament with less than 22 events and more than 1 top-10?
SELECT MAX(top_25) FROM table_name_11 WHERE events < 22 AND top_10 > 1
CREATE TABLE table_name_79 ( Id VARCHAR )
what is 2008 when 2012 is 3r and 2009 is 2r?
SELECT 2008 FROM table_name_79 WHERE 2012 = "3r" AND 2009 = "2r"
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE time_interval ( period text...
list all flights leaving DENVER arriving in SEATTLE on saturday that depart after 1230pm
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 = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
CREATE TABLE constructorResults ( constructorResultsId INTEGER, raceId INTEGER, constructorId INTEGER, points REAL, status TEXT ) CREATE TABLE qualifying ( qualifyId INTEGER, raceId INTEGER, driverId INTEGER, constructorId INTEGER, number INTEGER, position INTEGER, q1 TE...
A bar chart for what are the number of the names of races held between 2009 and 2011?, show from high to low by the Y.
SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name ORDER BY COUNT(name) DESC
CREATE TABLE table_22752982_5 ( runner_up_a VARCHAR, winner VARCHAR )
Who was the runner-up (a) if K. P. Ramalingam won the election?
SELECT runner_up_a FROM table_22752982_5 WHERE winner = "K. P. Ramalingam"
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE prescriptions ( row_id number, subject_id number, h...
when was the last time patient 3267 arterial bp mean was measured less than 84.0 on the first icu visit.
SELECT chartevents.charttime 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 = 3267) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (S...
CREATE TABLE table_62334 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
On what Date is Tie no 19?
SELECT "Date" FROM table_62334 WHERE "Tie no" = '19'
CREATE TABLE table_203_812 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many silver medals did turkey win ?
SELECT "silver" FROM table_203_812 WHERE "nation" = 'turkey'
CREATE TABLE table_36212 ( "Name" text, "Pennant number" text, "Laid down" text, "Launched" text, "Date of commission" text, "Homeport (as of July 2013)" text, "Planned decommission (as announced in 2009)" text )
What kind of Launched has a Homeport (as of July 2013) of sold to chile, and a Pennant number of f80?
SELECT "Launched" FROM table_36212 WHERE "Homeport (as of July 2013)" = 'sold to chile' AND "Pennant number" = 'f80'
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city var...
What are the special topics classes offered next Winter ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E...
CREATE TABLE table_19642 ( "Position" real, "Race number" text, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Elapsed time d:hh:mm:ss" text )
What are all values of LOA(metres) for an elapsed time of 2:17:01:05?
SELECT "LOA (Metres)" FROM table_19642 WHERE "Elapsed time d:hh:mm:ss" = '2:17:01:05'
CREATE TABLE table_9048 ( "Year" real, "Winner" text, "Score" text, "Runner(s)-up" text, "Winner's share ($)" real, "Course" text, "Location" text )
Where is runner-up Betsy Rawls from?
SELECT "Location" FROM table_9048 WHERE "Runner(s)-up" = 'betsy rawls'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
what is procedure icd9 code and procedure short title of subject id 8440?
SELECT procedures.icd9_code, procedures.short_title FROM procedures WHERE procedures.subject_id = "8440"
CREATE TABLE flight ( flno number, origin text, destination text, distance number, departure_date time, arrival_date time, price number, aid number ) CREATE TABLE certificate ( eid number, aid number ) CREATE TABLE aircraft ( aid number, name text, distance number )...
What is the number of employees that have a salary between 100000 and 200000?
SELECT COUNT(*) FROM employee WHERE salary BETWEEN 100000 AND 200000
CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text ) CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text )
Compare the total number of different ranks using a bar graph, and sort bar in ascending order.
SELECT Rank, COUNT(Rank) FROM captain GROUP BY Rank ORDER BY Rank
CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district text, nces_id text, yr_data number, t_fed_rev number, c14 number, c25 number ) CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ...
State with highest average math score
SELECT state FROM ndecoreexcel_math_grade8 ORDER BY average_scale_score DESC LIMIT 1
CREATE TABLE table_10953197_4 ( writer_s_ VARCHAR, production_code VARCHAR )
Who was the writer for the episode with production code 2395096?
SELECT writer_s_ FROM table_10953197_4 WHERE production_code = "2395096"
CREATE TABLE table_46931 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Game Site" text, "Attendance" text )
Against the Houston Oilers after week 14, what was the result of the game?
SELECT "Result" FROM table_46931 WHERE "Week" > '14' AND "Opponent" = 'houston oilers'
CREATE TABLE table_42129 ( "Player" text, "Club" text, "League" real, "FA Cup" real, "FA Trophy" real, "League Cup" real, "Total" real )
What is the highest league for the league cup more than 1, and a FA cup of 1?
SELECT MAX("League") FROM table_42129 WHERE "League Cup" > '1' AND "FA Cup" = '1'
CREATE TABLE table_name_7 ( nation VARCHAR, cyclist VARCHAR )
Which nation is Danilo di Luca from?
SELECT nation FROM table_name_7 WHERE cyclist = "danilo di luca"
CREATE TABLE table_24491017_1 ( team VARCHAR, f_laps VARCHAR )
What team was he on when he had 10 f/laps?
SELECT team FROM table_24491017_1 WHERE f_laps = 10
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text, arrival_time int, arrival_airline text, arrival_flight_number int, departure_time int, departure_airline...
show me the prices of FIRST class tickets on US round trip from CLEVELAND to MIAMI
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (((flight.airline_code = 'US') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAMI' AND flight.to_airport...
CREATE TABLE table_21552 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
Name the date of appointment for petrik sander
SELECT "Date of appointment" FROM table_21552 WHERE "Replaced by" = 'Petrik Sander'
CREATE TABLE table_name_30 ( surface VARCHAR, city VARCHAR, tournament VARCHAR )
On what Surface will the Venezuela F5 Futures in Caracas be played?
SELECT surface FROM table_name_30 WHERE city = "caracas" AND tournament = "venezuela f5 futures"
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, date_account_opened DATETIME, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VA...
Show first name and id for all customers with at least 2 accounts in a bar chart, and show in asc by the total number.
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T1.customer_id
CREATE TABLE table_63736 ( "Pick" real, "Team" text, "Player" text, "Position" text, "College" text )
What is the highest pick when the college is saginaw valley state?
SELECT MAX("Pick") FROM table_63736 WHERE "College" = 'saginaw valley state'
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 PostsWithDeleted ( Id number, PostTypeId number, Acc...
Get Users by Location and Tag And Votes.
SELECT u.DisplayName, 'http://stackoverflow.com/users/' + CAST(u.Id AS TEXT(255)) AS "httplink", u.Reputation, COUNT(v.Id) AS "votes" FROM Users AS u INNER JOIN Votes AS v ON v.UserId = u.Id INNER JOIN Posts AS p ON p.Id = v.PostId INNER JOIN Posts AS ans ON p.Id = ans.ParentId INNER JOIN PostTags AS pt ON p.Id = pt.Po...
CREATE TABLE table_62468 ( "Parish (Prestegjeld)" text, "Sub-Parish (Sokn)" text, "Church Name" text, "Year Built" text, "Location of the Church" text )
In what year was the church located in flor built?
SELECT "Year Built" FROM table_62468 WHERE "Location of the Church" = 'florø'
CREATE TABLE table_76401 ( "Year" text, "2009" text, "2008" text, "2007" text, "2006" text, "2005" text, "2004" text, "2003" text )
What is the 2008 for 2009 heartland high tech?
SELECT "2008" FROM table_76401 WHERE "2009" = 'heartland high tech'
CREATE TABLE table_19789597_5 ( opponent VARCHAR, date VARCHAR )
Name the opponent for june 12
SELECT opponent FROM table_19789597_5 WHERE date = "June 12"
CREATE TABLE table_59338 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
What was the location where the opponent was Jae Young Kim?
SELECT "Location" FROM table_59338 WHERE "Opponent" = 'jae young kim'
CREATE TABLE table_55156 ( "Player" text, "Rec." real, "Yards" real, "Avg." real, "TD's" real, "Long" real )
What is the low TD for 49 longs and 1436 less yards?
SELECT MIN("TD's") FROM table_55156 WHERE "Long" = '49' AND "Yards" < '1436'
CREATE TABLE table_62105 ( "Mission" text, "Resident Country" text, "Local Location" text, "Local Mission" text, "Non-Resident Head of Mission" text, "Local Position" text )
What is Local Mission, when Mission is 'Mauritius'?
SELECT "Local Mission" FROM table_62105 WHERE "Mission" = 'mauritius'
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Average number of users who mention Python in About Me and have a picture.
SELECT COUNT(DISTINCT Id) FROM Users WHERE UPPER(AboutMe) LIKE '%PYTHON%' AND NOT ProfileImageUrl IS NULL
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_capacity INTEGER, gender VARCHAR(1) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, ...
A bar chart for finding the number of the first name of students who are living in the Smith Hall, could you sort by the how many fname from low to high?
SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T3.dorm_name = 'Smith Hall' GROUP BY Fname ORDER BY COUNT(Fname)
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_...
i need a flight on AA from MIAMI to CHICAGO that arrives around 5pm
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 (((flight.arrival_time <= 1730 AND flight.arrival_time >= 1630) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND flight.to...
CREATE TABLE table_name_28 ( runners_up VARCHAR, year VARCHAR )
Who are the runners-up in 1996?
SELECT runners_up FROM table_name_28 WHERE year = "1996"
CREATE TABLE table_49382 ( "Result" text, "Race" text, "Distance" text, "Weight" real, "Winner or 2nd" text, "Pos'n" text )
What is the race with a 10f distance and mollison as the winner or 2nd?
SELECT "Race" FROM table_49382 WHERE "Distance" = '10f' AND "Winner or 2nd" = 'mollison'
CREATE TABLE country ( country_id number, country_name text, capital text, official_native_language text ) CREATE TABLE team ( team_id number, name text ) CREATE TABLE match_season ( season number, player text, position text, country number, team number, draft_pick_numb...
Show the positions of the players from the team with name 'Ryley Goldner'.
SELECT T1.position FROM match_season AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Ryley Goldner"
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, e...
I want a bar chart to show the average cloud cover of the dates that have the 5 highest cloud cover rates each day.
SELECT date, AVG(cloud_cover) FROM weather
CREATE TABLE table_name_46 ( february VARCHAR, record VARCHAR )
What is February, when Record is '21-29-11'?
SELECT february FROM table_name_46 WHERE record = "21-29-11"
CREATE TABLE table_name_32 ( score VARCHAR, record VARCHAR )
What is the score when the record was 5-4-2?
SELECT score FROM table_name_32 WHERE record = "5-4-2"
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, P...
Synonymized tags that have a tag wiki.
SELECT SourceTagName, src.Count, Posts.Body AS "source_tag_wiki_excerpt", TargetTagName, tgt.TagName, ApprovalDate FROM TagSynonyms INNER JOIN Tags AS src ON SourceTagName = src.TagName LEFT JOIN Tags AS tgt ON TargetTagName = tgt.TagName INNER JOIN Posts ON src.ExcerptPostId = Posts.Id ORDER BY SourceTagName
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 (...
what is the number of patients whose marital status is widowed and lab test fluid is joint fluid?
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.fluid = "Joint Fluid"
CREATE TABLE table_47384 ( "Poll Source" text, "Dates administered" text, "Democrat: Brian Schweitzer" text, "Republican: Roy Brown" text, "Libertarian: Stan Jones" text, "Lead Margin" real )
What was the lead margin when Schweitzer had 55% and Jones had 2%?
SELECT SUM("Lead Margin") FROM table_47384 WHERE "Democrat: Brian Schweitzer" = '55%' AND "Libertarian: Stan Jones" = '2%'
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Show me about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road in a bar chart, order by the X-axis in ascending.
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
what is minimum age of patients whose death status is 0 and discharge location is home?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.discharge_location = "HOME"
CREATE TABLE table_204_371 ( id number, "team" text, "competition" text, "category" text, "appearances\nstart" number, "appearances\nsub" number, "goals" number, "team record" text )
where did japan only score four goals ?
SELECT "competition" FROM table_204_371 WHERE "team" = 'japan' AND "goals" = 4
CREATE TABLE table_204_93 ( id number, "round" number, "pick" number, "player" text, "position" text, "nationality" text, "team" text, "college" text )
how many f/c 's -lrb- forward/center -rrb- are on the list ?
SELECT COUNT(*) FROM table_204_93 WHERE "position" = 'f/c'
CREATE TABLE table_59117 ( "Club" text, "City" text, "Stadium" text, "Capacity" real, "2007\u201308 season" text )
What is Rovigo's Club?
SELECT "Club" FROM table_59117 WHERE "City" = 'rovigo'
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate...
all posts (Q and A) for user 2515498.
SELECT Title, Body FROM Posts WHERE OwnerUserId = 2515498
CREATE TABLE table_77199 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" real, "Year named" real )
What is the average Year Named, when Latitude is 37.9N, and when Diameter (km) is greater than 76?
SELECT AVG("Year named") FROM table_77199 WHERE "Latitude" = '37.9n' AND "Diameter (km)" > '76'
CREATE TABLE trucks ( truck_id number, truck_licence_number text, truck_details text ) CREATE TABLE actual_orders ( actual_order_id number, order_status_code text, regular_order_id number, actual_order_date time ) CREATE TABLE regular_order_products ( regular_order_id number, produ...
Find the names and phone numbers of customers living in California state.
SELECT t1.customer_name, t1.customer_phone FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = 'California'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
give me the number of elective hospital admission patients who are diagnosed with other and unspecified open wound of head without mention of complication.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND diagnoses.long_title = "Other and unspecified open wound of head without mention of complication"
CREATE TABLE table_15467476_3 ( tries_for VARCHAR, club VARCHAR )
How many tries for, for club cambrian welfare rfc?
SELECT tries_for FROM table_15467476_3 WHERE club = "Cambrian Welfare RFC"
CREATE TABLE table_name_43 ( date VARCHAR, record VARCHAR )
When were the Brewers 27-31?
SELECT date FROM table_name_43 WHERE record = "27-31"
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) 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_re...
i need a list of late afternoon flights from ST. LOUIS to CHICAGO
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 = 'ST. LOUIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHI...
CREATE TABLE table_72163 ( "Character" text, "Fate" text, "Actor" text, "First Episode" text, "Final Episode" text, "Duration" text, "Final Episode Count" real )
what's the actor with character being judge joseph ratner
SELECT "Actor" FROM table_72163 WHERE "Character" = 'Judge Joseph Ratner'
CREATE TABLE table_name_76 ( date VARCHAR, partner VARCHAR )
When did he play with peter nyborg?
SELECT date FROM table_name_76 WHERE partner = "peter nyborg"
CREATE TABLE table_74063 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
Which team replaced their manager with Serhat G ller?
SELECT "Team" FROM table_74063 WHERE "Replaced by" = 'Serhat Güller'
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, Par...
Django related tags on StackOverflow.
SELECT * FROM Tags WHERE TagName LIKE 'django%' AND WikiPostId IS NULL ORDER BY Count DESC
CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city...
Find the first name and age of the students who are playing both Football and Lacrosse.
SELECT fname, age FROM student WHERE stuid IN (SELECT stuid FROM sportsinfo WHERE sportname = "Football" INTERSECT SELECT stuid FROM sportsinfo WHERE sportname = "Lacrosse")
CREATE TABLE table_43289 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What date was the game that was before week 4 and was attended by over 54,015 people ?
SELECT "Date" FROM table_43289 WHERE "Week" < '4' AND "Attendance" > '54,015'
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what was the last time of patient 010-1155 taking tpn on this month/25?
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 = '010-1155')) AND intakeoutput.cellpath LIKE '%intake%'...
CREATE TABLE airlines ( alid number, name text, iata text, icao text, callsign text, country text, active text ) CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE ...
For each country, what is the average elevation of that country's airports?
SELECT AVG(elevation), country FROM airports GROUP BY country
CREATE TABLE table_62093 ( "Chassis code" text, "Years" text, "Model" text, "Engine" text, "Power" text, "Torque" text )
What Engine does the w123.026 chassis have?
SELECT "Engine" FROM table_62093 WHERE "Chassis code" = 'w123.026'
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostNoticeTypes ( Id...
Find questions with a single tag (now case insensitive).
SELECT Id AS "post_link", CreationDate, Tags FROM Posts WHERE Tags = '<automation>' ORDER BY Score DESC LIMIT 1000
CREATE TABLE table_54182 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the highest crowd listed when the away side scores 4.9 (33)?
SELECT MAX("Crowd") FROM table_54182 WHERE "Away team score" = '4.9 (33)'
CREATE TABLE course ( title VARCHAR, course_id VARCHAR ) CREATE TABLE SECTION ( course_id VARCHAR )
What is the title of the course that was offered at building Chandler during the fall semester in the year of 2010?
SELECT T1.title FROM course AS T1 JOIN SECTION AS T2 ON T1.course_id = T2.course_id WHERE building = 'Chandler' AND semester = 'Fall' AND YEAR = 2010
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( i...
is the systemicsystolic of patient 018-95228 second measured on the first icu visit less than its value first measured on the first icu visit?
SELECT (SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-95228') AND NOT patient.unitdischarget...
CREATE TABLE table_77536 ( "Pick" real, "Round" text, "Player" text, "Position" text, "School" text )
What was the highest guard picked?
SELECT MAX("Pick") FROM table_77536 WHERE "Position" = 'guard'