context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_85 (
year INTEGER,
points INTEGER
) | What was the earliest year that had less than 1 point? | SELECT MIN(year) FROM table_name_85 WHERE points < 1 | sql_create_context |
CREATE TABLE table_40052 (
"Year" real,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | Which Division has a Year larger than 1996,a Regular Season of 4th, and a Playoffs of final? | SELECT "Division" FROM table_40052 WHERE "Year" > '1996' AND "Regular Season" = '4th' AND "Playoffs" = 'final' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined b... | Favorites that you haven't posted in. | SELECT Votes.PostId AS "post_link", Votes.CreationDate, COUNT(*) AS "AnswerNo" FROM Votes AS votes JOIN Posts AS questions ON Votes.PostId = questions.Id JOIN Posts AS answers ON Votes.PostId = answers.ParentId WHERE Votes.VoteTypeId = 5 AND Votes.UserId = '##UserId##' GROUP BY Votes.PostId, Votes.CreationDate HAVING S... | sede |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 编码为53573541的患者的检验报告单对应的检验结果指标均正常的是哪些?列出其检验报告单号都是啥呀? | SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND person_info_hz_info.KH = hz_info.KH AND pers... | css |
CREATE TABLE table_7890 (
"Player" text,
"Team" text,
"Matches" real,
"Runs" real,
"Balls" real,
"Strike Rate" real,
"Average" real,
"100s" real
) | Can you tell me the sum of 100s that has the Matches of 12, and the Strike Rate smaller than 144.81? | SELECT SUM("100s") FROM table_7890 WHERE "Matches" = '12' AND "Strike Rate" < '144.81' | wikisql |
CREATE TABLE table_68874 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text
) | Name the start for year less than 1977 | SELECT "Start" FROM table_68874 WHERE "Year" < '1977' | wikisql |
CREATE TABLE table_65850 (
"Year" text,
"Location" text,
"Number of teams" text,
"Player of the tournament" text,
"Top goalscorer(s)" text,
"Best goalkeeper" text
) | How many teams were at the 2007 details tournament where there a top goalscorer was not awarded? | SELECT "Number of teams" FROM table_65850 WHERE "Top goalscorer(s)" = 'not awarded' AND "Year" = '2007 details' | wikisql |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREAT... | did patient 022-76925's sao2 since 27 months ago be greater than 85.0? | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-76925')) AND vitalperiodic.sao2 > 85.0 AND NOT vitalperiodic.sao... | eicu |
CREATE TABLE table_8730 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" text
) | How many rounds was the fight with a decision by submission (punches)? | SELECT "Round" FROM table_8730 WHERE "Method" = 'submission (punches)' | wikisql |
CREATE TABLE table_15820 (
"District" text,
"Counties Represented" text,
"Party" text,
"First Elected" real,
"Committee" text
) | What is the average first elected year that has a district of 11 and a committee of environmental matters? | SELECT AVG("First Elected") FROM table_15820 WHERE "District" = '11' AND "Committee" = 'environmental matters' | wikisql |
CREATE TABLE table_name_93 (
score VARCHAR,
save VARCHAR
) | What score occurred when the save was ||27,108||63 44? | SELECT score FROM table_name_93 WHERE save = "||27,108||63–44" | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
CO... | For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, and order by the X in asc. | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | get me the number of living patients who have ketorolac prescription. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.expire_flag = "0" AND prescriptions.drug = "Ketorolac" | mimicsql_data |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_c... | tell me, what were the five most common procedures until 1 year ago? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY procedur... | mimic_iii |
CREATE TABLE table_8445 (
"Name" text,
"Country" text,
"Role" text,
"Period" text,
"Teams" text
) | Which period has the team CS Sedan? | SELECT "Period" FROM table_8445 WHERE "Teams" = 'cs sedan' | wikisql |
CREATE TABLE table_39052 (
"Unit" text,
"Russian" text,
"Translation" text,
"Ratio" text,
"Cubic inches (exact)" text,
"Metric value" text,
"Imperial" text,
"US Customary" text
) | What Russian word translates to bucket? | SELECT "Russian" FROM table_39052 WHERE "Translation" = 'bucket' | wikisql |
CREATE TABLE table_55012 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | What is the score of set 3 when the total is 45 31? | SELECT "Set 3" FROM table_55012 WHERE "Total" = '45–31' | wikisql |
CREATE TABLE table_14035132_3 (
production_code VARCHAR,
no_in_series VARCHAR
) | What's the production code of the episode with a series number 37b? | SELECT production_code FROM table_14035132_3 WHERE no_in_series = "37b" | sql_create_context |
CREATE TABLE table_name_86 (
time VARCHAR,
name VARCHAR
) | What was Arkady Vyatchanin's time? | SELECT time FROM table_name_86 WHERE name = "arkady vyatchanin" | sql_create_context |
CREATE TABLE pitStops (
raceId INTEGER,
driverId INTEGER,
stop INTEGER,
lap INTEGER,
time TEXT,
duration TEXT,
milliseconds INTEGER
)
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
position INTEGE... | Show the relationship between driver ID and number of races of all drivers who have at least participated in two races in a scatter chart. | SELECT T1.driverId, COUNT(*) FROM drivers AS T1 JOIN results AS T2 ON T1.driverId = T2.driverId JOIN races AS T3 ON T2.raceId = T3.raceId GROUP BY T1.driverId | nvbench |
CREATE TABLE table_name_46 (
winning_score VARCHAR,
tournament VARCHAR,
runner_s__up VARCHAR
) | What is the winning score of standard register ping tournament, which has Kelly Robbins as the runner-up? | SELECT winning_score FROM table_name_46 WHERE tournament = "standard register ping" AND runner_s__up = "kelly robbins" | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
v... | has patient 64538 had any gastric gastric tube event until 03/20/2101? | SELECT COUNT(*) > 0 FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 64538)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'gastric gastri... | mimic_iii |
CREATE TABLE Catalog_Contents (
catalog_entry_name VARCHAR,
capacity VARCHAR,
price_in_dollars INTEGER
) | Find the name and capacity of products with price greater than 700 (in USD). | SELECT catalog_entry_name, capacity FROM Catalog_Contents WHERE price_in_dollars > 700 | sql_create_context |
CREATE TABLE table_name_89 (
elite_eight VARCHAR,
sweet_sixteen VARCHAR,
win__percentage VARCHAR
) | What Elite Eight had a Sweet Sixteen of 1 and a win % of .875? | SELECT elite_eight FROM table_name_89 WHERE sweet_sixteen = "1" AND win__percentage = ".875" | sql_create_context |
CREATE TABLE table_10491 (
"Date" text,
"Competition" text,
"Venue" text,
"Result" text,
"Score" text,
"Goals" text
) | What was the score of the match on 11/2/01? | SELECT "Score" FROM table_10491 WHERE "Date" = '11/2/01' | wikisql |
CREATE TABLE table_name_55 (
race_4 VARCHAR,
race_3 VARCHAR,
race_2 VARCHAR
) | What's the value for race 4 when race 3 is dns and race 2 is 27? | SELECT race_4 FROM table_name_55 WHERE race_3 = "dns" AND race_2 = "27" | 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... | how many of the patients diagnosed with personal history of traumatic fracture have an unspecified death status? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.long_title = "Personal history of traumatic fracture" | mimicsql_data |
CREATE TABLE table_name_25 (
away_team VARCHAR,
venue VARCHAR
) | What was the away team score at Windy Hill? | SELECT away_team AS score FROM table_name_25 WHERE venue = "windy hill" | sql_create_context |
CREATE TABLE table_24248450_3 (
conference VARCHAR
) | What is the tournament called for the Big Sky Conference? | SELECT conference AS Tournament FROM table_24248450_3 WHERE conference = "Big Sky conference" | 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,
... | 在医院5443679的记录中患者王灵秀看病的科室名称内包含喉的全部医疗就诊记录分别有哪些? | SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '王灵秀' AND gwyjzb.MED_SER_ORG_NO = '5443679' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%喉%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '王灵秀' AND fgwyjzb.MED_SER_ORG_NO = '5443679' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%喉%' | css |
CREATE TABLE table_name_25 (
event VARCHAR,
pursuit VARCHAR,
sprint VARCHAR
) | Name the event with pursuit of 18th and sprint of 20th | SELECT event FROM table_name_25 WHERE pursuit = "18th" AND sprint = "20th" | sql_create_context |
CREATE TABLE table_name_30 (
npl_net VARCHAR,
bank VARCHAR
) | Which NPL net's bank was citibank? | SELECT npl_net FROM table_name_30 WHERE bank = "citibank" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number... | when was patient 68641 for the last time leaving the hospital the last year? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 68641 AND DATETIME(admissions.dischtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY admissions.dischtime DESC LIMIT 1 | mimic_iii |
CREATE TABLE table_name_87 (
laps VARCHAR,
grid INTEGER
) | When the Grids is less than 2 what are the total laps? | SELECT COUNT(laps) FROM table_name_87 WHERE grid < 2 | sql_create_context |
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 whose ethnicity is white and primary disease is overdose? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.diagnosis = "OVERDOSE" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepi... | during the last year was glucagon (human recombinant) 1 mg/ml solution for injection prescribed to patient 007-10135? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-10135')) AND medication.drugname = 'glucagon (human recombinant) 1 mg/... | eicu |
CREATE TABLE Contacts (
contact_id INTEGER,
customer_id INTEGER,
gender VARCHAR(1),
first_name VARCHAR(80),
last_name VARCHAR(50),
contact_phone VARCHAR(80)
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_method_code VARCHAR(15),
customer_number VARCHAR(20),
customer_nam... | Show me a bar chart with the product name and their frequency, sort in ascending by the names. | SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY product_name | nvbench |
CREATE TABLE order_items (
order_item_id number,
order_id number,
product_id number,
product_quantity text,
other_order_item_details text
)
CREATE TABLE orders (
order_id number,
customer_id number,
date_order_placed time,
order_details text
)
CREATE TABLE financial_transactions (
... | What is the customer last name, id and phone number with most number of orders? | SELECT T2.customer_last_name, T1.customer_id, T2.phone_number FROM orders AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id GROUP BY T1.customer_id ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_name VARCHAR(50),
other_account_details VARCHAR(255)
)
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHA... | Bar graph to show sum card number from different card type code | SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code | nvbench |
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,... | all flights from WASHINGTON to SAN FRANCISCO after 1700 on 11 12 economy class | 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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((DAT... | atis |
CREATE TABLE table_name_3 (
player VARCHAR,
country VARCHAR
) | Which player is from Sweden? | SELECT player FROM table_name_3 WHERE country = "sweden" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
Owner... | Arqade [minecraft-commands] average score per user reputation. | SELECT AVG(CAST(pp.Score AS FLOAT)) AS Average_Score, SUM(pp.Score) AS Score_Sum, COUNT(pp.REP_BUCKET) AS Post_Count, pp.REP_BUCKET AS Reputation_Bucket FROM (SELECT p.Score, CASE WHEN u.Reputation <= 50 THEN ' 000 - 50' WHEN u.Reputation > 50 AND u.Reputation <= 100 THEN '051 - 100' WHEN u.Reputation > 100 AND u.Reput... | sede |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE intakeoutput (
intakeou... | what were the top four most common drugs that followed within the same month for the patients who were given antiemetic - serotonin antagonist until 3 years ago? | SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'antiemetic - serotonin antagonist' AND DATETIME(tr... | eicu |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | when was patient 010-19726 prescribed 500 ml flex cont : sodium chloride 0.9 % iv soln last until 47 months ago? | 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 = '010-19726')) AND medication.drugname = '500 ml flex cont : sod... | eicu |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | What is the procedure icd9 code and procedure short title of Kenneth Koeller? | SELECT procedures.icd9_code, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Kenneth Koeller" | mimicsql_data |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | Show me a bar chart, that simply displays the last name of the employee and the corresponding department's location id. | SELECT LAST_NAME, LOCATION_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID | nvbench |
CREATE TABLE table_name_59 (
date VARCHAR,
loss VARCHAR
) | Name the date with loss of carman (3-12) | SELECT date FROM table_name_59 WHERE loss = "carman (3-12)" | sql_create_context |
CREATE TABLE train_station (
station_id VARCHAR
)
CREATE TABLE station (
name VARCHAR,
station_id VARCHAR
) | Show the station name and number of trains in each station. | SELECT T2.name, COUNT(*) FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id GROUP BY T1.station_id | sql_create_context |
CREATE TABLE table_59440 (
"Nat." text,
"Name" text,
"Moving to" text,
"Type" text,
"Transfer window" text
) | What is the name when moving to atl tico minero? | SELECT "Name" FROM table_59440 WHERE "Moving to" = 'atlético minero' | wikisql |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE video_games (
gameid number,
gname text,
gtype text
)
CREATE TABLE plays_games (
stuid number,
gameid number,
hours_pla... | What are the types of video games and how many are in each type? | SELECT gtype, COUNT(*) FROM video_games GROUP BY gtype | spider |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | How many patients are less than 86 years old? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "86" | mimicsql_data |
CREATE TABLE table_65755 (
"Competition" text,
"Played" real,
"Spartak" real,
"Draw" real,
"Dynamo" real
) | what is the most draw when the competition is soviet league and dynamo is more than 34? | SELECT MAX("Draw") FROM table_65755 WHERE "Competition" = 'soviet league' AND "Dynamo" > '34' | wikisql |
CREATE TABLE table_19089486_1 (
leagues_entering_this_round VARCHAR,
clubs_involved VARCHAR
) | Name the leagues entering this round for 4 | SELECT leagues_entering_this_round FROM table_19089486_1 WHERE clubs_involved = 4 | sql_create_context |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | what is the gender and procedure short title of subject id 18480? | SELECT demographic.gender, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "18480" | mimicsql_data |
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... | Get questions with particular tags asked by specific user. | SELECT Users.Id, Posts.Id AS "post_link" FROM Users, Posts WHERE Users.Id = Posts.OwnerUserId AND Posts.PostTypeId = 1 AND Posts.Tags LIKE '%##TAG1##%' AND Posts.Tags LIKE '%##TAG2##%' AND NOT Posts.Tags LIKE '%##EXCLUDEDTAG##%' AND Users.Id IN (4154201, 2962624, 3078552, 973122, 1124494, 1360853, 751, 1113715, 3117915... | sede |
CREATE TABLE table_204_724 (
id number,
"outcome" text,
"no." number,
"date" text,
"tournament" text,
"surface" text,
"partner" text,
"opponents in the final" text,
"score in the final" text
) | what is the number of winning outcomes ? | SELECT COUNT(*) FROM table_204_724 WHERE "outcome" = 'winner' | squall |
CREATE TABLE table_name_25 (
date_s__conducted VARCHAR,
lead VARCHAR
) | On what date was the lead 8.6%? | SELECT date_s__conducted FROM table_name_25 WHERE lead = "8.6%" | sql_create_context |
CREATE TABLE table_47301 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high assists when the record was 33 15? | SELECT "High assists" FROM table_47301 WHERE "Record" = '33–15' | wikisql |
CREATE TABLE table_65154 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | Which To par has a Player of momoko ueda? | SELECT "To par" FROM table_65154 WHERE "Player" = 'momoko ueda' | wikisql |
CREATE TABLE table_name_49 (
record VARCHAR,
home VARCHAR,
date VARCHAR
) | Which Record has a Home of Montreal Canadiens and a Date of April 22? | SELECT record FROM table_name_49 WHERE home = "montreal canadiens" AND date = "april 22" | sql_create_context |
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_... | Display a bar chart for how many male and female assistant professors do we have?, I want to display y axis in descending order. | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_14670060_1 (
frequency VARCHAR,
coverage VARCHAR
) | What frequency does Chihuahua Sinaloa Durango cover? | SELECT frequency FROM table_14670060_1 WHERE coverage = "Chihuahua Sinaloa Durango" | sql_create_context |
CREATE TABLE table_name_16 (
reb_avg INTEGER,
games VARCHAR,
rank VARCHAR
) | What is the total of rebound averages with more than 98 games and a rank of 7? | SELECT SUM(reb_avg) FROM table_name_16 WHERE games > 98 AND rank = 7 | sql_create_context |
CREATE TABLE table_name_65 (
date VARCHAR,
location VARCHAR,
tournament VARCHAR
) | What is the date of the Kmart greater greensboro open in North Carolina? | SELECT date FROM table_name_65 WHERE location = "north carolina" AND tournament = "kmart greater greensboro open" | sql_create_context |
CREATE TABLE table_41254 (
"Class" text,
"Quantity" real,
"Manufacturer" text,
"Motor" text,
"Seats" real
) | What is the quantity when the seats number was 16 and the class was kss 1913? | SELECT "Quantity" FROM table_41254 WHERE "Seats" = '16' AND "Class" = 'kss 1913' | wikisql |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate re... | A pie chart shows the proportion of Sex and the sum of Height. | SELECT Sex, SUM(Height) FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_name_98 (
result VARCHAR,
year VARCHAR,
award VARCHAR
) | Name the result in 2010 for bgm cyworld | SELECT result FROM table_name_98 WHERE year = 2010 AND award = "bgm cyworld" | sql_create_context |
CREATE TABLE table_204_362 (
id number,
"episode" number,
"airdate" text,
"game 1" text,
"game 2" text,
"game 3" text,
"viewers" text
) | which episode has the most viewers ? | SELECT "episode" FROM table_204_362 ORDER BY "viewers" DESC LIMIT 1 | squall |
CREATE TABLE table_56678 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | what is the rank when silver is less than 0? | SELECT SUM("Rank") FROM table_56678 WHERE "Silver" < '0' | wikisql |
CREATE TABLE table_204_812 (
id number,
"#" number,
"prime minister" text,
"date of birth" text,
"start date\nof (first) term" text,
"age at beginning\nof (first) term" text,
"end date\nof (final) term" text,
"total time in\noffice" text,
"date of death" text,
"lifespan" text
) | which prime ministers spent more than 1,500 days in the office ? | SELECT "prime minister" FROM table_204_812 WHERE "total time in\noffice" > 1500 | squall |
CREATE TABLE table_name_84 (
ad_freq VARCHAR,
show_name VARCHAR
) | How often are there ads during American Top 40? | SELECT ad_freq FROM table_name_84 WHERE show_name = "american top 40" | sql_create_context |
CREATE TABLE table_14319 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text,
"Race Leader" text
) | Which course had a rest day for the Race Leader? | SELECT "Course" FROM table_14319 WHERE "Race Leader" = 'rest day' | wikisql |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | Return a bar chart about the distribution of Date_of_Birth and Height , and order Y-axis from high to low order. | SELECT Date_of_Birth, Height FROM people ORDER BY Height DESC | nvbench |
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... | specify the admission type for subject id 9271 | SELECT demographic.admission_type FROM demographic WHERE demographic.subject_id = "9271" | mimicsql_data |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 0296260这个医疗机构在2004-01-26到2017-06-26内的总金额和统筹总金额分别怎么样 | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '0296260' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-01-26' AND '2017-06-26' | css |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
... | what were the three most common microbiological tests that followed in the same hospital visit for patients who took inject into thorax cavit? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_pro... | mimic_iii |
CREATE TABLE table_224840_4 (
vacator VARCHAR,
date_successor_seated VARCHAR
) | Who left office on November 26, 1800? | SELECT vacator FROM table_224840_4 WHERE date_successor_seated = "November 26, 1800" | sql_create_context |
CREATE TABLE table_name_71 (
distance VARCHAR,
year VARCHAR
) | What was the distance in 1997? | SELECT distance FROM table_name_71 WHERE year = 1997 | sql_create_context |
CREATE TABLE table_70422 (
"Year" real,
"Entrant" text,
"Class" text,
"Chassis" text,
"Engine" text,
"Rank" text,
"Points" text
) | Which engine has a year later than 2006 and 60 as the points? | SELECT "Engine" FROM table_70422 WHERE "Year" > '2006' AND "Points" = '60' | wikisql |
CREATE TABLE table_48249 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | What is the highest Round that lasted 1:44? | SELECT MAX("Round") FROM table_48249 WHERE "Time" = '1:44' | wikisql |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose diagnoses short title is peritonitis (acute) gen and drug route is ih? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Peritonitis (acute) gen" AND prescriptions.route = "IH" | mimicsql_data |
CREATE TABLE table_12962773_16 (
position VARCHAR,
current_club VARCHAR
) | How many players are from energa czarni? | SELECT COUNT(position) FROM table_12962773_16 WHERE current_club = "Energa Czarni" | sql_create_context |
CREATE TABLE table_2610582_3 (
location__transmitter_site_ VARCHAR,
power_kw__erp_ VARCHAR
) | What is the location that has a power of 5kw (10kw ERP)? | SELECT location__transmitter_site_ FROM table_2610582_3 WHERE power_kw__erp_ = "5kW (10kW ERP)" | sql_create_context |
CREATE TABLE table_48120 (
"Date" text,
"Opponent" text,
"Venue" text,
"Score" text,
"Attendance" text,
"Scorers" text
) | What date was the score won 1-2? | SELECT "Date" FROM table_48120 WHERE "Score" = 'won 1-2' | wikisql |
CREATE TABLE editor (
Name VARCHAR,
editor_id VARCHAR
)
CREATE TABLE journal_committee (
Name VARCHAR,
editor_id VARCHAR
) | List the names of editors that are not on any journal committee. | SELECT Name FROM editor WHERE NOT editor_id IN (SELECT editor_id FROM journal_committee) | sql_create_context |
CREATE TABLE table_28955 (
"Rd." text,
"Circuit" text,
"City / State" text,
"Date" text,
"Championship" text,
"Challenge" text,
"Production" text
) | Who handled production for the race when the championship went to david wall and challenge was jordan ormsby? | SELECT "Production" FROM table_28955 WHERE "Championship" = 'David Wall' AND "Challenge" = 'Jordan Ormsby' | 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... | give me the number of patients whose age is less than 85 and procedure icd9 code is 3806? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "85" AND procedures.icd9_code = "3806" | mimicsql_data |
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 admission year is less than 2194 and diagnoses short title is dysphagia nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2194" AND diagnoses.short_title = "Dysphagia NEC" | mimicsql_data |
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 sum transaction amount from each transaction type, and sort from high to low by the X-axis. | SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type ORDER BY transaction_type DESC | nvbench |
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... | count the number of patients who are diagnosed with unspecified hereditary and idiopathic peripheral neuropathy. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Unspecified hereditary and idiopathic peripheral neuropathy" | mimicsql_data |
CREATE TABLE table_204_805 (
id number,
"name" text,
"club" text,
"date of departure" text,
"replacement" text,
"date of appointment" text
) | what name is just previous to surasak tansurat on the list ? | SELECT "name" FROM table_204_805 WHERE id = (SELECT id FROM table_204_805 WHERE "name" = 'surasak tansurat') - 1 | squall |
CREATE TABLE table_23900 (
"Central-Southern Calabrian" text,
"Phonetic Greek" text,
"Italian" text,
"French" text,
"English" text
) | What is the French translation for the English word 'orange'? | SELECT "French" FROM table_23900 WHERE "English" = 'orange' | wikisql |
CREATE TABLE checking (
custid number,
balance number
)
CREATE TABLE accounts (
custid number,
name text
)
CREATE TABLE savings (
custid number,
balance number
) | What are the customer id and name corresponding to accounts with a checking balance less than the largest checking balance? | SELECT T1.custid, T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT MAX(balance) FROM checking) | spider |
CREATE TABLE table_name_9 (
locomotive VARCHAR,
built VARCHAR,
type VARCHAR,
entered_service VARCHAR
) | Which locomotive had a 2-8-2t type, entered service year prior to 1915, and which was built after 1911? | SELECT locomotive FROM table_name_9 WHERE type = "2-8-2t" AND entered_service < 1915 AND built > 1911 | sql_create_context |
CREATE TABLE table_1676073_13 (
lost VARCHAR,
points_for VARCHAR
) | How many losses does the club with 539 points for have? | SELECT lost FROM table_1676073_13 WHERE points_for = "539" | sql_create_context |
CREATE TABLE table_204_676 (
id number,
"year" number,
"division" number,
"league" text,
"regular season" text,
"playoffs" text,
"open cup" text
) | what is the year previous to 2005 ? | SELECT MAX("year") FROM table_204_676 WHERE "year" < 2005 | squall |
CREATE TABLE table_39507 (
"Game" real,
"Date" real,
"Opponent" text,
"Score" text,
"Location/attendance" text,
"Record" text
) | What was the score for game 18? | SELECT "Score" FROM table_39507 WHERE "Game" = '18' | wikisql |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airp... | which flights leaving BALTIMORE to DALLAS on monday afternoon have economic class | 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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE (((DAT... | atis |
CREATE TABLE table_45611 (
"Rider" text,
"Manufacturer" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the time/retired of the one with grid of 16? | SELECT "Time/Retired" FROM table_45611 WHERE "Grid" = '16' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | I need to know the requirements for a CS-LSA degree . | SELECT DISTINCT program_requirement.additional_req, program_requirement.category, program_requirement.min_credit, program.name FROM program, program_requirement WHERE program.name LIKE '%CS-LSA%' AND program.program_id = program_requirement.program_id | advising |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.