context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_3830 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had the high point total on october 20? | SELECT "High points" FROM table_3830 WHERE "Date" = 'October 20' | wikisql |
CREATE TABLE table_name_66 (
_2_clubs VARCHAR,
total VARCHAR
) | What is the lowest 4 hoops, 2 clubs of the nation with a total of 38.25? | SELECT MIN(4 AS _hoops), _2_clubs FROM table_name_66 WHERE total = 38.25 | sql_create_context |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Student_Tests_Taken (
registration_id IN... | What is the date of enrollment of the course named 'Spanish', and count them by a bar chart, and list by the total number in desc. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Courses AS T1 JOIN Student_Course_Enrolment AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "Spanish" ORDER BY COUNT(date_of_enrolment) DESC | nvbench |
CREATE TABLE table_33237 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | Who is the host in the city of Philadelphia? | SELECT "Host" FROM table_33237 WHERE "City" = 'philadelphia' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | give me the number of patients whose admission year is less than 2154 and procedure icd9 code is 331? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2154" AND procedures.icd9_code = "331" | mimicsql_data |
CREATE TABLE table_60009 (
"Provider" text,
"Years" text,
"Free or pay" text,
"Transmission" text,
"On demand" text
) | Name the Provider that has a pay in 2006 , and a Transmission of iptv and digital terrestrial? | SELECT "Provider" FROM table_60009 WHERE "Free or pay" = 'pay' AND "Years" = '2006–' AND "Transmission" = 'iptv and digital terrestrial' | 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... | Comments containing \text but not \\text. | SELECT Comments.Id AS "comment_link", Comments.CreationDate FROM Comments LEFT JOIN Posts ON Comments.PostId = Posts.Id WHERE UserId = 7733418 AND Text LIKE '%.dump%' AND Tags LIKE '%sqlite%' ORDER BY CreationDate DESC | sede |
CREATE TABLE table_203_758 (
id number,
"no." number,
"dub no." number,
"english dubbed title / english subbed title\noriginal japanese title" text,
"original air date" text,
"english air date" text
) | how many episodes had both an original air date and an english air date ? | SELECT COUNT("english dubbed title / english subbed title\noriginal japanese title") FROM table_203_758 WHERE NOT "original air date" IS NULL AND NOT "english air date" IS NULL | squall |
CREATE TABLE table_68665 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
) | Name the total number of laps for 23rd position | SELECT COUNT("Laps") FROM table_68665 WHERE "Pos." = '23rd' | wikisql |
CREATE TABLE table_26577 (
"Processor" text,
"Brand name" text,
"Model (list)" text,
"Cores" real,
"L2 Cache" text,
"Socket" text,
"TDP" text
) | Whats the processor for p9xxx? | SELECT "Processor" FROM table_26577 WHERE "Model (list)" = 'P9xxx' | wikisql |
CREATE TABLE table_name_75 (
grid INTEGER,
driver VARCHAR,
laps VARCHAR
) | When Jean Alesi had laps less than 24, what was his highest grid? | SELECT MAX(grid) FROM table_name_75 WHERE driver = "jean alesi" AND laps < 24 | sql_create_context |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,... | how many times were patient 23969's visited the hospital in this year? | SELECT COUNT(DISTINCT admissions.hadm_id) FROM admissions WHERE admissions.subject_id = 23969 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_49019 (
"Date" text,
"Time ( GMT )" text,
"Serial" text,
"Apogee" text,
"Outcome" text
) | Which date has serial of 11c? | SELECT "Date" FROM table_49019 WHERE "Serial" = '11c' | 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... | 在针灸科在脑梗死后遗症住院的在05年6月25日到11年5月19日内平均花费用了多少钱? | SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '中医针灸科' AND t_kc21.IN_HOSP_DATE BETWEEN '2005-06-25' AND '2011-05-19' AND t_kc21.IN_DIAG_DIS_NM = '脑梗死后遗症' AND t_kc21.CLINIC_TYPE = '住院' | css |
CREATE TABLE table_name_65 (
frequency VARCHAR,
format VARCHAR,
owner VARCHAR
) | What is the frequency for the country station owned by Jim Pattison Group? | SELECT frequency FROM table_name_65 WHERE format = "country" AND owner = "jim pattison group" | sql_create_context |
CREATE TABLE table_42084 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | Which years in Orlando are featured with the center position? | SELECT "Years in Orlando" FROM table_42084 WHERE "Position" = 'center' | wikisql |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION varchar(4),
... | Show max(stu gpa) vs minimal stu gpa as scatter plot use a different color for each DEPT_CODE | SELECT MAX(STU_GPA), MIN(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_name_12 (
pop_density__per_km2_ INTEGER,
district VARCHAR,
s_barangay VARCHAR
) | What is the lowest population density for the district of Santa Cruz and a Barangay larger than 82? | SELECT MIN(pop_density__per_km2_) FROM table_name_12 WHERE district = "santa cruz" AND s_barangay > 82 | sql_create_context |
CREATE TABLE Scientists (
Name VARCHAR,
SSN VARCHAR
)
CREATE TABLE Projects (
Name VARCHAR,
Hours VARCHAR,
Code VARCHAR
)
CREATE TABLE AssignedTo (
Scientist VARCHAR,
Project VARCHAR
) | List all the scientists' names, their projects' names, and the hours worked by that scientist on each project, in alphabetical order of project name, and then scientist name. | SELECT T1.Name, T3.Name, T3.Hours FROM Scientists AS T1 JOIN AssignedTo AS T2 ON T1.SSN = T2.Scientist JOIN Projects AS T3 ON T2.Project = T3.Code ORDER BY T3.Name, T1.Name | 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 demographic ... | Get me the number of patients who have drug code bume2 and hematology as lab test category. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "BUME2" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_62051 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Competition" text
) | Which opponent completed a challenge competition with a result of 8-2 w? | SELECT "Opponent" FROM table_62051 WHERE "Competition" = 'challenge' AND "Result" = '8-2 w' | wikisql |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the sum of manufacturer , and group by attribute name, display in desc by the y-axis. | SELECT T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Manufacturer DESC | nvbench |
CREATE TABLE table_43840 (
"Series" text,
"Title" text,
"Broadcasts (TV) 1" real,
"Episodes (TV+extra) 2" text,
"Directors" text,
"Aired in Japan 3" text,
"US Release Date" text
) | What is Episodes (TV+extra) 2, when Broadcasts (TV) 1 is less than 13, and when Directors is 'Shigehito Takayanagi'? | SELECT "Episodes (TV+extra) 2" FROM table_43840 WHERE "Broadcasts (TV) 1" < '13' AND "Directors" = 'shigehito takayanagi' | wikisql |
CREATE TABLE table_204_583 (
id number,
"capacitor type" text,
"capacity" text,
"volts" text,
"temp." text,
"energy-to-weight ratio" text,
"power-to-weight ratio" text
) | what is the average temp of the nesccap electric double layer capacitor ? | SELECT AVG("temp.") FROM table_204_583 WHERE "capacitor type" = 'nesccap electric double-layer capacitor' | squall |
CREATE TABLE table_79791 (
"Game" real,
"Date" text,
"Location" text,
"Time" text,
"Attendance" real
) | What is the highest game number that had a time of 2:44? | SELECT MAX("Game") FROM table_79791 WHERE "Time" = '2:44' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | how many current patients was there. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL | mimic_iii |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date... | For those employees who was hired before 2002-06-21, draw a bar chart about the distribution of job_id and the average of employee_id , and group by attribute job_id, and I want to order y axis from low to high order. | SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code va... | what is the cheapest COACH flight between DALLAS and BALTIMORE leaving 8 10 | SELECT DISTINCT FLIGHT_0.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, date_day AS DATE... | atis |
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... | 79550795568这个住院就诊的入住病区叫什么?代码是什么?以及入院床位是哪一个 | SELECT zyjzjlb.RZBQDM, zyjzjlb.RZBQMC, zyjzjlb.RYCWH FROM zyjzjlb WHERE zyjzjlb.JZLSH = '79550795568' | css |
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 ... | 列出患者30728995的检验报告单日期在零二年八月二十七日之前的所对应的门诊就诊的流水号 | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM AND pers... | css |
CREATE TABLE table_35018 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What game has 28 points, and tampa bay lightning as the opponent? | SELECT "Game" FROM table_35018 WHERE "Points" = '28' AND "Opponent" = 'tampa bay lightning' | wikisql |
CREATE TABLE table_55890 (
"Name" text,
"Entered office" text,
"Left office" text,
"Political party" text,
"Monarchs served" text,
"Birth Place" text
) | What date did the prime minister who entered office on 7 December 1916 leave office? | SELECT "Left office" FROM table_55890 WHERE "Entered office" = '7 december 1916' | wikisql |
CREATE TABLE table_78268 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What was the time of the driver on grid 3? | SELECT "Time/Retired" FROM table_78268 WHERE "Grid" = '3' | wikisql |
CREATE TABLE table_68631 (
"Year" text,
"Record" text,
"Finish" text,
"Manager" text,
"Playoffs" text
) | Name the year with finish of 12th and record of 23-36 | SELECT "Year" FROM table_68631 WHERE "Finish" = '12th' AND "Record" = '23-36' | wikisql |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
... | How many companies that are not headquartered in the United States for each main industry? Show me a bar chart, and rank by the names from low to high. | SELECT Main_Industry, COUNT(Main_Industry) FROM company WHERE Headquarters <> 'USA' GROUP BY Main_Industry ORDER BY Main_Industry | nvbench |
CREATE TABLE table_name_11 (
year_s__won VARCHAR,
total VARCHAR
) | What years won have a total of 286? | SELECT year_s__won FROM table_name_11 WHERE total = 286 | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compa... | which is the flight number for the US flight from PHILADELPHIA to BOSTON is it 279 or is it 137338 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (((flight.flight_number = 137338 OR flight.flight_number = 279) AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON' AND flight.to_... | atis |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 来医疗机构7149475看病的人里,非本地的患者人数是多少 | SELECT COUNT(DISTINCT PERSON_ID) FROM t_kc21 WHERE MED_SER_ORG_NO = '7149475' AND (REMOTE_SETTLE_FLG = '异地1' OR REMOTE_SETTLE_FLG = '异地2') | css |
CREATE TABLE table_25539502_1 (
season INTEGER,
podiums VARCHAR
) | What is the latest season where he had 1 podium? | SELECT MAX(season) FROM table_25539502_1 WHERE podiums = 1 | sql_create_context |
CREATE TABLE table_name_10 (
goals_against INTEGER,
points VARCHAR,
lost VARCHAR
) | What are the total Goals against with 72 points and more than 37 losses? | SELECT SUM(goals_against) FROM table_name_10 WHERE points = 72 AND lost > 37 | sql_create_context |
CREATE TABLE movie (
mid number,
title text,
year number,
director text
)
CREATE TABLE rating (
rid number,
mid number,
stars number,
ratingdate time
)
CREATE TABLE reviewer (
rid number,
name text
) | What are the titles of all movies that have between 3 and 5 stars? | SELECT T2.title FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid WHERE T1.stars BETWEEN 3 AND 5 | spider |
CREATE TABLE table_33656 (
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | What is the score for the match where albert monta s was the partner? | SELECT "Score" FROM table_33656 WHERE "Partner" = 'albert montañés' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | what was the name of the medicine that patient 007-7646 was prescribed with in the same day after having been diagnosed with upper respiratory obstruction - due to tumor since 05/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 = '007-7646') AND diagnosis.diagnosi... | eicu |
CREATE TABLE table_name_32 (
class VARCHAR,
laps VARCHAR
) | What was the class when there were 325 laps? | SELECT class FROM table_name_32 WHERE laps = 325 | sql_create_context |
CREATE TABLE table_56585 (
"Unit" text,
"Complement" text,
"Killed" text,
"Wounded" text,
"Missing" text
) | How many were Wounded while in a Unit with a Complement of 83 off 9 Men? | SELECT "Wounded" FROM table_56585 WHERE "Complement" = '83 off 9 men' | wikisql |
CREATE TABLE AssignedTo (
Scientist int,
Project char(4)
)
CREATE TABLE Scientists (
SSN int,
Name Char(30)
)
CREATE TABLE Projects (
Code Char(4),
Name Char(50),
Hours int
) | what are the names of projects that require more than 300 hours, and how many scientists are assigned to each?, list by the Name in desc. | SELECT Name, COUNT(*) FROM Projects AS T1 JOIN AssignedTo AS T2 ON T1.Code = T2.Project WHERE T1.Hours > 300 GROUP BY T1.Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_57853 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | What is the tyre with a 56 chassis? | SELECT "Tyre" FROM table_57853 WHERE "Chassis" = '56' | wikisql |
CREATE TABLE table_1013129_8 (
college_junior_club_team VARCHAR,
player VARCHAR
) | What team is Keith Mccambridge on? | SELECT college_junior_club_team FROM table_1013129_8 WHERE player = "Keith McCambridge" | sql_create_context |
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... | 医生87598615一共诊治过多少门诊病人,在05-03-01到11-02-19期间 | SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN zzmzjzjlb ON hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX WHERE zzmzjzjlb.ZZYSGH = '87598615' AND zzmzjzjlb.JZKSRQ BETWEEN '2005-03-01' AND '2011-02-19' UNION SELECT COUNT(hz_info.RYBH) FROM hz_info JOIN fzzmzjzjlb ON hz_inf... | css |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE ... | which are the flights from DENVER to BALTIMORE or WASHINGTON | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight WHERE ((flight.to_airport = AIRPORT_SERVICE_1.airport_code AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND... | atis |
CREATE TABLE table_56317 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | What is the time/retired for mika h kkinen | SELECT "Time/Retired" FROM table_56317 WHERE "Driver" = 'mika häkkinen' | wikisql |
CREATE TABLE table_64092 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"County" text
) | What is the IHSAA Football Class for county 67 putnam at Greencastle? | SELECT "IHSAA Football Class" FROM table_64092 WHERE "County" = '67 putnam' AND "School" = 'greencastle' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime... | tell me the average systemicdiastolic in patient 033-22108 in a day before? | SELECT AVG(vitalperiodic.systemicdiastolic) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033-22108')) AND NOT vitalperiodic.systemicd... | eicu |
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... | give me the number of patients whose admission type is emergency and diagnoses icd9 code is 40391? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.icd9_code = "40391" | mimicsql_data |
CREATE TABLE table_204_727 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which countries won at least six bronze medals ? | SELECT "nation" FROM table_204_727 WHERE "bronze" >= 6 | squall |
CREATE TABLE table_name_47 (
place INTEGER,
draw VARCHAR,
points VARCHAR
) | Name the least place for draw more than 3 and points of 8 | SELECT MIN(place) FROM table_name_47 WHERE draw > 3 AND points = 8 | sql_create_context |
CREATE TABLE table_22180353_1 (
conformity_to_original_design VARCHAR,
registration VARCHAR
) | What is every conformity to original design if registration is HB-DAI? | SELECT conformity_to_original_design FROM table_22180353_1 WHERE registration = "HB-DAI" | sql_create_context |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE airport (
airport_code varchar,
airport_name text,... | list all flights at MKE | SELECT DISTINCT flight.flight_id FROM airport AS AIRPORT_0, airport AS AIRPORT_1, flight WHERE (flight.to_airport = AIRPORT_0.airport_code AND AIRPORT_0.airport_code = 'MKE') OR (flight.from_airport = AIRPORT_1.airport_code AND AIRPORT_1.airport_code = 'MKE') | atis |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 查查胃肠外科在03.02.04至18.10.15期间,因治疗腔隙性脑梗死这个疾病住院的平均费用是多少 | SELECT AVG(t_kc21.MED_AMOUT) FROM t_kc21 WHERE t_kc21.MED_ORG_DEPT_NM = '胃肠外科' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-02-04' AND '2018-10-15' AND t_kc21.IN_DIAG_DIS_NM = '腔隙性脑梗死' AND t_kc21.CLINIC_TYPE = '住院' | css |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '赵伟博' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE Students (
student_id INTEGER,
date_of_registration DATETIME,
date_of_latest_logon DATETIME,
login_name VARCHAR(40),
password VARCHAR(10),
personal_name VARCHAR(40),
middle_name VARCHAR(40),
family_name VARCHAR(40)
)
CREATE TABLE Student_Tests_Taken (
registration_id IN... | What are the enrollment dates of all the tests that have result 'Pass', and count them by a bar chart, and list in desc by the total number. | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) DESC | nvbench |
CREATE TABLE table_42564 (
"1861" real,
"1866" real,
"1872" real,
"1876" real,
"1881" real,
"1886" real,
"1891" real
) | What is the sum of 1891(s), when 1872 is less than 685, and when 1881 is less than 348? | SELECT SUM("1891") FROM table_42564 WHERE "1872" < '685' AND "1881" < '348' | wikisql |
CREATE TABLE table_name_49 (
round INTEGER,
event VARCHAR
) | How many rounds did the match at GCF: Strength and Honor last? | SELECT AVG(round) FROM table_name_49 WHERE event = "gcf: strength and honor" | sql_create_context |
CREATE TABLE ref_locations (
location_code text,
location_name text,
location_description text
)
CREATE TABLE documents_to_be_destroyed (
document_id number,
destruction_authorised_by_employee_id number,
destroyed_by_employee_id number,
planned_destruction_date time,
actual_destruction_... | Which employees have the role with code 'HR'? Find their names. | SELECT employee_name FROM employees WHERE role_code = "HR" | spider |
CREATE TABLE affected_region (
Region_id int,
Storm_ID int,
Number_city_affected real
)
CREATE TABLE storm (
Storm_ID int,
Name text,
Dates_active text,
Max_speed int,
Damage_millions_USD real,
Number_Deaths int
)
CREATE TABLE region (
Region_id int,
Region_code text,
R... | Draw a bar chart for how many storms occured in each region? | SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id | nvbench |
CREATE TABLE table_203_539 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" number
) | other than asian junior championships , what other time did they place 1st ? | SELECT "competition" FROM table_203_539 WHERE "competition" <> 'asian junior championships' AND "position" = 1 | squall |
CREATE TABLE table_13241993_3 (
part_6 VARCHAR,
episode__number VARCHAR
) | How many part 6 parts are there in the episode number 5? | SELECT COUNT(part_6) FROM table_13241993_3 WHERE episode__number = 5 | sql_create_context |
CREATE TABLE table_58013 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When the Away team scored 11.8 (74) how many people showed up? | SELECT "Crowd" FROM table_58013 WHERE "Away team score" = '11.8 (74)' | wikisql |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 将病患陶晴画医疗费总额不在769.78元以下的医疗记录中的入院诊断疾病名列出来,还有对应的编号 | 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 >= 769.78) UNION SELECT fgwyjzb.OUT_DIAG_DIS_CD, fgwyjzb.OUT_DIAG_DIS_NM FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '陶晴画' AND fgwyjzb.M... | css |
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... | 在2013年2月9日到2016年5月30日内患者51768625被多少医生看过病? | SELECT COUNT(DISTINCT mzjzjlb.ZZYSGH) 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 = '51768625' AND mzjzjlb.JZKSRQ BETWEEN '2013-02-09' AND '2016-05-30' | css |
CREATE TABLE table_39241 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Which Position has a Round larger than 14, and a School/Club Team of north texas? | SELECT "Position" FROM table_39241 WHERE "Round" > '14' AND "School/Club Team" = 'north texas' | wikisql |
CREATE TABLE table_7147 (
"Year" real,
"Artist" text,
"Album" text,
"Label" text,
"Credit" text
) | Who was the artist for the album, Christmas under the reunion label with the guitar? | SELECT "Artist" FROM table_7147 WHERE "Label" = 'reunion' AND "Credit" = 'guitar' AND "Album" = 'christmas' | 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... | count the number of patients younger than 20 years who suffer from neoplasm of uncertain behavior of other lymphatic and hematopoietic tissues/bone marrow transplant primary disease. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "NEOPLASM OF UNCERTAIN BEHAVIOR OF OTHER LYMPHATIC AND HEMATOPOIETIC TISSUES\BONE MARROW TRANSPLANT" AND demographic.age < "20" | mimicsql_data |
CREATE TABLE employees (
department_id VARCHAR
)
CREATE TABLE departments (
department_name VARCHAR,
department_id VARCHAR
) | display the department name and number of employees in each of the department. | SELECT T2.department_name, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.department_id = T2.department_id GROUP BY T2.department_name | sql_create_context |
CREATE TABLE table_204_647 (
id number,
"year" number,
"film" text,
"role" text,
"language" text
) | how many films were made in 2008 | SELECT COUNT("film") FROM table_204_647 WHERE "year" = 2008 | squall |
CREATE TABLE table_66755 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is the to par of the player from England with a t1 place? | SELECT "To par" FROM table_66755 WHERE "Country" = 'england' AND "Place" = 't1' | wikisql |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
... | top ruby users from kerala. | SELECT u.Id, CONCAT('http://stackoverflow.com/users/', u.Id), (SELECT DisplayName FROM Users AS udn WITH (nolock) WHERE udn.Id = u.Id), COUNT(*) AS UpVotes FROM Tags AS t WITH (nolock) INNER JOIN PostTags AS pt WITH (nolock) ON pt.TagId = t.Id INNER JOIN Posts AS p WITH (nolock) ON p.ParentId = pt.PostId INNER JOIN Vot... | sede |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | how many patients have stayed at the ward 45 since 3 years ago? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 45 AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-3 year')) | mimic_iii |
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... | which patients had cardiopulmonary resuscitation, not otherwise specified? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Cardiopulmonary resuscitation, not otherwise specified" | mimicsql_data |
CREATE TABLE table_name_71 (
wins VARCHAR,
win__percentage VARCHAR
) | Which win has 38.67% wins? | SELECT wins FROM table_name_71 WHERE win__percentage = "38.67%" | sql_create_context |
CREATE TABLE university (
founded VARCHAR,
affiliation VARCHAR
) | Find the founded year of the newest non public school. | SELECT founded FROM university WHERE affiliation <> 'Public' ORDER BY founded DESC LIMIT 1 | sql_create_context |
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... | 在患者75917305的医疗记录中,查一下医疗费总额不低于353.37元的入院诊断疾病的名称和编号 | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '75917305' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 353.37) | css |
CREATE TABLE table_978 (
"Year" real,
"Team Name" text,
"Division" text,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | What is the division for the year 2006? | SELECT "Division" FROM table_978 WHERE "Year" = '2006' | wikisql |
CREATE TABLE table_name_38 (
church_name VARCHAR,
year_built VARCHAR
) | Which church was built in 1600? | SELECT church_name FROM table_name_38 WHERE year_built = 1600 | sql_create_context |
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TA... | Return a histogram on what is the average high temperature for each day of week? | SELECT day_of_week, AVG(high_temperature) FROM weekly_weather GROUP BY day_of_week | nvbench |
CREATE TABLE table_79918 (
"Year" real,
"Men's singles" text,
"Women's singles" text,
"Men's doubles" text,
"Women's doubles" text,
"Mixed doubles" text
) | Which mixed doubles happened later than 2011? | SELECT "Mixed doubles" FROM table_79918 WHERE "Year" > '2011' | wikisql |
CREATE TABLE table_2418 (
"Political parties" text,
"% 2006" text,
"Seats 2006" real,
"% 2001" text,
"Seats 2001" real,
"% 1997" text
) | How many seats in 2006 has a % 1997 rating of 38.9? | SELECT COUNT("Seats 2006") FROM table_2418 WHERE "% 1997" = '38.9' | wikisql |
CREATE TABLE table_73151 (
"#" real,
"Episode" text,
"UK air date" text,
"Timeslot" text,
"Viewers (millions)" text,
"Audience share in timeslot" text
) | Name the total number of viewers for audience share in timeslot for 10.2% | SELECT COUNT("Viewers (millions)") FROM table_73151 WHERE "Audience share in timeslot" = '10.2%' | wikisql |
CREATE TABLE table_name_36 (
points_1 INTEGER,
lost VARCHAR,
drawn VARCHAR,
goal_difference VARCHAR
) | Which Points 1 has Drawn of 5, and a Goal Difference of +58, and a Lost larger than 4? | SELECT MAX(points_1) FROM table_name_36 WHERE drawn = 5 AND goal_difference = "+58" AND lost > 4 | 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,
... | give me the number of patients whose death status is 0 and procedure long title is circumcision? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.long_title = "Circumcision" | mimicsql_data |
CREATE TABLE table_29790 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What was the score for series 2 3? | SELECT "Score" FROM table_29790 WHERE "Series" = '2–3' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
... | GraphQL StackOverflow posts over time. | SELECT CONCAT(TIME_TO_STR(CreationDate, '%Y'), ' ', TIME_TO_STR(CreationDate, '%m')) AS dt, COUNT(1) AS num_serverless_mentions FROM Posts WHERE Title LIKE '%graphql%' GROUP BY CONCAT(TIME_TO_STR(CreationDate, '%Y'), ' ', TIME_TO_STR(CreationDate, '%m')) | sede |
CREATE TABLE table_name_45 (
year_s__won VARCHAR,
player VARCHAR
) | What year(s) did Mike Weir win player of the year? | SELECT year_s__won FROM table_name_45 WHERE player = "mike weir" | sql_create_context |
CREATE TABLE table_47443 (
"Series Sorted" text,
"Title" text,
"Doctor" text,
"Featuring" text,
"Released" text
) | what is the released when the series is sorted 6y/ai? | SELECT "Released" FROM table_47443 WHERE "Series Sorted" = '6y/ai' | wikisql |
CREATE TABLE table_1046454_1 (
regular_season VARCHAR,
year VARCHAR
) | what are all the regular season where year is 2011 | SELECT regular_season FROM table_1046454_1 WHERE year = 2011 | sql_create_context |
CREATE TABLE table_28643 (
"Rank by average" real,
"Place" real,
"Couple" text,
"Total points" text,
"Number of dances" real,
"Average" text
) | How many ranks by average when Keiron & Brianne are the couple? | SELECT COUNT("Rank by average") FROM table_28643 WHERE "Couple" = 'Keiron & Brianne' | 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, give me the comparison about the sum of code over the headquarter , and group by attribute headquarter, and sort in descending by the bar. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC | nvbench |
CREATE TABLE table_24781886_3 (
air_date VARCHAR,
viewers VARCHAR
) | When 7.08 is the amount of viewers what is the air date? | SELECT air_date FROM table_24781886_3 WHERE viewers = "7.08" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TA... | give me the latest NW flight from MILWAUKEE to TACOMA tomorrow | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'TACOMA' AND date_day.day_number = 20 AND date_day.month_number = 1 AND ... | atis |
CREATE TABLE table_14877 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
) | What's the top year with the Chassis ats hs1? | SELECT MAX("Year") FROM table_14877 WHERE "Chassis" = 'ats hs1' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.