table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_59 (
long INTEGER,
loss VARCHAR,
gain VARCHAR
) | When the player gained below 1,405 yards and lost over 390 yards, what's the sum of the long yards? | SELECT SUM(long) FROM table_name_59 WHERE loss > 390 AND gain < 1 OFFSET 405 |
CREATE TABLE table_61505 (
"Year" real,
"Binibining Pilipinas-Universe" text,
"Binibining Pilipinas-World" text,
"Binibining Pilipinas International" text,
"Miss Maja Pilipinas" text,
"First runner-up" text,
"Second runner-up" text
) | Which Year has a Binibining Pilipinas International of alma concepcion? | SELECT "Year" FROM table_61505 WHERE "Binibining Pilipinas International" = 'alma concepcion' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the average age of patients who are admitted under emergency and diagnosed with primary disease communicating aneurysm/sda? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.diagnosis = "POSTERIOR COMMUNICATING ANEURYSM/SDA" |
CREATE TABLE table_name_19 (
venue VARCHAR,
result VARCHAR
) | In what venues was the match with a final result of Eng by 4 wkts? | SELECT venue FROM table_name_19 WHERE result = "eng by 4 wkts" |
CREATE TABLE table_58848 (
"Year" real,
"Manufacturer" text,
"Start" real,
"Finish" real,
"Team" text
) | WHAT MANUFACTURER AFTER 1966 HAD A START SMALLER THAN 5, A WOOD TEAM AND FINISHED 35? | SELECT "Manufacturer" FROM table_58848 WHERE "Year" > '1966' AND "Start" < '5' AND "Team" = 'wood' AND "Finish" = '35' |
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 employees (
EMPLOYEE_ID decimal(6,0),... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the sum of manager_id bin hire_date by time, sort Y-axis from high to low order. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID) DESC |
CREATE TABLE table_48456 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Location Attendance" text,
"Record" text
) | What is the location and attendance of the game when the score is 125-100? | SELECT "Location Attendance" FROM table_48456 WHERE "Score" = '125-100' |
CREATE TABLE table_name_31 (
tries_for VARCHAR,
tries_against VARCHAR
) | tries against correct as of 2007-10-15 has what tries for? | SELECT tries_for FROM table_name_31 WHERE tries_against = "correct as of 2007-10-15" |
CREATE TABLE employees (
employee_id VARCHAR,
first_name VARCHAR,
last_name VARCHAR,
job_id VARCHAR,
salary INTEGER
) | display the employee number, name( first name and last name ) and job title for all employees whose salary is more than any salary of those employees whose job title is PU_MAN. | SELECT employee_id, first_name, last_name, job_id FROM employees WHERE salary > (SELECT MAX(salary) FROM employees WHERE job_id = 'PU_MAN') |
CREATE TABLE table_2160008_4 (
reason_for_change VARCHAR,
date_successor_seated VARCHAR
) | Name the number of reason for change on may 11, 1939 | SELECT COUNT(reason_for_change) FROM table_2160008_4 WHERE date_successor_seated = "May 11, 1939" |
CREATE TABLE table_2861364_1 (
place_of_execution VARCHAR,
executed_person VARCHAR
) | where was mazouz ghaouti executed? | SELECT place_of_execution FROM table_2861364_1 WHERE executed_person = "Mazouz Ghaouti" |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | until 2104, how many patients were prescribed with 1000 ml flex cont : sodium chloride 0.9 % iv soln within the same hospital visit after the diagnosis with pancreatitis - acute? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pancreatitis - acute' AND STRFTIME('%y', diagnosis.diagnosistime) <= '210... |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what are the four most commonly prescribed drugs for patients who were also prescribed vincristine sulfate at the same time during this year? | 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 = 'vincristine sulfate' AND DATETIME(prescriptions.startdate, 'start... |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is the number of patients whose ethnicity is black/haitian and primary disease is aortic insufficiency\re-do sternotomy; aortic valve replacement ? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT " |
CREATE TABLE table_13741576_6 (
club VARCHAR,
points_for VARCHAR
) | What club has 536 points for? | SELECT club FROM table_13741576_6 WHERE points_for = "536" |
CREATE TABLE table_16418 (
"Condition" text,
"Prothrombin time" text,
"Partial thromboplastin time" text,
"Bleeding time" text,
"Platelet count" text
) | What was the bleeding time for the factor x deficiency as seen in amyloid purpura | SELECT "Bleeding time" FROM table_16418 WHERE "Condition" = 'Factor X deficiency as seen in amyloid purpura' |
CREATE TABLE table_6309 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | what team scored 65-87 | SELECT "Date" FROM table_6309 WHERE "Record" = '65-87' |
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
)
... | Find the average age of patients that survived and had a pimary disease of ventricular tachycardia. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "VENTRICULAR TACHYCARDIA" |
CREATE TABLE table_26893 (
"Team" text,
"Truck(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
) | Name the team for susan bates | SELECT "Team" FROM table_26893 WHERE "Listed Owner(s)" = 'Susan Bates' |
CREATE TABLE lessons (
lesson_id number,
customer_id number,
lesson_status_code text,
staff_id number,
vehicle_id number,
lesson_date time,
lesson_time text,
price number
)
CREATE TABLE customer_payments (
customer_id number,
datetime_payment time,
payment_method_code text,
... | List all payment methods and number of payments using each payment methods. | SELECT payment_method_code, COUNT(*) FROM customer_payments GROUP BY payment_method_code |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,... | what was the three most frequently performed lab tests in 2105? | 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 STRFTIME('%y', labevents.charttime) = '2105' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 3) |
CREATE TABLE table_name_28 (
school VARCHAR,
mascot VARCHAR
) | Which School's Mascot is Raiders? | SELECT school FROM table_name_28 WHERE mascot = "raiders" |
CREATE TABLE table_51195 (
"Year" real,
"Theme" text,
"Artist" text,
"Composition" text,
"Mintage" real,
"Issue Price" text
) | What's the mintage when the theme was year of the rabbit? | SELECT "Mintage" FROM table_51195 WHERE "Theme" = 'year of the rabbit' |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalpe... | among patients that were prescribed with 2 ml vial: midazolam hcl 2 mg/2ml ij soln, what are the five most frequently prescribed drugs at the same time, since 2103. | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = '2 ml vial: midazolam hcl 2 mg/2ml ij soln' AND STRF... |
CREATE TABLE table_name_9 (
name VARCHAR,
caps VARCHAR
) | Who has a 59 cap? | SELECT name FROM table_name_9 WHERE caps = 59 |
CREATE TABLE table_59082 (
"Season" text,
"GP/MP" text,
"Kills" real,
"K/Game" real,
"Errors" real,
"Total Attempts" real,
"Percentage" real,
"Assists" real,
"Service Aces" real,
"Digs" real,
"Solo Blocks" real,
"Block Assists" real,
"Total Blocks" real,
"Points" ... | What is the highest percentage when there are more than 361 blocks? | SELECT MAX("Percentage") FROM table_59082 WHERE "Total Blocks" > '361' |
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
S... | Find the average age of students living in each dorm and the name of dorm. Plot them as bar chart. | SELECT dorm_name, AVG(T1.Age) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid GROUP BY T3.dorm_name |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | tell me the price of verapamil sr. | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'verapamil sr') |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and commission_pct , display by the y axis in asc. | SELECT FIRST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT |
CREATE TABLE table_23285761_11 (
high_assists VARCHAR,
date VARCHAR
) | Who has the high assists when April 26 is the date? | SELECT high_assists FROM table_23285761_11 WHERE date = "April 26" |
CREATE TABLE table_68212 (
"Year" real,
"Manufacturer" text,
"Start" real,
"Finish" real,
"Team" text
) | Name the total number of start when finish is less than 4 | SELECT COUNT("Start") FROM table_68212 WHERE "Finish" < '4' |
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)
CREATE TABLE Grants (
grant_id INTEGER,
organisation_id INTEGER,
grant_amount DECIMAL(19,4),
grant_start_date DATETIME,
grant_end_date DATETIME,
other_details VARCHAR(255)
)
CR... | What are the ids and details for all organizations that have grants of more than 6000 dollars, rank X from low to high order. | SELECT T2.organisation_details, T1.organisation_id FROM Grants AS T1 JOIN Organisations AS T2 ON T1.organisation_id = T2.organisation_id GROUP BY T2.organisation_details ORDER BY T2.organisation_details |
CREATE TABLE table_68602 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which opponent has a record of 17-11? | SELECT "Opponent" FROM table_68602 WHERE "Record" = '17-11' |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 locations (
LOCATION_ID decimal(4,0... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of hire_date and the average of manager_id bin hire_date by weekday, and show by the y axis in ascending. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) |
CREATE TABLE table_name_44 (
address VARCHAR,
mascot VARCHAR
) | What is the address for the school that has the coyotes mascot? | SELECT address FROM table_name_44 WHERE mascot = "coyotes" |
CREATE TABLE table_name_12 (
Block INTEGER,
assists VARCHAR,
total_blocks VARCHAR
) | When assists is more than 32 and total blocks is more than 88, what is the total of block assists? | SELECT SUM(Block) AS assists FROM table_name_12 WHERE assists > 32 AND total_blocks > 88 |
CREATE TABLE table_3342 (
"Settlement" text,
"Cyrillic Name" text,
"Type" text,
"Population (2011)" real,
"Largest ethnic group (2002)" text,
"Dominant religion (2002)" text
) | What is the largest ethnic group (2002) when cyrillic name is ? | SELECT "Largest ethnic group (2002)" FROM table_3342 WHERE "Cyrillic Name" = 'Брестач' |
CREATE TABLE table_18143210_2 (
number_of_seasons_in_liga_mx VARCHAR,
first_season_of_current_spell_in_top_division VARCHAR
) | How many 'number of season in Liga MX' were played if the 'first season of current spell in top division' is in 1962-63? | SELECT number_of_seasons_in_liga_mx FROM table_18143210_2 WHERE first_season_of_current_spell_in_top_division = "1962-63" |
CREATE TABLE postseason (
team_id_winner VARCHAR,
year VARCHAR
)
CREATE TABLE team (
name VARCHAR,
team_id_br VARCHAR
) | What are the name and id of the team with the most victories in 2008 postseason? | SELECT T2.name, T1.team_id_winner FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T1.year = 2008 GROUP BY T1.team_id_winner ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
... | What is the first name of the faculty members who participated in at least one activity? For each of them, also show the number of activities they participated in with a bar chart, list in ascending by the X. | SELECT Fname, COUNT(*) FROM Faculty AS T1 JOIN Faculty_Participates_in AS T2 ON T1.FacID = T2.FacID GROUP BY T1.FacID ORDER BY Fname |
CREATE TABLE table_name_36 (
date VARCHAR,
crowd INTEGER
) | When was the attendance at a venue bigger than 35,151? | SELECT date FROM table_name_36 WHERE crowd > 35 OFFSET 151 |
CREATE TABLE match_result (
Rank int,
Club_ID int,
Gold int,
Big_Silver int,
Small_Silver int,
Bronze int,
Points int
)
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text,
Club_ID int,
Rank int
)
CREATE TABLE club (
Club_ID int,
Club_name text,
... | Draw a bar chart of gender versus the number of gender, order in descending by the names. | SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY Gender DESC |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
... | when was patient 83182 being prescribed with a medication for the last time in this hospital visit? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate DESC LIMIT 1 |
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... | provide the number of patients diagnosed with mv collision nos-driver. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Mv collision NOS-driver" |
CREATE TABLE table_14560 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Which opponent has a Date of april 14? | SELECT "Opponent" FROM table_14560 WHERE "Date" = 'april 14' |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | Visualize a bar chart about the distribution of meter_600 and ID , and order by the bars in asc. | SELECT meter_600, ID FROM swimmer ORDER BY meter_600 |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | indicate the monthly minimum amount of arterial bp [systolic] for patient 25814 since 61 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 = 25814)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... |
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,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Lives_in (
stuid INTEGER,
... | Find the number of students living in each city with a bar chart, and display by the Y-axis from high to low please. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC |
CREATE TABLE Ref_Transaction_Types (
transaction_type_description VARCHAR,
transaction_type_code VARCHAR
)
CREATE TABLE TRANSACTIONS (
date_of_transaction VARCHAR,
transaction_type_code VARCHAR,
share_count INTEGER
) | Show the transaction type descriptions and dates if the share count is smaller than 10. | SELECT T1.transaction_type_description, T2.date_of_transaction FROM Ref_Transaction_Types AS T1 JOIN TRANSACTIONS AS T2 ON T1.transaction_type_code = T2.transaction_type_code WHERE T2.share_count < 10 |
CREATE TABLE table_22824 (
"Team #1" text,
"Agg. score" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | What's the 2nd leg result in the round where Panionios is team #2? | SELECT "2nd leg" FROM table_22824 WHERE "Team #2" = 'Panionios' |
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
)
... | what is drug type and drug route of drug code soln2? | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "SOLN2" |
CREATE TABLE table_63664 (
"Restaurant Name" text,
"Original Name" text,
"Location" text,
"Chef" text,
"Designer" text,
"Still Open?" text
) | what is the location when the designer is glen peloso and the restaurant is joe boo's cookoos? | SELECT "Location" FROM table_63664 WHERE "Designer" = 'glen peloso' AND "Restaurant Name" = 'joe boo''s cookoos' |
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | Find the number of rooms for each bed type Visualize by bar chart, and I want to show in descending by the y axis. | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY COUNT(*) DESC |
CREATE TABLE table_70593 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which entrant scored less than 8 points and used a Maserati chassis? | SELECT "Entrant" FROM table_70593 WHERE "Points" < '8' AND "Chassis" = 'maserati' |
CREATE TABLE table_name_54 (
zone INTEGER,
stations VARCHAR,
platforms VARCHAR
) | Name the average zone for waddon railway station and has more than 2 platforms | SELECT AVG(zone) FROM table_name_54 WHERE stations = "waddon railway station" AND platforms > 2 |
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 average age of patients whose insurance is government and days of hospital stay is 1? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Government" AND demographic.days_stay = "1" |
CREATE TABLE table_name_22 (
location VARCHAR,
time VARCHAR
) | What is the Location when the time was 11:55? | SELECT location FROM table_name_22 WHERE time = "11:55" |
CREATE TABLE table_25353861_5 (
rebounds VARCHAR,
player VARCHAR
) | How many rebounds did Tammy Sutton-Brown have? | SELECT rebounds FROM table_25353861_5 WHERE player = "Tammy Sutton-Brown" |
CREATE TABLE department (
name VARCHAR,
num_employees VARCHAR,
department_id VARCHAR
)
CREATE TABLE management (
department_id VARCHAR,
temporary_acting VARCHAR
) | Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes'? | SELECT T1.name, T1.num_employees FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id WHERE T2.temporary_acting = 'Yes' |
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
)
... | What is the admission location and diagnosis short title of Dominga Garvin? | SELECT demographic.admission_location, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Dominga Garvin" |
CREATE TABLE vocals (
songid VARCHAR
)
CREATE TABLE songs (
title VARCHAR,
songid VARCHAR
) | Find all the songs that do not have a lead vocal. | SELECT DISTINCT title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid EXCEPT SELECT t2.title FROM vocals AS t1 JOIN songs AS t2 ON t1.songid = t2.songid WHERE TYPE = "lead" |
CREATE TABLE table_62376 (
"1999/ 00" text,
"2000/ 01" text,
"2001/ 02" text,
"2002/ 03" text,
"2003/ 04" text,
"2004/ 05" text,
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
... | Which 2010/ 11 has a 2011/ 12 of former non-ranking tournaments? | SELECT "2010/ 11" FROM table_62376 WHERE "2011/ 12" = 'former non-ranking tournaments' |
CREATE TABLE table_36358 (
"Virtue" text,
"Latin" text,
"Gloss" text,
"(Vice)" text,
"(Latin)" text
) | Which virtue is acedia(Latin)? | SELECT "Virtue" FROM table_36358 WHERE "(Latin)" = 'acedia' |
CREATE TABLE table_name_20 (
home_team VARCHAR,
venue VARCHAR
) | What was the home team's score at Corio Oval? | SELECT home_team AS score FROM table_name_20 WHERE venue = "corio oval" |
CREATE TABLE table_5157 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
) | Which Grid has a Driver of cristiano da matta, and Points smaller than 33? | SELECT SUM("Grid") FROM table_5157 WHERE "Driver" = 'cristiano da matta' AND "Points" < '33' |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | How many married patients have left internal jugular vein thrombosis left arm edema as their primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDa... | Emacs users in Frederick, MD. | SELECT * FROM Users WHERE Location LIKE '%Frederick, MD%' ORDER BY Reputation DESC |
CREATE TABLE table_71853 (
"Matches" real,
"Innings" real,
"Not Out" real,
"High Score" text,
"Runs" real,
"Average" real
) | What is the match total for a score over 299 and under 412 innings? | SELECT SUM("Matches") FROM table_71853 WHERE "High Score" = '299' AND "Innings" < '412' |
CREATE TABLE table_203_323 (
id number,
"city" text,
"country" text,
"airport" text,
"begin" number,
"end" number
) | which two destinations were available for less than one year ? | SELECT "city" FROM table_203_323 WHERE "end" - "begin" < 1 |
CREATE TABLE table_71438 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | What is the 1st party with Charles Isaac Elton as the 2nd member? | SELECT "1st Party" FROM table_71438 WHERE "2nd Member" = 'charles isaac elton' |
CREATE TABLE table_11121 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | What year is the event in athens, greece? | SELECT MAX("Year") FROM table_11121 WHERE "Venue" = 'athens, greece' |
CREATE TABLE table_70957 (
"Parties and voter communities" text,
"% 2006" real,
"seats 2006" real,
"% 2001" real,
"seats 2001" real
) | When seats for 2001 is greater than 15 and % 2001 is greater than 100, what is the % 2006? | SELECT AVG("% 2006") FROM table_70957 WHERE "seats 2001" > '15' AND "% 2001" > '100' |
CREATE TABLE table_name_61 (
round VARCHAR,
tournament VARCHAR
) | What is Round, when Tournament is 'Paris'? | SELECT round FROM table_name_61 WHERE tournament = "paris" |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
... | Who Answers My Questions? (Tutorial). | SELECT a.Id AS "post_link", a.Score, au.Id AS "user_link" FROM Posts AS p JOIN Posts AS a ON p.Id = a.ParentId JOIN Users AS au ON a.OwnerUserId = au.Id WHERE p.PostTypeId = 1 AND p.OwnerUserId = '##UserId##' ORDER BY a.Score DESC |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the sum of employee_id , and group by attribute job_id, and order total number from low to high order please. | SELECT JOB_ID, SUM(EMPLOYEE_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(EMPLOYEE_ID) |
CREATE TABLE table_11545282_10 (
no VARCHAR,
school_club_team VARCHAR
) | What number does the player from Ohio play with? | SELECT no FROM table_11545282_10 WHERE school_club_team = "Ohio" |
CREATE TABLE table_13951 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | what is the date for the tournament jou -l s-tours? | SELECT "Date" FROM table_13951 WHERE "Tournament" = 'joué-lès-tours' |
CREATE TABLE table_2150 (
"Shekhina:" text,
"Reason" text,
"Mind" text,
"Intelligence" text,
"Thought" text,
"Understanding" text
) | What is the intelligence os the one that has s , 'thought'? | SELECT "Intelligence" FROM table_2150 WHERE "Thought" = '思 sī, "thought' |
CREATE TABLE table_name_78 (
points INTEGER,
goals VARCHAR,
assists VARCHAR,
games VARCHAR
) | If the goals scored were below 6, 11 games were played, and there were 7 assists, what's the sum of points with games meeting these criteria? | SELECT SUM(points) FROM table_name_78 WHERE assists = 7 AND games = 11 AND goals < 6 |
CREATE TABLE table_name_12 (
rider VARCHAR,
speed VARCHAR,
time VARCHAR
) | What Rider had a Speed of 108.347mph and Time of 1:02.40.93? | SELECT rider FROM table_name_12 WHERE speed = "108.347mph" AND time = "1:02.40.93" |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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),
... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of salary over the hire_date bin hire_date by weekday. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | when's the first time patient 1902's heart rate was measured or taken today? | SELECT chartevents.charttime 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 = 1902)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat... |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For those employees who did not have any job in the past, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, order from low to high by the Y. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) |
CREATE TABLE table_name_26 (
SLM INTEGER,
built INTEGER
) | What locomotive built after 1895 has the highest SLM number? | SELECT MAX(SLM) AS number FROM table_name_26 WHERE built > 1895 |
CREATE TABLE table_name_21 (
round VARCHAR,
opponent VARCHAR
) | What is the round when the match was against sergis kyratzis? | SELECT round FROM table_name_21 WHERE opponent = "sergis kyratzis" |
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... | Draw a bar chart about the distribution of ACC_Road and the sum of School_ID , and group by attribute ACC_Road, show from low to high by the bar please. | SELECT ACC_Road, SUM(School_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road |
CREATE TABLE table_name_23 (
time_of_broadcast VARCHAR,
days_of_the_week VARCHAR,
picture_format VARCHAR,
hours VARCHAR
) | Name the Time of broadcast has a Picture format of 4:3, and Hours of 20:30, and Days of the week of monday, wednesday, friday? | SELECT time_of_broadcast FROM table_name_23 WHERE picture_format = "4:3" AND hours = "20:30" AND days_of_the_week = "monday, wednesday, friday" |
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 int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | a FIRST class flight on AA to SAN FRANCISCO on tuesday in the next week | SELECT DISTINCT flight.flight_id FROM airport_service, city, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE_DAY_0.day_number = 22 AND DATE_DAY_0.month_number = 3 AND DATE_DAY_0.year = 1991 AND... |
CREATE TABLE table_203_245 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | how many total international races did german silva place in the top 3 spots ? | SELECT COUNT("competition") FROM table_203_245 WHERE "position" <= 3 |
CREATE TABLE table_name_54 (
rank_by_average INTEGER,
total VARCHAR,
place VARCHAR
) | Which Rank by average is the lowest one that has a Total of 425, and a Place larger than 1? | SELECT MIN(rank_by_average) FROM table_name_54 WHERE total = 425 AND place > 1 |
CREATE TABLE table_name_40 (
termini VARCHAR,
population_area VARCHAR
) | What termini does the route with a population Area of aguilares have? | SELECT termini FROM table_name_40 WHERE population_area = "aguilares" |
CREATE TABLE table_204_311 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | what is the total number of bronze medals won by france ? | SELECT "bronze" FROM table_204_311 WHERE "nation" = 'france' |
CREATE TABLE table_55461 (
"Year" real,
"Player" text,
"Position" text,
"College/Country" text,
"WNBA Team" text
) | Regarding players before 2000, what is the USC player's position? | SELECT "Position" FROM table_55461 WHERE "Year" < '2000' AND "College/Country" = 'usc' |
CREATE TABLE table_203_420 (
id number,
"#" number,
"stadium" text,
"capacity" number,
"city" text,
"home team" text
) | how many stadiums have a capacity between 6000 and 8000 ? | SELECT COUNT("stadium") FROM table_203_420 WHERE "capacity" >= 6000 AND "capacity" <= 8000 |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE equipment_sequence (
aircr... | i need to fly from NASHVILLE to TACOMA first thing in the morning what is there | 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 = 'NASHVILLE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TA... |
CREATE TABLE table_29135051_3 (
broadcast_date VARCHAR,
guest_s_ VARCHAR
) | when was the episode on which barbara windsor and heston blumenthal guest starred broadcasted | SELECT broadcast_date FROM table_29135051_3 WHERE guest_s_ = "Barbara Windsor and Heston Blumenthal" |
CREATE TABLE table_71618 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the year with a kurtis kraft 500a chassis? | SELECT SUM("Year") FROM table_71618 WHERE "Chassis" = 'kurtis kraft 500a' |
CREATE TABLE table_2544694_3 (
indonesia_super_series_2008 VARCHAR
) | Which series occurred when the 7800 was 5040.00? | SELECT indonesia_super_series_2008 FROM table_2544694_3 WHERE 780000 = "5040.00" |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
countr... | Which Thermodynamics and Kinetics courses are worth 9 credits ? | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Thermodynamics and Kinetics%' OR name LIKE '%Thermodynamics and Kinetics%') AND credits = 9 |
CREATE TABLE table_name_12 (
tally VARCHAR,
opposition VARCHAR,
total VARCHAR
) | What is the tally when the opposition is Derry, and total is 14? | SELECT tally FROM table_name_12 WHERE opposition = "derry" AND total = 14 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.