table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_80337 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What Label released on October 25, 1984, in the format of Stereo LP?
SELECT "Label" FROM table_80337 WHERE "Date" = 'october 25, 1984' AND "Format" = 'stereo lp'
CREATE TABLE table_49152 ( "Pick #" real, "CFL Team" text, "Player" text, "Position" text, "College" text )
what is the cfl team for position d?
SELECT "CFL Team" FROM table_49152 WHERE "Position" = 'd'
CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, mean_dew_point_f INTEGER, min_dew_point_f INTEGER, max_humidity INTEGER, mean_humidity INTEGER, min_humidity INTEGER, max_sea_level_pre...
Visualize a bar chart for what are the ids and names of all start stations that were the beginning of at least 200 trips?, list by the x-axis from low to high.
SELECT start_station_name, start_station_id FROM trip ORDER BY start_station_name
CREATE TABLE table_41130 ( "Region" text, "Date" text, "Label" text, "Format" text, "Catalog" text )
What is the Format with a Catalog that is vcrd 103?
SELECT "Format" FROM table_41130 WHERE "Catalog" = 'vcrd 103'
CREATE TABLE table_61652 ( "Tournament" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
WHAT IS THE 2007 AT MADRID MASTERS?
SELECT "2007" FROM table_61652 WHERE "Tournament" = 'madrid masters'
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar...
How many classes will be offered next semester across all departments ?
SELECT COUNT(DISTINCT course_offering.course_id) FROM course_offering, semester WHERE semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25), EMAIL varchar(25), PHONE_NUMBER varchar(20), ...
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, sort by the names in descending please.
SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID DESC
CREATE TABLE table_name_3 ( circuit VARCHAR, winner VARCHAR, race VARCHAR )
what is the circuit when the winner is stan jones and the race is phillip island trophy race?
SELECT circuit FROM table_name_3 WHERE winner = "stan jones" AND race = "phillip island trophy race"
CREATE TABLE table_72587 ( "Position" real, "Sail number" text, "Yacht" text, "State/country" text, "Yacht type" text, "LOA (Metres)" text, "Skipper" text, "Corrected time d:hh:mm:ss" text )
What are all of the states or countries with a corrected time 3:13:40:05?
SELECT "State/country" FROM table_72587 WHERE "Corrected time d:hh:mm:ss" = '3:13:40:05'
CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE purchase ( member_id number, branch_id tex...
Show name, address road, and city for all branches sorted by open year.
SELECT name, address_road, city FROM branch ORDER BY open_year
CREATE TABLE table_45744 ( "Player" text, "Nationality" text, "Jersey Number(s)" real, "Position" text, "Years" text, "From" text )
What is the Jersey Number of the Player from Clemson?
SELECT SUM("Jersey Number(s)") FROM table_45744 WHERE "From" = 'clemson'
CREATE TABLE table_name_1 ( home VARCHAR, away VARCHAR )
What is the home for the away of 4-0?
SELECT home FROM table_name_1 WHERE away = "4-0"
CREATE TABLE table_28987 ( "Country" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot %" text )
Name the number of ends lost for 6 stolen ends
SELECT COUNT("Ends Lost") FROM table_28987 WHERE "Stolen Ends" = '6'
CREATE TABLE table_80160 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Which country has a score of 70-66=136?
SELECT "Country" FROM table_80160 WHERE "Score" = '70-66=136'
CREATE TABLE table_203_512 ( id number, "release date" text, "album" text, "catalog number" text, "chart position" number, "notes" text )
how many albums were released in the month of november ?
SELECT COUNT("album") FROM table_203_512 WHERE "release date" = 11
CREATE TABLE table_42796 ( "Name" text, "Position" text, "Number" real, "Season" text, "Acquisition via" text )
What is the number of the acquisition of import in the 2002 season?
SELECT "Number" FROM table_42796 WHERE "Acquisition via" = 'import' AND "Season" = '2002'
CREATE TABLE table_name_50 ( name VARCHAR, direction VARCHAR, terminus VARCHAR )
Which bi-directional route has a terminus at Ecat/Rosa Park Transit Center?
SELECT name FROM table_name_50 WHERE direction = "bi-directional" AND terminus = "ecat/rosa park transit center"
CREATE TABLE table_9858 ( "Rank" real, "Venue name" text, "Highest attendance" text, "Location" text, "Current seating capacity" real )
What is Highest Attendance, when Rank is 90, and when Venue Name is Infineon Raceway?
SELECT "Highest attendance" FROM table_9858 WHERE "Rank" = '90' AND "Venue name" = 'infineon raceway'
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0),...
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the average of salary , and group by attribute job_id, I want to rank by the x axis in asc please.
SELECT JOB_ID, AVG(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID
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...
which patients have levo500pm drug code?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "LEVO500PM"
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE presc...
what is the minimum amount of hospital cost that includes granular casts until 1 year ago?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT labevents.hadm_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'granular casts')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY cost....
CREATE TABLE author ( authorid int, authorname varchar ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE venue ( venueid int, venuename varchar ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TAB...
first deep learning paper
SELECT DISTINCT paper.year FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'deep learning' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid GROUP BY paper.year ORDER BY paper.year
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_ti...
For GEOG 472 last semester , who were the GSIs ?
SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course...
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, ...
give me the number of patients whose admission year is less than 2176 and diagnoses short title is hypopotassemia?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2176" AND diagnoses.short_title = "Hypopotassemia"
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE microlab ( microl...
calculate the duration of hospital stays of patient 035-22706's last hospital stay.
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '035-22706' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1
CREATE TABLE table_1342315_12 ( first_elected INTEGER, incumbent VARCHAR )
When was incumbent Leo E. Allen first elected?
SELECT MIN(first_elected) FROM table_1342315_12 WHERE incumbent = "Leo E. Allen"
CREATE TABLE table_27700530_11 ( high_assists VARCHAR, team VARCHAR )
Who had highest assists at the game against Houston?
SELECT high_assists FROM table_27700530_11 WHERE team = "Houston"
CREATE TABLE table_name_59 ( overall VARCHAR, position VARCHAR, pick VARCHAR )
What is the total overall number of the ot position player with a pick greater than 5?
SELECT COUNT(overall) FROM table_name_59 WHERE position = "ot" AND pick > 5
CREATE TABLE table_74978 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
In what Round was George Thomas Picked?
SELECT AVG("Round") FROM table_74978 WHERE "Name" = 'george thomas'
CREATE TABLE table_name_78 ( total INTEGER, country VARCHAR )
What is the highest Total for Australia?
SELECT MAX(total) FROM table_name_78 WHERE country = "australia"
CREATE TABLE table_77473 ( "Year" real, "Championship" text, "Partner" text, "Opponents in the final" text, "Score" text )
which opponents in the u.s. championships played after 1945 and had a score of 3 6, 6 4, 2 6, 6 3, 20 18?
SELECT "Opponents in the final" FROM table_77473 WHERE "Championship" = 'u.s. championships' AND "Year" > '1945' AND "Score" = '3–6, 6–4, 2–6, 6–3, 20–18'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE vitalperiodic ( ...
what was the output of patient 017-49538 for the first time,?
SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-49538')) AND intakeoutput.cellpath LIKE '%output%' ORDER...
CREATE TABLE table_178408_1 ( location_of_the_church VARCHAR, sub_parish__sokn_ VARCHAR )
Name the location of the church for bremanger
SELECT location_of_the_church FROM table_178408_1 WHERE sub_parish__sokn_ = "Bremanger"
CREATE TABLE table_name_3 ( place VARCHAR, to_par VARCHAR, player VARCHAR )
What place has E as the to par, with Mark Wiebe as the player?
SELECT place FROM table_name_3 WHERE to_par = "e" AND player = "mark wiebe"
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,...
give me the number of patients whose admission type is elective and lab test category is blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab."CATEGORY" = "Blood Gas"
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Votes on posts that are neither questions nor answers.
SELECT p.Id AS "post_link", p.Id AS "post_id", pt.Name AS "post_type", vt.Name AS "vote_type", v.UserId AS "user_link", v.CreationDate AS "vote_date", p.Body FROM Votes AS v JOIN Posts AS p ON v.PostId = p.Id JOIN PostTypes AS pt ON p.PostTypeId = pt.Id JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id WHERE pt.Name NOT IN ...
CREATE TABLE table_name_31 ( year VARCHAR, winner__female_ VARCHAR, talent__male_ VARCHAR )
What year had Kim Gevaert as the female winner and Xavier de Baerdemaeker as the male talent?
SELECT year FROM table_name_31 WHERE winner__female_ = "kim gevaert" AND talent__male_ = "xavier de baerdemaeker"
CREATE TABLE table_22476 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" text, "Water (sqmi)" text, "Latitude" text, "Longitude" text, "GEO ID" real, "ANSI code" real )
What county is associated with ansi code 1759686?
SELECT "County" FROM table_22476 WHERE "ANSI code" = '1759686'
CREATE TABLE table_71889 ( "Year" real, "Winners" text, "Club" text, "Time" text, "Runners-up" text )
Who won when np cooper av cooke was runner up?
SELECT "Winners" FROM table_71889 WHERE "Runners-up" = 'np cooper av cooke'
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...
what is age and procedure icd9 code of subject name estrella carroll?
SELECT demographic.age, procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Estrella Carroll"
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 )
What are the names of the cheapest products in each category along with the cheapest price in a bar chart?
SELECT Name, MIN(Price) FROM Products GROUP BY Name
CREATE TABLE table_39988 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" text, "Time" text, "Location" text )
What was the resolution for the match that ended by Submission (armbar)?
SELECT "Res." FROM table_39988 WHERE "Method" = 'submission (armbar)'
CREATE TABLE table_21386 ( "Series #" real, "Season #" real, "Title" text, "Directed by" text, "Original air date" text, "Prod. code" real )
How many episodes have the season number of 1?
SELECT COUNT("Series #") FROM table_21386 WHERE "Season #" = '1'
CREATE TABLE Staff ( staff_id INTEGER, staff_address_id INTEGER, nickname VARCHAR(80), first_name VARCHAR(80), middle_name VARCHAR(80), last_name VARCHAR(80), date_of_birth DATETIME, date_joined_staff DATETIME, date_left_staff DATETIME ) CREATE TABLE Customer_Payments ( customer...
What is the date of birth of every customer whose status code is 'Good Customer', and count them by a line chart, rank in desc by the X-axis.
SELECT date_of_birth, COUNT(date_of_birth) FROM Customers WHERE customer_status_code = 'Good Customer' ORDER BY date_of_birth DESC
CREATE TABLE table_name_5 ( location___state VARCHAR, circuit VARCHAR )
What is the location/state that has adelaide international raceway as the circuit?
SELECT location___state FROM table_name_5 WHERE circuit = "adelaide international raceway"
CREATE TABLE table_2880 ( "Rank" real, "Rider" text, "Mon 24 Aug" text, "Tues 25 Aug" text, "Wed 26 Aug" text, "Thurs 27 Aug" text, "Fri 28 Aug" text, "Sat 29 Aug" text )
When roy richardson 476cc aermacchi is the rider what is the time for saturday august 9th?
SELECT "Sat 29 Aug" FROM table_2880 WHERE "Rider" = 'Roy Richardson 476cc Aermacchi'
CREATE TABLE table_61289 ( "Name of ground" text, "Location" text, "Year" text, "FC matches" text, "LA matches" text, "T20 matches" text, "Total" text )
What year was the total 9?
SELECT "Year" FROM table_61289 WHERE "Total" = '9'
CREATE TABLE church ( open_date VARCHAR )
Show the opening year in whcih at least two churches opened.
SELECT open_date FROM church GROUP BY open_date HAVING COUNT(*) >= 2
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE prescriptions ( row_id num...
count the number of patients who have been on sc 24 fe ng intake the last year.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'sc 24 fe ng' AND d_...
CREATE TABLE table_train_109 ( "id" int, "serum_potassium" float, "systolic_blood_pressure_sbp" int, "body_mass_index_bmi" float, "hypertension" bool, "NOUSE" float )
treated hypertension ( systolic blood pressure >= 110 mmhg systolic and <= 170 mmhg
SELECT * FROM table_train_109 WHERE hypertension = 1 OR (systolic_blood_pressure_sbp >= 110 AND systolic_blood_pressure_sbp <= 170)
CREATE TABLE employee ( emp_num number, emp_lname text, emp_fname text, emp_initial text, emp_jobcode text, emp_hiredate time, emp_dob time ) CREATE TABLE department ( dept_code text, dept_name text, school_code text, emp_num number, dept_address text, dept_extension...
What are the first names of all students who took ACCT-211 and received a C?
SELECT T3.stu_fname FROM class AS T1 JOIN enroll AS T2 ON T1.class_code = T2.class_code JOIN student AS T3 ON T2.stu_num = T3.stu_num WHERE T1.crs_code = 'ACCT-211' AND T2.enroll_grade = 'C'
CREATE TABLE table_name_37 ( country VARCHAR, player VARCHAR, score VARCHAR )
What country did Bart Bryant with a score of 69-70=139 belong to?
SELECT country FROM table_name_37 WHERE score = 69 - 70 = 139 AND player = "bart bryant"
CREATE TABLE region ( region_id number, region_code text, region_name text ) CREATE TABLE affected_region ( region_id number, storm_id number, number_city_affected number ) CREATE TABLE storm ( storm_id number, name text, dates_active text, max_speed number, damage_millions...
What is the total number of deaths and damage for all storms with a max speed greater than the average?
SELECT SUM(number_deaths), SUM(damage_millions_usd) FROM storm WHERE max_speed > (SELECT AVG(max_speed) FROM storm)
CREATE TABLE table_12146637_1 ( episode_title VARCHAR, us_viewers__millions_ VARCHAR )
How many episodes had 9.90 million viewers?
SELECT COUNT(episode_title) FROM table_12146637_1 WHERE us_viewers__millions_ = "9.90"
CREATE TABLE table_22844 ( "Year" real, "Iowa" text, "Kansas" text, "Minnesota" text, "Missouri" text, "Nebraska" text, "North/South Dakota" text )
Name the missouri for 2002
SELECT "Missouri" FROM table_22844 WHERE "Year" = '2002'
CREATE TABLE table_name_58 ( chinese_name VARCHAR, english_name VARCHAR )
What is the Chinese name for the English name Andy Lau?
SELECT chinese_name FROM table_name_58 WHERE english_name = "andy lau"
CREATE TABLE table_28634206_1 ( country VARCHAR )
How many times was taiwan 3rd runner-up?
SELECT MAX(3 AS rd_runner_up) FROM table_28634206_1 WHERE country = "Taiwan"
CREATE TABLE table_11023 ( "Country" text, "Alternate title/Translation" text, "TV network(s)" text, "Series premiere" text, "Weekly schedule" text )
What is the alternate title/translation of the series that premiered on December 12, 2006?
SELECT "Alternate title/Translation" FROM table_11023 WHERE "Series premiere" = 'december 12, 2006'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospit...
how much does a procedure known as antibacterials - cephalosporin cost?
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'antibacterials - cephalosporin')
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
users who took a long break from posting on an SE site?. http://meta.stackexchange.com/questions/245972/how-to-find-the-users-who-took-a-long-break-from-posting-on-an-se-site#245972
SELECT Users.Id, Users.EmailHash, Users.WebsiteUrl FROM Users WHERE Users.CreationDate >= '##year:int##' AND Users.Location LIKE '%##location##%'
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar...
what are the flights from DENVER to SAN FRANCISCO
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRA...
CREATE TABLE table_name_52 ( gold INTEGER, bronze VARCHAR, total VARCHAR, silver VARCHAR, rank VARCHAR )
What is the gold when silver is 1, rank is larger than 3, total is smaller than 2, bronze is smaller than 0?
SELECT SUM(gold) FROM table_name_52 WHERE silver = 1 AND rank > 3 AND total < 2 AND bronze < 0
CREATE TABLE table_13178 ( "7:00 am" text, "7:30 am" text, "8:00 am" text, "9:00 am" text, "10:00 am" text, "11:00 am" text, "noon" text, "12:30 pm" text, "1:00 pm" text, "1:30 pm" text, "2:00 pm" text, "3:00 pm" text, "4:30 pm" text, "5:00 pm" text, "6:30 pm"...
What airs at 7:00 am when The Big Cartoonie Show airs at 3pm?
SELECT "7:00 am" FROM table_13178 WHERE "3:00 pm" = 'the big cartoonie show'
CREATE TABLE table_71868 ( "Team" text, "1st Match" text, "Matches" text, "Lost" text, "% Won" text )
Name the matches for gold coast
SELECT "Matches" FROM table_71868 WHERE "Team" = 'gold coast'
CREATE TABLE table_2233 ( "Pos" text, "No" text, "Driver" text, "Constructor" text, "Part 1" text, "Part 2" text, "Part 3" text, "Grid" text )
Who was the driver when the time in part 3 was 1:31.386?
SELECT "Driver" FROM table_2233 WHERE "Part 1" = '1:31.386'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
what is diagnoses icd9 code of subject id 19420?
SELECT diagnoses.icd9_code FROM diagnoses WHERE diagnoses.subject_id = "19420"
CREATE TABLE table_name_26 ( tie_no VARCHAR, date VARCHAR, away_team VARCHAR )
What is the tie number in the game on 5 January 1986 where Exeter City is the away team?
SELECT tie_no FROM table_name_26 WHERE date = "5 january 1986" AND away_team = "exeter city"
CREATE TABLE table_11501 ( "party" text, "Manhattan" text, "The Bronx" text, "Brooklyn" text, "Queens" text, "Richmond [Staten Is.]" text, "Total" real )
How many voters were in Manhattan when 181,639 people voted in the Bronx?
SELECT "Richmond [Staten Is.]" FROM table_11501 WHERE "The Bronx" = '181,639'
CREATE TABLE table_10595 ( "Location" text, "Venue" text, "Promotion" text, "Event" text, "Inductee(s)" text )
What is the promotion when the event was Acid-fest?
SELECT "Promotion" FROM table_10595 WHERE "Event" = 'acid-fest'
CREATE TABLE table_48846 ( "Result" text, "Opponent" text, "Method" text, "Date" text, "Round" real )
Which Round has a Method of ko, and a Date of 1958?
SELECT MIN("Round") FROM table_48846 WHERE "Method" = 'ko' AND "Date" = '1958'
CREATE TABLE table_12206918_2 ( opponent VARCHAR, date VARCHAR )
How many opponents fought on 1982-12-03?
SELECT COUNT(opponent) FROM table_12206918_2 WHERE date = "1982-12-03"
CREATE TABLE table_15984 ( "Week" real, "Dance/song" text, "Horwood" text, "Goodman" text, "Dixon" text, "Tonioli" text, "Total" text, "Result" text )
How many songs received a 10 from Goodman and were rated by Tonioli?
SELECT COUNT("Tonioli") FROM table_15984 WHERE "Goodman" = '10'
CREATE TABLE plays_games ( stuid number, gameid number, hours_played number ) CREATE TABLE video_games ( gameid number, gname text, gtype text ) CREATE TABLE sportsinfo ( stuid number, sportname text, hoursperweek number, gamesplayed number, onscholarship text ) CREATE TAB...
How many different students play games?
SELECT COUNT(DISTINCT stuid) FROM plays_games
CREATE TABLE table_name_83 ( played INTEGER, drawn VARCHAR, points VARCHAR )
Which average Played has a Drawn smaller than 1, and Points larger than 4?
SELECT AVG(played) FROM table_name_83 WHERE drawn < 1 AND points > 4
CREATE TABLE table_46201 ( "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real, "Points" real )
What mark has over 813 points in the United States, and a 0.152 react?
SELECT "Mark" FROM table_46201 WHERE "Points" > '813' AND "Country" = 'united states' AND "React" > '0.152'
CREATE TABLE table_name_11 ( grid VARCHAR, laps VARCHAR, driver VARCHAR )
How many grids have less than 41 laps and a Driver of pedro de la rosa?
SELECT COUNT(grid) FROM table_name_11 WHERE laps < 41 AND driver = "pedro de la rosa"
CREATE TABLE table_7670 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What kind of Silver has a Nation of norway and a Gold smaller than 3?
SELECT SUM("Silver") FROM table_7670 WHERE "Nation" = 'norway' AND "Gold" < '3'
CREATE TABLE table_name_36 ( name VARCHAR, launch VARCHAR, hanzi VARCHAR )
Which company launched in 1996 and has a Hanzi of ?
SELECT name FROM table_name_36 WHERE launch = "1996" AND hanzi = "凤凰卫视中文台"
CREATE TABLE table_10749367_3 ( test_taker VARCHAR, _number VARCHAR )
Who took test #4?
SELECT test_taker FROM table_10749367_3 WHERE _number = 4
CREATE TABLE table_14278 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
Who is the opponent of the game with a game number larger than 5 on June 22?
SELECT "Opponent" FROM table_14278 WHERE "Game" > '5' AND "Date" = 'june 22'
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TAB...
Try and find deleted BLCR question.
SELECT Body FROM Posts WHERE LOWER(Body) LIKE '%blcr%'
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...
Number of Questions answered by Users In MonthWise.
SELECT COUNT(A.Id) AS Answers FROM Posts AS A INNER JOIN Users AS U ON A.OwnerUserId = U.Id WHERE NOT A.ParentId IS NULL AND U.Id = '##UserId##'
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...
give me the number of patients whose year of birth is less than 2041 and drug route is sc?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2041" AND prescriptions.route = "SC"
CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE PostHistoryTypes ( Id number, ...
Questions with lots of answers, but none upvoted. Shows questions that have no upvoted answers, sorted by the number of answers.
SELECT q.Id AS "post_link", COUNT(a.Id) AS Answers FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE NOT EXISTS(SELECT Id FROM Posts AS a WHERE a.ParentId = q.Id AND a.Score > 0) GROUP BY q.Id ORDER BY COUNT(a.Id) DESC, q.Id
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destructio...
How many documents are stored? Bin the store date by weekday in a bar chart, and order by the y-axis from low to high.
SELECT Date_Stored, COUNT(Date_Stored) FROM All_Documents AS T1 JOIN Ref_Calendar AS T2 ON T1.Date_Stored = T2.Calendar_Date ORDER BY COUNT(Date_Stored)
CREATE TABLE table_name_79 ( name VARCHAR, nationality VARCHAR, rank VARCHAR, heat VARCHAR )
Who is from the united states, has a rank less than 9, and heat more than 5?
SELECT name FROM table_name_79 WHERE rank < 9 AND heat > 5 AND nationality = "united states"
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE a...
when was the first time in the previous day that patient 027-203413 has had a versed intake?
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 = '027-203413')) AND intakeoutput.cellpath LIKE '%intake...
CREATE TABLE table_name_89 ( year INTEGER, accolade VARCHAR, rank VARCHAR )
Name the highest year with rank of 22 and accolade of singles of 1999
SELECT MAX(year) FROM table_name_89 WHERE accolade = "singles of 1999" AND rank = "22"
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepi...
count the number of patients who have been on enteral tube intake: nasogastric nostril, l 12fr intake.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT intakeoutput.patientunitstayid FROM intakeoutput WHERE intakeoutput.celllabel = 'enteral tube intake: nasogastric nostril, l 12fr' AND intakeoutput.cellpath LIKE '%input%')
CREATE TABLE table_28344 ( "Road race" text, "Distance" text, "Location" text, "Country" text, "Month held" text )
What are all of the area where distance is marathon and month held is february
SELECT "Location" FROM table_28344 WHERE "Distance" = 'Marathon' AND "Month held" = 'February'
CREATE TABLE table_29942205_1 ( country_territory VARCHAR )
How many women has got the first runner-up position in representation of Philippines?
SELECT 1 AS st_runner_up FROM table_29942205_1 WHERE country_territory = "Philippines"
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 procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
who is diagnosed with tot anom pulm ven connec?
SELECT admissions.subject_id FROM admissions WHERE admissions.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 = 'tot anom pulm ven connec'))
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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...
When will they be offering Latin American Society and Culture ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
CREATE TABLE table_204_312 ( id number, "stage" text, "date" text, "route" text, "terrain" text, "length" text, "winner" text )
how many miles is the metz - nancy route ?
SELECT "length" FROM table_204_312 WHERE "route" = 'metz - nancy'
CREATE TABLE table_7497 ( "Unemployment" text, "2007-03" real, "2008-03" real, "2009-03" real, "2010-03" real, "2011-03" real, "2012-03" real )
What is the highest 2010-03, when 2008-03 is less than 9.9, when 2011-03 is less than 11.8, and when Unemployment is Czech Republic?
SELECT MAX("2010-03") FROM table_7497 WHERE "2008-03" < '9.9' AND "2011-03" < '11.8' AND "Unemployment" = 'czech republic'
CREATE TABLE table_23392257_4 ( original_airdate VARCHAR, _number VARCHAR )
What date did Episode 22 originally air?
SELECT COUNT(original_airdate) FROM table_23392257_4 WHERE _number = 22
CREATE TABLE table_203_269 ( id number, "season" text, "competition" text, "round" text, "club" text, "home" text, "away" text, "aggregate" text )
what is the last competition they competed in ?
SELECT "competition" FROM table_203_269 ORDER BY id DESC LIMIT 1
CREATE TABLE table_203_695 ( id number, "draw" number, "artist" text, "song" text, "points" number, "place" text )
in the irish national final for the eurovision song contest in 1990 , the artist singing which song received third place ?
SELECT "artist" FROM table_203_695 WHERE "place" = 3
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
Out of the total number of patients who died in or before the year 2174, how many of them had neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues\bone marrow transplant as their primary disease?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.dod_year <= "2174.0"
CREATE TABLE table_name_75 ( week INTEGER, winning_team VARCHAR, event VARCHAR )
How many weeks have a Winning team of yellow team, and an Event of foos it or lose it?
SELECT SUM(week) FROM table_name_75 WHERE winning_team = "yellow team" AND event = "foos it or lose it"