context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_53177 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What venue hosted a match with a 3-0 score on December 7, 2002? | SELECT "Venue" FROM table_53177 WHERE "Score" = '3-0' AND "Date" = 'december 7, 2002' | wikisql |
CREATE TABLE table_23643 (
"Standard Yarn Weight System" text,
"Yarn Type (US)" text,
"Ply (UK, NZ, AU)" text,
"m/100g" text,
"Wraps Per Inch (WPI)" text
) | Name the ply (uk, nz, au) for fingering | SELECT "Ply (UK, NZ, AU)" FROM table_23643 WHERE "Yarn Type (US)" = 'Fingering' | wikisql |
CREATE TABLE table_name_8 (
driver VARCHAR,
date VARCHAR,
race VARCHAR
) | Which Driver has a Date of 16th september 1951, and a Race of dns? | SELECT driver FROM table_name_8 WHERE date = "16th september 1951" AND race = "dns" | sql_create_context |
CREATE TABLE table_name_49 (
lost INTEGER,
points INTEGER
) | What average lost has points greater than 108? | SELECT AVG(lost) FROM table_name_49 WHERE points > 108 | 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... | 列出姜淑华患者医疗记录中医疗费总额不少于2959.88元的出院诊断疾病名称以及编码都是什么? | SELECT gwyjzb.OUT_DIAG_DIS_CD, gwyjzb.OUT_DIAG_DIS_NM FROM gwyjzb WHERE gwyjzb.PERSON_NM = '姜淑华' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT >= 2959.88) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '姜淑华' AND fgwyjzb.... | css |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 排序一下团伙成员苗建木最常去的哪些医院? | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_NM = '苗建木' GROUP BY t_kc21.MED_SER_ORG_NO ORDER BY COUNT(*) DESC | css |
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... | 白蛋白的参考值范围下限和上限在哪个数值范围内,门诊可诊断患者患有痴呆 | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE zzmzjzjlb.JZZDSM = '痴呆' AND jyjgzbb.JCZBMC = '白蛋白' UNION SELECT jyjgzbb.CKZFWXX, jyjgz... | css |
CREATE TABLE table_6903 (
"Year" text,
"Playoff round" text,
"Venue" text,
"Winner" text,
"Result" text,
"Loser" text
) | What is the Venue when the result was 88 87? | SELECT "Venue" FROM table_6903 WHERE "Result" = '88–87' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE patients (
... | in the last hospital visit patient 27964 had been in an emergency room? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 27964 AND admissions.admission_location = 'emergency room admit' AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
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 treatment (
treat... | during this hospital encounter what is patient 022-78423's age? | SELECT patient.age FROM patient WHERE patient.uniquepid = '022-78423' AND patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE table_15737 (
"Season" text,
"Team Name" text,
"Games" real,
"Losses" real,
"Points" real
) | What is the average number of points for a team that played 17 games and had more than 15 losses? | SELECT AVG("Points") FROM table_15737 WHERE "Games" = '17' AND "Losses" > '15' | wikisql |
CREATE TABLE Products (
product_id INTEGER,
parent_product_id INTEGER,
production_type_code VARCHAR(15),
unit_price DECIMAL(19,4),
product_name VARCHAR(80),
product_color VARCHAR(20),
product_size VARCHAR(20)
)
CREATE TABLE Orders (
order_id INTEGER,
customer_id INTEGER,
date_or... | What is the relationship between account name and the number of transactions for each account? Return a scatter chart. | SELECT account_name, COUNT(*) FROM Financial_Transactions AS T1 JOIN Accounts AS T2 ON T1.account_id = T2.account_id GROUP BY T1.account_id | nvbench |
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 ... | 在医疗就诊21869177682的病号沈天成要查询的检验报告单? | SELECT * FROM jybgb WHERE jybgb.JZLSH = '21869177682' | css |
CREATE TABLE table_74231 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | What is the place and when was the year when the women's doubles womens were Bai yang Niu Jianfeng? | SELECT "Year Location" FROM table_74231 WHERE "Womens Doubles" = 'Bai Yang Niu Jianfeng' | wikisql |
CREATE TABLE table_name_87 (
date VARCHAR,
opposing_team VARCHAR
) | What was the date of the game against Oxford United? | SELECT date FROM table_name_87 WHERE opposing_team = "oxford united" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course (
course_id int,
na... | Who are the upper-level classes taught by ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN program_... | advising |
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... | I want to know the proportion of All_Games_Percent for each all neutral. | SELECT All_Neutral, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE table_name_43 (
performances INTEGER,
role VARCHAR
) | Name the most performances for geoffrey fitton | SELECT MAX(performances) FROM table_name_43 WHERE role = "geoffrey fitton" | sql_create_context |
CREATE TABLE table_name_2 (
mountains_classification VARCHAR,
winner VARCHAR
) | What is the Mountains Classification for Winner jos luis carrasco? | SELECT mountains_classification FROM table_name_2 WHERE winner = "josé luis carrasco" | sql_create_context |
CREATE TABLE table_1140080_2 (
race VARCHAR,
constructor VARCHAR
) | what's the race winner with constructor renault | SELECT race AS Winner FROM table_1140080_2 WHERE constructor = "Renault" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | which type of drug is timolol maleate 0.5%? | SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "Timolol Maleate 0.5%" | mimicsql_data |
CREATE TABLE train (
Train_ID int,
Train_Num text,
Name text,
From text,
Arrival text,
Railway_ID int
)
CREATE TABLE railway_manage (
Railway_ID int,
Manager_ID int,
From_Year text
)
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts... | Compare the total number of trains in each name by a bar graph, sort y-axis in desc order. | SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY COUNT(Name) 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... | provide the number of patients whose lab test item id is 5148. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "51458" | mimicsql_data |
CREATE TABLE table_name_16 (
opponent VARCHAR,
score VARCHAR,
december VARCHAR,
game VARCHAR
) | December smaller than 14, and a Game smaller than 28, and a Score of 6 - 6 involved what opponent? | SELECT opponent FROM table_name_16 WHERE december < 14 AND game < 28 AND score = "6 - 6" | sql_create_context |
CREATE TABLE table_42761 (
"Element" text,
"Nuclide" text,
"Z ( p )" real,
"N ( n )" real,
"isotopic mass ( u )" text
) | What is the highest Z (p) when arsenic is the element, and the N (n) is more than 42 | SELECT MAX("Z ( p )") FROM table_42761 WHERE "Element" = 'arsenic' AND "N ( n )" > '42' | wikisql |
CREATE TABLE table_62266 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | What is Score, when Date is 'May 11'? | SELECT "Score" FROM table_62266 WHERE "Date" = 'may 11' | wikisql |
CREATE TABLE table_22014431_3 (
total VARCHAR,
tosses_pyramids VARCHAR
) | What is the total if 44 is tosses/pyramids? | SELECT total FROM table_22014431_3 WHERE tosses_pyramids = "44" | 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 procedure long title and icu stay id of subject id 74032? | SELECT procedures.long_title, prescriptions.icustay_id FROM procedures INNER JOIN prescriptions ON procedures.hadm_id = prescriptions.hadm_id WHERE procedures.subject_id = "74032" | mimicsql_data |
CREATE TABLE table_name_5 (
crowd VARCHAR,
away_team VARCHAR
) | What was the attendance of the South Melbourne away game? | SELECT COUNT(crowd) FROM table_name_5 WHERE away_team = "south melbourne" | sql_create_context |
CREATE TABLE table_17502 (
".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
) | What are all the 100 m group (mm) with a .308 winchester cartridge type of .300 winchester magnum cartridge type | SELECT "100 m group (mm)" FROM table_17502 WHERE ".308 Winchester cartridge type" = '.300 Winchester Magnum cartridge type' | wikisql |
CREATE TABLE film_text (
film_id number,
title text,
description text
)
CREATE TABLE film_actor (
actor_id number,
film_id number,
last_update time
)
CREATE TABLE film (
film_id number,
title text,
description text,
release_year time,
language_id number,
original_langua... | Give the districts which have two or more addresses. | SELECT district FROM address GROUP BY district HAVING COUNT(*) >= 2 | spider |
CREATE TABLE table_name_92 (
japanese VARCHAR,
korean VARCHAR
) | Which JAPANESE has a KOREAN of / sanahwasa? | SELECT japanese FROM table_name_92 WHERE korean = "상나화수 / sanahwasa" | sql_create_context |
CREATE TABLE table_77214 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is player raymond floyd's country? | SELECT "Country" FROM table_77214 WHERE "Player" = 'raymond floyd' | 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... | what is the number of patients whose age is less than 49 and procedure short title is clo endosc bx bile duct? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "49" AND procedures.short_title = "Clo endosc bx bile duct" | mimicsql_data |
CREATE TABLE table_31564 (
"Year" real,
"Competition" text,
"Date" text,
"Location" text,
"Score" text,
"Result" text
) | How many years has there been a competition in Helsinki? | SELECT COUNT("Year") FROM table_31564 WHERE "Location" = 'helsinki' | wikisql |
CREATE TABLE table_6177 (
"Res." text,
"Record" text,
"Opponent" text,
"Type" text,
"Rd., Time" text,
"Date" text
) | What is the type when Robert Villemain had a record at 109 1 2? | SELECT "Type" FROM table_6177 WHERE "Opponent" = 'robert villemain' AND "Record" = '109–1–2' | 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... | 编号45775351的患者之前患过什么病 | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '45775351' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '45775351' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_ID = '45775351' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG... | css |
CREATE TABLE table_train_67 (
"id" int,
"corticosteroid_therapy" bool,
"viral_infection" bool,
"active_infection" bool,
"hiv_infection" bool,
"neutropenia" int,
"receiving_prednisolone" int,
"age" float,
"NOUSE" float
) | presence of hiv infection | SELECT * FROM table_train_67 WHERE hiv_infection = 1 | criteria2sql |
CREATE TABLE table_51838 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | WHAT WAS THE SCORE IN THE FINAL AGAINST RABIE CHAKI? | SELECT "Score" FROM table_51838 WHERE "Opponent in the final" = 'rabie chaki' | wikisql |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
... | had patient 1372 been ordered with quetiapine fumarate, phenylephrine or ondansetron until 05/2101? | SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 1372) AND prescriptions.drug IN ('quetiapine fumarate', 'phenylephrine', 'ondansetron') AND STRFTIME('%y-%m', prescriptions.startdate) <= '2101-05' | mimic_iii |
CREATE TABLE table_45297 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | In the fight against Brandon Bledsoe, how many rounds did the fight last? | SELECT "Round" FROM table_45297 WHERE "Opponent" = 'brandon bledsoe' | wikisql |
CREATE TABLE table_72503 (
"Shirt No" real,
"Nationality" text,
"Player" text,
"Birth Date" text,
"Height" real,
"Position" text
) | What is Roman Bragin's position? | SELECT "Position" FROM table_72503 WHERE "Player" = 'Roman Bragin' | 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... | 从02年2月17日开始05年10月13日结束的医疗机构5215588的统筹总金额和总金额是多少元? | SELECT SUM(t_kc24.MED_AMOUT), SUM(t_kc24.OVE_PAY) 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 = '5215588' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-02-17' AND '2005-10-13' | css |
CREATE TABLE table_name_55 (
number_of_contestants VARCHAR,
international_destinations VARCHAR
) | What is Number of Contestants, when International Destinations is London Lisbon? | SELECT number_of_contestants FROM table_name_55 WHERE international_destinations = "london lisbon" | sql_create_context |
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... | how many patients born before 2089 had drug code clot10? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2089" AND prescriptions.formulary_drug_cd = "CLOT10" | mimicsql_data |
CREATE TABLE Bookings (
Booking_ID INTEGER,
Customer_ID INTEGER,
Workshop_Group_ID VARCHAR(100),
Status_Code CHAR(15),
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Marketing_Regi... | What are the names of the workshop groups that have bookings with status code 'stop', and count them by a bar chart, rank X-axis from low to high order. | SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY Store_Name | 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... | for patient id 29541, specify the icd9 code and duration of hospital stay | SELECT demographic.days_stay, procedures.long_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "29541" | mimicsql_data |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the job_id . | SELECT JOB_ID, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_204_341 (
id number,
"name in english" text,
"name in turkish" text,
"area (km2)" text,
"depth" text,
"location (districts and/or provinces)" text
) | does lake bafa or lake yay have a bigger area ? | SELECT "name in english" FROM table_204_341 WHERE "name in english" IN ('lake bafa', 'lake yay') ORDER BY "area (km2)" DESC LIMIT 1 | squall |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 看一下编号为16021187507的医疗就诊的出院日期 | SELECT OUT_HOSP_DATE FROM t_kc21 WHERE MED_CLINIC_ID = '16021187507' | css |
CREATE TABLE table_203_250 (
id number,
"name" text,
"type" text,
"r.a. (j2000)" text,
"dec. (j2000)" text,
"redshift (km/s)" text,
"apparent magnitude" number
) | name the member with the highest apparent magnitude . | SELECT "name" FROM table_203_250 ORDER BY "apparent magnitude" DESC LIMIT 1 | squall |
CREATE TABLE table_name_99 (
chorley INTEGER,
preston VARCHAR,
west_lancashire VARCHAR
) | What is the lowest Chorley with a 6 Preston and a 4 for West Lancashire? | SELECT MIN(chorley) FROM table_name_99 WHERE preston = 6 AND west_lancashire < 4 | sql_create_context |
CREATE TABLE table_19448 (
"Position" text,
"Number" real,
"Name" text,
"Height" text,
"Weight" text,
"Class" text,
"Hometown" text,
"Games\u2191" real
) | What are all weights for the number 27? | SELECT "Weight" FROM table_19448 WHERE "Number" = '27' | wikisql |
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,
... | 看看编号为61436514102的门诊就诊记录病患体征的日期时间 | SELECT wdmzjzjlb.JLSJ FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '61436514102' UNION SELECT bdmzjzjlb.JLSJ FROM bdmzjzjlb WHERE bdmzjzjlb.JZLSH = '61436514102' | css |
CREATE TABLE Elimination (
Elimination_ID text,
Wrestler_ID text,
Team text,
Eliminated_By text,
Elimination_Move text,
Time text
)
CREATE TABLE wrestler (
Wrestler_ID int,
Name text,
Reign text,
Days_held text,
Location text,
Event text
) | Create a bar chart showing how many team across team | SELECT Team, COUNT(Team) FROM Elimination GROUP BY Team | nvbench |
CREATE TABLE table_54218 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | How many laps were driven in 2:54:23.8? | SELECT SUM("Laps") FROM table_54218 WHERE "Time/Retired" = '2:54:23.8' | wikisql |
CREATE TABLE Departments (
department_id INTEGER,
dept_store_id INTEGER,
department_name VARCHAR(80)
)
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(10),
order_date DATETIME
)
CREATE TABLE Customers (
customer_id INTEGER,
payment_me... | Return the names and ids of customers who have TN in their address by a bar chart, and display names in descending order. | SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_name DESC | nvbench |
CREATE TABLE employee (
fname VARCHAR,
lname VARCHAR,
salary INTEGER
) | Return the first names and last names of employees who earn more than 30000 in salary. | SELECT fname, lname FROM employee WHERE salary > 30000 | sql_create_context |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
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,... | 列出患者姜浩歌就诊科室在医院1560846中名称包含牙病的所有门诊就诊记录是什么流水号? | SELECT mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND pers... | css |
CREATE TABLE table_77815 (
"Name" text,
"Date of birth" text,
"Position(s)" text,
"Seasons" text,
"Matches & (Goals) (League + Finals + KNVB-Cup)" text,
"Previous club" text
) | What previous club was born on October 22, 1993? | SELECT "Previous club" FROM table_77815 WHERE "Date of birth" = 'october 22, 1993' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | give me the number of urgent hospital admission patients who are taking senna medication. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "URGENT" AND prescriptions.drug = "Senna" | mimicsql_data |
CREATE TABLE table_36537 (
"Date" text,
"Episode" real,
"Performer 1" text,
"Performer 2" text,
"Performer 3" text,
"Performer 4" text
) | Who is performer 2 of the episode on 9 April 1993 with Josie Lawrence as performer 4? | SELECT "Performer 2" FROM table_36537 WHERE "Performer 4" = 'josie lawrence' AND "Date" = '9 april 1993' | wikisql |
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... | Show me about the distribution of meter_500 and ID in a bar chart, order names in asc order please. | SELECT meter_500, ID FROM swimmer ORDER BY meter_500 | nvbench |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | what is age and diagnoses icd9 code of subject id 65759? | SELECT demographic.age, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "65759" | mimicsql_data |
CREATE TABLE Asset_Parts (
asset_id INTEGER,
part_id INTEGER
)
CREATE TABLE Parts (
part_id INTEGER,
part_name VARCHAR(255),
chargeable_yn VARCHAR(1),
chargeable_amount VARCHAR(20),
other_part_details VARCHAR(255)
)
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEG... | Return a bar chart on how many engineers did each staff contact? List both the contact staff name and number of engineers contacted, I want to rank from low to high by the bar. | SELECT staff_name, COUNT(*) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id GROUP BY T1.staff_name ORDER BY staff_name | nvbench |
CREATE TABLE table_3708 (
"Total #" real,
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | How many items appear in the written by column in episode 3? | SELECT COUNT("Written by") FROM table_3708 WHERE "Episode #" = '3' | wikisql |
CREATE TABLE table_25740 (
"Season" text,
"Oberbayern A" text,
"Oberbayern B" text,
"Niederbayern" text,
"Schwaben" text,
"Oberpfalz" text
) | When fc oberau is the oberbayern a what is the oberpfalz? | SELECT "Oberpfalz" FROM table_25740 WHERE "Oberbayern A" = 'FC Oberau' | wikisql |
CREATE TABLE table_11541 (
"State" text,
"Interview" real,
"Swimsuit" real,
"Evening Gown" real,
"Average" real
) | What is the lowest swimsuit that has an evening gown bigger than 8.794 for illinois? | SELECT MIN("Swimsuit") FROM table_11541 WHERE "Evening Gown" > '8.794' AND "State" = 'illinois' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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... | 患者41170186435在门诊就诊期间的身高、体重、体温、收缩压、心率、舒张压、呼吸频率、脉率都是什么数据? | SELECT mzjzjlb.SG, mzjzjlb.TZ, mzjzjlb.TW, mzjzjlb.SSY, mzjzjlb.SZY, mzjzjlb.XL, mzjzjlb.HXPLC, mzjzjlb.ML FROM mzjzjlb WHERE mzjzjlb.JZLSH = '41170186435' | css |
CREATE TABLE table_name_52 (
region VARCHAR,
home_venue VARCHAR
) | What region has giuseppe sivori as a home venue? | SELECT region FROM table_name_52 WHERE home_venue = "giuseppe sivori" | sql_create_context |
CREATE TABLE PersonFriend (
name VARCHAR,
friend VARCHAR
)
CREATE TABLE person (
age INTEGER
)
CREATE TABLE Person (
name VARCHAR,
age INTEGER
) | Who has friends that are younger than the average age? | SELECT DISTINCT T2.name FROM person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < (SELECT AVG(age) FROM person) | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id n... | calculate the number of patients diagnosed with ocl vrtb art wo infrct since 1 year ago. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ocl vrtb art wo infrct') AND DATETIME(diagnoses_icd.chartt... | mimic_iii |
CREATE TABLE table_name_96 (
average INTEGER,
swimsuit VARCHAR,
evening_gown VARCHAR
) | How many averages had a swimsuit number of 8.42 and an evening gown number that was less than 8.71? | SELECT SUM(average) FROM table_name_96 WHERE swimsuit = 8.42 AND evening_gown < 8.71 | sql_create_context |
CREATE TABLE table_53361 (
"City" text,
"Country" text,
"Airport" text,
"IATA" text,
"ICAO" text
) | Name the city for thailand | SELECT "City" FROM table_53361 WHERE "Country" = 'thailand' | wikisql |
CREATE TABLE table_name_22 (
game INTEGER,
december VARCHAR,
score VARCHAR
) | What is the lowest Game, when December is greater than 13, and when Score is '5 - 0'? | SELECT MIN(game) FROM table_name_22 WHERE december > 13 AND score = "5 - 0" | sql_create_context |
CREATE TABLE member (
Member_ID int,
Name text,
Country text,
College_ID int
)
CREATE TABLE round (
Round_ID int,
Member_ID int,
Decoration_Theme text,
Rank_in_Round int
)
CREATE TABLE college (
College_ID int,
Name text,
Leader_Name text,
College_Location text
) | Return a bar chart showing how many members have visited for each college, sort from low to high by the X-axis. | SELECT T1.Name, COUNT(T1.Name) FROM college AS T1 JOIN member AS T2 ON T1.College_ID = T2.College_ID GROUP BY T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_name_17 (
to_par VARCHAR,
country VARCHAR,
player VARCHAR
) | What was the To par for United States golfer fred couples? | SELECT to_par FROM table_name_17 WHERE country = "united states" AND player = "fred couples" | sql_create_context |
CREATE TABLE table_19192 (
"s Car plate (starting 1937)" text,
"Voivodeship or city" text,
"Capital" text,
"Area (1930) in 1,000skm 2" text,
"Population (1931) in 1,000s" text
) | Name the population in 1931 for lubelskie | SELECT "Population (1931) in 1,000s" FROM table_19192 WHERE "Voivodeship or city" = 'lubelskie' | wikisql |
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... | how many female patients have been diagnosed with paralytic ileus? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.gender = "F" AND diagnoses.short_title = "Paralytic ileus" | mimicsql_data |
CREATE TABLE table_name_54 (
round VARCHAR,
position VARCHAR,
player VARCHAR
) | What round was Andre Fluellen drafted as a Defensive Tackle? | SELECT COUNT(round) FROM table_name_54 WHERE position = "defensive tackle" AND player = "andre fluellen" | 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 demographic (
subject_id text,
hadm_id t... | How many patients of white russian ethnicity were given the drug through both eyes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND prescriptions.route = "BOTH EYES" | mimicsql_data |
CREATE TABLE table_38618 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the sum of againsts the team with less than 38 played had? | SELECT SUM("Against") FROM table_38618 WHERE "Played" < '38' | wikisql |
CREATE TABLE table_name_56 (
population_density__per_km²_ VARCHAR,
population__2006_ VARCHAR
) | What population density (per km) that has 84 as the population (2006)? | SELECT population_density__per_km²_ FROM table_name_56 WHERE population__2006_ = "84" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | when did patient 42473 first have the maximum mch - value in 12/this year? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42473) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mch') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIM... | mimic_iii |
CREATE TABLE table_75374 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | What is the lowest week that has an attendance greater than 23,058, with october 24, 1943 as the date? | SELECT MIN("Week") FROM table_75374 WHERE "Attendance" > '23,058' AND "Date" = 'october 24, 1943' | wikisql |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Answers that have source code for java questions. | SELECT a.Body AS "Answeres", a.Score, q.Id AS "post_link", q.Tags AS " Question Tags", q.Body, q.AnswerCount, q.Id FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id JOIN PostTags AS t ON q.Id = t.PostId WHERE q.AnswerCount > 1 AND a.Body LIKE '%<code>%' AND (t.TagId = 16) ORDER BY q.Id DESC | sede |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
... | Will I be able to take ALA 250 and ALA 115 during the same semester ? | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'ALA' AND COURSE_0... | advising |
CREATE TABLE table_name_9 (
Id VARCHAR
) | Name the 2011 with 2002 of 1r and 2009 of a | SELECT 2011 FROM table_name_9 WHERE 2002 = "1r" AND 2009 = "a" | sql_create_context |
CREATE TABLE table_2081 (
"Year" real,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | What year was the average speed 145.24 | SELECT MAX("Year") FROM table_2081 WHERE "Average Speed (mph)" = '145.24' | wikisql |
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE section (
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0),
bui... | Bar chart of total number of credits from each dept name, and sort in asc by the total number of credits. | SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name ORDER BY SUM(credits) | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | how many patients are below 85 years of age have undergone other diagnostic procedures on skin and subcutaneous tissue? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.age < "85" AND procedures.long_title = "Other diagnostic procedures on skin and subcutaneous tissue" | mimicsql_data |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | how many patients whose days of hospital stay is greater than 14 and item id is 51200? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "14" AND lab.itemid = "51200" | mimicsql_data |
CREATE TABLE table_72019 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text
) | What Losing bonus has a Points against of 588? | SELECT "Losing bonus" FROM table_72019 WHERE "Points against" = '588' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment tex... | Tags of the most hated Posts. | SELECT TagName, COUNT(*) AS freq FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.Id = PostTags.PostId WHERE Posts.Score < -10 GROUP BY TagName ORDER BY freq DESC LIMIT 50 | sede |
CREATE TABLE table_name_88 (
time VARCHAR,
machine VARCHAR,
rider_s_ VARCHAR
) | What time did bruce anstey complete in a honda 1000cc? | SELECT time FROM table_name_88 WHERE machine = "honda 1000cc" AND rider_s_ = "bruce anstey" | 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... | count the number of patients whose marital status is married and drug route is tp? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.marital_status = "MARRIED" AND prescriptions.route = "TP" | mimicsql_data |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE ... | Popular MongoDB Queries by ViewCount (Year Normalized). | SELECT Score, ViewCount, CreationDate, DATEDIFF(YEAR, CreationDate, GETDATE()) + 1 AS "YearsOpen", (ViewCount / (DATEDIFF(YEAR, CreationDate, GETDATE()) + 1)) AS "NewScore", LastActivityDate, Title, Id, Tags FROM Posts WHERE Title LIKE '%mongodb%' OR Tags LIKE '%mongodb%' ORDER BY NewScore DESC | sede |
CREATE TABLE Video_Games (
GameID INTEGER,
GName VARCHAR(40),
GType VARCHAR(40)
)
CREATE TABLE SportsInfo (
StuID INTEGER,
SportName VARCHAR(32),
HoursPerWeek INTEGER,
GamesPlayed INTEGER,
OnScholarship VARCHAR(1)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
F... | Give me a histogram for how many students play each sport?, and show X-axis in ascending order. | SELECT SportName, COUNT(*) FROM SportsInfo GROUP BY SportName ORDER BY SportName | nvbench |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTa... | Good question vs includes code. | SELECT MAX(CreationDate) FROM Posts | sede |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Answer older than the question. | SELECT q.Id AS "post_link", a.Id AS "post_link" FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id WHERE (q.PostTypeId = 1) AND (q.AnswerCount > 0) AND (a.CreationDate < q.CreationDate) | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.