context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 did not have any job in the past, give me the comparison about the sum of employee_id over the hire_date bin hire_date by weekday by a bar chart. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_name_49 (
record VARCHAR,
score VARCHAR,
points VARCHAR,
game VARCHAR
) | Which Record has Points smaller than 40, and a Game larger than 25, and a Score of 2 0? | SELECT record FROM table_name_49 WHERE points < 40 AND game > 25 AND score = "2–0" | sql_create_context |
CREATE TABLE table_27297 (
"Company" text,
"Parent company" text,
"Parent headquarters" text,
"Plant" text,
"Models produced" text,
"Production (latest figures)" text
) | what is the company with the parent company wrightbus? | SELECT "Company" FROM table_27297 WHERE "Parent company" = 'Wrightbus' | wikisql |
CREATE TABLE table_name_42 (
engine VARCHAR,
entrant VARCHAR,
year VARCHAR,
points VARCHAR
) | What was the engine of the Hoover Motor Express after 1955 with greater than 0 points? | SELECT engine FROM table_name_42 WHERE year > 1955 AND points > 0 AND entrant = "hoover motor express" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Answers per day on [rust]: total vs. Shepmaster's answers. | SELECT MIN(answers.CreationDate), (COUNT(*) + 0.0) / TIME_TO_STR(LAST_DATE_OF_MONTH(MIN(answers.CreationDate)), '%d') AS "answers per day", COUNT(CASE answers.OwnerDisplayName WHEN 'Shepmaster' THEN 1 ELSE NULL END) + 0.0 / TIME_TO_STR(LAST_DATE_OF_MONTH(MIN(answers.CreationDate)), '%d') AS "shepmasters answers per day... | sede |
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,
... | 在05年2月3日到15年9月8日期间医院8966457的科室065收取的医疗费总额是多少? | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8966457' AND t_kc21.MED_ORG_DEPT_CD = '065') AND t_kc24.CLINIC_SLT_DATE BETWEEN '2005-02-03' AND '2015-09-08' | css |
CREATE TABLE table_16734640_1 (
location VARCHAR,
institution VARCHAR
) | Name the location for chattahoochee technical college | SELECT location FROM table_16734640_1 WHERE institution = "Chattahoochee Technical College" | sql_create_context |
CREATE TABLE table_11178271_1 (
weekly_rank VARCHAR,
air_date VARCHAR
) | What is the weekly rank with an air date is november 12, 2007? | SELECT weekly_rank FROM table_11178271_1 WHERE air_date = "November 12, 2007" | sql_create_context |
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcit... | autoencoder papers | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'autoencoder' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid | scholar |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | give me the number of patients whose admission location is emergency room admit and primary disease is transient ischemic attack? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "EMERGENCY ROOM ADMIT" AND demographic.diagnosis = "TRANSIENT ISCHEMIC ATTACK" | mimicsql_data |
CREATE TABLE table_68939 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | Name the Drawn for tries against of 36 and points of 66 | SELECT "Drawn" FROM table_68939 WHERE "Tries against" = '36' AND "Points" = '66' | wikisql |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
) | List the companies of entrepreneurs in descending order of money requested. | SELECT company FROM entrepreneur ORDER BY money_requested DESC | spider |
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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what number of patients admitted in urgent care had their route mentioned as ivpca? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.route = "IVPCA" | mimicsql_data |
CREATE TABLE broadcast (
program_id VARCHAR,
Time_of_day VARCHAR
)
CREATE TABLE program (
owner VARCHAR,
program_id VARCHAR
) | find the program owners that have some programs in both morning and night time. | SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = "Morning" INTERSECT SELECT t1.owner FROM program AS t1 JOIN broadcast AS t2 ON t1.program_id = t2.program_id WHERE t2.Time_of_day = "Night" | sql_create_context |
CREATE TABLE table_28404 (
"Institution" text,
"Location" text,
"Nickname" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" text
) | How many different items appear in the enrollment column that joined in 1931, 1949 1? | SELECT COUNT("Enrollment") FROM table_28404 WHERE "Joined" = '1931, 1949 1' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 列出病人53441764医疗记录中的入院诊断疾病编码和名称,主要针对医疗费总额不低于4790.44元的 | SELECT OUT_DIAG_DIS_CD, OUT_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '53441764' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 4790.44) | css |
CREATE TABLE table_name_82 (
college_junior_club_team__league_ VARCHAR,
round INTEGER
) | what is the college/junior/club team (league) when the round is less than 7? | SELECT college_junior_club_team__league_ FROM table_name_82 WHERE round < 7 | sql_create_context |
CREATE TABLE table_name_64 (
grid INTEGER,
laps VARCHAR,
constructor VARCHAR
) | What is the high grid total for maserati with under 35 laps? | SELECT MAX(grid) FROM table_name_64 WHERE laps < 35 AND constructor = "maserati" | sql_create_context |
CREATE TABLE table_4356 (
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text
) | Tell me the player for pick of 145 | SELECT "Player" FROM table_4356 WHERE "Pick" = '145' | wikisql |
CREATE TABLE table_name_91 (
date VARCHAR,
record VARCHAR
) | What is the date of the game when the Rockies had a record of 61 66? | SELECT date FROM table_name_91 WHERE record = "61–66" | sql_create_context |
CREATE TABLE table_3647 (
"Country or territory with flag" text,
"Area (km\u00b2) (per sqmi)" text,
"Population (July 2009 est.)" real,
"Population density per km\u00b2" text,
"Capital" text
) | What was the country with a population density per km of 3.5/km (/sqmi)? | SELECT "Country or territory with flag" FROM table_3647 WHERE "Population density per km\u00b2" = '3.5/km² (/sqmi)' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | how many of the patients with icd9 code 3532 died in the year less than 2174? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2174.0" AND procedures.icd9_code = "3532" | mimicsql_data |
CREATE TABLE table_70262 (
"1-person dive" text,
"2-person dive" text,
"3-person dive" text,
"Surface" text,
"Cage dive" text,
"Seal/turtle decoy" text,
"Catch release" text,
"Attached camera" text,
"Remote camera" text
) | Which cage dive has none as a 3-person dive? | SELECT "Cage dive" FROM table_70262 WHERE "3-person dive" = 'none' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREAT... | when patient 025-24306 was admitted to the hospital via the emergency department for the first time until 2104? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '025-24306' AND patient.hospitaladmitsource = 'emergency department' AND STRFTIME('%y', patient.hospitaladmittime) <= '2104' ORDER BY patient.hospitaladmittime LIMIT 1 | eicu |
CREATE TABLE zyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 在编号为4511217的医疗机构中目前在院总共多少人? | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '4511217' AND qtb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '4511217' AND gyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '4511217' AND zyb.HOSP_STS > 0 UNION SELECT COUNT(*) FROM mzb WHERE mzb.MED_SER_ORG_NO = '... | css |
CREATE TABLE table_36780 (
"Year" real,
"Location" text,
"Gold" text,
"Silver" text,
"Bronze" text
) | Who got the gold in seoul before 2002? | SELECT "Gold" FROM table_36780 WHERE "Year" < '2002' AND "Location" = 'seoul' | wikisql |
CREATE TABLE table_51458 (
"Class" text,
"Operator" text,
"No. Built" real,
"Year Built" text,
"Cars per Set" real,
"Unit nos." text
) | What class has less than 12 numbers built operated by southern? | SELECT "Class" FROM table_51458 WHERE "No. Built" < '12' AND "Operator" = 'southern' | wikisql |
CREATE TABLE table_33973 (
"Date" text,
"Site" text,
"Sport" text,
"Winning team" text,
"Series" text
) | Which date had a sport of Academics? | SELECT "Date" FROM table_33973 WHERE "Sport" = 'academics' | wikisql |
CREATE TABLE debate_people (
Debate_ID int,
Affirmative int,
Negative int,
If_Affirmative_Win bool
)
CREATE TABLE people (
People_ID int,
District text,
Name text,
Party text,
Age int
)
CREATE TABLE debate (
Debate_ID int,
Date text,
Venue text,
Num_of_Audience int
... | Bar chart x axis venue y axis how many venue | SELECT Venue, COUNT(Venue) FROM debate GROUP BY Venue | nvbench |
CREATE TABLE Claims (
Claim_ID INTEGER,
Policy_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Code CHAR(15),
Start_Date DATE,
End... | Bin the claim date into the Day of Week interval and count them for visualizing a bar chart, display by the y axis in ascending. | SELECT Date_Claim_Made, COUNT(Date_Claim_Made) FROM Settlements ORDER BY COUNT(Date_Claim_Made) | nvbench |
CREATE TABLE table_name_27 (
score VARCHAR,
tournament VARCHAR
) | What score has zadar as the tournament? | SELECT score FROM table_name_27 WHERE tournament = "zadar" | sql_create_context |
CREATE TABLE table_name_5 (
region VARCHAR,
name VARCHAR
) | What is the region for tv uskana? | SELECT region FROM table_name_5 WHERE name = "tv uskana" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessD... | Tag Wiki edits owned by Community. | SELECT * FROM Posts AS p JOIN PostHistory ON PostId = p.Id WHERE UserId = -1 AND PostTypeId IN (4, 5) | sede |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 sum of salary , and group by attribute job_id, and display by the JOB_ID in desc. | SELECT JOB_ID, SUM(SALARY) 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_63806 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What is the highest rank with the notes of sa/b, and a time of 6:39.07? | SELECT MAX("Rank") FROM table_63806 WHERE "Notes" = 'sa/b' AND "Time" = '6:39.07' | wikisql |
CREATE TABLE vehicles (
vehicle_id number,
vehicle_details text
)
CREATE TABLE customers (
customer_id number,
customer_address_id number,
customer_status_code text,
date_became_customer time,
date_of_birth time,
first_name text,
last_name text,
amount_outstanding number,
em... | How many staff in total? | SELECT COUNT(*) FROM staff | spider |
CREATE TABLE table_40744 (
"Television service" text,
"Country" text,
"Language" text,
"Content" text,
"HDTV" text,
"Package/Option" text
) | What is the package/option for Italy when the language is italian? | SELECT "Package/Option" FROM table_40744 WHERE "Country" = 'italy' AND "Language" = 'italian' | wikisql |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | What is the average base price of rooms, for each bed type Plot them as bar chart, and display in asc by the bedType please. | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType | nvbench |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,... | what number of patients have been discharged from the hospital since 3 years ago? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL AND DATETIME(patient.hospitaldischargetime) >= DATETIME(CURRENT_TIME(), '-3 year') | eicu |
CREATE TABLE table_name_75 (
draws INTEGER,
byes INTEGER
) | What is the fewest number of draws for teams with more than 0 byes? | SELECT MIN(draws) FROM table_name_75 WHERE byes > 0 | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 编号54296151099的医疗就诊开出的抗病毒口服液的剂型和规格是什么 | SELECT DOSE_FORM, SPEC FROM t_kc22 WHERE MED_CLINIC_ID = '54296151099' AND SOC_SRT_DIRE_NM = '抗病毒口服液' | css |
CREATE TABLE table_26866519_1 (
original_airdate VARCHAR,
season__number VARCHAR
) | What are the original air date(s) for season episode 20? | SELECT original_airdate FROM table_26866519_1 WHERE season__number = 20 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | among patients admitted on phys referral/normal deli, calculate the total number of those treated with glycerin (ped) | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Glycerin (Ped)" | mimicsql_data |
CREATE TABLE branch (
name VARCHAR,
branch_id VARCHAR
)
CREATE TABLE membership_register_branch (
branch_id VARCHAR,
register_year INTEGER
) | Show all branch names with the number of members in each branch registered after 2015. | SELECT T2.name, COUNT(*) FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id WHERE T1.register_year > 2015 GROUP BY T2.branch_id | sql_create_context |
CREATE TABLE table_18673 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | who are the candidates with district being kansas 4 | SELECT "Candidates" FROM table_18673 WHERE "District" = 'Kansas 4' | wikisql |
CREATE TABLE table_name_68 (
tournament VARCHAR
) | What is the total number of first prizes in USD for the Canadian Open? | SELECT SUM(1 AS st_prize___) AS $__ FROM table_name_68 WHERE tournament = "canadian open" | 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... | 把医院医院4876950全部医疗就诊的记录里患者的平均岁数按科室名字和入院诊断编码的差异列出来 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '4876950' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of hire_date and the amount of hire_date bin hire_date by time, and I want to rank from high to low by the y-axis. | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COUNT(HIRE_DATE) DESC | nvbench |
CREATE TABLE Products (
product_id INTEGER,
product_name VARCHAR(20),
product_price DECIMAL(19,4),
product_description VARCHAR(255)
)
CREATE TABLE Delivery_Routes (
route_id INTEGER,
route_name VARCHAR(50),
other_route_details VARCHAR(255)
)
CREATE TABLE Delivery_Route_Locations (
loca... | List the state names and the number of customers living in each state with a bar chart, order by the bars from low to high please. | SELECT state_province_county, COUNT(*) FROM Customer_Addresses AS t1 JOIN Addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county ORDER BY state_province_county | nvbench |
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
)
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
) | Find all students taught by OTHA MOYER. Output the first and last names of the students. | SELECT T1.firstname, T1.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom WHERE T2.firstname = "OTHA" AND T2.lastname = "MOYER" | spider |
CREATE TABLE table_22871239_8 (
_number VARCHAR,
score VARCHAR
) | Name the total number for score l 110-112 | SELECT COUNT(_number) FROM table_22871239_8 WHERE score = "L 110-112" | sql_create_context |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | Bar chart x axis country y axis the average of age | SELECT Country, AVG(Age) FROM artist GROUP BY Country | nvbench |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 这个患者00559880的身高和体重是多少? | SELECT txmzjzjlb.SG, txmzjzjlb.TZ FROM hz_info JOIN txmzjzjlb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE hz_info.RYBH = '00559880' UNION SELECT ftxmzjzjlb.SG, ftxmzjzjlb.TZ FROM hz_info JOIN ftxmzjzjlb ON hz_info.YLJGDM = ftxmzjzjlb.YLJGDM AND hz_info.KH = f... | css |
CREATE TABLE table_56291 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
) | Who was the opponent in the game with save ||33,389||87 62? | SELECT "Opponent" FROM table_56291 WHERE "Save" = '||33,389||87–62' | wikisql |
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... | 把年龄高于20岁的患者医疗记录中的总医疗费平均一下能有多少钱? | SELECT AVG(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.PERSON_AGE > 20) | css |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | tell me the total number of patients in the 498 wards until 1 year ago? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 498 AND DATETIME(patient.unitadmittime) <= DATETIME(CURRENT_TIME(), '-1 year') | eicu |
CREATE TABLE table_name_75 (
high_points VARCHAR,
team VARCHAR
) | What are the High points for Team @ portland? | SELECT high_points FROM table_name_75 WHERE team = "@ portland" | sql_create_context |
CREATE TABLE table_22825058_23 (
w_l VARCHAR,
against VARCHAR
) | Name the w/l for czech republic | SELECT w_l FROM table_22825058_23 WHERE against = "Czech Republic" | sql_create_context |
CREATE TABLE table_name_13 (
result VARCHAR,
venue VARCHAR,
year VARCHAR,
event VARCHAR
) | Wat was the result for the 20 km after 2008 when the venue was Metz, France? | SELECT result FROM table_name_13 WHERE year > 2008 AND event = "20 km" AND venue = "metz, france" | 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 year of death is less than or equal to 2179 and procedure icd9 code is 3972? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2179.0" AND procedures.icd9_code = "3972" | mimicsql_data |
CREATE TABLE table_73352 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 10" real,
"Poles" real,
"Avg. Start" text,
"Avg. Finish" text,
"Winnings" text,
"Position" text,
"Team(s)" text
) | What is the most recent year where the average start is 8.5? | SELECT MAX("Year") FROM table_73352 WHERE "Avg. Start" = '8.5' | wikisql |
CREATE TABLE table_30582 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | How many nhl teams are listed when college/junior/club team is listed as newton north high school (ushs-ma)? | SELECT COUNT("NHL team") FROM table_30582 WHERE "College/junior/club team" = 'Newton North High School (USHS-MA)' | wikisql |
CREATE TABLE table_28005809_2 (
sdlp INTEGER,
council VARCHAR
) | What is the SDLP of Belfast? | SELECT MAX(sdlp) FROM table_28005809_2 WHERE council = "Belfast" | sql_create_context |
CREATE TABLE table_58148 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the score of the away team at the the glenferrie oval? | SELECT "Away team score" FROM table_58148 WHERE "Venue" = 'glenferrie oval' | wikisql |
CREATE TABLE table_19583 (
"#" real,
"Title" text,
"Length" text,
"Writer" text,
"Composer" text,
"Arranger" text,
"Dialect" text,
"Mix Engineer" text
) | What track number is 4:29 in length? | SELECT "#" FROM table_19583 WHERE "Length" = '4:29' | wikisql |
CREATE TABLE catalogs (
catalog_id number,
catalog_name text,
catalog_publisher text,
date_of_publication time,
date_of_latest_revision time
)
CREATE TABLE catalog_contents (
catalog_entry_id number,
catalog_level_number number,
parent_entry_id number,
previous_entry_id number,
... | Which catalog contents have length below 3 or above 5? Find the catalog entry names. | SELECT catalog_entry_name FROM catalog_contents WHERE length < 3 OR width > 5 | spider |
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 diagnoses (
... | what is maximum age of patients whose marital status is widowed and death status is 0? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.expire_flag = "0" | mimicsql_data |
CREATE TABLE table_name_38 (
date VARCHAR,
result VARCHAR,
score VARCHAR
) | When has Result of 2 0, and a Score of 2 0? | SELECT date FROM table_name_38 WHERE result = "2–0" AND score = "2 – 0" | sql_create_context |
CREATE TABLE fgwyjzb (
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,
... | 在医院9155074中,根据入院诊断疾病编码查出不同疾病的平均患者年龄是多少 | SELECT gwyjzb.IN_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '9155074' GROUP BY gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.IN_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9155074' GROUP BY fgwyjzb.IN_DIAG_DIS_CD | css |
CREATE TABLE table_25947046_1 (
total INTEGER,
arabs VARCHAR
) | What is the lowest total when arabs is 4000? | SELECT MIN(total) FROM table_25947046_1 WHERE arabs = 4000 | sql_create_context |
CREATE TABLE HOTELS (
star_rating_code VARCHAR,
price_range INTEGER
) | Show the average price of hotels for each star rating code. | SELECT star_rating_code, AVG(price_range) FROM HOTELS GROUP BY star_rating_code | sql_create_context |
CREATE TABLE table_201_10 (
id number,
"#" number,
"name" text,
"office" text,
"political party" text,
"occupation" text
) | how many mayors were either fisherman or farmers ? | SELECT COUNT("name") FROM table_201_10 WHERE "occupation" IN ('fisherman', 'farmer') | squall |
CREATE TABLE table_56040 (
"Date" text,
"Venue" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Series" text
) | Name the decision for boston bruins visitor | SELECT "Decision" FROM table_56040 WHERE "Visitor" = 'boston bruins' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE cost (
row_id nu... | how many hours have passed since the first time patient 99883 during their current hospital visit received a mch lab test? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 99883 AND admissions.dis... | mimic_iii |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body t... | Users with most reputation from single post. | SELECT p.OwnerUserId AS "user_link", u.Reputation FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY p.OwnerUserId, u.Reputation HAVING COUNT(p.Id) = 1 ORDER BY u.Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_name_98 (
Id VARCHAR
) | Which 2013 has a 2010 of 1r? | SELECT 2013 FROM table_name_98 WHERE 2010 = "1r" | 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... | Calculate the average age of russian speaking patients who have sepsis as primary disease. | SELECT AVG(demographic.age) FROM demographic WHERE demographic.language = "RUSS" AND demographic.diagnosis = "SEPSIS" | mimicsql_data |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | when did patient 004-93782 for the last time since 2102 get discharged from the hospital? | SELECT patient.hospitaldischargetime FROM patient WHERE patient.uniquepid = '004-93782' AND STRFTIME('%y', patient.hospitaldischargetime) >= '2102' ORDER BY patient.hospitaldischargetime DESC LIMIT 1 | eicu |
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... | give me the number of patients whose diagnoses icd9 code is v4364 and drug route is ivpca? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "V4364" AND prescriptions.route = "IVPCA" | mimicsql_data |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
... | what are the DINNER flights from INDIANAPOLIS to SAN DIEGO on wednesday may twelfth | 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, food_service WHERE ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.... | atis |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE medication (
medi... | count how many drugs are prescribed to patient 030-44598 in 12/this year. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-44598')) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIM... | eicu |
CREATE TABLE table_39160 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | What is the mixed doubles in the year 2007 when the men's singles is eduards loze? | SELECT "Mixed doubles" FROM table_39160 WHERE "Year" > '2007' AND "Men's singles" = 'eduards loze' | wikisql |
CREATE TABLE table_11244 (
"Year" text,
"Title" text,
"US 100" text,
"US AC" text,
"Lead singer" text,
"Album" text,
"Label and cat#" text
) | Which album was on June 1998? | SELECT "Album" FROM table_11244 WHERE "Year" = 'june 1998' | wikisql |
CREATE TABLE table_72373 (
"Country" text,
"Total Drivers" real,
"Champions" text,
"Championships" text,
"Current September 22, 2013" real,
"First driver(s)" text,
"Last/Current driver(s) September 22, 2013" text
) | How many entries are there for total drivers when the Last driver for september 22, 2013 was gianmarco raimondo? | SELECT "Total Drivers" FROM table_72373 WHERE "Last/Current driver(s) September 22, 2013" = 'Gianmarco Raimondo' | wikisql |
CREATE TABLE table_name_41 (
school VARCHAR,
nickname_s_ VARCHAR
) | What is the name of the school with the Tornadoes Lady Tornadoes? | SELECT school FROM table_name_41 WHERE nickname_s_ = "tornadoes lady tornadoes" | 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,
... | provide the number of patients whose diagnoses long title is unspecified septicemia and lab test category is blood gas? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Unspecified septicemia" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE table_57149 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | What is the final score of the game at lambeau field? | SELECT "Final Score" FROM table_57149 WHERE "Stadium" = 'lambeau field' | wikisql |
CREATE TABLE table_name_4 (
time VARCHAR,
ground VARCHAR
) | What is the time of the Ghantoot Racing and Polo Club? | SELECT time FROM table_name_4 WHERE ground = "ghantoot racing and polo club" | sql_create_context |
CREATE TABLE table_name_33 (
wins VARCHAR,
runners_up VARCHAR
) | How many wins did the 8 time runner-up have? | SELECT wins FROM table_name_33 WHERE runners_up = "8" | 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 zyjzjlb (
CYBQDM text,
CYBQMC... | 编号为S25.293疾病的患者其身体里降钙素原的参考值范围中的上限与下限分别达到多些? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE table_40035 (
"Date" text,
"Opponent" text,
"Location" text,
"Result" text,
"Attendance" real
) | What was the lowest Attendance when the Opponent was Maryland? | SELECT MIN("Attendance") FROM table_40035 WHERE "Opponent" = 'maryland' | wikisql |
CREATE TABLE table_15460 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Runner(s)-up" text
) | What is the to par value for the game with a winning score of 71-69-71-70=281? | SELECT "To par" FROM table_15460 WHERE "Winning score" = '71-69-71-70=281' | wikisql |
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,
... | how many patients died after being diagnosed with hypocalcemia during the same month? | SELECT COUNT(DISTINCT t2.uniquepid) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypocalcemia') AS t1 GROUP BY t1.uniquepid HAVING MIN(t1.diagnos... | eicu |
CREATE TABLE ref_budget_codes (
budget_type_code text,
budget_type_description text
)
CREATE TABLE documents (
document_id number,
document_type_code text,
project_id number,
document_date time,
document_name text,
document_description text,
other_details text
)
CREATE TABLE statem... | Return the code of the document type that is most common. | SELECT document_type_code FROM documents GROUP BY document_type_code ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_94 (
driver VARCHAR,
points INTEGER
) | What driver has points less than 17? | SELECT driver FROM table_name_94 WHERE points < 17 | sql_create_context |
CREATE TABLE table_65091 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text,
"Attendance" text
) | What is the TV Time of the game on December 27, 2003? | SELECT "TV Time" FROM table_65091 WHERE "Date" = 'december 27, 2003' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text... | 患者40108491在2011年9月11日之后的门诊就诊记录里有哪些能对应的检验报告单?这些在就诊时的诊流水号是什么? | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers... | css |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transa... | What is the relationship between card number and card id? Return a scatter chart. | SELECT card_id, card_number FROM Customers_Cards | nvbench |
CREATE TABLE table_name_16 (
player VARCHAR,
country VARCHAR
) | Which player is from England? | SELECT player FROM table_name_16 WHERE country = "england" | sql_create_context |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(1... | Show the order ids and the number of items in each order with a scatter chart. | SELECT order_id, COUNT(*) FROM Order_Items GROUP BY order_id | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.