context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_38 (
extras INTEGER,
name VARCHAR,
runs_conceded VARCHAR
) | What is the average Extras for Muttiah Muralitharan, with less than 353 Runs Conceded? | SELECT AVG(extras) FROM table_name_38 WHERE name = "muttiah muralitharan" AND runs_conceded < 353 | sql_create_context |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of job_id and manager_id , sort Y from low to high order please. | SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID | nvbench |
CREATE TABLE manager (
player_id TEXT,
year INTEGER,
team_id TEXT,
league_id TEXT,
inseason INTEGER,
g INTEGER,
w INTEGER,
l INTEGER,
rank NUMERIC,
plyr_mgr TEXT
)
CREATE TABLE fielding_outfield (
player_id TEXT,
year INTEGER,
stint INTEGER,
glf NUMERIC,
gcf ... | Show me the frequency of the weekdays (binning year into weekdays interval) that the team Boston Red Stockings won in the postseasons with a bar chart. | SELECT year, COUNT(year) FROM postseason AS T1 JOIN team AS T2 ON T1.team_id_winner = T2.team_id_br WHERE T2.name = 'Boston Red Stockings' | nvbench |
CREATE TABLE table_name_85 (
attendance VARCHAR,
opponent VARCHAR
) | What was Bye's opponent's attendance? | SELECT attendance FROM table_name_85 WHERE opponent = "bye" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | tell me the number of patients who were admitted before the year 2172 and underwent aortography. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2172" AND procedures.long_title = "Aortography" | mimicsql_data |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE VoteTypes (
Id number,
Name text... | Find duplicated questions which user has answered. | SELECT p.ParentId, p.Id AS "post_link", p.Title, pp.Title FROM Posts AS p JOIN Posts AS pp ON p.ParentId = pp.Id JOIN PostHistory AS ph ON ph.PostId = pp.Id WHERE p.PostTypeId = 2 AND p.OwnerUserId = '##userid##' AND ph.PostHistoryTypeId = 10 AND ph.Comment = 101 AND NOT pp.ClosedDate IS NULL | sede |
CREATE TABLE table_75584 (
"County" text,
"Per capita income" text,
"Median household income" text,
"Population" real,
"Number of households" real
) | What is the per capital income for Charles county? | SELECT "Per capita income" FROM table_75584 WHERE "County" = 'charles' | wikisql |
CREATE TABLE table_39000 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest number of bronze medals with less than 2 silver medals and more than 1 medal in total for Uzbekistan? | SELECT MIN("Bronze") FROM table_39000 WHERE "Silver" < '2' AND "Total" > '1' AND "Nation" = 'uzbekistan' | wikisql |
CREATE TABLE table_name_36 (
date VARCHAR,
attendance INTEGER
) | When was the Attendance larger than 74,382? | SELECT date FROM table_name_36 WHERE attendance > 74 OFFSET 382 | sql_create_context |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Search User by their Display Name. Filter users by their Display Name, and Country Name | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, WebsiteUrl FROM Users WHERE LOWER(Location) LIKE LOWER('%##CityName##%') AND LOWER(DisplayName) LIKE LOWER('%##UserName##%') ORDER BY Reputation DESC | sede |
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 diagnosis did patient 007-16774 first receive during the previous year? | SELECT diagnosis.diagnosisname FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-16774')) AND DATETIME(diagnosis.diagnosistime, 'start of year... | eicu |
CREATE TABLE table_7419 (
"Home team" text,
"Away team" text,
"Match score" text,
"\"Pick The Winners\" score" text,
"FootyTAB winner" text
) | What is the Away team when the FootyTAB winner was st. george? | SELECT "Away team" FROM table_7419 WHERE "FootyTAB winner" = 'st. george' | wikisql |
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
)
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE authors (
authid number,
lname text,
fname text
) | Find the last name of the author with first name 'Amal'. | SELECT lname FROM authors WHERE fname = "Amal" | spider |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wa... | has patient 022-89058 been prescribed acetaminophen, 50 ml vial : dextrose 50 % iv soln, or acetaminophen (tylenol) tablet 650 mg when they came to the hospital first time? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-89058' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.... | eicu |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE admissions (
row_id numbe... | what is patient 94293's daily average level of asparate aminotransferase (ast) during their first hospital encounter? | SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94293 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = '... | mimic_iii |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | Count the number of male students who had class senator votes in the fall election cycle. | SELECT COUNT(*) FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = class_senator_vote WHERE T1.sex = "M" AND T2.election_cycle = "Fall" | spider |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
... | In Spring or Summer 2008 which hardware courses are offered ? | SELECT DISTINCT course.department, course.name, course.number, semester.semester FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE area.area LIKE '%hardw... | advising |
CREATE TABLE table_5579 (
"Result" text,
"Record" text,
"Opponent" text,
"Event" text,
"Method" text,
"Round" text,
"Time" text
) | What was the record after the NJKF Magnam 16 event that lasted 2:06? | SELECT "Record" FROM table_5579 WHERE "Time" = '2:06' AND "Event" = 'njkf magnam 16' | wikisql |
CREATE TABLE table_55916 (
"Season" text,
"Club" text,
"National League" text,
"National Cup" text,
"European Cup" text
) | What Club has Fiba European Champion's Cup and an Italian Cup? | SELECT "Club" FROM table_55916 WHERE "European Cup" = 'fiba european champion''s cup' AND "National Cup" = 'italian cup' | wikisql |
CREATE TABLE table_name_97 (
game_site VARCHAR,
opponent VARCHAR
) | What's the Game SIte with an Opponent of San Diego Chargers? | SELECT game_site FROM table_name_97 WHERE opponent = "san diego chargers" | sql_create_context |
CREATE TABLE table_name_66 (
team_chassis VARCHAR,
pts INTEGER
) | Which Team/Chassis has less than 65 points? | SELECT team_chassis FROM table_name_66 WHERE pts < 65 | sql_create_context |
CREATE TABLE table_67608 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text
) | How many points against did Carmarthen Athletic RFC have when they played 22 games ? | SELECT "Points against" FROM table_67608 WHERE "Played" = '22' AND "Club" = 'carmarthen athletic rfc' | wikisql |
CREATE TABLE table_name_81 (
matches VARCHAR,
points_for VARCHAR
) | What match had 240 points for? | SELECT matches FROM table_name_81 WHERE points_for = "240" | sql_create_context |
CREATE TABLE table_name_66 (
wins INTEGER,
top_25 INTEGER
) | What is the average wins has Top-25 less than 0? | SELECT AVG(wins) FROM table_name_66 WHERE top_25 < 0 | sql_create_context |
CREATE TABLE table_name_34 (
decile VARCHAR,
name VARCHAR
) | What is the total number of decile for the redwood school locality? | SELECT COUNT(decile) FROM table_name_34 WHERE name = "redwood school" | sql_create_context |
CREATE TABLE table_27441210_17 (
number_one_single_s_ VARCHAR,
artist VARCHAR
) | What number-one single is performed by artist Pep's? | SELECT number_one_single_s_ FROM table_27441210_17 WHERE artist = "Pep's" | sql_create_context |
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varcha... | what DL flights from CINCINNATI to NEW YORK arrive at NEW YORK before 1800 on saturday | 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 (((((((flight.arrival_time < 41 OR flight.time_elapsed >= 60) AND flight.departure_time > flight.arrival_time) AND date_day.day_number = 26 AND d... | atis |
CREATE TABLE table_68192 (
"First game" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Percentage" text
) | What is the highest number of draws that correlates with a percentage of 0.00% and less than 1 loss? | SELECT MAX("Drawn") FROM table_68192 WHERE "Percentage" = '0.00%' AND "Lost" < '1' | wikisql |
CREATE TABLE table_name_66 (
silver INTEGER,
total INTEGER
) | what is the average silver when the total is more than 20? | SELECT AVG(silver) FROM table_name_66 WHERE total > 20 | sql_create_context |
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 procedure does patient 88659 receive in the last year for the first time? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT procedures_icd.icd9_code FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 88659) AND DATETIME(procedures_icd.charttime, 'start of year') = DAT... | mimic_iii |
CREATE TABLE table_38106 (
"Orbital regime" text,
"Launches" real,
"Successes" real,
"Failures" real,
"Accidentally Achieved" real
) | What is the greatest successes that have failures greater than 1 and launches less than 28? | SELECT MAX("Successes") FROM table_38106 WHERE "Failures" > '1' AND "Launches" < '28' | wikisql |
CREATE TABLE table_name_73 (
laps INTEGER,
rank VARCHAR
) | What is the highest laps of the year when the rank was 14? | SELECT MAX(laps) FROM table_name_73 WHERE rank = "14" | sql_create_context |
CREATE TABLE wedding (
Church_ID int,
Male_ID int,
Female_ID int,
Year int
)
CREATE TABLE church (
Church_ID int,
Name text,
Organized_by text,
Open_Date int,
Continuation_of text
)
CREATE TABLE people (
People_ID int,
Name text,
Country text,
Is_Male text,
Age ... | Give me the trend about the number of church opening in each year, could you show by the X-axis in desc? | SELECT Open_Date, COUNT(Open_Date) FROM church GROUP BY Open_Date ORDER BY Open_Date DESC | nvbench |
CREATE TABLE table_name_59 (
tournament VARCHAR
) | What is 1994, when 1991 is 'QF', and when Tournament is 'Australian Open'? | SELECT 1994 FROM table_name_59 WHERE 1991 = "qf" AND tournament = "australian open" | sql_create_context |
CREATE TABLE table_12113888_1 (
number INTEGER
) | What is the highest number listed? | SELECT MAX(number) FROM table_12113888_1 | sql_create_context |
CREATE TABLE table_27305 (
"Team" text,
"#" real,
"Primary Sponsor" text,
"Driver(s)" text,
"Listed Owner(s)" text,
"Engine" text,
"Chassis" text
) | Who drives the abc supply sponsored cor? | SELECT "Driver(s)" FROM table_27305 WHERE "Primary Sponsor" = 'ABC Supply' | wikisql |
CREATE TABLE table_10239 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the crowd number when the home team was Carlton? | SELECT MIN("Crowd") FROM table_10239 WHERE "Home team" = 'carlton' | wikisql |
CREATE TABLE table_29626583_3 (
pick__number INTEGER,
mls_team VARCHAR,
affiliation VARCHAR
) | What is the pick number for the team toronto fc and affiliation is ldu quito? | SELECT MAX(pick__number) FROM table_29626583_3 WHERE mls_team = "Toronto FC" AND affiliation = "LDU Quito" | sql_create_context |
CREATE TABLE table_57164 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Driver" text,
"Rounds" text
) | Who is the driver whose Constructor was Era, and whose entrant was T.A.S.O. Mathieson? | SELECT "Driver" FROM table_57164 WHERE "Constructor" = 'era' AND "Entrant" = 't.a.s.o. mathieson' | wikisql |
CREATE TABLE table_name_53 (
round VARCHAR,
pick__number VARCHAR
) | In what Round was Pick #12 drafted? | SELECT round FROM table_name_53 WHERE pick__number = 12 | sql_create_context |
CREATE TABLE table_50644 (
"Tournament" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"Career SR" text,
"Career Win-Loss" text
) | What is Tournament, when 2001 is '1R'? | SELECT "Tournament" FROM table_50644 WHERE "2001" = '1r' | wikisql |
CREATE TABLE table_name_5 (
date VARCHAR,
region VARCHAR,
label VARCHAR
) | Which date was associated with the release in Europe on the Wichita Recordings label? | SELECT date FROM table_name_5 WHERE region = "europe" AND label = "wichita recordings" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | tell me the top four diagnosis that has the highest two year mortality rate? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t4.icd9_code FROM (SELECT t3.icd9_code, DENSE_RANK() OVER (ORDER BY t3.c1 DESC) AS c2 FROM (SELECT t2.icd9_code, 100 - SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.chartt... | mimic_iii |
CREATE TABLE table_24353141_1 (
original_3rd_us_tour_cast VARCHAR,
original_uk_cast VARCHAR
) | How many original 3rd us tour cast were there while the original uk cast was alyssa dipalma? | SELECT COUNT(original_3rd_us_tour_cast) FROM table_24353141_1 WHERE original_uk_cast = "Alyssa DiPalma" | sql_create_context |
CREATE TABLE table_25119 (
"Details" text,
"Host Nation(s)" text,
"Final Venue" text,
"Winner" text,
"Result" text,
"Runner-up" text
) | What is the name of the host nations if the winner was Hong Kong 207/6 (47.1 overs)? | SELECT "Host Nation(s)" FROM table_25119 WHERE "Winner" = 'Hong Kong 207/6 (47.1 overs)' | wikisql |
CREATE TABLE table_20436 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" text,
"Time" text,
"Jockey" text,
"Winner/2nd" text
) | Which horse won with a time of 1:35.98 and what was their position? | SELECT "Winner/2nd" FROM table_20436 WHERE "Time" = '1:35.98' | wikisql |
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_... | what are the flights from CHARLOTTE to ATLANTA returning on tuesday 7 13 | 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, state WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND date_day.day_number = 13 AND date_day.month_number = ... | atis |
CREATE TABLE table_name_45 (
points INTEGER,
goals_against VARCHAR,
losses VARCHAR
) | How many Points have Goals against of 35, and less than 13 losses? | SELECT SUM(points) FROM table_name_45 WHERE goals_against = 35 AND losses < 13 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | 有哪些人审核超过13份检验报告单在医疗就诊71249027132中?列出这些审核人工号和姓名分别是? | SELECT SHRGH, SHRXM FROM jybgb WHERE JZLSH = '71249027132' GROUP BY SHRGH HAVING COUNT(*) > 13 | css |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 自2001.10.27起,至2007.12.2止,共有多少医务人员为患者41857706检测指标303435,想知道他们的工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGD... | css |
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 year is less than 2120 and procedure short title is suture of artery? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2120" AND procedures.short_title = "Suture of artery" | mimicsql_data |
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE player (
Player_ID int,
name text,
Position text,
Club_ID int,
Apps real,
Trie... | What are the types of competition and number of competitions for that type Show bar chart, and display names in ascending order. | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients born before 2184 who have lab test item id 51250. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2184" AND lab.itemid = "51250" | mimicsql_data |
CREATE TABLE table_name_91 (
grid INTEGER,
time_retired VARCHAR,
laps VARCHAR,
manufacturer VARCHAR
) | What is the lowest Grid with 25 laps manufactured by Honda with a time of +54.103? | SELECT MIN(grid) FROM table_name_91 WHERE laps = 25 AND manufacturer = "honda" AND time_retired = "+54.103" | sql_create_context |
CREATE TABLE table_59756 (
"Player" text,
"Draft" text,
"Round" real,
"Pick" real,
"Position" text,
"NFL Club" text
) | Which Pick has a Player of chuck bryant, and an NFL Club of san diego chargers? | SELECT "Pick" FROM table_59756 WHERE "Player" = 'chuck bryant' AND "NFL Club" = 'san diego chargers' | wikisql |
CREATE TABLE table_816 (
"Stain" text,
"Common use" text,
"Nucleus" text,
"Cytoplasm" text,
"Red blood cell (RBC)" text,
"Collagen fibers" text,
"Specifically stains" text
) | A nucleus that is blue/black will specifically stain what? | SELECT "Specifically stains" FROM table_816 WHERE "Nucleus" = 'Blue/black' | wikisql |
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 married patients died in or before 2165? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.dod_year <= "2165.0" | mimicsql_data |
CREATE TABLE table_204_32 (
id number,
"season" number,
"division" text,
"w-l" text,
"finish" text,
"home" text,
"road" text,
"gf" number,
"ga" number,
"coach" text,
"playoffs" text,
"avg attendance" number
) | the team 's record in 2011 was the same was it 's record in what year | SELECT "season" FROM table_204_32 WHERE "season" <> 2011 AND "w-l" = (SELECT "w-l" FROM table_204_32 WHERE "season" = 2011) | squall |
CREATE TABLE table_14984103_1 (
attendance INTEGER,
game_site VARCHAR
) | Name the most attendance for game site for los angeles memorial coliseum | SELECT MAX(attendance) FROM table_14984103_1 WHERE game_site = "Los Angeles Memorial Coliseum" | sql_create_context |
CREATE TABLE table_4266 (
"Material" text,
"Type" text,
"Geometry" text,
"Output voltage" text,
"Output power" text,
"Synthesis" text,
"Researched at" text
) | How many synthesis are there for 5~16.2 pw per cycle (calculated) output power? | SELECT COUNT("Synthesis") FROM table_4266 WHERE "Output power" = '5~16.2 pW per cycle (calculated)' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | how many patients whose drug code is lans30st and lab test fluid is cerebrospinal fluid (csf)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LANS30ST" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
CREATE TABLE table_56479 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | What is the constructor of the race with Juan Manuel Fangio as the fastest lap and Giuseppe Farina as the winning driver? | SELECT "Constructor" FROM table_56479 WHERE "Fastest lap" = 'juan manuel fangio' AND "Winning driver" = 'giuseppe farina' | wikisql |
CREATE TABLE table_50213 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text,
"Man of the Match" text
) | What is the Result when the Attendance is 1,634? | SELECT "Result" FROM table_50213 WHERE "Attendance" = '1,634' | wikisql |
CREATE TABLE table_name_15 (
tyres VARCHAR,
points VARCHAR,
chassis VARCHAR
) | What tyres have 1 point and an ensign n177 chassis? | SELECT tyres FROM table_name_15 WHERE points = "1" AND chassis = "ensign n177" | sql_create_context |
CREATE TABLE table_name_33 (
away_team VARCHAR,
home_team VARCHAR
) | What is the Away team at Bristol Rovers' Home game? | SELECT away_team FROM table_name_33 WHERE home_team = "bristol rovers" | sql_create_context |
CREATE TABLE table_name_22 (
stage VARCHAR,
winner VARCHAR
) | Name the stgae with winner of robbie mcewen | SELECT stage FROM table_name_22 WHERE winner = "robbie mcewen" | sql_create_context |
CREATE TABLE table_25323 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Cowboys points" real,
"Opponents" real,
"Record" text
) | How many records show Utah as the opponent? | SELECT COUNT("Record") FROM table_25323 WHERE "Opponent" = 'Utah' | wikisql |
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... | Calculate the number of patients treated with drug hydx25 who died in or before the year 2186. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dod_year <= "2186.0" AND prescriptions.formulary_drug_cd = "HYDX25" | mimicsql_data |
CREATE TABLE table_name_39 (
japanese_orthography VARCHAR,
abbreviation VARCHAR
) | What is the Japanese orthography for the abbreviation of ndmc? | SELECT japanese_orthography FROM table_name_39 WHERE abbreviation = "ndmc" | sql_create_context |
CREATE TABLE table_name_96 (
year INTEGER,
title VARCHAR
) | What is recorded as the lowest Year that has the Title of Cold Feet? | SELECT MIN(year) FROM table_name_96 WHERE title = "cold feet" | sql_create_context |
CREATE TABLE table_16601 (
"No." real,
"Episode" text,
"Air Date" text,
"Timeslot" text,
"Rating" text,
"Share" text,
"18\u201349 (Rating/Share)" text,
"Viewers (m)" text,
"Rank (#)" text
) | What's the rating of the episode originally aired on May 5, 2009? | SELECT "Rating" FROM table_16601 WHERE "Air Date" = 'May 5, 2009' | wikisql |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 根据不同的入院诊断疾病名称和科室编码,列出医院0923184患者的平均年龄在所有医疗就诊记录中是多大? | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '0923184' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '09231... | css |
CREATE TABLE table_50804 (
"Year" text,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | WHich Open Cup has a Division larger than 4? | SELECT "Open Cup" FROM table_50804 WHERE "Division" > '4' | wikisql |
CREATE TABLE table_name_23 (
fleet_number VARCHAR,
model VARCHAR
) | What is the fleet number of Model Orion 01.507? | SELECT fleet_number FROM table_name_23 WHERE model = "orion 01.507" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 查询6350564医院的科室838涉及的医疗费总额,时间范围是零四年七月十五日到一五年一月二十二日 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6350564' AND t_kc21.MED_ORG_DEPT_CD = '838') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-07-15' AND '2015-01-22' | css |
CREATE TABLE table_52805 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" text,
"Ties" real,
"Goals For" real,
"Goals Against" real
) | Which team had 7 losses and 55 goals? | SELECT "Team" FROM table_52805 WHERE "Losses" = '7' AND "Goals For" = '55' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | what is the daily average intake of lipids that patient 005-87465 is getting on this hospital visit? | SELECT AVG(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-87465' AND patient.hospitaldischargetime IS ... | eicu |
CREATE TABLE table_1342149_18 (
result VARCHAR,
incumbent VARCHAR
) | What was the result in the election where Hale Boggs was the incumbent? | SELECT result FROM table_1342149_18 WHERE incumbent = "Hale Boggs" | sql_create_context |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | what flights from HOUSTON to MILWAUKEE on friday in the evening on AA | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MILWAUKEE' AND date_day.day_number = 25 AND date_day.month_number = 6 A... | atis |
CREATE TABLE physician (
employeeid VARCHAR,
name VARCHAR
)
CREATE TABLE patient (
SSN VARCHAR
)
CREATE TABLE prescribes (
patient VARCHAR,
physician VARCHAR
) | How many patients' prescriptions are made by physician John Dorian? | SELECT COUNT(T1.SSN) FROM patient AS T1 JOIN prescribes AS T2 ON T1.SSN = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = "John Dorian" | sql_create_context |
CREATE TABLE table_22713796_14 (
stage VARCHAR,
mountains_classification VARCHAR
) | Name the stage for no award | SELECT stage FROM table_22713796_14 WHERE mountains_classification = "no award" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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 number,
icustay_id n... | how many hours have it been since patient 97395 had the first idio periph neurpthy nos diagnosis during this hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'idio periph neurpthy nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM ad... | mimic_iii |
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 procedures_icd (
row_id number,
subject_id number,
... | when was the first lap gastric restric proc done for patient 4718 until 3 years ago? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'lap gastric restric proc') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4718) AND ... | mimic_iii |
CREATE TABLE table_23235 (
"Office" text,
"Branch" text,
"Location" text,
"Elected" real,
"Term began" text,
"Term ended" text
) | What year was the congressional service elected for a term beginning on January 3, 1989? | SELECT "Elected" FROM table_23235 WHERE "Term began" = 'January 3, 1989' | wikisql |
CREATE TABLE table_50397 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text,
"Home Rink" text
) | What primary conference does the team nicknamed Phoenix belongs to? | SELECT "Primary conference" FROM table_50397 WHERE "Team Nickname" = 'phoenix' | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTy... | [draft] How many upvotes do I have for each tag?. How many upvotes do I have for each tag? (how long before I get tag badges?) | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY UpVotes DESC | sede |
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... | count the number of patients admitted on an urgent basis who stayed in hospital for more than 5 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.days_stay > "5" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | give me the number of patients whose ethnicity is american indian/alaska native and their lab test is d-dimer. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.label = "D-Dimer" | mimicsql_data |
CREATE TABLE table_name_93 (
upper_index_kcal__nm_3 INTEGER,
lower_index_mj__nm_3 VARCHAR,
upper_index_mj__nm_3 VARCHAR
) | What is the entry for Upper index Kcal/ Nm 3 for the row with an entry that has a Lower index MJ/ Nm 3 of 47.91, and an Upper index MJ/ Nm 3 larger than 53.28? | SELECT SUM(upper_index_kcal__nm_3) FROM table_name_93 WHERE lower_index_mj__nm_3 = 47.91 AND upper_index_mj__nm_3 > 53.28 | sql_create_context |
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... | Find out the time of admission and number of days for which the patient with patient id 15061 stayed in the hospital. | SELECT demographic.days_stay, demographic.admittime FROM demographic WHERE demographic.subject_id = "15061" | mimicsql_data |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | 患者39436080954在门诊就诊时其就诊状态代码是多少叫什么名称? | SELECT txmzjzjlb.JZZTDM, txmzjzjlb.JZZTMC FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '39436080954' UNION SELECT ftxmzjzjlb.JZZTDM, ftxmzjzjlb.JZZTMC FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '39436080954' | css |
CREATE TABLE Mailshot_Campaigns (
mailshot_id INTEGER,
product_category VARCHAR(15),
mailshot_name VARCHAR(80),
mailshot_start_date DATETIME,
mailshot_end_date DATETIME
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
premise_id INTEGER,
date_address_from DATETIME,
address_t... | Create a bar chart showing the total number across premises type, I want to order Y in ascending order. | SELECT premises_type, COUNT(*) FROM Premises GROUP BY premises_type ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_31051 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What season number is the episode 'The Gang Cracks The Liberty Bell'? | SELECT MIN("No. in season") FROM table_31051 WHERE "Title" = 'The Gang Cracks the Liberty Bell' | wikisql |
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
building varchar(15),
room_number varchar(7),
time_slot_id varchar(... | How many courses are provided in each year? Visualize with a line chart, sort in descending by the x axis. | SELECT year, COUNT(*) FROM section ORDER BY year DESC | nvbench |
CREATE TABLE table_74255 (
"Date/Location" text,
"Mens singles" text,
"Womens Singles" text,
"U21 Mens" text,
"U21 Womens" text,
"Mixed Restricted" text,
"Mixed Veteran" text
) | When Paul Whiting won the mixed veteran, who won the mixed restricted? | SELECT "Mixed Restricted" FROM table_74255 WHERE "Mixed Veteran" = 'Paul Whiting' | wikisql |
CREATE TABLE table_54509 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which was the home team that had an opponent have a score of 11.6 (72)? | SELECT "Home team score" FROM table_54509 WHERE "Away team score" = '11.6 (72)' | wikisql |
CREATE TABLE table_name_21 (
number_of_electorates__2009_ VARCHAR,
reserved_for___sc___st__none_ VARCHAR
) | Which Number of electorates (2009) has a Reserved for (SC / ST /None) of total:? | SELECT number_of_electorates__2009_ FROM table_name_21 WHERE reserved_for___sc___st__none_ = "total:" | sql_create_context |
CREATE TABLE table_name_31 (
reserved_for___sc___st__none_ VARCHAR,
name VARCHAR
) | What is Beohari's reserved for (SC/ST/None)? | SELECT reserved_for___sc___st__none_ FROM table_name_31 WHERE name = "beohari" | sql_create_context |
CREATE TABLE table_40851 (
"Republican ticket" text,
"Democratic ticket" text,
"American Labor ticket" text,
"Communist ticket" text,
"Socialist ticket" text
) | Who's the Republican ticket with a Democratic ticket of flora d. johnson? | SELECT "Republican ticket" FROM table_40851 WHERE "Democratic ticket" = 'flora d. johnson' | wikisql |
CREATE TABLE table_233830_1 (
number_of_channels VARCHAR,
channels VARCHAR
) | If the channels is wxyzuv, what is the number of channels? | SELECT number_of_channels FROM table_233830_1 WHERE channels = "WXYZUV" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.