context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE Guests (
gues... | How many bookings does each booking status have? List the booking status code and the number of corresponding bookings with a bar chart, and show names in asc order. | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY booking_status_code | nvbench |
CREATE TABLE table_name_24 (
home_ground VARCHAR,
position_in_2012_13 VARCHAR
) | When the position in 2012-12 is 7th, third division what is the home ground? | SELECT home_ground FROM table_name_24 WHERE position_in_2012_13 = "7th, third division" | sql_create_context |
CREATE TABLE table_12282 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the Venue of the 2002 World Cup Qualification? | SELECT "Venue" FROM table_12282 WHERE "Competition" = '2002 world cup qualification' | wikisql |
CREATE TABLE table_name_17 (
time INTEGER,
lane VARCHAR,
rank VARCHAR
) | Name the sum of time for lane of 1 and rank less than 8 | SELECT SUM(time) FROM table_name_17 WHERE lane = 1 AND rank < 8 | sql_create_context |
CREATE TABLE table_name_31 (
country VARCHAR,
year VARCHAR
) | What country had a film in 1993? | SELECT country FROM table_name_31 WHERE year = 1993 | sql_create_context |
CREATE TABLE table_name_4 (
score VARCHAR,
country VARCHAR,
player VARCHAR
) | what is the score when the country is united states and the player is george fazio? | SELECT score FROM table_name_4 WHERE country = "united states" AND player = "george fazio" | 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... | provide the number of female patients who have drug code azit500i. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "AZIT500I" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is primary disease and drug name of subject name wilbur braatz? | SELECT demographic.diagnosis, prescriptions.drug FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Wilbur Braatz" | mimicsql_data |
CREATE TABLE table_50633 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What player is in the place of t1 and has the score of 67-70=137? | SELECT "Player" FROM table_50633 WHERE "Place" = 't1' AND "Score" = '67-70=137' | wikisql |
CREATE TABLE gwyjzb (
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,
... | 那个11103457号的病患在看病过程中被开出的药品都少于9690.79元的医疗就诊编号是多少? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '11103457' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 9690.79) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '11103457' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI... | css |
CREATE TABLE table_203_186 (
id number,
"painter" text,
"composition" number,
"drawing" number,
"color" number,
"expression" number
) | how many painters received a color mark below 10 ? | SELECT COUNT("painter") FROM table_203_186 WHERE "color" < 10 | squall |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownV... | User ranking for questions only, simple - no check for CW or rep cap. | SELECT p.OwnerUserId AS "user_link", COUNT(DISTINCT p.Id) AS "total_questions", SUM(CASE WHEN VoteTypeId = 2 THEN 5 WHEN VoteTypeId = 3 THEN -2 END) + (SELECT COUNT(*) FROM Posts AS acc WHERE acc.OwnerUserId = p.OwnerUserId AND NOT AcceptedAnswerId IS NULL) * 2 AS "total_reputation" FROM Posts AS p INNER JOIN Votes AS ... | sede |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID ... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, and display in desc by the bar. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_name_35 (
fcc_info VARCHAR,
state VARCHAR,
city_of_license VARCHAR
) | What is the FCC info for the radio station in West Lafayette, Indiana? | SELECT fcc_info FROM table_name_35 WHERE state = "indiana" AND city_of_license = "west lafayette" | sql_create_context |
CREATE TABLE table_37198 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | On what Date was the Record 9 6 4? | SELECT "Date" FROM table_37198 WHERE "Record" = '9–6–4' | wikisql |
CREATE TABLE table_21345 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Competition" text,
"Man of the Match" text
) | How many attendance figures are given for the game where the final score was lost 5-3? | SELECT COUNT("Attendance") FROM table_21345 WHERE "Result" = 'Lost 5-3' | wikisql |
CREATE TABLE table_14153 (
"Year" real,
"September" text,
"October" text,
"November" text,
"December" text
) | Who is in December when November has Alexus Winston? | SELECT "December" FROM table_14153 WHERE "November" = 'alexus winston' | wikisql |
CREATE TABLE Customers (
customer_id INTEGER,
customer_type_code VARCHAR(20),
address_line_1 VARCHAR(80),
address_line_2 VARCHAR(80),
town_city VARCHAR(80),
state VARCHAR(80),
email_address VARCHAR(255),
phone_number VARCHAR(80)
)
CREATE TABLE Products (
product_id INTEGER,
pare... | Bar graph to show the average of product price from different product category code, show names from low to high order. | SELECT product_category_code, AVG(product_price) FROM Products GROUP BY product_category_code ORDER BY product_category_code | nvbench |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDis... | Stackoverflow Top 100 users from Banglore. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%kolkata%' ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_204_863 (
id number,
"state" text,
"city/county" text,
"population served" number,
"charter type" text,
"station name" text,
"web site" text
) | what is the number of people served by the rolla station ? | SELECT "population served" FROM table_204_863 WHERE "city/county" = 'rolla' | squall |
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... | 列出患者姜浩歌就诊科室在医院1560846中名称包含牙病的所有门诊就诊记录是什么流水号? | SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '姜浩歌' AND hz_info.YLJGDM = '1560846' AND txmzjzjlb.JZKSMC LIKE '%牙病%' UNION SELECT ftxmzjzjlb.... | css |
CREATE TABLE table_name_55 (
lost VARCHAR,
drawn VARCHAR,
bonus_points VARCHAR
) | What is the number of lost games when 2 were drawn, and there were 6 bonus points? | SELECT lost FROM table_name_55 WHERE drawn = "2" AND bonus_points = "6" | sql_create_context |
CREATE TABLE table_name_74 (
time_of_airing_on_channel_4 VARCHAR,
episode_number VARCHAR,
title VARCHAR
) | What time did Channel 4 air an episode number larger than 106 with the title of Marry Me A Little? | SELECT time_of_airing_on_channel_4 FROM table_name_74 WHERE episode_number > 106 AND title = "marry me a little" | sql_create_context |
CREATE TABLE table_19384 (
"Country" text,
"Local Name" text,
"Host" text,
"Channel" text,
"Year Aired" text,
"Top Prize" text
) | How many hosts were on Seven Network? | SELECT COUNT("Host") FROM table_19384 WHERE "Channel" = 'Seven Network' | 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_DIRE_CD text,
MED_DIRE_NM text,... | 排出葛晴画患者医疗记录医疗费总额不少于6196.22元的中出院诊断疾病的编码是什么?其名称叫什么? | SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '葛晴画' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 6196.22) | css |
CREATE TABLE table_name_32 (
points INTEGER,
chassis VARCHAR,
year VARCHAR
) | What are the lowest points with a Chassis of zakspeed 841, and a Year smaller than 1985? | SELECT MIN(points) FROM table_name_32 WHERE chassis = "zakspeed 841" AND year < 1985 | sql_create_context |
CREATE TABLE table_20396710_1 (
points_difference VARCHAR,
points_for VARCHAR
) | when the points for is 139 is points difference? | SELECT COUNT(points_difference) FROM table_20396710_1 WHERE points_for = "139" | sql_create_context |
CREATE TABLE table_name_98 (
title VARCHAR,
characters VARCHAR
) | What title has daffy (as duck dodgers) as the character? | SELECT title FROM table_name_98 WHERE characters = "daffy (as duck dodgers)" | sql_create_context |
CREATE TABLE table_54099 (
"Tournament" text,
"1998" text,
"1999" text,
"2000" text,
"2001" text,
"2002" text,
"2003" text,
"2004" text,
"2005" text,
"2006" text,
"2007" text,
"Career SR" text
) | Which 2006 tournament had a 4R performance in 2001? | SELECT "2006" FROM table_54099 WHERE "2001" = '4r' | wikisql |
CREATE TABLE table_name_73 (
area_km_2 VARCHAR,
official_name VARCHAR
) | Saint-Jacques has what as the area km 2? | SELECT area_km_2 FROM table_name_73 WHERE official_name = "saint-jacques" | 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE transfers (
r... | for the first time , when did patient 27465 receive insert intercostal cath? | 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 = 'insert intercostal cath') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27465) ORDE... | mimic_iii |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeri... | what was the last systemicsystolic of patient 016-29746 since 07/12/2101. | SELECT vitalperiodic.systemicsystolic FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-29746')) AND NOT vitalperiodic.systemicsystoli... | eicu |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 整理下患者姜淑华在二零零四年七月三十日到二零二零年十一月二十六日内所有检验结果指标记录的检测人为17450031的检验指标流水号好嘛 | (SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM =... | css |
CREATE TABLE table_name_57 (
game__number INTEGER,
record VARCHAR
) | Record of 11-10-3 is what sum of game #? | SELECT SUM(game__number) FROM table_name_57 WHERE record = "11-10-3" | sql_create_context |
CREATE TABLE table_name_48 (
home_team VARCHAR
) | What is melbourne's home team score? | SELECT home_team AS score FROM table_name_48 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE table_73386 (
"S No" real,
"Team (A)" text,
"Team (B)" text,
"Winner" text,
"Margin" text,
"Match Date" text
) | What was the margin of the match on 19 Jan 2002? | SELECT "Margin" FROM table_73386 WHERE "Match Date" = '19 Jan 2002' | wikisql |
CREATE TABLE trip (
id VARCHAR,
duration VARCHAR
) | What are the ids and durations of the trips with the top 3 durations? | SELECT id, duration FROM trip ORDER BY duration DESC LIMIT 3 | sql_create_context |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Student_Tests_Taken (
registration_id I... | How many courses for each subject? Plot a bar chart. | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id | nvbench |
CREATE TABLE table_name_21 (
engine VARCHAR,
displacement VARCHAR,
power VARCHAR
) | Displacement of 4.4l (4423cc/269in ) and a Power of 220kw (299hp) @ 4000 belongs to what engine? | SELECT engine FROM table_name_21 WHERE displacement = "4.4l (4423cc/269in³)" AND power = "220kw (299hp) @ 4000" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
las... | what was patient 17435's first arterial bp mean on the first intensive care unit visit. | 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 = 17435) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.itemid IN (S... | mimic_iii |
CREATE TABLE table_204_867 (
id number,
"number" number,
"date" text,
"name" text,
"age\n(at execution)" number,
"age\n(at offense)" number,
"race" text,
"state" text,
"method" text
) | how many women were not executed by lethal injection ? | SELECT COUNT("name") FROM table_204_867 WHERE "method" <> 'lethal injection' | squall |
CREATE TABLE table_1342331_5 (
district VARCHAR,
incumbent VARCHAR
) | what's the district with incumbent being william j. driver | SELECT district FROM table_1342331_5 WHERE incumbent = "William J. Driver" | sql_create_context |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Courses (
course_id INTEGER,
author_... | Find the number of the dates of the tests taken with result 'Pass', order x-axis from high to low order. | SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY date_test_taken DESC | nvbench |
CREATE TABLE table_26073 (
"Round" text,
"Clubs remaining" real,
"Clubs involved" real,
"Winners from previous round" text,
"New entries this round" text,
"Leagues entering at this round" text
) | Which rounds had 32 clubs involved? | SELECT "Round" FROM table_26073 WHERE "Clubs involved" = '32' | wikisql |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopi... | Questions with at least one upvoted answer. | SELECT YEAR(q.CreationDate) AS "year", SUM(CASE WHEN a.ParentId IS NULL THEN 1 END) AS "open_unanswered_questions", COUNT(a.ParentId) AS "questions_with_answers", COUNT(CASE WHEN a.Score > 0 THEN a.ParentId END) AS "qs_with_positive_answers" FROM Posts AS q LEFT JOIN (SELECT DISTINCT ans.ParentId, MAX(ans.Score) AS "sc... | sede |
CREATE TABLE table_41049 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
) | What team was the opponent when the result was l 0-27? | SELECT "Opponent" FROM table_41049 WHERE "Result" = 'l 0-27' | wikisql |
CREATE TABLE table_27613 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | On what dates was the final score of the game L 14 24? | SELECT "Date" FROM table_27613 WHERE "Final score" = 'L 14–24' | wikisql |
CREATE TABLE table_203_365 (
id number,
"released" text,
"video title" text,
"company" text,
"director" text,
"notes" text
) | what is the total number of films shoko goto appeared in 2005 ? | SELECT COUNT(DISTINCT "video title") FROM table_203_365 WHERE "released" = 2005 | squall |
CREATE TABLE table_71982 (
"Station" text,
"City of license" text,
"Channel" text,
"ERP kW" real,
"HAAT m ( ft )" text,
"Facility ID" real
) | What is the Facility ID that has a City of license of wheeling, and a ERP kW less than 4.5? | SELECT MAX("Facility ID") FROM table_71982 WHERE "City of license" = 'wheeling' AND "ERP kW" < '4.5' | wikisql |
CREATE TABLE table_7199 (
"State" text,
"Type" text,
"Name" text,
"Title" text,
"Royal house" text,
"From" text
) | Which state has a king named xiang? | SELECT "State" FROM table_7199 WHERE "Title" = 'king' AND "Name" = 'xiang' | wikisql |
CREATE TABLE table_2127933_3 (
partner VARCHAR,
opponents VARCHAR
) | Who were the partners during times that harry johnson hazel hotchkiss wightman was the opponent? | SELECT partner FROM table_2127933_3 WHERE opponents = "Harry Johnson Hazel Hotchkiss Wightman" | sql_create_context |
CREATE TABLE table_name_87 (
driving_force_ex VARCHAR,
gt_force VARCHAR,
g27_racing_wheel VARCHAR
) | GT Force of yes, and a G27 Racing Wheel of 16 involves which driving force ex? | SELECT driving_force_ex FROM table_name_87 WHERE gt_force = "yes" AND g27_racing_wheel = "16" | sql_create_context |
CREATE TABLE table_18814 (
"Specification" text,
"Gender" text,
"Junior High School (12\u201315 yrs)" text,
"Senior High School (15\u201318 yrs)" text,
"University students and Adults (18yrs+)" text
) | What amount is the junior high school where the gender is male and the specification is minimum diameter of sakigawa? | SELECT "Junior High School (12\u201315 yrs)" FROM table_18814 WHERE "Gender" = 'Male' AND "Specification" = 'Minimum diameter of sakigawa' | wikisql |
CREATE TABLE table_57239 (
"Round" real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
) | What is the pole position of the grand prix with 1 round? | SELECT "Pole Position" FROM table_57239 WHERE "Round" = '1' | wikisql |
CREATE TABLE table_31848 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | What MLS team is affiliated with yale university? | SELECT "MLS Team" FROM table_31848 WHERE "Affiliation" = 'yale university' | wikisql |
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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | 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 trend about salary over hire_date , display X-axis in asc order. | SELECT HIRE_DATE, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE | nvbench |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
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... | Bin the hire date into Month interval, and then compute the average salary of employees in each month for a bar chart, note that just select those employees without the letter M in their first name. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' | nvbench |
CREATE TABLE table_name_43 (
date VARCHAR,
record VARCHAR
) | Which Date has a Record of 19 16 8? | SELECT date FROM table_name_43 WHERE record = "19–16–8" | sql_create_context |
CREATE TABLE table_name_59 (
track INTEGER,
original_album VARCHAR
) | Which track has the original album turbulent indigo? | SELECT AVG(track) FROM table_name_59 WHERE original_album = "turbulent indigo" | sql_create_context |
CREATE TABLE table_51505 (
"Squad No." real,
"Name" text,
"Position" text,
"League Apps" text,
"League Goals" real,
"FA Cup Apps" text,
"FA Cup Goals" real,
"League Cup Apps" text,
"League Cup Goals" real,
"FLT Apps" text,
"FLT Goals" real,
"Total Apps" text,
"Total G... | How many leage apperances for the player with one FA cup, and a FLT Apps of 0 (1)? | SELECT "League Apps" FROM table_51505 WHERE "FA Cup Apps" = '1' AND "FLT Apps" = '0 (1)' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | what was the first operation time in their last hospital visit for patient 015-67291? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-67291' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
... | For each classroom with at least 2 classes, how many classes are offered. Show the proportion. | SELECT CLASS_ROOM, COUNT(*) FROM CLASS GROUP BY CLASS_ROOM | nvbench |
CREATE TABLE table_47 (
"Nominative" text,
"Old orthography" text,
"New orthography" text,
"/e/ or /\u00e6/ (IPA)" text,
"Tone (Latvian notation: /~/ - level, /^/ - broken)" text,
"Translation" text
) | What is the tone for gen.sing. plague? | SELECT "Tone (Latvian notation: /~/ - level, /^/ - broken)" FROM table_47 WHERE "Translation" = 'Gen.Sing. plague' | wikisql |
CREATE TABLE table_name_87 (
home VARCHAR,
date VARCHAR
) | Which home team was playing on January 13? | SELECT home FROM table_name_87 WHERE date = "january 13" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | Tell me the number of patients younger than 31 years who have syncope telemetry as their primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SYNCOPE;TELEMETRY" AND demographic.age < "31" | mimicsql_data |
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,
... | 85839461这个病人被开出的药品金额不低于9856.88元的医疗记录有哪些?把医疗就诊编号列出来即可 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '85839461' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 9856.88) | css |
CREATE TABLE table_name_87 (
Id VARCHAR
) | What is the 1990 value with a 24 in 1995? | SELECT 1990 FROM table_name_87 WHERE 1995 = "24" | sql_create_context |
CREATE TABLE table_name_5 (
time__eest_ VARCHAR,
stage VARCHAR
) | What is the Time (EEST), when the Stage is ss8? | SELECT time__eest_ FROM table_name_5 WHERE stage = "ss8" | 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... | how many patients whose gender is m and lab test name is ferritin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.gender = "M" AND lab.label = "Ferritin" | mimicsql_data |
CREATE TABLE table_47521 (
"Conference" text,
"# of Bids" real,
"Record" text,
"Win %" text,
"Round of 32" text,
"Sweet Sixteen" text,
"Elite Eight" text,
"Final Four" text,
"Championship Game" text
) | When the conference is west coast and the number of bids are at 2, what's the percentage of games won? | SELECT "Win %" FROM table_47521 WHERE "# of Bids" = '2' AND "Conference" = 'west coast' | wikisql |
CREATE TABLE table_1857 (
"Class" text,
"Team" text,
"103lbs" text,
"112lbs" text,
"119lbs" text,
"125lbs" text,
"130lbs" text,
"135lbs" text,
"140lbs" text
) | Who weighed 135lbs that was in the same class as Treveor Grant (Lowry) at 119 lbs? | SELECT "135lbs" FROM table_1857 WHERE "119lbs" = 'Treveor Grant (Lowry)' | wikisql |
CREATE TABLE band (
id number,
firstname text,
lastname text
)
CREATE TABLE tracklists (
albumid number,
position number,
songid number
)
CREATE TABLE albums (
aid number,
title text,
year number,
label text,
type text
)
CREATE TABLE vocals (
songid number,
bandmat... | What is the type of vocals that the band member with the last name 'Heilo' played the most? | SELECT type FROM vocals AS T1 JOIN band AS T2 ON T1.bandmate = T2.id WHERE lastname = "Heilo" GROUP BY type ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_47809 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | WHAT IS THE POSITION WITH A ROUND LARGER THAN 6, AND OVERALL OF 191? | SELECT "Position" FROM table_47809 WHERE "Round" > '6' AND "Overall" = '191' | wikisql |
CREATE TABLE table_1368 (
"N\u00b0" real,
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"DAR" text,
"HDTV" text,
"Package/Option" text
) | Name the language for fox business network | SELECT "Language" FROM table_1368 WHERE "Television service" = 'Fox Business Network' | wikisql |
CREATE TABLE table_name_38 (
Id VARCHAR
) | Which 1965 has a 1962 of 0.35000000000000003, and a 1967 smaller than 0.53? | SELECT MIN(1965) FROM table_name_38 WHERE 1962 = 0.35000000000000003 AND 1967 < 0.53 | sql_create_context |
CREATE TABLE table_2897457_7 (
pick__number VARCHAR,
player VARCHAR
) | What are Scott Zygulski's pick numbers? | SELECT pick__number FROM table_2897457_7 WHERE player = "Scott Zygulski" | sql_create_context |
CREATE TABLE table_1566850_9 (
pictorials VARCHAR,
date VARCHAR
) | What is the name of the pictorial in the 11-98 issue? | SELECT pictorials FROM table_1566850_9 WHERE date = "11-98" | sql_create_context |
CREATE TABLE table_2781227_11 (
pick INTEGER,
nhl_team VARCHAR
) | What was the minimum pick by the Florida Panthers? | SELECT MIN(pick) FROM table_2781227_11 WHERE nhl_team = "Florida Panthers" | sql_create_context |
CREATE TABLE table_name_18 (
surface VARCHAR,
date VARCHAR
) | What Surface has a Date of 1 september 2008? | SELECT surface FROM table_name_18 WHERE date = "1 september 2008" | sql_create_context |
CREATE TABLE table_17810099_3 (
title VARCHAR,
episode__number VARCHAR
) | what was the title of the episode 21a? | SELECT title FROM table_17810099_3 WHERE episode__number = "21a" | sql_create_context |
CREATE TABLE table_57168 (
"Round" real,
"Grand Prix" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
) | Which date was hermanos rodr guez the location? | SELECT "Date" FROM table_57168 WHERE "Location" = 'hermanos rodríguez' | wikisql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number... | when was the last time the respiratory rate for patient 14671 was greater than 16.0 since 09/25/2100? | SELECT chartevents.charttime 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 = 14671)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'respirat... | mimic_iii |
CREATE TABLE table_name_35 (
date VARCHAR,
home_captain VARCHAR,
venue VARCHAR
) | On which dates played Home Captain Courtney Walsh at the Queen's Park Oval? | SELECT date FROM table_name_35 WHERE home_captain = "courtney walsh" AND venue = "queen's park oval" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | 号码是40176918的病人在2002年8月23日到2002年12月5日期间所使用的药品其编码、名称、数量、单价、金额都是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '40176918' AND t_kc21.IN_HOSP_DATE BETWEEN... | css |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | Before I take SOC 311 what other courses would be useful to have ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'SOC' AND number = 311 | advising |
CREATE TABLE table_name_21 (
type VARCHAR,
reported_price VARCHAR,
person_s_ VARCHAR
) | What type of photos of Angelina Jolie cost $500,000? | SELECT type FROM table_name_21 WHERE reported_price = "$500,000" AND person_s_ = "angelina jolie" | sql_create_context |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Posts (
Id nu... | Highest Voted Comments for a User on SFF. | SELECT PostId AS "post_link", Score, Text FROM Comments WHERE UserId = '##UserId##' ORDER BY Score DESC LIMIT 250 | sede |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | count the number of patients whose days of hospital stay is greater than 2 and procedure long title is exteriorization of small intestine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.long_title = "Exteriorization of small intestine" | mimicsql_data |
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... | what 's the cheapest round trip fare between DALLAS and BALTIMORE | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_... | atis |
CREATE TABLE table_name_56 (
role VARCHAR,
director VARCHAR,
title VARCHAR
) | What role did John Wayne play in The Trail Beyond, directed by R.N. Bradbury? | SELECT role FROM table_name_56 WHERE director = "r.n. bradbury" AND title = "the trail beyond" | sql_create_context |
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE aircraft (
aid number,
name text,
distance number
)
CREATE TABLE certificate (
eid number,
aid number
)... | Show names for all aircrafts of which John Williams has certificates. | SELECT T3.name FROM employee AS T1 JOIN certificate AS T2 ON T1.eid = T2.eid JOIN aircraft AS T3 ON T3.aid = T2.aid WHERE T1.name = "John Williams" | spider |
CREATE TABLE table_42193 (
"Name" text,
"Start of Reign" real,
"End of Reign" text,
"Birth Name" text,
"Title" text
) | What is the date of birth of the person who started their reign in 1986? | SELECT "Birth Name" FROM table_42193 WHERE "Start of Reign" = '1986' | wikisql |
CREATE TABLE table_46149 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text,
"Location" text
) | Who was the opponent in round 2 of the UFC 49 event? | SELECT "Opponent" FROM table_46149 WHERE "Round" = '2' AND "Event" = 'ufc 49' | wikisql |
CREATE TABLE table_name_20 (
network VARCHAR,
language VARCHAR,
origin_of_programming VARCHAR,
genre VARCHAR
) | What network has an origin in India, a genre of general, and broadcasts in Bengali? | SELECT network FROM table_name_20 WHERE origin_of_programming = "india" AND genre = "general" AND language = "bengali" | 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... | provide the number of patients whose diagnoses short title is gstr/ddnts nos w/o hmrhg and lab test fluid is pleural? | 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.short_title = "Gstr/ddnts NOS w/o hmrhg" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_636 (
"W.H. Archer" text,
"J.E. Armstrong" text,
"H.L. Birkett" text,
"F.A. Brill" text,
"H.T. Brewer" text
) | What are the fa.brill when w.h. archer is known as r. newman? | SELECT "F.A. Brill" FROM table_636 WHERE "W.H. Archer" = 'R. Newman' | wikisql |
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
)
... | for how many days was the patient with patient id 22999 hospitalized? | SELECT demographic.days_stay FROM demographic WHERE demographic.subject_id = "22999" | mimicsql_data |
CREATE TABLE table_34645 (
"Year" real,
"US Cham. Rank" real,
"US Cham. Spending" text,
"Next Highest Spender" text,
"Next Highest Amount" text
) | Which Year is the lowest one that has a US Cham Rank smaller than 1? | SELECT MIN("Year") FROM table_34645 WHERE "US Cham. Rank" < '1' | wikisql |
CREATE TABLE table_5699 (
"Model" text,
"Engine" text,
"Displacement" text,
"Power" text,
"Torque" text
) | Which of the engines has a displacement of 1,585 cc, with a model number of 90i? | SELECT "Engine" FROM table_5699 WHERE "Displacement" = '1,585 cc' AND "Model" = '90i' | wikisql |
CREATE TABLE table_1200 (
"Series Ep." text,
"Episode" real,
"Netflix" text,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
) | Name the segment a for 8-08 | SELECT "Segment A" FROM table_1200 WHERE "Series Ep." = '8-08' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.