context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE wdmzjzjlb (
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... | 在10年9月29日到21年10月4日内患者22625548的所有检验结果指标记录的检测人为马皓轩的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B... | css |
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... | Return a bar chart about the distribution of All_Road and School_ID , could you list by the names in asc please? | SELECT All_Road, School_ID FROM basketball_match ORDER BY All_Road | nvbench |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
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 Dorm_amenity (
ameni... | Find the number of students for the cities where have more than one student, and sort by the X-axis from high to low. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code DESC | nvbench |
CREATE TABLE table_name_85 (
website VARCHAR,
frequency VARCHAR,
callsign VARCHAR
) | Which Website has a Frequency smaller than 760 and a Callsign of kkyx? | SELECT website FROM table_name_85 WHERE frequency < 760 AND callsign = "kkyx" | sql_create_context |
CREATE TABLE table_6567 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the average number of bronze medals of the team with 0 silvers, ranked 3, and less than 1 total medal? | SELECT AVG("Bronze") FROM table_6567 WHERE "Silver" = '0' AND "Rank" = '3' AND "Total" < '1' | wikisql |
CREATE TABLE table_29612 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real
) | Name the score for game 5 | SELECT "Score" FROM table_29612 WHERE "Game" = '5' | wikisql |
CREATE TABLE table_68450 (
"Need" text,
"Being (qualities)" text,
"Having (things)" text,
"Doing (actions)" text,
"Interacting (settings)" text
) | Name the being qualities for having things of friendships, family, relationships with nature | SELECT "Being (qualities)" FROM table_68450 WHERE "Having (things)" = 'friendships, family, relationships with nature' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 医院4300893所有的记录里,依照科室的不同和入院时诊断病名的区别显示出患者年纪平均值,保留其中小于17岁的记录 | SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '4300893' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.IN_DIAG_DIS_NM HAVING AVG(gwyjzb.PERSON_AGE) < 17 UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.IN_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WH... | css |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
date_of_birth text
)
CREATE TABLE entrepreneur (
entrepreneur_id number,
people_id number,
company text,
money_requested number,
investor text
) | What are the weights of entrepreneurs in descending order of money requested? | SELECT T2.weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id ORDER BY T1.money_requested DESC | spider |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | among patients who were prescribed with atropine 0.1 mg/ml syringe : 10 ml syringe, what is the three most frequently prescribed drug at the same time, until 1 year ago? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'atropine 0.1 mg/ml syringe : 10 ml syringe' AND DAT... | eicu |
CREATE TABLE table_name_94 (
opponent VARCHAR,
game VARCHAR
) | Who was the opponent in Game 27? | SELECT opponent FROM table_name_94 WHERE game = 27 | sql_create_context |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15),
Workshop_Group_ID INTEGER,
Product_Description VARCHAR(255),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4),
Other_Product_Service_Details VARCHAR(255)
)
CREATE TABLE Order_Items (
Order_Item_ID INTEGER,
... | Show all payment method codes and the number of orders for each code Show bar chart, order from high to low by the Y. | SELECT payment_method_code, COUNT(*) FROM Invoices GROUP BY payment_method_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 根据出院诊断疾病编码,列出不同疾病的平均患者在医院9733339中多大年龄? | SELECT qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '9733339' GROUP BY qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '9733339' GROUP BY gyb.OUT_DIAG_DIS_CD UNION SELECT zyb.OUT_DIAG_DIS_CD, AVG(zyb.PERSON_AGE) FROM zyb WHERE... | css |
CREATE TABLE table_77069 (
"Name of System" text,
"Location" text,
"Traction Type" text,
"Date (From)" text,
"Date (To)" text
) | What is the date (to) associated wiht a traction type of electric and the Yarmouth Light and Power Company system? | SELECT "Date (To)" FROM table_77069 WHERE "Traction Type" = 'electric' AND "Name of System" = 'yarmouth light and power company' | wikisql |
CREATE TABLE table_19282 (
"Series" text,
"Main presenter" text,
"Co-presenter" text,
"Comedian" text,
"UK co-presenter" text
) | Who are the UK co-presenters that have Joe Swash as a co-presenter and Russell Kane as a comedian? | SELECT COUNT("UK co-presenter") FROM table_19282 WHERE "Co-presenter" = 'Joe Swash' AND "Comedian" = 'Russell Kane' | wikisql |
CREATE TABLE table_74012 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Name the candidates for john boyle | SELECT "Candidates" FROM table_74012 WHERE "Incumbent" = 'John Boyle' | wikisql |
CREATE TABLE table_63666 (
"Restaurant Name" text,
"Original Name" text,
"Location" text,
"Chef" text,
"Designer" text,
"Still Open?" text
) | is the restaurant locavore still open? | SELECT "Still Open?" FROM table_63666 WHERE "Restaurant Name" = 'locavore' | wikisql |
CREATE TABLE table_name_95 (
finish VARCHAR,
year VARCHAR
) | What was Jack McGrath's finish number in 1954? | SELECT finish FROM table_name_95 WHERE year = "1954" | sql_create_context |
CREATE TABLE table_name_50 (
constructor VARCHAR,
driver VARCHAR
) | What is the constructor of the driver Heinz-Harald Frentzen? | SELECT constructor FROM table_name_50 WHERE driver = "heinz-harald frentzen" | sql_create_context |
CREATE TABLE table_train_38 (
"id" int,
"left_ventricular_ejection_fraction_lvef" int,
"child_pugh_class" string,
"systolic_blood_pressure_sbp" int,
"heart_disease" bool,
"acute_hepatitis" bool,
"liver_disease" bool,
"heart_rate" int,
"NOUSE" float
) | left ventricular ejection fraction less than 30 % | SELECT * FROM table_train_38 WHERE left_ventricular_ejection_fraction_lvef < 30 | criteria2sql |
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),... | Show the average of account details for different statement details in a bar chart, and order by the Y in ascending. | SELECT Statement_Details, AVG(Account_Details) FROM Accounts AS T1 JOIN Statements AS T2 ON T1.Statement_ID = T2.Statement_ID GROUP BY Statement_Details ORDER BY AVG(Account_Details) | nvbench |
CREATE TABLE table_name_68 (
method VARCHAR,
opponent VARCHAR
) | Which method had Travis Fulton as an opponent? | SELECT method FROM table_name_68 WHERE opponent = "travis fulton" | sql_create_context |
CREATE TABLE table_name_43 (
floors VARCHAR,
location VARCHAR
) | How many floors did the tallest building in Aston have? | SELECT floors FROM table_name_43 WHERE location = "aston" | sql_create_context |
CREATE TABLE order_items (
order_id number,
product_id number,
order_quantity text
)
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_address_from time,
address_type text,
date_address_to time
)
CREATE TABLE products (
product_id number,
product_det... | List all the distinct cities | SELECT DISTINCT city FROM addresses | spider |
CREATE TABLE wrestler (
wrestler_id number,
name text,
reign text,
days_held text,
location text,
event text
)
CREATE TABLE elimination (
elimination_id text,
wrestler_id text,
team text,
eliminated_by text,
elimination_move text,
time text
) | What is the name of the wrestler with the fewest days held? | SELECT name FROM wrestler ORDER BY days_held LIMIT 1 | spider |
CREATE TABLE table_name_43 (
semi_finalists VARCHAR,
week_of VARCHAR,
runner_up VARCHAR
) | Who are the semi finalists on the week of 12 june, when the runner-up is listed as Lori McNeil? | SELECT semi_finalists FROM table_name_43 WHERE week_of = "12 june" AND runner_up = "lori mcneil" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | among patients who remained admitted in hospital for more than 10 days, how many of them got drug administered in both eyes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "10" AND prescriptions.route = "BOTH EYES" | mimicsql_data |
CREATE TABLE table_13598 (
"Year" real,
"Title" text,
"Singapore 987FM Top Position" text,
"Singapore Power98 Top Position" text,
"Album" text
) | What is the average year for Faces? | SELECT AVG("Year") FROM table_13598 WHERE "Title" = 'faces' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Show me about the distribution of All_Neutral and All_Games_Percent in a bar chart, I want to display by the total number in ascending. | SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent | nvbench |
CREATE TABLE table_name_25 (
home_captain VARCHAR,
result VARCHAR
) | Who was the Home Captain and the Result for AUS by 4 wkts? | SELECT home_captain FROM table_name_25 WHERE result = "aus by 4 wkts" | sql_create_context |
CREATE TABLE table_29634 (
"#" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Viewers" real,
"Original airdate" text,
"Prod. code" real
) | What is the original air date of # 6? | SELECT "Original airdate" FROM table_29634 WHERE "#" = '6' | wikisql |
CREATE TABLE table_9378 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many games were on December 5? | SELECT SUM("Game") FROM table_9378 WHERE "Date" = 'december 5' | wikisql |
CREATE TABLE table_68340 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | what is the total number of rounds when method is tko (punches) and time is 0:40? | SELECT COUNT("Round") FROM table_68340 WHERE "Method" = 'tko (punches)' AND "Time" = '0:40' | wikisql |
CREATE TABLE table_27553 (
"Player" text,
"Games Played" real,
"Rebounds" real,
"Assists" real,
"Steals" real,
"Blocks" real,
"Points" real
) | How many players 89 points? | SELECT COUNT("Blocks") FROM table_27553 WHERE "Points" = '89' | wikisql |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 从二零零四年八月二十九日到二零一四年五月二十二日这段时间里,患者苗慧捷的哪些药品自付比例低于0.71的,把数量提供出来 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '苗慧捷' AND t_kc22.STA_DATE BETWEEN '2004-08-29' AND '2014-05-22' AND t_kc22.SELF_PAY_PRO < 0.71 | 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
)
... | what is maximum age of patients whose insurance is self pay and primary disease is stemi? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.insurance = "Self Pay" AND demographic.diagnosis = "STEMI" | mimicsql_data |
CREATE TABLE table_76393 (
"Year (Ceremony)" text,
"Film title used in nomination" text,
"Original title" text,
"Language(s)" text,
"Director" text,
"Result" text
) | What year was Zona Sur nominated? | SELECT "Year (Ceremony)" FROM table_76393 WHERE "Original title" = 'zona sur' | wikisql |
CREATE TABLE table_42209 (
"Record" text,
"Athlete" text,
"Nation" text,
"Venue" text,
"Date" text
) | What is the Record with a Date that is may 20, 1961? | SELECT "Record" FROM table_42209 WHERE "Date" = 'may 20, 1961' | wikisql |
CREATE TABLE table_name_42 (
total INTEGER,
gold VARCHAR,
bronze VARCHAR
) | What is the smallest total that has 11 golds and bronzes over 2? | SELECT MIN(total) FROM table_name_42 WHERE gold = 11 AND bronze > 2 | sql_create_context |
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,
... | what is the minimum hospital cost that includes a procedure known as hormonal therapy (for varices) since 3 years ago? | SELECT MIN(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 treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'hormonal therapy (for varices)')) AND DATETI... | eicu |
CREATE TABLE table_name_56 (
points INTEGER,
laps VARCHAR,
grid VARCHAR,
driver VARCHAR
) | Which Points have a Grid larger than 7, and a Driver of alex tagliani, and a Lapse smaller than 85? | SELECT MAX(points) FROM table_name_56 WHERE grid > 7 AND driver = "alex tagliani" AND laps < 85 | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is drug type and drug route of drug name diltiazem? | SELECT prescriptions.drug_type, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Diltiazem" | mimicsql_data |
CREATE TABLE table_18753 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | what are all the record where date is january 21 | SELECT "Record" FROM table_18753 WHERE "Date" = 'January 21' | wikisql |
CREATE TABLE table_61195 (
"Name" text,
"Bodyweight" real,
"Snatch" real,
"Clean & Jerk" real,
"Total (kg)" real
) | WHAT IS THE SNATCH WITH TOTAL KG SMALLER THAN 318, AND CLEAN JERK LARGER THAN 175? | SELECT MIN("Snatch") FROM table_61195 WHERE "Total (kg)" < '318' AND "Clean & Jerk" > '175' | wikisql |
CREATE TABLE table_200_4 (
id number,
"team" text,
"p" number,
"w" number,
"t" number,
"l" number,
"gf" number,
"ga" number,
"gd" number,
"pts." number
) | how many points did portugal score in the 1994 europeans men 's handball championship preliminary round ? | SELECT "pts." FROM table_200_4 WHERE "team" = 'portugal' | squall |
CREATE TABLE allergy_type (
allergy text,
allergytype text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE has_allergy (
stuid number,
allergy text
) | How many students have a food allergy? | SELECT COUNT(*) FROM has_allergy AS T1 JOIN allergy_type AS T2 ON T1.allergy = T2.allergy WHERE T2.allergytype = "food" | spider |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE lab (
labid numbe... | during the last year, what were the three most frequent drugs that were prescribed to patients during the same month after being diagnosed with s/p thoracoscopic procedure - pleurodesis? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 's/p thoracoscopic procedure - pleurodesis' AND DAT... | eicu |
CREATE TABLE table_2896329_1 (
handicap VARCHAR,
prize_money VARCHAR
) | What was the handicap when the prize money was 120s? | SELECT handicap FROM table_2896329_1 WHERE prize_money = "120s" | sql_create_context |
CREATE TABLE table_61657 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | How many weeks have an attendance less than 26,048? | SELECT SUM("Week") FROM table_61657 WHERE "Attendance" < '26,048' | wikisql |
CREATE TABLE Subjects (
subject_id INTEGER,
subject_name VARCHAR(120)
)
CREATE TABLE Student_Course_Enrolment (
registration_id INTEGER,
student_id INTEGER,
course_id INTEGER,
date_of_enrolment DATETIME,
date_of_completion DATETIME
)
CREATE TABLE Student_Tests_Taken (
registration_id I... | How many courses for each subject? Plot a bar chart, I want to display by the y-axis in descending. | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_71 (
studio_s_ VARCHAR,
director VARCHAR
) | What studio has the director Philip Frank Messina? | SELECT studio_s_ FROM table_name_71 WHERE director = "philip frank messina" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE patients (
row_id number,
subject_id number,
... | how much was albuterol 0.083% neb soln first prescribed to patient 808 in 08/2105? | SELECT prescriptions.dose_val_rx FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 808) AND prescriptions.drug = 'albuterol 0.083% neb soln' AND STRFTIME('%y-%m', prescriptions.startdate) = '2105-08' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE table_name_78 (
record VARCHAR,
year VARCHAR
) | Name the record for 1997 | SELECT record FROM table_name_78 WHERE year = "1997" | 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... | 卫奇胜这个患者以前在哪个地方就诊过? | SELECT mzjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '卫奇胜' UNION SELECT zyjzjlb.YLJGDM FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_i... | css |
CREATE TABLE table_204_292 (
id number,
"no." number,
"name" text,
"class" number,
"games" number,
"minutes" number,
"points" number,
"2 points\n(made/attempts)" text,
"2 points\n(%)" number,
"3 points\n(made/attempts)" text,
"3 points\n(%)" number,
"free throws\n(made/at... | who is the last player on the list to not attempt a 3 point shot ? | SELECT "name" FROM table_204_292 WHERE "3 points\n(made/attempts)" IS NULL ORDER BY id DESC LIMIT 1 | squall |
CREATE TABLE table_40860 (
"Record" text,
"Athlete" text,
"Nation" text,
"Venue" text,
"Date" text
) | What nation has a Record of 5.06m(16ft7in)? | SELECT "Nation" FROM table_40860 WHERE "Record" = '5.06m(16ft7in)' | wikisql |
CREATE TABLE table_26984 (
"Spacecraft" text,
"Spacewalker" text,
"Start \u2013 UTC" text,
"End \u2013 UTC" text,
"Duration" text,
"Comments" text
) | When first woman eva is the comment what is the end -utc? | SELECT "End \u2013 UTC" FROM table_26984 WHERE "Comments" = 'First woman EVA' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, find name and code , and group by attribute name, and visualize them by a bar chart, and rank in desc by the bars. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_38332 (
"Year" text,
"Coach" text,
"Crew" text,
"Record" text,
"Win %" real
) | What is the total number of win % when John Gartin is coach, the crew is varsity 8+, and the year is 2005? | SELECT SUM("Win %") FROM table_38332 WHERE "Coach" = 'john gartin' AND "Crew" = 'varsity 8+' AND "Year" = '2005' | wikisql |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
uniquepid text,
... | how much does a drug cost, lorazepam inj? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'lorazepam inj') | eicu |
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 lab (
subject_id text,
hadm_id text,
... | count the number of patients whose days of hospital stay is greater than 8 and procedure long title is other cystoscopy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "8" AND procedures.long_title = "Other cystoscopy" | mimicsql_data |
CREATE TABLE table_41391 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Kickoff Time" text,
"Attendance" text
) | What was the kickoff time for week 11's game? | SELECT "Kickoff Time" FROM table_41391 WHERE "Week" = '11' | wikisql |
CREATE TABLE table_16780 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | Who was the winning driver for the goodwood circuit? | SELECT "Winning driver" FROM table_16780 WHERE "Circuit" = 'Goodwood' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | tehran province of Iran Stackoverflow users. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%arak%' ORDER BY Reputation DESC | sede |
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... | 患者朱和颂的各检验科室的编码及名称在医疗就诊07371082275中均为? | SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '07371082275' | css |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
E... | Chance of getting an answer by user rep. | SELECT Reputation / 5 * 5, COUNT(CASE WHEN AnswerCount > 0 THEN 1 END) * 1.0 / COUNT(*) AS rate FROM Users, Posts WHERE Posts.PostTypeId = 1 AND OwnerUserId = Users.Id AND Reputation / 5 < '##maxReputation##' / 5 GROUP BY Reputation / 5 ORDER BY Reputation / 5 | sede |
CREATE TABLE table_24900 (
"Code & location" text,
"Missile Type" text,
"Defense Area" text,
"Dates" text,
"Control Site condition/owner" text,
"Launch Site condition/owner" text
) | What is every missile type with a code and location of M-20 Harbor Drive? | SELECT "Missile Type" FROM table_24900 WHERE "Code & location" = 'M-20 Harbor Drive' | wikisql |
CREATE TABLE table_72556 (
"Rank" text,
"Common" text,
"Population" real,
"Area (km 2 )" text,
"Density (inhabitants/km 2 )" text,
"Altitude (mslm)" real
) | Where does the common of Galliate rank in population? | SELECT "Rank" FROM table_72556 WHERE "Common" = 'Galliate' | wikisql |
CREATE TABLE table_53627 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did Melbourne score as the home team? | SELECT "Home team score" FROM table_53627 WHERE "Home team" = 'melbourne' | wikisql |
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 ... | how many current patients are of age 40s? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 40 AND 49 | mimic_iii |
CREATE TABLE table_23483 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | how many records were made on february 22 | SELECT COUNT("Record") FROM table_23483 WHERE "Date" = 'February 22' | wikisql |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 二零一二年一月二十九日到二零二零年三月三十一,病患83591891去医疗机构6330903挂过几次门诊 | SELECT COUNT(*) FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '83591891' AND mzjzjlb.JZKSRQ BETWEEN '2012-01-29' AND '2020-03-31' AND mzjzjlb.YLJGDM = '6330903' | css |
CREATE TABLE table_47378 (
"Rank" real,
"Mountain Peak" text,
"Region" text,
"Mountain Range" text,
"Location" text
) | what is the region when the location is 49.7462 n 117.1419 w? | SELECT "Region" FROM table_47378 WHERE "Location" = '49.7462°n 117.1419°w' | wikisql |
CREATE TABLE table_25563779_4 (
champion VARCHAR,
third VARCHAR
) | If the third name is Bruno Bonifacio, what is the champion? | SELECT champion FROM table_25563779_4 WHERE third = "Bruno Bonifacio" | sql_create_context |
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 ReviewTaskResults (
Id number,
Review... | number of users by tag. | SELECT Location, COUNT(*) FROM Users WHERE Location LIKE '%portugal%' OR Location LIKE '%lisbon%' OR Location LIKE '%lisboa%' GROUP BY Location | sede |
CREATE TABLE table_32900 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | When was the Browns' game that over 36,796 attended? | SELECT "Date" FROM table_32900 WHERE "Attendance" > '36,796' | wikisql |
CREATE TABLE table_31641 (
"Census year" real,
"Total" real,
"Macedonians" real,
"Albanians" real,
"Turks" real,
"Roma" real,
"Vlachs" real,
"Serbs" real,
"Bosniaks" real,
"Other" real
) | Tell me the highest bosniaks for year more than 2002 | SELECT MAX("Bosniaks") FROM table_31641 WHERE "Census year" > '2002' | 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... | show the date of birth and insurance type of lawrence wibbens. | SELECT demographic.dob, demographic.insurance FROM demographic WHERE demographic.name = "Lawrence Wibbens" | mimicsql_data |
CREATE TABLE table_name_72 (
top_5 INTEGER,
tournament VARCHAR,
cuts_made VARCHAR
) | What is the average Top-5, when Tournament is U.S. Open, and when Cuts Made is greater than 10? | SELECT AVG(top_5) FROM table_name_72 WHERE tournament = "u.s. open" AND cuts_made > 10 | sql_create_context |
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
) | For each manufacturer name, what are the names and prices of their most expensive product? | SELECT T1.name, MAX(T1.price), T2.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.manufacturer = T2.code GROUP BY T2.name | spider |
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 bar chart shows the distribution of All_Home and the average of Team_ID , and group by attribute All_Home, rank by the y-axis from low to high. | SELECT All_Home, AVG(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY AVG(Team_ID) | nvbench |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE restriction (
restriction_code text,
advance_purc... | only show CO flights | SELECT DISTINCT flight_id FROM flight WHERE airline_code = 'CO' | atis |
CREATE TABLE table_11058 (
"Year" real,
"Competition" text,
"Date" text,
"Surface" text,
"Location" text,
"Score" text,
"Result" text
) | Which competition has a Year of 2008, a Surface of carpet, and a Date of 31 jan? | SELECT "Competition" FROM table_11058 WHERE "Year" = '2008' AND "Surface" = 'carpet' AND "Date" = '31 jan' | wikisql |
CREATE TABLE table_name_18 (
crowd INTEGER,
home_team VARCHAR
) | What was the smallest crowd that Melbourne played for at home? | SELECT MIN(crowd) FROM table_name_18 WHERE home_team = "melbourne" | sql_create_context |
CREATE TABLE table_68979 (
".308 Winchester cartridge type" text,
"100 m group (mm)" text,
"100 m group ( MOA )" text,
"300 m group (mm)" text,
"300 m group ( MOA )" text
) | Which of the .308 Winchester cartridge type has a 100 m group of 14 and also a 300 m group of 0.63? | SELECT ".308 Winchester cartridge type" FROM table_68979 WHERE "100 m group (mm)" = '14' AND "300 m group ( MOA )" = '0.63' | wikisql |
CREATE TABLE table_1745843_7 (
part_4 VARCHAR,
part_3 VARCHAR
) | What's the part 4 for the verb whose part 3 is borgen? | SELECT part_4 FROM table_1745843_7 WHERE part_3 = "borgen" | sql_create_context |
CREATE TABLE table_name_18 (
width INTEGER,
frame_size VARCHAR,
height VARCHAR
) | What is the smallest width for a frame size of 5k and a height shorter than 2700? | SELECT MIN(width) FROM table_name_18 WHERE frame_size = "5k" AND height < 2700 | sql_create_context |
CREATE TABLE table_63918 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the Total number of medals for the Nation with 7 or less Bronze medals and 1 Silver medal with a Rank of 9 or larger? | SELECT MIN("Total") FROM table_63918 WHERE "Bronze" < '7' AND "Silver" = '1' AND "Rank" > '9' | 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... | Visualize the relationship between Height and Weight , and group by attribute Sex. | SELECT Height, Weight FROM people GROUP BY Sex | nvbench |
CREATE TABLE table_65441 (
"Position" text,
"Drivers" text,
"Entrant" text,
"Class" text,
"Laps" real
) | For what class is the laps 66? | SELECT "Class" FROM table_65441 WHERE "Laps" = '66' | wikisql |
CREATE TABLE manufacturers (
code VARCHAR,
name VARCHAR
)
CREATE TABLE products (
name VARCHAR
) | Find number of products which Sony does not make. | SELECT COUNT(DISTINCT name) FROM products WHERE NOT name IN (SELECT T1.name FROM products AS T1 JOIN manufacturers AS T2 ON T1.Manufacturer = T2.code WHERE T2.name = 'Sony') | sql_create_context |
CREATE TABLE table_203_506 (
id number,
"opponent" text,
"played" number,
"won" number,
"lost" number,
"drawn" number,
"% won overall" text
) | name two countries that the england women 's rfu have played above thirty games against . | SELECT "opponent" FROM table_203_506 WHERE "played" >= 30 | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeo... | during this month has patient 012-4131 received a potassium test? | SELECT COUNT(*) > 0 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-4131')) AND lab.labname = 'potassium' AND DATETIME(lab.labresulttime, 'start of mont... | eicu |
CREATE TABLE table_73783 (
"Song" text,
"Singer" text,
"Co-Singers" text,
"Music Director" text,
"Lyricist" text,
"Co-Stars" text,
"Movie/Album" text,
"Year" real,
"Additional Info" text
) | What movie did Bela Bose co-star in? | SELECT "Movie/Album" FROM table_73783 WHERE "Co-Stars" = 'Bela Bose' | wikisql |
CREATE TABLE table_36730 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text
) | Who is the Incumbent that has a District of ohio 13 in Democratic Party? | SELECT "Incumbent" FROM table_36730 WHERE "District" = 'ohio 13' | wikisql |
CREATE TABLE table_69011 (
"Year" text,
"Venue" text,
"Winners" text,
"Runner-up" text,
"3rd place" text
) | What shows for 3rd place when Runner-up shows as runner-up? | SELECT "3rd place" FROM table_69011 WHERE "Runner-up" = 'runner-up' | wikisql |
CREATE TABLE table_name_96 (
fifth VARCHAR,
sixth VARCHAR,
second VARCHAR,
first VARCHAR
) | What team placed fifth during the season where Victoria placed second, Tasmania placed first, and South Australia placed sixth? | SELECT fifth FROM table_name_96 WHERE second = "victoria" AND first = "tasmania" AND sixth = "south australia" | sql_create_context |
CREATE TABLE table_18620 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | what's the first elected with candidates being joe starnes (d) 100.0% george bogus ( w/i ) 0.003% | SELECT "First elected" FROM table_18620 WHERE "Candidates" = 'Joe Starnes (D) 100.0% George Bogus ( W/I ) 0.003%' | wikisql |
CREATE TABLE table_67936 (
"Tournament" text,
"2005" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What was the 2009 result associated with a 2012 of 1R and a 2007 of 2R? | SELECT "2009" FROM table_67936 WHERE "2012" = '1r' AND "2007" = '2r' | 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... | 从11年6月24日起到21年7月31日在编号为2335631的医疗机构中未就业人员医疗就诊的医疗费总额达到7979.89元以上的就诊记录数量是多少啊? | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2335631' AND gwyjzb.IN_HOSP_DATE BETWEEN '2011-06-24' AND '2021-07-31' AND gwyjzb.INSURED_STS = '未就业' AND gwyjzb.MED_AMOUT >= 7979.89 UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '2335631' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2011-06-24' AND '... | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.