table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_18994724_1 ( language_s_ VARCHAR, film_title_used_in_nomination VARCHAR )
What language was spoken in Everlasting Moments?
SELECT language_s_ FROM table_18994724_1 WHERE film_title_used_in_nomination = "Everlasting Moments"
CREATE TABLE table_39261 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Events" real, "Wins" real )
Which Country has a Rank of 5?
SELECT "Country" FROM table_39261 WHERE "Rank" = '5'
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 those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and commission_pct , sort in desc by the bars.
SELECT PHONE_NUMBER, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER DESC
CREATE TABLE table_name_32 ( position INTEGER, played INTEGER )
Which Position has a Played larger than 9?
SELECT SUM(position) FROM table_name_32 WHERE played > 9
CREATE TABLE table_204_845 ( id number, "round" number, "circuit" text, "location" text, "date" text, "pole position" text, "fastest lap" text, "winning driver" text, "headline event" text )
what city was the race held before montreal on august 24 ?
SELECT "location" FROM table_204_845 WHERE "date" < (SELECT "date" FROM table_204_845 WHERE "location" = 'montreal' AND "date" = 'august 24') ORDER BY "date" DESC LIMIT 1
CREATE TABLE table_name_44 ( Id VARCHAR )
What is the 2010 for the grand slam tournaments of 2007?
SELECT 2010 FROM table_name_44 WHERE 2007 = "grand slam tournaments"
CREATE TABLE table_name_10 ( date VARCHAR, winner VARCHAR, race_title VARCHAR )
On what date did Dick Johnson with at Calder?
SELECT date FROM table_name_10 WHERE winner = "dick johnson" AND race_title = "calder"
CREATE TABLE table_73834 ( "meas. num" real, "passed" text, "YES votes" real, "NO votes" real, "% YES" text, "Const. Amd.?" text, "type" text, "description" text )
HOw many no votes were there when there were 45.60% yes votes
SELECT MIN("NO votes") FROM table_73834 WHERE "% YES" = '45.60%'
CREATE TABLE table_203_30 ( id number, "place" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals\nscored" number, "goals\nconceded" number, "+/-" number, "points" number )
what were the number of goals scored by team a.d.isidro metapan ?
SELECT "goals\nscored" FROM table_203_30 WHERE "team" = 'a.d. isidro metapan'
CREATE TABLE table_name_35 ( driver VARCHAR, time_retired VARCHAR, constructor VARCHAR )
What driver has a ime/Retired of +1 lap, and a Constructor of bar - honda?
SELECT driver FROM table_name_35 WHERE time_retired = "+1 lap" AND constructor = "bar - honda"
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( r...
how many hours has it been since the last time patient 14154 stayed in careunit csru during their current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14154 AND admissions.dischtime IS NULL) AND transfers.careunit = 'csru' ORDER BY transfers.intime DESC LIMIT 1
CREATE TABLE member ( Member_ID int, Card_Number text, Name text, Hometown text, Level int ) CREATE TABLE branch ( Branch_ID int, Name text, Open_year text, Address_road text, City text, membership_amount text ) CREATE TABLE purchase ( Member_ID int, Branch_ID text,...
Bar chart of the number of hometown from each hometown, and I want to display total number in descending order.
SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY COUNT(Hometown) DESC
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob te...
provide the number of patients whose year of birth is less than 2069 and lab test name is amylase?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2069" AND lab.label = "Amylase"
CREATE TABLE table_name_36 ( pages INTEGER, translated_title VARCHAR )
I want the sum of pages for thistle among roses
SELECT SUM(pages) FROM table_name_36 WHERE translated_title = "thistle among roses"
CREATE TABLE table_204_855 ( id number, "year" number, "date" text, "winner" text, "result" text, "loser" text, "attendance" number, "location" text )
how many total games did the chicago bears win in the 1980s ?
SELECT COUNT(*) FROM table_204_855 WHERE "winner" = 'chicago bears'
CREATE TABLE table_name_26 ( timeslot VARCHAR, air_date VARCHAR )
What is the timeslot for the episode that aired April 28, 2009?
SELECT timeslot FROM table_name_26 WHERE air_date = "april 28, 2009"
CREATE TABLE table_11464746_1 ( composition VARCHAR, house_name VARCHAR )
What is the benue house made of?
SELECT composition FROM table_11464746_1 WHERE house_name = "Benue"
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...
tell me the first value of lactate in patient 022-187132 in their current hospital visit?
SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132' AND patient.hospitaldischargetime IS NULL)) AND lab.labname = 'lactate' ORD...
CREATE TABLE table_78357 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Venue is the one for the footscray Home team?
SELECT "Venue" FROM table_78357 WHERE "Home team" = 'footscray'
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, draw a bar chart about the distribution of name and manufacturer , and group by attribute founder, show from low to high by the Y-axis.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer
CREATE TABLE table_name_52 ( country VARCHAR, place VARCHAR, score VARCHAR )
What country placed t3 with a score of 70-65=135?
SELECT country FROM table_name_52 WHERE place = "t3" AND score = 70 - 65 = 135
CREATE TABLE market ( Market_ID int, District text, Num_of_employees int, Num_of_shops real, Ranking int ) CREATE TABLE phone ( Name text, Phone_ID int, Memory_in_G int, Carrier text, Price real ) CREATE TABLE phone_market ( Market_ID int, Phone_ID text, Num_of_stoc...
I want to know the proportion of the total number for each carrier.
SELECT Carrier, COUNT(*) FROM phone GROUP BY Carrier
CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paper ( paperid int, title varchar, venueid int, year int, numciting int, numcitedby...
What authors wrote papers about semantic parsing in 2016 ?
SELECT DISTINCT writes.authorid FROM author, keyphrase, paper, paperkeyphrase, writes WHERE keyphrase.keyphrasename = 'semantic parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year = 2016 AND writes.authorid = author.authorid AND writes.paperid = pape...
CREATE TABLE table_name_50 ( away_team VARCHAR, home_team VARCHAR )
What away team played against Footscray as the home team?
SELECT away_team FROM table_name_50 WHERE home_team = "footscray"
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE offering_instructor ( ...
Which person is the teacher of PSYCH 359 ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PSYCH' AND course.number = 359 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering....
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, ...
since 5 years ago, how many patients were admitted to the hospital?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-5 year')
CREATE TABLE table_742 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What candidates ran in the election that included john shelley?
SELECT "Candidates" FROM table_742 WHERE "Incumbent" = 'John Shelley'
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...
what is drug type of drug name hydrocerin?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Hydrocerin"
CREATE TABLE table_203_521 ( id number, "year" number, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text )
how many total times has this team finished 1st in mid south ?
SELECT COUNT(*) FROM table_203_521 WHERE "regular season" = '1st, mid south'
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), LAST_NAME varchar(25...
Give me a histogram, that simply displays the last name of the employee and the corresponding manager id, and display Y in desc order.
SELECT LAST_NAME, MANAGER_ID FROM employees ORDER BY MANAGER_ID DESC
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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 requirement (...
Who is the instructor for Core Winter classes ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
CREATE TABLE table_name_26 ( executions_in_effigie VARCHAR, tribunal VARCHAR )
How man executions in effigie took place at the Lamego tribunal?
SELECT executions_in_effigie FROM table_name_26 WHERE tribunal = "lamego"
CREATE TABLE table_name_96 ( opponent VARCHAR, date VARCHAR )
On June 29, who was the opponent?
SELECT opponent FROM table_name_96 WHERE date = "june 29"
CREATE TABLE table_name_4 ( ends_won INTEGER, ends_lost VARCHAR, shot__percentage VARCHAR )
What is the highest number of ends won of 47 Ends Lost and a Shot % less than 73?
SELECT MAX(ends_won) FROM table_name_4 WHERE ends_lost = 47 AND shot__percentage < 73
CREATE TABLE table_73525 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What's the number of the game in which Carlos Boozer (8) did the high rebounds?
SELECT "Game" FROM table_73525 WHERE "High rebounds" = 'Carlos Boozer (8)'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( la...
what procedure was first taken to patient 005-77687 in the last hospital visit?
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
CREATE TABLE table_name_61 ( format VARCHAR, region VARCHAR, catalog VARCHAR )
Which Format has a Region of united states, and a Catalog of kem 072?
SELECT format FROM table_name_61 WHERE region = "united states" AND catalog = "kem 072"
CREATE TABLE table_name_1 ( round VARCHAR, college VARCHAR )
In what Round was a player from College of Connecticut drafted?
SELECT round FROM table_name_1 WHERE college = "connecticut"
CREATE TABLE professor ( dept_code VARCHAR ) CREATE TABLE department ( dept_code VARCHAR, dept_name VARCHAR )
How many professors who are from either Accounting or Biology department?
SELECT COUNT(*) FROM professor AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code WHERE T2.dept_name = 'Accounting' OR T2.dept_name = 'Biology'
CREATE TABLE table_14199 ( "Rank" real, "Heat" real, "Name" text, "Nationality" text, "Time" text )
What nationality is Erin Donohue?
SELECT "Nationality" FROM table_14199 WHERE "Name" = 'erin donohue'
CREATE TABLE table_12800 ( "Draft" real, "Round" real, "Pick" real, "Player" text, "Nationality" text )
What is the lowest pick of player paul stasiuk from a round greater than 12?
SELECT MIN("Pick") FROM table_12800 WHERE "Player" = 'paul stasiuk' AND "Round" > '12'
CREATE TABLE table_204_899 ( id number, "event" text, "date" text, "area" text, "tornadoes" number, "casualties" text, "notes" text )
what are the total number of tornado events that occurred in 1960 in the u.s. ?
SELECT SUM("tornadoes") FROM table_204_899 WHERE "date" = 1960
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
count the number of patients that died during the same month after having been diagnosed with bronchitis until 1 year ago.
SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'bronchitis') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnosis...
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedb...
Tags without excerpts ordered by use. Lists the most commonly used tags with empty/missing tag wikis (wiki or excerpt).
SELECT t.TagName AS "tagname", t.Count AS TagCount FROM Tags AS t LEFT JOIN Posts AS e ON t.ExcerptPostId = e.Id LEFT JOIN TagSynonyms AS ts ON ts.SourceTagName = t.TagName WHERE LENGTH(e.Body) < 10 GROUP BY t.TagName, t.Count ORDER BY t.Count DESC
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 medication ( med...
is the glucose of patient 031-11804 second measured on the last hospital visit less than it was first measured on the last hospital visit?
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-11804' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi...
CREATE TABLE table_1341718_14 ( candidates VARCHAR, district VARCHAR )
how many times was it the district illinois 18?
SELECT COUNT(candidates) FROM table_1341718_14 WHERE district = "Illinois 18"
CREATE TABLE table_203_521 ( id number, "year" number, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text )
what was the team 's playoff result in the year after being champions ?
SELECT "playoffs" FROM table_203_521 WHERE "year" = (SELECT "year" FROM table_203_521 WHERE "playoffs" = 'champions') + 1
CREATE TABLE table_19759 ( "Result" text, "Date" text, "Race" text, "Venue" text, "Group" text, "Distance" text, "Weight (kg)" text, "Jockey" text, "Winner/2nd" text )
When did the 55 kg participant race?
SELECT "Date" FROM table_19759 WHERE "Weight (kg)" = '55'
CREATE TABLE Customers ( customer_id INTEGER, payment_method_code VARCHAR(15), customer_number VARCHAR(20), customer_name VARCHAR(80), customer_address VARCHAR(255), customer_phone VARCHAR(80), customer_email VARCHAR(80) ) CREATE TABLE Products ( product_id INTEGER, product_type_cod...
Show the number of customer address history in each year and bin date from by year interval with a line chart.
SELECT date_from, COUNT(date_from) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE View_Unit_Status ( apt_id INTEG...
How many apartment bookings for each weekday? Draw a bar chart binning booking start date by weekday interval, and rank by the y-axis from high to low please.
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id ORDER BY COUNT(booking_start_date) DESC
CREATE TABLE table_68525 ( "Season" text, "League" text, "Winner" text, "Goals" real, "Assists" real, "Points" real )
In the WCHL League, what is the last Assists with less than 65 Goals?
SELECT MIN("Assists") FROM table_68525 WHERE "League" = 'wchl' AND "Goals" < '65'
CREATE TABLE table_name_58 ( score VARCHAR, record VARCHAR )
What was the score when their record was 35 23 15?
SELECT score FROM table_name_58 WHERE record = "35–23–15"
CREATE TABLE table_name_19 ( school_club_team VARCHAR, player VARCHAR )
What college team did Derek Fisher play for?
SELECT school_club_team FROM table_name_19 WHERE player = "derek fisher"
CREATE TABLE table_23654 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" text )
what is the 3-dart average of raymond van barneveld
SELECT "3-dart Average" FROM table_23654 WHERE "Player" = 'Raymond van Barneveld'
CREATE TABLE table_77970 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
What is the date of the circuit of n rburgring, which had Graham Hill as the winning driver?
SELECT "Date" FROM table_77970 WHERE "Winning driver" = 'graham hill' AND "Circuit" = 'nürburgring'
CREATE TABLE table_name_62 ( react INTEGER, country VARCHAR, lane VARCHAR )
What is the lowest of the athlete from sri lanka who has a lane greater than 8?
SELECT MIN(react) FROM table_name_62 WHERE country = "sri lanka" AND lane > 8
CREATE TABLE table_204_783 ( id number, "position" text, "player" text, "free agency\ntag" text, "date signed" text, "2013 team" text )
geno hayes and nick roach both played which position ?
SELECT "position" FROM table_204_783 WHERE "player" = 'geno hayes'
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...
what flights are there from DALLAS to HOUSTON
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTON...
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text, stop_airp...
what flights from WASHINGTON to TORONTO
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 = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TOR...
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...
A scatter chart shows the correlation between ACC_Percent and All_Games_Percent , and group by attribute All_Neutral.
SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Neutral
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, ...
Top 5 StackOverflowers in Coimbatore.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%singapore%' OR UPPER(Location) LIKE '%SINGAPORE%' OR Location LIKE '%singapore%' AND Reputation >= 10000 ORDER BY Reputation DESC LIMIT 25
CREATE TABLE table_name_71 ( margin_of_victory VARCHAR, winning_score VARCHAR )
Who were the runner(s)-up when the winning score was 10 (69-68-74-67=278)?
SELECT margin_of_victory FROM table_name_71 WHERE winning_score = –10(69 - 68 - 74 - 67 = 278)
CREATE TABLE table_58281 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the lowest crowd with home team richmond?
SELECT MIN("Crowd") FROM table_58281 WHERE "Home team" = 'richmond'
CREATE TABLE table_59371 ( "Station" text, "Distance from Wellington" text, "Height above sea level (m)" text, "Opened" real, "Closed" text )
Opened prior to 1877 only 2.44km from Wellington, when did this station close?
SELECT "Closed" FROM table_59371 WHERE "Opened" < '1877' AND "Distance from Wellington" = '2.44km'
CREATE TABLE results ( resultid number, raceid number, driverid number, constructorid number, number number, grid number, position number, positiontext text, positionorder number, points number, laps number, time text, milliseconds number, fastestlap number, r...
Find the distinct names of all races held between 2014 and 2017?
SELECT DISTINCT name FROM races WHERE year BETWEEN 2014 AND 2017
CREATE TABLE table_name_80 ( percentage INTEGER, points_for VARCHAR, losses VARCHAR, wins VARCHAR, points_against VARCHAR )
What is the average Percentage when there are more than 0 wins, Points Against is more than 481, Losses of 8, and a Points For larger than 826?
SELECT AVG(percentage) FROM table_name_80 WHERE wins > 0 AND points_against > 481 AND losses = 8 AND points_for > 826
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...
count the number of patients whose lab test name is alveolar-arterial gradient.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Alveolar-arterial Gradient"
CREATE TABLE table_23197088_4 ( score_in_final VARCHAR, championship VARCHAR )
such as are entire the rating of closing where championship is moscow
SELECT score_in_final FROM table_23197088_4 WHERE championship = "Moscow"
CREATE TABLE table_name_53 ( player VARCHAR, score VARCHAR )
What player has a score of 79?
SELECT player FROM table_name_53 WHERE score = "79"
CREATE TABLE table_11230937_2 ( us_viewers__millions_ VARCHAR, no_in_season VARCHAR )
How many millions of viewers watched episode 15?
SELECT us_viewers__millions_ FROM table_11230937_2 WHERE no_in_season = 15
CREATE TABLE table_9648 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Round" real, "Time" text, "Location" text )
What is the total number of Round(s), when Time is 'n/a', and when Location is 'Canton, Ohio, USA'?
SELECT COUNT("Round") FROM table_9648 WHERE "Time" = 'n/a' AND "Location" = 'canton, ohio, usa'
CREATE TABLE table_8648 ( "Frequency" text, "Call sign" text, "Branding" text, "Format" text, "Owner" text )
What is the Call sign of the Frequency 106.9 the X?
SELECT "Call sign" FROM table_8648 WHERE "Branding" = '106.9 the x'
CREATE TABLE table_24302700_6 ( name VARCHAR, nationality VARCHAR )
Who are all the players from the united states?
SELECT name FROM table_24302700_6 WHERE nationality = "United States"
CREATE TABLE table_7056 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the largest gold number when the total is less than 3, the rank is 5, and the silver is more than 1?
SELECT MAX("Gold") FROM table_7056 WHERE "Total" < '3' AND "Rank" = '5' AND "Silver" > '1'
CREATE TABLE player ( player_id TEXT, birth_year NUMERIC, birth_month NUMERIC, birth_day NUMERIC, birth_country TEXT, birth_state TEXT, birth_city TEXT, death_year NUMERIC, death_month NUMERIC, death_day NUMERIC, death_country TEXT, death_state TEXT, death_city TEXT, ...
For each year, bin the year into day of the week interval, and return the total number of times the team Boston Red Stockings won in the postseasons using a line chart, order X-axis from high to low order.
SELECT year, SUM(COUNT(*)) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' ORDER BY year DESC
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, and could you display from high to low by the y-axis?
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC
CREATE TABLE drivers ( driverId INTEGER, driverRef TEXT, number TEXT, code TEXT, forename TEXT, surname TEXT, dob TEXT, nationality TEXT, url TEXT ) CREATE TABLE results ( resultId INTEGER, raceId INTEGER, driverId INTEGER, constructorId INTEGER, number INTEGER, ...
Find the names of Japanese constructors that have once earned more than 5 points, and count them by a bar chart, I want to rank by the x-axis in ascending.
SELECT name, COUNT(name) FROM constructors AS T1 JOIN constructorStandings AS T2 ON T1.constructorId = T2.constructorId WHERE T1.nationality = "Japanese" AND T2.points > 5 GROUP BY name ORDER BY name
CREATE TABLE table_19178 ( "Home (1st leg)" text, "Home (2nd leg)" text, "1st Leg" text, "2nd leg" text, "Aggregate" text )
When temperley is the home (2nd leg) what is the home (1st leg)?
SELECT "Home (1st leg)" FROM table_19178 WHERE "Home (2nd leg)" = 'Temperley'
CREATE TABLE table_40721 ( "Date" text, "Time" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text, "Report" text )
What was the overall score when set 1 was 23 25?
SELECT "Score" FROM table_40721 WHERE "Set 1" = '23–25'
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE chartevents ( row_id number, subject_id number, ...
had patient 5364 been diagnosed this year with ac posthemorrhag anemia?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ac posthemorrhag anemia') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5364) AND DATETIME(diagnoses_...
CREATE TABLE table_18461635_1 ( captain VARCHAR, location VARCHAR )
Who is the captain of the team in Southampton?
SELECT captain FROM table_18461635_1 WHERE location = "Southampton"
CREATE TABLE table_19324 ( "Episode no." real, "Title" text, "Director" text, "Writer(s)" text, "Original Air Date (ATV)" text, "Production no." real )
Who was the director of the episode originally aired on 26 October 1969?
SELECT "Director" FROM table_19324 WHERE "Original Air Date (ATV)" = '26 October 1969'
CREATE TABLE table_name_20 ( laps INTEGER, grid VARCHAR, driver VARCHAR )
What is the low lap total for henri pescarolo with a grad larger than 6?
SELECT MIN(laps) FROM table_name_20 WHERE grid > 6 AND driver = "henri pescarolo"
CREATE TABLE table_21197 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What was the final score of the game with gerald wallace (14) as the High Rebound?
SELECT "Record" FROM table_21197 WHERE "High rebounds" = 'Gerald Wallace (14)'
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, ...
Is DANCE 335 a hard course ?
SELECT COUNT(*) > 0, program_course.workload FROM course, program_course WHERE course.department = 'DANCE' AND course.number = 335 AND program_course.course_id = course.course_id AND program_course.workload > 3
CREATE TABLE table_24924 ( "Name" text, "Position" text, "Height" text, "Weight" text, "Date of Birth" text, "Home Team" text )
What is the weight is the name is Stuart Craig?
SELECT "Weight" FROM table_24924 WHERE "Name" = 'Stuart Craig'
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, give me the comparison about the average of code over the name , and group by attribute name, I want to sort by the the average of code in desc.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code DESC
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decima...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the average of department_id bin hire_date by weekday.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
CREATE TABLE table_name_3 ( result VARCHAR, film_title_used_in_nomination VARCHAR )
WHAT IS THE RESULT WITH A FILM TITLE FIREDANCER?
SELECT result FROM table_name_3 WHERE film_title_used_in_nomination = "firedancer"
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 minimum age of patients whose language is russ and primary disease is st elevated myocardial infarction\cardiac cath?
SELECT MIN(demographic.age) FROM demographic WHERE demographic.language = "RUSS" AND demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH"
CREATE TABLE table_44557 ( "School" text, "Bask" text, "Golf" text, "Soccer" text, "Soft" text, "Swimming" text, "Tennis" text, "Indoor track" text, "Volleyball" text )
Does Detroit have a soccer team?
SELECT "Soccer" FROM table_44557 WHERE "School" = 'detroit'
CREATE TABLE table_name_54 ( name VARCHAR, town_city VARCHAR, type VARCHAR )
What is the Name of the Multiple Type museum in Anchorage?
SELECT name FROM table_name_54 WHERE town_city = "anchorage" AND type = "multiple"
CREATE TABLE table_204_784 ( id number, "player" text, "league" number, "cup" number, "europa league" number, "total" number )
how many goals did ismail isa score this season ?
SELECT "total" FROM table_204_784 WHERE "player" = 'ismail isa'
CREATE TABLE table_5918 ( "Character" text, "French voice actor" text, "Italian voice actor" text, "German voice actor" text, "Spanish voice actor" text )
What character does Italian voice actor Emanuela Damasio play?
SELECT "Character" FROM table_5918 WHERE "Italian voice actor" = 'emanuela damasio'
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, d...
since 102 months ago patient 016-17669's heartrate was less than 116.0?
SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-17669')) AND vitalperiodic.heartrate < 116.0 AND NOT vitalperiod...
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name te...
until 2 years ago, what were the top five most frequent specimen tests ordered for patients during the same month after they were diagnosed with angio stm/dudn w hmrhg?
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
when's the last time that patient 010-17950 had a vasopressors - vasopressin in the last hospital visit?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-17950' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
CREATE TABLE table_59235 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text )
How many tries against for the team with 67 tries for?
SELECT "Tries against" FROM table_59235 WHERE "Tries for" = '67'
CREATE TABLE table_name_13 ( company_name VARCHAR, accreditation_level VARCHAR, accreditation_status VARCHAR )
What is the Company Name, when the Accreditation Level is Joyn Hot Fixes, and when the Accreditation Status is Approved (Awarded 17.05.13)?
SELECT company_name FROM table_name_13 WHERE accreditation_level = "joyn hot fixes" AND accreditation_status = "approved (awarded 17.05.13)"
CREATE TABLE table_name_27 ( country_of_origin VARCHAR, year_of_intro VARCHAR, primary_cartridge VARCHAR )
What is Country of Origin, when Year of Intro is greater than 1985, and when Primary Cartridge is 125mm?
SELECT country_of_origin FROM table_name_27 WHERE year_of_intro > 1985 AND primary_cartridge = "125mm"