context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 ... | 需要住院就诊99979251802的入院途径代码和名称的详细信息 | SELECT wdmzjzjlb.RYTJDM, wdmzjzjlb.RYTJMC FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '99979251802' UNION SELECT bdmzjzjlb.RYTJDM, bdmzjzjlb.RYTJMC FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '99979251802' | css |
CREATE TABLE table_27185 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What is the number in the series that was titled 'Past Tense'? | SELECT "No. in series" FROM table_27185 WHERE "Title" = 'Past Tense' | wikisql |
CREATE TABLE table_name_96 (
nominee VARCHAR,
category VARCHAR
) | Who is the nominee for Best Lead Actress? | SELECT nominee FROM table_name_96 WHERE category = "best lead actress" | sql_create_context |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCH... | How many students are older than average for each gender, display from low to high by the X. | SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_name_98 (
previous_champion_s_ VARCHAR,
date_won VARCHAR
) | Who was the previous champion of the title won on July 7, 2010? | SELECT previous_champion_s_ FROM table_name_98 WHERE date_won = "july 7, 2010" | sql_create_context |
CREATE TABLE table_24321 (
"Draw" real,
"Song" text,
"Artist" text,
"Panel Points" real,
"Televotes" real,
"Televote Points" real,
"Score" real,
"Placing" text
) | Name the score for rebeka dremelj | SELECT "Score" FROM table_24321 WHERE "Artist" = 'Rebeka Dremelj' | wikisql |
CREATE TABLE table_24548 (
"District" text,
"Headquarters" text,
"Area (km\u00b2)" real,
"Population (2011)" real,
"Division" text
) | If the headquarters is Bharatpur, what is the maximum area? | SELECT MAX("Area (km\u00b2)") FROM table_24548 WHERE "Headquarters" = 'Bharatpur' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | what are the four most frequently ordered microbiological tests until 2104 for patients that received kidney stone procedure - with removal of ureteral calculus previously within 2 months? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'kidney stone procedure - with removal of ure... | eicu |
CREATE TABLE table_28347 (
"Road race" text,
"Distance" text,
"Location" text,
"Country" text,
"Month held" text
) | How many times a year is the Brighton Marathon held? | SELECT COUNT("Month held") FROM table_28347 WHERE "Distance" = 'Marathon' AND "Location" = 'Brighton' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Short ID questions to review. | SELECT Score, LENGTH(Body) AS BodyLength, CreationDate, Id AS "post_link", p.Id, ViewCount, LastEditDate FROM Posts AS p WHERE Tags LIKE '%identify%' AND PostTypeId = 1 AND AcceptedAnswerId IS NULL AND ClosedDate IS NULL ORDER BY LENGTH(Body), CreationDate | sede |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
h... | has patient 14397 been admitted into the hospital this year? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 14397 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_49409 (
"Outcome" text,
"Date" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | Which Opponent in the final has a Score in the final of 6 2, 6 3, 2 6, 7 5? | SELECT "Opponent in the final" FROM table_49409 WHERE "Score in the final" = '6–2, 6–3, 2–6, 7–5' | wikisql |
CREATE TABLE city (
City_ID int,
City text,
Hanzi text,
Hanyu_Pinyin text,
Regional_Population int,
GDP real
)
CREATE TABLE hosting_city (
Year int,
Match_ID int,
Host_City text
)
CREATE TABLE match (
Match_ID int,
Date text,
Venue text,
Score text,
Result text,... | Find the number of matches in different competitions Visualize by bar chart, and rank in descending by the total number. | SELECT Competition, COUNT(*) FROM match GROUP BY Competition ORDER BY COUNT(*) DESC | nvbench |
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... | 编号99383862652的医疗就诊中,患者的病情描述有哪些症状 | SELECT gwyjzb.MAIN_COND_DES FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '99383862652' UNION SELECT fgwyjzb.MAIN_COND_DES FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '99383862652' | css |
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20),
customer_last_name VARCHAR(20),
customer_address VARCHAR(255),
customer_phone VARCHAR(255),
customer_email VARCHAR(255),
other_customer_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction... | What are the different card types, and how many cards are there of each. Show a pie chart. | SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code | nvbench |
CREATE TABLE table_name_27 (
college_junior_club_team__league_ VARCHAR,
position VARCHAR,
round VARCHAR,
nationality VARCHAR
) | what is the college/junior/club team (league) when the round is higher than 1, the nationality is canada and the position is (d)? | SELECT college_junior_club_team__league_ FROM table_name_27 WHERE round > 1 AND nationality = "canada" AND position = "(d)" | sql_create_context |
CREATE TABLE table_39077 (
"Denomination" text,
"Metal" text,
"Weight" text,
"Shape" text,
"Size" text
) | What is the weight with a denomination that is ten paise? | SELECT "Weight" FROM table_39077 WHERE "Denomination" = 'ten paise' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | how much do the reptilase time control actually cost? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'reptilase time control')) | mimic_iii |
CREATE TABLE table_19897294_5 (
original_air_date VARCHAR,
no_overall VARCHAR
) | Name the air date for uk17 | SELECT original_air_date FROM table_19897294_5 WHERE no_overall = "UK17" | sql_create_context |
CREATE TABLE table_25571 (
"R" real,
"Player" text,
"Position" text,
"League" real,
"Champions League" real,
"Copa del Rey" real,
"Total" real
) | What is the maximum possible Copa Del Rey? | SELECT MAX("Copa del Rey") FROM table_25571 | wikisql |
CREATE TABLE table_1211545_2 (
name VARCHAR,
heavy_vehicle__2_axles_ VARCHAR
) | What is the name of the plaza where the toll for heavy vehicles with 2 axles is r87.00? | SELECT name FROM table_1211545_2 WHERE heavy_vehicle__2_axles_ = "R87.00" | sql_create_context |
CREATE TABLE table_name_83 (
country VARCHAR,
date VARCHAR
) | Which country is dated October 20, 1976? | SELECT country FROM table_name_83 WHERE date = "october 20, 1976" | sql_create_context |
CREATE TABLE table_22891 (
"Start of conflict" real,
"End of conflict" text,
"Conflict" text,
"Continent" text,
"Location" text,
"Branches involved" text
) | Which conflicts took place in Yemen? | SELECT "Conflict" FROM table_22891 WHERE "Location" = 'Yemen' | wikisql |
CREATE TABLE table_35106 (
"Sanskrit \u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d" text,
"Tamil \u0ba4\u0bae\u0bbf\u0bb4\u0bcd" text,
"Telugu \u0c24\u0c46\u0c32\u0c41\u0c17\u0c41" text,
"Kannada \u0c95\u0ca8\u0ccd\u0ca8\u0ca1" text,
"Malayalam \u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02" text,
... | What kind of Sanskrit has a Tamil of r ki i ? | SELECT "Sanskrit \u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d" FROM table_35106 WHERE "Tamil \u0ba4\u0bae\u0bbf\u0bb4\u0bcd" = 'rōkiṇi ரோகிணி' | wikisql |
CREATE TABLE table_name_65 (
quantity_made VARCHAR,
year_made VARCHAR
) | What is Quantity Made, when Year Made is '4-4-0 oooo american'? | SELECT quantity_made FROM table_name_65 WHERE year_made = "4-4-0 — oooo — american" | sql_create_context |
CREATE TABLE table_name_13 (
game VARCHAR,
score VARCHAR
) | Score of new york yankees 2, brooklyn dodgers 3 involves how many number of games? | SELECT COUNT(game) FROM table_name_13 WHERE score = "new york yankees – 2, brooklyn dodgers – 3" | sql_create_context |
CREATE TABLE table_74521 (
"Year" real,
"Recipient" text,
"Role" text,
"Play" text,
"Production" text
) | Name the play for 1976 | SELECT "Play" FROM table_74521 WHERE "Year" = '1976' | wikisql |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 20284523病人所有检验结果指标记录的检测员为李雅健的检验指标流水号是多少就在01年7月11日到2014年11月2日之间? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGD... | css |
CREATE TABLE table_name_99 (
type VARCHAR,
name VARCHAR
) | What type of state is bo qin? | SELECT type FROM table_name_99 WHERE name = "bo qin" | sql_create_context |
CREATE TABLE table_name_35 (
season VARCHAR,
rank VARCHAR
) | Which season has rank 2? | SELECT season FROM table_name_35 WHERE rank = "2" | sql_create_context |
CREATE TABLE table_name_13 (
stadium VARCHAR,
visiting_team VARCHAR
) | In what stadium were the New England Patriots the visiting team? | SELECT stadium FROM table_name_13 WHERE visiting_team = "new england patriots" | sql_create_context |
CREATE TABLE table_21359 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text,
"Competition" text,
"Man of the Match" text
) | where was the venue where the attendance was 702? | SELECT "Venue" FROM table_21359 WHERE "Attendance" = '702' | wikisql |
CREATE TABLE table_2906 (
"Episode" text,
"First broadcast" text,
"Davids team" text,
"Lees team" text,
"Scores" text
) | What is the episode number that was first broadcast on 3 September 2010? | SELECT "Episode" FROM table_2906 WHERE "First broadcast" = '3 September 2010' | wikisql |
CREATE TABLE table_60585 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | What is the score points when the total is 16? | SELECT "Score points" FROM table_60585 WHERE "Total" = '16' | wikisql |
CREATE TABLE table_41259 (
"Rank" real,
"Country" text,
"Winner" real,
"Runner -up" real,
"Losing Semi- finalist" real
) | Which Rank has a Country of costa rica, and a Losing Semi- finalist larger than 1? | SELECT AVG("Rank") FROM table_41259 WHERE "Country" = 'costa rica' AND "Losing Semi- finalist" > '1' | wikisql |
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_DIRE_CD text,
MED_DIRE_NM text,... | 负责医疗诊察20594807854中费用明细项目38778842615的医疗机构科室编码以及其名称各自叫什么? | SELECT t_kc22.MED_ORG_DEPT_CD, t_kc22.MED_ORG_DEPT_NM FROM t_kc22 WHERE t_kc22.MED_EXP_DET_ID = '38778842615' | css |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | did patient 013-28507 receive any tests for crp in this year? | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-28507')) AND lab.labname = 'crp' AND DATETIME(lab.labresulttime, 'start of year') = ... | eicu |
CREATE TABLE table_name_63 (
barrel_twist VARCHAR,
barrel_length VARCHAR
) | Can you tell me the Barrel twist that has the Barrel lenght of 11.5 in.? | SELECT barrel_twist FROM table_name_63 WHERE barrel_length = "11.5 in." | sql_create_context |
CREATE TABLE table_name_71 (
Id VARCHAR
) | What was the 2009 results that has q1 for 2010, and A as the result for 2011? | SELECT 2009 FROM table_name_71 WHERE 2010 = "q1" AND 2011 = "a" | sql_create_context |
CREATE TABLE table_name_81 (
race VARCHAR,
date VARCHAR
) | what is the race on 23 october? | SELECT race FROM table_name_81 WHERE date = "23 october" | sql_create_context |
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
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 Lives_in (
stuid INTEGER,
... | Find the average age for students with different sex in a bar chart, and list by the bar in ascending please. | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 已经被门诊诊断为疾病W41.056的这个患者96646392的D2聚体(肝素/EDTA)的结果定量及其单位分别是什么? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE table_61027 (
"Year" real,
"Award" text,
"Category" text,
"Role" text,
"Result" text
) | Which Result has an Award of virgin media tv awards? | SELECT "Result" FROM table_61027 WHERE "Award" = 'virgin media tv awards' | wikisql |
CREATE TABLE table_name_53 (
current_conference VARCHAR,
nickname VARCHAR
) | Which Current Conference has a Nickname of lynx? | SELECT current_conference FROM table_name_53 WHERE nickname = "lynx" | sql_create_context |
CREATE TABLE table_28232443_1 (
year INTEGER,
artist VARCHAR
) | what was the first year that kid creole and the coconuts recorded with I Too Have Seen The Woods / Sire Records? | SELECT MIN(year) FROM table_28232443_1 WHERE artist = "Kid Creole and the Coconuts" | sql_create_context |
CREATE TABLE table_256286_55 (
description VARCHAR,
_percentage_yes VARCHAR
) | What is the description of the measure that got 78.27% yes votes? | SELECT description FROM table_256286_55 WHERE _percentage_yes = "78.27%" | sql_create_context |
CREATE TABLE procedures (
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 urgent hospital admission patients who had a magnesium lab test done. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Magnesium" | mimicsql_data |
CREATE TABLE table_name_15 (
attendance VARCHAR,
score VARCHAR
) | How many people attended the game that ended 4-6? | SELECT COUNT(attendance) FROM table_name_15 WHERE score = "4-6" | sql_create_context |
CREATE TABLE table_name_64 (
year VARCHAR,
country VARCHAR,
dates VARCHAR
) | What Year was the United States the country for aug 3 5? | SELECT year FROM table_name_64 WHERE country = "united states" AND dates = "aug 3–5" | sql_create_context |
CREATE TABLE table_68399 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | Which engine of bmw had the lowest points and chassis of march 792 that is newer than 1979? | SELECT MIN("Points") FROM table_68399 WHERE "Engine" = 'bmw' AND "Chassis" = 'march 792' AND "Year" > '1979' | wikisql |
CREATE TABLE table_76046 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the sum of gold medals for a rank of 14? | SELECT SUM("Gold") FROM table_76046 WHERE "Rank" = '14' | wikisql |
CREATE TABLE table_20032301_3 (
undecided VARCHAR,
sampling_error VARCHAR
) | What's the percentage of undecided according to the poll source with sampling error of 2.7%? | SELECT undecided FROM table_20032301_3 WHERE sampling_error = "2.7%" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID... | For all employees who have the letters D or S in their first name, give me the comparison about the sum of manager_id over the hire_date bin hire_date by weekday by a bar chart, I want to sort by the Y-axis in asc. | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY SUM(MANAGER_ID) | nvbench |
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
)
... | what is drug code of drug name doxazosin? | SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Doxazosin" | mimicsql_data |
CREATE TABLE table_7246 (
"Rank" real,
"Park" text,
"Location" text,
"Peak Name" text,
"Elevation (ft)" real,
"Minimum Elevation (ft)" text,
"Vertical Relief (ft)" real
) | What is the mean vertical relief in feet when the rank is more than 40 and the location is va0573? | SELECT AVG("Vertical Relief (ft)") FROM table_7246 WHERE "Rank" > '40' AND "Location" = 'va0573' | 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... | 在2008-03-18到2019-06-20内,医疗机构6247162的入院诊断疾病结果与出院诊断疾病结果有多少不同的次数 | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '6247162' AND IN_HOSP_DATE BETWEEN '2008-03-18' AND '2019-06-20' AND IN_DIAG_DIS_CD <> OUT_DIAG_DIS_CD | css |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_descriptio... | pm flights DALLAS to ATLANTA | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((flight.departure_time <= 2359 AND flight.departure_time >= 1200) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND flight... | atis |
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... | Highest rated unanimously upvoted posts. | SELECT v.PostId AS postId, COUNT(v.Id) AS Upvotes FROM Votes AS v WHERE v.VoteTypeId = 2 GROUP BY v.PostId ORDER BY COUNT(v.Id) | sede |
CREATE TABLE stores (
store_id text,
address_id number,
marketing_region_code text,
store_name text,
store_phone text,
store_email_address text,
other_details text
)
CREATE TABLE performers (
performer_id number,
address_id number,
customer_name text,
customer_phone text,
... | Find the payment method that is used the most often in all the invoices. Give me its code. | SELECT payment_method_code FROM invoices GROUP BY payment_method_code ORDER BY COUNT(*) DESC LIMIT 1 | spider |
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,... | 95072739患者开出的药品在哪几次医疗记录中被均高于8153.6元?列出医疗就诊编号都是什么? | SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '95072739' AND NOT MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT <= 8153.6) | css |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport... | how much is a flight from WASHINGTON to BOSTON | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'WASHINGTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.c... | atis |
CREATE TABLE table_name_28 (
electrics VARCHAR,
engine VARCHAR,
model_name VARCHAR
) | Which Electrics has an Engine of 175cc, bhp (kw), and a Model Name of d10 sports & bushman? | SELECT electrics FROM table_name_28 WHERE engine = "175cc, bhp (kw)" AND model_name = "d10 sports & bushman" | sql_create_context |
CREATE TABLE table_14919 (
"Season" text,
"Series" text,
"Races" text,
"Wins" text,
"Podiums" text,
"Points" text,
"Final Placing" text
) | Which Season has a 19th Final Place? | SELECT "Season" FROM table_14919 WHERE "Final Placing" = '19th' | wikisql |
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-09-21到2008-12-08内有什么? | SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_in... | css |
CREATE TABLE Roles (
Role_Code CHAR(15),
Role_Name VARCHAR(255),
Role_Description VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Description VARCHAR(255)
)
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INT... | Show the number of documents in different starting date and bin starting date by weekday interval with a bar chart, and rank y axis in desc order please. | SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations ORDER BY COUNT(Date_in_Location_From) DESC | nvbench |
CREATE TABLE table_40957 (
"Position" text,
"Jersey number" real,
"Name v t e" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthplace" text,
"1995-96 team" text
) | What was the Name v t e, of the player whose Weight (kg) was 84, whose Position was D, and whose Jersey number was 2? | SELECT "Name v t e" FROM table_40957 WHERE "Weight (kg)" = '84' AND "Position" = 'd' AND "Jersey number" = '2' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | tell me the top four most common diagnoses for the patients in the 30s until 1 year ago? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 yea... | eicu |
CREATE TABLE table_51917 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the highest crowd with north melbourne as away team? | SELECT MAX("Crowd") FROM table_51917 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE table_8622 (
"Discipline" text,
"Championship" text,
"Circuit" text,
"Session" text,
"Cause" text
) | What was the session at the circuit of lowes motor speedway? | SELECT "Session" FROM table_8622 WHERE "Circuit" = 'lowes motor speedway' | wikisql |
CREATE TABLE table_204_130 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | what venue is previous to gin sio chico neto , maring ? | SELECT "venue" FROM table_204_130 WHERE "date" < (SELECT "date" FROM table_204_130 WHERE "venue" = 'ginasio chico neto, maringa') ORDER BY "date" DESC LIMIT 1 | squall |
CREATE TABLE table_37687 (
"Year" real,
"Home" text,
"Score" text,
"Away" text,
"Date" text,
"Venue" text
) | What's the Score with a Home of Scotland and Date of 24 February? | SELECT "Score" FROM table_37687 WHERE "Home" = 'scotland' AND "Date" = '24 february' | wikisql |
CREATE TABLE table_22901 (
"Series No." real,
"Season No." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.K. viewers (million)" text
) | What's the series number of the episode seen by 2.43 million viewers in the UK? | SELECT "Series No." FROM table_22901 WHERE "U.K. viewers (million)" = '2.43' | wikisql |
CREATE TABLE table_26228 (
"No" real,
"Player" text,
"Height (m)" text,
"Height (f)" text,
"Position" text,
"Year born" real,
"Current Club" text
) | Name the height for number 7 | SELECT "Height (m)" FROM table_26228 WHERE "No" = '7' | wikisql |
CREATE TABLE table_26375386_18 (
vote_percentage VARCHAR,
couple VARCHAR
) | What was the vote % of Heather and Matt? | SELECT vote_percentage FROM table_26375386_18 WHERE couple = "Heather and Matt" | sql_create_context |
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... | Users by Popular Question ratio. (only users with at least 10 Popular Questions) | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS SeptemberRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = Pos... | sede |
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... | give me the number of patients with other specified cardiac dysrhythmias diagnoses who have delta abnormal lab test status. | 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 = "Other specified cardiac dysrhythmias" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE procedures (
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,
... | what is the number of patients whose primary disease is mesenteric ischemia and age is less than 86? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "MESENTERIC ISCHEMIA" AND demographic.age < "86" | mimicsql_data |
CREATE TABLE table_name_40 (
marginal_ordinary_income_tax_rate VARCHAR,
head_of_household VARCHAR
) | Name the marginal ordinary income tax rate that has a head of household of $372,951+ | SELECT marginal_ordinary_income_tax_rate FROM table_name_40 WHERE head_of_household = "$372,951+" | sql_create_context |
CREATE TABLE table_12650 (
"Perpetrator" text,
"Year" text,
"Location" text,
"Country" text,
"Killed" text
) | What year is the location Ta'izz? | SELECT "Year" FROM table_12650 WHERE "Location" = 'ta''izz' | wikisql |
CREATE TABLE table_14870 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Nick Price's score? | SELECT "Score" FROM table_14870 WHERE "Player" = 'nick price' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | what is the procedure icd9 code of Jerry Deberry? | SELECT procedures.icd9_code FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
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... | 统计年龄不高于26岁的患者医疗记录的平均看病费总额是多少元? | SELECT AVG(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_AGE <= 26) | css |
CREATE TABLE table_1532 (
"Urban area (locality)" text,
"Municipality" text,
"Population" real,
"Land area (hectares)" text,
"Density (inh./km\u00b2)" text,
"Code" real
) | How many hectars of land is in Kaxholmen? | SELECT "Land area (hectares)" FROM table_1532 WHERE "Urban area (locality)" = 'Kaxholmen' | wikisql |
CREATE TABLE table_203_696 (
id number,
"year" number,
"single" text,
"charts\nfr" number,
"charts\nbel\nwa" number,
"charts\nswi" number,
"certification" number,
"album" text
) | how many singles were released before 2001 but after 1997 ? | SELECT COUNT("single") FROM table_203_696 WHERE "year" < 2001 AND "year" > 1997 | squall |
CREATE TABLE table_33524 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the average crowd size for games with hawthorn as the home side? | SELECT AVG("Crowd") FROM table_33524 WHERE "Home team" = 'hawthorn' | wikisql |
CREATE TABLE table_20903658_1 (
title_subject VARCHAR,
date_painted_created VARCHAR
) | Who was the subject of the sculpture created in 1982? | SELECT title_subject FROM table_20903658_1 WHERE date_painted_created = "1982" | sql_create_context |
CREATE TABLE table_name_86 (
highest_score VARCHAR
) | What is the average value in the 100s category when the high score is 196? | SELECT AVG(100 AS s) FROM table_name_86 WHERE highest_score = "196" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is average age of patients whose marital status is married and primary disease is brain mass;intracranial hemorrhage? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" | mimicsql_data |
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... | Give me the number of living patients who have atrial septal defect mitral valve replacement repair atrial-septal defect/sda as their primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" | mimicsql_data |
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... | 病患凤香馨使用的药品均低于3461.35元一共有多少记载在次医疗记录上?编号当时都是多少? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '凤香馨' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3461.35) | css |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | 白蛋白的参考值范围下限和上限在哪个数值范围内,门诊可诊断患者患有痴呆 | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH = jybgb.... | css |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varch... | Just show the employee's last name and their employee id using a bar chart, sort from low to high by the Y-axis. | SELECT LAST_NAME, EMPLOYEE_ID FROM employees ORDER BY EMPLOYEE_ID | nvbench |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Score distribution (all questions, no filters). | SELECT COUNT(Id) AS CountOfScore, Score FROM Posts AS p WHERE p.PostTypeId = 1 AND Score BETWEEN -20 AND 20 GROUP BY Score ORDER BY Score | sede |
CREATE TABLE table_23662272_4 (
couple VARCHAR,
total_points_earned VARCHAR
) | What is the name of the couple if the total points earned is 161? | SELECT couple FROM table_23662272_4 WHERE total_points_earned = 161 | sql_create_context |
CREATE TABLE table_72987 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Raiders points" real,
"Opponents" real,
"Raiders first downs" real,
"Record" text,
"Attendance" real
) | What was the result of the game seen by 31095 people? | SELECT "Result" FROM table_72987 WHERE "Attendance" = '31095' | wikisql |
CREATE TABLE table_47463 (
"Match No." real,
"Date" text,
"Time" text,
"Score" text,
"Venue" text,
"Match Report" text
) | What is the highest Match No., when Date is 2008-03-21, and when Time is 16:00? | SELECT MAX("Match No.") FROM table_47463 WHERE "Date" = '2008-03-21' AND "Time" = '16:00' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | had patient 22648 had any gastric emesis output since 12/2105? | SELECT COUNT(*) > 0 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 = 22648)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric emesis... | mimic_iii |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 病患郑自珍大腿的检测各项指标结果如何? | (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_11071 (
"Pick" real,
"Round" real,
"Player" text,
"Position" text,
"School" text
) | What's the average round number for East Carolina? | SELECT AVG("Round") FROM table_11071 WHERE "School" = 'east carolina' | wikisql |
CREATE TABLE table_203_545 (
id number,
"single/ep" text,
"release date" text,
"label" text,
"format(s)" text,
"uk singles chart position" number,
"notes" text
) | what are the number of times jive records is listed as the label ? | SELECT COUNT(*) FROM table_203_545 WHERE "label" = 'jive records' | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.