context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_test_2 (
"id" int,
"loss_of_consciousness" bool,
"gender" string,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"stroke" bool,
"renal_disease" bool,
"hemorrhagic_diathesis" bool,
"transient_ischemic_attack" bool,
"creatinine_clearance_cl" float,
"demen... | known renal insufficiency ( either known creatinin clearance < 30 ml / min / 1.73 m2 or current medical care for severe renal insufficiency ) | SELECT * FROM table_test_2 WHERE renal_disease = 1 OR (creatinine_clearance_cl < 30 OR renal_disease = 1) | criteria2sql |
CREATE TABLE table_name_12 (
week INTEGER,
date VARCHAR
) | What was the Week on December 17? | SELECT MIN(week) FROM table_name_12 WHERE date = "december 17" | sql_create_context |
CREATE TABLE made_by (
id int,
msid int,
pid int
)
CREATE TABLE keyword (
id int,
keyword text
)
CREATE TABLE directed_by (
id int,
msid int,
did int
)
CREATE TABLE written_by (
id int,
msid int,
wid int
)
CREATE TABLE writer (
wid int,
gender text,
name text,... | What are the series in which ' Scott Foley ' is an actor ? | SELECT tv_series.title FROM actor, cast, tv_series WHERE actor.name = 'Scott Foley' AND cast.aid = actor.aid AND tv_series.sid = cast.msid | imdb |
CREATE TABLE table_61890 (
"Rank" real,
"Athlete" text,
"Taijijian" real,
"Taijiquan" real,
"Total" real
) | What is the highest taijijian with a 9.87 taijiquan and a total less than 19.77? | SELECT MAX("Taijijian") FROM table_61890 WHERE "Taijiquan" = '9.87' AND "Total" < '19.77' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 06038186这个病人在2020-12-13以前有哪些门诊就诊的检验报告单?查一下这些门诊就诊的流水号 | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzj... | css |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | count the number of times that patient 20713 had had a tooth extraction nec procedure. | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'tooth extraction nec') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20713) | mimic_iii |
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city... | Show the faculty id of each faculty member, along with the number of students he or she advises. Show scatter chart. | SELECT FacID, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.FacID | nvbench |
CREATE TABLE table_name_64 (
result VARCHAR,
week VARCHAR
) | What is the result when 13 is the week? | SELECT result FROM table_name_64 WHERE week = 13 | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, find name and the average of manufacturer , and group by attribute name, and visualize them by a bar chart, sort mean manufacturer in ascending order. | SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer | nvbench |
CREATE TABLE table_25938 (
"Episode" text,
"First broadcast" text,
"Seans team" text,
"Jasons team" text,
"Scores" text
) | Name the total number of scores for 7x10 | SELECT COUNT("Scores") FROM table_25938 WHERE "Episode" = '7x10' | wikisql |
CREATE TABLE table_78346 (
"Name" text,
"Builder" text,
"Wheel arrangement" text,
"Works Number" real,
"Built" real
) | What is the work number for Victor? | SELECT "Works Number" FROM table_78346 WHERE "Name" = 'victor' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid numb... | how many times patient 006-122567 has come to the intensive care unit in 2101? | SELECT COUNT(DISTINCT patient.patientunitstayid) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-122567') AND STRFTIME('%y', patient.unitadmittime) = '2101' | eicu |
CREATE TABLE table_70147 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What Away team had an Attendance of 3,395? | SELECT "Away team" FROM table_70147 WHERE "Attendance" = '3,395' | wikisql |
CREATE TABLE table_72219 (
"Player" text,
"No.(s)" text,
"Height in Ft." text,
"Position" text,
"Years for Rockets" text,
"School/Club Team/Country" text
) | What years did the player from LaSalle play for the Rockets? | SELECT "Years for Rockets" FROM table_72219 WHERE "School/Club Team/Country" = 'LaSalle' | wikisql |
CREATE TABLE table_name_47 (
birthplace VARCHAR,
_date VARCHAR,
pick VARCHAR
) | What is the birthplace and date of pick 4? | SELECT birthplace, _date FROM table_name_47 WHERE pick = 4 | sql_create_context |
CREATE TABLE Museums (
Museum_ID INTEGER,
Museum_Details VARCHAR(255)
)
CREATE TABLE Shops (
Shop_ID INTEGER,
Shop_Details VARCHAR(255)
)
CREATE TABLE Staff (
Staff_ID INTEGER,
Tourist_Attraction_ID INTEGER,
Name VARCHAR(40),
Other_Details VARCHAR(255)
)
CREATE TABLE Visits (
Visi... | Show the names and ids of tourist attractions that are visited at most once by a bar chart, list by the Y-axis in asc please. | SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Tourist_Attraction_ID | nvbench |
CREATE TABLE table_1315616_1 (
mediator VARCHAR,
kōhaku__number VARCHAR
) | Who was the mediator in k haku number 53? | SELECT mediator FROM table_1315616_1 WHERE kōhaku__number = 53 | sql_create_context |
CREATE TABLE Maintenance_Engineers (
engineer_id INTEGER,
company_id INTEGER,
first_name VARCHAR(50),
last_name VARCHAR(50),
other_details VARCHAR(255)
)
CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
engineer_id INTEGER,
fault_log_entry_id INTEG... | A bar chart about the number of faults for different fault short name, sort from low to high by the y-axis. | SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY fault_short_name ORDER BY COUNT(fault_short_name) | nvbench |
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 jyjgzbb (
BGDH text,
BGRQ tim... | 在2012年9月17日到2021年6月15日内84842097患者被开出的所有检验报告单的检验报告单号一共都有哪些? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info... | css |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
patientheal... | when did patient 029-8212 get admitted for the last time since 2104 in the hospital? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '029-8212' AND STRFTIME('%y', patient.hospitaladmittime) >= '2104' ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_25213146_2 (
date VARCHAR,
winning_team VARCHAR
) | On what date(s) was the winning team Prema Powerteam? | SELECT date FROM table_25213146_2 WHERE winning_team = "Prema Powerteam" | sql_create_context |
CREATE TABLE table_26964 (
"Name" text,
"Position" text,
"Period" text,
"Appearances\u00b9" real,
"Goals\u00b9" real,
"Nationality\u00b2" text
) | What is the nationality of Louis floch | SELECT "Nationality\u00b2" FROM table_26964 WHERE "Name" = 'Louis Floch' | wikisql |
CREATE TABLE table_983 (
"Competition" text,
"Record" text,
"Result" text,
"Home Matches" real,
"Home Attendance" real,
"Avg. Home Attendance" real
) | What was the lowest home attendance for the southern derby? | SELECT MIN("Home Attendance") FROM table_983 WHERE "Competition" = 'Southern Derby' | 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 ... | what number of patients have admission location as transfer from hosp/extram and drug code as phen 100ivbp? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND prescriptions.formulary_drug_cd = "PHEN100IVPB" | mimicsql_data |
CREATE TABLE table_51744 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How much did the away team score that played St Kilda? | SELECT "Away team score" FROM table_51744 WHERE "Home team" = 'st kilda' | wikisql |
CREATE TABLE table_name_97 (
date VARCHAR,
location VARCHAR,
result VARCHAR
) | What was the date of the game played at Gillette Stadium with a score of 40-21? | SELECT date FROM table_name_97 WHERE location = "gillette stadium" AND result = "40-21" | sql_create_context |
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,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 把医疗机构0195557做过项目0152检查的记录查看一下 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '0195557' AND t_kc22.SOC_SRT_DIRE_CD = '0152' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gyb.MED_SER_ORG_NO = '0195557' AND t_kc22.SOC_SRT_DIRE_CD = '0152' UNION ... | css |
CREATE TABLE table_28409 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Football?" text,
"Joined" real
) | How many values for joined occur at Guilford College? | SELECT COUNT("Joined") FROM table_28409 WHERE "Institution" = 'Guilford College' | wikisql |
CREATE TABLE table_204_717 (
id number,
"season" text,
"level" number,
"division" text,
"place" text
) | which season was the only season to come in 18th ? | SELECT "season" FROM table_204_717 WHERE "place" = 18 | squall |
CREATE TABLE table_train_65 (
"id" int,
"intention_to_arterial_catheter" bool,
"steroid_therapy" bool,
"intention_to_central_venous_catheter" bool,
"central_venous_pressure_cvp" int,
"receiving_vasopressor" bool,
"pulmonary_artery_occlusive_pressure_paop" int,
"septic_shock" bool,
"a... | presence of a pulmonary artery catheter ( or central venous catheters ) | SELECT * FROM table_train_65 WHERE intention_to_arterial_catheter = 1 OR intention_to_central_venous_catheter = 1 | criteria2sql |
CREATE TABLE table_19450 (
"Virtual" real,
"Physical" real,
"Call sign" text,
"Branding" text,
"Network" text,
"Owner" text
) | Name the call sign for the 17 physical | SELECT "Call sign" FROM table_19450 WHERE "Physical" = '17' | wikisql |
CREATE TABLE table_4640 (
"Round" real,
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning car" text
) | What date did the International Gold Cup take place? | SELECT "Date" FROM table_4640 WHERE "Name" = 'international gold cup' | wikisql |
CREATE TABLE table_169693_1 (
age_40_49 INTEGER
) | Name the least age 40-49 | SELECT MIN(age_40_49) FROM table_169693_1 | sql_create_context |
CREATE TABLE table_32181 (
"Round" real,
"Overall" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Which player was drafted after round 9 and number 464 overall? | SELECT "Player" FROM table_32181 WHERE "Round" > '9' AND "Overall" = '464' | wikisql |
CREATE TABLE table_78576 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Who has a To par of 2, and a Country of united states? | SELECT "Player" FROM table_78576 WHERE "To par" = '–2' AND "Country" = 'united states' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | Will there be any upper-level ANTHRCUL classes to take this Spring ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ANTHRCUL' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Sp... | advising |
CREATE TABLE table_name_78 (
translation VARCHAR,
date VARCHAR
) | Which translation was published in 1986? | SELECT translation FROM table_name_78 WHERE date = 1986 | sql_create_context |
CREATE TABLE table_69660 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Who took the loss in the game that ended with a 54-61 record? | SELECT "Loss" FROM table_69660 WHERE "Record" = '54-61' | wikisql |
CREATE TABLE table_11202 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team score for the team that has a home team score of 14.22 (106)? | SELECT "Away team score" FROM table_11202 WHERE "Home team score" = '14.22 (106)' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | when was the last time patient 031-3355 was given microbiology tests in 12/this year? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-3355')) AND DATETIME(microlab.culturetakentime, 'start of yea... | eicu |
CREATE TABLE table_20787 (
"product" text,
"dimensions (mm)" text,
"dpi" real,
"pages per minute (color)" real,
"max page size" text,
"interface" text
) | What is the dpi of a scanner with the mm dimensions 280 x 95 x 40? | SELECT "dpi" FROM table_20787 WHERE "dimensions (mm)" = '280 x 95 x 40' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
... | what is the name of the procedure that has been done two times in 03/last year to patient 27362? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 273... | mimic_iii |
CREATE TABLE table_20193 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | Name the years in orlando that the player from concord hs was in | SELECT "Years in Orlando" FROM table_20193 WHERE "School/Club Team" = 'Concord HS' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name te... | what are the top four commonly prescribed drugs that patients were prescribed after having received a aortocor bypas-1 cor art treatment in the same hospital visit? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE table_name_69 (
country VARCHAR,
score VARCHAR
) | What country has a score of 66-73-69=208? | SELECT country FROM table_name_69 WHERE score = 66 - 73 - 69 = 208 | sql_create_context |
CREATE TABLE table_47179 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which player was chosen by Saskatchewan in a pick larger than 38? | SELECT "Player" FROM table_47179 WHERE "Pick #" > '38' AND "CFL Team" = 'saskatchewan' | wikisql |
CREATE TABLE table_21758 (
"Year" real,
"Network" text,
"Play-by-play" text,
"Color commentator" text,
"Sideline reporters" text,
"Pregame host" text,
"Pregame analysts" text
) | What pregame analyst(s) had rob stone and monica gonzalez as sideline reporters and were on tsn2? | SELECT "Pregame analysts" FROM table_21758 WHERE "Sideline reporters" = 'Rob Stone and Monica Gonzalez' AND "Network" = 'TSN2' | wikisql |
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... | tag gold badges sorted by date. | SELECT ROW_NUMBER() OVER (ORDER BY b.Date), u.Id, u.DisplayName, b.Date, b.Name, b.Class FROM Badges AS b INNER JOIN Users AS u ON u.Id = b.UserId WHERE b.Name LIKE '%' AND b.Class = 1 ORDER BY b.Date | sede |
CREATE TABLE table_15581223_8 (
tackles INTEGER,
sacks VARCHAR
) | Name the most tackles for 3.5 sacks | SELECT MAX(tackles) FROM table_15581223_8 WHERE sacks = "3.5" | sql_create_context |
CREATE TABLE table_27756164_8 (
location_attendance VARCHAR,
team VARCHAR
) | When the team is chicago what is the location attendence? | SELECT location_attendance FROM table_27756164_8 WHERE team = "Chicago" | sql_create_context |
CREATE TABLE table_29773532_21 (
official_rating_16_39 VARCHAR,
episode VARCHAR
) | What was the official rating 16-39 of episode 9? | SELECT official_rating_16_39 FROM table_29773532_21 WHERE episode = 9 | sql_create_context |
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,
... | how many of the female patients had icd9 code 76519? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.icd9_code = "76519" | mimicsql_data |
CREATE TABLE Maintenance_Contracts (
maintenance_contract_id INTEGER,
maintenance_contract_company_id INTEGER,
contract_start_date DATETIME,
contract_end_date DATETIME,
other_contract_details VARCHAR(255)
)
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_n... | List the number of enginners and group by first name in a bar chart, display by the bar in descending please. | SELECT first_name, COUNT(first_name) FROM Maintenance_Engineers AS T1 JOIN Engineer_Skills AS T2 ON T1.engineer_id = T2.engineer_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY first_name ORDER BY first_name DESC | nvbench |
CREATE TABLE table_9320 (
"Length feet (m)" text,
"Width feet (m)" text,
"Load short tons (MT)" text,
"Truss type(s)" text,
"Year built" text,
"Source (Year)" text
) | What is the width for hte truss with a source of zacher (1994)? | SELECT "Width feet (m)" FROM table_9320 WHERE "Source (Year)" = 'zacher (1994)' | wikisql |
CREATE TABLE table_203_410 (
id number,
"game" number,
"date" text,
"opponent" text,
"location" text,
"score" text,
"attendance" number,
"record" text
) | how many games were played at the prudential center ? | SELECT COUNT("game") FROM table_203_410 WHERE "location" = 'prudential center' | squall |
CREATE TABLE table_19753079_41 (
candidates VARCHAR,
first_elected VARCHAR
) | When 1984 is the first elected who are the candidates? | SELECT candidates FROM table_19753079_41 WHERE first_elected = 1984 | sql_create_context |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
... | Users with Tags Score excluding undesirable tag. | SELECT DISTINCT u.Id AS "user_link", CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, 'Tag:' + t.TagName, SUM(a.Score) AS "tag_score", COUNT(*) AS "answer_count" FROM Users AS u INNER JOIN Posts AS a ON a.OwnerUserId = u.Id INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN PostTags... | sede |
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... | count the number of patients whose admission location is trsf within this facility and drug name is sodium chloride? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND prescriptions.drug = "Sodium Chloride" | mimicsql_data |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label te... | when was the first efavirenz prescription given to patient 13536 when they came to the hospital last time. | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13536 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND prescriptions.drug = 'efavirenz' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_78171 (
"Season" real,
"Belonging league" text,
"Matches" real,
"league point" real,
"Draw" real,
"Lose" real,
"Goal difference" real,
"Point" real,
"Lost point" real,
"Final rank" real
) | Tell me the average final rank for loe more than 10 and point less than 43 | SELECT AVG("Final rank") FROM table_78171 WHERE "Lose" > '10' AND "Point" < '43' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | how much do charge for a chemotherapy? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'treatment' AND cost.eventid IN (SELECT treatment.treatmentid FROM treatment WHERE treatment.treatmentname = 'chemotherapy') | eicu |
CREATE TABLE table_56575 (
"Particle" text,
"Symbol" text,
"Makeup" text,
"Rest mass MeV / c 2" text,
"Isospin I" text,
"Spin ( Parity ) J P" text,
"Commonly decays to" text
) | Which Particle has an Isospin I of 1 2, and a Symbol of 0 (1530)? | SELECT "Particle" FROM table_56575 WHERE "Isospin I" = '1⁄2' AND "Symbol" = 'ξ ∗0 (1530)' | wikisql |
CREATE TABLE player_award (
player_id text,
award_id text,
year number,
league_id text,
tie text,
notes text
)
CREATE TABLE player_award_vote (
award_id text,
year number,
league_id text,
player_id text,
points_won number,
points_max number,
votes_first text
)
CREAT... | Which player get the highest score in 1971? | SELECT player_id FROM player_award_vote WHERE year = "1971" ORDER BY points_won DESC LIMIT 1 | thehistoryofbaseball |
CREATE TABLE table_31138 (
"Year" real,
"Network" text,
"Play-by-play announcer" text,
"Color commentator" text,
"s Field reporter" text,
"Pregame hosts" text,
"Pregame analysts" text,
"Trophy presentation" text
) | Who is every play-by-play announcer when Chris Rose is the trophy presenter? | SELECT "Play-by-play announcer" FROM table_31138 WHERE "Trophy presentation" = 'Chris Rose' | wikisql |
CREATE TABLE temperature (
city_id number,
jan number,
feb number,
mar number,
apr number,
jun number,
jul number,
aug number,
sep number,
oct number,
nov number,
dec number
)
CREATE TABLE hosting_city (
year number,
match_id number,
host_city text
)
CREATE ... | Give me a list of cities whose temperature in Feb is higher than that in Jun or cities that were once host cities? | SELECT T1.city FROM city AS T1 JOIN temperature AS T2 ON T1.city_id = T2.city_id WHERE T2.feb > T2.jun UNION SELECT T3.city FROM city AS T3 JOIN hosting_city AS T4 ON T3.city_id = T4.host_city | spider |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 列出在医院2797205中编号为16026423患者就诊科室名称包含足踝的所有门诊就诊记录的流水号是多少? | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '16026423' AND hz_info.YLJGDM = '2797205' AND mzjzjlb.JZKSMC LIKE '%足踝%' | css |
CREATE TABLE table_name_55 (
result_f_a VARCHAR,
league_position VARCHAR,
date VARCHAR
) | What was the Result F A on 21 February 2009, when the league position was 1st? | SELECT result_f_a FROM table_name_55 WHERE league_position = "1st" AND date = "21 february 2009" | sql_create_context |
CREATE TABLE table_17054 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | What is the school of the player from Lake Charles, LA? | SELECT "School" FROM table_17054 WHERE "Hometown" = 'Lake Charles, LA' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 查看哪个就诊流水号能跟编号39027691440的检验报告单对应起来 | SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGDH = '39027691440' | css |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 在患者陶歌韵的诊疗记录里,从02年8月1日到10年6月21日这期间,为其检测游离甲状腺素(三代)的医务人员有哪几位,报一下工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM 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 jy... | css |
CREATE TABLE table_203_249 (
id number,
"position" number,
"song title" text,
"artist" text,
"sales" number,
"highest position" number
) | which artist has the least highest position ? | SELECT "artist" FROM table_203_249 ORDER BY "position" DESC LIMIT 1 | squall |
CREATE TABLE table_36263 (
"Date" text,
"Episode" real,
"Performer 1" text,
"Performer 2" text,
"Performer 3" text,
"Performer 4" text
) | Performer 2 of compilation 2 is what performer 1? | SELECT "Performer 1" FROM table_36263 WHERE "Performer 2" = 'compilation 2' | wikisql |
CREATE TABLE table_29434211_1 (
season INTEGER,
podiums VARCHAR
) | What is the maximum season that has exactly 2 podiums? | SELECT MAX(season) FROM table_29434211_1 WHERE podiums = 2 | sql_create_context |
CREATE TABLE table_22932 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | How many teams won $2,089,556? | SELECT COUNT("Wins") FROM table_22932 WHERE "Winnings" = '$2,089,556' | wikisql |
CREATE TABLE genre (
gid int,
genre text
)
CREATE TABLE cast (
id int,
msid int,
aid int,
role text
)
CREATE TABLE copyright (
id int,
msid int,
cid int
)
CREATE TABLE company (
id int,
name text,
country_code varchar
)
CREATE TABLE made_by (
id int,
msid int,... | who acted the role of ' Mr. Bean | SELECT actor.name FROM actor, cast WHERE cast.aid = actor.aid AND cast.role = 'Mr. Bean' | imdb |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of phone_number and manager_id , and order in ascending by the Y-axis. | SELECT PHONE_NUMBER, 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 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
)
... | how many patients whose admission location is clinic referral/premature and item id is 51099? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND lab.itemid = "51099" | mimicsql_data |
CREATE TABLE table_name_10 (
label VARCHAR,
catalog VARCHAR
) | What label has the catalog nebt058? | SELECT label FROM table_name_10 WHERE catalog = "nebt058" | sql_create_context |
CREATE TABLE table_204_694 (
id number,
"year" text,
"name" text,
"date" text,
"stages" number,
"distance" text,
"winner" text,
"time" text
) | how long did it take warren davadilla to complete the 1998 marlboro centennial tour ? | SELECT "time" FROM table_204_694 WHERE "year" = 1998 | squall |
CREATE TABLE table_name_59 (
attendance VARCHAR,
week VARCHAR
) | What is the attendance for week 11? | SELECT attendance FROM table_name_59 WHERE week = 11 | 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 chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | when was patient 24547 prescribed a mycophenolate mofetil and cetylpyridinium chl (cepacol) at the same time for the first time in 08/last year? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'mycophenolate mofetil' AND admissions.subject_id = 24547 AND DATETIME(prescriptions.startdate, 'start of year') = DATETIME(CURRENT_... | mimic_iii |
CREATE TABLE table_name_46 (
result VARCHAR,
week VARCHAR,
date VARCHAR
) | Tell me the result for week less than 4 and september 7, 1986 | SELECT result FROM table_name_46 WHERE week < 4 AND date = "september 7, 1986" | sql_create_context |
CREATE TABLE table_67817 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | What winner has the sanremo to cuneo as the course? | SELECT "Winner" FROM table_67817 WHERE "Course" = 'sanremo to cuneo' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Po... | Filterable history of Review Types and Results. | SELECT ReviewTasks.Id, ReviewTasks.CreationDate, ReviewTaskTypes.Name AS ReviewType, ReviewTaskResultTypes.Name AS ResultType FROM ReviewTasks, ReviewTaskResults, ReviewTaskResultTypes, ReviewTaskTypes WHERE ReviewTasks.CompletedByReviewTaskId = ReviewTaskResults.Id AND ReviewTaskResultTypes.Id = ReviewTaskResults.Revi... | sede |
CREATE TABLE Student_Course_Enrolment (
student_id VARCHAR
)
CREATE TABLE Students (
student_id VARCHAR
) | How many students did not have any course enrollment? | SELECT COUNT(*) FROM Students WHERE NOT student_id IN (SELECT student_id FROM Student_Course_Enrolment) | sql_create_context |
CREATE TABLE table_20996923_25 (
round__number INTEGER,
player VARCHAR
) | What was Sherrick McManis's earliest round? | SELECT MIN(round__number) FROM table_20996923_25 WHERE player = "Sherrick McManis" | sql_create_context |
CREATE TABLE table_54699 (
"Sail" text,
"Yacht" text,
"Syndicate" text,
"Yacht Club" text,
"Nation" text
) | Which nation has the America 3 Foundation syndicate and the jayhawk yacht? | SELECT "Nation" FROM table_54699 WHERE "Syndicate" = 'america 3 foundation' AND "Yacht" = 'jayhawk' | wikisql |
CREATE TABLE table_52350 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many golds for the nation ranked below 5 and over 1 bronze medals? | SELECT MAX("Gold") FROM table_52350 WHERE "Rank" > '5' AND "Bronze" < '1' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount nu... | Get all comments for a specified user in a descending order by Score. | SELECT c.Score, c.Id AS "comment_link", p.Id AS "post_link", c.Text, c.CreationDate, c.UserId AS "user_link" FROM Comments AS c, Posts AS p WHERE p.Id = c.PostId AND c.UserId = @UserId ORDER BY c.Score DESC | sede |
CREATE TABLE table_17333 (
"#" real,
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Attendance" text,
"Record" text,
"Streak" text
) | What is the record for the game at home Los Angeles Lakers? | SELECT "Record" FROM table_17333 WHERE "Home" = 'Los Angeles Lakers' | wikisql |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | Plot sum capacity over openning year in a line chart, and I want to rank by the x axis in ascending. | SELECT Openning_year, SUM(Capacity) FROM cinema ORDER BY Openning_year | nvbench |
CREATE TABLE table_name_68 (
score VARCHAR,
club VARCHAR
) | What scores did the RSC Anderlecht club have? | SELECT score FROM table_name_68 WHERE club = "rsc anderlecht" | sql_create_context |
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 mzjzjlb_jybgb (
YLJGDM_MZJZJLB te... | 病人89609630为疾病U85.955,门诊诊断的检测指标023380的结果定量是什么?单位是什么? | 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 table_46741 (
"Letter" text,
"IPv6 address" text,
"AS-number" text,
"Operator" text,
"Location #sites (global/local)" text,
"Software" text
) | Which letter has an operator of the Defense Information Systems Agency? | SELECT "Letter" FROM table_46741 WHERE "Operator" = 'defense information systems agency' | wikisql |
CREATE TABLE table_63598 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | What player had the high point on July 7? | SELECT "High points" FROM table_63598 WHERE "Date" = 'july 7' | wikisql |
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 (
... | How many patients are discharged to home health care and underwent the procedure cardiopulm resuscitate nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME" AND procedures.short_title = "Cardiopulm resuscita NOS" | mimicsql_data |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
... | when first did patient 12927 have the minimum heart rate on this month/30? | 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 = 12927)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart ra... | mimic_iii |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellv... | tell me the sex of patient 021-111547. | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '021-111547' | eicu |
CREATE TABLE table_45087 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" real
) | What is the fewest goals for when goals against is 75 and drawn is smaller than 11? | SELECT MIN("Goals For") FROM table_45087 WHERE "Goals Against" = '75' AND "Drawn" < '11' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
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,
tough_test... | What professors teach upper-level classes ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_... | advising |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.