context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 在张秀媛的患者的检查过程中有哪些检验报告单对应的检验结果指标是都不正常的?具体的检验报告单号是啥? | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '张... | css |
CREATE TABLE table_7057 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total of silver when gold is less than 0? | SELECT SUM("Silver") FROM table_7057 WHERE "Gold" < '0' | wikisql |
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 primary disease is left colon cancer and procedure short title is temporary tracheostomy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LEFT COLON CANCER" AND procedures.short_title = "Temporary tracheostomy" | mimicsql_data |
CREATE TABLE third_party_companies (
company_id number,
company_type text,
company_name text,
company_address text,
other_company_details text
)
CREATE TABLE part_faults (
part_fault_id number,
part_id number,
fault_short_name text,
fault_description text,
other_fault_details te... | List the all the assets make, model, details by the disposed date ascendingly. | SELECT asset_make, asset_model, asset_details FROM assets ORDER BY asset_disposed_date | spider |
CREATE TABLE table_12703 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What was the away team for the game in Slough Town? | SELECT "Away team" FROM table_12703 WHERE "Home team" = 'slough town' | wikisql |
CREATE TABLE table_21445 (
"Team #1" text,
"Points" text,
"Team #2" text,
"1st leg" text,
"2nd leg" text
) | When they played Universidad de Chile, what was the score of the first leg? | SELECT COUNT("1st leg") FROM table_21445 WHERE "Team #2" = 'Universidad de Chile' | wikisql |
CREATE TABLE table_name_55 (
result VARCHAR,
date VARCHAR
) | What was the result on 1990-11-04? | SELECT result FROM table_name_55 WHERE date = "1990-11-04" | sql_create_context |
CREATE TABLE table_56031 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many points did the away team score when the home team scored 16.12 (108)? | SELECT "Away team score" FROM table_56031 WHERE "Home team score" = '16.12 (108)' | wikisql |
CREATE TABLE jobs (
job_id text,
job_title text,
min_salary number,
max_salary number
)
CREATE TABLE regions (
region_id number,
region_name text
)
CREATE TABLE locations (
location_id number,
street_address text,
postal_code text,
city text,
state_province text,
countr... | display job title and average salary of employees. | SELECT job_title, AVG(salary) FROM employees AS T1 JOIN jobs AS T2 ON T1.job_id = T2.job_id GROUP BY T2.job_title | spider |
CREATE TABLE table_204_812 (
id number,
"#" number,
"prime minister" text,
"date of birth" text,
"start date\nof (first) term" text,
"age at beginning\nof (first) term" text,
"end date\nof (final) term" text,
"total time in\noffice" text,
"date of death" text,
"lifespan" text
) | how many australian prime ministers were older than 50 at the time they began their first term ? | SELECT COUNT("prime minister") FROM table_204_812 WHERE "age at beginning\nof (first) term" >= 50 | squall |
CREATE TABLE tv_series (
sid int,
title text,
release_year int,
num_of_seasons int,
num_of_episodes int,
title_aka text,
budget text
)
CREATE TABLE made_by (
id int,
msid int,
pid int
)
CREATE TABLE company (
id int,
name text,
country_code varchar
)
CREATE TABLE p... | which company funded the ' Mickey Mouse ' series | SELECT company.name FROM company, copyright, tv_series WHERE copyright.cid = company.id AND tv_series.sid = copyright.msid AND tv_series.title = 'Mickey Mouse' | imdb |
CREATE TABLE residents_services (
resident_id number,
service_id number,
date_moved_in time,
property_id number,
date_requested time,
date_provided time,
other_details text
)
CREATE TABLE services (
service_id number,
organization_id number,
service_type_code text,
service_d... | What is the maximum number that a certain service is provided? List the service id, details and number. | SELECT T1.service_id, T1.service_details, COUNT(*) FROM services AS T1 JOIN residents_services AS T2 ON T1.service_id = T2.service_id GROUP BY T1.service_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_46849 (
"Position" real,
"Team" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Goals For" real,
"Goals Against" real,
"Goal Difference" text,
"Points 1" text
) | What is the largest drawn number when 14 is the position, and goals for is more than 66? | SELECT MAX("Drawn") FROM table_46849 WHERE "Position" = '14' AND "Goals For" > '66' | wikisql |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
H... | 把医院4560557全部医疗就诊的记录里民政补助的金额比上全部的医疗费用额度的最大比值参照不同的科室编号和不同的入院诊断疾病的编号列一下,并且把结果从大到小排出来 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4560557' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC | css |
CREATE TABLE table_name_50 (
date VARCHAR,
leading_scorer VARCHAR
) | What date was Carlos Boozer (23) the leading scorer? | SELECT date FROM table_name_50 WHERE leading_scorer = "carlos boozer (23)" | sql_create_context |
CREATE TABLE table_2182562_1 (
wins VARCHAR,
avg_start VARCHAR
) | How many wins when the average start is 29.0? | SELECT COUNT(wins) FROM table_2182562_1 WHERE avg_start = "29.0" | sql_create_context |
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 Votes (
Id number,
PostId number,
VoteTypeId nu... | Proportion of Questions with an Accepted Answer. | SELECT 1.0 * COUNT(CASE WHEN NOT AcceptedAnswerId IS NULL THEN 1 ELSE NULL END) / COUNT(*) FROM Posts WHERE PostTypeId = 1 | sede |
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 (
... | what is the number of medicare patients who had clofarabine intravenous infusion? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.short_title = "IV infusion clofarabine" | mimicsql_data |
CREATE TABLE table_name_60 (
Id VARCHAR
) | How many sets were played in the tournament that had 4R in 2011 and 2R in 2008? | SELECT 2009 FROM table_name_60 WHERE 2011 = "4r" AND 2008 = "2r" | sql_create_context |
CREATE TABLE table_667 (
"Year" real,
"Finish position" text,
"1st day" text,
"2nd day" text,
"3rd day" text,
"4th Day" text
) | what's the 3rd day with finbeingh position being 16th | SELECT "3rd day" FROM table_667 WHERE "Finish position" = '16th' | wikisql |
CREATE TABLE table_name_62 (
home VARCHAR,
visitor VARCHAR,
date VARCHAR
) | What was the home team that played Vancouver on April 29? | SELECT home FROM table_name_62 WHERE visitor = "vancouver" AND date = "april 29" | sql_create_context |
CREATE TABLE table_70691 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What Date has a label of alfa records? | SELECT "Date" FROM table_70691 WHERE "Label" = 'alfa records' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 和我讲讲医疗就诊53117897919中药品402418932-k所属的三大目录类别各是什么? | SELECT DIRE_TYPE FROM t_kc22 WHERE MED_CLINIC_ID = '53117897919' AND SOC_SRT_DIRE_CD = '402418932-k' | css |
CREATE TABLE table_11838 (
"Name" text,
"Country" text,
"Reign began" text,
"Reign ended" text,
"Length" text
) | When did Pharaoh Seth's reign end? | SELECT "Reign ended" FROM table_11838 WHERE "Name" = 'pharaoh seth' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | Find the number of patients whose ethnicity is white - russian and drug route is ivpca? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "IVPCA" | mimicsql_data |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No... | What are the number of the wines that have prices lower than 50 and have appelations in Monterey county?, and display by the x-axis in desc. | SELECT Name, COUNT(Name) FROM appellations AS T1 JOIN wine AS T2 ON T1.Appelation = T2.Appelation WHERE T1.County = "Monterey" AND T2.Price < 50 GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | what would be the average yearly number of patients diagnosed with toxic myopathy since 3 years ago? | SELECT AVG(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'toxic myopathy') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY... | mimic_iii |
CREATE TABLE table_75150 (
"Player" text,
"Position" text,
"Starter" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many extra points did right halfback Roswell Wendell have? | SELECT "Extra points" FROM table_75150 WHERE "Position" = 'right halfback' AND "Player" = 'roswell wendell' | wikisql |
CREATE TABLE table_name_25 (
company_or_product_name VARCHAR,
money_requested__£_ VARCHAR,
entrepreneur_s_ VARCHAR
) | What was the Company or Product name where Entrepreneurs Geoff and Colette Bell requested 75,000? | SELECT company_or_product_name FROM table_name_25 WHERE money_requested__£_ = "75,000" AND entrepreneur_s_ = "geoff and colette bell" | 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,... | 看看在02年7月20日到12年4月8日期间,医院8578851的购药医疗记录合计数 | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '8578851' AND IN_HOSP_DATE BETWEEN '2002-07-20' AND '2012-04-08' AND CLINIC_TYPE = '购药' | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what number of patients born before the year 2034 had lab test item id 51009? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2034" AND lab.itemid = "51009" | mimicsql_data |
CREATE TABLE table_name_77 (
circuit VARCHAR,
session VARCHAR
) | What circuit has qualifying as the session? | SELECT circuit FROM table_name_77 WHERE session = "qualifying" | sql_create_context |
CREATE TABLE table_name_42 (
floors INTEGER,
height__m_ VARCHAR
) | What are the fewest floors for the building that has a height of 116 meters? | SELECT MIN(floors) FROM table_name_42 WHERE height__m_ = 116 | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
... | what is the one year survival rate of patients suffering from acute respiratory failure - due to pulmonary infiltrates who were prescribed cefazolin 2 gm in ns 100 ml ivpb (repackage)? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... | eicu |
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... | 哪一天进行75820096573这个门诊就诊呢 | SELECT txmzjzjlb.JZKSRQ FROM txmzjzjlb WHERE txmzjzjlb.JZLSH = '75820096573' UNION SELECT ftxmzjzjlb.JZKSRQ FROM ftxmzjzjlb WHERE ftxmzjzjlb.JZLSH = '75820096573' | css |
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,
... | How many hispanic, latino, or puerto rican patients are on drug named sucralfate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND prescriptions.drug = "Sucralfate" | mimicsql_data |
CREATE TABLE table_name_23 (
player VARCHAR,
to_par VARCHAR,
score VARCHAR
) | What player has +3 to par and score of 75-72=147? | SELECT player FROM table_name_23 WHERE to_par = "+3" AND score = 75 - 72 = 147 | sql_create_context |
CREATE TABLE table_name_19 (
score VARCHAR,
place VARCHAR,
country VARCHAR
) | What's the score for the t10 player from zimbabwe? | SELECT score FROM table_name_19 WHERE place = "t10" AND country = "zimbabwe" | sql_create_context |
CREATE TABLE Staff_Department_Assignments (
staff_id INTEGER,
department_id INTEGER,
date_assigned_from DATETIME,
job_title_code VARCHAR(10),
date_assigned_to DATETIME
)
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date D... | What are the names and ids of customers whose address contains TN Show bar chart, and rank in asc by the y-axis. | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id | nvbench |
CREATE TABLE table_46904 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
) | What is Opponent, when Location/Attendance is 'Mellon Arena - 17,132'? | SELECT "Opponent" FROM table_46904 WHERE "Location/Attendance" = 'mellon arena - 17,132' | wikisql |
CREATE TABLE player (
player_id number,
player text,
years_played text,
total_wl text,
singles_wl text,
doubles_wl text,
team number
)
CREATE TABLE team (
team_id number,
name text
)
CREATE TABLE match_season (
season number,
player text,
position text,
country numb... | Show the players and years played for players from team 'Columbus Crew'. | SELECT T1.player, T1.years_played FROM player AS T1 JOIN team AS T2 ON T1.team = T2.team_id WHERE T2.name = "Columbus Crew" | spider |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 在75363192461的医疗就诊中,定价上限金额高于3738.33元的药品被开出了哪些,把清单列出来 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '75363192461' AND UP_LIMIT_AMO > 3738.33 | css |
CREATE TABLE table_name_7 (
district VARCHAR,
first_elected VARCHAR,
towns_represented VARCHAR
) | Which district had first elected earlier than 2006 for representation of Broken Arrow, Tulsa? | SELECT district FROM table_name_7 WHERE first_elected < 2006 AND towns_represented = "broken arrow, tulsa" | sql_create_context |
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 ... | 从零七年到八月十一日之后,查查医疗机构7743304的住院就诊记录中入院登记有多少 | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '7743304' AND wdmzjzjlb.RYDJSJ > '2007-08-11' UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '7743304' AND bdmzjzjlb.RYDJSJ > '2007-08-11' | css |
CREATE TABLE Ref_Colors (
color_code VARCHAR(15),
color_description VARCHAR(80)
)
CREATE TABLE Ref_Characteristic_Types (
characteristic_type_code VARCHAR(15),
characteristic_type_description VARCHAR(80)
)
CREATE TABLE Product_Characteristics (
product_id INTEGER,
characteristic_id INTEGER,
... | A bar chart for finding the number of the category descriptions of the products whose descriptions include letter 't', and could you rank x axis from low to high order? | SELECT product_category_description, COUNT(product_category_description) FROM Ref_Product_Categories AS T1 JOIN Products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%' GROUP BY product_category_description ORDER BY product_category_description | nvbench |
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... | count the number of patients who have had systemic antibiotics - quinolone performed since 3 years ago. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'systemic antibiotics - quinolone' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TIME(), '-3 year')) | eicu |
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 decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY... | 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, return a line chart about the change of employee_id over hire_date . | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_79006 (
"Player" text,
"Team" text,
"Round 1" real,
"Round 2" text,
"Subtotal" real,
"Finals" text,
"Total" real
) | Which player has a subtotal of more than 3 and more than 8 in round 1? | SELECT "Player" FROM table_79006 WHERE "Subtotal" > '3' AND "Round 1" > '8' | wikisql |
CREATE TABLE table_name_65 (
socialist_ticket VARCHAR,
american_labor_ticket VARCHAR
) | Which Socialist candidate ran against American Labor candidate Caroline O'Day? | SELECT socialist_ticket FROM table_name_65 WHERE american_labor_ticket = "caroline o'day" | sql_create_context |
CREATE TABLE table_6390 (
"Year" real,
"Film" text,
"Role" text,
"Language" text,
"Notes" text
) | Which film has a role named Taylor? | SELECT "Film" FROM table_6390 WHERE "Role" = 'taylor' | wikisql |
CREATE TABLE table_56348 (
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | Who held pole position at the race won by Gilles Villeneuve, with the fastest lap held by Gilles Villeneuve, driving a Ferrari? | SELECT "Pole Position" FROM table_56348 WHERE "Fastest Lap" = 'gilles villeneuve' AND "Constructor" = 'ferrari' AND "Race Winner" = 'gilles villeneuve' | wikisql |
CREATE TABLE mission (
mission_id number,
ship_id number,
code text,
launched_year number,
location text,
speed_knots number,
fate text
)
CREATE TABLE ship (
ship_id number,
name text,
type text,
nationality text,
tonnage number
) | What are the types and nationalities of every ship? | SELECT type, nationality FROM ship | spider |
CREATE TABLE table_24872 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | what is the name of the episode whose premiere was in march 2, 1997? | SELECT "Title" FROM table_24872 WHERE "Original air date" = 'March 2, 1997' | wikisql |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
) | Return the dates of birth for entrepreneurs who have either the investor Simon Woodroffe or Peter Jones, and count them by a bar chart, and rank by the how many date of birth from high to low. | SELECT Date_of_Birth, COUNT(Date_of_Birth) FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID WHERE T1.Investor = "Simon Woodroffe" OR T1.Investor = "Peter Jones" ORDER BY COUNT(Date_of_Birth) DESC | nvbench |
CREATE TABLE table_62458 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Which play is from Ireland? | SELECT "Player" FROM table_62458 WHERE "Country" = 'ireland' | wikisql |
CREATE TABLE table_66769 (
"Team" text,
"City" text,
"State" text,
"Home venue" text,
"Capacity" real
) | What is the state of the team who plays in Mumbai? | SELECT "State" FROM table_66769 WHERE "Team" = 'mumbai' | wikisql |
CREATE TABLE table_32861 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the size of the crowd for the game with Footscray as the home team? | SELECT AVG("Crowd") FROM table_32861 WHERE "Home team" = 'footscray' | wikisql |
CREATE TABLE table_49705 (
"Exit Date" text,
"Pos." text,
"Player" text,
"To club" text,
"Transfer fee" text
) | Ashley Grimes had what to club? | SELECT "To club" FROM table_49705 WHERE "Player" = 'ashley grimes' | wikisql |
CREATE TABLE table_name_14 (
bronze INTEGER,
total VARCHAR,
gold VARCHAR,
nation VARCHAR
) | What is the lowest bronze medal count for Italy with fewer than 6 gold medals and greater than 10 total medals? | SELECT MIN(bronze) FROM table_name_14 WHERE gold < 6 AND nation = "italy" AND total > 10 | sql_create_context |
CREATE TABLE table_42819 (
"Date" text,
"Home captain" text,
"Away captain" text,
"Venue" text,
"Result" text
) | What was the result of the game that was played on 29,30 31 May 1902? | SELECT "Result" FROM table_42819 WHERE "Date" = '29,30–31 may 1902' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | All CommunityWiky posts by users that aren't closed. | SELECT PostTypes.Name, Posts.Id AS "post_link", Posts.Score AS Score, Users.DisplayName, Posts.CreationDate FROM Posts INNER JOIN Users ON Posts.OwnerUserId = Users.Id INNER JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id LEFT JOIN Posts AS ParentPosts ON Posts.ParentId = ParentPosts.Id WHERE Posts.PostTypeId IN (1, ... | sede |
CREATE TABLE table_36063 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | Which team has 48 rebounds? | SELECT "Team" FROM table_36063 WHERE "Rebounds" = '48' | wikisql |
CREATE TABLE table_56104 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | How many bronzes for nations ranked above 7, under 3 golds, and under 10 total medals? | SELECT COUNT("Bronze") FROM table_56104 WHERE "Rank" < '7' AND "Gold" < '3' AND "Total" < '10' | wikisql |
CREATE TABLE table_name_31 (
percent_of_slovenes_1951 VARCHAR,
village__german_ VARCHAR
) | What percentage of Slovenes lived in the village of Roach in 1951? | SELECT percent_of_slovenes_1951 FROM table_name_31 WHERE village__german_ = "roach" | sql_create_context |
CREATE TABLE table_73869 (
"Constituency" text,
"Candidate" text,
"Affiliation" text,
"Result - votes" real,
"Result - %" text,
"Loss/gain" text
) | How many values for constituency for the vote result of 162? | SELECT COUNT("Constituency") FROM table_73869 WHERE "Result - votes" = '162' | wikisql |
CREATE TABLE table_2840500_3 (
pick VARCHAR,
player VARCHAR
) | what is the overall number of chosen ideas where the person is scott parker | SELECT COUNT(pick) FROM table_2840500_3 WHERE player = "Scott Parker" | sql_create_context |
CREATE TABLE table_29447 (
"Club" text,
"Chairman" text,
"Current manager" text,
"Team captain" text,
"Kitmaker" text,
"Shirt sponsor" text
) | What is the club when the chairman is roger lambrecht? | SELECT "Club" FROM table_29447 WHERE "Chairman" = 'Roger Lambrecht' | wikisql |
CREATE TABLE table_10188 (
"Rank" real,
"Gymnast" text,
"Floor Exercise" real,
"Pommel Horse" real,
"Rings" real,
"Vault" real,
"Parallel Bars" real,
"Horizontal Bar" real,
"Total" real
) | Name the total number of pommel horses for vault of 9.475 and rank more than 16 | SELECT COUNT("Pommel Horse") FROM table_10188 WHERE "Rank" > '16' AND "Vault" = '9.475' | wikisql |
CREATE TABLE table_65340 (
"Draw" real,
"Entrant" text,
"Brand" text,
"Order" text,
"Eliminated by" text,
"Time" text
) | What is Mark Henry's brand? | SELECT "Brand" FROM table_65340 WHERE "Entrant" = 'mark henry' | wikisql |
CREATE TABLE table_name_54 (
profits__billion_ INTEGER,
sales__billion_$_ VARCHAR,
headquarters VARCHAR,
industry VARCHAR
) | How many profits is the company that is headquartered in the USA, in the banking industry, and has sales (billion $) less than 98.64 bringing in? | SELECT SUM(profits__billion_) AS $_ FROM table_name_54 WHERE headquarters = "usa" AND industry = "banking" AND sales__billion_$_ < 98.64 | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and order by the Y in ascending. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Manufacturer | nvbench |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customer_Policies (
Policy_ID INTEGER,
Customer_ID INTEGER,
Policy_Type_Co... | Bin the settlement date for each settlement case into the day of week interval and count them for visualizing a bar chart, show by the Y-axis in desc. | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements ORDER BY COUNT(Date_Claim_Settled) DESC | nvbench |
CREATE TABLE table_name_66 (
starts VARCHAR,
earnings__$_ VARCHAR,
cuts_made VARCHAR,
top_25 VARCHAR
) | How many Starts that have Cuts made of 2, Top 25 larger than 0, and Earnings ($) smaller than 338,067? | SELECT COUNT(starts) FROM table_name_66 WHERE cuts_made = 2 AND top_25 > 0 AND earnings__$_ < 338 OFFSET 067 | sql_create_context |
CREATE TABLE table_name_95 (
game INTEGER,
time VARCHAR
) | What is the number of the game that was played in the time of 2:38? | SELECT MAX(game) FROM table_name_95 WHERE time = "2:38" | sql_create_context |
CREATE TABLE table_203_581 (
id number,
"club" text,
"chinese" text,
"city" text,
"home stadium" text,
"capacity" number,
"average attendance" number
) | how many total clubs are listed ? | SELECT COUNT("club") FROM table_203_581 | squall |
CREATE TABLE table_name_33 (
notes VARCHAR,
call_sign VARCHAR
) | What is the Notes of the Frequency with Call sign CFUN-FM-1? | SELECT notes FROM table_name_33 WHERE call_sign = "cfun-fm-1" | sql_create_context |
CREATE TABLE table_name_10 (
player VARCHAR,
club_team VARCHAR
) | What Player Club Team is Indiana Ice (ushl)? | SELECT player FROM table_name_10 WHERE club_team = "indiana ice (ushl)" | sql_create_context |
CREATE TABLE table_34249 (
"Kanji" text,
"Name" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
) | What is the Kanji for the Ayanami dd-45? | SELECT "Kanji" FROM table_34249 WHERE "Name" = 'ayanami dd-45' | wikisql |
CREATE TABLE table_2679061_9 (
nationality VARCHAR,
pick__number VARCHAR
) | What was the nationality of player picked no. 179? | SELECT nationality FROM table_2679061_9 WHERE pick__number = 179 | sql_create_context |
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
CREATE TABLE student (
stu_num number,
stu_lname text,
stu_fname text,
stu_init text,
stu_dob time,
stu_hrs number,
stu_class text,
stu_gp... | Which department has the highest average student GPA, and what is the average gpa? | SELECT T2.dept_name, AVG(T1.stu_gpa) FROM student AS T1 JOIN department AS T2 ON T1.dept_code = T2.dept_code GROUP BY T1.dept_code ORDER BY AVG(T1.stu_gpa) DESC LIMIT 1 | spider |
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,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 查一下从2001-08-28到2006-01-01这期间,患者窦碧玉去9175260这个医疗机构看过几次门诊 | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '窦碧玉' AND mzjzjlb.JZKSRQ BETWEEN '2001-08-28' AND '2006-01-01' AND mzjzjlb.YLJGDM = '9175260' | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
... | what's the name of the drug that was first prescribed to patient 60136? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136) ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_train_232 (
"id" int,
"metastatic_cancer" bool,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"short_life_expectancy" bool,
"body_mass_index_bmi" float,
"a1c" float,
"NOUSE" float
) | body mass index range ( 25 _ 38 kg / m2 ) with type ii diabetes mellitus receiving stable dose of metformin bid for the previous 60 days for glucose control | SELECT * FROM table_train_232 WHERE body_mass_index_bmi >= 25 AND body_mass_index_bmi <= 38 AND diabetic = 'ii' | criteria2sql |
CREATE TABLE table_1820752_1 (
constellation VARCHAR,
spectral_type VARCHAR
) | If the spectral type is g1v, what is the constellation? | SELECT constellation FROM table_1820752_1 WHERE spectral_type = "G1V" | sql_create_context |
CREATE TABLE table_name_46 (
points INTEGER,
player VARCHAR,
tries VARCHAR
) | What is the average number of points scored by Joe Vagana when making fewer than 2 tries? | SELECT AVG(points) FROM table_name_46 WHERE player = "joe vagana" AND tries < 2 | sql_create_context |
CREATE TABLE table_204_211 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | who is the only country to win only golds ? | SELECT "nation" FROM table_204_211 WHERE "silver" = 0 AND "bronze" = 0 | squall |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 门诊上一般被诊断为慢性支气管炎的患者的检测指标454629数值的平均值以及最值会是怎样的数据 | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '慢性支气管炎' AND jyjgzbb.JCZBDM = ... | css |
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 ... | 哪些患者在02981540665住院就诊,查询病人的卡号以及卡的类型 | SELECT KH, KLX FROM zyjzjlb WHERE JZLSH = '02981540665' | css |
CREATE TABLE table_name_25 (
away_team VARCHAR
) | Name the away team score for geelong away team | SELECT away_team AS score FROM table_name_25 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number... | High View Counts with no Images. Questions whos answers don't have any screenshots but have a very high view count | SELECT P.Id AS "post_link", P.Score, P.ViewCount FROM Posts AS P WHERE P.ClosedDate IS NULL AND P.PostTypeId = 1 AND P.AnswerCount >= 1 AND P.Id NOT IN (SELECT A.ParentId FROM Posts AS A WHERE A.PostTypeId = 2 AND A.Score >= 2 AND A.Body LIKE '%imgur%') ORDER BY P.ViewCount DESC | sede |
CREATE TABLE table_name_12 (
date VARCHAR,
score VARCHAR,
record VARCHAR
) | Which Date has a Score of 24-7, and a Record of 4-10? | SELECT date FROM table_name_12 WHERE score = "24-7" AND record = "4-10" | sql_create_context |
CREATE TABLE table_28600 (
"Year" real,
"Under-11" text,
"Under-13" text,
"Under-15" text,
"Under-17" text,
"Under-19" text
) | In the year 2009 who was the under-13? | SELECT "Under-13" FROM table_28600 WHERE "Year" = '2009' | wikisql |
CREATE TABLE table_name_23 (
crowd INTEGER,
home_team VARCHAR
) | When the Home team of geelong played, what was their lowest Crowd number? | SELECT MIN(crowd) FROM table_name_23 WHERE home_team = "geelong" | sql_create_context |
CREATE TABLE table_name_47 (
pick INTEGER,
round VARCHAR,
overall VARCHAR
) | How many picks had a round smaller than 6 and an overall bigger than 153? | SELECT SUM(pick) FROM table_name_47 WHERE round < 6 AND overall > 153 | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what are patient 012-169's gender? | SELECT DISTINCT patient.gender FROM patient WHERE patient.uniquepid = '012-169' | eicu |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE In... | Plot a scatter chart, order id by the total number . | SELECT order_id, COUNT(*) FROM Invoices GROUP BY order_id | nvbench |
CREATE TABLE table_name_73 (
player VARCHAR,
country VARCHAR,
to_par VARCHAR
) | Name the Player who has a Country of united states, and a To par of 5? | SELECT player FROM table_name_73 WHERE country = "united states" AND to_par = "–5" | sql_create_context |
CREATE TABLE table_40286 (
"Week of" text,
"Tier" text,
"Winner" text,
"Runner-up" text,
"Semi finalists" text
) | What is the Semi finalists when the Runner-up was katrina adams zina garrison-jackson? | SELECT "Semi finalists" FROM table_40286 WHERE "Runner-up" = 'katrina adams zina garrison-jackson' | wikisql |
CREATE TABLE table_name_29 (
size_difference VARCHAR,
prefix VARCHAR
) | What is the size difference for exa? | SELECT size_difference FROM table_name_29 WHERE prefix = "exa" | sql_create_context |
CREATE TABLE table_11982 (
"Date" text,
"Venue" text,
"Opponent" text,
"Result" text,
"Tournament" text,
"Scored" real
) | Where was the game with the result of 22-20 played? | SELECT "Venue" FROM table_11982 WHERE "Result" = '22-20' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.