answer stringlengths 6 3.91k | question stringlengths 7 766 | context stringlengths 27 7.14k |
|---|---|---|
SELECT * FROM college ORDER BY enr | List all information about college sorted by enrollment number in the ascending order. | CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
) |
SELECT termination FROM table_1601027_1 WHERE us_msrp = "$49" | Which terminations correspond to a US MSRP of $49? | CREATE TABLE table_1601027_1 (termination VARCHAR, us_msrp VARCHAR) |
SELECT first_name, last_name, salary FROM employees WHERE commission_pct = "null" | What are the full name (first and last name) and salary for all employees who does not have any value for commission? | CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR, commission_pct VARCHAR) |
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | tell me what was the top three most common diagnosis since 4 years ago? | 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 treatment (
... |
SELECT COUNT(headphone_class) FROM table_1601027_1 WHERE us_msrp = "$150" | How many headphone classes have a US MSRP of $150? | CREATE TABLE table_1601027_1 (headphone_class VARCHAR, us_msrp VARCHAR) |
SELECT first_name, last_name, salary FROM employees WHERE first_name LIKE '%m' | Display the first and last name, and salary for those employees whose first name is ending with the letter m. | CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary VARCHAR) |
SELECT ROW_NUMBER() OVER (ORDER BY Votes.Votes DESC) AS VoteRank, Votes.TagName AS Tag, Votes.Votes AS "Votes " FROM (SELECT Tags.TagName, COUNT(DISTINCT Votes.Id) AS Votes FROM Tags, PostTags, Posts, Votes WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostTags.PostId AND Votes.PostId = Posts.Id AND Votes.CreationDate ... | most popular new tags by votes. | CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
... |
SELECT COUNT(earpads) FROM table_1601027_1 WHERE headphone_class = "Prestige" AND us_msrp = "$79" | How many values for earpads correspond to the headphone class Prestige and a US MSRP of $79? | CREATE TABLE table_1601027_1 (earpads VARCHAR, headphone_class VARCHAR, us_msrp VARCHAR) |
SELECT job_id, hire_date FROM employees WHERE hire_date BETWEEN '2007-11-05' AND '2009-07-05' | Find job id and date of hire for those employees who was hired between November 5th, 2007 and July 5th, 2009. | CREATE TABLE employees (job_id VARCHAR, hire_date INTEGER) |
SELECT record FROM table_name_63 WHERE date = "12 march 2008" | What was the record on 12 march 2008? | CREATE TABLE table_name_63 (
record VARCHAR,
date VARCHAR
) |
SELECT headphone_model FROM table_1601027_1 WHERE driver_matched_db = "0.1" AND us_msrp = "$49" | Which headphone models have a driver-matched DB of 0.1 and a US MSRP of $49? | CREATE TABLE table_1601027_1 (headphone_model VARCHAR, driver_matched_db VARCHAR, us_msrp VARCHAR) |
SELECT first_name, last_name FROM employees WHERE department_id = 70 OR department_id = 90 | What are the first and last name for those employees who works either in department 70 or 90? | CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR) |
SELECT last_update FROM table_name_75 WHERE name = "joe surratt" | for the name of joe surratt what is the last update? | CREATE TABLE table_name_75 (
last_update VARCHAR,
name VARCHAR
) |
SELECT termination FROM table_1601027_1 WHERE headphone_model = "SR80i" | Which terminations correspond with headphone model SR80I? | CREATE TABLE table_1601027_1 (termination VARCHAR, headphone_model VARCHAR) |
SELECT salary, manager_id FROM employees WHERE manager_id <> "null" | Find the salary and manager number for those employees who is working under a manager. | CREATE TABLE employees (salary VARCHAR, manager_id VARCHAR) |
SELECT MAX(total) FROM table_name_57 WHERE bronze > 1 AND gold > 0 | Which Total has a Bronze larger than 1, and a Gold larger than 0? | CREATE TABLE table_name_57 (
total INTEGER,
bronze VARCHAR,
gold VARCHAR
) |
SELECT type FROM table_1602620_1 WHERE office = "State Assemblyman" | What type are State Assemblyman | CREATE TABLE table_1602620_1 (type VARCHAR, office VARCHAR) |
SELECT * FROM employees WHERE hire_date < '2002-06-21' | display all the details from Employees table for those employees who was hired before 2002-06-21. | CREATE TABLE employees (hire_date INTEGER) |
SELECT "Result" FROM table_70866 WHERE "Goal" = '9' | What is the Result where Goal is 9? | CREATE TABLE table_70866 (
"Goal" real,
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) |
SELECT type FROM table_1602620_1 WHERE term_began = "December 8, 1980" | What type had a beginning term of December 8, 1980 | CREATE TABLE table_1602620_1 (type VARCHAR, term_began VARCHAR) |
SELECT * FROM employees WHERE first_name LIKE '%D%' OR first_name LIKE '%S%' ORDER BY salary DESC | display all the information for all employees who have the letters D or S in their first name and also arrange the result in descending order by salary. | CREATE TABLE employees (salary VARCHAR, first_name VARCHAR) |
SELECT "Opponent" FROM table_44146 WHERE "Tournament" = 'milan, italy' | Who were the opponents for the event in Milan, Italy? | CREATE TABLE table_44146 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponent" text,
"Score" text
) |
SELECT type FROM table_1602620_1 WHERE elected = 1980 | What type had an election day in 1980 | CREATE TABLE table_1602620_1 (type VARCHAR, elected VARCHAR) |
SELECT * FROM employees WHERE hire_date > '1987-09-07' | display those employees who joined after 7th September, 1987. | CREATE TABLE employees (hire_date INTEGER) |
SELECT "Opponent" FROM table_36169 WHERE "Result" = 'w 14–6' | Who was the opponent at the game with a result of w 14 6? | CREATE TABLE table_36169 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text
) |
SELECT term_ended FROM table_1602620_1 WHERE elected = 1990 | What year did the term end for those elected in 1990 | CREATE TABLE table_1602620_1 (term_ended VARCHAR, elected VARCHAR) |
SELECT job_title FROM jobs WHERE min_salary > 9000 | display the job title of jobs which minimum salary is greater than 9000. | CREATE TABLE jobs (job_title VARCHAR, min_salary INTEGER) |
SELECT "Venue" FROM table_57473 WHERE "Home team" = 'north melbourne' | What is the venue of North Melbourne? | CREATE TABLE table_57473 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) |
SELECT location FROM table_1602620_1 WHERE term_ended = "December 2, 1976" | What is the location for the office whose term ended December 2, 1976 | CREATE TABLE table_1602620_1 (location VARCHAR, term_ended VARCHAR) |
SELECT job_title, max_salary - min_salary FROM jobs WHERE max_salary BETWEEN 12000 AND 18000 | display job Title, the difference between minimum and maximum salaries for those jobs which max salary within the range 12000 to 18000. | CREATE TABLE jobs (job_title VARCHAR, max_salary INTEGER, min_salary VARCHAR) |
SELECT TagName, PostId AS "post_link", p.Tags, p.CreationDate FROM Tags AS t LEFT JOIN Posts AS pe ON pe.Id = t.ExcerptPostId LEFT JOIN Posts AS pw ON pw.Id = t.WikiPostId LEFT JOIN PostTags AS pt ON TagId = t.Id LEFT JOIN Posts AS p ON p.Id = PostId WHERE Count = 1 AND (WikiPostId IS NULL OR (LENGTH(pe.Body) < 1 AND L... | Questions with a single-use tag that has no tag wiki. These single-use tags are candidates for being deleted by the cleanup script, unless a wiki excerpt is written. Some of these questions might become untagged if the single-use tag deletion script is turned back on. | CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
... |
SELECT term_ended FROM table_1602620_1 WHERE elected = 1984 | What year did the term end for the office elected in 1984 | CREATE TABLE table_1602620_1 (term_ended VARCHAR, elected VARCHAR) |
SELECT email FROM employees WHERE commission_pct = "null" AND salary BETWEEN 7000 AND 12000 AND department_id = 50 | display the emails of the employees who have no commission percentage and salary within the range 7000 to 12000 and works in that department which number is 50. | CREATE TABLE employees (email VARCHAR, department_id VARCHAR, commission_pct VARCHAR, salary VARCHAR) |
SELECT "Nation" FROM table_77021 WHERE "Rank" > '2' AND "Total" > '1' AND "Bronze" < '3' | What is Nation, when Rank is greater than 2, when Total is greater than 1, and when Bronze is less than 3? | CREATE TABLE table_77021 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) |
SELECT record FROM table_16028499_2 WHERE date = "October 8, 1989" | What was the record on October 8, 1989? | CREATE TABLE table_16028499_2 (record VARCHAR, date VARCHAR) |
SELECT employee_id, MAX(end_date) FROM job_history GROUP BY employee_id | display the employee ID for each employee and the date on which he ended his previous job. | CREATE TABLE job_history (employee_id VARCHAR, end_date INTEGER) |
SELECT MAX(demographic.age) FROM demographic WHERE demographic.language = "ENGL" AND demographic.diagnosis = "SEPSIS" | calculate the maximum age of english speaking patients who have sepsis primary disease. | 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... |
SELECT game_site FROM table_16028499_2 WHERE date = "October 29, 1989" | Where was the game site on October 29, 1989? | CREATE TABLE table_16028499_2 (game_site VARCHAR, date VARCHAR) |
SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(commission_pct) > 10 | display those departments where more than ten employees work who got a commission percentage. | CREATE TABLE employees (department_id VARCHAR, commission_pct VARCHAR) |
SELECT MIN(series__number) FROM table_12564633_1 WHERE written_by = "Jack Orman" | What was the first series in this list that Jack Orman wrote? | CREATE TABLE table_12564633_1 (
series__number INTEGER,
written_by VARCHAR
) |
SELECT MIN(attendance) FROM table_16028499_2 WHERE opponent = "New Orleans Saints" | What was the minimum attendance against the New Orleans Saints? | CREATE TABLE table_16028499_2 (attendance INTEGER, opponent VARCHAR) |
SELECT DISTINCT department_id FROM employees GROUP BY department_id, manager_id HAVING COUNT(employee_id) >= 4 | Find the ids of the departments where any manager is managing 4 or more employees. | CREATE TABLE employees (department_id VARCHAR, manager_id VARCHAR, employee_id VARCHAR) |
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Propofol" | give me the number of patients whose drug name is propofol? | 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... |
SELECT result FROM table_16028499_2 WHERE week = 2 | What was the result of week 2? | CREATE TABLE table_16028499_2 (result VARCHAR, week VARCHAR) |
SELECT department_id, AVG(salary) FROM employees WHERE commission_pct <> "null" GROUP BY department_id | display the average salary of employees for each department who gets a commission percentage. | CREATE TABLE employees (department_id VARCHAR, salary INTEGER, commission_pct VARCHAR) |
SELECT "Races" FROM table_34089 WHERE "Points" > '123' AND "Driver" = 'fernando alonso' AND "Percentage of possible points" = '74.44%' | Which races have points greater than 123, fernando alonso as the driver and a percentage of possible points of 74.44%? | CREATE TABLE table_34089 (
"Driver" text,
"Points" real,
"Season" real,
"Races" real,
"Percentage of possible points" text
) |
SELECT date FROM table_16028499_2 WHERE opponent = "New York Jets" | What date did the team play the New York Jets? | CREATE TABLE table_16028499_2 (date VARCHAR, opponent VARCHAR) |
SELECT country_id, COUNT(*) FROM locations GROUP BY country_id | display the country ID and number of cities for each country. | CREATE TABLE locations (country_id VARCHAR) |
SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-13409')) AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(... | has patient 009-13409 received a procedure until 4 years ago. | CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... |
SELECT MIN(attendance) FROM table_16025095_1 WHERE date = "January 24, 1987" | What was the minimum crowd on January 24, 1987? | CREATE TABLE table_16025095_1 (attendance INTEGER, date VARCHAR) |
SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2 | display job ID for those jobs that were done by two or more for more than 300 days. | CREATE TABLE job_history (job_id VARCHAR, end_date VARCHAR, start_date VARCHAR) |
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-91239') AND patient.unitdischargetime IS NULL) ... | when was the first time that patient 015-91239 had the maximum value of respiration on the current icu visit? | CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE diagnosis (
diagn... |
SELECT viewers__in_millions_ FROM table_1601935_1 WHERE run_time = "18:00" | How many millions of viewers were there for the episode with a run time of 18:00? | CREATE TABLE table_1601935_1 (viewers__in_millions_ VARCHAR, run_time VARCHAR) |
SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) >= 2 | display the ID for those employees who did two or more jobs in the past. | CREATE TABLE job_history (employee_id VARCHAR) |
SELECT home_team FROM table_name_60 WHERE tie_no = "7" | Who was the home team when the Tie no was 7? | CREATE TABLE table_name_60 (
home_team VARCHAR,
tie_no VARCHAR
) |
SELECT archive FROM table_1601935_1 WHERE viewers__in_millions_ = "6.6" | What was the archive for episode with 6.6 million viewers? | CREATE TABLE table_1601935_1 (archive VARCHAR, viewers__in_millions_ VARCHAR) |
SELECT T1.employee_id, T4.country_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id JOIN locations AS T3 ON T2.location_id = T3.location_id JOIN countries AS T4 ON T3.country_id = T4.country_id | Find employee with ID and name of the country presently where (s)he is working. | CREATE TABLE countries (country_name VARCHAR, country_id VARCHAR); CREATE TABLE departments (department_id VARCHAR, location_id VARCHAR); CREATE TABLE locations (location_id VARCHAR, country_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, department_id VARCHAR) |
SELECT "Original artist" FROM table_24426 WHERE "Result" = 'Selected' | Who was the originally artist when Jasmine Murray was selected? | CREATE TABLE table_24426 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) |
SELECT MIN(game) FROM table_16028459_2 WHERE bills_first_downs = 21 | When is the latest game the bills had 21 first downs | CREATE TABLE table_16028459_2 (game INTEGER, bills_first_downs VARCHAR) |
SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name | display the department name and number of employees in each of the department. | CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR) |
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of department_id bin hire_date by time. | 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... |
SELECT MIN(bills_first_downs) FROM table_16028459_2 WHERE opponents = 6 | How many first downs did the bills have when their opponent had 6 | CREATE TABLE table_16028459_2 (bills_first_downs INTEGER, opponents VARCHAR) |
SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000 | Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000? | CREATE TABLE job_history (employee_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR) |
SELECT opponent FROM table_name_24 WHERE loss = "tomko (1-1)" | What opponent has tomko (1-1) as a loss? | CREATE TABLE table_name_24 (
opponent VARCHAR,
loss VARCHAR
) |
SELECT bills_points FROM table_16028459_2 WHERE opponents = 14 | How many points did the bills score when their opponent had 14 | CREATE TABLE table_16028459_2 (bills_points VARCHAR, opponents VARCHAR) |
SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title | display job title and average salary of employees. | CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (job_id VARCHAR) |
SELECT "132.1%" FROM table_19826 WHERE "North Carolina" = 'Colorado' | Name the 132.1% for where north carolina is colorado | CREATE TABLE table_19826 (
"North Carolina" text,
"273.7%" text,
"South Carolina" text,
"132.1%" text,
"Mississippi" text,
"95.8%" text,
"Wisconsin" text,
"59.4%" text,
"Vermont" text,
"32.5%" text
) |
SELECT MIN(opponents) FROM table_16028459_2 WHERE opponent = "Baltimore Colts" | What is the minimum number of points given up to the Baltimore Colts | CREATE TABLE table_16028459_2 (opponents INTEGER, opponent VARCHAR) |
SELECT first_name, last_name FROM employees WHERE salary > (SELECT salary FROM employees WHERE employee_id = 163) | What is the full name ( first name and last name ) for those employees who gets more salary than the employee whose id is 163? | CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, salary INTEGER, employee_id VARCHAR) |
SELECT MIN(episode) FROM table_name_48 WHERE performer_4 = "john bird" | What is the lowest episode number where john bird was the 4th performer? | CREATE TABLE table_name_48 (
episode INTEGER,
performer_4 VARCHAR
) |
SELECT runner_s__up FROM table_1602858_1 WHERE tournament = "Memorial tournament" | Who was the runner-up in the Memorial Tournament? | CREATE TABLE table_1602858_1 (runner_s__up VARCHAR, tournament VARCHAR) |
SELECT MIN(salary), department_id FROM employees GROUP BY department_id | return the smallest salary for every departments. | CREATE TABLE employees (department_id VARCHAR, salary INTEGER) |
SELECT CreationDate, Id AS "post_link" FROM Posts WHERE OwnerUserId IS NULL AND ClosedDate IS NULL AND PostTypeId = 1 AND COALESCE(AnswerCount, 0) = 0 ORDER BY CreationDate | Unanswered questions by deleted users. | CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count ... |
SELECT winning_score FROM table_1602858_1 WHERE runner_s__up = "Rory Sabbatini" | What was the winning score for the tournament with runner-up Rory Sabbatini? | CREATE TABLE table_1602858_1 (winning_score VARCHAR, runner_s__up VARCHAR) |
SELECT first_name, last_name, department_id FROM employees WHERE salary IN (SELECT MIN(salary) FROM employees GROUP BY department_id) | Find the first name and last name and department id for those employees who earn such amount of salary which is the smallest salary of any of the departments. | CREATE TABLE employees (first_name VARCHAR, last_name VARCHAR, department_id VARCHAR, salary INTEGER) |
SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'total protein' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '030-52327' AND pat... | what are the percentile of 6.7 in a total protein lab test given the same age of patient 030-52327 during their current hospital encounter? | 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 cost (
c... |
SELECT margin_of_victory FROM table_1602858_1 WHERE winning_score = 63 - 68 - 68 - 68 = 267 | What was the margin of victory with the winning score "63-68-68-68=267"? | CREATE TABLE table_1602858_1 (margin_of_victory VARCHAR, winning_score VARCHAR) |
SELECT employee_id FROM employees WHERE salary > (SELECT AVG(salary) FROM employees) | Find the employee id for all employees who earn more than the average salary. | CREATE TABLE employees (employee_id VARCHAR, salary INTEGER) |
SELECT "Parameter" FROM table_20882 WHERE "1st stage" = '2.67 m' | Name the parameter for 2.67 m | CREATE TABLE table_20882 (
"Parameter" text,
"1st stage" text,
"2nd stage" text,
"3rd stage" text,
"4th stage" text
) |
SELECT MIN(position) FROM table_16034882_5 | Name the least position | CREATE TABLE table_16034882_5 (position INTEGER) |
SELECT employee_id, salary FROM employees WHERE manager_id = (SELECT employee_id FROM employees WHERE first_name = 'Payam') | display the employee id and salary of all employees who report to Payam (first name). | CREATE TABLE employees (employee_id VARCHAR, salary VARCHAR, manager_id VARCHAR, first_name VARCHAR) |
SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and manager_id in a bar chart, and list by the X from low to high. | CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... |
SELECT MAX(goals_scored) FROM table_16034882_5 WHERE position = 4 | Name the most goals scored for position 4 | CREATE TABLE table_16034882_5 (goals_scored INTEGER, position VARCHAR) |
SELECT DISTINCT T2.department_name FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id | find the name of all departments that do actually have one or more employees assigned to them. | CREATE TABLE departments (department_name VARCHAR, department_id VARCHAR); CREATE TABLE employees (department_id VARCHAR) |
SELECT cname, state, MIN(enr) FROM college GROUP BY state | What is the name of school that has the smallest enrollment in each state? | CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
) |
SELECT bowl_game FROM table_16046689_29 WHERE city = "Tempe, Arizona" | What is the name of the bowl game that was played in Tempe, Arizona? | CREATE TABLE table_16046689_29 (bowl_game VARCHAR, city VARCHAR) |
SELECT DISTINCT * FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T1.employee_id = T2.manager_id | get the details of employees who manage a department. | CREATE TABLE departments (department_id VARCHAR, manager_id VARCHAR); CREATE TABLE employees (department_id VARCHAR, employee_id VARCHAR) |
SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age >= 60) AND STRFTIME('%y', labevents.charttime) >=... | what were the five most frequent lab tests ordered since 2104 for patients in the age of 60 or above? | CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code te... |
SELECT city FROM table_16046689_29 WHERE stadium = "Citrus Bowl" AND television = "ABC" | What city in the Citrus Bowl aired on ABC? | CREATE TABLE table_16046689_29 (city VARCHAR, stadium VARCHAR, television VARCHAR) |
SELECT job_id FROM employees GROUP BY job_id HAVING AVG(salary) > 8000 | Find the job ID for those jobs which average salary is above 8000. | CREATE TABLE employees (job_id VARCHAR, salary INTEGER) |
SELECT school_club_team FROM table_name_97 WHERE round < 5 AND pick > 1 AND player = "reggie mckenzie" | Which School/Club Team has a Round smaller than 5, a Pick larger than 1, and a Player of reggie mckenzie? | CREATE TABLE table_name_97 (
school_club_team VARCHAR,
player VARCHAR,
round VARCHAR,
pick VARCHAR
) |
SELECT conference_matchups FROM table_16046689_29 WHERE date = "January 1, 2009" AND bowl_game = "Capital One" | What teams played in the Capital One bowl game on January 1, 2009? | CREATE TABLE table_16046689_29 (conference_matchups VARCHAR, date VARCHAR, bowl_game VARCHAR) |
SELECT T1.employee_id, T2.job_title FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id WHERE T1.department_id = 80 | display the employee ID and job name for all those jobs in department 80. | CREATE TABLE jobs (job_title VARCHAR, job_id VARCHAR); CREATE TABLE employees (employee_id VARCHAR, job_id VARCHAR, department_id VARCHAR) |
SELECT original_title FROM table_18987377_1 WHERE film_title_used_in_nomination = "The Last Metro" | Name the original title for the last metro | CREATE TABLE table_18987377_1 (
original_title VARCHAR,
film_title_used_in_nomination VARCHAR
) |
SELECT stadium FROM table_16046689_29 WHERE payout___us$__ = "$3 Million" | Which stadium has a payout of $3 million? | CREATE TABLE table_16046689_29 (stadium VARCHAR, payout___us$__ VARCHAR) |
SELECT T1.first_name, T1.job_id FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id WHERE T2.department_name = 'Finance' | What is the first name and job id for all employees in the Finance department? | CREATE TABLE departments (department_id VARCHAR, department_name VARCHAR); CREATE TABLE employees (first_name VARCHAR, job_id VARCHAR, department_id VARCHAR) |
SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100 | Create a bar chart showing meter_100 across meter 600, and could you order from low to high by the Y-axis? | CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... |
SELECT MAX(number_of_people) FROM table_16048129_5 WHERE average_family_size = "2.8" | What is the largest population in regions where the average family size is 2.8 people? | CREATE TABLE table_16048129_5 (number_of_people INTEGER, average_family_size VARCHAR) |
SELECT * FROM employees WHERE salary BETWEEN (SELECT MIN(salary) FROM employees) AND 2500 | display all the information of the employees whose salary if within the range of smallest salary and 2500. | CREATE TABLE employees (salary INTEGER) |
SELECT DISTINCT T1.Fname FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.VICE_PRESIDENT_Vote EXCEPT SELECT DISTINCT Fname FROM STUDENT WHERE city_code = "PIT" | Find the distinct first names of all the students who have vice president votes and whose city code is not PIT. | CREATE TABLE STUDENT (
Fname VARCHAR,
city_code VARCHAR
)
CREATE TABLE VOTING_RECORD (
VICE_PRESIDENT_Vote VARCHAR
) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.