table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_203_823 ( id number, "model name" text, "date" text, "type" text, "thrust (kg) / power (eshp)" text, "fitted to" text )
what was the top thrust achieved by a lyul ` ka engine before 1980 ?
SELECT "thrust (kg) / power (eshp)" FROM table_203_823 ORDER BY "thrust (kg) / power (eshp)" DESC LIMIT 1
CREATE TABLE table_name_69 ( points INTEGER, season VARCHAR )
What is total amount of points for the 2007 season?
SELECT SUM(points) FROM table_name_69 WHERE season = 2007
CREATE TABLE table_name_44 ( pick__number INTEGER, round VARCHAR, position VARCHAR, college VARCHAR )
A Round larger than 1, a College of Oklahoma state, and a average Pick # that has a Position of tight end is what?
SELECT AVG(pick__number) FROM table_name_44 WHERE position = "tight end" AND college = "oklahoma state" AND round > 1
CREATE TABLE table_name_2 ( grid INTEGER, time_retired VARCHAR )
What Grid has a Time/Retired of clutch?
SELECT SUM(grid) FROM table_name_2 WHERE time_retired = "clutch"
CREATE TABLE table_name_93 ( home_team VARCHAR, venue VARCHAR )
Which home team played at MCG?
SELECT home_team FROM table_name_93 WHERE venue = "mcg"
CREATE TABLE Invoices ( invoice_number INTEGER, order_id INTEGER, invoice_date DATETIME ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, account_id INTEGER, invoice_number INTEGER, transaction_type VARCHAR(15), transaction_date DATETIME, transaction_amount DECIMAL(19,...
Show the number of accounts for each customer in a bar chart grouping by customer's first name.
SELECT customer_first_name, COUNT(*) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_...
BOSTON 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PITTSBU...
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 regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE employees ( EMPLOYEE_I...
For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21'
CREATE TABLE table_203_836 ( id number, "title" text, "year" number, "platforms" text, "developer" text, "publisher" text, "notes" text )
how many platforms did american mcgee 's grimm run on ?
SELECT "platforms" FROM table_203_836 WHERE "title" = "american mcgee's grimm"
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE treatment ( treatmenti...
what are the four most common medications that followed during the same month for patients who received antiviral therapy until 2101?
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 = 'antiviral therapy' AND STRFTIME('%y', treatment.tr...
CREATE TABLE table_24530 ( "No." real, "Date" text, "Tournament" text, "Winning score" text, "To par" text, "Margin of victory" text, "Runner(s)-up" text, "Winners share ( \u20ac )" real )
What is the winning score when 5 strokes is the margin of victory?
SELECT "Winning score" FROM table_24530 WHERE "Margin of victory" = '5 strokes'
CREATE TABLE table_2429942_2 ( top_goalscorer VARCHAR, season VARCHAR )
Who is the top goalscorer for season 1998-99?
SELECT top_goalscorer FROM table_2429942_2 WHERE season = "1998-99"
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 was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by weekday, and could you list Y in desc order please?
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
what is patient 27739's monthly minimum value of arterial bp [diastolic] since 1068 days ago?
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
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...
Visualize a bar chart about the distribution of All_Home and School_ID , and group by attribute ACC_Home, show in asc by the Y-axis.
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY School_ID
CREATE TABLE table_20225 ( "Date" text, "Cover model" text, "Centerfold model" text, "Interview subject" text, "20 Questions" text, "Pictorials" text )
Who was featured in 20 questions when the subject of the interview was Mike Piazza?
SELECT "20 Questions" FROM table_20225 WHERE "Interview subject" = 'Mike Piazza'
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, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Next semester which classes are available as PreMajor ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND program_course.category LIKE '%PreMajor%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' AND semester.semester_id = co...
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...
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Home, and sort in desc by the X-axis please.
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY All_Home DESC
CREATE TABLE table_name_1 ( home_team VARCHAR, venue VARCHAR )
What did the Victoria park home team score?
SELECT home_team AS score FROM table_name_1 WHERE venue = "victoria park"
CREATE TABLE table_65267 ( "Township" text, "County" text, "Pop. (2010)" real, "Land ( sqmi )" real, "Water (sqmi)" real, "Latitude" real, "Longitude" real, "GEO ID" real, "ANSI code" real )
What is the highest water (sq mi) of the township glenila, which has more than 33.576 sq mi of land and a latitude greater than 48.832189?
SELECT MAX("Water (sqmi)") FROM table_65267 WHERE "Land ( sqmi )" > '33.576' AND "Township" = 'glenila' AND "Latitude" > '48.832189'
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give me the number of patients whose language is span and religion is jewish?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "SPAN" AND demographic.religion = "JEWISH"
CREATE TABLE table_57716 ( "Rd #" real, "Pick #" real, "Player" text, "Reg GP" real, "Pl GP" real )
What is the highest Pick number that had a road number that was less than 6, featured Bob Dailey as a player, and which had a Reg GP bigger than 257?
SELECT MAX("Pick #") FROM table_57716 WHERE "Rd #" < '6' AND "Player" = 'bob dailey' AND "Reg GP" > '257'
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
tell me the four year survival rate of patients who have been prescribed morphine 4 mg/ml syringe : 1 ml syringe after they were diagnosed with biliary obstruction - cholelithiasis?
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid...
CREATE TABLE table_27800 ( "Case" text, "1st pers. sing." text, "2nd pers. sing." text, "3rd pers. sing." text, "1st pers. pl" text, "2nd pers. pl." text, "3rd pers pl." text )
Name the 3rd person pl for ~
SELECT "3rd pers pl." FROM table_27800 WHERE "2nd pers. sing." = 'тонэн ~ тонэныд'
CREATE TABLE table_30113 ( "Player" text, "Matches" real, "Innings" real, "Wickets" real, "Average" text, "BBI" text, "BBM" text, "5wi" real )
What is the least amount of matches?
SELECT MIN("Matches") FROM table_30113
CREATE TABLE table_name_63 ( record VARCHAR, date VARCHAR )
On September 7 what was the record?
SELECT record FROM table_name_63 WHERE date = "september 7"
CREATE TABLE bridge ( architect_id int, id int, name text, location text, length_meters real, length_feet real ) CREATE TABLE architect ( id text, name text, nationality text, gender text ) CREATE TABLE mill ( architect_id int, id int, location text, name text, ...
How many mills of 'Grondzeiler' type are built in each year? Give me the trend.
SELECT built_year, COUNT(built_year) FROM mill WHERE type = 'Grondzeiler'
CREATE TABLE table_dev_5 ( "id" int, "anemia" bool, "gender" string, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "panel_reactive_antibodies" int, "psa" int, "body_mass_index_bmi" float, "NOUSE" float )
presence of panel reactive antibodies > 20 %
SELECT * FROM table_dev_5 WHERE panel_reactive_antibodies > 20
CREATE TABLE table_name_14 ( crowd VARCHAR, away_team VARCHAR )
How many spectators were at the away team Carlton?
SELECT crowd FROM table_name_14 WHERE away_team = "carlton"
CREATE TABLE table_43601 ( "Vacuum range" text, "Pressure in hPa (mbar)" text, "Molecules / cm 3" text, "Molecules / m 3" text, "Mean free path" text )
What is the Pressure in hPa (mbar), when Vacuum Range is 'medium vacuum'?
SELECT "Pressure in hPa (mbar)" FROM table_43601 WHERE "Vacuum range" = 'medium vacuum'
CREATE TABLE table_17357929_1 ( goal_average_1 VARCHAR, lost VARCHAR )
What is the goal average 1 for teams that lost 9 games?
SELECT goal_average_1 FROM table_17357929_1 WHERE lost = 9
CREATE TABLE table_38348 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What is the score of the friendly match?
SELECT "Score" FROM table_38348 WHERE "Competition" = 'friendly match'
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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find hire_date and the sum of manager_id bin hire_date by weekday, and visualize them by a bar chart, I want to sort by the total number in desc.
SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(MANAGER_ID) DESC
CREATE TABLE table_11173827_1 ( rank VARCHAR, chinese_title VARCHAR )
What is the rank of the chinese title ?
SELECT rank FROM table_11173827_1 WHERE chinese_title = "緣來自有機"
CREATE TABLE table_60544 ( "Name" text, "Pos." text, "Height" text, "Weight" text, "Date of Birth" text, "Club" text )
What is the Name of the D Player born on 1983-07-19?
SELECT "Name" FROM table_60544 WHERE "Pos." = 'd' AND "Date of Birth" = '1983-07-19'
CREATE TABLE table_35620 ( "Season" real, "Team" text, "Wins" real, "Losses" real, "Draws" real )
What is the least amount of losses for the team that had more than 0 draws during the seasons earlier than 1926?
SELECT MIN("Losses") FROM table_35620 WHERE "Draws" > '0' AND "Season" < '1926'
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE microb...
count the number of non-invasive mech vent procedures performed in 2104.
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'non-invasive mech vent') AND STRFTIME('%y', procedures_icd.charttime) = '2104'
CREATE TABLE table_name_28 ( silver VARCHAR, bronze VARCHAR, sport VARCHAR )
When volleyball has 2 bronze, what is the total number of silver?
SELECT COUNT(silver) FROM table_name_28 WHERE bronze = 2 AND sport = "volleyball"
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE...
list all flights leaving DENVER between 2000 and 2100
SELECT DISTINCT flight_id FROM flight WHERE ((departure_time <= 2100 AND departure_time >= 2000) AND from_airport IN (SELECT AIRPORT_SERVICEalias0.airport_code FROM airport_service AS AIRPORT_SERVICEalias0 WHERE AIRPORT_SERVICEalias0.city_code IN (SELECT CITYalias0.city_code FROM city AS CITYalias0 WHERE CITYalias0.cit...
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, ...
Tell me the drug type and route of administration of QUET200.
SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "QUET200"
CREATE TABLE table_69610 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the score of the Boston Bruins away game on March 13?
SELECT "Score" FROM table_69610 WHERE "Visitor" = 'boston bruins' AND "Date" = 'march 13'
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...
count the number of patients whose admission location is clinic referral/premature and drug code is niac100?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND prescriptions.formulary_drug_cd = "NIAC100"
CREATE TABLE table_name_83 ( bronze INTEGER, rank VARCHAR, total VARCHAR )
What is the lowest bronze total that has a rank of 1 and more than 34 total medals?
SELECT MIN(bronze) FROM table_name_83 WHERE rank = "1" AND total > 34
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
what is the drug that patient 029-7028 was prescribed with within 2 days after the oxygen therapy (> 60%) - reduce fio2 as tolerated in 09/last year?
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-7028') AND treatment.treatmen...
CREATE TABLE table_32838 ( "Player" text, "Span" text, "Start" text, "Tries" text, "Conv" text, "Pens" text, "Drop" text, "Lost" text, "Draw" text )
What drop has a 0 conv and Tries of 6?
SELECT "Drop" FROM table_32838 WHERE "Conv" = '0' AND "Tries" = '6'
CREATE TABLE table_name_81 ( opponent VARCHAR, date VARCHAR )
What opponent has april 23 as the date?
SELECT opponent FROM table_name_81 WHERE date = "april 23"
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, ni...
CLEVELAND to MIAMI on wednesday arriving before 1600
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <...
CREATE TABLE table_51830 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What constructor has a grid less than 13 with under 9 laps?
SELECT "Constructor" FROM table_51830 WHERE "Grid" < '13' AND "Laps" < '9'
CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requirement varchar, description varchar, num_semesters int, num_enrolled int, has_discussion varchar, has_lab varchar, has_p...
How many classes of the upper level have labs ?
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_lab = 'Y' AND program_course.category LIKE '%ULCS%'
CREATE TABLE table_name_14 ( block_a VARCHAR, el_nosawa_mendoza VARCHAR )
What is the Block A value for an El NOSAWA Mendoza value of kondo (7:08)?
SELECT block_a FROM table_name_14 WHERE el_nosawa_mendoza = "kondo (7:08)"
CREATE TABLE table_19075 ( "Previous season" text, "Team" text, "Town" text, "Arena (capacity)" text, "Website" text, "Head Coach" text, "Foreign Players (max. 2)" text )
Who was the head coach in season 2?
SELECT "Head Coach" FROM table_19075 WHERE "Previous season" = '2'
CREATE TABLE table_73998 ( "District" text, "Incumbent" text, "Party" text, "First elected" text, "Result" text, "Candidates" text )
Name the result for augustine h. shepperd (j) 100%
SELECT "Result" FROM table_73998 WHERE "Candidates" = 'Augustine H. Shepperd (J) 100%'
CREATE TABLE Procedures ( Code INTEGER, Name VARCHAR(30), Cost REAL ) CREATE TABLE Nurse ( EmployeeID INTEGER, Name VARCHAR(30), Position VARCHAR(30), Registered BOOLEAN, SSN INTEGER ) CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUnder...
Which physicians are trained in procedures that are more expensive than 5000, and count them by a bar chart
SELECT T1.Name, COUNT(T1.Name) FROM Physician AS T1 JOIN Trained_In AS T2 ON T1.EmployeeID = T2.Physician JOIN Procedures AS T3 ON T3.Code = T2.Treatment WHERE T3.Cost > 5000 GROUP BY T1.Name
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 whose ethnicity is american indian/alaska native and year of birth is less than 2134?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.dob_year < "2134"
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) 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 ...
has the respiratory rate of patient 28443 in 12/2105 ever been less than 24.0?
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28443)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respiratory rate'...
CREATE TABLE table_name_61 ( per_capita_income VARCHAR, median_family_income VARCHAR )
What is the per capita income of the county with a median family income of $40,492?
SELECT per_capita_income FROM table_name_61 WHERE median_family_income = "$40,492"
CREATE TABLE table_name_64 ( howard_baker VARCHAR, george_h_w_bush VARCHAR )
Name the howard bake when bush had 66%
SELECT howard_baker FROM table_name_64 WHERE george_h_w_bush = "66%"
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length in...
all flights from BOSTON to WASHINGTON on 11 11
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 = 'WASHINGTON' AND date_day.day_number = 11 AND date_day.month_number = 11 A...
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Badges ( Id number, UserId number, Name t...
Top Android Users in Poland.
WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =...
CREATE TABLE table_name_12 ( host VARCHAR, venue VARCHAR, year VARCHAR, state VARCHAR )
What is the host in a year greater than 1989 and when the venue is the Staples Center located in California?
SELECT host FROM table_name_12 WHERE year > 1989 AND state = "california" AND venue = "staples center"
CREATE TABLE table_44205 ( "Publication" text, "Country" text, "Accolade" text, "Year" real, "Rank" real )
What is Accolade, when Country is 'United States', and when Year is '1999'?
SELECT "Accolade" FROM table_44205 WHERE "Country" = 'united states' AND "Year" = '1999'
CREATE TABLE table_58703 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Which Result has a Game of game 1?
SELECT "Result" FROM table_58703 WHERE "Game" = 'game 1'
CREATE TABLE table_80044 ( "Units" text, "Type" text, "Period used" text, "Formed from" text, "Trailers" text )
Name the typed for formed from 6-pul trailer third in res unit
SELECT "Type" FROM table_80044 WHERE "Formed from" = '6-pul trailer third in res unit'
CREATE TABLE table_12205 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" text, "Finish" text )
Which To par has a Player of tom watson?
SELECT "To par" FROM table_12205 WHERE "Player" = 'tom watson'
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, give me the comparison about employee_id over the last_name .
SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE song ( song_name varchar2(50), artist...
For each file format, return the number of artists who released songs in that format Show bar chart, and show by the X in asc.
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats
CREATE TABLE table_name_58 ( total_seasons INTEGER, team VARCHAR )
What is the least total seasons of the Vancouver 86ers?
SELECT MIN(total_seasons) FROM table_name_58 WHERE team = "vancouver 86ers"
CREATE TABLE table_52754 ( "Title" text, "Author(s)" text, "Recorded" text, "Location(s)" text, "Time" text )
What title runs for 3:22?
SELECT "Title" FROM table_52754 WHERE "Time" = '3:22'
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, O...
Number of up- and downvotes per day - 2.
SELECT CreationDate, SUM(CASE VoteTypeId WHEN 2 THEN 1 ELSE 0 END) AS "Upvotes", SUM(CASE VoteTypeId WHEN 3 THEN 1 ELSE 0 END) AS "Downvotes" FROM Votes WHERE CreationDate >= '2019-09-01' AND VoteTypeId IN (2, 3) GROUP BY CreationDate ORDER BY CreationDate
CREATE TABLE table_203_157 ( id number, "year" number, "film" text, "role" text, "language" text, "notes" text )
what was neha 's last film ?
SELECT "film" FROM table_203_157 ORDER BY id DESC LIMIT 1
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...
Give me the comparison about Team_ID over the All_Home , and group by attribute ACC_Home by a bar chart, and could you rank in desc by the Y?
SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Home, All_Home ORDER BY Team_ID DESC
CREATE TABLE item ( i_id number, title text ) CREATE TABLE trust ( source_u_id number, target_u_id number, trust number ) CREATE TABLE review ( a_id number, u_id number, i_id number, rating number, rank number ) CREATE TABLE useracct ( u_id number, name text )
Find the highest rank of all reviews.
SELECT MIN(rank) FROM review
CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Customer_Addresses ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Customers ( customer_id INTEGER, payment_method_code ...
what is the average price for each type of product?, and show y-axis in descending order.
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price) DESC
CREATE TABLE table_63009 ( "Driver" text, "Navigator" text, "Vehicle" text, "Class" text, "Capacity" real, "Total Time" text, "Margin" text )
How much Capacity has a Vehicle of 2003 holden commodore ute?
SELECT COUNT("Capacity") FROM table_63009 WHERE "Vehicle" = '2003 holden commodore ute'
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 vitalperiodi...
patient 002-38474 was since 5 years ago in the emergency room?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '002-38474' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime) >= DATETIME(CURRENT_TIME(), '-5 year')
CREATE TABLE table_1729366_2 ( championship VARCHAR, opponents_in_the_final VARCHAR )
Which championship had the final opponents of nathalie dechy andy ram?
SELECT championship FROM table_1729366_2 WHERE opponents_in_the_final = "Nathalie Dechy Andy Ram"
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId n...
Top Users from Algeria /.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, WebsiteUrl AS Wesbite, LastAccessDate AS Seen, CreationDate FROM Users WHERE Reputation >= '##MinimalReputation:int?1##' AND (UPPER(Location) LIKE UPPER('%Algeria%') OR UPPER(Location) LIKE UPPER('%Algerie%') OR UPPER(L...
CREATE TABLE genre ( g_name varchar2(20), rating varchar2(10), most_popular_in varchar2(50) ) CREATE TABLE files ( f_id number(10), artist_name varchar2(50), file_size varchar2(20), duration varchar2(20), formats varchar2(20) ) CREATE TABLE artist ( artist_name varchar2(50), co...
Bar graph to show the total number from different formats, and display by the the total number in asc please.
SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY COUNT(*)
CREATE TABLE member_of_club ( stuid number, clubid number, position text ) CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE club ( clubid number, clubname text, clubdes...
Which members of 'Bootup Baltimore' major in '600'? Give me their first names and last names.
SELECT t3.fname, t3.lname FROM club AS t1 JOIN member_of_club AS t2 ON t1.clubid = t2.clubid JOIN student AS t3 ON t2.stuid = t3.stuid WHERE t1.clubname = "Bootup Baltimore" AND t3.major = "600"
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 course_tags_count ( course_id int, clear_grading int, pop_quiz int, ...
Which classes being offered this Spring-Summer are upper-level WRITING ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'WRITING' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Spr...
CREATE TABLE table_21312959_1 ( no_in_season VARCHAR, us_viewers__millions_ VARCHAR )
How many episodes had the us viewers (millions) figure of 5.0?
SELECT COUNT(no_in_season) FROM table_21312959_1 WHERE us_viewers__millions_ = "5.0"
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE...
i want a list of flights from PITTSBURGH to BALTIMORE on thursday that arrive in BALTIMORE before 1000
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 24 AND date_day.month_number = 5 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <...
CREATE TABLE table_41080 ( "Season" text, "Division" text, "Finish" text, "Wins" text, "Losses" text, "Pct." text )
In which season were there Wins of 29 and a Finished place of 3rd?
SELECT "Season" FROM table_41080 WHERE "Wins" = '29' AND "Finish" = '3rd'
CREATE TABLE table_79254 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Theme Song(s)" text, "Episodes" real, "Average Ratings" text )
What is the Theme Song of the show on Fuji TV Station with Average Ratings of 16.65%?
SELECT "Theme Song(s)" FROM table_79254 WHERE "TV Station" = 'fuji tv' AND "Average Ratings" = '16.65%'
CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
Give me the title and highest price for each film Show bar chart, could you display in ascending by the x-axis?
SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title
CREATE TABLE table_38184 ( "Rank" real, "Matches as champion" real, "Reigns as champion" real, "Title matches won*" real, "Title last held" text )
Which Matches is on 24 march 1963 with a Rank larger than 44?
SELECT MAX("Matches as champion") FROM table_38184 WHERE "Title last held" = '24 march 1963' AND "Rank" > '44'
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 did not have any job in the past, visualize a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
CREATE TABLE table_18659 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
What year was the first election when Fritz G. Lanham was elected?
SELECT MAX("First elected") FROM table_18659 WHERE "Incumbent" = 'Fritz G. Lanham'
CREATE TABLE table_48328 ( "Team #1" text, "Points" text, "Team #2" text, "1st leg" text, "2nd leg" text )
What is 2nd Leg, when Team #2 is 'San Lorenzo'?
SELECT "2nd leg" FROM table_48328 WHERE "Team #2" = 'san lorenzo'
CREATE TABLE table_train_199 ( "id" int, "t2dm" bool, "hemoglobin_a1c_hba1c" float, "renal_disease" bool, "diabetic" string, "hypoglycemia" bool, "diabetes" bool, "seizure_disorder" bool, "glaucoma" bool, "hypertension" bool, "age" float, "NOUSE" float )
age 5 _ 14 at time of enrollment
SELECT * FROM table_train_199 WHERE age >= 5 AND age <= 14
CREATE TABLE table_11703336_1 ( cpu VARCHAR, ram VARCHAR, display_size VARCHAR )
what is the cpu for the calculator with 28 kb of ram and display size 128 64 pixels 21 8 characters?
SELECT cpu FROM table_11703336_1 WHERE ram = "28 KB of ram" AND display_size = "128×64 pixels 21×8 characters"
CREATE TABLE table_35604 ( "Team" text, "Copa Libertadores 1996" text, "Supercopa Sudamericana 1996" text, "Copa CONMEBOL 1996" text, "Recopa Sudamericana 1996" text )
What is the recoupa sudaamericana 1996 result of team flamengo, which did not qualify for the copa conmebol 1996?
SELECT "Recopa Sudamericana 1996" FROM table_35604 WHERE "Copa CONMEBOL 1996" = 'did not qualify' AND "Team" = 'flamengo'
CREATE TABLE table_name_81 ( Id VARCHAR )
What is 2004, when 2010 is 'Grand Slam Tournaments'?
SELECT 2004 FROM table_name_81 WHERE 2010 = "grand slam tournaments"
CREATE TABLE table_49153 ( "Scorer" text, "Club" text, "League goals" text, "FA Cup goals" real, "League Cup goals" real, "Euro competitions" text, "Total" real )
what was the total for the Wolverhampton Wanderers?
SELECT "League goals" FROM table_49153 WHERE "Club" = 'wolverhampton wanderers'
CREATE TABLE table_67174 ( "Games" real, "Wins" real, "Draws" real, "Losses" real, "Goals For" real, "Goals Against" real, "Goal Differential" text )
for a Goals Against smaller than 9, and a Goal Differential of 0, and a Draws smaller than 2, and a Wins of 1, what's the goal total?
SELECT SUM("Goals For") FROM table_67174 WHERE "Goals Against" < '9' AND "Goal Differential" = '0' AND "Draws" < '2' AND "Wins" = '1'
CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, OwnerDisplayName text, LastEditorUserId number, LastEditorDispl...
All questions closed as off-topic. Questions that have been closed (not protected), along with their close reasons, ordered by their view count.
SELECT q.Id AS "post_link", q.CreationDate, q.ClosedDate FROM Posts AS q INNER JOIN PostHistory AS h ON q.Id = h.PostId WHERE h.PostHistoryTypeId = 10 AND NOT q.ClosedDate IS NULL ORDER BY q.ClosedDate DESC
CREATE TABLE Addresses ( address_id INTEGER, line_1_number_building VARCHAR(80), city VARCHAR(50), zip_postcode VARCHAR(20), state_province_county VARCHAR(50), country VARCHAR(50) ) CREATE TABLE Lessons ( lesson_id INTEGER, customer_id INTEGER, lesson_status_code VARCHAR(15), st...
List all customer status codes and the number of customers having each status code, could you rank bar in descending order?
SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY customer_status_code DESC
CREATE TABLE table_name_45 ( monday VARCHAR, sunday VARCHAR, series VARCHAR )
Who was the presenter on Monday of 'Big Brother 13' in which Alice Levine Jamie East presented on Sunday?
SELECT monday FROM table_name_45 WHERE sunday = "alice levine jamie east" AND series = "big brother 13"
CREATE TABLE table_54923 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Leading scorer" text, "Attendance" real, "Record" text )
How many people attended the game on 8 March 2008?
SELECT SUM("Attendance") FROM table_54923 WHERE "Date" = '8 march 2008'
CREATE TABLE table_name_90 ( home_team VARCHAR, away_team VARCHAR )
What is the home team score of the game with Adelaide as the away team?
SELECT home_team AS score FROM table_name_90 WHERE away_team = "adelaide"