context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 从2007年11月6日开始,截止到2012年5月8日,请把47198797的这位病人总共被开出的检验报告单的审核日期时间给列出来 | SELECT jybgb.SHSJ FROM hz_info JOIN mzjzjlb JOIN jybgb ON 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 WHERE hz_info.RYBH = '47198797' AND jybgb.BGRQ BETWEEN '2007-11-06' AND '2012-05-08' UNION... | css |
CREATE TABLE table_67332 (
"Rank" text,
"Country" text,
"2009" text,
"2010" text,
"2011" text
) | what is the production in 2010 with rank of 8? | SELECT "2010" FROM table_67332 WHERE "Rank" = '8' | wikisql |
CREATE TABLE table_22612 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | Who had the most assist and how many on July 26? | SELECT "High assists" FROM table_22612 WHERE "Date" = 'July 26' | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the admission location and diagnosis icd9 code for patient id 2560? | SELECT demographic.admission_location, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_name_34 (
e_greenberg VARCHAR,
t_wyka VARCHAR
) | Which E. Greenberg has a T. Wyka of 10,793 (70%)? | SELECT e_greenberg FROM table_name_34 WHERE t_wyka = "10,793 (70%)" | sql_create_context |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
... | when was patient 006-97726 first prescribed with ondansetron and lorazepam 0.5 mg po tabs at the same time in 02/2104? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'ondansetron' AND patient.uniquepid = '006-97726' AND STRFTIME('%y-%m', medication.drugstarttime) = '2104-02') AS t1 JOIN ... | eicu |
CREATE TABLE table_name_76 (
yellow INTEGER,
category VARCHAR,
amerindian VARCHAR
) | What is the sum of Yellow, when Category is Bugre (Indian), and when Amerindian is less than 50,00? | SELECT SUM(yellow) FROM table_name_76 WHERE category = "bugre (indian)" AND amerindian < 50 OFFSET 00 | sql_create_context |
CREATE TABLE table_7106 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the highest top-25 of the tournament with less than 22 events and more than 1 top-10? | SELECT MAX("Top-25") FROM table_7106 WHERE "Events" < '22' AND "Top-10" > '1' | wikisql |
CREATE TABLE table_21132404_1 (
political_parties VARCHAR,
_percentage_2006 VARCHAR
) | How many political parties had a %2006 rating of 43.5? | SELECT COUNT(political_parties) FROM table_21132404_1 WHERE _percentage_2006 = "43.5" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | what did patient 87733 first have as an output until 947 days ago? | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 87733)) AND DATETIME(outputevents.charttim... | mimic_iii |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE cost (
r... | what were the three most frequent diagnoses for the patients of 40s since 6 years ago? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE table_64247 (
"Year" real,
"Title" text,
"Director" text,
"Studio(s)" text,
"Notes" text
) | What studio had the director Peter Lord Nick Park before 2004? | SELECT "Studio(s)" FROM table_64247 WHERE "Year" < '2004' AND "Director" = 'peter lord nick park' | wikisql |
CREATE TABLE table_72137 (
"No. in season" real,
"No. in series" real,
"Title" text,
"Canadian airdate" text,
"US airdate" text,
"Production code" real
) | The canadian airdate of 11 february 2008 applied to what series number? | SELECT COUNT("No. in series") FROM table_72137 WHERE "Canadian airdate" = '11 February 2008' | wikisql |
CREATE TABLE table_26137666_3 (
pole_position VARCHAR,
circuit VARCHAR,
winning_driver VARCHAR
) | What is every pole position for the Castle Combe circuit and Robbie Kerr is the winning driver? | SELECT pole_position FROM table_26137666_3 WHERE circuit = "Castle Combe" AND winning_driver = "Robbie Kerr" | sql_create_context |
CREATE TABLE table_23295 (
"#" real,
"Player" text,
"Age" real,
"Australian Open" real,
"French Open" real,
"Wimbledon" real,
"US Open" real
) | How many players are on this list? | SELECT MAX("#") FROM table_23295 | 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... | 患者患有疾病Y80.928,他被开出的药品的编号和名称分别是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.t_kc21_IN_DIAG_DIS_CD = 'Y80.928' | css |
CREATE TABLE table_13759 (
"Debut year" real,
"Player" text,
"Games" real,
"Goals" real,
"Years at club" text
) | What is the highest debut year for player Joe Youlden, with goals larger than 0? | SELECT MAX("Debut year") FROM table_13759 WHERE "Player" = 'joe youlden' AND "Goals" > '0' | wikisql |
CREATE TABLE Attribute_Definitions (
attribute_id INTEGER,
attribute_name VARCHAR(30),
attribute_data_type VARCHAR(10)
)
CREATE TABLE Catalogs (
catalog_id INTEGER,
catalog_name VARCHAR(50),
catalog_publisher VARCHAR(80),
date_of_publication DATETIME,
date_of_latest_revision DATETIME
)
... | What are the name and level of catalog structure with level number between 5 and 1 Show bar chart, and list names in desc order please. | SELECT catalog_level_name, catalog_level_number FROM Catalog_Structure WHERE catalog_level_number BETWEEN 5 AND 10 ORDER BY catalog_level_name DESC | nvbench |
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 patients were diagnosed with mouth and pharyngeal cancer and their lab test status was delta? | 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 = "Carcinoma in situ of lip, oral cavity, and pharynx" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | how many patients have procedure icd9 code 4562? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.icd9_code = "4562" | mimicsql_data |
CREATE TABLE table_66076 (
"Period" text,
"Internet Explorer" text,
"Firefox" text,
"Chrome" text,
"Safari" text,
"Opera" text,
"Other Mozilla" text,
"Mobile" text
) | What percentage of users were using other Mozilla browsers during the period in which 9.00% were using Chrome? | SELECT "Other Mozilla" FROM table_66076 WHERE "Chrome" = '9.00%' | wikisql |
CREATE TABLE table_name_54 (
date_aired VARCHAR,
title VARCHAR
) | What was the date of the show titled Beat the Star? | SELECT date_aired FROM table_name_54 WHERE title = "beat the star" | sql_create_context |
CREATE TABLE table_49160 (
"Skip" text,
"Third/Vice skip" text,
"Second" text,
"Lead" text,
"City" text
) | Which Lead has a Skip of ted appelman? | SELECT "Lead" FROM table_49160 WHERE "Skip" = 'ted appelman' | wikisql |
CREATE TABLE table_name_51 (
airport VARCHAR,
iata VARCHAR
) | What is the Airport with an IATA of TRZ? | SELECT airport FROM table_name_51 WHERE iata = "trz" | sql_create_context |
CREATE TABLE table_41697 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | Which Wins has a Top-5 of 6? | SELECT AVG("Wins") FROM table_41697 WHERE "Top-5" = '6' | wikisql |
CREATE TABLE table_203_105 (
id number,
"name" text,
"street address" text,
"years as tallest" text,
"height\nft (m)" text,
"floors" number
) | what was the first building named as the tallest ? | SELECT "name" FROM table_203_105 ORDER BY id LIMIT 1 | 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,
... | 请问编号54118858的患者,有哪些检验报告单对应的检验结果指标全部是正常的?能把检验报告单号列出来吗? | SELECT zyjybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN zyjybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '54118858' AND NOT zyjybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM ... | css |
CREATE TABLE table_67889 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Try BP" text,
"Losing BP" text
) | What is the number drawn when 3 have been lost? | SELECT "Drawn" FROM table_67889 WHERE "Lost" = '3' | wikisql |
CREATE TABLE table_name_17 (
quantity_preserved VARCHAR,
class VARCHAR
) | What is the quantity preserved of the e-1 class? | SELECT quantity_preserved FROM table_name_17 WHERE class = "e-1" | sql_create_context |
CREATE TABLE table_75318 (
"Date" text,
"Type" text,
"Record description" text,
"Achievement" text,
"Pilot" text
) | Pilot of g.v. alfyorov, and a Record description of altitude with kg (lb) payload, and a Type of mi-10 involved what date? | SELECT "Date" FROM table_75318 WHERE "Pilot" = 'g.v. alfyorov' AND "Record description" = 'altitude with kg (lb) payload' AND "Type" = 'mi-10' | wikisql |
CREATE TABLE customer_orders (
order_id number,
customer_id number,
store_id number,
order_date time,
planned_delivery_date time,
actual_delivery_date time,
other_order_details text
)
CREATE TABLE ref_service_types (
service_type_code text,
parent_service_type_code text,
service... | Find the phone number of performer 'Ashley'. | SELECT customer_phone FROM performers WHERE customer_name = "Ashley" | spider |
CREATE TABLE table_15027 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Name the year for anton kriel chris cotillard | SELECT "Year" FROM table_15027 WHERE "Men's doubles" = 'anton kriel chris cotillard' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | Delete me - trial query. | SELECT CreationDate FROM Comments WHERE UserId = '##UserId##' | sede |
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE song (
song_name varchar2(50),
artist... | Bar graph to show the total number from different formats | SELECT formats, COUNT(*) FROM files GROUP BY formats | nvbench |
CREATE TABLE table_7583 (
"1900s" real,
"1920s" real,
"1930s" real,
"1940s" real,
"1950s" real,
"1960s" real,
"1970s" real,
"1980s" real,
"1990s" real,
"2000s to date" real,
"Total to date" real
) | What is the sum for the 2000s to date that has 0 in the 1920s? | SELECT SUM("2000s to date") FROM table_7583 WHERE "1920s" < '0' | wikisql |
CREATE TABLE review (
a_id integer,
u_id integer,
i_id integer,
rating integer,
rank integer
)
CREATE TABLE useracct (
u_id integer,
name varchar(128)
)
CREATE TABLE trust (
source_u_id integer,
target_u_id integer,
trust integer
)
CREATE TABLE item (
i_id integer,
tit... | For each user, return the name and the average rating of reviews given by them Plot them as bar chart, could you display y-axis in ascending order? | SELECT name, AVG(T2.rating) FROM useracct AS T1 JOIN review AS T2 ON T1.u_id = T2.u_id GROUP BY T2.u_id ORDER BY AVG(T2.rating) | nvbench |
CREATE TABLE table_name_14 (
year INTEGER,
chinese_title VARCHAR
) | I want the average year of | SELECT AVG(year) FROM table_name_14 WHERE chinese_title = "敗犬女王" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 从2011年4年6日到2019年11月23日,7835150这个医疗机构在转诊门诊的就诊记录有多少 | SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.YLJGDM = '7835150' AND fzzmzjzjlb.JZKSRQ BETWEEN '2011-04-06' AND '2019-11-23' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
... | provide the number of patients whose diagnoses icd9 code is 78321 and lab test abnormal status is abnormal? | 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.icd9_code = "78321" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_name_17 (
attendance VARCHAR,
record VARCHAR
) | What was total attendance on the day they went 17-7? | SELECT COUNT(attendance) FROM table_name_17 WHERE record = "17-7" | sql_create_context |
CREATE TABLE table_76287 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | who had the high assists when the game was less than 13 and the score was w 75-66? | SELECT "High assists" FROM table_76287 WHERE "Game" < '13' AND "Score" = 'w 75-66' | wikisql |
CREATE TABLE table_train_183 (
"id" int,
"anemia" bool,
"hiv_infection" bool,
"hemoglobin_a1c_hba1c" float,
"creatinine_clearance_cl" float,
"panel_reactive_antibodies" int,
"NOUSE" float
) | creatinine clearance < 60 ml / min | SELECT * FROM table_train_183 WHERE creatinine_clearance_cl < 60 | criteria2sql |
CREATE TABLE table_29310 (
"Team" text,
"Home Gms" real,
"Home Total" real,
"Home Avg" real,
"Top Home Crowd" text,
"Road Gms" real,
"Road Total" real,
"Road Avg" real,
"Overall Gms" real,
"Overall Total" real,
"Overall Avg" real
) | What was the highest home total? | SELECT MAX("Home Total") FROM table_29310 | wikisql |
CREATE TABLE table_204_13 (
id number,
"finished" text,
"post" number,
"horse" text,
"jockey" text,
"trainer" text,
"owner" text,
"time / behind" text
) | what is the number of post for 3rd finished | SELECT "post" FROM table_204_13 WHERE "finished" = 3 | squall |
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... | let me know the number of newborn patients who have prescription of base type medication. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "NEWBORN" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
... | Give me the comparison about ID over the meter_500 . | SELECT meter_500, ID FROM swimmer | nvbench |
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 ... | 就诊病人28664417730在住院期间的病员卡号以及卡类型分别是什么? | SELECT zyjzjlb.KH, zyjzjlb.KLX FROM zyjzjlb WHERE zyjzjlb.JZLSH = '28664417730' | css |
CREATE TABLE table_48729 (
"Total Points" real,
"Score" text,
"Premiers" text,
"Runners Up" text,
"Details" text
) | What was the score where the total points was 50? | SELECT "Score" FROM table_48729 WHERE "Total Points" = '50' | wikisql |
CREATE TABLE table_30445 (
"Episode" text,
"Date Aired" text,
"Timeslot" text,
"Rating" text,
"Nightly Rank" real,
"Weekly Rank" text
) | When did the episode 1.13 air for the first time? | SELECT "Date Aired" FROM table_30445 WHERE "Episode" = '1.13' | wikisql |
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,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | what is the number of urgent hospital admission patients who have albuterol 0.083% neb soln prescription? | 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.drug = "Albuterol 0.083% Neb Soln" | mimicsql_data |
CREATE TABLE music_festival (
Date_of_ceremony VARCHAR,
RESULT VARCHAR
) | Return the dates of ceremony and the results of all music festivals | SELECT Date_of_ceremony, RESULT FROM music_festival | sql_create_context |
CREATE TABLE table_18746 (
"Frequency" text,
"Call sign" text,
"Name" text,
"Format" text,
"Owner" text,
"Target city/ market" text,
"City of license" text
) | What market is Wessington Springs in | SELECT "Target city/ market" FROM table_18746 WHERE "City of license" = 'Wessington Springs' | wikisql |
CREATE TABLE table_name_75 (
week INTEGER,
attendance INTEGER
) | What is the average week number of all the matches where less than 22,604 people attended? | SELECT AVG(week) FROM table_name_75 WHERE attendance < 22 OFFSET 604 | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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... | 28140515这个病人的检验报告单结果指标均异常的有哪些?看看检验报告的单号 | SELECT jyjgzbb.BGDH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '28140515' AND NOT jyjgzbb.BGDH IN (SELECT jyjgzb... | css |
CREATE TABLE station (
id number,
network_name text,
services text,
local_authority text
)
CREATE TABLE weekly_weather (
station_id number,
day_of_week text,
high_temperature number,
low_temperature number,
precipitation number,
wind_speed_mph number
)
CREATE TABLE train (
... | Find names and times of trains that run through stations for the local authority Chiltern. | SELECT t3.name, t3.time FROM station AS t1 JOIN route AS t2 ON t1.id = t2.station_id JOIN train AS t3 ON t2.train_id = t3.id WHERE t1.local_authority = "Chiltern" | spider |
CREATE TABLE table_name_18 (
horizontal_bar VARCHAR,
parallel_bars VARCHAR,
pommel_horse VARCHAR,
position VARCHAR
) | What is the horizontal bar score with a pommel horse of n/a, and the position is less than 27, and the parallel bars score is 15.800? | SELECT horizontal_bar FROM table_name_18 WHERE pommel_horse = "n/a" AND position < 27 AND parallel_bars = "15.800" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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... | 前往9414834医院就诊的患者03371547入院科室的名字没有造口的住院就诊记录都有啥? | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '03371547' AND hz_info.YLJGDM = '9414834' AND NOT zyjzjlb.JZKSMC LIKE '%造口%' | css |
CREATE TABLE table_name_41 (
earnings__ INTEGER,
player VARCHAR
) | How much has dave stockton earned? | SELECT MAX(earnings__) AS $__ FROM table_name_41 WHERE player = "dave stockton" | sql_create_context |
CREATE TABLE table_20114 (
"Pos." real,
"Driver" text,
"Qualifying" real,
"Race 1" text,
"Race 2" text,
"Race 3" text,
"Points" real
) | Name the total number of qualifiying for race 3 being 3 | SELECT COUNT("Qualifying") FROM table_20114 WHERE "Race 3" = '3' | wikisql |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Stack bar chart of school_id vs All_Home based on acc road, and show in asc by the bar. | SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY ACC_Road | nvbench |
CREATE TABLE table_49579 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What date was the opponent in the final Barbara Paulus? | SELECT "Date" FROM table_49579 WHERE "Opponent in the final" = 'barbara paulus' | wikisql |
CREATE TABLE table_name_30 (
country VARCHAR,
points INTEGER
) | What is Country, when Points are more than 12? | SELECT country FROM table_name_30 WHERE points > 12 | sql_create_context |
CREATE TABLE table_name_21 (
general_classification VARCHAR,
stage VARCHAR,
points_classification VARCHAR,
young_rider_classification VARCHAR
) | What is the general classification of the stage 3 with Daniele Bennati as the points classification and Morris Possoni as the young rider classification. | SELECT general_classification FROM table_name_21 WHERE points_classification = "daniele bennati" AND young_rider_classification = "morris possoni" AND stage = "3" | sql_create_context |
CREATE TABLE table_52036 (
"Country" text,
"OF-5" text,
"OF-4" text,
"OF-2" text,
"OF-1" text
) | What country has OF-1 Locotenent? | SELECT "Country" FROM table_52036 WHERE "OF-1" = 'locotenent' | 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... | Compute the total minimal baseprice across decor as a pie chart. | SELECT decor, MIN(basePrice) FROM Rooms GROUP BY decor | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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,
... | count the number of patients with drug code nado20 whose lab testfluid is pleural. | 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 = "NADO20" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_25584 (
"Rank" real,
"Metropolitan area" text,
"Principal city" text,
"10,000+ places" real,
"Densest incorporated place" text,
"Density" text
) | Name the number of rank for stone park | SELECT COUNT("Rank") FROM table_25584 WHERE "Densest incorporated place" = 'Stone Park' | wikisql |
CREATE TABLE table_26669939_1 (
year VARCHAR,
host_country VARCHAR
) | In what year was Montenegro the host country? | SELECT year FROM table_26669939_1 WHERE host_country = "Montenegro" | sql_create_context |
CREATE TABLE table_1507852_5 (
bubbles VARCHAR,
attribute VARCHAR
) | what's the bubbles with attribute being onpopuphidden | SELECT bubbles FROM table_1507852_5 WHERE attribute = "onpopuphidden" | 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,
... | How many white ethnic background patients have left internal jugular vein thrombosis left arm edema as their primary disease? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.diagnosis = "LEFT INTERNAL JUGULAR VEIN THROMBOSIS;LEFT ARM EDEMA" | mimicsql_data |
CREATE TABLE table_train_260 (
"id" int,
"leukocyte_deficiencies" bool,
"bleeding" int,
"hemoglobin_a1c_hba1c" float,
"leukocyte_dysfunction" bool,
"renal_disease" bool,
"hba1c" float,
"serum_creatinine" float,
"NOUSE" float
) | glycated hemoglobin a1c ( hba1c ) levels of at least 8 % up to and including 12 % as reported within 4 weeks of implant placement | SELECT * FROM table_train_260 WHERE hba1c >= 8 AND hemoglobin_a1c_hba1c <= 12 | criteria2sql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For those employees who was hired before 2002-06-21, a bar chart shows the distribution of hire_date and the sum of salary bin hire_date by time, order by the Y-axis from high to low. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_79684 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"Class" text,
"FCC info" text
) | What is the total erp w of class c3, which has a frequency mhz less than 89.9? | SELECT COUNT("ERP W") FROM table_79684 WHERE "Class" = 'c3' AND "Frequency MHz" < '89.9' | wikisql |
CREATE TABLE table_204_14 (
id number,
"rank" number,
"bib" number,
"athlete" text,
"country" text,
"time" text,
"deficit" text,
"note" text
) | how long did nicole fessel take ? | SELECT "time" FROM table_204_14 WHERE "athlete" = 'nicole fessel' | squall |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
... | A bar chart for what are the number of the last names for all scholarship students?, I want to order by the X-axis in ascending. | SELECT LName, COUNT(LName) FROM SportsInfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T1.OnScholarship = 'Y' GROUP BY LName ORDER BY LName | nvbench |
CREATE TABLE table_70404 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | How many years did Barclay Nordica Arrows BMW enter with Cosworth v8 engine? | SELECT SUM("Year") FROM table_70404 WHERE "Entrant" = 'barclay nordica arrows bmw' AND "Engine" = 'cosworth v8' | wikisql |
CREATE TABLE table_31997 (
"Year" real,
"Competition" text,
"Date" text,
"Location" text,
"Score" text,
"Result" text
) | Tell me the result for harrogate | SELECT "Result" FROM table_31997 WHERE "Location" = 'harrogate' | wikisql |
CREATE TABLE table_17103566_1 (
man_of_the_match VARCHAR,
match_number VARCHAR
) | Who is man of the match for match number 5? | SELECT man_of_the_match FROM table_17103566_1 WHERE match_number = 5 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
... | what are the top four most frequently diagnosed diagnoses that the patients have received within 2 months after being diagnosed with stroke education given? | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'stroke education given') AS t1 JOIN (SEL... | eicu |
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE railway_manage ... | A pie chart for showing the number of the countries that have managers of age above 50 or below 46. | SELECT Country, COUNT(Country) FROM manager WHERE Age > 50 OR Age < 46 GROUP BY Country | nvbench |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | what is the five year survival rate of the pulmonary aspiration patients? | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t2.diagnosistime) > 5 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOI... | eicu |
CREATE TABLE table_name_27 (
rebounds VARCHAR,
name VARCHAR
) | Can you tell me the Rebounds that has the Name of pom baskets jena? | SELECT rebounds FROM table_name_27 WHERE name = "pom baskets jena" | sql_create_context |
CREATE TABLE table_name_52 (
transfer_window VARCHAR,
source VARCHAR,
moving_from VARCHAR
) | What is the transfer window of the Leeds United source with a move from Motherwell? | SELECT transfer_window FROM table_name_52 WHERE source = "leeds united" AND moving_from = "motherwell" | sql_create_context |
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
)
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
) | Give me a histogram for what are the naems of all the projects, and how many scientists were assigned to each of them?, I want to list names in desc order. | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project GROUP BY T1.Name ORDER BY Name DESC | nvbench |
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
) | What are the names of all the players who received a yes during tryouts, and also what are the names of their colleges? | SELECT T1.pname, T2.cname FROM player AS T1 JOIN tryout AS T2 ON T1.pid = T2.pid WHERE T2.decision = 'yes' | spider |
CREATE TABLE table_76823 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | WHAT IS THE HOME TEAM ON APRIL 25? | SELECT "Home Team" FROM table_76823 WHERE "Date" = 'april 25' | wikisql |
CREATE TABLE table_160510_5 (
country VARCHAR,
area VARCHAR
) | Name the country for 11,891 area | SELECT country FROM table_160510_5 WHERE area = "11,891" | sql_create_context |
CREATE TABLE table_57261 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the attendance for the North Melbourne's home game? | SELECT "Crowd" FROM table_57261 WHERE "Home team" = 'north melbourne' | 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... | what is minimum age of patients whose admission location is trsf within this facility and discharge location is disc-tran cancer/chldrn h? | SELECT MIN(demographic.age) FROM demographic WHERE demographic.admission_location = "TRSF WITHIN THIS FACILITY" AND demographic.discharge_location = "DISC-TRAN CANCER/CHLDRN H" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number... | until 2103, when did patient 028-56914 come for the last time to the hospital? | SELECT patient.hospitaladmittime FROM patient WHERE patient.uniquepid = '028-56914' AND STRFTIME('%y', patient.hospitaladmittime) <= '2103' ORDER BY patient.hospitaladmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_15 (
member_countries VARCHAR,
area__km²_ VARCHAR
) | Which country has an area of 871,980 square km? | SELECT member_countries FROM table_name_15 WHERE area__km²_ = "871,980" | sql_create_context |
CREATE TABLE table_40935 (
"Pilot" text,
"Original Airdate" text,
"Musical Guest/Song performed" text,
"YouTube Hero" text,
"MySpace Band" text
) | What is the name of the MySpace Band with an Original Airdate of 19 february 2008? | SELECT "MySpace Band" FROM table_40935 WHERE "Original Airdate" = '19 february 2008' | 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,... | 在病患73506592就诊期间医疗费总额使用了高于2109.01元的记录都是什么,在入院时诊断出的疾病号码与名称是多些? | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '73506592' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT > 2109.01) | css |
CREATE TABLE table_name_40 (
finals VARCHAR,
name VARCHAR
) | What finals have grant brebner as the name? | SELECT finals FROM table_name_40 WHERE name = "grant brebner" | 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,
... | 低于15岁的病人的医疗记录的医疗费总额是多少?统计平均值 | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_AGE < 15 UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_AGE < 15) | css |
CREATE TABLE table_204_443 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"game site" text,
"attendance" number,
"bye" text
) | team that scored more than 40 points against the jets that is not the miami dolphins | SELECT "opponent" FROM table_204_443 WHERE "result" > 40 AND "opponent" <> 'miami dolphins' | squall |
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 manufacturer , and group by attribute headquarter, and order Name in desc order please. | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE Teachers (
first_name VARCHAR,
email_address VARCHAR
) | Find the first names of teachers whose email address contains the word 'man'. | SELECT first_name FROM Teachers WHERE email_address LIKE '%man%' | sql_create_context |
CREATE TABLE endowment (
donator_name VARCHAR
) | Show all donor names. | SELECT DISTINCT donator_name FROM endowment | sql_create_context |
CREATE TABLE table_22082 (
"#" real,
"Date" text,
"Opponent" text,
"Score" text,
"Site/Stadium" text,
"Win" text,
"Loss" text,
"Save" text,
"Attendance" real,
"Overall Record" text,
"NCAAT Record" text
) | What is the June 21 ncaat baseball record for Fresno State Bulldogs? | SELECT "NCAAT Record" FROM table_22082 WHERE "Date" = 'June 21' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.