context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 参保人尤幼仪门诊检查费是多少,在2020-09-13到2021-01-21期间? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '尤幼仪' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2020-09-13' AND '2021-01-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
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... | what were the top three prescription drugs among patients of age of 30s during this year? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(... | eicu |
CREATE TABLE table_40819 (
"1935" text,
"1936" text,
"1937" text,
"1938" text,
"1939" text,
"1940" text,
"1941" text,
"1943" text,
"1945" text,
"1946" text,
"1947" text,
"1948" text,
"1949" text,
"1950" text,
"1951" text,
"1952" text,
"1953" text
) | What 1941 has N/A as 1945, N/A for 1948, and 9 for 1953? | SELECT "1941" FROM table_40819 WHERE "1945" = 'n/a' AND "1948" = 'n/a' AND "1953" = '9' | wikisql |
CREATE TABLE table_55495 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | Tell me the total number of grid for laps of 52 | SELECT COUNT("Grid") FROM table_55495 WHERE "Laps" = '52' | wikisql |
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),... | For the sale details with amount smaller than 3000, visualize a bar chart that x-axis is the sales details and count them as y, and rank by the y axis from low to high please. | SELECT sales_details, COUNT(sales_details) FROM Sales AS T1 JOIN Transactions AS T2 ON T1.sales_transaction_id = T2.transaction_id WHERE T2.amount_of_transaction < 3000 GROUP BY sales_details ORDER BY COUNT(sales_details) | nvbench |
CREATE TABLE table_25322 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Cowboys points" real,
"Opponents" real,
"Record" text
) | How many opponents were there when the opponent was Arizona State? | SELECT MIN("Opponents") FROM table_25322 WHERE "Opponent" = 'Arizona State' | wikisql |
CREATE TABLE table_name_16 (
title VARCHAR,
name VARCHAR
) | What is the title of ahaziah? | SELECT title FROM table_name_16 WHERE name = "ahaziah" | sql_create_context |
CREATE TABLE table_48093 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Which Opponent has an Event of jungle fight 5? | SELECT "Opponent" FROM table_48093 WHERE "Event" = 'jungle fight 5' | wikisql |
CREATE TABLE Invoice_Line_Items (
order_item_id INTEGER,
invoice_number INTEGER,
product_id INTEGER,
product_title VARCHAR(80),
product_quantity VARCHAR(50),
product_price DECIMAL(19,4),
derived_product_cost DECIMAL(19,4),
derived_vat_payable DECIMAL(19,4),
derived_total_cost DECIMAL... | Show the number of accounts for all accounts by the customer with first name 'Meaghan' opened in each day Bin the account open day by year interval in a bar chart, and list in desc by the date_account_opened. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' ORDER BY date_account_opened DESC | nvbench |
CREATE TABLE table_1976 (
"Number" text,
"Previous Number(s)" real,
"Previous Class" text,
"Converted" real,
"Use" text,
"Withdrawn" real,
"Disposal" text
) | What is every previous class when the previous number is 61323? | SELECT "Previous Class" FROM table_1976 WHERE "Previous Number(s)" = '61323' | 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... | how many black/haitian patients were give the drug meropenem? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/HAITIAN" AND prescriptions.drug = "Meropenem" | mimicsql_data |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD... | 按照其自己的描述医疗就诊04273607781病情怎么样? | SELECT t_kc21.MAIN_COND_DES FROM t_kc21 WHERE t_kc21.MED_CLINIC_ID = '04273607781' | css |
CREATE TABLE table_name_22 (
pick INTEGER,
school_club_team VARCHAR,
round VARCHAR
) | What's the Pick average that has a School/Club Team of Alabama, with a Round that's smaller than 9? | SELECT AVG(pick) FROM table_name_22 WHERE school_club_team = "alabama" AND round < 9 | sql_create_context |
CREATE TABLE table_train_98 (
"id" int,
"mini_mental_state_examination_mmse" int,
"stroke" bool,
"lyperlipidemia_ldl" int,
"allergy_to_milk" bool,
"allergy_to_soy" bool,
"body_mass_index_bmi" float,
"NOUSE" float
) | taking medication for lyperlipidemia ldl > 160 | SELECT * FROM table_train_98 WHERE lyperlipidemia_ldl > 160 | criteria2sql |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
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
)... | what is the minimum hospital cost in which are involved influenza vaccination until 2104? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'influenza vaccination')) AND STRFTIME('%y', cost.chargeti... | mimic_iii |
CREATE TABLE table_17597 (
"Year" real,
"Denomination" text,
"Alloy" text,
"Reverse" text,
"Diameter" text,
"Weight" text,
"Obverse" text,
"Mintage" real,
"Series" text
) | how many reverse with series being iii series | SELECT COUNT("Reverse") FROM table_17597 WHERE "Series" = 'III series' | 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... | 患者83192146在01年8月28日到02年12月20日这段时间内,自付比例低于0.32的药品数量是多少 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '83192146' AND t_kc22.STA_DATE BETWEEN '2001-08-28' AND '2002-12-20' AND t_kc22.SELF_PAY_PRO < 0.32 | css |
CREATE TABLE table_53249 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Who was the winning driver of the Argentine Grand Prix? | SELECT "Winning driver" FROM table_53249 WHERE "Race" = 'argentine grand prix' | wikisql |
CREATE TABLE table_name_72 (
dates_administered VARCHAR,
lead_margin VARCHAR,
poll_source VARCHAR
) | What were the dates administered when the lead margin was larger than 14 and the poll source was Research 2000? | SELECT dates_administered FROM table_name_72 WHERE lead_margin > 14 AND poll_source = "research 2000" | sql_create_context |
CREATE TABLE txmzjzjlb (
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,
MZZYZDZ... | 患者吕博涉的胸腹水白蛋白(白蛋白)什么情况在14年9月30日到20年8月11日期间 | 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 PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Na... | Negative scored questions percentage per year. | SELECT SUM(CASE WHEN Score < 0 THEN 1 ELSE 0 END) * 100 / COUNT(*) AS percentage, COUNT(*) AS total, SUM(CASE WHEN Score < 0 THEN 1 ELSE 0 END) AS negatice_count FROM Posts WHERE YEAR(CreationDate) = @year AND PostTypeId = 1 | sede |
CREATE TABLE table_65792 (
"Rank" real,
"Summit" text,
"Country" text,
"Island" text,
"Col (m)" real
) | What's the summit when the rank is less than 2 and has a col (m) of 0? | SELECT "Summit" FROM table_65792 WHERE "Col (m)" = '0' AND "Rank" < '2' | wikisql |
CREATE TABLE table_203_239 (
id number,
"year" number,
"title" text,
"chinese title" text,
"role" text,
"notes" text
) | how many films are listed in this filmography ? | SELECT COUNT("title") FROM table_203_239 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | report the number of dead patients who had levofloxacin prescription. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "1" AND prescriptions.drug = "Levofloxacin" | 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... | what is age and discharge location of subject id 2560? | SELECT demographic.age, demographic.discharge_location FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_61648 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | WHAT IS THE TOURNAMENT WITH 2008 AND 2011 WITH A? | SELECT "Tournament" FROM table_61648 WHERE "2008" = 'a' AND "2011" = 'a' | wikisql |
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 cheapest round trip flight from ATLANTA to PITTSBURGH | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1... | atis |
CREATE TABLE table_23346 (
"Rank" real,
"City" text,
"1890 census" text,
"1910 census" real,
"1920 census" real,
"1930 census" real,
"1940 census" real
) | For cities with a census of 296000 in 1940, what was their census in 1920? | SELECT "1920 census" FROM table_23346 WHERE "1940 census" = '296000' | 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... | how many patients with atrial fibrillation\thoracoscopic maze procedure bilateral/sda were admitted before the year 2190? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" AND demographic.admityear < "2190" | mimicsql_data |
CREATE TABLE table_72578 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | Name the college/junior/club team for left wing | SELECT "College/junior/club team" FROM table_72578 WHERE "Position" = 'Left Wing' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTyp... | number of posts per month by tagname. | SELECT COUNT(Posts.Id), MONTH(Posts.CreationDate), YEAR(Posts.CreationDate), Tags.TagName FROM Posts JOIN PostTags ON Posts.Id = PostTags.PostId JOIN Tags ON Tags.Id = PostTags.TagId WHERE Tags.TagName = 'office-js' GROUP BY YEAR(Posts.CreationDate), MONTH(Posts.CreationDate), Tags.TagName | sede |
CREATE TABLE table_203_844 (
id number,
"res." text,
"record" text,
"opponent" text,
"method" text,
"event" text,
"date" text,
"round" number,
"time" text,
"location" text,
"notes" text
) | who was the first opponent he lost too ? | SELECT "opponent" FROM table_203_844 WHERE "res." = 'loss' ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_name_9 (
points INTEGER,
place VARCHAR,
position VARCHAR
) | Who had the smallest points in 3rd place but had a position greater than 8? | SELECT MIN(points) FROM table_name_9 WHERE place = "3rd" AND position > 8 | sql_create_context |
CREATE TABLE table_5010 (
"Player" text,
"Touchdowns" real,
"Extra points" real,
"Field goals" real,
"Points" real
) | How many touchdowns were made where field goals were less than 0? | SELECT SUM("Touchdowns") FROM table_5010 WHERE "Field goals" < '0' | wikisql |
CREATE TABLE table_37969 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
) | What was the date of the game with a save of ||3,073? | SELECT "Date" FROM table_37969 WHERE "Save" = '||3,073' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 医疗就诊73259917842中药品0958的医疗机构三大目录编码及名称分别是什么? | SELECT MED_DIRE_CD, MED_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '73259917842' AND SOC_SRT_DIRE_CD = '0958' | css |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | does patient 50065 have the result of his or her microbiology test since 2101? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 50065) AND STRFTIME('%y', microbiologyevents.charttime) >= '2101' | mimic_iii |
CREATE TABLE table_24399615_4 (
airdate VARCHAR,
bbc_three_weekly_ranking VARCHAR
) | What date did the episode air that had n/a for it's bbc three weekly ranking? | SELECT airdate FROM table_24399615_4 WHERE bbc_three_weekly_ranking = "N/A" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | A scatter chart shows the correlation between ACC_Percent and All_Games_Percent , and group by attribute All_Home. | SELECT ACC_Percent, All_Games_Percent FROM basketball_match GROUP BY All_Home | nvbench |
CREATE TABLE city (
city_id number,
county_id number,
name text,
white number,
black number,
amerindian number,
asian number,
multiracial number,
hispanic number
)
CREATE TABLE county_public_safety (
county_id number,
name text,
population number,
police_officers num... | What are the minimum and maximum crime rate of counties? | SELECT MIN(crime_rate), MAX(crime_rate) FROM county_public_safety | spider |
CREATE TABLE table_46939 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is Gold, when Rank is 7? | SELECT "Gold" FROM table_46939 WHERE "Rank" = '7' | wikisql |
CREATE TABLE table_42599 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Director(s)" text,
"Result" text
) | What is the year of the ceremony with the original title ni iji sin? | SELECT "Year (Ceremony)" FROM table_42599 WHERE "Original title" = 'ničiji sin' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)... | when did patient 022-142620 receive an intake for the first time on 04/30/last year? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-142620')) AND intakeoutput.cellpath LIKE '%intake... | eicu |
CREATE TABLE table_28909 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Which district did William A. Burwell (Dr) belong to? | SELECT "District" FROM table_28909 WHERE "Candidates" = 'William A. Burwell (DR)' | wikisql |
CREATE TABLE table_name_8 (
pick__number VARCHAR,
name VARCHAR
) | What is Aundray Bruce's Pick #? | SELECT pick__number FROM table_name_8 WHERE name = "aundray bruce" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidan... | Answers and the questions they go to. For a given user, show the answers and also show a link to the corresponding question and display its title.
Optionally limit to a date range.
Sort by date. | SELECT Body, ParentId, Id, CreationDate FROM Posts WHERE Posts.OwnerUserId = @UserId AND Posts.PostTypeId = 2 AND CreationDate BETWEEN @Start AND @Finish ORDER BY CreationDate | sede |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | give me the number of patients whose year of birth is less than 2090 and lab test fluid is cerebrospinal fluid (csf)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2090" AND lab.fluid = "Cerebrospinal Fluid (CSF)" | mimicsql_data |
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 TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,... | is there ground transportation in DFW from the DFW airport to downtown DALLAS | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'DALLAS' AND ground_service.airpor... | atis |
CREATE TABLE table_52929 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did Essendon score when they were the away team? | SELECT "Away team score" FROM table_52929 WHERE "Away team" = 'essendon' | wikisql |
CREATE TABLE table_46202 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" real
) | What is the lowest Total, when Year(s) Won is '1968 , 1971', and when To Par is less than 11? | SELECT MIN("Total") FROM table_46202 WHERE "Year(s) won" = '1968 , 1971' AND "To par" < '11' | wikisql |
CREATE TABLE table (
r INTEGER,
player VARCHAR,
Marcelo VARCHAR
) | If the player is Marcelo, what is the minimum R? | SELECT MIN(r) FROM table WHERE player = Marcelo | sql_create_context |
CREATE TABLE table_64158 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text,
"Points" text
) | What is the lowest year that has hypo-meeting as the tournament, with 8002 as the points? | SELECT MIN("Year") FROM table_64158 WHERE "Tournament" = 'hypo-meeting' AND "Points" = '8002' | wikisql |
CREATE TABLE table_47233 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School" text
) | In what Round was Derrick Franklin picked? | SELECT "Round" FROM table_47233 WHERE "Player" = 'derrick franklin' | wikisql |
CREATE TABLE table_203_321 (
id number,
"sheriff" text,
"start of term" number
) | did robert petty serve before josiah reeve ? | SELECT (SELECT "start of term" FROM table_203_321 WHERE "sheriff" = 'robert petty') < (SELECT "start of term" FROM table_203_321 WHERE "sheriff" = 'josiah reeve') | squall |
CREATE TABLE table_22258 (
"#" real,
"Cover Date" text,
"Story Title" text,
"Writer/s" text,
"Artist/s" text,
"Letterer/s" text,
"Colourist/s" text,
"Editor/s" text,
"Comments" text
) | What is the comment on the issue dated 14 March 1987? | SELECT "Comments" FROM table_22258 WHERE "Cover Date" = '14 March 1987' | wikisql |
CREATE TABLE room (
roomnumber number,
roomtype text,
blockfloor number,
blockcode number,
unavailable boolean
)
CREATE TABLE appointment (
appointmentid number,
patient number,
prepnurse number,
physician number,
start time,
end time,
examinationroom text
)
CREATE TABL... | Find the number of rooms located on each block floor. | SELECT COUNT(*), T1.blockfloor FROM block AS T1 JOIN room AS T2 ON T1.blockfloor = T2.blockfloor AND T1.blockcode = T2.blockcode GROUP BY T1.blockfloor | spider |
CREATE TABLE table_39436 (
"Rank" real,
"Name" text,
"Nationality" text,
"1st (m)" real,
"2nd (m)" real,
"Points" real,
"Overall NT points" text,
"Overall WC points (Rank)" text
) | What are the most points for Thomas Morgenstern with a distance less than 123.5 in 2nd and rank over 4? | SELECT MAX("Points") FROM table_39436 WHERE "2nd (m)" < '123.5' AND "Name" = 'thomas morgenstern' AND "Rank" > '4' | 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... | tell me the number of widow patients for whom total cholesterol lab test was ordered. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.label = "Cholesterol, Total" | mimicsql_data |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | 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, visualize a line chart about the change of manager_id over hire_date , list from low to high by the X. | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_54288 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | How many attended on may 6? | SELECT COUNT("Attendance") FROM table_54288 WHERE "Date" = 'may 6' | wikisql |
CREATE TABLE table_name_13 (
gold INTEGER,
bronze VARCHAR,
nation VARCHAR
) | What's the gold medal count for Total Nation with a bronze count more than 0 and a total less than 54? | SELECT MAX(gold) FROM table_name_13 WHERE bronze > 0 AND nation = "total" AND "total" < 54 | sql_create_context |
CREATE TABLE table_name_12 (
position VARCHAR,
player VARCHAR
) | What Position did Aaron Williams play? | SELECT position FROM table_name_12 WHERE player = "aaron williams" | sql_create_context |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE voting_record (
stuid number,
registration_date text,
election_cycle text,
president_vote number,
vice_president_vote number... | For each election cycle, report the number of voting records. | SELECT election_cycle, COUNT(*) FROM voting_record GROUP BY election_cycle | spider |
CREATE TABLE table_2897457_8 (
pick__number VARCHAR,
nhl_team VARCHAR
) | What pick number did the New York Rangers have? | SELECT pick__number FROM table_2897457_8 WHERE nhl_team = "New York Rangers" | sql_create_context |
CREATE TABLE table_56084 (
"Character" text,
"Position" text,
"Actor" text,
"First Episode" text,
"Final Episode" text,
"Episodes Credited" real
) | What was the position of Frank Tripp? | SELECT "Position" FROM table_56084 WHERE "Character" = 'frank tripp' | wikisql |
CREATE TABLE table_8520 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Grizzlies" text,
"School/Club Team" text
) | What position does Wayne Ellington play? | SELECT "Position" FROM table_8520 WHERE "Player" = 'wayne ellington' | wikisql |
CREATE TABLE table_25271777_1 (
violent VARCHAR,
index VARCHAR
) | How many violent crimes occurred the year that the index was 191037? | SELECT violent FROM table_25271777_1 WHERE index = 191037 | sql_create_context |
CREATE TABLE table_2781227_7 (
college_junior_club_team VARCHAR,
player VARCHAR
) | What college team did Ryan Golden come from? | SELECT college_junior_club_team FROM table_2781227_7 WHERE player = "Ryan Golden" | sql_create_context |
CREATE TABLE Flight (
origin VARCHAR
) | Show all origins and the number of flights from each origin. | SELECT origin, COUNT(*) FROM Flight GROUP BY origin | sql_create_context |
CREATE TABLE table_15796072_1 (
original_artist VARCHAR,
theme VARCHAR
) | Who was the original artist when the theme was 1980s? | SELECT original_artist FROM table_15796072_1 WHERE theme = "1980s" | sql_create_context |
CREATE TABLE table_36532 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | On June 12 what score had an attendance larger than 43,191? | SELECT "Score" FROM table_36532 WHERE "Attendance" > '43,191' AND "Date" = 'june 12' | wikisql |
CREATE TABLE table_name_46 (
constructor VARCHAR,
grid VARCHAR,
time_retired VARCHAR
) | Which Constructor has a Grid larger than 8, and a Time/Retired of +1:17.124? | SELECT constructor FROM table_name_46 WHERE grid > 8 AND time_retired = "+1:17.124" | sql_create_context |
CREATE TABLE table_23647 (
"Standard Yarn Weight System" text,
"Yarn Type (US)" text,
"Ply (UK, NZ, AU)" text,
"m/100g" text,
"Wraps Per Inch (WPI)" text
) | Name the standard yarn weight system for 7 wpi | SELECT "Standard Yarn Weight System" FROM table_23647 WHERE "Wraps Per Inch (WPI)" = '7 wpi' | wikisql |
CREATE TABLE table_name_87 (
pick__number INTEGER,
position VARCHAR
) | What is the total number of picks for the position of OL? | SELECT SUM(pick__number) FROM table_name_87 WHERE position = "ol" | sql_create_context |
CREATE TABLE party (
Party_ID int,
Year real,
Party text,
Governor text,
Lieutenant_Governor text,
Comptroller text,
Attorney_General text,
US_Senate text
)
CREATE TABLE county (
County_Id int,
County_name text,
Population real,
Zip_code text
)
CREATE TABLE election (
... | Find the parties associated with the delegates from district 1. Who served as governors of the parties, and count them by a pie chart | SELECT Governor, COUNT(Governor) FROM election AS T1 JOIN party AS T2 ON T1.Party = T2.Party_ID WHERE T1.District = 1 GROUP BY Governor | nvbench |
CREATE TABLE 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 prescriptions... | give me the number of patients whose diagnoses short title is perinat gi sys dis nec and lab test abnormal status is delta? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Perinat GI sys dis NEC" AND lab.flag = "delta" | mimicsql_data |
CREATE TABLE table_name_66 (
record VARCHAR,
score VARCHAR
) | What was the record at the game when the score was 1 0? | SELECT record FROM table_name_66 WHERE score = "1–0" | sql_create_context |
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
Region_name text
)
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_cit... | For all storms with at least 1 death, compare the number of deaths by name with a bar graph. | SELECT Name, Number_Deaths FROM storm WHERE Number_Deaths >= 1 | nvbench |
CREATE TABLE table_80408 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the date of the game after week 5 against the Houston Oilers? | SELECT "Date" FROM table_80408 WHERE "Week" > '5' AND "Opponent" = 'houston oilers' | wikisql |
CREATE TABLE table_15843 (
"State/territory" text,
"Text/background colour" text,
"Format" text,
"Current slogan" text,
"Current series" text,
"Notes" text
) | What is the format for South Australia? | SELECT "Format" FROM table_15843 WHERE "State/territory" = 'South Australia' | wikisql |
CREATE TABLE table_38538 (
"Station Code" text,
"Station" text,
"Arrival" text,
"Departure" text,
"Kilometers" real
) | What is the sum of Kilometers that has a Station Code of KGQ? | SELECT COUNT("Kilometers") FROM table_38538 WHERE "Station Code" = 'kgq' | wikisql |
CREATE TABLE table_name_43 (
winning_team VARCHAR,
date VARCHAR
) | With a Date of 22 July, what is the Winning team? | SELECT winning_team FROM table_name_43 WHERE date = "22 july" | sql_create_context |
CREATE TABLE table_50813 (
"Edition" text,
"Round" text,
"Date" text,
"Against" text,
"Surface" text,
"Opponent" text,
"Result" text
) | what is the date when the surface is clay and the result is 6 7 (4 7) , 1 6? | SELECT "Date" FROM table_50813 WHERE "Surface" = 'clay' AND "Result" = '6–7 (4–7) , 1–6' | wikisql |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar... | Are there classes on Friday for when Prof. Leon Gmeindl teaches 829 ? | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.number = 829 AND c... | advising |
CREATE TABLE table_204_311 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | who came after south korea with the most gold medals won ? | SELECT "nation" FROM table_204_311 WHERE "gold" < (SELECT "gold" FROM table_204_311 WHERE "nation" = 'south korea') ORDER BY "gold" DESC LIMIT 1 | squall |
CREATE TABLE table_32662 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | What was the Jets week 17 attendance? | SELECT "Attendance" FROM table_32662 WHERE "Week" = '17' | wikisql |
CREATE TABLE table_name_89 (
method VARCHAR,
round VARCHAR,
record VARCHAR
) | Which method was used in round 1 with a record of 1-0? | SELECT method FROM table_name_89 WHERE round = 1 AND record = "1-0" | sql_create_context |
CREATE TABLE table_11205 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When did an away team score 8.6 (54)? | SELECT "Date" FROM table_11205 WHERE "Away team score" = '8.6 (54)' | 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... | give me the number of patients whose primary disease is sigmoid diverticulitis, colovestical fistula/sda and age is less than 71? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" AND demographic.age < "71" | mimicsql_data |
CREATE TABLE table_204_526 (
id number,
"name" text,
"#" number,
"position" text,
"height" text,
"weight" number,
"year" text,
"home town" text,
"high school" text
) | total number of players whose home town was in north carolina -lrb- nc -rrb- | SELECT COUNT("name") FROM table_204_526 WHERE "home town" = 'nc' | squall |
CREATE TABLE table_name_13 (
score INTEGER,
place VARCHAR,
player VARCHAR
) | What is Sum of Score, when Place is T2, and when Player is Justin Leonard? | SELECT SUM(score) FROM table_name_13 WHERE place = "t2" AND player = "justin leonard" | sql_create_context |
CREATE TABLE job_history (
job_id VARCHAR,
end_date VARCHAR,
start_date VARCHAR
) | display job ID for those jobs that were done by two or more for more than 300 days. | SELECT job_id FROM job_history WHERE end_date - start_date > 300 GROUP BY job_id HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE Things (
thing_id INTEGER,
organization_id INTEGER,
Type_of_Thing_Code CHAR(15),
service_type_code CHAR(10),
service_details VARCHAR(255)
)
CREATE TABLE Organizations (
organization_id INTEGER,
parent_organization_id INTEGER,
organization_details VARCHAR(255)
)
CREATE TABL... | Just list the resident id and details in a bar chart, and rank in ascending by the resident_id. | SELECT other_details, resident_id FROM Residents ORDER BY resident_id | nvbench |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit ... | did patient 12797 have any surgery until 2102? | SELECT COUNT(*) > 0 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12797) AND STRFTIME('%y', procedures_icd.charttime) <= '2102' | mimic_iii |
CREATE TABLE faculty (
campus number,
year number,
faculty number
)
CREATE TABLE campuses (
id number,
campus text,
location text,
county text,
year number
)
CREATE TABLE enrollments (
campus number,
year number,
totalenrollment_ay number,
fte_ay number
)
CREATE TABLE ... | How many undergraduates are there at San Jose State | SELECT SUM(t1.undergraduate) FROM discipline_enrollments AS t1 JOIN campuses AS t2 ON t1.campus = t2.id WHERE t1.year = 2004 AND t2.campus = "San Jose State University" | spider |
CREATE TABLE table_203_791 (
id number,
"represented" text,
"contestant" text,
"age" number,
"height" text,
"hometown" text
) | the number of delegates in competition | SELECT COUNT("contestant") FROM table_203_791 | squall |
CREATE TABLE table_58784 (
"Rank" text,
"Name" text,
"Height metres / ft" text,
"Floors" text,
"Year" real
) | What ranking is the Battersea Power Station? | SELECT "Rank" FROM table_58784 WHERE "Name" = 'battersea power station' | wikisql |
CREATE TABLE table_name_41 (
position VARCHAR,
year VARCHAR,
event VARCHAR,
competition VARCHAR
) | What was the position for mauro at the world championships in 1985 during the foil individual event? | SELECT position FROM table_name_41 WHERE event = "foil individual" AND competition = "world championships" AND year = 1985 | sql_create_context |
CREATE TABLE table_28668784_1 (
stadium VARCHAR,
home_team VARCHAR
) | What stadium does FK Rudar play in? | SELECT stadium FROM table_28668784_1 WHERE home_team = "FK Rudar" | sql_create_context |
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | tell me the average arterial bp [systolic] for patient 18677's body on 05/05/2102? | SELECT AVG(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18677)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.