table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | You can use a bar chart to show the employees' first name and their manager id as Y, and I want to list by the X-axis in ascending. | SELECT T1.FIRST_NAME, T1.MANAGER_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID ORDER BY T1.FIRST_NAME |
CREATE TABLE table_name_39 (
venue VARCHAR,
position VARCHAR
) | Name the Venue which has a Position of 5th? | SELECT venue FROM table_name_39 WHERE position = "5th" |
CREATE TABLE table_name_21 (
attendance VARCHAR,
time VARCHAR
) | Name the attendance for time of 1:31 | SELECT attendance FROM table_name_21 WHERE time = "1:31" |
CREATE TABLE table_62679 (
"Constituency number" text,
"Name" text,
"Reserved for ( SC / ST /None)" text,
"District" text,
"Number of electorates (2009)" real
) | Bhiwani district have what constituency number? | SELECT "Constituency number" FROM table_62679 WHERE "District" = 'bhiwani' |
CREATE TABLE table_42615 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What are the least Top-5 finish when the events are greater than 18? | SELECT MIN("Top-5") FROM table_42615 WHERE "Events" > '18' |
CREATE TABLE table_name_29 (
top_fives VARCHAR,
year VARCHAR,
wins VARCHAR
) | What is the total number of top fives in 2010 when casey mears had more than 0 wins? | SELECT COUNT(top_fives) FROM table_name_29 WHERE year = "2010" AND wins > 0 |
CREATE TABLE table_44674 (
"Nat." text,
"Name" text,
"Moving to" text,
"Type" text,
"Transfer window" text,
"Transfer fee" text,
"Source" text
) | What was the transfer fee when winter was the transfer window? | SELECT "Transfer fee" FROM table_44674 WHERE "Transfer window" = 'winter' |
CREATE TABLE table_6009 (
"Release date" text,
"Country" text,
"Classifaction" text,
"Publisher" text,
"Format" text,
"Region" text,
"Language" text,
"Sound" text,
"Subtitles" text
) | What language has 20th century fox as the publisher? | SELECT "Language" FROM table_6009 WHERE "Publisher" = '20th century fox' |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | Bar graph to show total number of cloud cover from different date, and show by the Y from low to high. | SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover) |
CREATE TABLE table_74842 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | Which Label has a Region of united states, and a Format of lp album? | SELECT "Label" FROM table_74842 WHERE "Region" = 'united states' AND "Format" = 'lp album' |
CREATE TABLE table_name_94 (
assists VARCHAR,
blocks VARCHAR,
year VARCHAR
) | What is Assists that has a Blocks of 2 tied (1) with a Year larger than 1995 | SELECT assists FROM table_name_94 WHERE blocks = "2 tied (1)" AND year > 1995 |
CREATE TABLE table_name_32 (
driver VARCHAR,
team VARCHAR,
points VARCHAR,
grid VARCHAR
) | Which driver has fewer than 2 points, larger grid that 4 and is on American Spirit Team Johansson? | SELECT driver FROM table_name_32 WHERE points < 2 AND grid > 4 AND team = "american spirit team johansson" |
CREATE TABLE table_name_92 (
date_withdrawn VARCHAR,
date_made VARCHAR
) | What is the withdrawal date associated with a date made of 1904? | SELECT date_withdrawn FROM table_name_92 WHERE date_made = "1904" |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
... | was there any record of the microbiology test for the nasopharynx of patient 031-16123 until 2104? | SELECT COUNT(*) FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123')) AND microlab.culturesite = 'nasopharynx' AND STRFTIME('%y', microlab.... |
CREATE TABLE table_6970 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Which Score has a Tournament of san jose, us (2)? | SELECT "Score" FROM table_6970 WHERE "Tournament" = 'san jose, us (2)' |
CREATE TABLE table_60051 (
"Draft" real,
"Round" text,
"Pick" real,
"Player" text,
"Nationality" text
) | Which Player has a Round of 9, and a Pick of 263? | SELECT "Player" FROM table_60051 WHERE "Round" = '9' AND "Pick" = '263' |
CREATE TABLE table_31995 (
"Year" real,
"Competition" text,
"Date" text,
"Location" text,
"Score" text,
"Result" text
) | Tell me the date for warsaw 1929 | SELECT "Date" FROM table_31995 WHERE "Location" = 'warsaw' AND "Year" = '1929' |
CREATE TABLE table_14727 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | Who is the Home Captain for 23,24,25,26 july 1992? | SELECT "Home captain" FROM table_14727 WHERE "Date" = '23,24,25,26 july 1992' |
CREATE TABLE table_name_94 (
nationality VARCHAR,
round VARCHAR,
college VARCHAR
) | For the draft pick from round 3 out of Mercer College what is the nationality? | SELECT nationality FROM table_name_94 WHERE round = 3 AND college = "mercer" |
CREATE TABLE table_204_778 (
id number,
"code" number,
"county" text,
"former province" text,
"area (km2)" number,
"population\ncensus 2009" number,
"capital" text
) | did mombasa or tana river have a larger population in 2009 ? | SELECT "county" FROM table_204_778 WHERE "county" IN ('mombasa', 'tana river') ORDER BY "population\ncensus 2009" DESC LIMIT 1 |
CREATE TABLE table_59194 (
"Code" real,
"Municipality" text,
"County" text,
"Population" real,
"Total area" text,
"Density (per km 2 land)" real
) | What is the population of Danderyd municipality in Stockholm County with a code lower than 162? | SELECT COUNT("Population") FROM table_59194 WHERE "County" = 'stockholm county' AND "Municipality" = 'danderyd municipality' AND "Code" < '162' |
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type ... | What are the nationalities and the taotal ages of journalists Visualize by a bar chart, I want to show by the total number of age in desc. | SELECT Nationality, SUM(Age) FROM journalist GROUP BY Nationality ORDER BY SUM(Age) DESC |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
sub... | count the number of patients who are dead after being diagnosed with postablat hypothyr nec in the same month in 2105. | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... |
CREATE TABLE table_29126507_1 (
date VARCHAR,
home_team VARCHAR
) | When was the home team Essendon? | SELECT date FROM table_29126507_1 WHERE home_team = "Essendon" |
CREATE TABLE table_name_1 (
driver VARCHAR,
constructor VARCHAR,
time_retired VARCHAR
) | Who was the driver, when the constructor was Renault, and when the Time/Retired was +38.600? | SELECT driver FROM table_name_1 WHERE constructor = "renault" AND time_retired = "+38.600" |
CREATE TABLE table_name_8 (
country VARCHAR,
money___$__ VARCHAR,
score VARCHAR
) | What Country has a Player with Playoff Money with a Score of 72-69-73-73=287? | SELECT country FROM table_name_8 WHERE money___$__ = "playoff" AND score = 72 - 69 - 73 - 73 = 287 |
CREATE TABLE table_name_46 (
series VARCHAR,
director VARCHAR,
title VARCHAR
) | What series has dan povenmire as the director, with museum scream as the title? | SELECT series FROM table_name_46 WHERE director = "dan povenmire" AND title = "museum scream" |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
c... | Next semester , will STDABRD 368 be available ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'STDABRD' AND course.number = 368 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
CREATE TABLE table_name_17 (
overall INTEGER,
college VARCHAR,
round VARCHAR
) | What is the lowest Overall, when College is Hardin-Simmons, and when Round is greater than 26? | SELECT MIN(overall) FROM table_name_17 WHERE college = "hardin-simmons" AND round > 26 |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE student_record (
student_... | What grades did I get in Prof. Seward 's courses ? | SELECT DISTINCT student_record.grade FROM student_record INNER JOIN offering_instructor ON student_record.offering_id = offering_instructor.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE LOWER(instructor.name) LIKE '%Seward%' AND student_record.student_id = 1 |
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 products with a price between 60 and 120, visualize a scatter chart about the correlation between price and manufacturer , and group by attribute name. | SELECT Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name |
CREATE TABLE table_name_26 (
role VARCHAR,
notes VARCHAR,
title VARCHAR
) | What is the name of the role that has a Title of Salud, Dinero y Amor and antagonist in the notes field? | SELECT role FROM table_name_26 WHERE notes = "antagonist" AND title = "salud, dinero y amor" |
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 about the distribution of ACC_Road and Team_ID , and group by attribute ACC_Home in a bar chart. | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | For those dates with a max temperature greater than or equal to 80, I would like a line chart to show the tendency, and order X-axis from low to high order. | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date |
CREATE TABLE table_41110 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | How many losses does corinthians have when they scored over 22 points? | SELECT COUNT("Lost") FROM table_41110 WHERE "Team" = 'corinthians' AND "Points" > '22' |
CREATE TABLE table_name_33 (
meet VARCHAR,
time VARCHAR
) | What is the Meet of the Event with a Time of 7:55.02? | SELECT meet FROM table_name_33 WHERE time = "7:55.02" |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TAB... | SO - Total Posts by Database Server Per Month - MsAccess. | SELECT CONCAT(YEAR(P.CreationDate), '-', MONTH(P.CreationDate)) AS YearMonth, 'MsAccess' AS TagName, COUNT(*) AS PostCount FROM Posts AS P INNER JOIN PostTags AS PT ON (P.Id = PT.PostId) INNER JOIN Tags AS T ON (PT.TagId = T.Id) WHERE T.TagName LIKE 'ms-access%' GROUP BY YEAR(P.CreationDate), MONTH(P.CreationDate) ORDE... |
CREATE TABLE table_49610 (
"Region (year)" text,
"No. 1" text,
"No. 2" text,
"No. 3" text,
"No. 4" text,
"No. 5" text,
"No. 6" text,
"No. 7" text,
"No. 8" text,
"No. 9" text,
"No. 10" text
) | What is No. 10, when No. 1 is Noah, and when No. 9 is Carter? | SELECT "No. 10" FROM table_49610 WHERE "No. 1" = 'noah' AND "No. 9" = 'carter' |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId num... | SELECT * FROM posts WHERE Id < 50000 AND Score >= 5 AND Tags IS NOT NULL. | SELECT * FROM Posts WHERE Id < 50000 AND Score >= 5 AND NOT Tags IS NULL |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
... | provide the number of patients whose procedure long title is removal of t-tube, other bile duct tube, or liver tube and lab test fluid is ascites? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Removal of T-tube, other bile duct tube, or liver tube" AND lab.fluid = "Ascites" |
CREATE TABLE film_market_estimation (
Year VARCHAR,
Market_ID VARCHAR
)
CREATE TABLE market (
Country VARCHAR,
Market_ID VARCHAR
) | Please list the countries and years of film market estimations. | SELECT T2.Country, T1.Year FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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
)
C... | count the number of patients whose year of death is less than or equal to 2158 and drug name is hydralazine hcl? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2158.0" AND prescriptions.drug = "Hydralazine HCl" |
CREATE TABLE table_95 (
"Season" real,
"Driver" text,
"Team" text,
"Engine" text,
"Poles" real,
"Wins" real,
"Podiums" real,
"Points" text,
"Margin of defeat" text
) | Which podiums did the alfa romeo team have? | SELECT "Podiums" FROM table_95 WHERE "Team" = 'Alfa Romeo' |
CREATE TABLE table_73237 (
"Type of aphasia" text,
"Repetition" text,
"Naming" text,
"Auditory comprehension" text,
"Fluency" text
) | Name the naming for fluent and poor comprehension | SELECT "Naming" FROM table_73237 WHERE "Fluency" = 'fluent' AND "Auditory comprehension" = 'poor' |
CREATE TABLE category (
category_id TINYINT UNSIGNED,
name VARCHAR(25),
last_update TIMESTAMP
)
CREATE TABLE film_actor (
actor_id SMALLINT UNSIGNED,
film_id SMALLINT UNSIGNED,
last_update TIMESTAMP
)
CREATE TABLE address (
address_id SMALLINT UNSIGNED,
address VARCHAR(50),
address... | What are the payment dates for any payments that have an amount greater than 10 or were handled by a staff member with the first name Elsa, and count them by a bar chart, I want to sort by the y axis in ascending. | SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) |
CREATE TABLE table_20414 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"Who knows the most about the guest host? panelists" text
) | Name who knows the most about the guest host panels for episode 5 | SELECT "Who knows the most about the guest host? panelists" FROM table_20414 WHERE "Episode Number" = '5' |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufac... | please give me the flight times i would like to fly from BOSTON to BALTIMORE in the morning before 800 | 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_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND flight.departure_time < 800 AND flight.to_airport = AIRPORT_SERVICE_1.airp... |
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... | on the current hospital encounter, was patient 021-95970 at the emergency room? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '021-95970' AND patient.hospitaladmitsource = 'emergency department' AND patient.hospitaldischargetime IS NULL |
CREATE TABLE table_train_218 (
"id" int,
"plasma_glucose_concentration" int,
"c_peptide_level" float,
"body_weight" float,
"diabetic" string,
"single_antigen_b_sab" int,
"low_density_lipoprotein_ldl_cholesterol" int,
"body_mass_index_bmi" float,
"triglyceride_tg" float,
"NOUSE" f... | type i diabetes with c _ peptide < 200 pmol / l and a simultaneous plasma glucose between 60 and 250 mg / dl | SELECT * FROM table_train_218 WHERE diabetic = 'i' AND c_peptide_level < 200 AND (plasma_glucose_concentration >= 60 AND plasma_glucose_concentration <= 250) |
CREATE TABLE table_63195 (
"Artist" text,
"Album" text,
"Track(s)" text,
"Date" text,
"Label" text
) | Which Track(s) is on 18 november 1985? | SELECT "Track(s)" FROM table_63195 WHERE "Date" = '18 november 1985' |
CREATE TABLE table_7241 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What is the date of the 4 strokes margin of victory? | SELECT "Date" FROM table_7241 WHERE "Margin of victory" = '4 strokes' |
CREATE TABLE table_75792 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What is the winning score for the runner-up Ernie Els? | SELECT "Winning score" FROM table_75792 WHERE "Runner(s)-up" = 'ernie els' |
CREATE TABLE table_name_1 (
attendance VARCHAR,
away_team VARCHAR
) | What was the attendance for the game where the away team was Stockport County? | SELECT attendance FROM table_name_1 WHERE away_team = "stockport county" |
CREATE TABLE table_name_43 (
height VARCHAR,
player VARCHAR
) | Which Height has a Player of mike bibby? | SELECT height FROM table_name_43 WHERE player = "mike bibby" |
CREATE TABLE table_77464 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Attendance" real,
"Record" text,
"Points" real
) | What is the Score of the game with a Record of 31 37 9? | SELECT "Score" FROM table_77464 WHERE "Record" = '31–37–9' |
CREATE TABLE table_16543 (
"Year" real,
"Title" text,
"Format" text,
"Studio" text,
"Release Date" text,
"Copyright Information" text,
"Catalog Number" text
) | where title is am/pm callanetics , what are all the copyright information? | SELECT "Copyright Information" FROM table_16543 WHERE "Title" = 'AM/PM Callanetics' |
CREATE TABLE table_203_254 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
) | which point did not accumulate more than 5 points ? | SELECT "team" FROM table_203_254 WHERE "points" <= 5 |
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... | has patient 87733 received a viral warts nos diagnosis until 2 years ago. | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'viral warts nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87733) AND DATETIME(diagnoses_icd.cha... |
CREATE TABLE table_1341453_44 (
first_elected INTEGER,
incumbent VARCHAR
) | What year was Bob Clement first elected? | SELECT MIN(first_elected) FROM table_1341453_44 WHERE incumbent = "Bob Clement" |
CREATE TABLE Customer_Payments (
customer_id INTEGER,
datetime_payment DATETIME,
payment_method_code VARCHAR(10),
amount_payment DOUBLE
)
CREATE TABLE Staff (
staff_id INTEGER,
staff_address_id INTEGER,
nickname VARCHAR(80),
first_name VARCHAR(80),
middle_name VARCHAR(80),
last_... | Visualize a pie chart to show customer status codes and the number of customers having each status code. | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod... | what is the percentile of 32.1 in mch given the same age of patient 91768 during the first hospital visit? | SELECT DISTINCT t1.c1 FROM (SELECT labevents.valuenum, PERCENT_RANK() OVER (ORDER BY labevents.valuenum) AS c1 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age = (SE... |
CREATE TABLE table_name_7 (
grid INTEGER,
rider VARCHAR,
laps VARCHAR,
bike VARCHAR
) | What is the average Grid, when Laps is less than 24, when Bike is 'Honda CBR1000RR', and when Rider is 'Jason Pridmore'? | SELECT AVG(grid) FROM table_name_7 WHERE laps < 24 AND bike = "honda cbr1000rr" AND rider = "jason pridmore" |
CREATE TABLE table_8592 (
"Track Name" text,
"Location" text,
"Length" text,
"Sanction" text,
"Program" text
) | What is the length of the track located in Taylorville, Illinois? | SELECT "Length" FROM table_8592 WHERE "Location" = 'taylorville, illinois' |
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 demographic ... | how many patients are below 89 years of age and stayed in hospital for more than 34 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "89" AND demographic.days_stay > "34" |
CREATE TABLE table_204_277 (
id number,
"region" text,
"country" text,
"location" text,
"size (m)" text,
"payload (metric tonnes)" text,
"degrees of freedom" number,
"x horiz disp (mm)" number,
"y horiz disp (mm)" number,
"z vert disp (mm)" number,
"x horiz vel (mm/s)" number... | how long is the size -lrb- m -rrb- of algeria ? | SELECT "size (m)" FROM table_204_277 WHERE "country" = 'algeria' |
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age... | Show different nationalities along with the number of hosts of each nationality in a bar chart. | SELECT Nationality, COUNT(*) FROM host GROUP BY Nationality |
CREATE TABLE employment (
Company_ID int,
People_ID int,
Year_working int
)
CREATE TABLE company (
Company_ID real,
Name text,
Headquarters text,
Industry text,
Sales_in_Billion real,
Profits_in_Billion real,
Assets_in_Billion real,
Market_Value_in_Billion real
)
CREATE TAB... | Return a bar chart about the number of companies for each industry, order bar in asc order. | SELECT Industry, COUNT(Industry) FROM company GROUP BY Industry ORDER BY Industry |
CREATE TABLE table_name_99 (
winning_driver VARCHAR,
date VARCHAR
) | Who won the race on 24 August? | SELECT winning_driver FROM table_name_99 WHERE date = "24 august" |
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,
... | what is the number of patients whose admission type is emergency and procedure icd9 code is 4576? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "4576" |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Silver Tag Badges by Country. Find people with a tag-based silver badge in a certain country.
Useful to search experts on a given subject. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Users.Id AS "user_link", Reputation, Location FROM Users, Badges WHERE LOWER(Users.Location) LIKE LOWER('%##CountryName##%') AND Users.Id = Badges.UserId AND Badges.Class = 2 AND Badges.TagBased = 1 AND LOWER(Badges.Name) = LOWER('##TagName##') ORDER BY Reputa... |
CREATE TABLE table_15017024_2 (
college VARCHAR,
pick VARCHAR
) | How many colleges did the player picked 57 attend? | SELECT COUNT(college) FROM table_15017024_2 WHERE pick = 57 |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | what number of patients born before the year 2065 had lab test item id 51516? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2065" AND lab.itemid = "51516" |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
avail... | Show me a line chart of how how many booking end date change over the booking end date, I want to sort by the x axis in asc. | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date ORDER BY booking_end_date |
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text... | i'd like a cheap flight from DALLAS to BALTIMORE on 1 1 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da... |
CREATE TABLE table_203_104 (
id number,
"athlete" text,
"nation" text,
"olympics" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many more silver medals did gillis grafstr m have compared to sonja henie ? | SELECT (SELECT "silver" FROM table_203_104 WHERE "athlete" = 'gillis grafstrom') - (SELECT "silver" FROM table_203_104 WHERE "athlete" = 'sonja henie') |
CREATE TABLE table_4995 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | what is the sum of attendance of week 11 | SELECT SUM("Attendance") FROM table_4995 WHERE "Week" = '11' |
CREATE TABLE table_name_40 (
year INTEGER,
director VARCHAR,
english_title VARCHAR
) | What is the submission Year of the Film The Dark Side of the Moon directed by Erik Clausen? | SELECT SUM(year) FROM table_name_40 WHERE director = "erik clausen" AND english_title = "the dark side of the moon" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | how many times have patient 030-3372's been to intensive care unit in 2101? | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-3372') AND STRFTIME('%y', patient.unitadmittime) = '2101' |
CREATE TABLE table_7251 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What is the Song choice when Elaine Paige was the Original artist? | SELECT "Song choice" FROM table_7251 WHERE "Original artist" = 'elaine paige' |
CREATE TABLE media_types (
id INTEGER,
name VARCHAR(120)
)
CREATE TABLE customers (
id INTEGER,
first_name VARCHAR(40),
last_name VARCHAR(20),
company VARCHAR(80),
address VARCHAR(70),
city VARCHAR(40),
state VARCHAR(40),
country VARCHAR(40),
postal_code VARCHAR(10),
pho... | What are the names of all the playlists, and count them by a bar chart | SELECT name, COUNT(name) FROM playlists GROUP BY name |
CREATE TABLE table_name_15 (
week VARCHAR,
date VARCHAR,
attendance VARCHAR
) | In which week was the game played on October 12, 1975 and the crowd was larger than 44,043? | SELECT COUNT(week) FROM table_name_15 WHERE date = "october 12, 1975" AND attendance > 44 OFFSET 043 |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | Find the distinct majors of students who have treasurer votes. | SELECT DISTINCT T1.major FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = T2.treasurer_vote |
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
) | What are the number of the names of products with price at most 200? | SELECT Name, COUNT(Name) FROM Products WHERE Price <= 200 GROUP BY Name |
CREATE TABLE table_name_95 (
rank INTEGER
) | What is the highest rank of the 2009 xbox? | SELECT MAX(rank) FROM table_name_95 WHERE 2009 = "xbox" |
CREATE TABLE table_name_26 (
player VARCHAR,
position VARCHAR
) | What player plays the position of small forward? | SELECT player FROM table_name_26 WHERE position = "small forward" |
CREATE TABLE table_27208814_1 (
original_airdate VARCHAR,
writer VARCHAR,
director VARCHAR
) | Name the original airdate for robin mukherjee and margy kinmonth | SELECT original_airdate FROM table_27208814_1 WHERE writer = "Robin Mukherjee" AND director = "Margy Kinmonth" |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category 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,... | For upper level courses , which does Cremonini teach ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.ins... |
CREATE TABLE table_name_30 (
competition VARCHAR,
score VARCHAR
) | In what competition was the score reported as 12.8 (80) - 8.7 (55)? | SELECT competition FROM table_name_30 WHERE score = "12.8 (80) - 8.7 (55)" |
CREATE TABLE table_79030 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | With Olympic Bronze Medalist as the total what are the score points? | SELECT "Score points" FROM table_79030 WHERE "Total" = 'olympic bronze medalist' |
CREATE TABLE table_74532 (
"Place" real,
"Rider" text,
"Country" text,
"Machine" text,
"Speed" text,
"Time" text,
"Points" real
) | Which places have points larger than 10? | SELECT MIN("Points") FROM table_74532 WHERE "Place" > '10' |
CREATE TABLE table_name_25 (
score VARCHAR,
att VARCHAR
) | What was the score for the matchup having attendance of 354? | SELECT score FROM table_name_25 WHERE att = 354 |
CREATE TABLE table_name_86 (
drawn INTEGER,
played VARCHAR,
diff VARCHAR,
points VARCHAR
) | What is the maximum number of draws when the diff is smaller than 186, points are fewer than 12 and games played fewer than 6? | SELECT MAX(drawn) FROM table_name_86 WHERE diff < 186 AND points < 12 AND played < 6 |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
row_id number,
subject_id num... | what were the three most common diagnoses for patients who were aged 20s in 2103? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | Draw a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, and I want to list by the X in descending. | SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | what is the average daily number of patients with blood in stool diagnosed since 6 years ago? | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'blood in stool') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year') GROUP BY... |
CREATE TABLE table_name_13 (
h_a_n VARCHAR,
score VARCHAR
) | Which H/A/N has a score of 105* ? | SELECT h_a_n FROM table_name_13 WHERE score = "105*♠" |
CREATE TABLE table_27201 (
"#" real,
"Episode" text,
"Air Date" text,
"Timeslot (EST)" text,
"Rating" text,
"Share" real,
"18-49 (Rating/Share)" text,
"Viewers (m)" text,
"Weekly Rank (#)" text
) | What is the share value of the episode 'sins of the father | SELECT MAX("Share") FROM table_27201 WHERE "Episode" = 'Sins of the Father' |
CREATE TABLE table_60599 (
"Title" text,
"Lyricist(s)" text,
"Composer(s)" text,
"Arranger(s)" text,
"Time" text
) | Who was the lyricist for composer Haewon Park? | SELECT "Lyricist(s)" FROM table_60599 WHERE "Composer(s)" = 'haewon park' |
CREATE TABLE table_name_44 (
distance VARCHAR,
speed VARCHAR
) | How far did the pilot go when averaging 124.1km/h? | SELECT distance FROM table_name_44 WHERE speed = "124.1km/h" |
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, show me about the correlation between manufacturer and code , and group by attribute headquarter in a scatter chart. | SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.