table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TAB... | what were the top three diagnoses that had the highest two year mortality rate? | SELECT t4.diagnosisname FROM (SELECT t3.diagnosisname, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.diagnosisname, 100 - SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 2 * 365 THEN 1 ELSE 0 END) * 10... |
CREATE TABLE table_37817 (
"Season" real,
"Team" text,
"Country" text,
"League" text,
"Level" real,
"Apps" text,
"Goals" real
) | Tell me the least season with level less than 1 | SELECT MIN("Season") FROM table_37817 WHERE "Level" < '1' |
CREATE TABLE table_26041144_16 (
catches INTEGER
) | What is the catches maximum number? | SELECT MAX(catches) FROM table_26041144_16 |
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,
... | among patients belonging to hispanic or latino ethnic origin, calculate the total number of male patients. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "HISPANIC OR LATINO" |
CREATE TABLE table_2333 (
"School" text,
"Location(s)" text,
"Control" text,
"Type" text,
"Enrollment (2005)" text,
"Founded" real
) | What year is the founding year, for the school that had an enrollment in 2005 of 963? | SELECT "Founded" FROM table_2333 WHERE "Enrollment (2005)" = '963' |
CREATE TABLE table_7700 (
"Material" text,
"Formula" text,
"Refractive index(es) 589.3nm" text,
"Hardness ( Mohs' scale )" text,
"Density (g/cm 3 )" text,
"State of the art" text
) | Which material has a hardness of 8.25? | SELECT "Material" FROM table_7700 WHERE "Hardness ( Mohs' scale )" = '8.25' |
CREATE TABLE table_46787 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the highest grid when the time is +45.162? | SELECT MAX("Grid") FROM table_46787 WHERE "Time" = '+45.162' |
CREATE TABLE table_name_64 (
Id VARCHAR
) | What is the total number of 1876(s), when 1872 is less than 1921, and when 1891 is less than 354? | SELECT COUNT(1876) FROM table_name_64 WHERE 1872 < 1921 AND 1891 < 354 |
CREATE TABLE table_name_61 (
opponent VARCHAR,
score VARCHAR
) | Who was the Opponent in the match with a Score of 6 3, 6 4? | SELECT opponent FROM table_name_61 WHERE score = "6–3, 6–4" |
CREATE TABLE table_51748 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What is the attendance in the bye week after week 5? | SELECT "Attendance" FROM table_51748 WHERE "Week" > '5' AND "Opponent" = 'bye' |
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 many hospitalized patients are there currently? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL |
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... | give me the number of patients whose diagnosis code is 34291 and age under 41 years. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "41" AND diagnoses.icd9_code = "34291" |
CREATE TABLE table_73321 (
"No." real,
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (million)" text,
"Original air date" text,
"Production code" real
) | What is the production code for the episode that had 9.18 million viewers (U.S.)? | SELECT MAX("Production code") FROM table_73321 WHERE "U.S. viewers (million)" = '9.18' |
CREATE TABLE table_63977 (
"Outcome" text,
"Year" text,
"Tournament" text,
"Surface" text,
"Partnering" text,
"Opponents in the final" text,
"Score" text
) | Who is the Partner in the match with a Score of 6-4, 2-6, 7-6? | SELECT "Partnering" FROM table_63977 WHERE "Score" = '6-4, 2-6, 7-6' |
CREATE TABLE table_203_99 (
id number,
"season" number,
"date" text,
"driver" text,
"team" text,
"chassis" text,
"engine" text,
"race distance\nlaps" number,
"race distance\nmiles (km)" text,
"race time" text,
"average speed\n(mph)" number,
"report" text
) | what is the least amount of laps completed ? | SELECT MIN("race distance\nlaps") FROM table_203_99 |
CREATE TABLE table_55731 (
"Rank" real,
"Name" text,
"Nation" text,
"SP+FS" real,
"Points" real,
"Places" real
) | Name the total number of SP+FS for places of 60 and points more than 151.66 | SELECT COUNT("SP+FS") FROM table_55731 WHERE "Places" = '60' AND "Points" > '151.66' |
CREATE TABLE table_11190568_7 (
date_of_appointment VARCHAR,
team VARCHAR
) | When are team Galway's dates of appointment? | SELECT date_of_appointment FROM table_11190568_7 WHERE team = "Galway" |
CREATE TABLE table_9515 (
"Party" text,
"Leader" text,
"Seats" text,
"% of seats" text,
"First Pref votes" text,
"% FPv" text
) | What is the %FPv for the Workers' Party? | SELECT "% FPv" FROM table_9515 WHERE "Party" = 'workers'' party' |
CREATE TABLE table_name_63 (
start VARCHAR,
finish VARCHAR
) | What's the start when the finish is 1? | SELECT start FROM table_name_63 WHERE finish = "1" |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
... | What are the DENT classes that don 't meet on Friday ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course_offering.friday = 'N' AND course.department = 'DENT' AND semester.semester = 'WN' AND s... |
CREATE TABLE table_15993 (
"Case/Suffix" text,
"we two" text,
"you and I" text,
"you two" text,
"them two (the two)" text,
"who-two" text
) | What is we two where you two is ngipen? | SELECT "we two" FROM table_15993 WHERE "you two" = 'ngipen' |
CREATE TABLE table_262481_2 (
nickname VARCHAR,
founded VARCHAR
) | What is the nickname of the institution that was founded in 1857? | SELECT nickname FROM table_262481_2 WHERE founded = 1857 |
CREATE TABLE table_400 (
"Name" text,
"Position" text,
"Height" text,
"Weight(lbs)" real,
"Born" text,
"College" text,
"Drafted" text,
"Pro Team" text
) | What is the weight(lbs) when born is april 6, 1954 detroit, mi? | SELECT "Weight(lbs)" FROM table_400 WHERE "Born" = 'April 6, 1954 Detroit, MI' |
CREATE TABLE table_name_40 (
player VARCHAR,
college VARCHAR
) | What p;layer attended Concordia College? | SELECT player FROM table_name_40 WHERE college = "concordia" |
CREATE TABLE staff (
staff_id number,
gender text,
first_name text,
last_name text,
email_address text,
phone_number text
)
CREATE TABLE products (
product_id number,
parent_product_id number,
product_category_code text,
date_product_first_available time,
date_product_discon... | Return the average price of products that have each category code. | SELECT AVG(product_price), product_category_code FROM products GROUP BY product_category_code |
CREATE TABLE table_78447 (
"Name" text,
"Gender" text,
"Local board" text,
"Suburb" text,
"Authority" text,
"Decile" text,
"Roll" real
) | What gender has a local board of albert eden with a roll of more than 232 and Decile of 5? | SELECT "Gender" FROM table_78447 WHERE "Local board" = 'albert–eden' AND "Roll" > '232' AND "Decile" = '5' |
CREATE TABLE table_name_75 (
division_north VARCHAR,
division_southwest VARCHAR,
division_west VARCHAR
) | Who won Division North when Division Southwest was won by Novaci and Division West by Vrap i te? | SELECT division_north FROM table_name_75 WHERE division_southwest = "novaci" AND division_west = "vrapčište" |
CREATE TABLE table_13558 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Median family income" text,
"Population" real,
"Number of households" real
) | What is the highest Population that has a Median household income of $32,902 with a number of households less than 11,125 | SELECT MAX("Population") FROM table_13558 WHERE "Median household income" = '$32,902' AND "Number of households" < '11,125' |
CREATE TABLE table_name_39 (
team VARCHAR,
wrestler VARCHAR
) | Who is Doug Basham's team? | SELECT team FROM table_name_39 WHERE wrestler = "doug basham" |
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE restriction (
restriction_c... | i'd like to make a round trip from LOS ANGELES to NEWARK by way of CHARLOTTE | 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, flight, flight_stop AS FLIGHT_STOP_0, flight_stop AS FLIGHT_STOP_1... |
CREATE TABLE table_34181 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Score has a Record of 15 12 2? | SELECT "Score" FROM table_34181 WHERE "Record" = '15–12–2' |
CREATE TABLE table_4504 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the away team when the home team scored 10.18 (78)? | SELECT "Away team" FROM table_4504 WHERE "Home team score" = '10.18 (78)' |
CREATE TABLE table_203_683 (
id number,
"season" text,
"league" text,
"gold" text,
"silver" text,
"bronze" text,
"winning manager" text
) | what was the only season that skeid won gold ? | SELECT "season" FROM table_203_683 WHERE "gold" = 'skeid' |
CREATE TABLE table_35370 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Points have a Game smaller than 60, and a Score of 2 0, and a February larger than 1? | SELECT AVG("Points") FROM table_35370 WHERE "Game" < '60' AND "Score" = '2–0' AND "February" > '1' |
CREATE TABLE table_70032 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | In the round that lasted 0:20, what was the Res? | SELECT "Res." FROM table_70032 WHERE "Time" = '0:20' |
CREATE TABLE table_37031 (
"Model" text,
"Engine" text,
"Displacement" text,
"Valvetrain" text,
"Fuel system" text,
"Max. power at rpm" text,
"Max. torque at rpm" text
) | What is the Displacement of the 180 Multijet Power/3.0 HDI Model? | SELECT "Displacement" FROM table_37031 WHERE "Model" = '180 multijet power/3.0 hdi' |
CREATE TABLE table_name_80 (
population INTEGER,
per_capita_income VARCHAR
) | What is the lowest Population, when Per Capita Income is '$16,330'? | SELECT MIN(population) FROM table_name_80 WHERE per_capita_income = "$16,330" |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE... | Plot the number of payment method code by grouped by payment method code as a bar graph, show by the y axis in asc. | SELECT Payment_Method_Code, COUNT(Payment_Method_Code) FROM Payments GROUP BY Payment_Method_Code ORDER BY COUNT(Payment_Method_Code) |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | What time is course 246 held for Fall semester ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... |
CREATE TABLE table_name_82 (
season VARCHAR,
level VARCHAR,
position VARCHAR
) | Which Season has a Level of tier 2 and a Position of 1st? | SELECT COUNT(season) FROM table_name_82 WHERE level = "tier 2" AND position = "1st" |
CREATE TABLE table_name_23 (
home_team VARCHAR
) | What did Footscray score at the home game? | SELECT home_team AS score FROM table_name_23 WHERE home_team = "footscray" |
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 all employees who have the letters D or S in their first name, show me about the distribution of job_id and the average of manager_id , and group by attribute job_id in a bar chart, I want to list in desc by the y axis. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID) DESC |
CREATE TABLE table_56481 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | What is the race that had a tyre of p and Juan Manuel Fangio as the winning driver? | SELECT "Race" FROM table_56481 WHERE "Tyre" = 'p' AND "Winning driver" = 'juan manuel fangio' |
CREATE TABLE table_52074 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the smallest crowd size for punt road oval? | SELECT MIN("Crowd") FROM table_52074 WHERE "Venue" = 'punt road oval' |
CREATE TABLE web_client_accelerator (
Operating_system VARCHAR
) | Find the number of web accelerators used for each Operating system. | SELECT Operating_system, COUNT(*) FROM web_client_accelerator GROUP BY Operating_system |
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 maximum age of patients whose marital status is widowed and insurance is medicare? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.insurance = "Medicare" |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
las... | tell me the name of the drug which patient 40435 was prescribed in the same hospital encounter after receiving a audiological evaluation procedure this month? | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 40435 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_proce... |
CREATE TABLE table_35430 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the average overall of John Ayres, who had a pick # greater than 4? | SELECT AVG("Overall") FROM table_35430 WHERE "Name" = 'john ayres' AND "Pick #" > '4' |
CREATE TABLE job_history (
employee_id VARCHAR
)
CREATE TABLE employees (
employee_id VARCHAR,
salary VARCHAR
) | Can you return all detailed info of jobs which was done by any of the employees who is presently earning a salary on and above 12000? | SELECT * FROM job_history AS T1 JOIN employees AS T2 ON T1.employee_id = T2.employee_id WHERE T2.salary >= 12000 |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | provide the number of patients whose discharge location is snf and procedure icd9 code is 966? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SNF" AND procedures.icd9_code = "966" |
CREATE TABLE table_69540 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | What was the record on September 26? | SELECT "Record" FROM table_69540 WHERE "Date" = 'september 26' |
CREATE TABLE table_name_32 (
played VARCHAR,
tries_for VARCHAR
) | What is the played for tries for 50? | SELECT played FROM table_name_32 WHERE tries_for = "50" |
CREATE TABLE table_name_47 (
player VARCHAR,
finish VARCHAR,
year_s__won VARCHAR
) | Who won in 1997 with a finish of t48? | SELECT player FROM table_name_47 WHERE finish = "t48" AND year_s__won = "1997" |
CREATE TABLE table_53582 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home team when the game was at Windy Hill? | SELECT "Home team" FROM table_53582 WHERE "Venue" = 'windy hill' |
CREATE TABLE train_station (
train_id number,
station_id number
)
CREATE TABLE train (
train_id number,
name text,
time text,
service text
)
CREATE TABLE station (
station_id number,
name text,
annual_entry_exit number,
annual_interchanges number,
total_passengers number,
... | What are all locations of train stations? | SELECT DISTINCT location FROM station |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
u... | what drugs did patient 011-55642 have an allergic reaction to in the current hospital encounter? | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-55642' AND patient.hospitaldischargetime IS NULL)) |
CREATE TABLE table_name_80 (
school_club_team VARCHAR,
player VARCHAR
) | What is Stephen Thompson's School/Club Team? | SELECT school_club_team FROM table_name_80 WHERE player = "stephen thompson" |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | what was the name of the output, which patient 017-61209 had first on 06/09/last year? | 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 = '017-61209')) AND intakeoutput.cellpath LIKE '%output%' AND D... |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE labevents (
row_id numbe... | count the number of patients who have received a opn mitral valvuloplasty procedure during the same month after they have had a left heart cardiac cath procedure since 6 years ago. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'left heart ... |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | what were the four most commonly diagnosed diagnoses for patients who were previously diagnosed with ac alcoholic hepatitis within 2 months? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.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 = admissions... |
CREATE TABLE table_name_22 (
year INTEGER,
pts INTEGER
) | What is the latesr year that has more points than 0? | SELECT MAX(year) FROM table_name_22 WHERE pts > 0 |
CREATE TABLE table_26195 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | Name the least division | SELECT MIN("Division") FROM table_26195 |
CREATE TABLE table_76853 (
"Player" text,
"Nationality" text,
"Jersey Number(s)" real,
"Position" text,
"Years" text,
"From" text
) | What college was the player with the jersey number of 34 from? | SELECT "From" FROM table_76853 WHERE "Jersey Number(s)" = '34' |
CREATE TABLE table_204_658 (
id number,
"week" number,
"date" text,
"kickoff" text,
"opponent" text,
"results\nfinal score" text,
"results\nteam record" text,
"game site" text,
"attendance" number
) | how many kick off times are past 6:00 p.m. ? | SELECT COUNT(*) FROM table_204_658 WHERE "kickoff" > '6:00 p.m' |
CREATE TABLE table_name_78 (
record VARCHAR,
date VARCHAR
) | What was the Record on September 21? | SELECT record FROM table_name_78 WHERE date = "september 21" |
CREATE TABLE order_items (
order_id VARCHAR,
order_quantity INTEGER
)
CREATE TABLE customer_orders (
customer_id VARCHAR,
order_id VARCHAR
)
CREATE TABLE customers (
customer_name VARCHAR,
customer_id VARCHAR
) | What is the name of the customer that has purchased the most items? | SELECT t1.customer_name FROM customers AS t1 JOIN customer_orders AS t2 ON t1.customer_id = t2.customer_id JOIN order_items AS t3 ON t2.order_id = t3.order_id GROUP BY t1.customer_name ORDER BY SUM(t3.order_quantity) DESC LIMIT 1 |
CREATE TABLE table_53153 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | Name the lelast decile for roll of 428 | SELECT MIN("Decile") FROM table_53153 WHERE "Roll" = '428' |
CREATE TABLE table_name_26 (
points INTEGER,
score VARCHAR,
january VARCHAR
) | Which Points is the lowest one that has a Score of 1 4, and a January smaller than 18? | SELECT MIN(points) FROM table_name_26 WHERE score = "1–4" AND january < 18 |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is drug name and drug route of subject name colton andrade? | SELECT prescriptions.drug, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Colton Andrade" |
CREATE TABLE table_11187 (
"State" text,
"Population" real,
"GDP per cap. (PPP)" real,
"Currency" text,
"Gini" real,
"Council votes" real,
"EP seats" real
) | Which country has less than 4 votes? | SELECT "State" FROM table_11187 WHERE "Council votes" < '4' |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what is the average yearly number of patients who suffer from osteomyelitis - extremity until 4 years ago? | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnosis.patientunitstayid) AS c1 FROM diagnosis WHERE diagnosis.diagnosisname = 'osteomyelitis - extremity' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY STRFTIME('%y', diagnosis.diagnosistime)) AS t1 |
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 gsi (
course_offering_id int,
student_id int
)
CREATE TABLE instructor (
... | For AOSS 320 , which prerequisites have I already completed ? | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'AOSS' AND COURSE_1.number = ... |
CREATE TABLE table_name_95 (
analogue_terrestrial_channel VARCHAR,
internet VARCHAR
) | What is the analogue terrestrial channel when the internet shows channel4.com? | SELECT analogue_terrestrial_channel FROM table_name_95 WHERE internet = "channel4.com" |
CREATE TABLE table_21795846_1 (
position VARCHAR,
points VARCHAR
) | If there is 16 points, what was the position? | SELECT position FROM table_21795846_1 WHERE points = 16 |
CREATE TABLE table_76790 (
"Pick" real,
"Pos." text,
"Nationality" text,
"Team" text,
"Previous team" text,
"NBA years [a ]" text,
"Career with the franchise [b ]" text
) | What is the team of the player who was previously on the indiana pacers? | SELECT "Team" FROM table_76790 WHERE "Previous team" = 'indiana pacers' |
CREATE TABLE table_name_62 (
place VARCHAR,
artist VARCHAR
) | What place for roger pontare? | SELECT place FROM table_name_62 WHERE artist = "roger pontare" |
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... | what was the dose of lidocaine jelly 2% (urojet) - that was last prescribed to patient 24921 in 09/last year? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24921) AND prescriptions.drug = 'lidocaine jelly 2% (urojet)' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1... |
CREATE TABLE table_name_83 (
round INTEGER,
opponent VARCHAR
) | Which Round has an Opponent of jorge magalhaes? | SELECT AVG(round) FROM table_name_83 WHERE opponent = "jorge magalhaes" |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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... | what amount of rifaximin has been prescribed to patient 26313 for the last time in 03/last year? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26313) AND prescriptions.drug = 'rifaximin' AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTI... |
CREATE TABLE table_64000 (
"Hampden FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | Which Draws have Losses larger than 8, and a Hampden FL of terang-mortlake? | SELECT "Draws" FROM table_64000 WHERE "Losses" > '8' AND "Hampden FL" = 'terang-mortlake' |
CREATE TABLE table_2417345_3 (
successor VARCHAR,
date_of_successors_formal_installation VARCHAR
) | Who were the successors when the date the successors were installed was February 23, 1870? | SELECT successor FROM table_2417345_3 WHERE date_of_successors_formal_installation = "February 23, 1870" |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Student... | A bar chart for what are the number of the enrollment dates of all the tests that have result 'Pass'?, and could you sort by the the number of date of enrolment in ascending? | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) |
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE ground_service (
... | tell me about the M80 aircraft | SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'M80' |
CREATE TABLE table_2562572_54 (
population__2011_ INTEGER,
settlement VARCHAR
) | What is the lowest population in 2011 for the settlement of ortanovci? | SELECT MIN(population__2011_) FROM table_2562572_54 WHERE settlement = "Čortanovci" |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | when did patient 025-60396 get admitted to the hospital via floor for the last time in 2104? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '025-60396' AND patient.hospitaladmitsource = 'floor' AND STRFTIME('%y', patient.hospitaladmittime) = '2104' ORDER BY patient.hospitaladmittime DESC LIMIT 1 |
CREATE TABLE table_name_62 (
fa_cup INTEGER,
player VARCHAR,
total VARCHAR
) | Which FA Cup has a Player of khairan ezuan razali, and a Total smaller than 0? | SELECT AVG(fa_cup) FROM table_name_62 WHERE player = "khairan ezuan razali" AND total < 0 |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | For all storms with at least 1 death, show me the dates active and the total number of deaths with a bar chart, could you sort by the names in asc? | SELECT Dates_active, Number_Deaths FROM storm WHERE Number_Deaths >= 1 ORDER BY Dates_active |
CREATE TABLE table_73981 (
"Episode" real,
"First broadcast Denmark ( DR1 )" text,
"Official TNS Gallup ratings" real,
"First broadcast UK ( BBC Four )" text,
"Official BARB ratings" text
) | When was the episode with a 1,036,000 BARB rating first aired in Denmark? | SELECT "First broadcast Denmark ( DR1 )" FROM table_73981 WHERE "Official BARB ratings" = '1,036,000' |
CREATE TABLE table_35913 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Stadium" text,
"Record" text,
"Attendance" real
) | What is the highest attendance that has oakland raiders as the opponent, with a week greater than 9? | SELECT MAX("Attendance") FROM table_35913 WHERE "Opponent" = 'oakland raiders' AND "Week" > '9' |
CREATE TABLE table_204_853 (
id number,
"pos" number,
"grid" number,
"no." number,
"driver" text,
"team" text,
"manufacturer" text,
"laps" number,
"points" number
) | which driver scored the most points ? | SELECT "driver" FROM table_204_853 ORDER BY "points" DESC LIMIT 1 |
CREATE TABLE table_54556 (
"Environment" text,
"Realization" text,
"Example" text,
"Pronunciation" text,
"Gloss" text
) | Name the gloss for [ d m] | SELECT "Gloss" FROM table_54556 WHERE "Pronunciation" = '[χdəm]' |
CREATE TABLE table_name_37 (
country VARCHAR,
pinnacle_height VARCHAR,
name VARCHAR
) | Which Country has a Pinnacle height of metres (ft) and a Name of azeri tv tower? | SELECT country FROM table_name_37 WHERE pinnacle_height = "metres (ft)" AND name = "azeri tv tower" |
CREATE TABLE table_29809 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high assists when the score was w 107 95 (ot)? | SELECT "High assists" FROM table_29809 WHERE "Score" = 'W 107–95 (OT)' |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | what was the drug last prescribed to patient 40059 in their current hospital visit? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40059 AND admissions.dischtime IS NULL) ORDER BY prescriptions.startdate DESC LIMIT 1 |
CREATE TABLE table_203_711 (
id number,
"name" text,
"age" number,
"hometown" text,
"occupation" text,
"culinary p.o.v." text,
"eliminated" text
) | how many competitors were under the age of 30 ? | SELECT COUNT("name") FROM table_203_711 WHERE "age" < 30 |
CREATE TABLE table_14312471_4 (
crowd INTEGER,
ground VARCHAR
) | What's the maximum crowd when scg is the ground? | SELECT MAX(crowd) FROM table_14312471_4 WHERE ground = "SCG" |
CREATE TABLE table_name_94 (
matches VARCHAR,
rank VARCHAR
) | Which Matches have a Rank of 2? | SELECT COUNT(matches) FROM table_name_94 WHERE rank = 2 |
CREATE TABLE table_203_313 (
id number,
"name" text,
"pennant" text,
"builder" text,
"launched" text,
"original name" text,
"fate" text
) | what date was the first ship launched ? | SELECT "launched" FROM table_203_313 ORDER BY "launched" LIMIT 1 |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | Top 20 users from Wellington. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%wellington, new zealand' ORDER BY Reputation DESC LIMIT 20 |
CREATE TABLE table_name_12 (
nation___athlete_s_ VARCHAR,
sport VARCHAR,
record VARCHAR
) | What is the Nation - athlete(s), when the Sport is luge - men's singles, and when the Record is, 'track'? | SELECT nation___athlete_s_ FROM table_name_12 WHERE sport = "luge - men's singles" AND record = "track" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.