context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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 diagnosis (
diagn... | how much does a drug called sodium chloride 0.9% 500 ml pb cost. | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'sodium chloride 0.9% 500 ml pb') | eicu |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREA... | Ten major RDBMS systems, ranked by popularity. | SELECT TagName AS Tags, cnt AS "questions_tagged", ROUND(100.0 * cnt / SUM(cnt) OVER (), 2) AS "ratio,_%" FROM Tags AS t JOIN LATERAL (SELECT COUNT(*) AS cnt FROM PostTags AS pt WHERE pt.TagId = t.Id) AS q WHERE t.TagName IN ('mysql', 'sql-server', 'oracle', 'postgresql', 'mariadb', 'mongodb', 'cassandra', 'db2', 'msac... | sede |
CREATE TABLE table_36175 (
"Character" text,
"Actor" text,
"Duration" text,
"Role" text,
"Appearances" text
) | What is the duration that has 3 for appearances, and james garret as the character? | SELECT "Duration" FROM table_36175 WHERE "Appearances" = '3' AND "Character" = 'james garret' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid ... | what is the monthly average intake of vasopressin (ml): that patient 031-3355 is getting since 34 months ago? | SELECT AVG(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 = '031-3355')) AND intakeoutput.celllabel = 'vasopr... | eicu |
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 hz_info (
KH text,
KLX number... | 在编号为48127032778病人看病期间名里有男科的科室开出的所有检验报告单的编号都是啥? | SELECT BGDH FROM jybgb WHERE JZLSH = '48127032778' AND KSMC LIKE '%男科%' | css |
CREATE TABLE table_77701 (
"Episode Air Date" text,
"Audition City" text,
"Date" text,
"First Audition Venue" text,
"Callback Date" text,
"Callback Venue" text,
"Golden Tickets" real
) | What day has a callback Venue of total tickets to hollywood? Question | SELECT "Date" FROM table_77701 WHERE "Callback Venue" = 'total tickets to hollywood' | wikisql |
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date DATETIME,
Document_Name VARCHAR(255),
Document_Description VARCHAR(255),
... | How many documents are there of each type Show bar chart, could you display from low to high by the total number? | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE claims (
claim_id number,
fnol_id number,
effective_date time
)
CREATE TABLE services (
service_id number,
service_name text
)
CREATE TABLE customers_policies (
customer_id number,
policy_id number,
date_opened time,
date_closed time
)
CREATE TABLE settlements (
s... | What are all the policy types of the customer named 'Dayana Robel'? | SELECT DISTINCT t3.policy_type_code FROM customers AS t1 JOIN customers_policies AS t2 ON t1.customer_id = t2.customer_id JOIN available_policies AS t3 ON t2.policy_id = t3.policy_id WHERE t1.customer_name = "Dayana Robel" | spider |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeou... | what were the top five most common procedures that followed in the same hospital visit for patients that received a laxatives - psyllium (metamucil, polycarbophil) until 2104? | SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'laxat... | eicu |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnon... | Questions with a specific tag and no other tags. | SELECT Id AS "post_link", Tags FROM Posts WHERE PostTypeId = 1 AND NOT Tags LIKE '<star-trek>' AND (Tags LIKE '<star-trek-%>' OR Tags LIKE '<the-wrath-of-khan>' OR Tags LIKE '<the-search-for-spock>' OR Tags LIKE '<the-voyage-home>' OR Tags LIKE '<the-final-frontier>' OR Tags LIKE '<the-undiscovered-country>' OR Tags LI... | sede |
CREATE TABLE table_name_95 (
venue VARCHAR,
city VARCHAR
) | What venue is in the city of Durham? | SELECT venue FROM table_name_95 WHERE city = "durham" | sql_create_context |
CREATE TABLE table_4262 (
"Rank" real,
"Country/Territory" text,
"Mister International" real,
"1st runner-up" real,
"2nd runner-up" real,
"3rd runner-up" real,
"4th runner-up" real,
"Semifinalists" real,
"Total" real
) | Name the number of semifinalists for 19 rank | SELECT COUNT("Semifinalists") FROM table_4262 WHERE "Rank" = '19' | 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_CLINIC_ID text,
MED_DIRE_CD tex... | 在2016年10月13日至2019年7月16日之内医院1134387总医疗记录的数量有多少? | SELECT COUNT(*) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1134387' AND qtb.IN_HOSP_DATE BETWEEN '2016-10-13' AND '2019-07-16' UNION SELECT COUNT(*) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1134387' AND gyb.IN_HOSP_DATE BETWEEN '2016-10-13' AND '2019-07-16' UNION SELECT COUNT(*) FROM zyb WHERE zyb.MED_SER_ORG_NO = '1134387' AND ... | css |
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 mzjzjlb.JZZDBM, mzjzjlb.JZZDSM 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 = '吕秀艳' | css |
CREATE TABLE table_name_80 (
event VARCHAR,
prize VARCHAR
) | What event had a prize of 900,000? | SELECT event FROM table_name_80 WHERE prize = "€900,000" | 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,
... | 支出的总医疗费,在医疗就诊80157522521里是多少? | SELECT gwyjzb.MED_AMOUT FROM gwyjzb WHERE gwyjzb.MED_CLINIC_ID = '80157522521' UNION SELECT fgwyjzb.MED_AMOUT FROM fgwyjzb WHERE fgwyjzb.MED_CLINIC_ID = '80157522521' | css |
CREATE TABLE table_16046 (
"\u2193 Function / Genus \u2192" text,
"Shigella" text,
"Salmonella" text,
"Yersinia" text,
"Escherichia" text
) | what's the salmonella with escherichia being espd | SELECT "Salmonella" FROM table_16046 WHERE "Escherichia" = 'EspD' | wikisql |
CREATE TABLE table_name_14 (
class VARCHAR,
quantity INTEGER
) | Which Class has a Quantity larger than 96? | SELECT class FROM table_name_14 WHERE quantity > 96 | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在2008年12月3日到2009年2月15日期间参保人号码为25470826的在门诊西药费花了多少? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '25470826' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2008-12-03' AND '2009-02-15' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
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... | Users located in Kansas or Missouri or Arkansas. | SELECT DisplayName, Reputation, WebsiteUrl, Location, AboutMe FROM Users WHERE UPPER(Location) LIKE '%KANSAS%' OR UPPER(Location) LIKE '% KS' OR UPPER(Location) LIKE '% KS %' OR UPPER(Location) = 'KS' UNION SELECT DisplayName, Reputation, WebsiteUrl, Location, AboutMe FROM Users WHERE UPPER(Location) LIKE '%MISSOURI%' ... | sede |
CREATE TABLE table_name_14 (
result VARCHAR,
nominee VARCHAR
) | Did Jason Pennycooke win the award he was nominated for? | SELECT result FROM table_name_14 WHERE nominee = "jason pennycooke" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewT... | List of users who have nondeleted comments on Meta in the last year. | SELECT COUNT(*) AS count, UserId AS id FROM Comments WHERE CreationDate > DATEADD(year, -6, GETDATE()) AND CreationDate < DATEADD(year, -5, GETDATE()) GROUP BY UserId ORDER BY count | sede |
CREATE TABLE table_21401 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Nickname" text,
"Joined" real,
"Left" real,
"Current Conference" text
) | what is the year union university was founded? | SELECT "Founded" FROM table_21401 WHERE "Institution" = 'Union University' | wikisql |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 54857048630这个住院就诊的出院病区叫什么?代码是什么?以及出院的床位是哪一个 | SELECT CYBQDM, CYBQMC, CYCWH FROM zyjzjlb WHERE JZLSH = '54857048630' | css |
CREATE TABLE financial_transactions (
transaction_id number,
account_id number,
invoice_number number,
transaction_type text,
transaction_date time,
transaction_amount number,
transaction_comment text,
other_transaction_details text
)
CREATE TABLE product_categories (
production_typ... | Show the order ids and the number of invoices for each order. | SELECT order_id, COUNT(*) FROM invoices GROUP BY order_id | spider |
CREATE TABLE table_2244 (
"English name" text,
"Thai name" text,
"Abbr." text,
"Transcription" text,
"Sanskrit word" text,
"Zodiac sign" text
) | How many different transcriptions are there for the Thai name ? | SELECT COUNT("Transcription") FROM table_2244 WHERE "Thai name" = 'พฤษภาคม' | wikisql |
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real
)
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int... | Show me how many year by year in a histogram | SELECT Year, COUNT(Year) FROM exhibition GROUP BY Year | nvbench |
CREATE TABLE table_13744 (
"Year" real,
"Title" text,
"Director" text,
"Studio(s)" text,
"Notes" text
) | What is Year is Walt Disney Pictures Imagemovers Digital? | SELECT SUM("Year") FROM table_13744 WHERE "Studio(s)" = 'walt disney pictures imagemovers digital' | wikisql |
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 lab (
la... | when was patient 022-127262 for the last time prescribed a drug via sub-q route during the last hospital encounter? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-127262' AND NOT patient.hospitaldischargetime IS NULL ORDE... | eicu |
CREATE TABLE table_200_7 (
id number,
"afrikaans" text,
"ipa" text,
"dutch" text,
"english" text,
"german" text
) | how do you say ` yes ' in afrikaans ? | SELECT "afrikaans" FROM table_200_7 WHERE "english" = 'yes' | squall |
CREATE TABLE table_78223 (
"Subframe #" real,
"Page #" text,
"Name" text,
"Word #" real,
"Bits" text
) | What is the page count and word count greater than 5 with Bits of 18 22? | SELECT "Page #" FROM table_78223 WHERE "Word #" > '5' AND "Bits" = '18–22' | wikisql |
CREATE TABLE table_10625 (
"Administrative Panel" real,
"Agricultural Panel" real,
"Cultural and Educational Panel" real,
"Industrial and Commercial Panel" real,
"Labour Panel" real,
"National University of Ireland" real,
"Nominated by the Taoiseach" real,
"Total" real
) | Tell me the total number of administrative panel with labour panel more than 2, nominated by taoiseach more than 6 and total of 28 | SELECT COUNT("Administrative Panel") FROM table_10625 WHERE "Labour Panel" > '2' AND "Total" = '28' AND "Nominated by the Taoiseach" > '6' | wikisql |
CREATE TABLE table_28068645_8 (
total INTEGER,
position VARCHAR
) | List the number of assists for the DF. | SELECT MAX(total) FROM table_28068645_8 WHERE position = "DF" | sql_create_context |
CREATE TABLE table_504 (
"Branding" text,
"Callsign" text,
"Frequency" text,
"Power (kW)" text,
"Station Type" text,
"Location" text
) | What is the branding of metro manila? | SELECT "Branding" FROM table_504 WHERE "Location" = 'Metro Manila' | wikisql |
CREATE TABLE table_name_89 (
runner_s__up VARCHAR,
date VARCHAR
) | Who was the runner-up on Jan 19, 1964? | SELECT runner_s__up FROM table_name_89 WHERE date = "jan 19, 1964" | sql_create_context |
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 aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,... | i want to leave PHILADELPHIA and arrive in ATLANTA on a THURSDAY | 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, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND days.day_name = 'THURSDAY' AND flight.flight_days = days.days_code AND... | atis |
CREATE TABLE table_train_15 (
"id" int,
"granulocyte_deficiency" bool,
"immune_suppression" bool,
"hiv_infection" bool,
"immune_deficiency_disorder" bool,
"tumor" bool,
"limited_care" bool,
"NOUSE" float
) | blood / lymphatic system tumors are not remission | SELECT * FROM table_train_15 WHERE tumor = 1 | criteria2sql |
CREATE TABLE table_60851 (
"Year" real,
"First" text,
"Second" text,
"Third" text,
"Fourth" text
) | Who is fourth when Anders Martinson USA is second? | SELECT "Fourth" FROM table_60851 WHERE "Second" = 'anders martinson usa' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, a bar chart shows the distribution of headquarter and the average of revenue , and group by attribute headquarter, sort from high to low by the mean revenue. | SELECT Headquarter, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY AVG(Revenue) DESC | nvbench |
CREATE TABLE table_name_90 (
money___ INTEGER,
player VARCHAR
) | What is the total amount of money that Payne Stewart has? | SELECT SUM(money___) AS £__ FROM table_name_90 WHERE player = "payne stewart" | sql_create_context |
CREATE TABLE table_name_67 (
position VARCHAR,
round VARCHAR,
pick VARCHAR
) | What position after round 8 has a pick less than 270? | SELECT position FROM table_name_67 WHERE round > 8 AND pick < 270 | sql_create_context |
CREATE TABLE table_name_64 (
country VARCHAR,
lane VARCHAR,
name VARCHAR
) | Which country has Anselmo Da Silva in lane 2? | SELECT country FROM table_name_64 WHERE lane < 2 AND name = "anselmo da silva" | sql_create_context |
CREATE TABLE table_name_11 (
place VARCHAR,
score VARCHAR
) | What place did the golfer who had a score of 69-68-69-70=276 finish in? | SELECT place FROM table_name_11 WHERE score = 69 - 68 - 69 - 70 = 276 | sql_create_context |
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... | count the number of patients whose primary disease is rash and year of death is less than or equal to 2155? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.dod_year <= "2155.0" | mimicsql_data |
CREATE TABLE table_40301 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | Overall attendance for week 4? | SELECT "Attendance" FROM table_40301 WHERE "Week" = '4' | 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... | 门诊诊断患者为过敏性皮炎,他们的籍贯代码是什么?名称是什么?相应人数是多少? | SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND ... | css |
CREATE TABLE table_79496 (
"Athlete" text,
"Nationality" text,
"2.15" text,
"2.20" text,
"2.25" text,
"Result" real
) | Which athlete from Brazil has 2.20 O and 2.25 of XXX? | SELECT "Athlete" FROM table_79496 WHERE "2.20" = 'o' AND "2.25" = 'xxx' AND "Nationality" = 'brazil' | wikisql |
CREATE TABLE table_62582 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" real,
"Money ( $ )" real
) | What score has money ($) greater than 400, with gene sarazen as the player? | SELECT "Score" FROM table_62582 WHERE "Money ( $ )" > '400' AND "Player" = 'gene sarazen' | wikisql |
CREATE TABLE table_name_34 (
rank INTEGER,
total INTEGER
) | What is the rank for the total less than 1? | SELECT AVG(rank) FROM table_name_34 WHERE total < 1 | sql_create_context |
CREATE TABLE school (
School_ID int,
Grade text,
School text,
Location text,
Type text
)
CREATE TABLE driver (
Driver_ID int,
Name text,
Party text,
Home_city text,
Age int
)
CREATE TABLE school_bus (
School_ID int,
Driver_ID int,
Years_Working int,
If_full_time... | Show the party and the number of drivers in each party with a bar chart, and sort bars in descending order. | SELECT Party, COUNT(*) FROM driver GROUP BY Party ORDER BY Party DESC | nvbench |
CREATE TABLE table_461 (
"Season" real,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | How many titles did Trupti Murgunde claim? | SELECT "Womens doubles" FROM table_461 WHERE "Womens singles" = 'Trupti Murgunde' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of job_id and the average of employee_id , and group by attribute job_id in a bar chart. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID | nvbench |
CREATE TABLE table_13791 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What is the lowest week that has November 30, 2003 as the date? | SELECT MIN("Week") FROM table_13791 WHERE "Date" = 'november 30, 2003' | 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 (
... | find the number of patients who take medication via inhalation and were admitted before 2168. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2168" AND prescriptions.route = "INHALATION" | mimicsql_data |
CREATE TABLE table_37507 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text
) | What is the highest division for years earlier than 2011? | SELECT MAX("Division") FROM table_37507 WHERE "Year" < '2011' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 患者凤英发哪些检验报告的结果指标全部正常?看看这些检验报告的单号 | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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 ... | css |
CREATE TABLE table_name_96 (
crowd VARCHAR,
away_team VARCHAR
) | What is the crowd size of the game when Fitzroy is the away team? | SELECT COUNT(crowd) FROM table_name_96 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE table_9373 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What's k. j. choi's to par? | SELECT "To par" FROM table_9373 WHERE "Player" = 'k. j. choi' | 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... | 在44520665号的医疗记录显示其所开出的药品价格全都比7717.72元还高的医疗就诊编号是多少? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '44520665' AND NOT gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT < 7717.72) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '44520665' AND NOT fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLI... | css |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 陈古兰这位参保人自20.9.18起,到21.3.30止,所有开出的药品中,单一药品最大购买次数有多少次 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '陈古兰' AND t_kc22.STA_DATE BETWEEN '2020-09-18' AND '2021-03-30' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT ... | css |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE hz_info (
KH text,
KLX number... | 二零零六年十二月二十二日到二零一五年三月五日,编号为8585428的医院中有多少科室在门诊就诊中开了7张以上检验报告单 | SELECT COUNT(*) FROM (SELECT zyjybgb.KSBM FROM mzjzjlb JOIN zyjybgb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '8585428' AND zyjybgb.BGRQ BETWEEN '2006-12-22' AND '2015-03-05' GROUP BY zyjybgb.KSBM HAVING COUNT(*) > 7 UNION SELECT mzjybgb.KSBM FROM mzjzjl... | css |
CREATE TABLE table_23465011_5 (
total_score INTEGER,
average_ranking VARCHAR
) | What is the total score when 7 is the average ranking? | SELECT MAX(total_score) FROM table_23465011_5 WHERE average_ranking = 7 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | how many patients are admitted under clinic referral/premature and are born before 2112? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.dob_year < "2112" | mimicsql_data |
CREATE TABLE team (
Team_id int,
Name text
)
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE match_season (
Season real,
Player text,
Position text,
Country int,
Team i... | Draw a pie chart for how many players played each position? | SELECT Position, COUNT(*) FROM match_season GROUP BY Position | nvbench |
CREATE TABLE table_72712 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What game happened on December 19? | SELECT MAX("Game") FROM table_72712 WHERE "Date" = 'December 19' | wikisql |
CREATE TABLE table_79247 (
"School" text,
"Location" text,
"Mascot" text,
"# / County" text,
"Enrollment" real,
"IHSAA Class /Football/Soccer" text,
"Year joined" real,
"Previous Conference" text,
"Year Left" real,
"Conference Joined" text
) | What is the highest enrollment for rochester community school? | SELECT MAX("Enrollment") FROM table_79247 WHERE "School" = 'rochester community' | wikisql |
CREATE TABLE table_29026564_10 (
score VARCHAR,
surface VARCHAR,
category VARCHAR
) | In the 250 series on clay what were the scores? | SELECT score FROM table_29026564_10 WHERE surface = "Clay" AND category = "250 series" | sql_create_context |
CREATE TABLE table_26986076_5 (
sat_21_aug VARCHAR,
rank VARCHAR
) | When 8 is the rank what is the Saturday August 21st? | SELECT sat_21_aug FROM table_26986076_5 WHERE rank = 8 | sql_create_context |
CREATE TABLE table_60029 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" text
) | What is Score, when Away Team is 'Newcastle Benfield'? | SELECT "Score" FROM table_60029 WHERE "Away team" = 'newcastle benfield' | wikisql |
CREATE TABLE table_37395 (
"Years" text,
"Competition" text,
"Vehicle Name" text,
"Original Vehicle" text,
"Architecture" text
) | What type of architecture does the Saturn Vue have? | SELECT "Architecture" FROM table_37395 WHERE "Vehicle Name" = 'saturn vue' | wikisql |
CREATE TABLE customer_payments (
customer_id number,
datetime_payment time,
payment_method_code text,
amount_payment number
)
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE... | What is the zip code of the customer Carole Bernhard? | SELECT T2.zip_postcode FROM customers AS T1 JOIN addresses AS T2 ON T1.customer_address_id = T2.address_id WHERE T1.first_name = "Carole" AND T1.last_name = "Bernhard" | spider |
CREATE TABLE table_name_34 (
country VARCHAR,
publisher VARCHAR
) | What country has deltamac (hk) as the publisher? | SELECT country FROM table_name_34 WHERE publisher = "deltamac (hk)" | sql_create_context |
CREATE TABLE table_32530 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | What day did he play on hard with tom mercer? | SELECT "Date" FROM table_32530 WHERE "Surface" = 'hard' AND "Partner" = 'tom mercer' | wikisql |
CREATE TABLE table_name_20 (
home VARCHAR,
attendance VARCHAR
) | What is the Home team when the Attendance was 1920? | SELECT home FROM table_name_20 WHERE attendance = 1920 | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | give me the number of patients whose diagnoses short title is long-term use steroids? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Long-term use steroids" | mimicsql_data |
CREATE TABLE table_32237 (
"Cyclist" text,
"Country" text,
"Team" text,
"Time" text,
"UCI ProTour Points" text
) | Who is Gerolsteiner's cyclist? | SELECT "Cyclist" FROM table_32237 WHERE "Team" = 'gerolsteiner' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,... | 看一下门诊43110591340就诊的诊断编码和名称是什么 | SELECT zzmzjzjlb.JZZDBM, zzmzjzjlb.JZZDSM FROM zzmzjzjlb WHERE zzmzjzjlb.JZLSH = '43110591340' UNION SELECT fzzmzjzjlb.JZZDBM, fzzmzjzjlb.JZZDSM FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZLSH = '43110591340' | css |
CREATE TABLE table_75643 (
"Goal" real,
"Date" text,
"Venue" text,
"Result" text,
"Competition" text
) | What was the result of the game in Stuttgart, West Germany and a goal number of less than 9? | SELECT "Result" FROM table_75643 WHERE "Venue" = 'stuttgart, west germany' AND "Goal" < '9' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
... | Top 50 users based on aervage number of upvotes per day. | SELECT DisplayName, UpVotes / (CAST(LastAccessDate AS INT) - CAST(CreationDate AS INT) + 1) AS VotesperDay FROM Users ORDER BY VotesperDay DESC LIMIT 50 | sede |
CREATE TABLE table_name_65 (
overall VARCHAR,
round INTEGER
) | Which Overall has a Round smaller than 2? | SELECT overall FROM table_name_65 WHERE round < 2 | sql_create_context |
CREATE TABLE table_203_237 (
id number,
"n" number,
"p" text,
"nat." text,
"name" text,
"age" number,
"moving from" text,
"type" text,
"transfer\nwindow" text,
"ends" number,
"transfer\nfee" text
) | what player had the most transfer fee ? | SELECT "name" FROM table_203_237 ORDER BY "transfer\nfee" DESC LIMIT 1 | squall |
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name ... | what are the flights from ST. LOUIS to BURBANK sunday evening | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BURBANK' AND date_day.day_number = 27 AND date_day.month_number = 8 AND ... | atis |
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... | 门诊诊断患者为结膜炎的尿素的参考值范围有什么下限和上限? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDSM = '结膜炎' AND jyjgzbb.JCZBMC = '尿素' | css |
CREATE TABLE table_1414702_3 (
wiaa_classification VARCHAR,
high_school VARCHAR
) | What is the WIAA classification of Oakland Alternative High School? | SELECT wiaa_classification FROM table_1414702_3 WHERE high_school = "Oakland Alternative" | sql_create_context |
CREATE TABLE table_17510803_2 (
played VARCHAR,
points_for VARCHAR
) | How many have been played for 362 points? | SELECT played FROM table_17510803_2 WHERE points_for = "362" | sql_create_context |
CREATE TABLE table_name_94 (
barrow_island_australia INTEGER,
draugen_north_sea VARCHAR,
mutineer_exeter_australia VARCHAR
) | What is the average Barrow Island Australia when Draugen north sea is 17 and Mutineer-Exeter Australia is smaller than 6? | SELECT AVG(barrow_island_australia) FROM table_name_94 WHERE draugen_north_sea = 17 AND mutineer_exeter_australia < 6 | sql_create_context |
CREATE TABLE table_28121 (
"Series #" real,
"Season #" real,
"Title" text,
"Director" text,
"Writer(s)" text,
"Airdate" text
) | How many writers were for season #1? | SELECT COUNT("Writer(s)") FROM table_28121 WHERE "Season #" = '1' | wikisql |
CREATE TABLE list (
lastname text,
firstname text,
grade number,
classroom number
)
CREATE TABLE teachers (
lastname text,
firstname text,
classroom number
) | Find the name of the teacher who teaches the largest number of students. | SELECT T2.firstname, T2.lastname FROM list AS T1 JOIN teachers AS T2 ON T1.classroom = T2.classroom GROUP BY T2.firstname, T2.lastname ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_60414 (
"Knight" text,
"Weapon/item" text,
"External weapon" text,
"Shield animal" text,
"Cart" text
) | What is the external weapon with the falcon shield animal? | SELECT "External weapon" FROM table_60414 WHERE "Shield animal" = 'falcon' | wikisql |
CREATE TABLE table_name_8 (
section VARCHAR,
position VARCHAR
) | Which section is in the 6th position? | SELECT section FROM table_name_8 WHERE position = "6th" | sql_create_context |
CREATE TABLE table_203_501 (
id number,
"title" text,
"genre" text,
"sub\u00addivisions" text,
"libretto" text,
"premiere date" text,
"place, theatre" text
) | in which city did the most operettas premiere ? | SELECT "place, theatre" FROM table_203_501 GROUP BY "place, theatre" ORDER BY COUNT("title") DESC LIMIT 1 | squall |
CREATE TABLE orders (
order_id VARCHAR,
order_status VARCHAR,
customer_id VARCHAR
)
CREATE TABLE customers (
customer_id VARCHAR,
customer_name VARCHAR
) | Give me a list of id and status of orders which belong to the customer named 'Jeramie'. | SELECT T2.order_id, T2.order_status FROM customers AS T1 JOIN orders AS T2 ON T1.customer_id = T2.customer_id WHERE T1.customer_name = "Jeramie" | sql_create_context |
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_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating nu... | what is the average rating of songs for each language? | SELECT languages, AVG(rating) FROM song GROUP BY languages | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | what are the four most common lab tests for the patients who received a systemic glucocorticoid - methylprednisolone before within 2 months? | SELECT t3.labname FROM (SELECT t2.labname, 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 = 'systemic glucocorticoid - methylprednisolone') AS t1... | eicu |
CREATE TABLE table_name_35 (
points INTEGER,
score VARCHAR
) | Which Points have a Score of 4 1? | SELECT MAX(points) FROM table_name_35 WHERE score = "4–1" | sql_create_context |
CREATE TABLE table_45074 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What is the average money ($) that Tom Weiskopf made? | SELECT AVG("Money ( $ )") FROM table_45074 WHERE "Player" = 'tom weiskopf' | wikisql |
CREATE TABLE table_name_83 (
silver INTEGER,
nation VARCHAR,
total VARCHAR
) | What is the least amount of silver for Italy with a total less than 5? | SELECT MIN(silver) FROM table_name_83 WHERE nation = "italy" AND total < 5 | sql_create_context |
CREATE TABLE table_17964 (
"Ensemble" text,
"Gold Medals" real,
"Silver Medals" real,
"Bronze Medals" real,
"Total Medals" real
) | what are all the gold medals when the silver medals is smaller than 1.0? | SELECT "Gold Medals" FROM table_17964 WHERE "Silver Medals" < '1.0' | 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... | 看一下药物的数目乘以单价在医疗费用的明细记录08024624019里得多少 | SELECT QTY * UNIVALENT FROM t_kc22 WHERE MED_EXP_DET_ID = '08024624019' | css |
CREATE TABLE table_name_48 (
ansi_code INTEGER,
latitude VARCHAR,
pop__2010_ VARCHAR,
geo_id VARCHAR,
water__sqmi_ VARCHAR
) | Which ANSI code has a GEO ID larger than 3809927140, and a Water (sqmi) smaller than 0.492, and a Pop (2010) of 37, and a Latitude larger than 48.245979? | SELECT MIN(ansi_code) FROM table_name_48 WHERE geo_id > 3809927140 AND water__sqmi_ < 0.492 AND pop__2010_ = 37 AND latitude > 48.245979 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.