context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE mzb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 从2006年2月17日到2006年6月28日内号码为19494267参保人的门诊检查费一共花费多少元? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 JOIN mzb ON mzb.MED_ORG_DEPT_CD = t_kc22.MED_CLINIC_ID WHERE mzb.PERSON_NM = '19494267' AND t_kc22.STA_DATE BETWEEN '2006-02-17' AND '2006-06-28' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
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,... | 查询给患者05485933开替米沙坦片这个药的医院 | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '05485933' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE SOC_SRT_DIRE_NM = '替米沙坦片') | css |
CREATE TABLE table_46962 (
"Name" text,
"Premier League" real,
"League Cup" real,
"FA Cup" real,
"Total" real
) | What is the average total of kenwyne jones, who has more than 10 premier leagues? | SELECT AVG("Total") FROM table_46962 WHERE "Name" = 'kenwyne jones' AND "Premier League" > '10' | 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 treatment (
... | what's the average cost of a hospital that includes a drug called albuterol-ipratropium (duoneb) inhalation solution 3 ml in 2104? | SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'albuterol-ipratropium (duoneb) inhalation solu... | eicu |
CREATE TABLE entrepreneur (
Entrepreneur_ID int,
People_ID int,
Company text,
Money_Requested real,
Investor text
)
CREATE TABLE people (
People_ID int,
Name text,
Height real,
Weight real,
Date_of_Birth text
) | Display a bar chart for what are the investors of entrepreneurs and the corresponding number of entrepreneurs invested by each investor?, and show in desc by the total number please. | SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | what is the primary disease and diagnosis of the patient id 8440? | SELECT demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "8440" | 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... | 在医院8879930内部统共有多少科室住院的最短时长都超过了10天? | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8879930' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING MIN(t_kc21.IN_HOSP_DAYS) > 10) AS T | css |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TA... | show me the flights from SAN FRANCISCO to PITTSBURGH on tuesday | 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 = 'PITTSBURGH' AND date_day.day_number = 22 AND date_day.month_number = 3 AN... | atis |
CREATE TABLE table_21892 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | On what surface was the game played with a score of 6 4, 6 4? | SELECT "Surface" FROM table_21892 WHERE "Score" = '6–4, 6–4' | wikisql |
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE cite (
citingpaperid int,
citedpaperid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE dataset (
datasetid int,
datasetname varchar
)
CREATE T... | papers before 2010 about character recognition | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'character recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year < 2010 | scholar |
CREATE TABLE table_51118 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which country has a score of 70-71-72=213? | SELECT "Country" FROM table_51118 WHERE "Score" = '70-71-72=213' | wikisql |
CREATE TABLE table_name_30 (
sales_total VARCHAR,
chart VARCHAR
) | Which Sales Total has a Chart of oricon monthly albums chart? | SELECT sales_total FROM table_name_30 WHERE chart = "oricon monthly albums chart" | sql_create_context |
CREATE TABLE table_name_69 (
nationality VARCHAR,
school_club_team VARCHAR
) | What Nationality is the Iowa State team? | SELECT nationality FROM table_name_69 WHERE school_club_team = "iowa state" | sql_create_context |
CREATE TABLE table_name_31 (
year VARCHAR,
result VARCHAR
) | In which year did he finish 11th? | SELECT COUNT(year) FROM table_name_31 WHERE result = "11th" | sql_create_context |
CREATE TABLE table_2592 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What' the series number of the episode with season number 13? | SELECT MIN("No. in series") FROM table_2592 WHERE "No. in season" = '13' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | give me the number of patients whose diagnoses short title is history of tobacco use and lab test category is blood gas? | 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.short_title = "History of tobacco use" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | 患者凤英发哪些检验报告的结果指标全部正常?看看这些检验报告的单号 | SELECT jybgb.BGDH 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.person_info_XM = '凤英发' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgz... | css |
CREATE TABLE table_12357 (
"Model" text,
"Chassis code" text,
"Production time" text,
"Number built" real,
"Engine" text
) | What's the production time with more than 2.737 built and a 280s model? | SELECT "Production time" FROM table_12357 WHERE "Number built" > '2.737' AND "Model" = '280s' | wikisql |
CREATE TABLE table_name_80 (
total INTEGER,
county VARCHAR
) | What is galway county's total? | SELECT SUM(total) FROM table_name_80 WHERE county = "galway" | sql_create_context |
CREATE TABLE Manufacturers (
name VARCHAR,
code VARCHAR
)
CREATE TABLE products (
Price INTEGER,
manufacturer VARCHAR,
price INTEGER
) | Select the names of manufacturer whose products have an average price higher than or equal to $150. | SELECT AVG(T1.price), T2.name FROM products AS T1 JOIN Manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name HAVING AVG(T1.price) >= 150 | sql_create_context |
CREATE TABLE table_203_853 (
id number,
"date" text,
"opponent" text,
"home/away" text,
"field" text,
"result" text
) | what was the difference in score between the barrage and the lizards on june 2 . | SELECT ABS("result" - "result") FROM table_203_853 WHERE "date" = 'june 2' | squall |
CREATE TABLE room (
roomnumber number,
roomtype text,
blockfloor number,
blockcode number,
unavailable boolean
)
CREATE TABLE trained_in (
physician number,
treatment number,
certificationdate time,
certificationexpires time
)
CREATE TABLE block (
blockfloor number,
blockco... | Find the ids of the nurses who are on call in block floor 1 and block code 1. | SELECT nurse FROM on_call WHERE blockfloor = 1 AND blockcode = 1 | spider |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE intakeoutput (
intakeoutpu... | when was patient 002-30780 prescribed a drug for the first time on 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 = '002-30780' AND NOT patient.hospitaldischargetime IS NULL ORDER... | eicu |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
air... | what is the latest flight on wednesday going from ATLANTA to WASHINGTON | 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 = 'WASHINGTON' AND date_day.day_number = 23 AND date_day.month_number = 4 A... | atis |
CREATE TABLE table_658 (
"Department" text,
"Acronym" text,
"Office" text,
"Incumbent" text,
"in Office since" text
) | what's the acronym with department being department of finance kagawaran ng pananalapi | SELECT "Acronym" FROM table_658 WHERE "Department" = 'Department of Finance Kagawaran ng Pananalapi' | wikisql |
CREATE TABLE event (
Event_ID int,
Date text,
Venue text,
Name text,
Event_Attendance int
)
CREATE TABLE journalist (
journalist_ID int,
Name text,
Nationality text,
Age text,
Years_working int
)
CREATE TABLE news_report (
journalist_ID int,
Event_ID int,
Work_Type ... | Visualize the average experience working length of journalists working on different role type using a pie chart. | SELECT Work_Type, AVG(Years_working) FROM journalist AS t1 JOIN news_report AS t2 ON t1.journalist_ID = t2.journalist_ID GROUP BY t2.Work_Type | nvbench |
CREATE TABLE table_name_23 (
semifinalists VARCHAR,
finalist VARCHAR
) | Which Semifinalists has a Finalist of andre agassi? | SELECT semifinalists FROM table_name_23 WHERE finalist = "andre agassi" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | What is the date of birth and language of Kurt Buczek? | SELECT demographic.dob, demographic.language FROM demographic WHERE demographic.name = "Kurt Buczek" | mimicsql_data |
CREATE TABLE table_name_16 (
name VARCHAR,
rank VARCHAR,
last VARCHAR
) | Who had a rank more than 48, and a last in 2005? | SELECT name FROM table_name_16 WHERE rank > 48 AND last = 2005 | sql_create_context |
CREATE TABLE table_22669044_9 (
high_points VARCHAR,
record VARCHAR
) | Name the high points 31-27 | SELECT high_points FROM table_22669044_9 WHERE record = "31-27" | sql_create_context |
CREATE TABLE table_76691 (
"Date" text,
"Time" text,
"Opponent" text,
"Score" text,
"Site" text,
"City" text
) | Which Score has a Time of 5:00pm? | SELECT "Score" FROM table_76691 WHERE "Time" = '5:00pm' | wikisql |
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 zzmzjzjlb (
HXPLC number,
HZX... | 08年11月4日到16年2月25日,科室07063的门诊诊疗量 | SELECT COUNT(*) FROM zzmzjzjlb WHERE zzmzjzjlb.JZKSBM = '07063' AND zzmzjzjlb.JZKSRQ BETWEEN '2008-11-04' AND '2016-02-25' UNION SELECT COUNT(*) FROM fzzmzjzjlb WHERE fzzmzjzjlb.JZKSBM = '07063' AND fzzmzjzjlb.JZKSRQ BETWEEN '2008-11-04' AND '2016-02-25' | css |
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... | 哪个科室出具的检验报告单49398353012其科室编码以及名称都是啥? | SELECT zyjybgb.JYKSBM, zyjybgb.JYKSMC FROM zyjybgb WHERE zyjybgb.BGDH = '49398353012' UNION SELECT mzjybgb.JYKSBM, mzjybgb.JYKSMC FROM mzjybgb WHERE mzjybgb.BGDH = '49398353012' | css |
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
characteristic_data_type text,
characteristic_name text,
other_characteristic_details text
)
CREATE TABLE product_characteristics (
product_id number,
characteristic_id number,
product_characteristic... | How many distinct characteristic names does the product 'cumin' have? | SELECT COUNT(DISTINCT t3.characteristic_name) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "sesame" | 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,... | 患者患有酒精依赖综合征的人数一共有多少人? | SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE IN_DIAG_DIS_NM = '酒精依赖综合征' | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE 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 procedure icd9 code and procedure long title of subject id 813? | SELECT procedures.icd9_code, procedures.long_title FROM procedures WHERE procedures.subject_id = "813" | mimicsql_data |
CREATE TABLE table_40751 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which Bronze has a Rank of 9? | SELECT COUNT("Bronze") FROM table_40751 WHERE "Rank" = '9' | wikisql |
CREATE TABLE table_name_95 (
year VARCHAR,
result VARCHAR,
extra VARCHAR,
tournament VARCHAR
) | In which year was the Tournament of european indoor championships played where the Extra was 800 m and the Result was 2nd? | SELECT year FROM table_name_95 WHERE extra = "800 m" AND tournament = "european indoor championships" AND result = "2nd" | sql_create_context |
CREATE TABLE table_name_63 (
driver VARCHAR,
grid VARCHAR
) | Which driver had a grid of 2? | SELECT driver FROM table_name_63 WHERE grid = 2 | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Suggested edits with review time. | SELECT pt.Name, p.Id AS "post_link", 'site://suggested-edits/' + CAST(se.Id AS TEXT) AS "Suggested edit", ROUND(CAST((JULIANDAY(COALESCE(ApprovalDate, RejectionDate)) - JULIANDAY(se.CreationDate)) * 86400.0 AS INT) / 86400., 2) AS "Review time (days)" FROM SuggestedEdits AS se INNER JOIN Posts AS p ON se.PostId = p.Id ... | sede |
CREATE TABLE table_40917 (
"Title" text,
"Director" text,
"Producer" text,
"Production Cost" text,
"Singapore Gross" text
) | Who was the producer for the film directed by 1997? | SELECT "Producer" FROM table_40917 WHERE "Director" = '1997' | wikisql |
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... | provide the number of patients who have angioedema primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ANGIOEDEMA" | mimicsql_data |
CREATE TABLE table_63490 (
"Rank" real,
"Peak" text,
"Country" text,
"Island" text,
"Elevation (m)" real,
"Col (m)" real
) | What is the rank when the elevation is 1,628, and Col (m) is larger than 0? | SELECT COUNT("Rank") FROM table_63490 WHERE "Elevation (m)" = '1,628' AND "Col (m)" > '0' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Number of questions by country. | SELECT COUNT(*) FROM Posts WHERE OwnerUserId IN (SELECT Id FROM Users WHERE NOT Location IS NULL) | sede |
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 demographic (
subject_id text,
hadm_id t... | Provide the number of patients who had other closed [endoscopic] biopsy of biliary duct or sphincter of oddi and were born before 2060. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2060" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi" | mimicsql_data |
CREATE TABLE table_22409 (
"Episode" text,
"Garfield Episode 1" text,
"U.S. Acres Episode" text,
"Garfield Episode 2" text,
"Original Airdate" text
) | What is the name of episode 2 for garfield when episode 1 is 'suburban jungle'? | SELECT "Garfield Episode 2" FROM table_22409 WHERE "Garfield Episode 1" = 'Suburban Jungle' | wikisql |
CREATE TABLE table_name_40 (
cargo VARCHAR,
ship_size VARCHAR
) | What cargo was contained in a ship size of aframax? | SELECT cargo FROM table_name_40 WHERE ship_size = "aframax" | sql_create_context |
CREATE TABLE Patient (
SSN INTEGER,
Name VARCHAR(30),
Address VARCHAR(30),
Phone VARCHAR(30),
InsuranceID INTEGER,
PCP INTEGER
)
CREATE TABLE Block (
BlockFloor INTEGER,
BlockCode INTEGER
)
CREATE TABLE Medication (
Code INTEGER,
Name VARCHAR(30),
Brand VARCHAR(30),
Des... | Return the name of each physician and the number of patients he or she treats by a pie chart. | SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID | nvbench |
CREATE TABLE table_54784 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"College" text
) | Name the team for pick more than 30 and position of c with round more than 4 | SELECT "Team" FROM table_54784 WHERE "Pick" > '30' AND "Position" = 'c' AND "Round" > '4' | wikisql |
CREATE TABLE table_name_18 (
frequency VARCHAR,
on_air_id VARCHAR
) | Name the frequency with on-air ID of 1way fm | SELECT frequency FROM table_name_18 WHERE on_air_id = "1way fm" | sql_create_context |
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 prescriptions (
subject_id text,
hadm_id... | count the number of patients whose admission year is less than 2167 and lab test name is reticulocyte count, automated? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2167" AND lab.label = "Reticulocyte Count, Automated" | mimicsql_data |
CREATE TABLE table_30064 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | What is the name of the episode that had 2.02 million u.s. viewers? | SELECT "Title" FROM table_30064 WHERE "U.S. viewers (million)" = '2.02' | wikisql |
CREATE TABLE table_1065 (
"Pos" real,
"Member Association" text,
"Points (total 500)" real,
"Clubs" real,
"Group stage" real,
"Play-off" real,
"AFC Cup" real
) | How many times has the points total for the afc cup competion been 289? | SELECT COUNT("AFC Cup") FROM table_1065 WHERE "Points (total 500)" = '289' | wikisql |
CREATE TABLE table_29090 (
"Round #" text,
"Home Team" text,
"Win/Loss" text,
"Score" text,
"Opposition" text,
"Location" text
) | What was the score when the opposition was West Coast in Wanganui? | SELECT "Score" FROM table_29090 WHERE "Opposition" = 'West Coast' AND "Location" = 'Wanganui' | wikisql |
CREATE TABLE table_name_26 (
date VARCHAR,
attendance VARCHAR
) | When was the game that had 58,025 people in attendance? | SELECT date FROM table_name_26 WHERE attendance = "58,025" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
... | All questions with exactly two specified tags and no accepted answer. | SELECT Id AS "post_link", CreationDate, Score, Tags FROM Posts WHERE Tags IN ('<' + '##tag1:string##' + '><' + '##tag2:string##' + '>', '<' + '##tag2:string##' + '><' + '##tag1:string##' + '>') AND AcceptedAnswerId IS NULL ORDER BY CreationDate DESC | sede |
CREATE TABLE table_5328 (
"Season" text,
"Level" real,
"Position" text,
"Nationality" text,
"Apps" real,
"Goals" real
) | What is the Position of the Level 3 winner from Saint Kitts and Nevis? | SELECT "Position" FROM table_5328 WHERE "Level" = '3' AND "Nationality" = 'saint kitts and nevis' | wikisql |
CREATE TABLE table_66240 (
"Peak" text,
"Country" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Col (m)" real
) | Which country has a Col (m) of 1374? | SELECT "Country" FROM table_66240 WHERE "Col (m)" = '1374' | wikisql |
CREATE TABLE table_name_38 (
total VARCHAR,
silver INTEGER
) | How much Total has a Silver smaller than 0? | SELECT COUNT(total) FROM table_name_38 WHERE silver < 0 | sql_create_context |
CREATE TABLE ftxmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZD... | 以前苗静姝患者有过什么异常情况吗? | SELECT * FROM person_info JOIN hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jy... | css |
CREATE TABLE table_name_48 (
date VARCHAR,
tie_no VARCHAR
) | What date has 11 as the tie no.? | SELECT date FROM table_name_48 WHERE tie_no = "11" | sql_create_context |
CREATE TABLE table_name_12 (
attendance VARCHAR,
result VARCHAR
) | I want the attendance which has a result of l 49 21 | SELECT attendance FROM table_name_12 WHERE result = "l 49–21" | sql_create_context |
CREATE TABLE table_1226250_1 (
prothrombin_time VARCHAR,
condition VARCHAR
) | How in prothrombin affected by glanzmann's thrombasthenia. | SELECT prothrombin_time FROM table_1226250_1 WHERE condition = "Glanzmann's thrombasthenia" | sql_create_context |
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... | 编码为53573541的患者的检验报告单对应的检验结果指标均正常的是哪些?列出其检验报告单号都是啥呀? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ... | css |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | calculate the minimum age of male patients who were of black/african american ethnic background. | SELECT MIN(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.ethnicity = "BLACK/AFRICAN AMERICAN" | mimicsql_data |
CREATE TABLE laptimes (
raceid number,
driverid number,
lap number,
position number,
time text,
milliseconds number
)
CREATE TABLE constructorstandings (
constructorstandingsid number,
raceid number,
constructorid number,
points number,
position number,
positiontext text... | What are all the different first names of the drivers who are in position as standing and won? | SELECT DISTINCT T1.forename FROM drivers AS T1 JOIN driverstandings AS T2 ON T1.driverid = T2.driverid WHERE T2.position = 1 AND T2.wins = 1 | spider |
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE class (
class_code text,
crs_code text,
class_section text,
class_time text,
class_room text,
prof_num number
)
... | How many different locations does each school have? | SELECT COUNT(DISTINCT dept_address), school_code FROM department GROUP BY school_code | spider |
CREATE TABLE table_53616 (
"Subframe #" real,
"Page #" text,
"Name" text,
"Word #" real,
"Bits" text,
"Scale" text,
"Signed" text
) | What is URA Index scale? | SELECT "Scale" FROM table_53616 WHERE "Name" = 'ura index' | wikisql |
CREATE TABLE table_24219 (
"Department" text,
"Micro (10ha)" real,
"Small (100ha)" real,
"Medium (500ha)" real,
"Big (>500ha)" real,
"Total" real
) | Which department has a small of 11370? | SELECT "Department" FROM table_24219 WHERE "Small (100ha)" = '11370' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose diagnoses long title is chronic obstructive asthma, unspecified and lab test category is hematology? | 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 = "Chronic obstructive asthma, unspecified" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE market (
Mar... | A line chart for what are the number of the years of film market estimation for the market of Japan, ordered by year descending? | SELECT Year, COUNT(Year) FROM film_market_estimation AS T1 JOIN market AS T2 ON T1.Market_ID = T2.Market_ID WHERE T2.Country = "Japan" ORDER BY T1.Year DESC | nvbench |
CREATE TABLE table_6491 (
"Source" text,
"Date" text,
"GERB" text,
"Attack" text,
"Blue Coalition" text
) | What GERB has an 11% Attack? | SELECT "GERB" FROM table_6491 WHERE "Attack" = '11%' | wikisql |
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... | Calculate the average duration of hospital stay of the patients who had COPD exacerbation as their primary disease | SELECT AVG(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "COPD EXACERBATION" | mimicsql_data |
CREATE TABLE table_18491 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | Name the minumim first elected for alvin bush | SELECT MIN("First elected") FROM table_18491 WHERE "Incumbent" = 'Alvin Bush' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Most Number of Famous Questions. | SELECT 'https://stackoverflow.com/questions/' + CAST(questions.Id AS TEXT), questions.Score, questions.ViewCount FROM Posts AS questions JOIN Posts AS answers ON answers.ParentId = questions.Id JOIN Users AS u ON u.Id = answers.OwnerUserId WHERE u.Id = 575376 AND questions.PostTypeId = 1 AND (questions.ViewCount > 3000... | sede |
CREATE TABLE table_name_61 (
frequency__khz_ INTEGER,
licensed_location VARCHAR
) | What is the smallest frequency (kHz) that is in the location of Longview? | SELECT MIN(frequency__khz_) FROM table_name_61 WHERE licensed_location = "longview" | sql_create_context |
CREATE TABLE table_name_16 (
avg INTEGER,
yards VARCHAR,
rec VARCHAR
) | Tell me the lowest avg for 6 yards and rec more than 1 | SELECT MIN(avg) FROM table_name_16 WHERE yards = 6 AND rec > 1 | sql_create_context |
CREATE TABLE table_19945 (
"#" real,
"Season" real,
"Bowl game" text,
"Result" text,
"Opponent" text,
"Stadium" text,
"Location" text,
"Attendance" text
) | What is the stadium where the attendance was 75,406? | SELECT "Stadium" FROM table_19945 WHERE "Attendance" = '75,406' | wikisql |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
ro... | count the numbers of patients who were prescribed latanoprost 0.005% ophth. soln. within 2 months after having been diagnosed with swelling of limb since 2103. | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'swelling of limb')... | mimic_iii |
CREATE TABLE table_24544 (
"Year" real,
"Horse" text,
"Driver" text,
"Trainer" text,
"Country of owner" text,
"Odds of winner" text,
"Winning time (km rate)" text
) | What was the winning time in the year when the odds of the winner were 2.94? | SELECT "Winning time (km rate)" FROM table_24544 WHERE "Odds of winner" = '2.94' | wikisql |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGR... | 编号为25408740的医生从一一年一月二十日到一九年七月十九日的门诊人次是多少 | SELECT COUNT(*) FROM mzjzjlb WHERE mzjzjlb.ZZYSGH = '25408740' AND mzjzjlb.JZKSRQ BETWEEN '2011-01-20' AND '2019-07-19' | css |
CREATE TABLE table_name_17 (
identifier VARCHAR,
power VARCHAR
) | what is the identifier when the power is 22500 watts? | SELECT identifier FROM table_name_17 WHERE power = "22500 watts" | sql_create_context |
CREATE TABLE table_203_676 (
id number,
"pick #" number,
"cfl team" text,
"player" text,
"position" text,
"college" text
) | who was the first player picked in round four ? | SELECT "player" FROM table_203_676 ORDER BY "pick #" LIMIT 1 | squall |
CREATE TABLE table_30771 (
"Episode air date" text,
"Audition city" text,
"Date" text,
"Venue" text,
"Callback date" text,
"Callback venue" text,
"Golden tickets" real
) | How many times is there a golden tickets entry when the callback venue is rcti studio, jakarta? | SELECT COUNT("Golden tickets") FROM table_30771 WHERE "Callback venue" = 'RCTI Studio, Jakarta' | wikisql |
CREATE TABLE table_22384475_1 (
match_date VARCHAR,
winner VARCHAR
) | What date did the West Indies win the match? | SELECT match_date FROM table_22384475_1 WHERE winner = "West Indies" | sql_create_context |
CREATE TABLE table_name_95 (
playing_for VARCHAR,
opponent VARCHAR,
date VARCHAR
) | who is playing for when the opponent is deportes savio and the date is 2010-03-11? | SELECT playing_for FROM table_name_95 WHERE opponent = "deportes savio" AND date = "2010-03-11" | sql_create_context |
CREATE TABLE table_name_4 (
season VARCHAR,
score VARCHAR
) | what season had a score of 1:0 | SELECT season FROM table_name_4 WHERE score = "1:0" | sql_create_context |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CR... | i need a flight leaving PITTSBURGH next monday arriving in FORT WORTH before 1000 | 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 ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.arrival_time <... | atis |
CREATE TABLE table_204_652 (
id number,
"title" text,
"year" number,
"director" text,
"country" text,
"genre" text,
"notes" text
) | how many directors are in the england films ? | SELECT COUNT("director") FROM table_204_652 WHERE "country" = 'england' | squall |
CREATE TABLE table_215 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | What is the report for the race that Mike Spence won. | SELECT "Report" FROM table_215 WHERE "Winning driver" = 'Mike Spence' | wikisql |
CREATE TABLE table_6360 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | What is the lowest game that has a drawn less than 0? | SELECT MIN("Games") FROM table_6360 WHERE "Drawn" < '0' | wikisql |
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
)
... | give me the number of patients who had open and other sigmoidectomy and had psychiatric facility-partial hospitalization discharge. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND procedures.short_title = "Open sigmoidectomy NEC" | mimicsql_data |
CREATE TABLE table_name_80 (
appearance VARCHAR,
polyphenyl_ether VARCHAR
) | What does Polyphenyl Ether of 3- and 4-ring oxythio look like? | SELECT appearance FROM table_name_80 WHERE polyphenyl_ether = "3- and 4-ring oxythio" | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsysto... | list of patient ids of patients who were diagnosed with s/p surgical repair of fracture - femur since 5 years ago. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 's/p surgical repair of fracture - femur' AND DATETIME(diagnosis.diagnosistime) >= DATETIME(CURRENT_TIME(), '-5 year')) | eicu |
CREATE TABLE table_2954 (
"Competition" text,
"Final position" text,
"First match" text,
"Last match" text,
"Final Place" text
) | Name the final place for july 25, 2009 | SELECT "Final Place" FROM table_2954 WHERE "Last match" = 'July 25, 2009' | wikisql |
CREATE TABLE table_51418 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What venue has the away side scoring 6.5 (41)? | SELECT "Venue" FROM table_51418 WHERE "Away team score" = '6.5 (41)' | wikisql |
CREATE TABLE table_name_45 (
home_team VARCHAR,
away_team VARCHAR
) | What home team has coventry city as the away team? | SELECT home_team FROM table_name_45 WHERE away_team = "coventry city" | sql_create_context |
CREATE TABLE table_name_78 (
score VARCHAR,
set_3 VARCHAR
) | What was the score when set 3 was 26-28? | SELECT score FROM table_name_78 WHERE set_3 = "26-28" | sql_create_context |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_c... | nonstop flights DENVER to KANSAS CITY | 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 (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'KANSAS... | atis |
CREATE TABLE table_name_45 (
team_1 VARCHAR,
team_2 VARCHAR
) | What is team 1 when team 2 is Manchester United? | SELECT team_1 FROM table_name_45 WHERE team_2 = "manchester united" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.