table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE papers (
Id VARCHAR
) | How many papers are published in total? | SELECT COUNT(*) FROM papers |
CREATE TABLE table_name_18 (
keynote_version INTEGER,
numbers_version VARCHAR,
pages_version VARCHAR
) | What's the latest keynote version of version 2.3 of numbers with pages greater than 4.3? | SELECT MAX(keynote_version) FROM table_name_18 WHERE numbers_version = "2.3" AND pages_version > 4.3 |
CREATE TABLE table_name_58 (
attendance INTEGER,
home_team VARCHAR
) | What was the Attendance when Oxford United was the Home team? | SELECT SUM(attendance) FROM table_name_58 WHERE home_team = "oxford united" |
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_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE transfers (
r... | what is patient 72107's length of stay in the icu for the first time? | SELECT STRFTIME('%j', icustays.outtime) - STRFTIME('%j', icustays.intime) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72107) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1 |
CREATE TABLE table_12023 (
"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 score when the home team is Collingwood? | SELECT "Home team score" FROM table_12023 WHERE "Home team" = 'collingwood' |
CREATE TABLE table_38159 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | What is the Country when the IATA shows cju? | SELECT "Country" FROM table_38159 WHERE "IATA" = 'cju' |
CREATE TABLE table_name_62 (
chassis VARCHAR,
rounds VARCHAR,
driver VARCHAR
) | What is the name of the Chassis of Diver Maria Teresa de Filippis in round 1? | SELECT chassis FROM table_name_62 WHERE rounds = "1" AND driver = "maria teresa de filippis" |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id... | Get country tags and their frequency. | SELECT Tags.TagName, COUNT(PostTags.TagId) AS no FROM PostTags, Tags WHERE Tags.Id = PostTags.TagId AND TagName = 'france' GROUP BY TagName ORDER BY no DESC |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | what was the yearly average dose of vascular 5 flush amount (ml) that patient 021-111547 was taking since 04/2105? | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547')) AND intakeoutput.celllabel = 'vasc... |
CREATE TABLE table_name_73 (
branding VARCHAR,
callsign VARCHAR
) | What is Branding, when Callsign is 'DXED-TV'? | SELECT branding FROM table_name_73 WHERE callsign = "dxed-tv" |
CREATE TABLE table_name_75 (
first_elected INTEGER,
district VARCHAR
) | What is the average first elected for the district South Carolina 2? | SELECT AVG(first_elected) FROM table_name_75 WHERE district = "south carolina 2" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid numb... | what are the three drugs that are prescribed the most frequently in 2104? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE STRFTIME('%y', medication.drugstarttime) = '2104' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 3 |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimme... | Show me about the distribution of meter_300 and ID in a bar chart, could you order by the y-axis in descending? | SELECT meter_300, ID FROM swimmer ORDER BY ID DESC |
CREATE TABLE table_1415 (
"Country" text,
"Freedom in the World 2013" text,
"2013 Index of Economic Freedom" text,
"2013 Press Freedom Index" text,
"2012 Democracy Index" text
) | How much freedom can did the people of Guinea experience in 2013? | SELECT "Freedom in the World 2013" FROM table_1415 WHERE "Country" = 'Guinea' |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | Is there a course that can help prepare me for PIBS 507 ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'PIBS' AND number = 507 |
CREATE TABLE table_19810459_1 (
result VARCHAR,
background VARCHAR
) | What was the result for the contestant whose background was as a business major? | SELECT result FROM table_19810459_1 WHERE background = "Business major" |
CREATE TABLE table_60545 (
"Name" text,
"Pos." text,
"Height" text,
"Weight" text,
"Date of Birth" text,
"Club" text
) | What is Eftychia Karagianni Pos.? | SELECT "Pos." FROM table_60545 WHERE "Name" = 'eftychia karagianni' |
CREATE TABLE table_15053 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What is the loss for the record of 42-36? | SELECT "Loss" FROM table_15053 WHERE "Record" = '42-36' |
CREATE TABLE table_name_79 (
grid INTEGER,
team VARCHAR,
points VARCHAR
) | What is the smallest grid value that had 16 points and a team of Mi-Jack Conquest Racing? | SELECT MIN(grid) FROM table_name_79 WHERE team = "mi-jack conquest racing" AND points = "16" |
CREATE TABLE table_40561 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the sum of Events when the top-25 is more than 5, and the top-10 is less than 4, and wins is more than 2? | SELECT SUM("Events") FROM table_40561 WHERE "Top-25" > '5' AND "Top-10" < '4' AND "Wins" > '2' |
CREATE TABLE table_11786 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the lowest crowd when essendon is the away team? | SELECT MIN("Crowd") FROM table_11786 WHERE "Away team" = 'essendon' |
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 state (
state_code text,
state_name text,
country_name text
)
CREATE T... | what LIMOUSINE service in LOS ANGELES | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'LOS ANGELES' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'LIMOUSINE' |
CREATE TABLE table_name_17 (
country VARCHAR,
player VARCHAR
) | What country does Tiger Woods play for? | SELECT country FROM table_name_17 WHERE player = "tiger woods" |
CREATE TABLE table_42245 (
"Event" text,
"Record" text,
"Nation" text,
"Date" text,
"Venue" text
) | Which Event has a Record of 4:02.54? | SELECT "Event" FROM table_42245 WHERE "Record" = '4:02.54' |
CREATE TABLE table_19791 (
"Year" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | who is the the womens doubles with mens doubles being reinhold pum karl buchart and mixed doubles being hermann fr hlich lore voit | SELECT "Womens doubles" FROM table_19791 WHERE "Mens doubles" = 'Reinhold Pum Karl Buchart' AND "Mixed doubles" = 'Hermann Fröhlich Lore Voit' |
CREATE TABLE table_24188 (
"No in Series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | How many original air dates were there for episodes with a production code of 4398016? | SELECT COUNT("Original air date") FROM table_24188 WHERE "Production code" = '4398016' |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number... | Select TagName From Tags Order By Count Asc. | SELECT TagName FROM Tags ORDER BY Count |
CREATE TABLE invoices (
invoice_number number,
invoice_date time,
invoice_details text
)
CREATE TABLE shipment_items (
shipment_id number,
order_item_id number
)
CREATE TABLE order_items (
order_item_id number,
product_id number,
order_id number,
order_item_status text,
order_i... | Find the names of the customers who have order status both 'On Road' and 'Shipped'. | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "On Road" INTERSECT SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T2.order_status = "Shipped" |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Return a bar chart about the distribution of ACC_Road and Team_ID , and group by attribute All_Home. | SELECT ACC_Road, Team_ID FROM basketball_match GROUP BY All_Home, ACC_Road |
CREATE TABLE table_16046689_29 (
bowl_game VARCHAR,
city VARCHAR
) | What is the name of the bowl game that was played in Tempe, Arizona? | SELECT bowl_game FROM table_16046689_29 WHERE city = "Tempe, Arizona" |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
) | Return a histogram on what are the names and seatings for all tracks opened after 2000, ordered by seating? | SELECT Name, Seating FROM track WHERE Year_Opened > 2000 ORDER BY Seating |
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age text
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_host... | Show the total number of the first year of parties with the theme 'Spring' or 'Teqnology' with a bar chart, bin the first year into weekday interval and count the first year, and I want to display y axis from low to high order. | SELECT First_year, COUNT(First_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" ORDER BY COUNT(First_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... | provide the number of patients whose ethnicity is white and year of birth is less than 2058? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.dob_year < "2058" |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Which classes are required to declare MODGREEK my major ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%MODGREEK%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
... | Given 452 and 473 , which course is harder ? | SELECT DISTINCT course.number FROM course, program_course WHERE (course.number = 452 OR course.number = 473) AND course.department = 'EECS' AND program_course.course_id = course.course_id ORDER BY program_course.workload DESC LIMIT 1 |
CREATE TABLE table_name_87 (
author VARCHAR,
first_issue VARCHAR
) | What is the Author of the Title with a First Issue of September 2010? | SELECT author FROM table_name_87 WHERE first_issue = "september 2010" |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | calculate the number of patients who had had a -eos lab test until 2102. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = '-eos' AND STRFTIME('%y', lab.labresulttime) <= '2102') |
CREATE TABLE table_name_1 (
city_of_license VARCHAR,
frequency VARCHAR
) | Tell me the city of license for 0 106.9 fm | SELECT city_of_license FROM table_name_1 WHERE frequency = "0 106.9 fm" |
CREATE TABLE table_name_36 (
rank INTEGER,
notes VARCHAR,
time VARCHAR
) | What is the rank of the athletes that have Notes of fb, and a Time of 6:47.30? | SELECT SUM(rank) FROM table_name_36 WHERE notes = "fb" AND time = "6:47.30" |
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,
... | find the average age of female patients with death status 1. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.expire_flag = "1" |
CREATE TABLE table_17467447_1 (
original_airdate VARCHAR,
us_viewers__million_ VARCHAR
) | What is the air date when the U.S. viewers was 5.50 million? | SELECT original_airdate FROM table_17467447_1 WHERE us_viewers__million_ = "5.50" |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | What are the EECS major 's ULCS courses ? | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%EECS%' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
CREATE TABLE table_46004 (
"Position" real,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the average number played that has fewer than 11 wins, more than 42 goals, more than 22 points, and 11 losses? | SELECT AVG("Played") FROM table_46004 WHERE "Wins" < '11' AND "Goals for" > '42' AND "Points" > '22' AND "Losses" = '11' |
CREATE TABLE table_58899 (
"Glenelg FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | How many byes were then when there were less than 737 against? | SELECT SUM("Byes") FROM table_58899 WHERE "Against" < '737' |
CREATE TABLE table_27290 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the district for mike rogers | SELECT "District" FROM table_27290 WHERE "Incumbent" = 'Mike Rogers' |
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,
... | give me the number of patients whose year of death is less than or equal to 2126 and procedure short title is umbilical vein cath? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.short_title = "Umbilical vein cath" |
CREATE TABLE table_58546 (
"Awards" text,
"Year" real,
"Category" text,
"Result" text,
"Production" text,
"Roll" text
) | What category was nominated in 2010 fo the British Soap Awards? | SELECT "Category" FROM table_58546 WHERE "Year" = '2010' AND "Result" = 'nominated' AND "Awards" = 'british soap awards' |
CREATE TABLE table_name_51 (
staffel_d VARCHAR,
staffel_e VARCHAR,
season VARCHAR
) | What is the Staffel D in the season 1983-84 with a Staffel E of Motor Suhl? | SELECT staffel_d FROM table_name_51 WHERE staffel_e = "motor suhl" AND season = "1983-84" |
CREATE TABLE table_46667 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Average 1" real,
"Points 2" real
) | For a team having goals for more than 95, what is the lowest position? | SELECT MIN("Position") FROM table_46667 WHERE "Goals For" > '95' |
CREATE TABLE table_name_62 (
constituency_number VARCHAR,
name VARCHAR
) | What is the Constituency number for Pandhana? | SELECT constituency_number FROM table_name_62 WHERE name = "pandhana" |
CREATE TABLE table_7483 (
"Year" real,
"Events played" real,
"Cuts made" real,
"Wins" real,
"2nds" real,
"Top 10s" real,
"Best finish" text,
"Earnings ($)" real,
"Rank" text,
"Scoring average" real,
"Scoring rank" text
) | What is the total number of Wins when 98 is the rank and the scoring average is more than 73.52? | SELECT COUNT("Wins") FROM table_7483 WHERE "Rank" = '98' AND "Scoring average" > '73.52' |
CREATE TABLE swimmer (
nationality VARCHAR
) | List countries that have more than one swimmer. | SELECT nationality, COUNT(*) FROM swimmer GROUP BY nationality HAVING COUNT(*) > 1 |
CREATE TABLE table_71781 (
"Date" text,
"Region" text,
"Label" text,
"Catalogue" text,
"Format" text
) | Which label is from the Germany region? | SELECT "Label" FROM table_71781 WHERE "Region" = 'germany' |
CREATE TABLE table_72918 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
) | What is the status(es) of the place with an area of 304.06 km2? | SELECT "Status" FROM table_72918 WHERE "Area km 2" = '304.06' |
CREATE TABLE table_name_38 (
average_ratings VARCHAR,
episodes VARCHAR,
japanese_title VARCHAR
) | What is average ratings for Japanese title of , with episodes larger than 9? | SELECT average_ratings FROM table_name_38 WHERE episodes > 9 AND japanese_title = "ホタルノヒカリ" |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9cod... | what was the name of the output, which patient 027-82318 had first during a day before? | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318')) AND intakeoutput.cellpath LIKE '%output%' AND D... |
CREATE TABLE table_22728 (
"Name" text,
"Population (2011)" real,
"Population (2006)" real,
"Change (%)" text,
"Land area (km\u00b2)" text,
"Population density (per km\u00b2)" text
) | When 4.5 is the percentage of change how many population counts were made for 2011? | SELECT COUNT("Population (2011)") FROM table_22728 WHERE "Change (%)" = '4.5' |
CREATE TABLE table_204_659 (
id number,
"seat" text,
"state" text,
"majority" number,
"member" text,
"party" text
) | what is the name of the last seat ? | SELECT "seat" FROM table_204_659 ORDER BY id DESC LIMIT 1 |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostsWit... | Top Moroccan Dev in stack (Java, React, Spring). | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", DisplayName, WebsiteUrl, Reputation FROM Users AS u INNER JOIN Comments AS c ON c.UserId = u.Id INNER JOIN Posts AS p ON p.Id = c.PostId INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE (UPPER(Tag... |
CREATE TABLE table_name_52 (
directed_by VARCHAR,
written_by VARCHAR,
original_airdate VARCHAR
) | Who directed the episode written by Dan Serafin and aired on July 23, 2008? | SELECT directed_by FROM table_name_52 WHERE written_by = "dan serafin" AND original_airdate = "july 23, 2008" |
CREATE TABLE table_36233 (
"Frequency" real,
"Callsign" text,
"Brand" text,
"City of License" text,
"Website" text,
"Webcast" text
) | Which Callsign includes a frequency under 1210, Newsradio 740 KTRH, and webcasts with listen live? | SELECT "Callsign" FROM table_36233 WHERE "Webcast" = 'listen live' AND "Frequency" < '1210' AND "Brand" = 'newsradio 740 ktrh' |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_i... | the number of patients in ward 45 until 2100? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 45 AND STRFTIME('%y', transfers.intime) <= '2100') |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location... | what is the top five most frequently prescribed drugs that were prescribed to patients within 2 months after being diagnosed with cytomegaloviral disease in this year? | SELECT t3.drug FROM (SELECT t2.drug, 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 = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ... |
CREATE TABLE table_36757 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What are the highest number of games drawn for games numbered under 6? | SELECT MAX("Drawn") FROM table_36757 WHERE "Games" < '6' |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TAB... | Are the upper-level classes all 17 credits ? | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 17 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(15),
customer_number VARCHAR(20),
customer_name VARCHAR(80),
customer_address VARCHAR(255),
customer_phone VARCHAR(80),
customer_email VARCHAR(80)
)
CREATE TABLE Contacts (
contact_id INTEGER,
customer_id INTE... | Show the number of customer address history in each day and bin date to by weekday with a bar chart. | SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id |
CREATE TABLE table_30049462_8 (
game VARCHAR,
score VARCHAR
) | Name the game for l 111 126 | SELECT game FROM table_30049462_8 WHERE score = "L 111–126" |
CREATE TABLE table_name_34 (
opponent VARCHAR,
attendance VARCHAR
) | Who was the opponent at the game attended by 62,657? | SELECT opponent FROM table_name_34 WHERE attendance = "62,657" |
CREATE TABLE table_12564633_1 (
series__number INTEGER,
season__number VARCHAR
) | What is the series number for Season #18? | SELECT MIN(series__number) FROM table_12564633_1 WHERE season__number = 18 |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the number of patients whose days of hospital stay is greater than 29 and item id is 50995? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "29" AND lab.itemid = "50995" |
CREATE TABLE table_41592 (
"Animal" text,
"Cell type" text,
"Resting potential (mV)" text,
"AP increase (mV)" text,
"AP duration (ms)" text,
"Conduction speed (m/s)" text
) | Which animal has an AP duration of 1.0 and a conduction speed of 7 30? | SELECT "Animal" FROM table_41592 WHERE "AP duration (ms)" = '1.0' AND "Conduction speed (m/s)" = '7–30' |
CREATE TABLE table_name_72 (
score VARCHAR,
place VARCHAR,
player VARCHAR
) | What was Laura Diaz's score for place t9? | SELECT score FROM table_name_72 WHERE place = "t9" AND player = "laura diaz" |
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... | What is the drug type of LR? | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "LR" |
CREATE TABLE table_2201724_1 (
year INTEGER
) | What is Fred Stolle's final year of competing in a championship? | SELECT MAX(year) FROM table_2201724_1 |
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Do all upper-level classes have exams ? | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
... | has patient 83499 gone through any lab test since 1 year ago? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83499) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-1 year') |
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Employees (
Employee_ID INTEGER,
Role_Code CHAR(15),
Employee_Name VARCHAR(255),
Gender_MFU CHAR(1),
Date_of_Birth DATETIME,
Other_De... | Return a scatter chart on what are the id of each employee and the number of document destruction authorised by that employee? | SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destruction_Authorised_by_Employee_ID |
CREATE TABLE table_22647 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Dolphins points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) | What is the date when the opponent is the New England Patriots? | SELECT "Date" FROM table_22647 WHERE "Opponent" = 'New England Patriots' |
CREATE TABLE table_name_69 (
year VARCHAR,
hungarian_top_40_album_charts VARCHAR
) | What year had the Hungarian top 40 album charts of 3? | SELECT year FROM table_name_69 WHERE hungarian_top_40_album_charts = "3" |
CREATE TABLE table_3359 (
"Total" real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Canadian air date" text,
"UK air date" text,
"Canadian Viewers (millions)" text
) | If the director is Yannick Bisson, what was the Canadian amount of viewers? | SELECT COUNT("Canadian Viewers (millions)") FROM table_3359 WHERE "Directed by" = 'Yannick Bisson' |
CREATE TABLE table_20391799_1 (
withdrawn INTEGER,
ltsr_no VARCHAR
) | Name the most withdrawn for 37 lstr no. | SELECT MAX(withdrawn) FROM table_20391799_1 WHERE ltsr_no = 37 |
CREATE TABLE table_name_17 (
top_25 INTEGER,
top_10 VARCHAR,
events VARCHAR
) | What is the highest top-25 with more than 9 top-10 but less than 29 events? | SELECT MAX(top_25) FROM table_name_17 WHERE top_10 > 9 AND events < 29 |
CREATE TABLE table_name_13 (
free VARCHAR,
ku VARCHAR,
genitive_1 VARCHAR
) | Which Free polite has a Genitive 1 of *=ku? | SELECT free AS polite FROM table_name_13 WHERE genitive_1 = * = ku |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service... | please give me the flights from BOSTON to PITTSBURGH on thursday of next week | 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 = 'PITTSBURGH' AND date_day.day_number = 24 AND date_day.month_number = 5 AN... |
CREATE TABLE table_10915 (
"Matches" real,
"Innings" real,
"Not Outs" real,
"Runs" real,
"Average" real
) | What is the lowest number of Not Outs when there were more than 25 innings? | SELECT MIN("Not Outs") FROM table_10915 WHERE "Innings" > '25' |
CREATE TABLE constructors (
constructorId INTEGER,
constructorRef TEXT,
name TEXT,
nationality TEXT,
url TEXT
)
CREATE TABLE lapTimes (
raceId INTEGER,
driverId INTEGER,
lap INTEGER,
position INTEGER,
time TEXT,
milliseconds INTEGER
)
CREATE TABLE driverStandings (
driv... | What are the ids and locations of all circuits in France or Belgium Show bar chart, and order in asc by the Y. | SELECT location, circuitId FROM circuits WHERE country = "France" OR country = "Belgium" ORDER BY circuitId |
CREATE TABLE table_1341663_44 (
incumbent VARCHAR,
district VARCHAR
) | What was the incumbent for texas 19? | SELECT incumbent FROM table_1341663_44 WHERE district = "Texas 19" |
CREATE TABLE table_54299 (
"Date" text,
"Tournament" text,
"Winning score" text,
"Margin of victory" text,
"Runner(s)-up" text
) | Who is the runner(s)-up for a winning score of 3 (71-74-66-66=277)? | SELECT "Runner(s)-up" FROM table_54299 WHERE "Winning score" = '−3 (71-74-66-66=277)' |
CREATE TABLE table_14558 (
"Opponent" text,
"OVERALL" text,
"HOME" text,
"AWAY" text,
"PLYFF" text
) | Which team has an overall playoff of (0-0), a home record of (0-1) and played the Green Bay Blizzard team? | SELECT "OVERALL" FROM table_14558 WHERE "PLYFF" = '(0-0)' AND "HOME" = '(0-1)' AND "Opponent" = 'green bay blizzard' |
CREATE TABLE competition (
competition_id number,
year number,
competition_type text,
country text
)
CREATE TABLE competition_result (
competition_id number,
club_id_1 number,
club_id_2 number,
score text
)
CREATE TABLE player (
player_id number,
name text,
position text,
... | List the types of competition that have at most five competitions of that type. | SELECT competition_type FROM competition GROUP BY competition_type HAVING COUNT(*) <= 5 |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | count the number of patients whose admission type is emergency and drug route is ih? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND prescriptions.route = "IH" |
CREATE TABLE table_name_35 (
attendance INTEGER,
loss VARCHAR
) | What is the largest Attendance with a Loss of darling (0 1)? | SELECT MAX(attendance) FROM table_name_35 WHERE loss = "darling (0–1)" |
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 ... | how big is the difference in patient 6536's weight second measured on the last hospital visit compared to the first value measured on the last hospital visit? | SELECT (SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6536 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1)) AND cha... |
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 diagnoses (
... | how many patients whose insurance is self pay and days of hospital stay is greater than 26? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "26" |
CREATE TABLE table_name_61 (
try_bonus VARCHAR,
points_against VARCHAR
) | What Try bonus has a Points against of 488? | SELECT try_bonus FROM table_name_61 WHERE points_against = "488" |
CREATE TABLE table_name_18 (
coach VARCHAR,
ncaa VARCHAR,
losses VARCHAR,
conference_titles VARCHAR,
seasons VARCHAR
) | Which coach has 0 conference titles, more than 2 seasons, higher than 87 losses and 0 NCAA? | SELECT coach FROM table_name_18 WHERE conference_titles = "0" AND seasons > 2 AND losses > 87 AND ncaa = "0" |
CREATE TABLE table_24329520_8 (
county VARCHAR,
borough VARCHAR,
members VARCHAR,
franchise_type VARCHAR
) | Which county has a membership of 1, a franchise type of corporation and a borough of Ennis? | SELECT county FROM table_24329520_8 WHERE members = 1 AND franchise_type = "Corporation" AND borough = "Ennis" |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTask... | Synonims created via 4 votes. | SELECT * FROM TagSynonyms WHERE Score >= 4 |
CREATE TABLE table_name_67 (
player VARCHAR,
money___$__ VARCHAR,
score VARCHAR
) | Which player has $450 and a score of 76-74-74-72=296? | SELECT player FROM table_name_67 WHERE money___$__ = "450" AND score = 76 - 74 - 74 - 72 = 296 |
CREATE TABLE table_1397655_1 (
city VARCHAR,
station VARCHAR
) | where is citv located | SELECT city FROM table_1397655_1 WHERE station = "CITV" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.