table stringlengths 33 7.14k | question stringlengths 4 1.06k | output stringlengths 2 4.44k ⌀ |
|---|---|---|
CREATE TABLE table_29090 (
"Round #" text,
"Home Team" text,
"Win/Loss" text,
"Score" text,
"Opposition" text,
"Location" text
) | What was the score when the opposition was West Coast in Wanganui? | SELECT "Score" FROM table_29090 WHERE "Opposition" = 'West Coast' AND "Location" = 'Wanganui' |
CREATE TABLE table_name_26 (
date VARCHAR,
attendance VARCHAR
) | When was the game that had 58,025 people in attendance? | SELECT date FROM table_name_26 WHERE attendance = "58,025" |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
... | All questions with exactly two specified tags and no accepted answer. | SELECT Id AS "post_link", CreationDate, Score, Tags FROM Posts WHERE Tags IN ('<' + '##tag1:string##' + '><' + '##tag2:string##' + '>', '<' + '##tag2:string##' + '><' + '##tag1:string##' + '>') AND AcceptedAnswerId IS NULL ORDER BY CreationDate DESC |
CREATE TABLE table_5328 (
"Season" text,
"Level" real,
"Position" text,
"Nationality" text,
"Apps" real,
"Goals" real
) | What is the Position of the Level 3 winner from Saint Kitts and Nevis? | SELECT "Position" FROM table_5328 WHERE "Level" = '3' AND "Nationality" = 'saint kitts and nevis' |
CREATE TABLE table_66240 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
) | Which country has a Col (m) of 1374? | SELECT "Country" FROM table_66240 WHERE "Col (m)" = '1374' |
CREATE TABLE table_name_38 (
total VARCHAR,
silver INTEGER
) | How much Total has a Silver smaller than 0? | SELECT COUNT(total) FROM table_name_38 WHERE silver < 0 |
CREATE TABLE table_name_48 (
date VARCHAR,
tie_no VARCHAR
) | What date has 11 as the tie no.? | SELECT date FROM table_name_48 WHERE tie_no = "11" |
CREATE TABLE table_name_12 (
attendance VARCHAR,
result VARCHAR
) | I want the attendance which has a result of l 49 21 | SELECT attendance FROM table_name_12 WHERE result = "l 49–21" |
CREATE TABLE table_1226250_1 (
prothrombin_time VARCHAR,
condition VARCHAR
) | How in prothrombin affected by glanzmann's thrombasthenia. | SELECT prothrombin_time FROM table_1226250_1 WHERE condition = "Glanzmann's thrombasthenia" |
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
)
... | calculate the minimum age of male patients who were of black/african american ethnic background. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN" |
CREATE TABLE laptimes (
raceid number,
driverid number,
lap number,
position number,
time text,
milliseconds number
)
CREATE TABLE constructorstandings (
constructorstandingsid number,
raceid number,
constructorid number,
points number,
position number,
positiontext text... | What are all the different first names of the drivers who are in position as standing and won? | SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 |
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
... | How many different locations does each school have? | SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code |
CREATE TABLE table_53616 (
"Subframe #" real,
"Page #" text,
"Name" text,
"Word #" real,
"Bits" text,
"Scale" text,
"Signed" text
) | What is URA Index scale? | SELECT "Scale" FROM table_53616 WHERE "Name" = 'ura index' |
CREATE TABLE table_24219 (
"Department" text,
"Micro (10ha)" real,
"Small (100ha)" real,
"Medium (500ha)" real,
"Big (>500ha)" real,
"Total" real
) | Which department has a small of 11370? | SELECT "Department" FROM table_24219 WHERE "Small (100ha)" = '11370' |
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... | how many patients whose diagnoses long title is chronic obstructive asthma, unspecified and lab test category is hematology? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Chronic obstructive asthma, unspecified" AND lab."CATEGORY" = "Hematology" |
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE market (
Mar... | A line chart for what are the number of the years of film market estimation for the market of Japan, ordered by year descending? | SELECT Year, COUNT(Year) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC |
CREATE TABLE table_6491 (
"Source" text,
"Date" text,
"GERB" text,
"Attack" text,
"Blue Coalition" text
) | What GERB has an 11% Attack? | SELECT "GERB" FROM table_6491 WHERE "Attack" = '11%' |
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... | Calculate the average duration of hospital stay of the patients who had COPD exacerbation as their primary disease | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" |
CREATE TABLE table_18491 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the minumim first elected for alvin bush | SELECT MIN("First elected") FROM table_18491 WHERE "Incumbent" = 'Alvin Bush' |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Most Number of Famous Questions. | SELECT 'https://stackoverflow.com/questions/' + CAST(questions.Id AS TEXT), questions.Score, questions.ViewCount FROM Posts AS questions JOIN Posts AS answers ON answers.ParentId = questions.Id JOIN Users AS u ON u.Id = answers.OwnerUserId WHERE u.Id = 575376 AND questions.PostTypeId = 1 AND (questions.ViewCount > 3000... |
CREATE TABLE table_name_61 (
frequency__khz_ INTEGER,
licensed_location VARCHAR
) | What is the smallest frequency (kHz) that is in the location of Longview? | SELECT MIN(frequency__khz_) FROM table_name_61 WHERE licensed_location = "longview" |
CREATE TABLE table_name_16 (
avg INTEGER,
yards VARCHAR,
rec VARCHAR
) | Tell me the lowest avg for 6 yards and rec more than 1 | SELECT MIN(avg) FROM table_name_16 WHERE yards = 6 AND rec > 1 |
CREATE TABLE table_19945 (
"#" real,
"Season" real,
"Bowl game" text,
"Result" text,
"Opponent" text,
"Stadium" text,
"Location" text,
"Attendance" text
) | What is the stadium where the attendance was 75,406? | SELECT "Stadium" FROM table_19945 WHERE "Attendance" = '75,406' |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
ro... | count the numbers of patients who were prescribed latanoprost 0.005% ophth. soln. within 2 months after having been diagnosed with swelling of limb since 2103. | SELECT COUNT(DISTINCT t1.subject_id) 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_diagnoses.short_title = 'swelling of limb')... |
CREATE TABLE table_24544 (
"Year" real,
"Horse" text,
"Driver" text,
"Trainer" text,
"Country of owner" text,
"Odds of winner" text,
"Winning time (km rate)" text
) | What was the winning time in the year when the odds of the winner were 2.94? | SELECT "Winning time (km rate)" FROM table_24544 WHERE "Odds of winner" = '2.94' |
CREATE TABLE table_name_17 (
identifier VARCHAR,
power VARCHAR
) | what is the identifier when the power is 22500 watts? | SELECT identifier FROM table_name_17 WHERE power = "22500 watts" |
CREATE TABLE table_203_676 (
id number,
"pick #" number,
"cfl team" text,
"player" text,
"position" text,
"college" text
) | who was the first player picked in round four ? | SELECT "player" FROM table_203_676 ORDER BY "pick #" LIMIT 1 |
CREATE TABLE table_30771 (
"Episode air date" text,
"Audition city" text,
"Date" text,
"Venue" text,
"Callback date" text,
"Callback venue" text,
"Golden tickets" real
) | How many times is there a golden tickets entry when the callback venue is rcti studio, jakarta? | SELECT COUNT("Golden tickets") FROM table_30771 WHERE "Callback venue" = 'RCTI Studio, Jakarta' |
CREATE TABLE table_22384475_1 (
match_date VARCHAR,
winner VARCHAR
) | What date did the West Indies win the match? | SELECT match_date FROM table_22384475_1 WHERE winner = "West Indies" |
CREATE TABLE table_name_95 (
playing_for VARCHAR,
opponent VARCHAR,
date VARCHAR
) | who is playing for when the opponent is deportes savio and the date is 2010-03-11? | SELECT playing_for FROM table_name_95 WHERE opponent = "deportes savio" AND date = "2010-03-11" |
CREATE TABLE table_name_4 (
season VARCHAR,
score VARCHAR
) | what season had a score of 1:0 | SELECT season FROM table_name_4 WHERE score = "1:0" |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CR... | i need a flight leaving PITTSBURGH next monday arriving in FORT WORTH before 1000 | 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 ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... |
CREATE TABLE table_204_652 (
id number,
"title" text,
"year" number,
"director" text,
"country" text,
"genre" text,
"notes" text
) | how many directors are in the england films ? | SELECT COUNT("director") FROM table_204_652 WHERE "country" = 'england' |
CREATE TABLE table_215 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | What is the report for the race that Mike Spence won. | SELECT "Report" FROM table_215 WHERE "Winning driver" = 'Mike Spence' |
CREATE TABLE table_6360 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What is the lowest game that has a drawn less than 0? | SELECT MIN("Games") FROM table_6360 WHERE "Drawn" < '0' |
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
)
... | give me the number of patients who had open and other sigmoidectomy and had psychiatric facility-partial hospitalization discharge. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Open sigmoidectomy NEC" |
CREATE TABLE table_name_80 (
appearance VARCHAR,
polyphenyl_ether VARCHAR
) | What does Polyphenyl Ether of 3- and 4-ring oxythio look like? | SELECT appearance FROM table_name_80 WHERE polyphenyl_ether = "3- and 4-ring oxythio" |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | list of patient ids of patients who were diagnosed with s/p surgical repair of fracture - femur since 5 years ago. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p surgical repair of fracture - femur' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year')) |
CREATE TABLE table_2954 (
"Competition" text,
"Final position" text,
"First match" text,
"Last match" text,
"Final Place" text
) | Name the final place for july 25, 2009 | SELECT "Final Place" FROM table_2954 WHERE "Last match" = 'July 25, 2009' |
CREATE TABLE table_51418 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What venue has the away side scoring 6.5 (41)? | SELECT "Venue" FROM table_51418 WHERE "Away team score" = '6.5 (41)' |
CREATE TABLE table_name_45 (
home_team VARCHAR,
away_team VARCHAR
) | What home team has coventry city as the away team? | SELECT home_team FROM table_name_45 WHERE away_team = "coventry city" |
CREATE TABLE table_name_78 (
score VARCHAR,
set_3 VARCHAR
) | What was the score when set 3 was 26-28? | SELECT score FROM table_name_78 WHERE set_3 = "26-28" |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_c... | nonstop flights DENVER to KANSAS CITY | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS... |
CREATE TABLE table_name_45 (
team_1 VARCHAR,
team_2 VARCHAR
) | What is team 1 when team 2 is Manchester United? | SELECT team_1 FROM table_name_45 WHERE team_2 = "manchester united" |
CREATE TABLE table_11365528_2 (
website VARCHAR,
head_coach VARCHAR
) | The head coach, steve radoslavic, is related to which websites? | SELECT website FROM table_11365528_2 WHERE head_coach = "Steve Radoslavic" |
CREATE TABLE table_51994 (
"Region" text,
"Voter registration" real,
"Voter turnout" real,
"BYuT" real,
"OU-PSD" real
) | What is the lower turnout that has a byut of 50.7 and an ou psd smaller than 36.8? | SELECT MIN("Voter turnout") FROM table_51994 WHERE "BYuT" = '50.7' AND "OU-PSD" < '36.8' |
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
)
... | specify birthdate and death status of patient mary davis | SELECT demographic.dob, demographic.expire_flag FROM demographic WHERE demographic.name = "Mary Davis" |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | tell me the name of the medication patient 13473 was first prescribed via iv route? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13473) AND prescriptions.route = 'iv' ORDER BY prescriptions.startdate LIMIT 1 |
CREATE TABLE table_name_31 (
college VARCHAR,
overall VARCHAR
) | Which college had an overall pick of 9? | SELECT college FROM table_name_31 WHERE overall = 9 |
CREATE TABLE table_75739 (
"Season" text,
"Skip" text,
"Third" text,
"Second" text,
"Lead" text
) | What lead has the third David Nedohin? | SELECT "Lead" FROM table_75739 WHERE "Third" = 'david nedohin' |
CREATE TABLE table_train_57 (
"id" int,
"bleeding" int,
"in_another_study" bool,
"hiv_infection" bool,
"hepatitis_c_infection" bool,
"receiving_vasopressor" bool,
"hypotension" bool,
"NOUSE" float
) | participation in another study | SELECT * FROM table_train_57 WHERE in_another_study = 1 |
CREATE TABLE table_203_809 (
id number,
"date" text,
"time" text,
"opponent#" text,
"rank#" text,
"site" text,
"tv" text,
"result" text,
"attendance" number
) | which game did georgia score the largest amount of points in ? | SELECT "date" FROM table_203_809 ORDER BY "result" DESC LIMIT 1 |
CREATE TABLE table_27808 (
"Position" real,
"Race number" text,
"Sail number" text,
"Yacht" text,
"State/country" text,
"Yacht type" text,
"LOA (Metres)" text,
"Skipper" text,
"Elapsed time d:hh:mm:ss" text
) | What yacht type is involved where Bob Oatley is the skipper? | SELECT "Yacht type" FROM table_27808 WHERE "Skipper" = 'Bob Oatley' |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | For patient id 9271, specify the location of the admission with the time | SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "9271" |
CREATE TABLE table_63135 (
"Match" real,
"Date" text,
"Competition or tour" text,
"Ground" text,
"Opponent" text,
"Score1" text,
"Scorers" text
) | Who are the scorers on 1 August 2008, where the ground was A? | SELECT "Scorers" FROM table_63135 WHERE "Ground" = 'a' AND "Date" = '1 august 2008' |
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,
... | is there any nasopharynx microbiology test history of patient 031-16123 until 1 year ago? | 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 DATETIME(microlab.cultur... |
CREATE TABLE table_77722 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | What was the decision of the Kings game when Chicago was the visiting team? | SELECT "Decision" FROM table_77722 WHERE "Visitor" = 'chicago' |
CREATE TABLE table_1745843_6 (
part_3 VARCHAR,
class VARCHAR
) | What's the part 3 of the verb in class 5? | SELECT part_3 FROM table_1745843_6 WHERE class = "5" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | how many patients whose admission location is trsf within this facility and diagnoses long title is abdominal pain, other specified site? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND diagnoses.long_title = "Abdominal pain, other specified site" |
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 meter_600 and meter_100 . | SELECT meter_600, meter_100 FROM swimmer |
CREATE TABLE table_15252 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which year averaged less than 9 points? | SELECT AVG("Year") FROM table_15252 WHERE "Points" < '9' |
CREATE TABLE table_name_60 (
lane INTEGER,
heat VARCHAR,
mark VARCHAR
) | What is the most lanes used in races with more than 1 heat and a winning mark of 7.25? | SELECT MAX(lane) FROM table_name_60 WHERE heat > 1 AND mark = "7.25" |
CREATE TABLE table_18600760_10 (
land___sqmi__ VARCHAR,
county VARCHAR
) | How big is the land in square miles of Grand Forks county? | SELECT land___sqmi__ FROM table_18600760_10 WHERE county = "Grand Forks" |
CREATE TABLE table_7411 (
"Tournament" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text
) | During the Tournament in which Ji Nov k was absent(A) in 1995, absent(A) in 1997, and made it to the 3rd round (3R) in 2003, how did he do in 2006? | SELECT "2006" FROM table_7411 WHERE "1995" = 'a' AND "1997" = 'a' AND "2003" = '3r' |
CREATE TABLE Detention (
datetime_detention_start VARCHAR,
teacher_id VARCHAR
)
CREATE TABLE Teachers (
teacher_id VARCHAR,
last_name VARCHAR
) | Find the start and end dates of detentions of teachers with last name 'Schultz'. | SELECT T1.datetime_detention_start, datetime_detention_end FROM Detention AS T1 JOIN Teachers AS T2 ON T1.teacher_id = T2.teacher_id WHERE T2.last_name = "Schultz" |
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,
... | give me the number of patients whose lab test name is troponin i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Troponin I" |
CREATE TABLE table_name_64 (
date VARCHAR,
runner_s__up VARCHAR
) | On what Date was Judy Rankin Runner(s)-up? | SELECT date FROM table_name_64 WHERE runner_s__up = "judy rankin" |
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 ... | has .9% normal saline been administered to patient 25814 on this hospital visit? | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814 AND admissions.dischtime IS NULL)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_item... |
CREATE TABLE table_203_607 (
id number,
"catalogue number" text,
"artist" text,
"release title" text,
"format" text,
"release date" text
) | what is the total number of titles coil released on 7 ' vinyl ? | SELECT COUNT("release title") FROM table_203_607 WHERE "format" = '7" vinyl' |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Draw a bar chart about the distribution of Name and Height , I want to order by the Y-axis in asc. | SELECT Name, Height FROM people ORDER BY Height |
CREATE TABLE table_name_6 (
laps INTEGER,
driver VARCHAR
) | What is the most laps for Ayrton Senna? | SELECT MAX(laps) FROM table_name_6 WHERE driver = "ayrton senna" |
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 marital status of subject id 2560. | SELECT demographic.marital_status FROM demographic WHERE demographic.subject_id = "2560" |
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_order_placed DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number IN... | What is the relationship between account id and name for all account? Return a scatter chart. | SELECT account_id, account_name FROM Accounts GROUP BY other_account_details |
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... | how many patients with other phototherapy procedure were hospitalized for more than 4 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "4" AND procedures.short_title = "Other phototherapy" |
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numci... | How many papers does Graham Neubig have in TACL | SELECT DISTINCT COUNT(paper.paperid) FROM author, paper, venue, writes WHERE author.authorname = 'Graham Neubig' AND venue.venueid = paper.venueid AND venue.venuename = 'TACL' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid |
CREATE TABLE table_31441 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Viewers (million)" text
) | What is the name of the episode written by glen mazzara? | SELECT "Title" FROM table_31441 WHERE "Written by" = 'Glen Mazzara' |
CREATE TABLE table_16854 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What is the number of school/club teams held by BYU? | SELECT MIN("No.") FROM table_16854 WHERE "School/Club Team" = 'BYU' |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Total votes of users by user-rep. | SELECT (UpVotes + DownVotes) AS "Total Votes" FROM Users WHERE Id = 1340599 |
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,
... | provide the number of patients whose ethnicity is hispanic/latino - puerto rican and item id is 50967? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND lab.itemid = "50967" |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | how many living patients had globulin lab test done? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Globulin" |
CREATE TABLE table_204_164 (
id number,
"branding" text,
"callsign" text,
"frequency" text,
"power (kw)" text,
"location" text
) | how many stations broadcast with a power of 5kw ? | SELECT COUNT("branding") FROM table_204_164 WHERE "power (kw)" = 5 |
CREATE TABLE invoice_line_items (
order_item_id number,
invoice_number number,
product_id number,
product_title text,
product_quantity text,
product_price number,
derived_product_cost number,
derived_vat_payable number,
derived_total_cost number
)
CREATE TABLE order_items (
orde... | Show the unique first names, last names, and phone numbers for all customers with any account. | SELECT DISTINCT T1.customer_first_name, T1.customer_last_name, T1.phone_number FROM customers AS T1 JOIN accounts AS T2 ON T1.customer_id = T2.customer_id |
CREATE TABLE table_204_317 (
id number,
"metropolitan area" text,
"country" text,
"rank" number,
"forstall\n2003 est." number,
"official population" number,
"year" number
) | how many cities are in the united states ? | SELECT COUNT("metropolitan area") FROM table_204_317 WHERE "country" = 'united states' |
CREATE TABLE table_68771 (
"Estimate" text,
"Name" text,
"Nat." text,
"Ship type" text,
"Where sunk" text,
"Date" text
) | What is the date that a ship sank in the South Atlantic? | SELECT "Date" FROM table_68771 WHERE "Where sunk" = 'south atlantic' |
CREATE TABLE table_60527 (
"Year" real,
"Round" real,
"Pick" real,
"Player" text,
"NBA Club" text
) | What is the highest pick for a year after 2010, and a round smaller than 1? | SELECT MAX("Pick") FROM table_60527 WHERE "Year" > '2010' AND "Round" < '1' |
CREATE TABLE table_name_31 (
round VARCHAR,
event VARCHAR
) | What round did the event UFC 86 take place? | SELECT round FROM table_name_31 WHERE event = "ufc 86" |
CREATE TABLE table_203_697 (
id number,
"player" text,
"career" text,
"nickname" text,
"team inducted as" text
) | who had the nickname robbie ? | SELECT "player" FROM table_203_697 WHERE "nickname" = '"robbie"' |
CREATE TABLE table_13947 (
"Athlete" text,
"Class" text,
"Horse" text,
"Event" text,
"Result" real
) | What horse was shown by with Britta N pel and got less than 71.909? | SELECT "Horse" FROM table_13947 WHERE "Athlete" = 'britta näpel' AND "Result" < '71.909' |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of department_id over the hire_date bin hire_date by time by a bar chart, and I want to order by the y-axis from low to high. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) |
CREATE TABLE table_203_378 (
id number,
"against" text,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"win %" text
) | what is the number of losses they have against france ? | SELECT "lost" FROM table_203_378 WHERE "against" = 'france' |
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... | how many patients whose death status is 0 and procedure long title is fiber-optic bronchoscopy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Fiber-optic bronchoscopy" |
CREATE TABLE table_name_63 (
position VARCHAR,
points INTEGER
) | What position has less than 6 Points? | SELECT COUNT(position) FROM table_name_63 WHERE points < 6 |
CREATE TABLE all_documents (
document_id number,
date_stored time,
document_type_code text,
document_name text,
document_description text,
other_details text
)
CREATE TABLE document_locations (
document_id number,
location_code text,
date_in_location_from time,
date_in_locaton_t... | What are all the role codes, role names, and role descriptions? | SELECT role_code, role_name, role_description FROM roles |
CREATE TABLE table_78967 (
"Date" text,
"Ship Name" text,
"Tonnage" text,
"Ship Type" text,
"Location" text,
"Disposition of Ship" text
) | What date was a brig type ship located in SW Approaches? | SELECT "Date" FROM table_78967 WHERE "Ship Type" = 'brig' AND "Location" = 'sw approaches' |
CREATE TABLE table_23354 (
"School" text,
"City / Town" text,
"Website" text,
"Size" real,
"Principal" text,
"Grades" text,
"IDOE Profile" text
) | Name the school/s with is size of 604. | SELECT "School" FROM table_23354 WHERE "Size" = '604' |
CREATE TABLE table_18998 (
"Position" real,
"Artist" text,
"Song title" text,
"Highest position" real,
"Points" real
) | what's the points with artbeingt being dave appell | SELECT "Points" FROM table_18998 WHERE "Artist" = 'Dave Appell' |
CREATE TABLE table_34461 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
) | What score has tim duncan (27) as the leading scorer? | SELECT "Score" FROM table_34461 WHERE "Leading scorer" = 'tim duncan (27)' |
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
)
... | how many patients whose admission type is elective and procedure icd9 code is 40? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "40" |
CREATE TABLE table_name_32 (
fastest_lap VARCHAR,
pole_position VARCHAR,
winning_driver VARCHAR
) | Who had the fastest lap when David Coulthard had pole position and Michael Schumacher as a winning driver. | SELECT fastest_lap FROM table_name_32 WHERE pole_position = "david coulthard" AND winning_driver = "michael schumacher" |
CREATE TABLE table_name_19 (
regular_season VARCHAR,
division VARCHAR
) | WHICH Regular Season has a Division of 4? | SELECT regular_season FROM table_name_19 WHERE division = 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.