table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_16713 ( "Rnd" real, "Race" text, "Date" text, "Location" text, "Pole Position" text, "Fastest Lap" text, "Race Winner" text, "Constructor" text, "Report" text )
what's the pole position with location being hockenheimring
SELECT "Pole Position" FROM table_16713 WHERE "Location" = 'Hockenheimring'
CREATE TABLE table_4685 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who is the away team when the home team scores 12.20 (92)?
SELECT "Away team" FROM table_4685 WHERE "Home team score" = '12.20 (92)'
CREATE TABLE table_8218 ( "University" text, "Common short form and abbreviation" text, "Location" text, "Enrollment" real, "Athletics nickname" text, "School Colors" text, "Founded" text, "Student newspaper" text )
Which School Colors has an Enrollment larger than 15,664, and Founded of 1910, and a Location of bowling green?
SELECT "School Colors" FROM table_8218 WHERE "Enrollment" > '15,664' AND "Founded" = '1910' AND "Location" = 'bowling green'
CREATE TABLE table_name_1 ( tournament VARCHAR, margin_of_victory VARCHAR, winning_score VARCHAR )
What tournament had a victory of a 1 stroke margin and the final winning score 69-75-71-70?
SELECT tournament FROM table_name_1 WHERE margin_of_victory = "1 stroke" AND winning_score = "69-75-71-70"
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
Posts that contain inline code formatting.
SELECT Id AS "post_link" FROM Posts WHERE Body LIKE '%<code>%' AND OwnerUserId = @UserID ORDER BY CreationDate DESC
CREATE TABLE table_42301 ( "Aces" real, "Player" text, "Opponent" text, "Year" real, "Event" text, "Sets" real, "Result" text )
what's the earliest year that serena williams had more than 2 sets?
SELECT MIN("Year") FROM table_42301 WHERE "Player" = 'serena williams' AND "Sets" > '2'
CREATE TABLE table_27387 ( "Language" text, "Quillacollo Municipality" real, "Sipe Sipe Municipality" real, "Tiquipaya Municipality" real, "Vinto Municipality" real, "Colcapirhua Municipality" real )
What is the Sipe Sipe Municipality minimum if the language is Quechua?
SELECT MIN("Sipe Sipe Municipality") FROM table_27387 WHERE "Language" = 'Quechua'
CREATE TABLE table_472 ( "Year" text, "Champion" text, "Country" text, "Score" text, "Tournament location" text, "Purse ($)" real, "Winners share ($)" real )
What is the winners Share ($) in the year 2004?
SELECT MIN("Winners share ($)") FROM table_472 WHERE "Year" = '2004'
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 number, icustay_id number, ...
when was patient 29635's last microbiological examination when they came to the hospital last time?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 29635 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY microbiologyevents.charttime DESC LIMIT 1
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ...
how many of the patients with infected right thigh graft had coronary arteriogr-1 cath?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "INFECTED RIGHT THIGH GRAFT" AND procedures.short_title = "Coronar arteriogr-1 cath"
CREATE TABLE table_204_232 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
which country scored the least medals ?
SELECT "nation" FROM table_204_232 WHERE "total" = (SELECT MIN("total") FROM table_204_232)
CREATE TABLE table_15743 ( "Discipline" text, "2003 Cadiz" text, "2007 Cascais" text, "2011 Perth" text, "2014 Santander" text )
Which Discipline has a 2007 laser radial Cascais ?
SELECT "Discipline" FROM table_15743 WHERE "2007 Cascais" = 'laser radial'
CREATE TABLE table_78974 ( "Lexton Plains" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What team has fewer than 9 wins and less than 1593 against?
SELECT "Lexton Plains" FROM table_78974 WHERE "Wins" < '9' AND "Against" < '1593'
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 demographic (...
find the procedure icd9 code for patient with patient id 10317.
SELECT procedures.icd9_code FROM procedures WHERE procedures.subject_id = "10317"
CREATE TABLE table_53115 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What was the Lightning's record at their home game against Carolina with an attendance over 16,526 and a decision of Holmqvist?
SELECT "Record" FROM table_53115 WHERE "Decision" = 'holmqvist' AND "Attendance" > '16,526' AND "Visitor" = 'carolina'
CREATE TABLE table_name_45 ( winning_driver VARCHAR, round VARCHAR )
Which Winning Driver has a Round of 9?
SELECT winning_driver FROM table_name_45 WHERE round = 9
CREATE TABLE table_25773116_2 ( location VARCHAR, round VARCHAR )
Where was the round 1 race?
SELECT location FROM table_25773116_2 WHERE round = 1
CREATE TABLE table_71978 ( "Date" text, "Tournament" text, "Surface" text, "Opponent in the final" text, "Score" text )
Name the tournament for grass surface and opponent in the final being paul baccanello
SELECT "Tournament" FROM table_71978 WHERE "Surface" = 'grass' AND "Opponent in the final" = 'paul baccanello'
CREATE TABLE table_name_22 ( opposition VARCHAR, date VARCHAR )
Who was the opposition in the game on July 29?
SELECT opposition FROM table_name_22 WHERE date = "july 29"
CREATE TABLE table_15173 ( "Stage" text, "Date" text, "Course" text, "Distance" text, "Winner" text, "Race Leader" text )
What's the distance of the course of stage 4?
SELECT "Distance" FROM table_15173 WHERE "Stage" = '4'
CREATE TABLE table_67651 ( "Res." text, "Record" text, "Opponent" text, "Type" text, "Rd., Time" text, "Date" text )
What is the type of the match with a win result and Michael Gomez as the opponent?
SELECT "Type" FROM table_67651 WHERE "Res." = 'win' AND "Opponent" = 'michael gomez'
CREATE TABLE table_name_78 ( Severe INTEGER, tropical_cyclones VARCHAR, tropical_lows VARCHAR )
What is the highest number of severe tropical cyclones when there are 10 tropical cyclones and 14 tropical lows?
SELECT MAX(Severe) AS tropical_cyclones FROM table_name_78 WHERE tropical_cyclones = 10 AND tropical_lows = 14
CREATE TABLE table_204_804 ( id number, "version" text, "length" text, "album" text, "remixed by" text, "year" number, "comment" text )
how many songs were remixed by garraund ?
SELECT COUNT(*) FROM table_204_804 WHERE "remixed by" = 'joachim garraud'
CREATE TABLE table_name_71 ( change VARCHAR, share VARCHAR )
Name the change with share of 2.9%
SELECT change FROM table_name_71 WHERE share = "2.9%"
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
what was the top four most frequent diagnoses that patients were given within the same hospital visit after receiving a digoxin until 2 years ago?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'digox...
CREATE TABLE table_name_41 ( district VARCHAR, party VARCHAR, results VARCHAR )
What district is the incumbent Republican and the incumbent retired to run for governor democratic gain?
SELECT district FROM table_name_41 WHERE party = "republican" AND results = "retired to run for governor democratic gain"
CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE va...
Show the relation between max(stu gpa) and the average of stu gpa for each DEPT_CODE using a scatter chart
SELECT MAX(STU_GPA), AVG(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
Questions and Accepted Answer: Search the set.
SELECT p1.Id AS "post_link", p1.*, p2.Id AS "post_link", p2.Id AS "post_link", p2.Score AS "p2Score", p2.Body AS "p2Body", p2.OwnerUserId AS "p2UserId", p2.OwnerDisplayName AS "p2OwnerDisplayName", p2.CommentCount AS "p2CommentCount" FROM Posts AS p1, Posts AS p2 WHERE p1.ParentId IS NULL AND NOT p1.AcceptedAnswerId IS...
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,...
provide marital status as well as preferred language of the patient with patient id 2560.
SELECT demographic.marital_status, demographic.language FROM demographic WHERE demographic.subject_id = "2560"
CREATE TABLE table_33447 ( "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Report" text )
What time was the fastest lap during Stoh's 200 in 1982?
SELECT "Fastest Lap" FROM table_33447 WHERE "Name" = 'stoh''s 200'
CREATE TABLE table_train_89 ( "id" int, "chronically_uncontrolled_hypertension" bool, "uncontrolled_diabetes" bool, "hemoglobin_a1c_hba1c" float, "body_weight" float, "renal_disease" bool, "creatinine_clearance_cl" float, "geriatric_depression_scale_gds" int, "major_depression" bool,...
active renal disease.
SELECT * FROM table_train_89 WHERE renal_disease = 1
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
Posting activity by hour of day.
SELECT HourOfDay, COUNT(*) AS PostCount FROM (SELECT TIME_TO_STR(DATE(CreationDate, '##UTCTimeShift## hh'), '%I') AS HourOfDay FROM Posts WHERE OwnerUserId = '##UserId##') AS sub GROUP BY HourOfDay ORDER BY HourOfDay
CREATE TABLE table_1341930_5 ( party VARCHAR, incumbent VARCHAR )
Name the number of party with the incubent james william trimble
SELECT COUNT(party) FROM table_1341930_5 WHERE incumbent = "James William Trimble"
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id nu...
Is there a way to find out how many edits have made by user. suport query for https://meta.stackexchange.com/questions/291912/is-there-a-way-to-find-out-how-many-edits-ive-made-network-wide
SELECT SUM('4') AS "title", SUM('5') AS "body", SUM('6') AS "tag", COUNT(*) AS "revtot" FROM (SELECT RevisionGUID, '4', '5', '6' FROM (SELECT RevisionGUID, PostHistoryTypeId FROM PostHistory AS ph INNER JOIN Users AS u ON u.Id = ph.UserId WHERE PostHistoryTypeId IN (4, 5, 6) AND AccountId = @accountid) AS data PIVOT(CO...
CREATE TABLE table_21725 ( "Class" text, "Part 1" text, "Part 2" text, "Part 3" text, "Part 4" text, "Verb meaning" text )
How many verbs mean to grow, to produce
SELECT COUNT("Part 1") FROM table_21725 WHERE "Verb meaning" = 'to grow, to produce'
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Tags ( Id number, TagName text, Cou...
How many words have a user written all together?.
SELECT SUM(LENGTH(Body) - LENGTH(REPLACE(Body, ' ', '')) + 1) AS NumbofWords FROM Posts AS p WHERE p.OwnerUserId = '##UserId##'
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 comment_instructor ( instructor_id int, student_id int, score int, ...
Can I take both these classes in the same semester , MUSTHTRE 441 and MUSTHTRE 133 ?
SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'MUSTHTRE' AND COU...
CREATE TABLE table_77585 ( "Rank" real, "Rider" text, "Team" text, "Speed" text, "Time" text )
What is the time of the rider with a 398cc yamaha?
SELECT "Time" FROM table_77585 WHERE "Team" = '398cc yamaha'
CREATE TABLE table_23122988_1 ( comedians VARCHAR, location VARCHAR )
Who were the comedians during the episode located in Birmingham Hippodrome?
SELECT comedians FROM table_23122988_1 WHERE location = "Birmingham Hippodrome"
CREATE TABLE table_67097 ( "Player" text, "Years" text, "Games played" real, "Goals allowed" real, "Goals against average" real )
What is the average goals against average for those playing more than 78 games?
SELECT AVG("Goals against average") FROM table_67097 WHERE "Games played" > '78'
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program ( program_id int, name varchar, college varc...
List the courses that satisfy the Other requirement that are on Intercultural Drama .
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Intercultural Drama%' OR course.description LIKE '%Intercultural Drama%' OR course.name LIKE '%I...
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE state ( state_code text, state_name text, country_name text ) ...
what type of plane is a D9S
SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'D9S'
CREATE TABLE SUBJECTS ( subject_name VARCHAR )
List all the subject names.
SELECT subject_name FROM SUBJECTS
CREATE TABLE table_18081 ( "Complete Series" text, "Region 1" text, "Region 2" text, "Region 4" text, "DVD Extras and Bonus Features" text, "Number Of Discs" real )
Name the region 4 for the complete fifth series
SELECT "Region 4" FROM table_18081 WHERE "Complete Series" = 'The Complete Fifth Series'
CREATE TABLE table_24084 ( "Medal of Honor" text, "Coast Guard Cross" text, "Navy Cross" text, "Distinguished Service Cross" text, "Air Force Cross" text, "Homeland Security Distinguished Service Medal" text )
What is the coast guard cross when you recieve the navy distinguished service medal?
SELECT "Coast Guard Cross" FROM table_24084 WHERE "Distinguished Service Cross" = 'Navy Distinguished Service Medal'
CREATE TABLE player ( id number, player_api_id number, player_name text, player_fifa_api_id number, birthday text, height number, weight number ) CREATE TABLE team_attributes ( id number, team_fifa_api_id number, team_api_id number, date text, buildupplayspeed number, ...
Of all players with an overall rating greater than 80, how many are right-footed and left-footed?
SELECT preferred_foot, COUNT(*) FROM player_attributes WHERE overall_rating > 80 GROUP BY preferred_foot
CREATE TABLE table_name_5 ( Id VARCHAR )
What was 2009, when 2001 was, 'not masters series'?
SELECT 2009 FROM table_name_5 WHERE 2001 = "not masters series"
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
on the current icu visit patient 5828's arterial bp [systolic] was greater than 88.0?
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 = 5828) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_item...
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 course_offering ( offering_id int, course_id int, semester int, section_number int, star...
Do you have any other suggestions for easier theory classes than ES 395 ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE area.area LIKE '%theory%' AND program_course.workload < (SELECT MIN(PROGRAM_COURSEalias1....
CREATE TABLE table_70029 ( "Year" real, "English title" text, "Original title" text, "Country" text, "Director(s)" text )
What country had a film in 1993?
SELECT "Country" FROM table_70029 WHERE "Year" = '1993'
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, h...
what were the number of agent specific therapy - beta blockers overdose procedures that were performed in 2105?
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'agent specific therapy - beta blockers overdose' AND STRFTIME('%y', treatment.treatmenttime) = '2105'
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 prescriptions...
tell me the drug code of phenylephrine medication.
SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Phenylephrine"
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of price , and group by attribute name, and could you sort in asc by the Y-axis?
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price
CREATE TABLE table_name_98 ( name VARCHAR, location VARCHAR, entered_service VARCHAR )
Which is located in Angola and entered service in 1988?
SELECT name FROM table_name_98 WHERE location = "angola" AND entered_service = "1988"
CREATE TABLE table_18305523_2 ( story_title VARCHAR, artist_s VARCHAR )
What is the title of the issue where the art was done by Barry Kitson and Farmer?
SELECT story_title FROM table_18305523_2 WHERE artist_s = "Barry Kitson and Farmer"
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE...
JPA and Hibernate Questions by Year.
SELECT COUNT(*) AS QuestionCount, CAST(TIME_TO_STR(Posts.CreationDate, '%Y') AS INT) AS Year FROM Posts JOIN PostTags ON Posts.Id = PostTags.PostId JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = 'hibernate' OR Tags.TagName = 'jpa' GROUP BY TIME_TO_STR(Posts.CreationDate, '%Y') ORDER BY Year DESC
CREATE TABLE table_41027 ( "Tournament" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text, "Win %" text )
Which 2007 has a 2003 of 1r?
SELECT "2007" FROM table_41027 WHERE "2003" = '1r'
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), COMMISSION_PCT decimal(2,2), MANAGER_ID decimal(6,0), DEPARTMENT_ID decimal(...
For all employees who have the letters D or S in their first name, return a scatter chart about the correlation between salary and department_id .
SELECT SALARY, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%'
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, Creati...
trying widthrow the HTML posts.
SELECT * FROM Posts WHERE Id = 1
CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airport text,...
show me the flights from BALTIMORE to BOSTON
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST...
CREATE TABLE table_15327 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Tyres" text, "Points" real )
Which chassis had 16 points?
SELECT "Chassis" FROM table_15327 WHERE "Points" = '16'
CREATE TABLE table_38119 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Record" text )
What home has 136-134 as the score?
SELECT "Home" FROM table_38119 WHERE "Score" = '136-134'
CREATE TABLE table_name_47 ( home_team VARCHAR, venue VARCHAR )
What team has Windy Hill as their home venue
SELECT home_team AS score FROM table_name_47 WHERE venue = "windy hill"
CREATE TABLE table_23939 ( "County" text, "Obama%" text, "Obama#" real, "McCain%" text, "McCain#" real )
What percentage of the votes in Tippah did Obama get?
SELECT "Obama%" FROM table_23939 WHERE "County" = 'Tippah'
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight_fare ( flight_id int, fare_id int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minu...
show me flights from DENVER to ATLANTA on 6 16
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND date_day.day_number = 16 AND date_day.month_number = 6 AND d...
CREATE TABLE table_name_11 ( team_1 VARCHAR )
What is the 1st leg of the Al Fahaheel Team 1?
SELECT 1 AS st_leg FROM table_name_11 WHERE team_1 = "al fahaheel"
CREATE TABLE table_2562113_1 ( enrollment INTEGER, nickname VARCHAR )
What is the enrollment for the hawks?
SELECT MAX(enrollment) FROM table_2562113_1 WHERE nickname = "Hawks"
CREATE TABLE table_54292 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What home team played against Footscray as the away team?
SELECT "Home team" FROM table_54292 WHERE "Away team" = 'footscray'
CREATE TABLE table_name_67 ( callsign VARCHAR, on_air_id VARCHAR )
What is 4zr's callsign?
SELECT callsign FROM table_name_67 WHERE on_air_id = "4zr"
CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight real ) CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate re...
Bar chart x axis date of birth y axis height, and list by the bar in ascending.
SELECT Date_of_Birth, Height FROM people ORDER BY Date_of_Birth
CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, g...
Are there 300 -level courses in Spring or Summer term ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 300 AND 300 + 100 AND semester.semester IN ('SP', 'SU', 'SS') AND semester.semester_i...
CREATE TABLE employees ( id number, last_name text, first_name text, title text, reports_to number, birth_date time, hire_date time, address text, city text, state text, country text, postal_code text, phone text, fax text, email text ) CREATE TABLE artists (...
What are the names of the albums that have more than 10 tracks?
SELECT T1.title FROM albums AS T1 JOIN tracks AS T2 ON T1.id = T2.album_id GROUP BY T1.id HAVING COUNT(T1.id) > 10
CREATE TABLE table_204_939 ( id number, "year" number, "chassis" text, "engine" text, "start" text, "finish" text )
in how many years was the finish 7th ?
SELECT COUNT("year") FROM table_204_939 WHERE "finish" = 7
CREATE TABLE table_name_40 ( first_runner_up VARCHAR, miss_maja_pilipinas VARCHAR )
What First runner-up has a Miss Maja Pilipinas of nanette prodigalidad?
SELECT first_runner_up FROM table_name_40 WHERE miss_maja_pilipinas = "nanette prodigalidad"
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 (...
specify ethnic origin of patient id 55094
SELECT demographic.ethnicity FROM demographic WHERE demographic.subject_id = "55094"
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREAT...
what is the maximum total cost to the hospital that includes a vent rate lab test during the previous year?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'vent rate')) AND DATETIME(cost.chargetime, 'start of year') = DATETI...
CREATE TABLE table_31773 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
Tell me the country for san juan
SELECT "Country" FROM table_31773 WHERE "City" = 'san juan'
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
show me the cheapest flights from BALTIMORE to DALLAS
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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY...
CREATE TABLE restaurant_type ( restypeid number, restypename text, restypedescription text ) CREATE TABLE visits_restaurant ( stuid number, resid number, time time, spent number ) CREATE TABLE restaurant ( resid number, resname text, address text, rating number ) CREATE TA...
What is the description of the restaurant type Sandwich?
SELECT restypedescription FROM restaurant_type WHERE restypename = "Sandwich"
CREATE TABLE university ( school_id number, school text, location text, founded number, affiliation text, enrollment number, nickname text, primary_conference text ) CREATE TABLE basketball_match ( team_id number, school_id number, team_name text, acc_regular_season text...
How many schools are in the basketball match?
SELECT COUNT(DISTINCT school_id) FROM basketball_match
CREATE TABLE table_8595 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Points" text )
How many points did Newport RFC get?
SELECT "Points" FROM table_8595 WHERE "Club" = 'newport rfc'
CREATE TABLE table_name_90 ( locality VARCHAR, ages VARCHAR, school VARCHAR )
What is the Locality of the Penarth Group School for Ages 8-16?
SELECT locality FROM table_name_90 WHERE ages = "8-16" AND school = "penarth group school"
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, connections int, departure_time int, dual_carrier text, flight_days text, flight_id int, fligh...
show me flights between NEW YORK and LAS VEGAS on sunday
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND date_day.day_number = 27 AND date_day.month_number = 8 AND...
CREATE TABLE table_name_76 ( cores VARCHAR, l3_cache VARCHAR, model_number VARCHAR )
What is listed for the Cores that has the L3 cache of 8 MB and Model number of Core i7-860?
SELECT cores FROM table_name_76 WHERE l3_cache = "8 mb" AND model_number = "core i7-860"
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtim...
what were the four most commonly diagnosed diagnoses for patients who were previously diagnosed with s/p exploratory laparoscopy within 2 months since 2102?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, 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 = 's/p exploratory laparoscopy' AND STRFTIM...
CREATE TABLE table_204_779 ( id number, "network name" text, "flagship" text, "programming type" text, "owner" text, "affiliates" number )
name a station that shows sports but is not televisa .
SELECT "network name" FROM table_204_779 WHERE "programming type" = 'sports' AND "owner" <> 'televisa'
CREATE TABLE table_name_15 ( system VARCHAR, actual_version VARCHAR )
Which System has an Actual Version 9.0?
SELECT system FROM table_name_15 WHERE actual_version = "9.0"
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 t...
Out of the total number of patients admitted before 2168, how many of them had int insert lead in vent?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2168" AND procedures.short_title = "Int insert lead in vent"
CREATE TABLE table_1277350_3 ( saturday_shani__saturn_ VARCHAR, sunday_surya__the_sun_ VARCHAR )
In the system where Sunday is ny yitru kizhamai, what is Saturday?
SELECT saturday_shani__saturn_ FROM table_1277350_3 WHERE sunday_surya__the_sun_ = "ஞாயிற்று கிழமை Nyāyitru kizhamai"
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 ) ...
what is gender and discharge time of subject id 55094?
SELECT demographic.gender, demographic.dischtime FROM demographic WHERE demographic.subject_id = "55094"
CREATE TABLE table_2701851_2 ( title VARCHAR, no_in_series VARCHAR )
What is the name of episode # 10a?
SELECT title FROM table_2701851_2 WHERE no_in_series = "10a"
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 ) ...
what is the number of patients whose admission year is less than 2154 and diagnoses short title is urinary incontinence nos?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2154" AND diagnoses.short_title = "Urinary incontinence NOS"
CREATE TABLE table_name_6 ( score VARCHAR, date VARCHAR )
What is the score on september 20?
SELECT score FROM table_name_6 WHERE date = "september 20"
CREATE TABLE table_name_10 ( res VARCHAR, method VARCHAR, opponent VARCHAR )
Which Res has a Method of decision (unanimous) and an Opponent of Wataru Sakata?
SELECT res FROM table_name_10 WHERE method = "decision (unanimous)" AND opponent = "wataru sakata"
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program ( program_id int, name v...
For before noon classes , what upper level electives are offered ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest...
CREATE TABLE table_9802 ( "Date" text, "Tournament" text, "Winning score" text, "Margin of victory" text, "Runner(s)-up" text )
What was the winning score on Jan 22, 1995 when the margin of victory was 1 stroke?
SELECT "Winning score" FROM table_9802 WHERE "Margin of victory" = '1 stroke' AND "Date" = 'jan 22, 1995'
CREATE TABLE table_18254488_2 ( uefa_champions_league INTEGER )
What is the highest amount of uefa champion leagues?
SELECT MAX(uefa_champions_league) FROM table_18254488_2
CREATE TABLE table_79469 ( "Event" text, "Class" text, "Gold" text, "Silver" text, "Bronze" text )
what is the event when gold is darren kenny great britain (gbr)?
SELECT "Event" FROM table_79469 WHERE "Gold" = 'darren kenny great britain (gbr)'
CREATE TABLE users ( user_id number, role_code text, user_name text, user_login text, password text ) CREATE TABLE images ( image_id number, image_alt_text text, image_name text, image_url text ) CREATE TABLE roles ( role_code text, role_description text ) CREATE TABLE fun...
Find the average access count across all documents?
SELECT AVG(access_count) FROM documents
CREATE TABLE table_61535 ( "Official Name" text, "Status" text, "Area km 2" real, "Population" real, "Census Ranking" text )
What is the population of the parish that has an area of 304.06?
SELECT SUM("Population") FROM table_61535 WHERE "Area km 2" = '304.06'