table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE Documents (
document_id INTEGER,
document_type_code VARCHAR(10),
grant_id INTEGER,
sent_date DATETIME,
response_received_date DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Organisation_Types (
organisation_type VARCHAR(10),
organisation_type_description VARCHAR(255)
)... | Plot date to by the number of date to as a trend line, and sort by the x-axis from high to low. | SELECT date_to, COUNT(date_to) FROM Project_Staff ORDER BY date_to DESC |
CREATE TABLE table_29931 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Name the number of score for january 12 | SELECT COUNT("Score") FROM table_29931 WHERE "Date" = 'January 12' |
CREATE TABLE table_40746 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | Which television service has italian for its language? | SELECT "Television service" FROM table_40746 WHERE "Language" = 'italian' |
CREATE TABLE table_name_69 (
discovery___publication_of_name VARCHAR,
species VARCHAR
) | Tell me the discovery/publication for red deer cave people | SELECT discovery___publication_of_name FROM table_name_69 WHERE species = "red deer cave people" |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the average of department_id bin hire_date by weekday in a bar chart. | SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 |
CREATE TABLE table_name_4 (
crowd VARCHAR,
venue VARCHAR
) | How many people watch at Western Oval venue? | SELECT COUNT(crowd) FROM table_name_4 WHERE venue = "western oval" |
CREATE TABLE table_2603017_2 (
b___bishop VARCHAR,
bc___beast_cadet VARCHAR
) | what is b - bishop where bc - beast cadet is gr - great dove? | SELECT b___bishop FROM table_2603017_2 WHERE bc___beast_cadet = "GR - Great Dove" |
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 demographic ... | how many patients with st elevated myocardial infarction/cardiac catheterization primary disease were admitted to hospital before 2135? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND demographic.admityear < "2135" |
CREATE TABLE table_29723 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who were the 76ers opponents on January 17? | SELECT "Team" FROM table_29723 WHERE "Date" = 'January 17' |
CREATE TABLE table_203_274 (
id number,
"church name" text,
"address" text,
"community" text,
"school" text
) | is our lady of loretto listed above or below the holy spirit ? | SELECT (SELECT id FROM table_203_274 WHERE "church name" = 'our lady of loretto') < (SELECT id FROM table_203_274 WHERE "church name" = 'holy spirit') |
CREATE TABLE table_name_51 (
date VARCHAR,
livery VARCHAR
) | What is the date for the Operational Livery? | SELECT date FROM table_name_51 WHERE livery = "operational" |
CREATE TABLE table_28668784_1 (
city___town VARCHAR,
stadium VARCHAR
) | What town holds Stadion Zlatica? | SELECT city___town FROM table_28668784_1 WHERE stadium = "Stadion Zlatica" |
CREATE TABLE table_23014685_1 (
area_damaged VARCHAR,
target VARCHAR
) | What area was damaged when King Khalid Military City was targeted? | SELECT area_damaged FROM table_23014685_1 WHERE target = "King Khalid Military City" |
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 patient (
uniquep... | in 01/last year what was the first value of a rdw lab test of patient 006-65715? | SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-65715')) AND lab.labname = 'rdw' AND DATETIME(lab.labresulttime, 'start of year') =... |
CREATE TABLE table_name_76 (
dvd_set_release_date VARCHAR,
network VARCHAR
) | When dis cbs release the DVD set? | SELECT dvd_set_release_date FROM table_name_76 WHERE network = "cbs" |
CREATE TABLE table_50180 (
"Show" text,
"Host(s)" text,
"Flagship" text,
"Market" text,
"iHeartRadio" text
) | What is the Flagship of the Show Hosted by Rover (Shane French)? | SELECT "Flagship" FROM table_50180 WHERE "Host(s)" = 'rover (shane french)' |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | calculate the duration of stay during patient 007-4322's first stay in the intensive care unit. | SELECT STRFTIME('%j', patient.unitdischargetime) - STRFTIME('%j', patient.unitadmittime) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-4322') AND NOT patient.unitadmittime IS NULL ORDER BY patient.unitadmittime LIMIT 1 |
CREATE TABLE table_59092 (
"Player" text,
"Country" text,
"Year(s) Won" text,
"Total" real,
"To par" real
) | Can you tell me the Year(s) Won that has the Country of united states, and the Total larger than 152? | SELECT "Year(s) Won" FROM table_59092 WHERE "Country" = 'united states' AND "Total" > '152' |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | Show me how many year by year in a histogram, and I want to list Y-axis in desc order. | SELECT Year, COUNT(Year) FROM exhibition ORDER BY COUNT(Year) DESC |
CREATE TABLE table_name_96 (
location VARCHAR,
classification VARCHAR
) | What is the location of Classification of T12? | SELECT location FROM table_name_96 WHERE classification = "t12" |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
... | calculate the five year survival rate among the patients who were prescribed lr after they were diagnosed with cv dis nec-deliver w p/p. | SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd... |
CREATE TABLE table_32804 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home team when the home team score is 12.17 (89)? | SELECT "Home team" FROM table_32804 WHERE "Home team score" = '12.17 (89)' |
CREATE TABLE table_57513 (
"Date of Issue" text,
"Theme" text,
"Design" text,
"Illustration" text,
"Paper Type" text,
"First Day Cover Cancellation" text
) | What is the Date of Issue with a Theme with mental health? | SELECT "Date of Issue" FROM table_57513 WHERE "Theme" = 'mental health' |
CREATE TABLE table_56 (
"Year" real,
"Game or event" text,
"Date contested" text,
"League or governing body" text,
"Sport" text,
"Winning team" text,
"Losing team" text,
"Final score" text
) | What sport had a final score of 3-2? | SELECT "Sport" FROM table_56 WHERE "Final score" = '3-2' |
CREATE TABLE table_203_61 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | nigeria has the most gold medals , but who has the most medals overall ? | SELECT "nation" FROM table_203_61 ORDER BY "total" DESC LIMIT 1 |
CREATE TABLE volume (
Famous_Title VARCHAR,
Artist_ID VARCHAR
)
CREATE TABLE artist (
Famous_Title VARCHAR,
Artist_ID VARCHAR
) | Find the famous titles of artists that do not have any volume. | SELECT Famous_Title FROM artist WHERE NOT Artist_ID IN (SELECT Artist_ID FROM volume) |
CREATE TABLE table_66970 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What races were Chi-Chi Rodriguez the runner-up in? | SELECT "Tournament" FROM table_66970 WHERE "Runner(s)-up" = 'chi-chi rodriguez' |
CREATE TABLE table_27146868_1 (
Id VARCHAR
) | What is 2006 when 1997 is 6.8? | SELECT 2006 FROM table_27146868_1 WHERE 1997 = "6.8" |
CREATE TABLE table_38417 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | Which player's pick number was 25? | SELECT "Player" FROM table_38417 WHERE "Pick #" = '25' |
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
) | A bar chart about what is the average rating star for each reviewer?, I want to show from high to low by the y axis. | SELECT name, AVG(T1.stars) FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID GROUP BY T2.name ORDER BY AVG(T1.stars) DESC |
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 prescription... | how many black/haitian patients had neb as the drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.route = "NEB" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TA... | what do endotracheal tube - insertion treatments cost? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'endotracheal tube - insertion') |
CREATE TABLE table_17657 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Total viewers (in millions)" text
) | Who directed the title that was written by Adam Milch? | SELECT "Directed by" FROM table_17657 WHERE "Written by" = 'Adam Milch' |
CREATE TABLE table_name_83 (
consistency_ VARCHAR,
_participation VARCHAR,
pareto_efficiency VARCHAR,
condorcet VARCHAR
) | what is the consistency & participation when pareto efficiency is yes and condorcet is no? | SELECT consistency_ & _participation FROM table_name_83 WHERE pareto_efficiency = "yes" AND condorcet = "no" |
CREATE TABLE table_18330 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the district that has Bob Wilson as an incumbent? | SELECT "District" FROM table_18330 WHERE "Incumbent" = 'Bob Wilson' |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Show me team_id by all road in a histogram, I want to list by the X-axis in ascending please. | SELECT All_Road, Team_ID FROM basketball_match ORDER BY All_Road |
CREATE TABLE table_name_67 (
ranking INTEGER,
name VARCHAR
) | What is the lowest ranking for Paul Mctiernan? | SELECT MIN(ranking) FROM table_name_67 WHERE name = "paul mctiernan" |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | Show the capacity for each cinema in a bar chart, list x axis from high to low order. | SELECT Name, Capacity FROM cinema ORDER BY Name DESC |
CREATE TABLE table_name_34 (
score VARCHAR,
date VARCHAR
) | What was the score of the game on February 8? | SELECT score FROM table_name_34 WHERE date = "february 8" |
CREATE TABLE table_28985631_1 (
defective_year VARCHAR,
numbered_month VARCHAR
) | What is the defective year for the eighth numbered month? | SELECT defective_year FROM table_28985631_1 WHERE numbered_month = "Eighth" |
CREATE TABLE table_name_19 (
opponent VARCHAR,
result VARCHAR,
week VARCHAR
) | What opponent did they have a bye result against before week 14? | SELECT opponent FROM table_name_19 WHERE result = "bye" AND week < 14 |
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... | Show me a bar chart for what are all the employee ids and the names of the countries in which they work? | SELECT COUNTRY_NAME, SUM(EMPLOYEE_ID) 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 GROUP BY COUNTRY_NAME |
CREATE TABLE table_name_11 (
home_team VARCHAR,
venue VARCHAR
) | What team has theoir home games in the venue of gold coast convention centre? | SELECT home_team FROM table_name_11 WHERE venue = "gold coast convention centre" |
CREATE TABLE Ref_Locations (
Location_Code CHAR(15),
Location_Name VARCHAR(255),
Location_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Roles (
Role_Code CHAR(... | I want to see trend of the number of date in locaton to by date in locaton to | SELECT Date_in_Locaton_To, COUNT(Date_in_Locaton_To) FROM Document_Locations |
CREATE TABLE table_16527640_2 (
rank_held_at_time_of_death VARCHAR,
player VARCHAR
) | How many players named paddy rowan? | SELECT COUNT(rank_held_at_time_of_death) FROM table_16527640_2 WHERE player = "Paddy Rowan" |
CREATE TABLE table_10335_1 (
current_country_of_location VARCHAR,
operational VARCHAR
) | what's the current country of location with operational period of summer of 1941 to 28 june 1944 | SELECT current_country_of_location FROM table_10335_1 WHERE operational = "Summer of 1941 to 28 June 1944" |
CREATE TABLE table_23799417_2 (
title VARCHAR,
original_airing VARCHAR
) | what is the episode title on original air date of September 30, 2007? | SELECT title FROM table_23799417_2 WHERE original_airing = "September 30, 2007" |
CREATE TABLE table_name_17 (
foundation VARCHAR,
enterprise VARCHAR
) | Which Foundation has an Enterprise of 2? | SELECT foundation FROM table_name_17 WHERE enterprise = "2" |
CREATE TABLE table_2102782_1 (
broadcast_date VARCHAR,
run_time VARCHAR
) | Name the broadcast date for run timke of 25:04 | SELECT broadcast_date FROM table_2102782_1 WHERE run_time = "25:04" |
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 prescription... | How many patients with brain mass intracranial hemorrhage as their primary disease had an abnormal lab test status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.flag = "abnormal" |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | My List of Tag Synonyms which permit Voting. | SELECT 'site://tags/' + TargetTagName + '/synonyms|' + TargetTagName AS "vote4me", COUNT(SourceTagName) AS "synonyms" FROM TagSynonyms AS TS WHERE ApprovalDate IS NULL AND (SELECT SUM(CASE V.VoteTypeId WHEN 2 THEN 1 WHEN 3 THEN -1 END) FROM Tags AS T, PostTags AS Pt, Posts AS P, Votes AS V, VoteTypes AS Vt WHERE T.Id =... |
CREATE TABLE table_28194879_1 (
_number VARCHAR,
production_code VARCHAR
) | What is the number in season of the episode whose production code is pabf05? | SELECT _number FROM table_28194879_1 WHERE production_code = "PABF05" |
CREATE TABLE table_name_96 (
wins INTEGER,
losses VARCHAR
) | What is the lowest amount of wins of someone who has 2 losses? | SELECT MIN(wins) FROM table_name_96 WHERE losses = 2 |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate... | Most accepted answers for Cassandra for the year. | SELECT Users.DisplayName, COUNT(*) AS AcceptedAnswers FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Posts AS questions ON questions.Id = PostTags.PostId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tags.Id = 34113 AND questions.Accept... |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
... | when did patient 808 get a microbiology test for the last time this month? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY microbiologyevents.... |
CREATE TABLE table_53941 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | Name the sum of played for position less than 9 and draws more than 19 with goals against more than 27 | SELECT SUM("Played") FROM table_53941 WHERE "Position" < '9' AND "Draws" > '19' AND "Goals against" > '27' |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
sp... | how much has patient 85407 in a year before to pay for their hospital stay? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 85407) AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') |
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... | count the number of patients whose religion is jehovah's witness and age is less than 59? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.religion = "JEHOVAH'S WITNESS" AND demographic.age < "59" |
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_seaso... | A bar chart showing the average price of each cinema, show in descending by the y-axis please. | SELECT Name, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name ORDER BY AVG(Price) DESC |
CREATE TABLE table_58745 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( \u00a3 )" real
) | Name The Score of Player of seve ballesteros? | SELECT "Score" FROM table_58745 WHERE "Player" = 'seve ballesteros' |
CREATE TABLE table_name_42 (
authors VARCHAR,
unit VARCHAR
) | Which authors have a Unit of densu -ciula formation? | SELECT authors FROM table_name_42 WHERE unit = "densuș-ciula formation" |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text... | i would like the evening schedule of flights from SAN FRANCISCO to WASHINGTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ... |
CREATE TABLE table_23192 (
"Player" text,
"Games Played" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | What is the largest amount of assists that Nicole Levandusky made? | SELECT MAX("Assists") FROM table_23192 WHERE "Player" = 'Nicole Levandusky' |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
... | In the classes for next Winter , what Core classes are offered ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id WHERE program_cour... |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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,
JO... | Show the trend about salary change over hire date using a line chart, and show x axis in descending order. | SELECT HIRE_DATE, SALARY FROM employees ORDER BY HIRE_DATE DESC |
CREATE TABLE region (
region_id number,
region_code text,
region_name text
)
CREATE TABLE storm (
storm_id number,
name text,
dates_active text,
max_speed number,
damage_millions_usd number,
number_deaths number
)
CREATE TABLE affected_region (
region_id number,
storm_id nu... | What are the names of regions that were not affected? | SELECT region_name FROM region WHERE NOT region_id IN (SELECT region_id FROM affected_region) |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many dead patients had diagnoses icd9 code 56962? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "56962" |
CREATE TABLE customer (
cust_id text,
cust_name text,
acc_type text,
acc_bal number,
no_of_loans number,
credit_score number,
branch_id number,
state text
)
CREATE TABLE bank (
branch_id number,
bname text,
no_of_customers number,
city text,
state text
)
CREATE TABL... | What are the names of customers who do not have saving accounts? | SELECT cust_name FROM customer EXCEPT SELECT cust_name FROM customer WHERE acc_type = 'saving' |
CREATE TABLE table_2538117_12 (
organization VARCHAR,
founding_date VARCHAR
) | What organization had the founding date of 1998-11-08? | SELECT organization FROM table_2538117_12 WHERE founding_date = "1998-11-08" |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDe... | Top users from Moscow, Russia. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%moscow%' OR UPPER(Location) LIKE '%MOSCOW%' OR Location LIKE '%Moscow%' AND Reputation >= 100 ORDER BY Reputation DESC |
CREATE TABLE table_37410 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What is the lowest lost from drawn of 1 or greater? | SELECT MIN("Lost") FROM table_37410 WHERE "Drawn" > '1' |
CREATE TABLE table_18240 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What party did Beau Boulter represent? | SELECT "Party" FROM table_18240 WHERE "Incumbent" = 'Beau Boulter' |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer... | what is the earliest flight from ATLANTA to BOSTON | 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTO... |
CREATE TABLE table_33863 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"City of License" text,
"Website" text,
"Webcast" text
) | Which Website has a Frequency smaller than 760 and a Callsign of kkyx? | SELECT "Website" FROM table_33863 WHERE "Frequency" < '760' AND "Callsign" = 'kkyx' |
CREATE TABLE table_name_15 (
team VARCHAR,
goals_against VARCHAR,
drawn VARCHAR,
position VARCHAR
) | Which team has a position higher than 3, a Drawn lower than 12, and a Goals Against higher than 85? | SELECT team FROM table_name_15 WHERE drawn < 12 AND position > 3 AND goals_against > 85 |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABL... | what is the total acetaminophen dose that has been prescribed this month to patient 12927? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12927) AND prescriptions.drug = 'acetaminophen' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month'... |
CREATE TABLE table_11393 (
"Data" text,
"Total gain" text,
"Percent gain" text,
"2003" text,
"2000" text,
"1997" text,
"1994" text,
"1991" text,
"1988" text,
"1985" text,
"1982" text,
"1979" text,
"1976" text,
"1973" text,
"1970" text,
"1967" text
) | Name the data with a percent gain of 28.4% | SELECT "Data" FROM table_11393 WHERE "Percent gain" = '28.4%' |
CREATE TABLE table_74712 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the venue when Geelong is the away team? | SELECT "Venue" FROM table_74712 WHERE "Away team" = 'geelong' |
CREATE TABLE table_10875694_11 (
product_no VARCHAR,
title VARCHAR
) | How many products have the title 'Jak 3'? | SELECT COUNT(product_no) FROM table_10875694_11 WHERE title = "Jak 3" |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients whose diagnoses short title is cellulitis of hand and drug type is main? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Cellulitis of hand" AND prescriptions.drug_type = "MAIN" |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what are the four most common medications prescribed for patients who were also prescribed calcium gluconate 100 mg/ml (10 %) iv : 10 ml at the same time until 2101? | 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 = 'calcium gluconate 100 mg/ml (10 %) iv : 10 ml' AND ... |
CREATE TABLE actor (
Actor_ID int,
Name text,
Musical_ID int,
Character text,
Duration text,
age int
)
CREATE TABLE musical (
Musical_ID int,
Name text,
Year int,
Award text,
Category text,
Nominee text,
Result text
) | How many actors have appeared in each musical Plot them as bar chart, and order x axis in asc order please. | SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY T2.Name |
CREATE TABLE diagnoses (
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 prescriptions... | what is the minimum age of patients whose admission location is transfer within this facility and diagnosed with primary disease atrial fibrillation\thoracoscopic maze procedure bilateral/sda? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" |
CREATE TABLE table_204_345 (
id number,
"discipline" text,
"amanda" number,
"bernie" number,
"javine h" number,
"julia" number,
"michelle" number
) | what is the first discipline listed on this chart ? | SELECT "discipline" FROM table_204_345 WHERE id = 1 |
CREATE TABLE table_17623902_1 (
original_air_date VARCHAR,
written_by VARCHAR
) | What was the original air date of this episode that was written by Debbie Sarjeant? | SELECT original_air_date FROM table_17623902_1 WHERE written_by = "Debbie Sarjeant" |
CREATE TABLE table_55295 (
"Grid" real,
"Driver" text,
"Constructor" text,
"Qual" real,
"Rank" real,
"Laps" real,
"Time/Retired" text
) | Name the highest grid for Laps more than 137 and rank is less than 8 | SELECT MAX("Grid") FROM table_55295 WHERE "Laps" > '137' AND "Rank" < '8' |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
... | Finding questions having ONLY the given tag. | SELECT Posts.Id, Posts.Id AS "post_link", OwnerUserId AS "user_link", Score, ViewCount, AnswerCount, CreationDate, Tags FROM Posts WHERE Tags = '<##tagname?calculus##>' ORDER BY Posts.LastEditDate |
CREATE TABLE table_name_87 (
points INTEGER,
laps INTEGER
) | What is the average amount of points larger than 154 laps? | SELECT AVG(points) FROM table_name_87 WHERE laps > 154 |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,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,
JO... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the last_name by a bar chart, list by the LAST_NAME from low to high please. | SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME |
CREATE TABLE table_33570 (
"Type" text,
"Suffix" text,
"Valency change" text,
"Example" text,
"Meaning" text
) | What is the example with the associative type? | SELECT "Example" FROM table_33570 WHERE "Type" = 'associative' |
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... | calculate the number of drugs prescribed to patient 006-200601 in a year before. | 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 = '006-200601')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETI... |
CREATE TABLE table_name_6 (
dates VARCHAR,
tournament_location VARCHAR,
champion VARCHAR
) | What dates was champion masahiro kawamura at the ibaraki country club tournament? | SELECT dates FROM table_name_6 WHERE tournament_location = "ibaraki country club" AND champion = "masahiro kawamura" |
CREATE TABLE table_2362606_1 (
score_in_final VARCHAR,
year VARCHAR
) | What was the score in the final in 1988? | SELECT score_in_final FROM table_2362606_1 WHERE year = 1988 |
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
CREATE TABLE Catalog_Contents (
catalog_entry_id INTEGER,
catalog_level_number INTEGER,
parent_entry_id INTEGER,
previous_entry_id INTEGER,
next_entry_id INTEGER,
... | Find the names of catalog entries with level number 8, and count them by a bar chart, I want to show x-axis in desc order. | SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY catalog_entry_name DESC |
CREATE TABLE table_67502 (
"Season" real,
"Cars Entered" real,
"Winning Driver" text,
"Second Driver" text,
"Third Driver" text,
"Race Report" text
) | How many average Cars Entered have a Third Driver of manny ayulo? | SELECT AVG("Cars Entered") FROM table_67502 WHERE "Third Driver" = 'manny ayulo' |
CREATE TABLE table_204_668 (
id number,
"#" number,
"menteri besar" text,
"took office" text,
"left office" text,
"party" text
) | what is the number of menteri besar that served 4 or more years ? | SELECT COUNT("menteri besar") FROM table_204_668 WHERE "left office" - "took office" >= 4 |
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 text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is language and admission time of subject name jesse ran? | SELECT demographic.language, demographic.admittime FROM demographic WHERE demographic.name = "Jesse Ran" |
CREATE TABLE table_name_78 (
fatalities VARCHAR,
time VARCHAR
) | What number of Fatalties is associated with the Time of 12:38:46? | SELECT fatalities FROM table_name_78 WHERE time = "12:38:46" |
CREATE TABLE table_77168 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | On what Date is Game 3 with Boston Road Team? | SELECT "Date" FROM table_77168 WHERE "Road Team" = 'boston' AND "Game" = 'game 3' |
CREATE TABLE table_17596418_4 (
p VARCHAR,
moving_from VARCHAR
) | What is the P for the player moving from Everton? | SELECT p FROM table_17596418_4 WHERE moving_from = "Everton" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.