table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_13015539_1 (
points VARCHAR,
lost VARCHAR
) | What is the total points for the tean with 8 losses? | SELECT COUNT(points) FROM table_13015539_1 WHERE lost = 8 |
CREATE TABLE table_203_237 (
id number,
"n" number,
"p" text,
"nat." text,
"name" text,
"age" number,
"moving from" text,
"type" text,
"transfer\nwindow" text,
"ends" number,
"transfer\nfee" text
) | how many players had a free transfer fee ? | SELECT COUNT("name") FROM table_203_237 WHERE "n" = 'free' |
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 female patients belong to black/african american ethnic background? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN" |
CREATE TABLE table_10566855_1 (
attendance INTEGER,
score VARCHAR
) | what is the minimum attendance with score 8.16 (64) 8.12 (60) | SELECT MIN(attendance) FROM table_10566855_1 WHERE score = "8.16 (64) – 8.12 (60)" |
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 dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
... | US 269 leaving BOSTON at 1628 what is the arrival time in BALTIMORE | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.departure_time = 1628 AND flight.flight_number = 269) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.... |
CREATE TABLE bank (
branch_ID int,
bname varchar(20),
no_of_customers int,
city varchar(10),
state varchar(20)
)
CREATE TABLE loan (
loan_ID varchar(3),
loan_type varchar(15),
cust_ID varchar(3),
branch_ID varchar(3),
amount int
)
CREATE TABLE customer (
cust_ID varchar(3),... | Can you compare the account balances of customers with the letter 'a' in their names using a bar graph, and show from low to high by the y axis. | SELECT cust_name, acc_bal FROM customer WHERE cust_name LIKE '%a%' ORDER BY acc_bal |
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
)
... | how many patients with primary pulmonary hypertension had a blood gas test by lab? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Primary pulmonary hypertension" AND lab."CATEGORY" = "Blood Gas" |
CREATE TABLE table_22417 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text,
"Language/Rebroadcast" text
) | When fm 97.3 is the frequency how many formats are there? | SELECT COUNT("Format") FROM table_22417 WHERE "Frequency" = 'FM 97.3' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | in total what was the total amount of enteral tube intake: nasogastric nostril, l that patient 005-18714 had received on 01/26/2104? | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-18714')) AND intakeoutput.celllabel = 'enter... |
CREATE TABLE table_63850 (
"Airline" text,
"IATA" text,
"ICAO" text,
"Callsign" text,
"Commenced operations" real
) | Which Commenced operations have an Airline of valuair? | SELECT "Commenced operations" FROM table_63850 WHERE "Airline" = 'valuair' |
CREATE TABLE tip (
tip_id int,
business_id varchar,
text longtext,
user_id varchar,
likes int,
year int,
month varchar
)
CREATE TABLE user (
uid int,
user_id varchar,
name varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address... | list all the reviews by Niloofar | SELECT review.text FROM review, user WHERE user.name = 'Niloofar' AND user.user_id = review.user_id |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | Which courses will be taught by Dr. Selena Smith next semester ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Selena Smith%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe... |
CREATE TABLE dorm (
dorm_name VARCHAR,
student_capacity VARCHAR
) | Find the name of the dorm with the largest capacity. | SELECT dorm_name FROM dorm ORDER BY student_capacity DESC LIMIT 1 |
CREATE TABLE table_name_95 (
theme VARCHAR,
issue_price VARCHAR
) | What is the Theme of the coin with an Issue Price of $89.95? | SELECT theme FROM table_name_95 WHERE issue_price = "$89.95" |
CREATE TABLE table_name_55 (
decile VARCHAR,
authority VARCHAR,
name VARCHAR
) | What is the decile for Westminster Christian School with a state integrated authority? | SELECT decile FROM table_name_55 WHERE authority = "state integrated" AND name = "westminster christian school" |
CREATE TABLE table_72670 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"For" real,
"Against" real,
"Difference" text
) | Name the points for paulistano | SELECT "Points" FROM table_72670 WHERE "Team" = 'Paulistano' |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (... | Show all role codes and the number of employees in each role by a bar chart, and sort by the the total number from high to low. | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code ORDER BY COUNT(*) DESC |
CREATE TABLE table_name_39 (
total INTEGER,
league_cup INTEGER
) | What is the sum of the League Cup smaller than 0? | SELECT SUM(total) FROM table_name_39 WHERE league_cup < 0 |
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,
... | provide the number of patients whose ethnicity is black/haitian and age is less than 85? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/HAITIAN" AND demographic.age < "85" |
CREATE TABLE table_name_79 (
matches INTEGER,
name VARCHAR,
seasons VARCHAR
) | What is the average number of matches of leonardo in seasons after 1? | SELECT AVG(matches) FROM table_name_79 WHERE name = "leonardo" AND seasons > 1 |
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(... | Bin the hire date into Month interval, and then compute the average salary of employees in each month for a bar chart, note that just select those employees without the letter M in their first name, and sort the average of salary in asc order please. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY) |
CREATE TABLE volume (
volume_id number,
volume_issue text,
issue_date text,
weeks_on_top number,
song text,
artist_id number
)
CREATE TABLE music_festival (
id number,
music_festival text,
date_of_ceremony text,
category text,
volume number,
result text
)
CREATE TABLE a... | Return the dates of ceremony corresponding to music festivals that had the category 'Best Song' and result 'Awarded'. | SELECT date_of_ceremony FROM music_festival WHERE category = "Best Song" AND result = "Awarded" |
CREATE TABLE table_56778 (
"County" text,
"Name" text,
"Length (miles)" real,
"West or south terminus" text,
"East or north terminus" text
) | what is the length (miles) when the east or north terminus is ne 2 in lincoln? | SELECT COUNT("Length (miles)") FROM table_56778 WHERE "East or north terminus" = 'ne 2 in lincoln' |
CREATE TABLE table_23346303_3 (
opponent VARCHAR,
location VARCHAR
) | what is the number of opponents where the location is syracuse, ny? | SELECT COUNT(opponent) FROM table_23346303_3 WHERE location = "Syracuse, NY" |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
... | when was the first time the respiration for patient 015-58787 was less than 29.0 today? | 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-58787')) AND vitalperiodic.respiration < 29.0 A... |
CREATE TABLE table_name_93 (
top_5 INTEGER,
top_10 VARCHAR,
wins VARCHAR
) | What is the best top-5 when top-10 is 1 and there are more than 0 wins? | SELECT MAX(top_5) FROM table_name_93 WHERE top_10 = 1 AND wins > 0 |
CREATE TABLE All_Documents (
Document_ID INTEGER,
Date_Stored DATETIME,
Document_Type_Code CHAR(15),
Document_Name CHAR(255),
Document_Description CHAR(255),
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Descri... | Show all role codes and the number of employees in each role with a pie chart. | SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code |
CREATE TABLE table_76742 (
"Location" text,
"Country" text,
"Type" text,
"Wheels" real,
"Configuration" text
) | What average wheels has accounting as the type, with IBM Collection as the location? | SELECT AVG("Wheels") FROM table_76742 WHERE "Type" = 'accounting' AND "Location" = 'ibm collection' |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of last_name and employee_id , show in asc by the y-axis please. | SELECT LAST_NAME, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID |
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... | Which classes should I take to use toward my Core ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%Core%' AND program_course.course_id = course.course_id |
CREATE TABLE table_name_32 (
school VARCHAR,
player VARCHAR
) | Which school did player Rodney Purvis belong to? | SELECT school FROM table_name_32 WHERE player = "rodney purvis" |
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
)
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
) | Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones, and count them by a line chart | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" |
CREATE TABLE table_47326 (
"Year" text,
"Rebs" real,
"Asts" real,
"Stls" real,
"Blks" real
) | What is the sum of Blks, when Stls is 1, and when Rebs is greater than 8.6? | SELECT SUM("Blks") FROM table_47326 WHERE "Stls" = '1' AND "Rebs" > '8.6' |
CREATE TABLE table_23235767_4 (
year VARCHAR,
opponent_in_the_final VARCHAR,
surface VARCHAR,
championship VARCHAR
) | Name the year for clay for boston and guillermo vilas | SELECT year FROM table_23235767_4 WHERE surface = "Clay" AND championship = "Boston" AND opponent_in_the_final = "Guillermo Vilas" |
CREATE TABLE table_name_19 (
week INTEGER,
date VARCHAR
) | What is the lowest week that has November 30, 2003 as the date? | SELECT MIN(week) FROM table_name_19 WHERE date = "november 30, 2003" |
CREATE TABLE table_34378 (
"Place" real,
"Nation" text,
"6 Ropes" real,
"4 Hoops, 2 Clubs" real,
"Total" real
) | What is the total of the nation with 19.025 4 hoops, 2 clubs? | SELECT "Total" FROM table_34378 WHERE "4 Hoops, 2 Clubs" = '19.025' |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | give the number of patients who were admitted to the hospital before the year 2144 with 5720 as the diagnosis icd9 code. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2144" AND diagnoses.icd9_code = "5720" |
CREATE TABLE table_name_52 (
points VARCHAR,
year VARCHAR,
chassis VARCHAR
) | How many points does the year after 1986 with a AGS JH23B chassis have? | SELECT points FROM table_name_52 WHERE year > 1986 AND chassis = "ags jh23b" |
CREATE TABLE table_45895 (
"Name" text,
"Listed" text,
"Location" text,
"County" text,
"Type" text
) | What type of Bridge is in Stanley? | SELECT "Type" FROM table_45895 WHERE "Location" = 'stanley' |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_labitems (
row_i... | how many times has patient 55360 been at the intensive care unit on this hospital encounter? | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55360 AND admissions.dischtime IS NULL) |
CREATE TABLE table_1108394_43 (
party VARCHAR,
brooklyn VARCHAR
) | what's the party with brooklyn value of 51.0% | SELECT party FROM table_1108394_43 WHERE brooklyn = "51.0_percentage" |
CREATE TABLE table_name_78 (
score VARCHAR,
attendance VARCHAR
) | When the attendance was 3188 what was the score? | SELECT score FROM table_name_78 WHERE attendance = 3188 |
CREATE TABLE table_name_80 (
undecided VARCHAR,
source VARCHAR,
murray VARCHAR
) | What is the undecided percentage of the poll from Suffolk University with Murray at 11%? | SELECT undecided FROM table_name_80 WHERE source = "suffolk university" AND murray = "11%" |
CREATE TABLE table_56872 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | Who had the time of 1:23.32.41? | SELECT "Rider" FROM table_56872 WHERE "Time" = '1:23.32.41' |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | when did patient 808 enter for the last time in the hospital since 2105? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 808 AND STRFTIME('%y', admissions.admittime) >= '2105' ORDER BY admissions.admittime DESC LIMIT 1 |
CREATE TABLE table_train_46 (
"id" int,
"bleeding" int,
"active_infection" bool,
"hypotension" bool,
"burn_injury" int,
"hypertension" bool,
"age" float,
"NOUSE" float
) | 10 % of body surface area acute burn injury | SELECT * FROM table_train_46 WHERE burn_injury > 10 |
CREATE TABLE table_52647 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Who constructed Chris Amon's car? | SELECT "Constructor" FROM table_52647 WHERE "Driver" = 'chris amon' |
CREATE TABLE table_name_45 (
Id VARCHAR
) | What is the value in 1990 when it is A in 1989, 1985, and 1993? | SELECT 1990 FROM table_name_45 WHERE 1989 = "a" AND 1985 = "a" AND 1993 = "a" |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
las... | how much vancomycin has been prescribed to patient 1784 in total? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1784) AND prescriptions.drug = 'vancomycin' |
CREATE TABLE table_62740 (
"Race Title" text,
"Circuit" text,
"City / State" text,
"Date" text,
"Winner" text
) | What's the circuit that had an event cancelled? | SELECT "Circuit" FROM table_62740 WHERE "Winner" = 'event cancelled' |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | when did patient 032-21820 first have a maximum value of respiration on this month/23? | 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 = '032-21820')) AND NOT vitalperiodic.respiration IS N... |
CREATE TABLE table_69769 (
"Game" real,
"Date" text,
"Location" text,
"Time" text,
"Attendance" real
) | Date of october 8 happened at what time? | SELECT "Time" FROM table_69769 WHERE "Date" = 'october 8' |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Parent... | Users active in the last fortnight. | SELECT Id AS "user_link", LastAccessDate FROM Users WHERE LastAccessDate > DATEDIFF(DAY, 1, GETDATE()) ORDER BY LastAccessDate |
CREATE TABLE table_38574 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which Surface has a Tournament of st. petersburg , russia? | SELECT "Surface" FROM table_38574 WHERE "Tournament" = 'st. petersburg , russia' |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswer... | Answer count by post (2011). | SELECT Id, CreationDate, CommunityOwnedDate, AnswerCount FROM Posts WHERE YEAR(CreationDate) = 2011 AND PostTypeId = 1 ORDER BY CreationDate |
CREATE TABLE table_203_355 (
id number,
"year" number,
"total" number,
"romanians" text,
"hungarians" text,
"roma" text
) | what year had the highest total number ? | SELECT "year" FROM table_203_355 ORDER BY "total" DESC LIMIT 1 |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
... | For each city, return the highest latitude among its stations. Show a pie chart. | SELECT city, MAX(lat) FROM station GROUP BY city |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | has patient 013-33898 received a procedure of antihyperlipidemic agent - fenofibrate in 2105? | 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 = '013-33898')) AND treatment.treatmentname = 'antihyperlipidemic agent - fenof... |
CREATE TABLE table_204_757 (
id number,
"state" text,
"interview" number,
"swimsuit" number,
"evening gown" number,
"average" number
) | what is the largest evening gown amount ? | SELECT MAX("evening gown") FROM table_204_757 |
CREATE TABLE table_18466 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the number of party in the arkansas 1 district | SELECT COUNT("Party") FROM table_18466 WHERE "District" = 'Arkansas 1' |
CREATE TABLE table_name_52 (
runner_s__up VARCHAR,
date VARCHAR
) | On the Date of 2 Aug 2009, who was the Runner(s)-up? | SELECT runner_s__up FROM table_name_52 WHERE date = "2 aug 2009" |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | Show the name and number of employees for the departments managed by heads whose temporary acting value is 'Yes', could you rank by the names from low to high please? | SELECT Name, SUM(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name ORDER BY Name |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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 employees (
EMPLO... | For those employees who was hired before 2002-06-21, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart, rank names in ascending order. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID |
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
)
... | count the number of patients whose admission type is elective and lab test name is triglycer? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.label = "Triglycer" |
CREATE TABLE table_23453931_5 (
opponent VARCHAR,
date VARCHAR
) | Name the opponents for december 3 | SELECT COUNT(opponent) FROM table_23453931_5 WHERE date = "December 3" |
CREATE TABLE table_32879 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What day did the VFL pay MCG? | SELECT "Date" FROM table_32879 WHERE "Venue" = 'mcg' |
CREATE TABLE table_63942 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Time ( sec )" real,
"Notes" text
) | Which athlete is ranked less than 5 with time over 11.22? | SELECT "Athlete" FROM table_63942 WHERE "Time ( sec )" > '11.22' AND "Rank" < '5' |
CREATE TABLE table_name_97 (
original_name VARCHAR,
film_title_used_in_nomination VARCHAR
) | Name the original name for last days of the victim | SELECT original_name FROM table_name_97 WHERE film_title_used_in_nomination = "last days of the victim" |
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... | give me the number of patients whose age is less than 31 and procedure icd9 code is 17? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "31" AND procedures.icd9_code = "17" |
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 medication (
medi... | what was the number of times hydromorphone 1 mg/1 ml syr was prescribed for patient 030-53416 in 06/this year? | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-53416')) AND medication.drugname = 'hydromorphone 1 mg/1 ml syr' AND DATET... |
CREATE TABLE table_name_47 (
third VARCHAR,
skip VARCHAR
) | What is the name of the third who has Barbora Vojtusova as Skip? | SELECT third FROM table_name_47 WHERE skip = "barbora vojtusova" |
CREATE TABLE table_9572 (
"Year" real,
"Character" text,
"Title" text,
"Author" text,
"Artist" text,
"Imprint" text
) | what is the imprint when the title is owari no chronicle (ahead series)? | SELECT "Imprint" FROM table_9572 WHERE "Title" = 'owari no chronicle (ahead series)' |
CREATE TABLE table_36285 (
"Name" text,
"Championship" real,
"FA Cup" real,
"League Cup" real,
"Total" real
) | League Cup smaller than 0 is what sum of the total? | SELECT SUM("Total") FROM table_36285 WHERE "League Cup" < '0' |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE Payments (
Payment_ID INTEGER,
S... | What about the average amounts of payments by each method code? You can give me a bar chart, display from high to low by the X. | SELECT Payment_Method_Code, AVG(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY Payment_Method_Code DESC |
CREATE TABLE table_69059 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" text,
"Class" text,
"FCC info" text
) | Which city of license has a wriq Call sign? | SELECT "City of license" FROM table_69059 WHERE "Call sign" = 'wriq' |
CREATE TABLE table_name_29 (
country VARCHAR,
hdtv VARCHAR,
content VARCHAR
) | What is Country, when HDTV is yes, and when Content is cinema? | SELECT country FROM table_name_29 WHERE hdtv = "yes" AND content = "cinema" |
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE market (
Mar... | Visualize a bar chart for how films are produced by each studio?, list bar from low to high order. | SELECT Studio, COUNT(*) FROM film GROUP BY Studio ORDER BY Studio |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
sy... | what was patient 002-58884's first time of lr intake on last month/14? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-58884')) AND intakeoutput.cellpath LIKE '%intake%... |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | give me the number of patients whose diagnoses short title is choledochlith nos w obst? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Choledochlith NOS w obst" |
CREATE TABLE table_name_63 (
laps VARCHAR,
driver VARCHAR
) | What are the total number of laps for Tom Bridger? | SELECT COUNT(laps) FROM table_name_63 WHERE driver = "tom bridger" |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuo... | how many times did a replace indwelling cath procedure be done? | 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 = 'replace indwelling cath') |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | what is minimum age of patients whose marital status is divorced and primary disease is brain mass;intracranial hemorrhage? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" |
CREATE TABLE table_34991 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What is the average game number that took place after February 13 against the Toronto Maple Leafs and more than 47 points were scored? | SELECT AVG("Game") FROM table_34991 WHERE "February" > '13' AND "Opponent" = 'toronto maple leafs' AND "Points" > '47' |
CREATE TABLE table_44722 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What was the score for set 3 when set 1 was 14 25? | SELECT "Set 3" FROM table_44722 WHERE "Set 1" = '14–25' |
CREATE TABLE Documents (
document_id INTEGER,
document_status_code CHAR(15),
document_type_code CHAR(15),
shipping_agent_code CHAR(15),
receipt_date DATETIME,
receipt_number VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Shipping_Agents (
shipping_agent_code CHAR(15),
s... | Show a bar chart about how many employees does each role have?, I want to order by the the total number in descending. | SELECT role_description, COUNT(*) FROM Roles AS T1 JOIN Employees AS T2 ON T1.role_code = T2.role_code GROUP BY T2.role_code ORDER BY COUNT(*) DESC |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | what was the last thing patient 20603 received for intake since 987 days ago? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT inputevents_cv.itemid FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20603)) AND DATETIME(inputevents_cv.... |
CREATE TABLE table_78990 (
"Model" text,
"Chassis" real,
"Engine" real,
"Year From" real,
"Year To" real
) | How many engines have a Model of sl600, and a Year From of 1994, and a Year To smaller than 1995? | SELECT COUNT("Engine") FROM table_78990 WHERE "Model" = 'sl600' AND "Year From" = '1994' AND "Year To" < '1995' |
CREATE TABLE table_17330069_1 (
time_retired VARCHAR,
points VARCHAR
) | If there are 28 points, what is the time/retired? | SELECT time_retired FROM table_17330069_1 WHERE points = "28" |
CREATE TABLE table_15236 (
"Name" text,
"Years" text,
"A-League" text,
"Finals" text,
"Total" text
) | Which player has an A-League of 113 (0)? | SELECT "Name" FROM table_15236 WHERE "A-League" = '113 (0)' |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
... | what was the name of the first lab test patient 51177 had received since 03/2105? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) AND STRFTIME('%y-%m', labevents.charttime) >= '2105-03' ORDER BY labevents.charttime LIMIT 1) |
CREATE TABLE table_15119 (
"Year" real,
"Division I" text,
"Division II" text,
"Division III" text,
"Division IV" text,
"Division V" text
) | What Division III has Bishop Brady in Division V and Hanover in Division IV? | SELECT "Division III" FROM table_15119 WHERE "Division V" = 'bishop brady' AND "Division IV" = 'hanover' |
CREATE TABLE table_67890 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Try BP" text,
"Losing BP" text
) | What is the number drawn when the try BP is 1? | SELECT "Drawn" FROM table_67890 WHERE "Try BP" = '1' |
CREATE TABLE table_name_34 (
opponent VARCHAR,
record VARCHAR
) | Who was the opponent the Buffalo Bills played when their record was 4-4? | SELECT opponent FROM table_name_34 WHERE record = "4-4" |
CREATE TABLE table_57011 (
"Year" real,
"Author" text,
"English title" text,
"Original title" text,
"Representing" text
) | What is the year for the ocean? | SELECT "Year" FROM table_57011 WHERE "English title" = 'the ocean' |
CREATE TABLE table_73185 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What position is the player who went to Regina? | SELECT "Position" FROM table_73185 WHERE "College" = 'Regina' |
CREATE TABLE table_62772 (
"Tournament" text,
"1987" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text
) | What is 1994 Grand Slam Tournament if 1993 is also grand slam tournaments? | SELECT "1994" FROM table_62772 WHERE "1993" = 'grand slam tournaments' |
CREATE TABLE table_name_52 (
Id VARCHAR
) | What is the 2005 that has a grand slam tournaments in 2007? | SELECT 2005 FROM table_name_52 WHERE 2007 = "grand slam tournaments" |
CREATE TABLE table_67600 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What is the number of the rank when the time is 2:15.98, in a lane larger than 7? | SELECT COUNT("Rank") FROM table_67600 WHERE "Time" = '2:15.98' AND "Lane" > '7' |
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge... | How many hosts does each nationality have? List the nationality and the count Visualize by bar chart, and sort X-axis from high to low order. | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality ORDER BY Nationality DESC |
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... | How many patients born before year 2170 have lab test fluid as other body fluid? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.fluid = "Other Body Fluid" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.