context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_203_739 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many nations received silver medals ? | SELECT COUNT("nation") FROM table_203_739 WHERE "silver" <> 0 | squall |
CREATE TABLE table_name_12 (
high_points VARCHAR,
game INTEGER
) | Who had the most points in games over 59? | SELECT high_points FROM table_name_12 WHERE game > 59 | sql_create_context |
CREATE TABLE table_46057 (
"Fin. Pos" text,
"Car No." text,
"Driver" text,
"Team" text,
"Laps" text,
"Time/Retired" text,
"Grid" text,
"Laps Led" text,
"Points" text
) | How many laps led when the Grid was 15? | SELECT "Laps Led" FROM table_46057 WHERE "Grid" = '15' | 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 prescription... | Count the number of patients admitted before the year 2175 whose procedure long title is other closed [endoscopic] biopsy of biliary duct or sphincter of oddi. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2175" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" | mimicsql_data |
CREATE TABLE participates_in (
stuid VARCHAR
)
CREATE TABLE activity (
actid VARCHAR,
activity_name VARCHAR
) | Find the ids of the students who participate in Canoeing and Kayaking. | SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Canoeing' INTERSECT SELECT T1.stuid FROM participates_in AS T1 JOIN activity AS T2 ON T2.actid = T2.actid WHERE T2.activity_name = 'Kayaking' | sql_create_context |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Are there any morning sessions for MENAS 334 ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time < '12:00:00' AND course_offering.start_time >= '08:00:00' AND course.course_id = course_offering.course_id AND course.department = 'MENAS' AND course.number = 334 AND semester.semester = 'WN' AND semester.semester_id = course_of... | advising |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 在03-3-18到04-1-26内,患者吕问筠被开出的哪些药品,把所有药品的编码、名称、数量、单价、金额列出来 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '吕问筠' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-03-18' AND '2004-01-26' | css |
CREATE TABLE table_name_56 (
third VARCHAR,
nation VARCHAR
) | Who is the third alternate for Germany? | SELECT third FROM table_name_56 WHERE nation = "germany" | sql_create_context |
CREATE TABLE table_203_803 (
id number,
"draw" number,
"country" text,
"language" text,
"artist" text,
"song" text,
"english translation" text,
"place" number,
"points" number
) | which country is listed last on the chart ? | SELECT "country" FROM table_203_803 ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_50475 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What was the time when his opponent was Rudy Martin? | SELECT "Time" FROM table_50475 WHERE "Opponent" = 'rudy martin' | wikisql |
CREATE TABLE table_18159601_1 (
greek_designation VARCHAR,
city VARCHAR
) | how mnay greek designation in tampa | SELECT COUNT(greek_designation) FROM table_18159601_1 WHERE city = "Tampa" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_labitems (
row_id number,
itemid numbe... | tell me the total dose of phenytoin sodium patient 15209 has been prescribed on the current hospital encounter? | SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15209 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'phenytoin sodium' | mimic_iii |
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE sportsinfo (
stuid number,
sportname text,
hoursperweek number,
gamesplayed number,
onscholarship text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text... | What are the names of all the games that have been played for at least 1000 hours? | SELECT gname FROM plays_games AS T1 JOIN video_games AS T2 ON T1.gameid = T2.gameid GROUP BY T1.gameid HAVING SUM(hours_played) >= 1000 | spider |
CREATE TABLE table_21436373_6 (
result_games VARCHAR,
date_year VARCHAR
) | What is the result/games of Sun 11/28/10 as the date/year? | SELECT result_games FROM table_21436373_6 WHERE date_year = "Sun 11/28/10" | sql_create_context |
CREATE TABLE table_61113 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Who was Margaret Court's opponent on clay in 1975? | SELECT "Opponents" FROM table_61113 WHERE "Surface" = 'clay' AND "Partner" = 'margaret court' AND "Year" = '1975' | wikisql |
CREATE TABLE table_name_15 (
masthead VARCHAR,
end_month VARCHAR
) | Which masthead ends on oct 69? | SELECT masthead FROM table_name_15 WHERE end_month = "oct–69" | sql_create_context |
CREATE TABLE table_69161 (
"Name" text,
"Tour" real,
"Giro" real,
"Vuelta" real,
"Total" real
) | The sun of total that has a tour of 7 and a Giro smaller than 3 is 12. | SELECT SUM("Total") FROM table_69161 WHERE "Tour" = '7' AND "Giro" < '3' | wikisql |
CREATE TABLE table_79785 (
"Team 1" text,
"Agg." text,
"Team 2" text,
"1st leg" text,
"2nd leg" text
) | Which team lost 0-3 and 0-5? | SELECT "Team 1" FROM table_79785 WHERE "2nd leg" = '0-3' AND "1st leg" = '0-5' | wikisql |
CREATE TABLE browser (
id int,
name text,
market_share real
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_year int
)
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connectio... | Display a bar chart for what are the ids and names of the web accelerators that are compatible with two or more browsers?, and could you rank by the bars in desc please? | SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id ORDER BY name DESC | nvbench |
CREATE TABLE Complaints (
complaint_id INTEGER,
product_id INTEGER,
customer_id INTEGER,
complaint_outcome_code VARCHAR(20),
complaint_status_code VARCHAR(20),
complaint_type_code VARCHAR(20),
date_complaint_raised DATETIME,
date_complaint_closed DATETIME,
staff_id INTEGER
)
CREATE ... | List the name of all products along with the number of complaints that they have received, sort by the the total number from low to high please. | SELECT product_name, COUNT(*) FROM Products AS t1 JOIN Complaints AS t2 ON t1.product_id = t2.product_id GROUP BY t1.product_name ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_7706 (
"Year" real,
"Date" text,
"Home" text,
"Score" text,
"Away" text,
"Venue" text
) | What date were Romania at Home at the Bucharest Venue with a Score of 13-19? | SELECT "Date" FROM table_7706 WHERE "Home" = 'romania' AND "Venue" = 'bucharest' AND "Score" = '13-19' | wikisql |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | A bar chart for what are the number of the titles of all movies that have rating star is between 3 and 5?, and display in asc by the X-axis. | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY title | nvbench |
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... | count the number of patients whose death status is 1 and admission location is emergency room admit? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.admission_location = "EMERGENCY ROOM ADMIT" | mimicsql_data |
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... | 在医院0600104中编码为80814674的患者门诊诊断名称包含牙龈的门诊就诊记录都有哪些? | SELECT * 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_mzjzjlb.mzjzjlb... | css |
CREATE TABLE table_name_91 (
finish VARCHAR,
year VARCHAR,
chassis VARCHAR,
start VARCHAR
) | What did the Dallara chassis with a 5 start in 2006 finish? | SELECT finish FROM table_name_91 WHERE chassis = "dallara" AND start = "5" AND year = 2006 | sql_create_context |
CREATE TABLE table_35164 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | In what Tournament was Janet Young a Partner? | SELECT "Tournament" FROM table_35164 WHERE "Partner" = 'janet young' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | How many patients are of divorced marital status and with black/african american ethnicity? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN" | mimicsql_data |
CREATE TABLE table_51299 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What position did the Saskatchewan player get drafted as? | SELECT "Position" FROM table_51299 WHERE "College" = 'saskatchewan' | wikisql |
CREATE TABLE table_204_63 (
id number,
"round" number,
"circuit" text,
"date" text,
"pole position" text,
"winning driver" text,
"winning team" text,
"trophy winner" text
) | what circuit is listed below autodromo di pergusa , enna ? | SELECT "circuit" FROM table_204_63 WHERE id = (SELECT id FROM table_204_63 WHERE "circuit" = 'autodromo di pergusa, enna') + 1 | squall |
CREATE TABLE table_name_60 (
first_appearance VARCHAR,
year VARCHAR,
name VARCHAR
) | What first appeared in 1966 in the comic X-2-Y? | SELECT first_appearance FROM table_name_60 WHERE year = 1966 AND name = "x-2-y" | sql_create_context |
CREATE TABLE table_24451 (
"Chassis code" text,
"Model no." text,
"Production years" text,
"Drivetrain" text,
"Transmission" text,
"Engine type" text,
"Engine code" text,
"Region(s)" text
) | Name the model number for usf46 | SELECT "Model no." FROM table_24451 WHERE "Chassis code" = 'USF46' | wikisql |
CREATE TABLE table_40873 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the fewest games lost by Paulistano with more than 39 points? | SELECT MIN("Lost") FROM table_40873 WHERE "Team" = 'paulistano' AND "Points" > '39' | wikisql |
CREATE TABLE table_22606461_10 (
rank VARCHAR
) | What is every entry for 1982-83 for rank 1? | SELECT 1982 AS _83 FROM table_22606461_10 WHERE rank = 1 | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | 查出医院3713663在2008年7月24日到2015年1月4日内哪些医疗就诊记录符合入院诊断疾病结果与出院诊断疾病结果不同的情况 | SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3713663' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-07-24' AND '2015-01-04' EXCEPT SELECT * FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '3713663' AND t_kc21.IN_HOSP_DATE BETWEEN '2008-07-24' AND '2015-01-04' AND t_kc21.IN_DIAG_DIS_CD = t_kc21.OUT_DIAG_DIS_CD | css |
CREATE TABLE table_name_28 (
opponent VARCHAR,
week VARCHAR
) | What is the Opponent on Week 11? | SELECT opponent FROM table_name_28 WHERE week = 11 | sql_create_context |
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 is the number of patients whose insurance is government and procedure short title is abdominal wall incision? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.short_title = "Abdominal wall incision" | mimicsql_data |
CREATE TABLE table_203_836 (
id number,
"title" text,
"year" number,
"platforms" text,
"developer" text,
"publisher" text,
"notes" text
) | what platform was used for the last title on this chart ? | SELECT "platforms" FROM table_203_836 ORDER BY id DESC LIMIT 1 | squall |
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 ... | 韩霞飞患者以前都有过哪些异常情况吗? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM... | css |
CREATE TABLE table_name_22 (
year_joined INTEGER,
year_left INTEGER
) | Of all the schools that left before 2003, what is the average year joined? | SELECT AVG(year_joined) FROM table_name_22 WHERE year_left < 2003 | sql_create_context |
CREATE TABLE catalog_contents (
catalog_entry_name VARCHAR,
price_in_dollars VARCHAR
) | What is the entry name of the most expensive catalog (in USD)? | SELECT catalog_entry_name FROM catalog_contents ORDER BY price_in_dollars DESC LIMIT 1 | sql_create_context |
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTas... | Math posts with votes before they were created. | SELECT pv.age AS "post_age", pv.VoteId AS "vote_id", pv.VoteTypeId AS "vote_type", pv.UserId AS "vote_user", pv.UserId AS "user_link", pv.Id AS "post_link" FROM (SELECT DATEDIFF(day, CAST(p.CreationDate AS DATE), CreationDate) AS age, p.Id, v.Id AS VoteId, v.VoteTypeId, v.UserId FROM Posts AS p LEFT JOIN Votes AS v ON ... | sede |
CREATE TABLE table_55808 (
"Name" text,
"Country" text,
"Status" text,
"Moving to" text,
"Transfer window" text,
"Transfer fee" text
) | Name the transfer fee for damia | SELECT "Transfer fee" FROM table_55808 WHERE "Name" = 'damia' | wikisql |
CREATE TABLE table_name_69 (
date VARCHAR,
surface VARCHAR,
partner VARCHAR
) | What day did he play on hard with tom mercer? | SELECT date FROM table_name_69 WHERE surface = "hard" AND partner = "tom mercer" | sql_create_context |
CREATE TABLE classroom (
building text,
room_number text,
capacity number
)
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE takes (
id text,
course_id text,
sec_id text,
semester text,
year number,
grade text
)
CREATE... | What is the name of the department with an instructure who has a name like 'Soisalon'? | SELECT dept_name FROM instructor WHERE name LIKE '%Soisalon%' | spider |
CREATE TABLE table_8189 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What score did Seve Ballesteros have when he was in T3 place? | SELECT "Score" FROM table_8189 WHERE "Place" = 't3' AND "Player" = 'seve ballesteros' | wikisql |
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, visualize a bar chart about the distribution of name and code , and group by attribute name, and order in descending by the Y. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_22825679_1 (
road_record VARCHAR,
team VARCHAR
) | Name the number of road record for team ole miss | SELECT COUNT(road_record) FROM table_22825679_1 WHERE team = "Ole Miss" | 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,... | 病号是99867232409的人在医疗就诊期自费了多少金额? | SELECT PER_EXP FROM t_kc24 WHERE MED_CLINIC_ID = '99867232409' | css |
CREATE TABLE INVOICES (
Order_Quantity INTEGER
) | Show the minimum, average, maximum order quantity of all invoices. | SELECT MIN(Order_Quantity), AVG(Order_Quantity), MAX(Order_Quantity) FROM INVOICES | sql_create_context |
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type ... | Visualize a bar chart, count and group by nationality from the journalist table, show x-axis in ascending order. | SELECT Nationality, COUNT(Nationality) FROM journalist GROUP BY Nationality ORDER BY Nationality | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what is the daily maximum amount of foley cath in patient 021-111547 in 12/this year? | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547')) AND intakeoutput.celllabel = 'fole... | eicu |
CREATE TABLE table_35455 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What's greatest attendance on May 7? | SELECT MAX("Attendance") FROM table_35455 WHERE "Date" = 'may 7' | wikisql |
CREATE TABLE table_61117 (
"Central Murray" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | How many wins when there are 4 losses and against are fewer than 1281? | SELECT AVG("Wins") FROM table_61117 WHERE "Losses" = '4' AND "Against" < '1281' | wikisql |
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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varc... | You can return a bar chart with employees' first names and their salaries, display by the Y in ascending. | SELECT FIRST_NAME, SALARY FROM employees ORDER BY SALARY | nvbench |
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 prescription... | give me the number of patients whose drug code is levo750 and lab test category is chemistry? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "LEVO750" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH ... | 编码为4854343的医院在门诊就诊中开出少于30张检验报告单从04年9月23日到06年11月24日内的科室是多少个? | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '4854343' AND jybgb.BGRQ BETWEEN '2004-09-23' AND '2006-11-24' GROUP BY jybgb.KSBM HAVING COUNT(*) < 30) AS T | css |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 编号是89718939232的医疗就诊用的是哪个门诊号或住院号 | SELECT t_kc21.CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '89718939232' | css |
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 female patients are aged below 36 years? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.age < "36" | mimicsql_data |
CREATE TABLE election (
Election_ID int,
Counties_Represented text,
District int,
Delegate text,
Party int,
First_Elected real,
Committee text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE party (
Party_ID int,
... | A bar chart for finding the number of the parties associated with the delegates from district 1. Who served as governors of the parties? | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor | nvbench |
CREATE TABLE table_2806 (
"Season" text,
"Mittelfranken Nord" text,
"Mittelfranken S\u00fcd" text,
"Unterfranken West" text,
"Unterfranken Ost" text,
"Oberfranken West" text,
"Oberfranken Ost" text
) | When atsv erlangen is the mittelfranken nord and alemannia haibach is the unterfranken west what is the mittelfranken s d? | SELECT "Mittelfranken S\u00fcd" FROM table_2806 WHERE "Unterfranken West" = 'Alemannia Haibach' AND "Mittelfranken Nord" = 'ATSV Erlangen' | wikisql |
CREATE TABLE table_name_30 (
player VARCHAR,
transfer_fee VARCHAR,
pos VARCHAR
) | Who had a transfer fee of released and played the position of DF? | SELECT player FROM table_name_30 WHERE transfer_fee = "released" AND pos = "df" | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | find the number of patients who are male and their admission location is clinic referral/premature. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admission_location = "CLINIC REFERRAL/PREMATURE" | mimicsql_data |
CREATE TABLE table_37456 (
"Team" text,
"Car(s)" text,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Crew Chief" text
) | Who is the crew chief of team Joe Gibbs Racing, which has a Chevrolet Monte Carlo and Fedex as the primary sponsor? | SELECT "Crew Chief" FROM table_37456 WHERE "Car(s)" = 'chevrolet monte carlo' AND "Team" = 'joe gibbs racing' AND "Primary Sponsor(s)" = 'fedex' | wikisql |
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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,... | is captopril prescribed since 2103 to patient 2518? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2518) AND prescriptions.drug = 'captopril' AND STRFTIME('%y', prescriptions.startdate) >= '2103' | mimic_iii |
CREATE TABLE table_45722 (
"Japanese" text,
"R\u014dmaji" text,
"Meaning" text,
"Chinese" text,
"Romanization" text,
"Source language" text
) | What language did the word mahjong originate from? | SELECT "Source language" FROM table_45722 WHERE "Meaning" = 'mahjong' | wikisql |
CREATE TABLE table_name_63 (
icao VARCHAR,
callsign VARCHAR
) | What is the ICAO for Air Busan? | SELECT icao FROM table_name_63 WHERE callsign = "air busan" | sql_create_context |
CREATE TABLE table_166346_1 (
joined_opec VARCHAR,
production___bbl__day_ VARCHAR
) | When did the country that produced 1,213,000 (21st) bbl/day join Opec? | SELECT joined_opec FROM table_166346_1 WHERE production___bbl__day_ = "1,213,000 (21st)" | sql_create_context |
CREATE TABLE table_27145 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | Who were the opponents that had an attendance of exactly 16115? | SELECT "Opponent" FROM table_27145 WHERE "Attendance" = '16115' | wikisql |
CREATE TABLE table_60425 (
"map#" real,
"County" text,
"Capital" text,
"Population (2008)" real,
"Area" text,
"Created" real
) | What is the population (2008) when the capital was Sanniquellie, created later than 1964? | SELECT SUM("Population (2008)") FROM table_60425 WHERE "Capital" = 'sanniquellie' AND "Created" > '1964' | wikisql |
CREATE TABLE table_name_18 (
bronze INTEGER,
silver VARCHAR,
total VARCHAR
) | What is the average value of Bronze when silver is 0 and the total is less than 1? | SELECT AVG(bronze) FROM table_name_18 WHERE silver = 0 AND total < 1 | sql_create_context |
CREATE TABLE table_58813 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What was the score when the Tie no was 9? | SELECT "Score" FROM table_58813 WHERE "Tie no" = '9' | wikisql |
CREATE TABLE table_13451 (
"Position" text,
"Gymnast" text,
"A Score" real,
"B Score" real,
"Total" real
) | what is the sum of the b score when the a score is 6.6 and the total is 15.6? | SELECT SUM("B Score") FROM table_13451 WHERE "A Score" = '6.6' AND "Total" = '15.6' | wikisql |
CREATE TABLE table_17924 (
"Position" real,
"Club" text,
"Played" real,
"Won" real,
"Drawn" real,
"Lost" real,
"Pts For" real,
"Pts Agst" real,
"B.P." real,
"Points" real
) | How many teams drew the widnes vikings? | SELECT COUNT("Drawn") FROM table_17924 WHERE "Club" = 'Widnes Vikings' | wikisql |
CREATE TABLE table_name_7 (
genre VARCHAR,
artist VARCHAR
) | What is the Genre when the Artist is Prince? | SELECT genre FROM table_name_7 WHERE artist = "prince" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_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,
... | 在医院5349528所有的就诊记载里根据不一样的科室名字和入院诊断的疾病名字列一下病人平均有多少岁 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5349528' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_NM | css |
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 patients aged below 24 had a hospital stay of more than 15 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "24" AND demographic.days_stay > "15" | mimicsql_data |
CREATE TABLE table_204_349 (
id number,
"year" number,
"conservative\ncouncillors" number,
"labour\ncouncillors" number,
"independent\ncouncillors" number,
"liberal\ncouncillors" number
) | the only year with 10 conservative councillors was when ? | SELECT "year" FROM table_204_349 WHERE "conservative\ncouncillors" = 10 | squall |
CREATE TABLE table_203_857 (
id number,
"denomination" text,
"1870" text,
"1880" text,
"1890" text,
"1900" text,
"1910" text,
"1920" text,
"1930" text,
"1941" text,
"1949" text,
"2001" text,
"2011" text
) | which denomination has the highest margin ? | SELECT "denomination" FROM table_203_857 ORDER BY "1870" DESC LIMIT 1 | squall |
CREATE TABLE table_name_96 (
record VARCHAR,
points VARCHAR,
score VARCHAR
) | Which Record has Points larger than 0, and a Score of 7 3? | SELECT record FROM table_name_96 WHERE points > 0 AND score = "7–3" | sql_create_context |
CREATE TABLE mzb (
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... | 从2001年10月10日到2004年10月16日期间,列出患者范曼蔓看病时给开出的所有药品的编码、名称、数量、单价、金额 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_NM = '范曼蔓' AND qtb.IN_HOSP_DATE BETWEEN '2001-10-10' AND '2004-10-16' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.Q... | css |
CREATE TABLE table_204_813 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | what is the total number of times mckoy placed in the top 3 ? | SELECT COUNT(*) FROM table_204_813 WHERE "position" <= 3 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | Count the number of patients whose admission locations is clinic referral/premature and admission year is before 2112. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.admityear < "2112" | mimicsql_data |
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... | 患者水光耀在0五年一月九日到一三年八月二日期间,总共到医院看过多少次病 | SELECT (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 '2005-01-09' AND '2013-08-02') + (SELECT COUNT(*) FROM person_info J... | css |
CREATE TABLE table_70883 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which Chassis has 0 points? | SELECT "Chassis" FROM table_70883 WHERE "Points" = '0' | 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 drug code of subject id 3343. | SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.subject_id = "3343" | mimicsql_data |
CREATE TABLE table_204_583 (
id number,
"capacitor type" text,
"capacity" text,
"volts" text,
"temp." text,
"energy-to-weight ratio" text,
"power-to-weight ratio" text
) | what is the difference in volts between the eestor eesu barium titanate supercapacitor and the act premlis lithium ion capacitor ? | SELECT ABS((SELECT "volts" FROM table_204_583 WHERE "capacitor type" = 'eestor eesu barium titanate supercapacitor') - (SELECT "volts" FROM table_204_583 WHERE "capacitor type" = 'act premlis lithium ion capacitor')) | squall |
CREATE TABLE table_name_48 (
goals VARCHAR,
years_at_club VARCHAR,
games VARCHAR,
debut_year VARCHAR
) | How many Goals have Games smaller than 6, and a Debut year of 1939, and Years at club of 1939, 1941? | SELECT COUNT(goals) FROM table_name_48 WHERE games < 6 AND debut_year = 1939 AND years_at_club = "1939, 1941" | sql_create_context |
CREATE TABLE table_name_94 (
player VARCHAR,
round VARCHAR,
college_junior_club_team VARCHAR
) | Who is the player from a round larger than 5 and the college/junior/club team of Leningrad SKA (russia)? | SELECT player FROM table_name_94 WHERE round > 5 AND college_junior_club_team = "leningrad ska (russia)" | sql_create_context |
CREATE TABLE table_name_71 (
cpu_chip VARCHAR,
type VARCHAR
) | Which CPU chip(s) is used in the Classic type hardware? | SELECT cpu_chip FROM table_name_71 WHERE type = "classic" | sql_create_context |
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... | 在医疗就诊62657094030中给病人范忆秋开出的各药品的名称及其每次用量和使用频次都分别是什么? | SELECT SOC_SRT_DIRE_NM, EACH_DOSAGE, USE_FRE FROM t_kc22 WHERE MED_CLINIC_ID = '62657094030' | css |
CREATE TABLE table_60068 (
"Club" text,
"Head Coach" text,
"City" text,
"Stadium" text,
"2003\u20132004 season" text
) | Who is the head coach for the club from Aveiro? | SELECT "Head Coach" FROM table_60068 WHERE "City" = 'aveiro' | wikisql |
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team int,
Draft_Pick_Number int,
Draft_Class text,
College text
)
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
... | How many players played each position Plot them as bar chart, and could you display y axis from high to low order? | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_74488 (
"Player" text,
"W-L (Total)" text,
"W-L (Singles)" text,
"W-L (Doubles)" text,
"Ties" real,
"Debut" real,
"Years Played" real
) | Tell me the WL doubles with a debut of 1999 | SELECT "W-L (Doubles)" FROM table_74488 WHERE "Debut" = '1999' | wikisql |
CREATE TABLE table_196 (
"Round" real,
"Grand Prix" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Constructor" text,
"Report" text
) | Which round was the winning constructor was Benetton - Ford and in the Pole Position was Damon Hill? | SELECT "Round" FROM table_196 WHERE "Winning Constructor" = 'Benetton - Ford' AND "Pole Position" = 'Damon Hill' | wikisql |
CREATE TABLE table_42412 (
"City of license" text,
"Identifier" text,
"Frequency" text,
"Power" text,
"Class" text,
"RECNet" text
) | What is Power, when City of License is Sioux Lookout? | SELECT "Power" FROM table_42412 WHERE "City of license" = 'sioux lookout' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | A bar chart shows the distribution of Team_Name and Team_ID , and order from low to high by the Y please. | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_ID | nvbench |
CREATE TABLE table_name_71 (
year VARCHAR,
venue VARCHAR,
opponent VARCHAR
) | What year was the venue at Sydney Cricket Ground, and the opponent was Parramatta Eels? | SELECT COUNT(year) FROM table_name_71 WHERE venue = "sydney cricket ground" AND opponent = "parramatta eels" | sql_create_context |
CREATE TABLE table_43409 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Serbian title" text,
"Director" text,
"Result" text
) | In what Year was Labyrinth nominated? | SELECT "Year (Ceremony)" FROM table_43409 WHERE "Film title used in nomination" = 'labyrinth' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 之前,患者彭璇玑的异常情况有什么? | (SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD... | css |
CREATE TABLE table_47037 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What was the record when the game was at the Rose Garden? | SELECT "Record" FROM table_47037 WHERE "Location" = 'rose garden' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.