table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuest...
Most Comments on Single Post.
SELECT DISTINCT (PostId), COUNT(Id) FROM Comments GROUP BY PostId ORDER BY COUNT(Id) DESC
CREATE TABLE table_name_69 ( year INTEGER, position VARCHAR, performance VARCHAR, competition VARCHAR )
What was the earliest year in which long jump was performed in the world indoor Championships in 5th position?
SELECT MIN(year) FROM table_name_69 WHERE performance = "long jump" AND competition = "world indoor championships" AND position = "5th"
CREATE TABLE table_19169116_6 ( high_rebounds VARCHAR, date VARCHAR )
how many games with high rebounds where in february 26
SELECT COUNT(high_rebounds) FROM table_19169116_6 WHERE date = "February 26"
CREATE TABLE table_25640730_7 ( written_by VARCHAR, uk_air_date VARCHAR )
If the UK air date is February 18, 2013, who was the episode written by?
SELECT written_by FROM table_25640730_7 WHERE uk_air_date = "February 18, 2013"
CREATE TABLE table_4108 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Viewers *" text )
How many people watched 'it's better to burn out than fae away'?
SELECT "Viewers *" FROM table_4108 WHERE "Title" = 'It''s Better to Burn Out Than Fae Away'
CREATE TABLE table_1333612_1 ( native_american VARCHAR, es_mulatto VARCHAR )
what's the native american with es mulatto being 0.7%
SELECT native_american FROM table_1333612_1 WHERE es_mulatto = "0.7%"
CREATE TABLE table_57830 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
For the roll of 651, what was the lowest Decile?
SELECT MIN("Decile") FROM table_57830 WHERE "Roll" = '651'
CREATE TABLE table_18600760_20 ( land___sqmi__ VARCHAR, latitude VARCHAR )
What is the land area (sqmi) for the township at longtidue 47.548602?
SELECT land___sqmi__ FROM table_18600760_20 WHERE latitude = "47.548602"
CREATE TABLE Documents_to_be_destroyed ( Destruction_Authorised_by_Employee_ID VARCHAR )
Show the ids of all employees who have authorized destruction.
SELECT DISTINCT Destruction_Authorised_by_Employee_ID FROM Documents_to_be_destroyed
CREATE TABLE table_11037 ( "Code" real, "Type" text, "Name" text, "Area (km 2 )" real, "Population" real, "Regional County Municipality" text, "Region" real )
What is total population of Saint-Agapit (code 33045)?
SELECT SUM("Region") FROM table_11037 WHERE "Name" = 'saint-agapit' AND "Code" < '33045'
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 real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
For the attribute Sex and the sum of Weight, show their proportion by a pie chart.
SELECT Sex, SUM(Weight) FROM people GROUP BY Sex
CREATE TABLE table_50709 ( "Appearances" real, "School" text, "Wins" real, "Losses" real, "Percent" text, "Last Appearance" text )
What is the total number of Losses, when Last Appearance is 2003, and when Wins is greater than 2?
SELECT COUNT("Losses") FROM table_50709 WHERE "Last Appearance" = '2003' AND "Wins" > '2'
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, find headquarter and the sum of price , and group by attribute headquarter, and visualize them by a bar chart, sort by the bars in asc.
SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE prescriptio...
has there ever been any 3% citrate given to patient 18866 in their first hospital visit?
SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND inputevents_cv.it...
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
what is procedure long title and drug route of subject id 24425?
SELECT procedures.long_title, prescriptions.route FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "24425"
CREATE TABLE table_name_25 ( laps VARCHAR, grid VARCHAR )
Which laps has a grid of 8?
SELECT laps FROM table_name_25 WHERE grid = "8"
CREATE TABLE table_name_96 ( laps VARCHAR, driver VARCHAR )
How many laps does olivier panis have?
SELECT laps FROM table_name_96 WHERE driver = "olivier panis"
CREATE TABLE table_23982399_1 ( challenger VARCHAR, overall_episode__number VARCHAR )
Who was the challenger on Episode 5?
SELECT challenger FROM table_23982399_1 WHERE overall_episode__number = 5
CREATE TABLE table_name_74 ( general_classification VARCHAR, mountains_classification VARCHAR, stage VARCHAR )
What's the general classification of stage 3 with David Loosli as the mountains classification?
SELECT general_classification FROM table_name_74 WHERE mountains_classification = "david loosli" AND stage = "3"
CREATE TABLE table_61062 ( "Season" text, "Date" text, "Winners" text, "Finalists" text, "Score" text )
Who were the finalists in the 1972 73 season?
SELECT "Finalists" FROM table_61062 WHERE "Season" = '1972–73'
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
How many patients were admitted to hospital for percutaneous (endoscopic) gastrostomy (peg) before the year 2124?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2124" AND procedures.long_title = "Percutaneous [endoscopic] gastrostomy [PEG]"
CREATE TABLE table_name_3 ( enrollment INTEGER, team_nickname VARCHAR )
What is the Enrollment for the Pilots?
SELECT MIN(enrollment) FROM table_name_3 WHERE team_nickname = "pilots"
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...
how many patients had short term hospital as their discharge location and have undergone a procedure endosc retro cholangiopa?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.short_title = "Endosc retro cholangiopa"
CREATE TABLE table_65888 ( "Year" real, "Class" text, "Team" text, "Machine" text, "Points" real, "Wins" real )
What class before 1990 has points of 33?
SELECT "Class" FROM table_65888 WHERE "Year" < '1990' AND "Points" = '33'
CREATE TABLE table_name_7 ( player VARCHAR, college VARCHAR )
Which player went to college at Tennessee-Chattanooga?
SELECT player FROM table_name_7 WHERE college = "tennessee-chattanooga"
CREATE TABLE table_16323766_3 ( preliminary_average VARCHAR, semifinal_average VARCHAR )
What was the preliminary average for the one who had a semifinal average of 8.966 (3)?
SELECT preliminary_average FROM table_16323766_3 WHERE semifinal_average = "8.966 (3)"
CREATE TABLE table_53874 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
When was there a score of 5-1?
SELECT "Date" FROM table_53874 WHERE "Score" = '5-1'
CREATE TABLE table_name_97 ( director VARCHAR, gross__worldwide_ VARCHAR )
Which director had a worldwide gross of $30,471?
SELECT director FROM table_name_97 WHERE gross__worldwide_ = "$30,471"
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
when did patient 86786 have the minimum value of creatinine last until 11/2105?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86786) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'creatinine') AND STRFTIME('%y-%m', labevents.charttime) <= '2105-11' ORDER BY l...
CREATE TABLE table_name_11 ( heat_points VARCHAR, game VARCHAR, date VARCHAR )
What is Heat Points, when Game is less than 80, and when Date is 'April 26 (First Round)'?
SELECT heat_points FROM table_name_11 WHERE game < 80 AND date = "april 26 (first round)"
CREATE TABLE station ( id INTEGER, name TEXT, lat NUMERIC, long NUMERIC, dock_count INTEGER, city TEXT, installation_date TEXT ) CREATE TABLE weather ( date TEXT, max_temperature_f INTEGER, mean_temperature_f INTEGER, min_temperature_f INTEGER, max_dew_point_f INTEGER, ...
A bar chart for what are the number of the dates in which the mean sea level pressure was between 303 and 31?, show y axis in descending order please.
SELECT date, COUNT(date) FROM weather WHERE mean_sea_level_pressure_inches BETWEEN 30.3 AND 31 ORDER BY COUNT(date) 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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients stayed in hospital for more than 10 days and tested in lab for ferritin?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "10" AND lab.label = "Ferritin"
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9cod...
list the top three most frequent drugs that patients have been prescribed with in the same month after receiving beta blocker - metoprolol the last year.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'beta blocker - metoprolol' AND DATETIME(treatment....
CREATE TABLE table_name_6 ( venue VARCHAR, runner_up__average_in_final_ VARCHAR )
what is the venue when the runner-up (average in final) is wayne jones (94.64)?
SELECT venue FROM table_name_6 WHERE runner_up__average_in_final_ = "wayne jones (94.64)"
CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Percent text, ACC_Home text, ACC_Road text, All_Games text, All_Games_Percent int, All_Home text, All_Road text, All_Neutral text ) CREATE TABLE university ( Scho...
Show me about the distribution of ACC_Road and the sum of Team_ID , and group by attribute ACC_Road in a bar chart, and sort Y in descending order.
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID) DESC
CREATE TABLE table_33253 ( "City" text, "Country" text, "IATA" text, "ICAO" text, "Airport" text )
What is Cuba's ICAO?
SELECT "ICAO" FROM table_33253 WHERE "Country" = 'cuba'
CREATE TABLE table_204_737 ( id number, "year" number, "order" text, "quantity" number, "ger nos." text )
what is the last year listed ?
SELECT "year" FROM table_204_737 ORDER BY id DESC LIMIT 1
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, ...
give me the number of patients whose admission type is urgent and lab test fluid is blood?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Blood"
CREATE TABLE table_name_54 ( on_air_id VARCHAR, band VARCHAR, callsign VARCHAR )
What is the On-air ID of FM broadcaster 4nsa?
SELECT on_air_id FROM table_name_54 WHERE band = "fm" AND callsign = "4nsa"
CREATE TABLE table_name_84 ( goals_for INTEGER, goals_against VARCHAR, drawn VARCHAR )
What is the highest goals entry with drawn larger than 6 and goals against 85?
SELECT MAX(goals_for) FROM table_name_84 WHERE goals_against = 85 AND drawn > 6
CREATE TABLE table_28741_1 ( area__km_2__ INTEGER, capital VARCHAR )
How few km 2 does the area with Nay Pyi Taw as capital cover?
SELECT MIN(area__km_2__) FROM table_28741_1 WHERE capital = "Nay Pyi Taw"
CREATE TABLE table_name_9 ( pick INTEGER, round VARCHAR, player VARCHAR )
Name of the highest Pick is also a Round greater than 5 and Player as Tom Ivey?
SELECT MAX(pick) FROM table_name_9 WHERE round > 5 AND player = "tom ivey"
CREATE TABLE dorm ( dormid number, dorm_name text, student_capacity number, gender text ) CREATE TABLE has_amenity ( dormid number, amenid number ) CREATE TABLE dorm_amenity ( amenid number, amenity_name text ) CREATE TABLE lives_in ( stuid number, dormid number, room_numb...
How many students are older than 20 in each dorm?
SELECT COUNT(*), T3.dorm_name FROM student AS T1 JOIN lives_in AS T2 ON T1.stuid = T2.stuid JOIN dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.age > 20 GROUP BY T3.dorm_name
CREATE TABLE table_77390 ( "Rank" real, "Mountain Peak" text, "State" text, "Mountain Range" text, "Location" text )
what is the mountain peak when the location is 37.5775 n 105.4856 w?
SELECT "Mountain Peak" FROM table_77390 WHERE "Location" = '37.5775°n 105.4856°w'
CREATE TABLE table_name_14 ( name VARCHAR, time VARCHAR )
What Name has a Time of 01:17:01?
SELECT name FROM table_name_14 WHERE time = "01:17:01"
CREATE TABLE table_name_52 ( Id VARCHAR )
Name the 2009 for when 2007 is 3r and 2010 is q2
SELECT 2009 FROM table_name_52 WHERE 2007 = "3r" AND 2010 = "q2"
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE time_inte...
i would like a list of round trip flights between INDIANAPOLIS and ORLANDO FLORIDA for the 27 and the 28 of 12
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare AS FARE_0, fare AS FARE_1, fare_basis, flight, flight_fare AS FLIGHT_FARE_0, flight_fare ...
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...
what is age and admission type of subject id 93033?
SELECT demographic.age, demographic.admission_type FROM demographic WHERE demographic.subject_id = "93033"
CREATE TABLE table_13113 ( "Elected" text, "Assembled" text, "Dissolved" text, "1st member" text, "2nd member" text )
What Assembled has a 1st member of william boteler?
SELECT "Assembled" FROM table_13113 WHERE "1st member" = 'william boteler'
CREATE TABLE table_7584 ( "1900s" real, "1920s" real, "1930s" real, "1940s" real, "1950s" real, "1960s" real, "1970s" real, "1980s" real, "1990s" real, "2000s to date" real, "Total to date" real )
What is the total number in the 1920s that has 0 in the 1960s, and less than 4 in the 2000s, and more than 3 in the 1930s?
SELECT COUNT("1920s") FROM table_7584 WHERE "1960s" = '0' AND "2000s to date" < '4' AND "1930s" > '3'
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_typ...
how many times metoprolol tartrate was prescribed since 4 years ago?
SELECT COUNT(*) FROM prescriptions WHERE prescriptions.drug = 'metoprolol tartrate' AND DATETIME(prescriptions.startdate) >= DATETIME(CURRENT_TIME(), '-4 year')
CREATE TABLE table_52867 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where did the home team score 15.21 (111)?
SELECT "Venue" FROM table_52867 WHERE "Home team score" = '15.21 (111)'
CREATE TABLE table_22757733_4 ( runner_up_a VARCHAR, winner VARCHAR )
who ended runner-up to sankar adhi?
SELECT runner_up_a FROM table_22757733_4 WHERE winner = "Sankar Adhi"
CREATE TABLE table_name_35 ( december INTEGER, game VARCHAR, points VARCHAR )
Which December has a Game of 37 and Points smaller than 47?
SELECT AVG(december) FROM table_name_35 WHERE game = 37 AND points < 47
CREATE TABLE table_name_73 ( round VARCHAR, pick__number VARCHAR, college VARCHAR )
How many rounds had a pick number of more than 10 and Appalachian State as a college?
SELECT COUNT(round) FROM table_name_73 WHERE pick__number > 10 AND college = "appalachian state"
CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_fl...
INDIANAPOLIS to ORLANDO 12 27
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 = 'ORLANDO' AND date_day.day_number = 27 AND date_day.month_number = 12 AND ...
CREATE TABLE table_name_74 ( venue VARCHAR, away_team VARCHAR )
When the Away team is melbourne, what venue do they play at?
SELECT venue FROM table_name_74 WHERE away_team = "melbourne"
CREATE TABLE table_name_37 ( term_end VARCHAR, party VARCHAR, minister VARCHAR )
When is the term end of Shlomo-Yisrael Ben-Meir of the National Religious Party?
SELECT term_end FROM table_name_37 WHERE party = "national religious party" AND minister = "shlomo-yisrael ben-meir"
CREATE TABLE table_12886178_4 ( points VARCHAR, club VARCHAR )
How many points does Croesyceiliog RFC have?
SELECT points FROM table_12886178_4 WHERE club = "Croesyceiliog RFC"
CREATE TABLE table_name_62 ( grid INTEGER, rider VARCHAR, laps VARCHAR )
What is the average Grid for the Rider Toni Elias with Laps more than 30?
SELECT AVG(grid) FROM table_name_62 WHERE rider = "toni elias" AND laps > 30
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Ad...
Find the average age for students with different sex in a bar chart, could you list by the Y from low to high?
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age)
CREATE TABLE furniture ( furniture_id number, name text, num_of_component number, market_rate number ) CREATE TABLE manufacturer ( manufacturer_id number, open_year number, name text, num_of_factories number, num_of_shops number ) CREATE TABLE furniture_manufacte ( manufacturer...
Find the id and number of shops for the company that produces the most expensive furniture.
SELECT t1.manufacturer_id, t1.num_of_shops FROM manufacturer AS t1 JOIN furniture_manufacte AS t2 ON t1.manufacturer_id = t2.manufacturer_id ORDER BY t2.price_in_dollar DESC LIMIT 1
CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufac...
please give me flights leaving SAN FRANCISCO and going to PITTSBURGH
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '...
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 jobs ( JOB_ID varchar(10), JOB_TI...
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the average of department_id bin hire_date by weekday in a bar chart.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_...
This Spring or Summer 2012 what are the available human computer interaction classes that are open ?
SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%human...
CREATE TABLE table_71185 ( "Model" text, "Launch year" real, "RAM ( MiB )" real, "ROM ( MiB )" real, "Slots" text, "WiFi" text, "Bluetooth" text )
What is the RAM (MiB) value for the X30 Mid-Range model?
SELECT "RAM ( MiB )" FROM table_71185 WHERE "Model" = 'x30 mid-range'
CREATE TABLE table_79186 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
For which tie was Scunthorpe United the away team?
SELECT "Tie no" FROM table_79186 WHERE "Away team" = 'scunthorpe united'
CREATE TABLE table_30909 ( "Round" real, "Date" text, "Opponent" text, "Home/Away" text, "Score (Collingwoods score is in bold)" text, "Result (includes margin)" text, "Venue" text, "Position on Ladder" text )
What was the score on saturday, 26 june 7:10pm?
SELECT "Score (Collingwoods score is in bold)" FROM table_30909 WHERE "Date" = 'Saturday, 26 June 7:10pm'
CREATE TABLE table_26992 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
What was the least amount of wins when he had 10 poles?
SELECT MIN("Wins") FROM table_26992 WHERE "Poles" = '10'
CREATE TABLE table_68443 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
What is the Qual with less than 68 laps?
SELECT "Qual" FROM table_68443 WHERE "Laps" < '68'
CREATE TABLE table_56116 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the time/retired for ronnie peterson with under 75 laps and a grid under 15?
SELECT "Time/Retired" FROM table_56116 WHERE "Laps" < '75' AND "Grid" < '15' AND "Driver" = 'ronnie peterson'
CREATE TABLE table_20669355_2 ( height__ft_ VARCHAR, country VARCHAR )
How tall is the contestant from Aruba?
SELECT height__ft_ FROM table_20669355_2 WHERE country = "Aruba"
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...
what is maximum age of patients whose marital status is widowed and admission type is elective?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admission_type = "ELECTIVE"
CREATE TABLE table_56667 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Where is the home venue of carlton that had a crowd bigger than 12,000?
SELECT "Venue" FROM table_56667 WHERE "Crowd" > '12,000' AND "Home team" = 'carlton'
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAd...
Top Indian users in StackOverFlow.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%india%' OR UPPER(Location) LIKE '%INDIA%' AND Reputation >= 5000 ORDER BY Reputation DESC
CREATE TABLE player_coach ( Player_ID int, Coach_ID int, Starting_year int ) CREATE TABLE club ( Club_ID int, Club_name text, Region text, Start_year int ) CREATE TABLE player ( Player_ID int, Sponsor_name text, Player_name text, Gender text, Residence text, Occupat...
Visualize a bar chart that X-axis is the gender and compute the number of players in each gender as a Y-axis, show total number in descending order.
SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender) DESC
CREATE TABLE table_13671 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
what is the tournament when the score is 2-6, 4-6?
SELECT "Tournament" FROM table_13671 WHERE "Score" = '2-6, 4-6'
CREATE TABLE table_182499_1 ( porphyria VARCHAR, substrate VARCHAR )
how many porphyria have substrate -aminolevulinic acid
SELECT COUNT(porphyria) FROM table_182499_1 WHERE substrate = "δ-Aminolevulinic acid"
CREATE TABLE table_61574 ( "Name" text, "Type" text, "R.A. ( J2000 )" text, "Dec. ( J2000 )" text, "Redshift (km/ s )" text, "Apparent Magnitude" real )
Which R.A. (J2000) has a Name of ngc 1543?
SELECT "R.A. ( J2000 )" FROM table_61574 WHERE "Name" = 'ngc 1543'
CREATE TABLE table_1140119_5 ( date VARCHAR, circuit VARCHAR )
What date was the Silverstone circuit driven?
SELECT date FROM table_1140119_5 WHERE circuit = "Silverstone"
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype tex...
what is the four most frequently ordered procedure for patients of 40s?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age B...
CREATE TABLE table_17903 ( "Unit" text, "Type" text, "Net power" text, "Total power" text, "Construction start" text, "Construction finish" text, "Commercial operation" text, "Shut down" text )
When was the start of the construction of the unit that's been in commercial operation since 04.03.1987?
SELECT "Construction start" FROM table_17903 WHERE "Commercial operation" = '04.03.1987'
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...
let me know the icu stay id for patient with patient id 83678.
SELECT prescriptions.icustay_id FROM prescriptions WHERE prescriptions.subject_id = "83678"
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 diagnoses ( ...
what is the maximum age of patients whose hospital stay is 29 days and who got admitted in or after the year 2121?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.days_stay = "29" AND demographic.admityear >= "2121"
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE T...
Top 200 Comments Containing 'Accept' or 'Upvote'.
SELECT Id, Text, Id AS "comment_link" FROM Comments WHERE LENGTH(Text) < 20 AND Text LIKE '%accept my answer%' OR Text LIKE '%please accept%' OR Text LIKE '%upvote please%' ORDER BY Id DESC LIMIT 200
CREATE TABLE table_name_3 ( team_1 VARCHAR )
What is the 1st leg score when US Mbila Nzambi is team 1?
SELECT 1 AS st_leg FROM table_name_3 WHERE team_1 = "us mbila nzambi"
CREATE TABLE table_14003108_1 ( highest VARCHAR, team VARCHAR )
how many highest with team being forfar athletic
SELECT COUNT(highest) FROM table_14003108_1 WHERE team = "Forfar Athletic"
CREATE TABLE table_20445 ( "Information" text, "Akimel A-al The name is Tohono Oodham for children of the river" text, "Altade\u00f1a" text, "Aprende" text, "Centennial" text, "Kyrene MS" text, "del Pueblo" text )
Name the del pueblo for centennial 1988
SELECT "del Pueblo" FROM table_20445 WHERE "Centennial" = '1988'
CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId number, CreationDate time, BountyAmount number ) CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Tags ( Id number, TagName text, C...
HTTP links (instead of HTTPS) for isfdb.org.
SELECT p.CreationDate, t.TagName, p.Id AS "post_link" FROM Posts AS p JOIN Tags AS t ON ((p.PostTypeId = 4 AND t.ExcerptPostId = p.Id) OR (p.PostTypeId = 5 AND t.WikiPostId = p.Id)) WHERE p.PostTypeId IN (4, 5) AND p.Body LIKE '%http://%' AND NOT p.Body LIKE '%http://isfdb.org%' AND NOT p.Body LIKE '%http://www.isfdb.o...
CREATE TABLE table_68789 ( "Institution" text, "Team" text, "City" text, "Province" text, "First season" real, "Head coach" text, "Enrollment" real, "Football stadium" text, "Capacity" real )
What's the total enrollment ofr Mcgill University that has a capacity less than 25,012?
SELECT COUNT("Enrollment") FROM table_68789 WHERE "Institution" = 'mcgill university' AND "Capacity" < '25,012'
CREATE TABLE table_name_9 ( winning_team VARCHAR, pole_position VARCHAR )
What team does mario andretti play pole position for?
SELECT winning_team FROM table_name_9 WHERE pole_position = "mario andretti"
CREATE TABLE purchase ( branch_id VARCHAR, year VARCHAR ) CREATE TABLE branch ( branch_id VARCHAR, city VARCHAR )
What is the sum of total pounds of purchase in year 2018 for all branches in London?
SELECT SUM(total_pounds) FROM purchase AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T2.city = 'London' AND T1.year = 2018
CREATE TABLE table_31409 ( "Rank" real, "Country/Territory" text, "Miss Earth" text, "Miss Air" real, "Miss Water" real, "Miss Fire" real, "Semifinalists" real, "Total" real )
What is the highest total for any country/territory?
SELECT MAX("Total") FROM table_31409
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 gender is f and item id is 50836?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "F" AND lab.itemid = "50836"
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type t...
what were the top five most common medicines that patients prescribed during the same month after having been prescribed with tobramycin fortified ophth. soln. since 5 years ago?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'tobramycin fortified ophth. soln.' AND DATETIME(prescriptions.sta...
CREATE TABLE table_name_10 ( floors INTEGER, name VARCHAR )
What is the number of floors for the Citic Square?
SELECT AVG(floors) FROM table_name_10 WHERE name = "citic square"
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE sta...
Show the number of games for each home team in a bar chart, and display by the total number in asc.
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Home_team ORDER BY COUNT(Home_team)
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE airline ( airline_code...
i want to arrive in DETROIT around 6pm and i'm leaving from CHICAGO
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.arrival_time <= 1830 AND flight.arrival_time >= 1730) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DETROIT' AND flight.to_...
CREATE TABLE table_27771406_1 ( catches INTEGER, player VARCHAR )
How many catches did Clifford McWatt have?
SELECT MIN(catches) FROM table_27771406_1 WHERE player = "Clifford McWatt"
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, visualize a bar chart about the distribution of name and the amount of name , and group by attribute name, rank by the x axis in asc.
SELECT T1.Name, COUNT(T1.Name) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name