table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_name_41 (
away_team VARCHAR,
venue VARCHAR
) | who is the away team when played at junction oval? | SELECT away_team FROM table_name_41 WHERE venue = "junction oval" |
CREATE TABLE table_73331 (
"Year" real,
"Division" real,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"National Open" text
) | What league was involved in 2008? | SELECT "League" FROM table_73331 WHERE "Year" = '2008' |
CREATE TABLE table_78597 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is the Place of the Player with a Score of 67? | SELECT "Place" FROM table_78597 WHERE "Score" = '67' |
CREATE TABLE table_name_42 (
color_commentator_s_ VARCHAR,
sideline_reporter_s_ VARCHAR,
year VARCHAR
) | Who was the color commentator for Eric Dickerson and Melissa Stark in 2001? | SELECT color_commentator_s_ FROM table_name_42 WHERE sideline_reporter_s_ = "eric dickerson and melissa stark" AND year = 2001 |
CREATE TABLE table_name_73 (
school VARCHAR,
location VARCHAR
) | Which school is located in trafalgar? | SELECT school FROM table_name_73 WHERE location = "trafalgar" |
CREATE TABLE table_name_40 (
lost INTEGER,
points_1 VARCHAR,
drawn VARCHAR,
goals_against VARCHAR
) | What is the highest lost entry that has a drawn entry less than 6, goals against less than 44, and a points 1 entry of 27? | SELECT MAX(lost) FROM table_name_40 WHERE drawn < 6 AND goals_against < 44 AND points_1 = "27" |
CREATE TABLE table_39710 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the result on October 4, 1993? | SELECT "Result" FROM table_39710 WHERE "Date" = 'october 4, 1993' |
CREATE TABLE table_name_20 (
laps INTEGER,
driver VARCHAR
) | What is the sum of laps for Derek Warwick? | SELECT SUM(laps) FROM table_name_20 WHERE driver = "derek warwick" |
CREATE TABLE table_39003 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text
) | What is the highest round with a guard position and an overall greater than 71? | SELECT MAX("Round") FROM table_39003 WHERE "Position" = 'guard' AND "Overall" > '71' |
CREATE TABLE table_name_85 (
home_team VARCHAR,
venue VARCHAR
) | Windy hill is the home to what team? | SELECT home_team FROM table_name_85 WHERE venue = "windy hill" |
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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | for patients id 2560, specify the icd9 code and primary disease. | SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" |
CREATE TABLE table_203_42 (
id number,
"model" text,
"class" text,
"length" text,
"fuel" text,
"starting price" text
) | what is the price of bot the via and tour models combined ? | SELECT SUM("starting price") FROM table_203_42 WHERE "model" IN ('via', 'tour') |
CREATE TABLE table_1329532_2 (
date_of_election VARCHAR,
elected_successor VARCHAR
) | What was the election date for Arthur Hodges? | SELECT date_of_election FROM table_1329532_2 WHERE elected_successor = "Arthur Hodges" |
CREATE TABLE table_6207 (
"Date" text,
"Episode" real,
"Performer 1" text,
"Performer 2" text,
"Performer 3" text,
"Performer 4" text
) | Who was performer 3 with karen maruyama as performer 2? | SELECT "Performer 3" FROM table_6207 WHERE "Performer 2" = 'karen maruyama' |
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 procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | tell me the dose of ns (syringe) that patient 30267 was prescribed in their last hospital encounter? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30267 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'ns (syringe)' |
CREATE TABLE table_name_15 (
date VARCHAR,
result VARCHAR
) | What was the date of the game with a result of won 4-2? | SELECT date FROM table_name_15 WHERE result = "won 4-2" |
CREATE TABLE table_73999 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Name the result for willis alston | SELECT "Result" FROM table_73999 WHERE "Incumbent" = 'Willis Alston' |
CREATE TABLE documents_with_expenses (
document_id number,
budget_type_code text,
document_details text
)
CREATE TABLE projects (
project_id number,
project_details text
)
CREATE TABLE statements (
statement_id number,
statement_details text
)
CREATE TABLE ref_budget_codes (
budget_ty... | Show all statement id and the number of accounts for each statement. | SELECT statement_id, COUNT(*) FROM accounts GROUP BY statement_id |
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... | what is procedure short title of subject id 8323? | SELECT procedures.short_title FROM procedures WHERE procedures.subject_id = "8323" |
CREATE TABLE table_1646960_3 (
debut_album VARCHAR,
winner VARCHAR
) | How many debut albums did mike mohede have? | SELECT COUNT(debut_album) FROM table_1646960_3 WHERE winner = "Mike Mohede" |
CREATE TABLE table_29566 (
"A\u00f1o" real,
"Trabajo nominado" text,
"Premio" text,
"Categor\u00eda" text,
"Country" text,
"Resultado" text
) | When the a o was 2012, who was the county? | SELECT "Country" FROM table_29566 WHERE "A\u00f1o" = '2012' |
CREATE TABLE table_77175 (
"Season" real,
"League" text,
"Finish" text,
"Wins" real,
"Losses" real,
"Ties" real
) | What league had a finish of 2nd and 3 losses? | SELECT "League" FROM table_77175 WHERE "Finish" = '2nd' AND "Losses" = '3' |
CREATE TABLE table_41555 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
) | What is the city of license that has lp as the class? | SELECT "City of license" FROM table_41555 WHERE "Class" = 'lp' |
CREATE TABLE table_name_90 (
crowd INTEGER,
home_team VARCHAR
) | What is Fitzroy's Home team Crowd? | SELECT SUM(crowd) FROM table_name_90 WHERE home_team = "fitzroy" |
CREATE TABLE table_65573 (
"Week 1" text,
"Week 3" text,
"Week 4" text,
"Week 6" text,
"Week 7" text,
"Week 8" text,
"Week 9" text,
"Week 10" text,
"Final Week 12" text
) | Who did the housemate that nominated Carol Roopali in week 1 nominate in week 8? | SELECT "Week 8" FROM table_65573 WHERE "Week 1" = 'carol roopali' |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents... | what are the four most frequently ordered procedures for patients who were previously diagnosed with pure hypercholesterolem within 2 months, in 2101? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissi... |
CREATE TABLE table_3059 (
"Name of Award" text,
"Name of Film" text,
"Language" text,
"Awardee(s)" text,
"Cash Prize" text
) | Name the total number of awardees for best screenplay | SELECT COUNT("Awardee(s)") FROM table_3059 WHERE "Name of Award" = 'Best Screenplay' |
CREATE TABLE table_name_80 (
olympics_so_far INTEGER,
class VARCHAR,
sailors VARCHAR,
first_og VARCHAR
) | What is the lowest value for Olympics, when Sailors is greater than 1, when First OG is after 1948, and when Class is 'Flying Dutchman'? | SELECT MIN(olympics_so_far) FROM table_name_80 WHERE sailors > 1 AND first_og > 1948 AND class = "flying dutchman" |
CREATE TABLE table_70779 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What is the most points that the Maserati 250F chassis scored in years after 1955? | SELECT MAX("Points") FROM table_70779 WHERE "Chassis" = 'maserati 250f' AND "Year" > '1955' |
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 ... | what is the name of a drug patient 94229 had been prescribed two times in the current hospital encounter? | SELECT t1.drug FROM (SELECT prescriptions.drug, COUNT(prescriptions.startdate) AS c1 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229 AND admissions.dischtime IS NULL) GROUP BY prescriptions.drug) AS t1 WHERE t1.c1 = 2 |
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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, return a line chart about the change of employee_id over hire_date , and list in ascending by the X. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE |
CREATE TABLE table_13796 (
"Name" text,
"Population (2011)" real,
"Population (2006)" text,
"Change (%)" text,
"Land area (km\u00b2)" text,
"Population density (per km\u00b2)" text
) | What population density (per km) that has 84 as the population (2006)? | SELECT "Population density (per km\u00b2)" FROM table_13796 WHERE "Population (2006)" = '84' |
CREATE TABLE table_67358 (
"Image" real,
"Smith" text,
"Ashmolean" real,
"Foster" real,
"Hahland" real,
"Dinsmoor" text,
"Hofkes-Brukker" text,
"Harrison" text,
"Cooper" text,
"BM/Corbett" text
) | What is the number of Ashmolean with 14s Harrison, and image less than 542? | SELECT COUNT("Ashmolean") FROM table_67358 WHERE "Harrison" = '14s' AND "Image" < '542' |
CREATE TABLE table_26385848_1 (
year__ceremony_ VARCHAR,
film_title VARCHAR
) | What is the year (ceremony) for the film title Eldra? | SELECT year__ceremony_ FROM table_26385848_1 WHERE film_title = "Eldra" |
CREATE TABLE table_name_51 (
club_province VARCHAR,
player VARCHAR
) | Name the club/province for steve borthwick | SELECT club_province FROM table_name_51 WHERE player = "steve borthwick" |
CREATE TABLE table_197638_7 (
age VARCHAR,
player VARCHAR
) | How many ages have Maureen Connolly Brinker as the player? | SELECT COUNT(age) FROM table_197638_7 WHERE player = "Maureen Connolly Brinker" |
CREATE TABLE table_37980 (
"Year" text,
"Conference" text,
"Overall Record" text,
"Conference Record" text,
"Coach" text
) | Who was the coach in 1953? | SELECT "Coach" FROM table_37980 WHERE "Year" = '1953' |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | Technology Trends (# Questions per Tag). | SELECT Tags.TagName, Tags.Count FROM Tags WHERE Tags.TagName = 'angularjs' OR Tags.TagName = 'angular' OR Tags.TagName = 'reactjs' OR Tags.TagName = 'vue.js' OR Tags.TagName = 'vuejs2' OR Tags.TagName = 'ember.js' OR Tags.TagName = 'backbone.js' OR Tags.TagName = 'polymer' |
CREATE TABLE order_items (
order_id number,
product_id number,
order_quantity text
)
CREATE TABLE customer_contact_channels (
customer_id number,
channel_code text,
active_from_date time,
active_to_date time,
contact_number text
)
CREATE TABLE customers (
customer_id number,
pa... | Which customer's name contains 'Alex'? Find the full name. | SELECT customer_name FROM customers WHERE customer_name LIKE "%Alex%" |
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... | how many patients whose admission type is elective have got the lab test named sodium, urine done? | 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 = "Sodium, Urine" |
CREATE TABLE table_name_88 (
team_2 VARCHAR,
team_1 VARCHAR
) | Who was Team 2 when Team 1 was Am rica? | SELECT team_2 FROM table_name_88 WHERE team_1 = "américa" |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1... | A bar chart showing the number of male and female faculty, rank y-axis in asc order. | SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY COUNT(*) |
CREATE TABLE table_203_467 (
id number,
"year" number,
"numer of jamaicans\ngranted british\ncitizenship" number,
"naturalisation\nby residence" number,
"naturalisation\nby marriage" number,
"registration\nof a minor child" number,
"registration\nby other means" number
) | how many jamaicans were granted british citizenship in 1998 ? | SELECT "numer of jamaicans\ngranted british\ncitizenship" FROM table_203_467 WHERE "year" = 1998 |
CREATE TABLE table_22551 (
"Nation" text,
"Rider" text,
"Horse" text,
"Cross Country Penalties" text,
"Total Penalties" text,
"Total Team Penalties" text,
"Team Rank" real
) | Which nation is where rider phillip dutton from? | SELECT "Nation" FROM table_22551 WHERE "Rider" = 'Phillip Dutton' |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
... | My own Edits on my posts. | SELECT t.Name, h.CreationDate, PostId AS "post_link" FROM PostHistory AS h JOIN PostHistoryTypes AS t ON t.Id = PostHistoryTypeId WHERE PostId IN (SELECT Id FROM Posts WHERE OwnerUserId = '##UserId##') AND h.UserId = '##UserId##' AND PostHistoryTypeId IN (4, 5, 6, 7, 8, 9) ORDER BY h.CreationDate DESC |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight_stop (
flight_id int,
stop... | please tell me the flights between BOSTON and PHILADELPHIA next thursday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 24 AND date_day.month_number = 5 ... |
CREATE TABLE table_name_70 (
street_address VARCHAR,
floors VARCHAR
) | Which address has 44 floors? | SELECT street_address FROM table_name_70 WHERE floors = 44 |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
Mark... | Answers who's question is tagged 'regex' and is likely just a new regex. | SELECT a.Id AS "post_link", a.Score AS "answer_score", LENGTH(a.Body) AS "answer_length", a.Body AS "answer_body" FROM Posts AS a INNER JOIN Posts AS q ON q.Id = a.ParentId WHERE a.PostTypeId = 2 AND q.Tags LIKE '%<regex>%' AND (a.Body LIKE '<pre><code>%' OR a.Body LIKE '<p><code>%') AND LENGTH(a.Body) <= 100 GROUP BY ... |
CREATE TABLE table_204_200 (
id number,
"iso/iec standard" text,
"title" text,
"status" text,
"description" text,
"wg" number
) | how many iso/iec were published before the year 2000 ? | SELECT COUNT("iso/iec standard") FROM table_204_200 WHERE "status" < 2000 |
CREATE TABLE table_15851155_1 (
enrollment INTEGER,
school VARCHAR
) | Name the minimum enrollment for montana tech of the university of montana | SELECT MIN(enrollment) FROM table_15851155_1 WHERE school = "Montana Tech of the University of Montana" |
CREATE TABLE party_forms (
form_id VARCHAR
)
CREATE TABLE forms (
form_name VARCHAR,
form_id VARCHAR
) | Find the name of the most popular party form. | SELECT t1.form_name FROM forms AS t1 JOIN party_forms AS t2 ON t1.form_id = t2.form_id GROUP BY t2.form_id ORDER BY COUNT(*) DESC LIMIT 1 |
CREATE TABLE table_42152 (
"Location" text,
"Aircraft" text,
"Tail number" text,
"Aircraft damage" text,
"Fatalities" text
) | What tail number was on the an-26, with 25/25 fatalities? | SELECT "Tail number" FROM table_42152 WHERE "Aircraft" = 'an-26' AND "Fatalities" = '25/25' |
CREATE TABLE table_56433 (
"Tournament" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text... | what tournament has 2000 of 3r? | SELECT "Tournament" FROM table_56433 WHERE "2000" = '3r' |
CREATE TABLE table_13944 (
"Rank" real,
"Athlete" text,
"Country" text,
"Time" text,
"Notes" text
) | The Athlete Shin Yeong-eun with a rank larger than 3 and notes of FD had what time? | SELECT "Time" FROM table_13944 WHERE "Rank" > '3' AND "Notes" = 'fd' AND "Athlete" = 'shin yeong-eun' |
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL tex... | Show the draft pick numbers and draft classes of players whose positions are defenders in a bar chart. | SELECT Draft_Class, Draft_Pick_Number FROM match_season WHERE Position = "Defender" |
CREATE TABLE table_7774 (
"Date" text,
"Event" text,
"City" text,
"Oil Pattern" text,
"Winner (Title #)" text,
"Runner-up" text,
"Score" text
) | Who is the runner-up from Milwaukee? | SELECT "Runner-up" FROM table_7774 WHERE "City" = 'milwaukee' |
CREATE TABLE table_72092 (
"District" text,
"Total amount of trees" real,
"Prevailing types, %" text,
"Amount of old trees" text,
"Amount of trees, that require replacement" text
) | What is the amount of trees, that require replacement when the district is motovilikhinsky? | SELECT "Amount of trees, that require replacement" FROM table_72092 WHERE "District" = 'Motovilikhinsky' |
CREATE TABLE table_name_73 (
issue_price INTEGER,
special_notes VARCHAR,
mintage VARCHAR
) | What is the average issue price with from Toronto maple leafs gift set, and a Mintage of 3527? | SELECT AVG(issue_price) FROM table_name_73 WHERE special_notes = "from toronto maple leafs gift set" AND mintage = "3527" |
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,
... | provide the number of patients whose gender is f and procedure short title is iv infusion clofarabine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.short_title = "IV infusion clofarabine" |
CREATE TABLE table_name_4 (
assists VARCHAR,
player VARCHAR
) | How many assists did Steve Walker have? | SELECT assists FROM table_name_4 WHERE player = "steve walker" |
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE... | Show the invoice number and the number of transactions for each invoice. Show the correlation. | SELECT invoice_number, COUNT(*) FROM Financial_Transactions GROUP BY invoice_number |
CREATE TABLE table_name_51 (
round INTEGER,
record VARCHAR
) | Which round has a record of 5-3 (1)? | SELECT MIN(round) FROM table_name_51 WHERE record = "5-3 (1)" |
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 demographic (... | how many patients had iv drip drug route? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.route = "IV DRIP" |
CREATE TABLE table_21017 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"L2 cache" text,
"FSB" text,
"Mult." text,
"Voltage" text,
"TDP" text,
"Socket" text,
"Release date" text,
"Part number(s)" text,
"Release price ( USD )" text
) | Name the fsb for atom z540 | SELECT "FSB" FROM table_21017 WHERE "Model number" = 'Atom Z540' |
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... | Display the proportion of the job title for all those jobs in department 80 using a pie chart. | SELECT JOB_TITLE, COUNT(JOB_TITLE) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.DEPARTMENT_ID = 80 GROUP BY JOB_TITLE |
CREATE TABLE table_name_74 (
rounds VARCHAR,
constructor VARCHAR
) | What rounds did Gordini participate in? | SELECT rounds FROM table_name_74 WHERE constructor = "gordini" |
CREATE TABLE Apartments (
apt_type_code VARCHAR,
room_count INTEGER
) | Show each apartment type code, and the maximum and minimum number of rooms for each type. | SELECT apt_type_code, MAX(room_count), MIN(room_count) FROM Apartments GROUP BY apt_type_code |
CREATE TABLE table_17155250_1 (
language_s_ VARCHAR,
film_title_used_in_nomination VARCHAR
) | What languages were spoken in the film 'FireDancer'? | SELECT language_s_ FROM table_17155250_1 WHERE film_title_used_in_nomination = "FireDancer" |
CREATE TABLE table_203_406 (
id number,
"entrant" text,
"constructor" text,
"chassis" text,
"engine" text,
"tyre" text,
"driver" text,
"rounds" text
) | how many drivers drove all the rounds ? | SELECT COUNT("driver") FROM table_203_406 WHERE "rounds" = 'all' |
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... | what is the total number of patients who had unspecified chronic pulmonary heart disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Chronic pulmonary heart disease, unspecified" |
CREATE TABLE jobs (
job_id text,
job_title text,
min_salary number,
max_salary number
)
CREATE TABLE countries (
country_id text,
country_name text,
region_id number
)
CREATE TABLE regions (
region_id number,
region_name text
)
CREATE TABLE departments (
department_id number,
... | What are the full names and salaries for any employees earning less than 6000? | SELECT first_name, last_name, salary FROM employees WHERE salary < 6000 |
CREATE TABLE table_name_78 (
position VARCHAR,
player VARCHAR
) | What is the position for Jani Lajunen? | SELECT position FROM table_name_78 WHERE player = "jani lajunen" |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Top 50 users from Rajkot. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pune%' OR UPPER(Location) LIKE '%PUNE' ORDER BY Reputation DESC LIMIT 500 |
CREATE TABLE table_name_75 (
losses INTEGER,
season VARCHAR,
draws VARCHAR
) | Which Losses is the lowest one that has a Season smaller than 1920, and Draws larger than 0? | SELECT MIN(losses) FROM table_name_75 WHERE season < 1920 AND draws > 0 |
CREATE TABLE table_52784 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What date did NY Rangers play at home? | SELECT "Date" FROM table_52784 WHERE "Home" = 'ny rangers' |
CREATE TABLE table_11961582_10 (
team VARCHAR,
date VARCHAR
) | Which team was played on April 20? | SELECT team FROM table_11961582_10 WHERE date = "April 20" |
CREATE TABLE table_name_93 (
block_a VARCHAR,
toshizo VARCHAR
) | Name the block A for shuji kondo | SELECT block_a FROM table_name_93 WHERE toshizo = "shuji kondo" |
CREATE TABLE table_28737 (
"School" text,
"Nickname" text,
"Location" text,
"Colors" text,
"Join Date" real
) | Name the colors for north canton | SELECT "Colors" FROM table_28737 WHERE "Location" = 'North Canton' |
CREATE TABLE table_5000 (
"Rank" real,
"Player" text,
"Country" text,
"Earnings ( $ )" real,
"Events" real,
"Wins" real
) | the sum of Events that has a Rank larger than 5 is 3 | SELECT SUM("Events") FROM table_5000 WHERE "Rank" > '5' |
CREATE TABLE table_42106 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What is the Team when antonio davis (8) had the high rebounds? | SELECT "Team" FROM table_42106 WHERE "High rebounds" = 'antonio davis (8)' |
CREATE TABLE table_1000181_1 (
notes VARCHAR,
current_slogan VARCHAR
) | Tell me what the notes are for South Australia | SELECT notes FROM table_1000181_1 WHERE current_slogan = "SOUTH AUSTRALIA" |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of founder and the average of price , and group by attribute founder, sort from high to low by the X-axis please. | SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC |
CREATE TABLE table_204_630 (
id number,
"no" number,
"date" text,
"race" text,
"track" text,
"winner" text,
"reports" text
) | where was the last race listing frank kimmel held ? | SELECT "track" FROM table_204_630 WHERE "winner" = 'frank kimmel' ORDER BY "date" DESC LIMIT 1 |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | what drug was prescribed to patient 005-77687 within the same day after having undergone the oral diuretic - metolazone (zaroxolyn) in a month before? | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-77687') AND treatment.treatme... |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Show weight from each date of birth, and display in descending by the total number. | SELECT Date_of_Birth, Weight FROM people ORDER BY Weight DESC |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostHistory (
Id number,
... | Queries for systemc over time. | SELECT TIME_TO_STR(CreationDate, '%y') * 100 + TIME_TO_STR(CreationDate, '%M') AS yyyymm, COUNT(*) AS cnt FROM Posts AS p INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'systemc' GROUP BY TIME_TO_STR(CreationDate, '%y') * 100 + TIME_TO_STR(CreationDate, '%M') ORD... |
CREATE TABLE table_55048 (
"Name" text,
"Model" text,
"Park" text,
"Opened" text,
"Status" text
) | What is the model for Thor's Hammer which is listed as operating? | SELECT "Model" FROM table_55048 WHERE "Status" = 'operating' AND "Name" = 'thor''s hammer' |
CREATE TABLE table_name_47 (
total_trips__am_pm_ VARCHAR,
operated_by VARCHAR
) | What trips are operated by Atlantic coast charters? | SELECT total_trips__am_pm_ FROM table_name_47 WHERE operated_by = "atlantic coast charters" |
CREATE TABLE table_72391 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | How many incumbents were for district georgia 6? | SELECT COUNT("Incumbent") FROM table_72391 WHERE "District" = 'Georgia 6' |
CREATE TABLE table_name_65 (
grid VARCHAR,
manufacturer VARCHAR,
time_retired VARCHAR
) | What is the grid with a yamaha manufacturer and a +19.435 time/retired? | SELECT grid FROM table_name_65 WHERE manufacturer = "yamaha" AND time_retired = "+19.435" |
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_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
... | Show me the trend about what are all the calendar dates and day Numbers?, rank in descending by the x-axis please. | SELECT Calendar_Date, Day_Number FROM Ref_Calendar ORDER BY Calendar_Date DESC |
CREATE TABLE table_75759 (
"Information" text,
"Altade\u00f1a" text,
"Aprende" text,
"Centennial" text,
"Kyrene MS" text,
"del Pueblo" text
) | Which Centennial has a del Pueblo of 1986? | SELECT "Centennial" FROM table_75759 WHERE "del Pueblo" = '1986' |
CREATE TABLE table_71822 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Which visiting team wound up with a final score of 18-40? | SELECT "Visiting Team" FROM table_71822 WHERE "Final Score" = '18-40' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | since 2105 what are the top four most common drugs prescribed to patients in the same hospital encounter after stress ulcer prophylaxis - famotidine? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'stress ulcer pr... |
CREATE TABLE table_70945 (
"Date enacted" text,
"Normal total" text,
"\u00a726 total" text,
"Ont." text,
"Que." text,
"N.S." text,
"N.B." text
) | Name the normal with que of 24 | SELECT "Normal total" FROM table_70945 WHERE "Que." = '24' |
CREATE TABLE table_name_90 (
bronze VARCHAR,
location VARCHAR
) | Who won the bronze medal in Hiroshima? | SELECT bronze FROM table_name_90 WHERE location = "hiroshima" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | what is the name of the medication that patient 016-30273 was first prescribed in 09/2103? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-30273')) AND STRFTIME('%y-%m', medication.drugstarttime) = '210... |
CREATE TABLE table_name_95 (
downhill VARCHAR,
points VARCHAR
) | What is the 1st run that is down hill less than 46, and 84.45 points? | SELECT 1 AS st_run FROM table_name_95 WHERE downhill < 46 AND points = "84.45" |
CREATE TABLE table_66760 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | What was the time of the person in lane 7? | SELECT "Time" FROM table_66760 WHERE "Lane" = '7' |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE l... | what is the maximum total cost for the hospital involving a procedure called valve replacement or repair - routine during the last year? | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'valve replacement or repair - routine')) AND... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.