context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status VARCHAR(15),
order_date DATETIME,
order_details VARCHAR(255)
)
CREATE TABLE Products (
product_id INTEGER,
product_details VARCHAR(255)
)
CREATE TABLE Customer_Addresses (
customer_id INTEGER,
addres... | How many customers using email as the contact channel? Group by customer name and bin active date by weekday in a stacked bar chart, show from high to low by the y-axis. | SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' GROUP BY customer_name ORDER BY COUNT(active_from_date) DESC | nvbench |
CREATE TABLE table_38890 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | Who was the opponent at the game in Belgrade with a 0:2 result? | SELECT "Opponent" FROM table_38890 WHERE "City" = 'belgrade' AND "Results\u00b9" = '0:2' | wikisql |
CREATE TABLE table_53477 (
"Grid" real,
"Driver" text,
"Constructor" text,
"Qual" real,
"Rank" real,
"Laps" real,
"Time/Retired" text
) | What was the rank of the car who had more than 182 laps, gris less than 3, with a qual time of more than 134.14 and a time/retired of +14:21.72? | SELECT MIN("Rank") FROM table_53477 WHERE "Laps" > '182' AND "Qual" > '134.14' AND "Time/Retired" = '+14:21.72' AND "Grid" < '3' | wikisql |
CREATE TABLE PersonFriend (
name varchar(20),
friend varchar(20),
year INTEGER
)
CREATE TABLE Person (
name varchar(20),
age INTEGER,
city TEXT,
gender TEXT,
job TEXT
) | how old is the youngest person for each job?, and show y-axis in descending order. | SELECT job, MIN(age) FROM Person GROUP BY job ORDER BY MIN(age) 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... | tell me primary disease and the type of drug prescription for the patient with patient id 18480. | SELECT demographic.diagnosis, prescriptions.drug_type FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "18480" | mimicsql_data |
CREATE TABLE table_6131 (
"Year" real,
"Winner" text,
"Jockey" text,
"Trainer" text,
"Owner" text,
"Time" text,
"Purse" text
) | What is the time for when cornelio velasquez was the jockey? | SELECT "Time" FROM table_6131 WHERE "Jockey" = 'cornelio velasquez' | wikisql |
CREATE TABLE table_name_19 (
october INTEGER,
game INTEGER
) | Name the most october for game less than 1 | SELECT MAX(october) FROM table_name_19 WHERE game < 1 | sql_create_context |
CREATE TABLE table_name_71 (
release_date VARCHAR,
title VARCHAR
) | When was Inki and the Minah Bird released? | SELECT release_date FROM table_name_71 WHERE title = "inki and the minah bird" | sql_create_context |
CREATE TABLE table_14433 (
"Date" text,
"Label" text,
"Region" text,
"Format" text,
"Catalog" text
) | Which region had the CD maxi format? | SELECT "Region" FROM table_14433 WHERE "Format" = 'cd maxi' | wikisql |
CREATE TABLE table_name_7 (
outcome VARCHAR,
partner VARCHAR
) | What is the Outcome of the match with Partner Andoni Vivanco? | SELECT outcome FROM table_name_7 WHERE partner = "andoni vivanco" | sql_create_context |
CREATE TABLE table_1921_1 (
conflict VARCHAR,
location VARCHAR
) | What is every conflict in Iraq? | SELECT conflict FROM table_1921_1 WHERE location = "Iraq" | sql_create_context |
CREATE TABLE table_2208838_4 (
played VARCHAR,
points VARCHAR
) | How many games were played by the player with 927 points? | SELECT played FROM table_2208838_4 WHERE points = 927 | sql_create_context |
CREATE TABLE table_name_2 (
date VARCHAR,
opponents VARCHAR
) | What Date has Opponents of sun shengnan han xinyun? | SELECT date FROM table_name_2 WHERE opponents = "sun shengnan han xinyun" | sql_create_context |
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE aircraft (
ai... | Show me how many destination by destination in a histogram, order bars in descending order. | SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination DESC | nvbench |
CREATE TABLE table_13117 (
"Shooter" text,
"Event" text,
"Rank points" text,
"Score points" text,
"Total" text
) | What event did the shooter, who had 10 score points, compete in? | SELECT "Event" FROM table_13117 WHERE "Score points" = '10' | wikisql |
CREATE TABLE table_24418525_1 (
callsign VARCHAR,
coverage VARCHAR
) | when coverage is dumaguete central visayas region, what is the callsign? | SELECT callsign FROM table_24418525_1 WHERE coverage = "Dumaguete Central Visayas Region" | sql_create_context |
CREATE TABLE table_62807 (
"Rank" real,
"Athletes" text,
"Country" text,
"Time" text,
"Notes" text
) | When france had a rank larger than 2, what was their time? | SELECT "Time" FROM table_62807 WHERE "Rank" > '2' AND "Country" = 'france' | wikisql |
CREATE TABLE table_25055040_22 (
mountains_classification VARCHAR,
most_courageous VARCHAR
) | When Yaroslav Popovych won most corageous, who won the mountains classification? | SELECT mountains_classification FROM table_25055040_22 WHERE most_courageous = "Yaroslav Popovych" | sql_create_context |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and salary . | SELECT FIRST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_54413 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | What is the highest pick number of the CFL's Toronto Argonauts? | SELECT MAX("Pick #") FROM table_54413 WHERE "CFL Team" = 'toronto argonauts' | wikisql |
CREATE TABLE table_train_204 (
"id" int,
"systolic_blood_pressure_sbp" int,
"plasma_glucose_concentration" int,
"fasting_plasma_glucose_fpg" float,
"increase_risk_of_intervention" bool,
"diastolic_blood_pressure_dbp" int,
"life_span" bool,
"body_mass_index_bmi" float,
"NOUSE" float
) | bmi > 24 kg / m2 | SELECT * FROM table_train_204 WHERE body_mass_index_bmi > 24 | criteria2sql |
CREATE TABLE table_18600760_7 (
ansi_code INTEGER,
pop__2010_ VARCHAR
) | If the population is 1858, what is the maximum ansi code? | SELECT MAX(ansi_code) FROM table_18600760_7 WHERE pop__2010_ = 1858 | sql_create_context |
CREATE TABLE table_name_89 (
losing_bonus VARCHAR,
try_bonus VARCHAR
) | What is the Losing bonus with an extra try bonus? | SELECT losing_bonus FROM table_name_89 WHERE try_bonus = "try bonus" | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 这家医院6975310的科室中有多少是在04年10月23日到18年10月29日期间的医疗费总额不低于448.65元的? | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '6975310' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2004-10-23' AND '2018-10-29' GROUP B... | css |
CREATE TABLE table_name_13 (
rank VARCHAR,
alliance VARCHAR,
country VARCHAR
) | How many airlines have the star alliance and are in brazil? | SELECT COUNT(rank) FROM table_name_13 WHERE alliance = "star alliance" AND country = "brazil" | sql_create_context |
CREATE TABLE table_203_777 (
id number,
"years" text,
"building" text,
"city" text,
"height (ctbuh)" text,
"floors" number
) | how many tallest building in canada have been built in toronto ? | SELECT COUNT("years") FROM table_203_777 WHERE "city" = 'toronto' | squall |
CREATE TABLE table_66740 (
"Season" text,
"Team Name" text,
"Games" real,
"Losses" real,
"Points" real
) | How many losses did the Burnaby Lakers accumulate when they scored 8 points in 1998 playing less than 25 games? | SELECT SUM("Losses") FROM table_66740 WHERE "Team Name" = 'burnaby lakers' AND "Points" = '8' AND "Season" = '1998' AND "Games" < '25' | wikisql |
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Documents (
Document_ID INTEGER,
Document_Type_Code CHAR(15),
Project_ID INTEGER,
Document_Date D... | Show the total number from each document type code, could you show by the X-axis in desc please? | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY Document_Type_Code DESC | nvbench |
CREATE TABLE Ref_Detention_Type (
detention_type_code VARCHAR(10),
detention_type_description VARCHAR(80)
)
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Assessment_Notes (
notes_id INTEGER,
student_id INTEGER,
teacher... | A bar chart for finding the number of the dates of assessment notes for students with first name 'Fanny'. | SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" | nvbench |
CREATE TABLE STUDENT (
LName VARCHAR,
Major VARCHAR
) | Find the last names of students with major 50. | SELECT LName FROM STUDENT WHERE Major = 50 | sql_create_context |
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
date_account_opened DATETIME,
account_name VARCHAR(50),
... | How many accounts are opened in each day? Bin the account open day by weekday in a bar chart, and sort by the Y-axis in asc. | SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts ORDER BY COUNT(date_account_opened) | nvbench |
CREATE TABLE table_name_79 (
label VARCHAR,
date VARCHAR,
format VARCHAR
) | What Label released on October 25, 1984, in the format of Stereo LP? | SELECT label FROM table_name_79 WHERE date = "october 25, 1984" AND format = "stereo lp" | sql_create_context |
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 language is ptun and year of death is less than or equal to 2132? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PTUN" AND demographic.dod_year <= "2132.0" | mimicsql_data |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 编号为19416849的患者在门诊诊断为慢性阻塞性肺病伴有急性加重的白蛋白的时候其结果定量是什么及其单位是什么呢? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb 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 jybgb.YLJGDM = jybgb_jyjgzbb.Y... | css |
CREATE TABLE table_name_86 (
ship_type VARCHAR,
nat VARCHAR
) | What ship type was from SE? | SELECT ship_type FROM table_name_86 WHERE nat = "se" | 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 ... | count the number of patients who had the intake of capd dialysate since 6 years ago. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT icustays.hadm_id FROM icustays WHERE icustays.icustay_id IN (SELECT inputevents_cv.icustay_id FROM inputevents_cv WHERE inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'capd dialysate' AND... | mimic_iii |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | what were the four most frequently given microbiology tests for patients who had received cultures earlier during the same hospital visit in 2105? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'cultures'... | eicu |
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 long title of procedure for procedure icd9 code 3613. | SELECT procedures.long_title FROM procedures WHERE procedures.icd9_code = "3613" | mimicsql_data |
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | What is the average rating for each movie that has never been reviewed by Brittany Harris. | SELECT mID, AVG(stars) FROM Rating WHERE NOT mID IN (SELECT T1.mID FROM Rating AS T1 JOIN Reviewer AS T2 ON T1.rID = T2.rID WHERE T2.name = "Brittany Harris") GROUP BY mID | nvbench |
CREATE TABLE table_28140 (
"Position" text,
"Name" text,
"Nationality" text,
"Event 1 Super Yoke" text,
"Event 2 Power Stairs" text,
"Event 3 Car Lift" text,
"Event 4 Farmers Walk" text,
"Event 5 Truck Pull" text,
"Event 6 Fingals Fingers" text,
"Event 7 Atlas Stones" text
) | Name the name for norway nationality | SELECT "Name" FROM table_28140 WHERE "Nationality" = 'Norway' | wikisql |
CREATE TABLE table_7761 (
"Province of Silla" text,
"Administrative district" text,
"Pre-1009 province" text,
"Post-1009 province" text,
"Modern equivalent" text
) | Which Pre-1009 province has a Post-1009 province of donggye? | SELECT "Pre-1009 province" FROM table_7761 WHERE "Post-1009 province" = 'donggye' | wikisql |
CREATE TABLE table_49206 (
"Year" real,
"Starts" real,
"Wins" real,
"Top 5" real,
"Top 10" real,
"Poles" real,
"Avg. Start" real,
"Avg. Finish" real,
"Winnings" text,
"Position" text
) | in 2007, what is the avg finish that had a start less than 1? | SELECT SUM("Avg. Finish") FROM table_49206 WHERE "Year" = '2007' AND "Starts" < '1' | wikisql |
CREATE TABLE table_name_18 (
year INTEGER,
album VARCHAR
) | Album of les mots had what lowest year? | SELECT MIN(year) FROM table_name_18 WHERE album = "les mots" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId num... | Maxium reputation without a gold badge. | SELECT u.Id AS "user_link", u.Reputation FROM Users AS u WHERE u.Id NOT IN (SELECT b.UserId FROM Badges AS b INNER JOIN Tags AS t ON t.TagName = b.Name GROUP BY b.UserId, t.Id HAVING COUNT(*) = 3) ORDER BY u.Reputation DESC | sede |
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
)
... | provide the number of patients whose admission type is emergency and lab test name is troponin i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Troponin I" | mimicsql_data |
CREATE TABLE table_name_17 (
result VARCHAR,
award VARCHAR,
nominee VARCHAR
) | What is the result of nominee, Patricia McGourty, for the drama desk award? | SELECT result FROM table_name_17 WHERE award = "drama desk award" AND nominee = "patricia mcgourty" | sql_create_context |
CREATE TABLE table_24664 (
"Team" text,
"Truck(s)" text,
"#" real,
"Driver(s)" text,
"Primary Sponsor(s)" text,
"Listed Owner(s)" text,
"Crew Chief" text
) | Name the listen owners for repairone | SELECT "Listed Owner(s)" FROM table_24664 WHERE "Primary Sponsor(s)" = 'RepairOne' | wikisql |
CREATE TABLE table_204_683 (
id number,
"no." number,
"constituency" text,
"winner candidate" text,
"party" text,
"votes" number,
"margin" number
) | what constituency comes immediately before palanpur ? | SELECT "constituency" FROM table_204_683 WHERE "no." = (SELECT "no." FROM table_204_683 WHERE "constituency" = 'palanpur') - 1 | squall |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
ins... | What is the class number of the Thin Films course ? | SELECT DISTINCT number FROM course WHERE (description LIKE '%Thin Films%' OR name LIKE '%Thin Films%') AND department = 'EECS' | advising |
CREATE TABLE table_name_87 (
loss VARCHAR,
score VARCHAR
) | What was the Loss that had a Score of 9-1? | SELECT loss FROM table_name_87 WHERE score = "9-1" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | what is the number of patients whose admission year is less than 2165 and lab test name is reticulocyte count, manual? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2165" AND lab.label = "Reticulocyte Count, Manual" | mimicsql_data |
CREATE TABLE table_37915 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What was the result on 16 November 2003? | SELECT "Result" FROM table_37915 WHERE "Date" = '16 november 2003' | wikisql |
CREATE TABLE table_name_46 (
place VARCHAR,
country VARCHAR
) | What is the place of Australia? | SELECT place FROM table_name_46 WHERE country = "australia" | sql_create_context |
CREATE TABLE table_20980 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Falcons points" real,
"Opponents" real,
"Record" text,
"Attendance" real
) | How many points did the Falcons score when the record was 4-4? | SELECT "Falcons points" FROM table_20980 WHERE "Record" = '4-4' | wikisql |
CREATE TABLE table_204_162 (
id number,
"team" text,
"constructor" text,
"motorcycle" text,
"tyres" text,
"no" number,
"rider" text,
"rounds" text
) | which motorcycle did garry mccoy use on his team ? | SELECT "motorcycle" FROM table_204_162 WHERE "rider" = 'garry mccoy' | squall |
CREATE TABLE table_35849 (
"Name" text,
"Hanzi" text,
"Hanyu Pinyin" text,
"Population (2010-11-01)" text,
"Area (km\u00b2)" text,
"Density (/km\u00b2)" text
) | What is the Pinyin for ? | SELECT "Hanyu Pinyin" FROM table_35849 WHERE "Hanzi" = '依兰县' | wikisql |
CREATE TABLE table_64595 (
"Version" text,
"Standard name" text,
"Common name" text,
"Downstream rate" text,
"Upstream rate" text
) | What's the standard name that has a common name of ADSL Over Pots and ADSL version? | SELECT "Standard name" FROM table_64595 WHERE "Version" = 'adsl' AND "Common name" = 'adsl over pots' | wikisql |
CREATE TABLE table_19376 (
"Tour" text,
"Mens singles" text,
"Womens singles" text,
"Mens doubles" text,
"Womens doubles" text,
"Mixed doubles" text
) | Name the mixed doubles when tour is hong kong super series | SELECT "Mixed doubles" FROM table_19376 WHERE "Tour" = 'Hong Kong Super Series' | wikisql |
CREATE TABLE table_79909 (
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 O" text,
"D 45 O" text,
"D 46 O" text,
"D 47 O" text,
"D 48 O" text
) | Name the D 48 O with D 41 of d 41 | SELECT "D 48 O" FROM table_79909 WHERE "D 41 \u221a" = 'd 41 √' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
med... | what is the name of the drug, which patient 028-30487 was prescribed in the same day after being diagnosed with metabolic acidosis - lactic acidosis since 02/2105? | SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '028-30487') AND diagnosis.diagnos... | eicu |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 患者凤英发哪些检验报告的结果指标全部正常?看看这些检验报告的单号 | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '凤英发' AND NOT ... | css |
CREATE TABLE table_204_249 (
id number,
"km" number,
"municipality" text,
"location" text,
"interescting highway" text,
"notes" text
) | including each municipality how many km total are there ? | SELECT SUM("km") FROM table_204_249 | squall |
CREATE TABLE finrev_fed_17 (
state_code number,
idcensus number,
school_district text,
nces_id text,
yr_data number,
t_fed_rev number,
c14 number,
c25 number
)
CREATE TABLE finrev_fed_key_17 (
state_code number,
state text,
#_records text
)
CREATE TABLE ndecoreexcel_math_gr... | How much did the federal government spend in No Child Left Behind funding in 2017? | SELECT SUM(c14) FROM finrev_fed_17 WHERE yr_data = 17 | studentmathscore |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime ... | what is the top four most frequent diagnoses among the patients in the 20s since 2101? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN... | mimic_iii |
CREATE TABLE table_name_18 (
owner_operator VARCHAR,
from_to VARCHAR
) | Who is the owner/operator of the line from Kambalda to Esperance? | SELECT owner_operator FROM table_name_18 WHERE from_to = "kambalda to esperance" | sql_create_context |
CREATE TABLE table_137 (
"1921" text,
"party" text,
"Manhattan" text,
"The Bronx" text,
"Brooklyn" text,
"Queens" text,
"Richmond [Staten Is.]" text,
"Total" real,
"%" text
) | How many votes in Brooklyn were won by the candidate who won 321 votes in Manhattan? | SELECT "Brooklyn" FROM table_137 WHERE "Manhattan" = '321' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | 在2015年11月6日到2021年10月2日内列出患者编号02589232所有检验结果指标记录的检验人为昌飞烟的检验指标流水序列号有多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B... | css |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Give me the comparison about ID over the meter_300 . | SELECT meter_300, ID FROM swimmer | nvbench |
CREATE TABLE table_57116 (
"College Name" text,
"Location" text,
"District" text,
"Affiliation" text,
"Estd" text
) | Where is the location of the coimbatore medical college? | SELECT "Location" FROM table_57116 WHERE "College Name" = 'coimbatore medical college' | wikisql |
CREATE TABLE table_204_71 (
id number,
"rank" number,
"heat" number,
"name" text,
"nationality" text,
"time" text,
"notes" text
) | what is the time difference in seconds between rachel king and sriyani kulawansa ? | SELECT ABS((SELECT "time" FROM table_204_71 WHERE "name" = 'rachel king') - (SELECT "time" FROM table_204_71 WHERE "name" = 'sriyani kulawansa')) | squall |
CREATE TABLE table_32064 (
"Title" text,
"Japan" text,
"North America" text,
"Europe" text,
"Australia" text
) | Tell me the Australia march 17, 2005 | SELECT "Australia" FROM table_32064 WHERE "Japan" = 'march 17, 2005' | wikisql |
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE field (
fieldid int
)
CREATE TABLE ... | When was benjamin mako hill 's first paper written ? | SELECT DISTINCT COUNT(paper.paperid), paper.year FROM author, paper, writes WHERE author.authorname = 'benjamin mako hill' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY paper.year ORDER BY paper.year | scholar |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | 编码为59764385388、69610298292的检验报告单中是否有名称相同的检测指标?分别列出这些检测指标名称叫什么?检测指标结果定量及其单位都是啥?对应的检验报告单号是什么? | SELECT JCZBMC, JCZBJGDL, JCZBJGDW, BGDH FROM jyjgzbb WHERE (BGDH = '59764385388' OR BGDH = '69610298292') AND JCZBMC IN ((SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '59764385388') INTERSECT (SELECT JCZBMC FROM jyjgzbb WHERE BGDH = '69610298292')) | css |
CREATE TABLE table_60012 (
"Provider" text,
"Years" text,
"Free or pay" text,
"Transmission" text,
"On demand" text
) | Name the Years that have a free + pay? | SELECT "Years" FROM table_60012 WHERE "Free or pay" = 'free + pay' | wikisql |
CREATE TABLE table_name_63 (
outcome VARCHAR,
opponent VARCHAR,
score VARCHAR
) | What is Outcome, when Opponent is Victoria Azarenka, and when Score is 6 2, 2 6, 7 5? | SELECT outcome FROM table_name_63 WHERE opponent = "victoria azarenka" AND score = "6–2, 2–6, 7–5" | sql_create_context |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 病患云鸿运在2009-07-30之前做过的检验报告在哪些门诊,列出这些门诊就诊的流水编码 | SELECT mzjzjlb.JZLSH 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 = '云鸿运' AND NOT mzjzjlb.JZLSH IN (SELECT JZLSH FROM jybgb WHERE BGRQ >= '2009-07-30') | css |
CREATE TABLE table_36429 (
"NTFA Div 1" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What is the average number of losses for teams with 0 draws and 0 byes? | SELECT AVG("Losses") FROM table_36429 WHERE "Draws" = '0' AND "Byes" < '0' | wikisql |
CREATE TABLE table_21778 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Bonus Points" text,
"Points" text
) | How many bonus points were won by 5? | SELECT "Bonus Points" FROM table_21778 WHERE "Won" = '5' | wikisql |
CREATE TABLE table_71600 (
"Year" real,
"Chassis" text,
"Engine" text,
"Start" text,
"Finish" text,
"Team" text
) | What year was the start 33? | SELECT SUM("Year") FROM table_71600 WHERE "Start" = '33' | wikisql |
CREATE TABLE table_75532 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | What is the School/Junior/Club Group (Association) that has a Round bigger than 6, and a Place of winger, and a Player of evgeny afanasiev? | SELECT "College/Junior/Club Team (League)" FROM table_75532 WHERE "Round" > '6' AND "Position" = 'winger' AND "Player" = 'evgeny afanasiev' | wikisql |
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,
... | Among patients diagnosed with closed fracture of base of skull with subarachnoid, subdural, and extradural hemorrhage, and loss of consciousness of unspecified duration, calculate the number of those who belonged to hispanic or latino - puertorican ethnic origin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "HISPANIC/LATINO - PUERTO RICAN" AND diagnoses.long_title = "Closed fracture of base of skull with subarachnoid, subdural, and extradural hemorrhage, with loss of ... | mimicsql_data |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCAT... | Compare the total number of different job titles for all those jobs in department 80 using a bar chart, show Y from low to high order. | SELECT JOB_TITLE, COUNT(JOB_TITLE) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID WHERE T1.DEPARTMENT_ID = 80 GROUP BY JOB_TITLE ORDER BY COUNT(JOB_TITLE) | nvbench |
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 average age of patients whose marital status is married and age is greater than or equal to 44? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.age >= "44" | mimicsql_data |
CREATE TABLE table_train_203 (
"id" int,
"gender" string,
"perforation" bool,
"hemoglobin_a1c_hba1c" float,
"peptic_ulcer_disease" bool,
"serum_c_peptide" float,
"gastrointestinal_disease" bool,
"serum_creatinine" float,
"age" float,
"NOUSE" float
) | serum c _ peptide level < 0.6 ng / ml | SELECT * FROM table_train_203 WHERE serum_c_peptide < 0.6 | criteria2sql |
CREATE TABLE table_name_23 (
record VARCHAR,
date VARCHAR
) | Which Record is on july 31? | SELECT record FROM table_name_23 WHERE date = "july 31" | sql_create_context |
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
)
... | provide the number of patients whose admission location is clinic referral/premature and discharge location is left against medical advi? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "CLINIC REFERRAL/PREMATURE" AND demographic.discharge_location = "LEFT AGAINST MEDICAL ADVI" | mimicsql_data |
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Students_in_Detention (
student_id INTEGER,
detention_id INTEGER,
incident_id INTEGER
)
CREATE TABLE Detention (
detention_id INTEGER,
detention_type_code VARCHAR(10),
te... | Return a bar chart about the distribution of other_details and the sum of monthly_rental , and group by attribute other_details. | SELECT other_details, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime t... | is systemicmean of patient 002-13643 second measured on the first intensive care unit visit greater than the first value measured on the first intensive care unit visit? | SELECT (SELECT vitalperiodic.systemicmean FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-13643') AND NOT patient.unitdischargetime ... | eicu |
CREATE TABLE table_203_672 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"venue" text,
"attendance" number
) | who was the only opponent to allow no points in a game ? | SELECT "opponent" FROM table_203_672 WHERE "result" = 0 | squall |
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,
... | 患者戚霞辉被开出的单价最高的药品有什么编码和名称及其单价在医院0335466中? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.UNIVALENT FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '戚霞辉' AND t_kc21.MED_SER_ORG_NO = '0335466') ORDER BY t_kc22.UNIVALENT DESC LIMIT 1 | css |
CREATE TABLE Customers (
gender VARCHAR
) | Show the number of customers for each gender. | SELECT gender, COUNT(*) FROM Customers GROUP BY gender | sql_create_context |
CREATE TABLE table_27293285_4 (
drawn VARCHAR,
lost VARCHAR,
tries_for VARCHAR
) | Name the drawn for lost being 5 and tries for 89 | SELECT drawn FROM table_27293285_4 WHERE lost = "5" AND tries_for = "89" | sql_create_context |
CREATE TABLE table_name_21 (
date VARCHAR,
circuit VARCHAR
) | What's the date of the circuit Winton Motor Raceway? | SELECT date FROM table_name_21 WHERE circuit = "winton motor raceway" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 列出患者49963274的检验报告单中结果指标均正常的检验报告单号 | SELECT jyjgzbb.BGDH FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '49963274' AND NOT jyjgzbb.BGDH IN (SELECT jyjgzb... | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number... | is patient 24762 given medication until 40 months ago? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 24762) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-40 month') | mimic_iii |
CREATE TABLE table_13940275_5 (
tries_against VARCHAR,
try_bonus VARCHAR
) | what's the tries against with try bonus being 10 | SELECT tries_against FROM table_13940275_5 WHERE try_bonus = "10" | sql_create_context |
CREATE TABLE table_name_23 (
score_1 VARCHAR,
away_team VARCHAR
) | What was the score of the match in which Portsmouth was the Away team? | SELECT score_1 FROM table_name_23 WHERE away_team = "portsmouth" | sql_create_context |
CREATE TABLE table_24989925_2 (
week INTEGER
) | How many weeks total are there? | SELECT MAX(week) FROM table_24989925_2 | sql_create_context |
CREATE TABLE nuclear_power_plants (
id text,
name text,
latitude text,
longitude text,
country text,
status text,
reactortype text,
reactormodel text,
constructionstartat text,
operationalfrom text,
operationalto text,
capacity text,
lastupdatedat text,
source tex... | Which country is Chinon-A3 in? | SELECT country FROM nuclear_power_plants WHERE name = "Chinon-A3" | geonucleardata |
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... | 自二零一三年十二月二十五日开始,截止到二零二一年十二月十四日,患者严美丽通过医保看病总共花了多少医疗费 | SELECT SUM(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.t_kc21_PERSON_NM = '严美丽' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2013-12-25' AND '2021-12-14' | css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.