context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_13026799_3 (
scoring_average VARCHAR,
earnings__$_ VARCHAR
) | What is the scoring aerage for 111419? | SELECT scoring_average FROM table_13026799_3 WHERE earnings__$_ = 111419 | sql_create_context |
CREATE TABLE table_36976 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | Which Lost has a Tries for of 75? | SELECT "Lost" FROM table_36976 WHERE "Tries for" = '75' | wikisql |
CREATE TABLE table_27067379_1 (
height VARCHAR,
building VARCHAR
) | If the building is Costanera Center Torre 1, what is the height? | SELECT height FROM table_27067379_1 WHERE building = "Costanera Center Torre 1" | sql_create_context |
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 are the courses in Reinf Conc Members that satisfy the Core requirement ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Reinf Conc Members%' OR course.description LIKE '%Reinf Conc Members%' OR course.name LIKE '%Rei... | advising |
CREATE TABLE table_51324 (
"Episode" text,
"Air Date" text,
"Timeslot (EST)" text,
"Season" real,
"Rating" real,
"Share" real,
"18\u201349" real,
"Viewers (m)" real,
"Rank (#)" text
) | What is the total number of viewers for the show that was aired on December 10, 2008 with an 18 to 49 rating less than 1.2? | SELECT COUNT("Viewers (m)") FROM table_51324 WHERE "Air Date" = 'december 10, 2008' AND "18\u201349" < '1.2' | wikisql |
CREATE TABLE table_17444 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | How many NHL teams does Terry French play for? | SELECT COUNT("NHL team") FROM table_17444 WHERE "Player" = 'Terry French' | wikisql |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
... | What is the number of booking start dates of the apartments with more than 2 bedrooms for each weekday? Draw a bar chart, and could you sort by the y-axis in descending? | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 ORDER BY COUNT(booking_start_date) DESC | nvbench |
CREATE TABLE table_22011138_7 (
total_pld VARCHAR,
pos VARCHAR
) | If the POS is 4, what is the total PLD? | SELECT total_pld FROM table_22011138_7 WHERE pos = 4 | sql_create_context |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID... | 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, for employee_id, hire_date, visualize the trend, list in ascending by the X. | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_17372 (
"Year" real,
"Division" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
) | What year did they finish 1st, southern? | SELECT MAX("Year") FROM table_17372 WHERE "Reg. Season" = '1st, Southern' | wikisql |
CREATE TABLE table_18936 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director" text,
"Result" text
) | Who is the director of the film Gie? | SELECT "Director" FROM table_18936 WHERE "Film title used in nomination" = 'Gie' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | calculate the total length of patient 003-42706's last hospital stay. | SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '003-42706' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_93 (
director VARCHAR,
title VARCHAR
) | Who is the director of Last Window: The Secret of Cape West 3? | SELECT director FROM table_name_93 WHERE title = "last window: the secret of cape west 3" | sql_create_context |
CREATE TABLE table_name_80 (
venue VARCHAR,
competition VARCHAR
) | Where were the Pan American Games held? | SELECT venue FROM table_name_80 WHERE competition = "pan american games" | sql_create_context |
CREATE TABLE table_name_12 (
away_team VARCHAR,
home_team VARCHAR,
competition VARCHAR
) | Who is the away team for the tome team Leeds United, at the League Cup Competition? | SELECT away_team FROM table_name_12 WHERE home_team = "leeds united" AND competition = "league cup" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
... | calculate the number of patients who were tested for abscess microbiology since 1 year ago. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'abscess' AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-1 year')) | eicu |
CREATE TABLE table_54724 (
"Year" text,
"Venue" text,
"Winner" text,
"Country" text,
"Score" text
) | where did marie-laure taya win? | SELECT "Venue" FROM table_54724 WHERE "Winner" = 'marie-laure taya' | wikisql |
CREATE TABLE table_70805 (
"Rank" real,
"Fastest time (s)" real,
"Wind (m/s)" real,
"Athlete" text,
"Nation" text,
"Date" text,
"Location" text
) | what nation is bianca knight the answer for? | SELECT "Nation" FROM table_70805 WHERE "Athlete" = 'bianca knight' | wikisql |
CREATE TABLE table_name_41 (
winner VARCHAR,
year VARCHAR,
owner VARCHAR
) | Who was the winner after 1989 when Stronach Stable was the owner? | SELECT winner FROM table_name_41 WHERE year > 1989 AND owner = "stronach stable" | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime... | when was patient 002-70965 last prescribed with nss infusion and protonix at the same time since 151 months ago? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'nss infusion' AND patient.uniquepid = '002-70965' AND DATETIME(medication.drugstarttime) >= DATETIME(CURRENT_TIME(), '-15... | eicu |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | how many AA flights leave DENVER 6 10 | SELECT COUNT(DISTINCT flight.flight_id) FROM airport_service, city, date_day, days, flight WHERE (city.city_code = airport_service.city_code AND city.city_name = 'DENVER' AND date_day.day_number = 10 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.flight_days = da... | atis |
CREATE TABLE table_55943 (
"Rank" real,
"Team" text,
"Floor Exercise" real,
"Pommel Horse" real,
"Rings" real,
"Vault" real,
"Parallel Bars" real,
"Horizontal Bar" real,
"Total" real
) | How many pommel horses have a Total smaller than 230.019, a Team of china (chn), and a Vault smaller than 38.437? | SELECT COUNT("Pommel Horse") FROM table_55943 WHERE "Total" < '230.019' AND "Team" = 'china (chn)' AND "Vault" < '38.437' | wikisql |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
... | show first flight from PHILADELPHIA to DALLAS | 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 = 'PHILADELPHIA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is the number of patients whose marital status is divorced and lab test name is cortisol? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Cortisol" | mimicsql_data |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | how much is the difference in arterial bp [diastolic] of patient 11732 measured at 2103-05-26 23:00:00 compared to the value measured at 2103-05-26 17:00:00? | 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 = 11732)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'a... | mimic_iii |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | how many patients received antiemetic - serotonin antagonist within 2 months after having received oxygen therapy (> 60%) - non-rebreather mask? | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'oxygen therapy (> 60%) - non-rebreather mask') AS t1 JOIN (SELECT patient.uniquepid, treatment.treatmenttime... | eicu |
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 treatment (
treat... | list the five most common diagnoses that were given to patients within 2 months after receiving hypotonic fluid administration - d5 half-normal saline this year. | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'hypotonic fluid administration - d5 half... | eicu |
CREATE TABLE table_name_56 (
years VARCHAR,
player VARCHAR
) | Alton Lister Category:Articles with hCards has what as the listed years? | SELECT years FROM table_name_56 WHERE player = "alton lister category:articles with hcards" | sql_create_context |
CREATE TABLE table_13471 (
"Event" text,
"Record" text,
"Nationality" text,
"Date" text,
"Games" text
) | On what date were the 1997 Bridgetown games in which a Martinique girl competed? | SELECT "Date" FROM table_13471 WHERE "Nationality" = 'martinique' AND "Games" = '1997 bridgetown' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Show my answers to R tag. Show my answers to R tag | SELECT a.Score, a.Body, q.Tags, q.Title FROM Posts AS q INNER JOIN Posts AS a ON q.Id = a.ParentId AND a.PostTypeId = 2 AND q.PostTypeId = 1 WHERE a.CommunityOwnedDate IS NULL AND a.OwnerUserId = '##UserId##' AND q.Tags LIKE '%<r>%' ORDER BY a.Score DESC | sede |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE weather (
date TEXT,
... | For the days with the 3 largest maximum gust speeds, show me the frequency of their corresponding date in the weekdays level using a bar chart. | SELECT date, COUNT(date) FROM weather ORDER BY max_gust_speed_mph DESC LIMIT 3 | nvbench |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者79841221被门诊诊断为疾病Q06.940,他的检测指标673380的结果定量及单位是怎样的 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb... | css |
CREATE TABLE ship (
TYPE VARCHAR,
Tonnage INTEGER
) | Show different types of ships and the average tonnage of ships of each type. | SELECT TYPE, AVG(Tonnage) FROM ship GROUP BY TYPE | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 在号码为2471866的医院的各科室中把它们的名称、编码以及平均住院时长都列出来,并且按照平均住院时长升序排序出来? | SELECT MED_ORG_DEPT_CD, MED_ORG_DEPT_NM, AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '2471866' GROUP BY MED_ORG_DEPT_CD ORDER BY AVG(IN_HOSP_DAYS) | css |
CREATE TABLE table_27756314_8 (
date VARCHAR,
game VARCHAR
) | What is the date for the game 35? | SELECT date FROM table_27756314_8 WHERE game = 35 | sql_create_context |
CREATE TABLE table_4144 (
"By-election" real,
"Electorate" text,
"Date" text,
"Incumbent" text,
"Reason" text,
"Winner" text
) | When waikaia is the electorate what is the highest by-election? | SELECT MAX("By-election") FROM table_4144 WHERE "Electorate" = 'Waikaia' | wikisql |
CREATE TABLE table_name_83 (
rec INTEGER,
yards VARCHAR,
avg VARCHAR
) | How many receptions for players with over 647 yards and an under 14 yard average? | SELECT MIN(rec) FROM table_name_83 WHERE yards > 647 AND avg < 14 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions... | specify the route of drug administration for phenylephrine | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Phenylephrine" | mimicsql_data |
CREATE TABLE table_name_95 (
rank VARCHAR,
silver VARCHAR,
total VARCHAR
) | Which Rank has a Silver larger than 1 and a Total larger than 13? | SELECT rank FROM table_name_95 WHERE silver > 1 AND total > 13 | sql_create_context |
CREATE TABLE table_21914 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | On November 1, 1964, where was the game site? | SELECT "Game site" FROM table_21914 WHERE "Date" = 'November 1, 1964' | wikisql |
CREATE TABLE table_12962773_15 (
current_club VARCHAR,
no VARCHAR
) | How many clubs does number 6 play for? | SELECT COUNT(current_club) FROM table_12962773_15 WHERE no = 6 | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id num... | All answers by a specific user including tags. | SELECT a.Id AS "post_link", a.Score, q.Tags FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id WHERE (a.OwnerUserId = '##userid##') ORDER BY a.Id | sede |
CREATE TABLE table_name_66 (
to_par VARCHAR,
player VARCHAR
) | Golfer Steve Pate has what To par? | SELECT to_par FROM table_name_66 WHERE player = "steve pate" | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,... | what is the first flight after 800 from BOSTON to SAN FRANCISCO | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.departure_time > 800 AND flight.to_airport = AIRPORT_SERVICE_1... | atis |
CREATE TABLE table_57779 (
"Rocket launch" text,
"Launch Date" text,
"Mission" text,
"Institutional authority" text,
"Launch Site" text,
"Outcomes" text,
"Derivatives" text
) | Which Outcome has a Launch Date of march 18, 1964; 14:50 gmt? | SELECT "Outcomes" FROM table_57779 WHERE "Launch Date" = 'march 18, 1964; 14:50 gmt' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | what are the top four most frequent medications that followed during the same hospital visit for patients who were given intravenous diuretic - iv furosemide during this year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'intravenous diu... | eicu |
CREATE TABLE table_13301 (
"Period" text,
"Internet Explorer" text,
"Firefox" text,
"Safari" text,
"Opera" text,
"Netscape" text,
"Other Mozilla" text
) | What percentage of users were using Netscape during the period in which 21.67% were using Firefox? | SELECT "Netscape" FROM table_13301 WHERE "Firefox" = '21.67%' | wikisql |
CREATE TABLE table_1954 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | In season 5 what episode number was production 06-03-519? | SELECT COUNT("No. in season") FROM table_1954 WHERE "Production code" = '06-03-519' | wikisql |
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 with procedure icd9 code 4105 who died in or before 2180? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2180.0" AND procedures.icd9_code = "4105" | mimicsql_data |
CREATE TABLE table_28461589_2 (
mins_played INTEGER,
good_passes VARCHAR
) | What is the fewest minutes played for the player with exactly 638 good passes? | SELECT MIN(mins_played) FROM table_28461589_2 WHERE good_passes = 638 | sql_create_context |
CREATE TABLE table_name_39 (
points INTEGER,
drawn VARCHAR,
position VARCHAR,
lost VARCHAR
) | what is the highest points when position is higher than 6, lost is less than 12 and drawn is less than 1? | SELECT MAX(points) FROM table_name_39 WHERE position > 6 AND lost < 12 AND drawn < 1 | sql_create_context |
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,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about the sum of manager_id over the hire_date bin hire_date by time by a bar chart. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_15884 (
"Year" real,
"Tournaments played" real,
"Cuts made*" real,
"Wins" real,
"2nd" real,
"Top 10s" real,
"Best finish" text,
"Earnings ($)" real,
"Money list rank" text,
"Scoring average" text,
"Scoring rank" text
) | What time was the highest for 2nd finishers? | SELECT MAX("2nd") FROM table_15884 | wikisql |
CREATE TABLE table_16799784_7 (
latitude VARCHAR,
longitude VARCHAR
) | what is the latitude of the feature of longitude 80.0e | SELECT latitude FROM table_16799784_7 WHERE longitude = "80.0E" | sql_create_context |
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
)
... | find me the number of patients with the diagnoses of critical illness myopathy who have been hospitalized for more than 20 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "20" AND diagnoses.short_title = "Critical illness myopthy" | mimicsql_data |
CREATE TABLE table_47381 (
"Name" text,
"Born-Died" text,
"Term start" text,
"Term end" text,
"Political Party" text
) | What is the Born-Died dates of Xhafer Bej Ypi? | SELECT "Born-Died" FROM table_47381 WHERE "Name" = 'xhafer bej ypi' | wikisql |
CREATE TABLE table_59102 (
"Original NFL team" text,
"Player" text,
"Pos." text,
"College" text,
"Conf." text
) | What college has Lance Moore Category:articles with hcards? | SELECT "College" FROM table_59102 WHERE "Player" = 'lance moore category:articles with hcards' | wikisql |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | 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 average of manager_id over the hire_date bin hire_date by weekday by a bar chart, and could you sort by the Y-axis in ascending? | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE table_14591 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which Opponent has a Method of submission? | SELECT "Opponent" FROM table_14591 WHERE "Method" = 'submission' | wikisql |
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... | count the number of self pay insurance patients who have been admitted for more than 26 days in hospital. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.days_stay > "26" | mimicsql_data |
CREATE TABLE table_1342359_17 (
incumbent VARCHAR,
first_elected VARCHAR
) | Who won in 1927 | SELECT incumbent FROM table_1342359_17 WHERE first_elected = 1927 | sql_create_context |
CREATE TABLE table_19726 (
"Character" text,
"French voice actor" text,
"Italian voice actor" text,
"German voice actor" text,
"Spanish voice actor" text
) | Name the italian voice actor for dirk fenselau | SELECT "Italian voice actor" FROM table_19726 WHERE "German voice actor" = 'Dirk Fenselau' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
... | Select * from Users where Location = 'india'. | SELECT * FROM Users WHERE Location = 'india' | sede |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 年龄超过17岁的病人的医疗记录的平均医疗费总额有多少 | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_AGE >= 17 UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_AGE >= 17 UNION SELECT zyb.MED_CLINIC_ID FROM zyb WHERE zyb.PERSON_AGE >= 17 UNION SELECT mzb.MED_CLINIC_ID FROM mzb WHERE mzb.PER... | css |
CREATE TABLE table_name_69 (
game INTEGER,
date VARCHAR
) | What is the lowest game number on February 20? | SELECT MIN(game) FROM table_name_69 WHERE date = "february 20" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | For those employees who did not have any job in the past, return a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by weekday. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_1974 (
"Graphics mode" real,
"Char cells" text,
"Pixels" text,
"Hardware colours" real,
"used (KB)" real,
"map" text,
"Type" text
) | If graphics mode is less than 1.0, what are the char cells? | SELECT "Char cells" FROM table_1974 WHERE "Graphics mode" < '1.0' | wikisql |
CREATE TABLE table_name_66 (
res VARCHAR,
time VARCHAR
) | What was the result when the time was 4:15? | SELECT res FROM table_name_66 WHERE time = "4:15" | sql_create_context |
CREATE TABLE table_name_7 (
score VARCHAR,
record VARCHAR
) | What is the score of the game where the record was 22-55? | SELECT score FROM table_name_7 WHERE record = "22-55" | sql_create_context |
CREATE TABLE Person (
name VARCHAR,
age VARCHAR
) | Find the names of all person sorted in the descending order using age. | SELECT name FROM Person ORDER BY age DESC | sql_create_context |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | i mean what was the first arterial bp mean for patient 1462 since 1247 days ago? | 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 = 1462)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b... | mimic_iii |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE diagnosis (
diagnosisid number... | what were the five most commonly given microbiology tests for patients that had previously received chest x-ray within 2 months the last year? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'chest x-ray' AND DATETIME(treatment.treatmen... | eicu |
CREATE TABLE table_name_17 (
finish VARCHAR,
year VARCHAR
) | What is the finish in 1956? | SELECT finish FROM table_name_17 WHERE year = "1956" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)... | Which , if any , advisory prerequisites are there for Food and Drink of Asia ? | SELECT DISTINCT advisory_requirement FROM course WHERE name LIKE '%Food and Drink of Asia%' | advising |
CREATE TABLE table_name_93 (
melbourne INTEGER,
episode_number_production_number VARCHAR,
sydney VARCHAR
) | What is the sum of the values for Melbourne, when Episode Number Production Number is 19 2-06, and when Sydney is less than 389,000? | SELECT SUM(melbourne) FROM table_name_93 WHERE episode_number_production_number = "19 2-06" AND sydney < 389 OFFSET 000 | sql_create_context |
CREATE TABLE table_23793 (
"shareholder name" text,
"A shares" real,
"B shares" real,
"% of capital" text,
"% of votes" text
) | How many different numbers of B shares does Handelsbanken fonder have? | SELECT COUNT("B shares") FROM table_23793 WHERE "shareholder name" = 'Handelsbanken fonder' | wikisql |
CREATE TABLE table_18761 (
"Season" text,
"Timeslot" text,
"Season Premiere" text,
"Season Finale" text,
"Episodes" real,
"TV Season" text,
"Ranking" text,
"Viewers (in millions)" text
) | In what TV season did the 3rd season air? | SELECT "TV Season" FROM table_18761 WHERE "Season" = '3rd' | wikisql |
CREATE TABLE table_11950720_4 (
bowling_style VARCHAR,
player VARCHAR
) | What is the bowling style of chris harris? | SELECT bowling_style FROM table_11950720_4 WHERE player = "Chris Harris" | sql_create_context |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | tell me the top three of the most common procedures this year? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY treatment.treatmentname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE table_name_20 (
original_air_date INTEGER,
series_number VARCHAR
) | What was the original air date of series number 10? | SELECT AVG(original_air_date) FROM table_name_20 WHERE series_number = 10 | sql_create_context |
CREATE TABLE table_56632 (
"Series" real,
"Year" text,
"Winner" text,
"Runner-up" text,
"Third place" text,
"Fourth place" text,
"Fifth place" text,
"Sixth place" text,
"Host" text
) | What series had Joan Tena in sixth place? | SELECT SUM("Series") FROM table_56632 WHERE "Sixth place" = 'joan tena' | wikisql |
CREATE TABLE table_1342338_6 (
result VARCHAR,
district VARCHAR
) | What is the result for california 2? | SELECT result FROM table_1342338_6 WHERE district = "California 2" | sql_create_context |
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 the death status of patients named paul edwards | SELECT demographic.expire_flag FROM demographic WHERE demographic.name = "Paul Edwards" | mimicsql_data |
CREATE TABLE table_name_42 (
attendance VARCHAR,
result VARCHAR
) | How many were in attendance when the result was l 20-17? | SELECT attendance FROM table_name_42 WHERE result = "l 20-17" | sql_create_context |
CREATE TABLE table_name_14 (
venue VARCHAR,
away_team VARCHAR
) | In which venue was North Melbourne the Away team? | SELECT venue FROM table_name_14 WHERE away_team = "north melbourne" | sql_create_context |
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... | what is the number of patients with snf discharge who were admitted to hospital before 2154? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SNF" AND demographic.admityear < "2154" | mimicsql_data |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Dorm (
dormid INTEGE... | How many students live in each city? Show a bar chart, I want to rank by the bar in ascending. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code | nvbench |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
va... | what were the top five most common diagnoses for patients of the 30s since 4 years ago? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE table_64355 (
"World record" text,
"Snatch" text,
"Ri Song-Hui ( PRK )" text,
"102kg" text,
"Busan , South Korea" text
) | What's the 102kg when the Ri Song-Hui was 226kg? | SELECT "102kg" FROM table_64355 WHERE "Ri Song-Hui ( PRK )" = '226kg' | wikisql |
CREATE TABLE table_name_93 (
date VARCHAR,
actual_title VARCHAR
) | What date has ed as an actual title? | SELECT date FROM table_name_93 WHERE actual_title = "ed" | sql_create_context |
CREATE TABLE table_40327 (
"Office" text,
"Republican ticket" text,
"Democratic ticket" text,
"American Labor ticket" text,
"Liberal ticket" text,
"Communist ticket" text
) | What is the Office when spencer c. young is on the liberal ticket?? | SELECT "Office" FROM table_40327 WHERE "Liberal ticket" = 'spencer c. young' | wikisql |
CREATE TABLE table_810 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What were the points for when there were 30 tries against? | SELECT "Points for" FROM table_810 WHERE "Tries against" = '30' | wikisql |
CREATE TABLE table_50545 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | Which Away Team has a Tie no of replay and a Home Team of Chesterfield? | SELECT "Away team" FROM table_50545 WHERE "Tie no" = 'replay' AND "Home team" = 'chesterfield' | wikisql |
CREATE TABLE table_36205 (
"Date" text,
"Episode" real,
"Performer 1" text,
"Performer 2" text,
"Performer 3" text,
"Performer 4" text
) | Episode of 9 in which performer 3 had? | SELECT "Performer 3" FROM table_36205 WHERE "Episode" = '9' | wikisql |
CREATE TABLE table_name_31 (
total INTEGER,
rank VARCHAR,
gold VARCHAR
) | What is the largest total when the rank is 6 and there's less than 1 gold? | SELECT MAX(total) FROM table_name_31 WHERE rank = "6" AND gold < 1 | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id numbe... | is there anything patient 69819 has had a diagnosis with until 2 years ago? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 69819) AND DATETIME(diagnoses_icd.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') | mimic_iii |
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... | how many patients are admitted under phys referral/normal delivery and discharge due to dead/expired? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.discharge_location = "DEAD/EXPIRED" | mimicsql_data |
CREATE TABLE table_204_98 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | how long did luis jesus take to finish in turin , italy in 1998 ? | SELECT "notes" FROM table_204_98 WHERE "year" = 1998 | squall |
CREATE TABLE table_25468520_1 (
design VARCHAR,
quantity VARCHAR
) | What is the design when quantity is 5,000,000? | SELECT design FROM table_25468520_1 WHERE quantity = "5,000,000" | sql_create_context |
CREATE TABLE table_25597 (
"No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text,
"18-49 Rating/Share" text
) | What was the original air date of episode number 1? | SELECT "Original air date" FROM table_25597 WHERE "No." = '1' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.