context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_75 (
chassis VARCHAR,
entrant VARCHAR,
points VARCHAR
) | What was the chassis when the entrant was Lavazza March, and the points were 0.5? | SELECT chassis FROM table_name_75 WHERE entrant = "lavazza march" AND points = 0.5 | sql_create_context |
CREATE TABLE table_name_23 (
rank INTEGER,
total INTEGER
) | Which rank has a total smaller than 1? | SELECT AVG(rank) FROM table_name_23 WHERE total < 1 | sql_create_context |
CREATE TABLE table_name_65 (
lost VARCHAR,
points VARCHAR,
against VARCHAR
) | How many games lost for team(s) with less than 4 paints and against total of over 340? | SELECT COUNT(lost) FROM table_name_65 WHERE points < 4 AND against > 340 | sql_create_context |
CREATE TABLE table_16271 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | When did the episode titled 'Lucky Strike' air for the first time? | SELECT "Original air date" FROM table_16271 WHERE "Title" = 'Lucky Strike' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | what is the top five of the frequent input event? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_41846 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | How many games does novica veli kovi have when there's more than 24 rebounds? | SELECT COUNT("Games") FROM table_41846 WHERE "Name" = 'novica veličković' AND "Rebounds" > '24' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
... | 65516243这位患者的223859指标在一四年十一月十二日至一六年九月四日期间的情况 | (SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN 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 = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = ... | css |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
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 admissions (
... | when did patient 94229 receive potassium chloride prescription first this month? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 94229) AND prescriptions.drug = 'potassium chloride' AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ... | mimic_iii |
CREATE TABLE table_59991 (
"Rank" real,
"Name" text,
"Years" text,
"Current Club" text,
"Goals" real,
"Apps" real,
"Ratio" real
) | Which Goals have a Ratio of 0.29? | SELECT "Goals" FROM table_59991 WHERE "Ratio" = '0.29' | wikisql |
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 regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALA... | For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, and list by the Y-axis from low to high. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
pati... | the list of the patient ids of patients diagnosed with pleural effusion - transudate by lab analysis last year. | SELECT patient.uniquepid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'pleural effusion - transudate by lab analysis' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) | eicu |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,... | let 's look at BALTIMORE to PHILADELPHIA again | 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 CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHIL... | atis |
CREATE TABLE table_name_45 (
team_1 VARCHAR
) | What is 1st Leg, when Team 1 is 'Portol Palma Mallorca'? | SELECT 1 AS st_leg FROM table_name_45 WHERE team_1 = "portol palma mallorca" | sql_create_context |
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... | Return a bar chart about the distribution of All_Home and the sum of Team_ID , and group by attribute All_Home. | SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home | nvbench |
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... | 门诊诊断患者柏飞鸿为煤工尘肺,他的检测指标223006的结果定量及其单位均为? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND... | css |
CREATE TABLE table_dev_4 (
"id" int,
"hypothyroidism" bool,
"serum_bicarbonate" int,
"c_peptide_level" float,
"autoimmune_disease" bool,
"hemoglobin_a1c_hba1c" float,
"positive_serum" bool,
"inhaled_steroids" bool,
"diabetic_ketoacidosis" bool,
"creatinine_clearance_cl" float,
... | chronic inflammatory or autoimmune disease with the exception of well _ controlled hypothyroidism or intermittent or mild persistent asthma not requiring the use of daily inhaled steroids | SELECT * FROM table_dev_4 WHERE chronic_inflammatory = 1 OR autoimmune_disease = 1 OR hypothyroidism = 1 OR asthma = 1 AND inhaled_steroids = 1 | criteria2sql |
CREATE TABLE table_2506300_1 (
top_10 INTEGER,
winnings VARCHAR
) | What the rank in the top 10 when the winnings were $1,741,176? | SELECT MIN(top_10) FROM table_2506300_1 WHERE winnings = "$1,741,176" | sql_create_context |
CREATE TABLE table_name_34 (
vehicle VARCHAR,
ceased_operation VARCHAR
) | Which vehicle failed at launch? | SELECT vehicle FROM table_name_34 WHERE ceased_operation = "failed at launch" | sql_create_context |
CREATE TABLE table_59993 (
"Rank" real,
"Name" text,
"Years" text,
"Current Club" text,
"Goals" real,
"Apps" real,
"Ratio" real
) | Which Current Club has a Rank of 4? | SELECT "Current Club" FROM table_59993 WHERE "Rank" = '4' | wikisql |
CREATE TABLE table_60044 (
"7:00 am" text,
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"10:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm"... | What is the 1pm show that has Local Programs at 2pm and Digimon: Digital Monsters at 4:30pm? | SELECT "1:00 pm" FROM table_60044 WHERE "2:00 pm" = 'local programs' AND "4:30 pm" = 'digimon: digital monsters' | wikisql |
CREATE TABLE diagnoses (
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 prescriptions... | calculate the number of patients admitted to emergency who had icd9 code 7761 | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "7761" | mimicsql_data |
CREATE TABLE table_9689 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text
) | What was the attendance like for week 8? | SELECT "Attendance" FROM table_9689 WHERE "Week" = '8' | wikisql |
CREATE TABLE table_name_44 (
total INTEGER,
gold INTEGER
) | Which Total has a Gold smaller than 4? | SELECT MIN(total) FROM table_name_44 WHERE gold < 4 | 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... | what is admission type and discharge time of subject id 15898? | SELECT demographic.admission_type, demographic.dischtime FROM demographic WHERE demographic.subject_id = "15898" | mimicsql_data |
CREATE TABLE table_12278 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | Which Date has a Tournament of milan , italy? | SELECT "Date" FROM table_12278 WHERE "Tournament" = 'milan , italy' | wikisql |
CREATE TABLE Course (
CID VARCHAR(7),
CName VARCHAR(40),
Credits INTEGER,
Instructor INTEGER,
Days VARCHAR(5),
Hours VARCHAR(11),
DNO INTEGER
)
CREATE TABLE Minor_in (
StuID INTEGER,
DNO INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12... | Find Days and the sum of Credits , and group by attribute Days, and visualize them by a bar chart. | SELECT Days, SUM(Credits) FROM Course GROUP BY Days ORDER BY Credits | nvbench |
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,
... | 列出在医院0621051中患者04455332门诊诊断名称包含形式的门诊有什么就诊记录? | SELECT * FROM hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.mzjzjlb... | css |
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 death status is 0 and diagnoses short title is bph w/o urinary obs/luts? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "BPH w/o urinary obs/LUTS" | mimicsql_data |
CREATE TABLE table_6701 (
"Tournament" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | Which 2012 has a 2010 of 0 0? | SELECT "2012" FROM table_6701 WHERE "2010" = '0–0' | wikisql |
CREATE TABLE table_name_69 (
nominating_festival VARCHAR,
film VARCHAR
) | What Nominating festival was party of the adjustment film? | SELECT nominating_festival FROM table_name_69 WHERE film = "adjustment" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | List of users with highest reputation from Poland. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%poland%' OR UPPER(Location) LIKE '%PL' ORDER BY Reputation DESC | sede |
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 admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dis... | is since 1 year ago patient 42473 diagnosed with hx of past noncompliance? | SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hx of past noncompliance') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 42473) AND DATETIME(diagnose... | mimic_iii |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | The upper-level classes , are they all worth 1 credits ? | SELECT COUNT(*) = 0 FROM course, program_course WHERE course.credits <> 1 AND course.department = 'EECS' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_24598274_20 (
channel VARCHAR,
local_title VARCHAR
) | The local title 'Live to Dance' was aired in which channel? | SELECT channel FROM table_24598274_20 WHERE local_title = "Live to Dance" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
T... | Most X questions in tag. | SELECT TOP(100) AS Id, SourceTagName, TargetTagName FROM TagSynonyms AS T WHERE T.SourceTagName LIKE '%' + @Tag + '%' | sede |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | What upper level classes are offered that do n't require exams but have projects ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND course.has_projects = 'Y' AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_31037 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | What is the name of episode number 29 in the series? | SELECT "Title" FROM table_31037 WHERE "No. in series" = '29' | wikisql |
CREATE TABLE table_name_12 (
home VARCHAR,
visitor VARCHAR,
date VARCHAR
) | Name the home when the visitor was dallas on february 2 | SELECT home FROM table_name_12 WHERE visitor = "dallas" AND date = "february 2" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
... | what is the minimum value of specific gravity in patient 16572's body until 66 months ago? | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16572) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'specific gravity') AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TI... | mimic_iii |
CREATE TABLE table_16902 (
"number" real,
"date of debut" text,
"name" text,
"date of birth" text,
"number of caps" real,
"number of goals" real,
"date of death\u2020" text
) | What is the name of the person whose date of death is 01-04-1954? | SELECT "name" FROM table_16902 WHERE "date of death\u2020" = '01-04-1954' | wikisql |
CREATE TABLE compartment_class (
compartment varchar,
class_type varchar
)
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE time_interval (
period text... | may i see all nonstop flights from ST. PETERSBURG to CHARLOTTE | 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 (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ST. PETERSBURG' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name =... | atis |
CREATE TABLE table_204_791 (
id number,
"event" text,
"winner" text,
"second" text,
"third" text,
"fourth" text
) | in what two races did chelsea williams earn the same rank ? | SELECT "event" FROM table_204_791 WHERE "winner" = 'chelsea wlliams' | squall |
CREATE TABLE table_name_79 (
year INTEGER,
index VARCHAR
) | What year is the happy planet index? | SELECT SUM(year) FROM table_name_79 WHERE index = "happy planet index" | sql_create_context |
CREATE TABLE table_53489 (
"Year" real,
"Competition" text,
"Date" text,
"Location" text,
"Score" text,
"Result" text
) | What is the result of the Europe/Africa Group I, play-off competition? | SELECT "Result" FROM table_53489 WHERE "Competition" = 'europe/africa group i, play-off' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | what are the four most frequently ordered specimen tests for patients that were previously diagnosed with hypotension within 2 months during this year? | SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypotension' AND DATETIME(diagnosis.diagnosi... | eicu |
CREATE TABLE table_name_59 (
second VARCHAR,
city VARCHAR,
skip VARCHAR
) | WHAT IS TEH SECOND WITH REGINA AS CITY AND SKIP OF MICHELLE ENGLOT? | SELECT second FROM table_name_59 WHERE city = "regina" AND skip = "michelle englot" | sql_create_context |
CREATE TABLE table (
r VARCHAR,
total VARCHAR,
position VARCHAR
) | What is the R when the total is 1 and the position is fw? | SELECT r FROM table WHERE total = 1 AND position = "FW" | sql_create_context |
CREATE TABLE table_823 (
"Aircraft type" text,
"National Origin" text,
"1st Flight" real,
"In Service" text,
"Retired" text,
"# built" text
) | how many Curtiss XBTC aircraft are retired? | SELECT COUNT("Retired") FROM table_823 WHERE "Aircraft type" = 'Curtiss XBTC' | wikisql |
CREATE TABLE table_name_75 (
tournament VARCHAR,
score VARCHAR
) | Which Tournament has a Score of 6 4, 6 4? | SELECT tournament FROM table_name_75 WHERE score = "6–4, 6–4" | sql_create_context |
CREATE TABLE table_name_30 (
score VARCHAR,
arena VARCHAR
) | What is the Score at Jobing.com Arena? | SELECT score FROM table_name_30 WHERE arena = "jobing.com arena" | sql_create_context |
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number... | nonstop flights DENVER to BOSTON | 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 (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOSTON... | atis |
CREATE TABLE table_24446718_3 (
awardee_s_ VARCHAR,
name_of_award VARCHAR
) | Name the total number of awardees for best screenplay | SELECT COUNT(awardee_s_) FROM table_24446718_3 WHERE name_of_award = "Best Screenplay" | sql_create_context |
CREATE TABLE table_name_70 (
round VARCHAR,
nationality VARCHAR,
player VARCHAR
) | What is the round of Jimmy Drolet from Canada? | SELECT round FROM table_name_70 WHERE nationality = "canada" AND player = "jimmy drolet" | sql_create_context |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Top stackoverflow users Sri lanka. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Id) LIKE '%sri lanka%' ORDER BY Reputation DESC | sede |
CREATE TABLE table_18600760_19 (
latitude VARCHAR,
water__sqmi_ VARCHAR
) | what is the latitude in the township where wate is 0.288 | SELECT latitude FROM table_18600760_19 WHERE water__sqmi_ = "0.288" | sql_create_context |
CREATE TABLE table_name_54 (
money___£__ VARCHAR,
score VARCHAR
) | How much money does the player with a 72-70-71-72=285 score have? | SELECT money___£__ FROM table_name_54 WHERE score = 72 - 70 - 71 - 72 = 285 | sql_create_context |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
... | How many courses for each office? Show me a bar chart, display in descending by the y axis. | SELECT PROF_OFFICE, COUNT(PROF_OFFICE) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY PROF_OFFICE ORDER BY COUNT(PROF_OFFICE) DESC | 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 prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | what is the number of patients whose admission location is phys referral/normal deli and item id is 51221? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.itemid = "51221" | mimicsql_data |
CREATE TABLE table_32892 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | What venue is in the state of Connecticut? | SELECT "Venue" FROM table_32892 WHERE "State" = 'connecticut' | wikisql |
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | What is the number of different grapes of each wine? Show me a bar chart, rank names from high to low order. | SELECT Grape, COUNT(Grape) FROM wine GROUP BY Grape ORDER BY Grape DESC | nvbench |
CREATE TABLE table_56158 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | Which date has a Score of 6 4, 6 3? | SELECT "Date" FROM table_56158 WHERE "Score" = '6–4, 6–3' | wikisql |
CREATE TABLE table_56624 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | How many rounds did the event rings: king of kings 2000 block a have with a record of 6-1? | SELECT "Round" FROM table_56624 WHERE "Event" = 'rings: king of kings 2000 block a' AND "Record" = '6-1' | wikisql |
CREATE TABLE table_name_24 (
run_2 INTEGER,
country VARCHAR,
athlete VARCHAR
) | What is the run 2 of athlete Maria Orlova from Russia? | SELECT SUM(run_2) FROM table_name_24 WHERE country = "russia" AND athlete = "maria orlova" | sql_create_context |
CREATE TABLE table_77797 (
"Player" text,
"Club" text,
"League" real,
"Play-offs" real,
"FA Cup" real,
"FA Trophy" real,
"Total" real
) | Which of the lowest FA Trophys involved the Forest Green Rovers club when the play-offs number was bigger than 0? | SELECT MIN("FA Trophy") FROM table_77797 WHERE "Club" = 'forest green rovers' AND "Play-offs" > '0' | wikisql |
CREATE TABLE table_28266 (
"AB - Angry boar" text,
"B - Bishop" text,
"BA - Running Bear" text,
"BB - Blind Bear" text,
"BC - Beast Cadet" text
) | what is bb - blind bear where ba - running bear is tc - tile chariot? | SELECT "BB - Blind Bear" FROM table_28266 WHERE "BA - Running Bear" = 'TC - Tile Chariot' | wikisql |
CREATE TABLE table_54437 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did Essendon play as the away team? | SELECT "Venue" FROM table_54437 WHERE "Away team" = 'essendon' | wikisql |
CREATE TABLE table_18402 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What party did Don Fuqua belong to? | SELECT "Party" FROM table_18402 WHERE "Incumbent" = 'Don Fuqua' | wikisql |
CREATE TABLE table_name_7 (
language VARCHAR,
launch VARCHAR,
hanzi VARCHAR
) | Which language's launch was in 2006 when then hanzi was ? | SELECT language FROM table_name_7 WHERE launch = 2006 AND hanzi = "青海电视台藏语综合频道" | sql_create_context |
CREATE TABLE table_name_47 (
score VARCHAR,
outcome VARCHAR,
surface VARCHAR,
opponent VARCHAR
) | What was the final score for Aguilar when he played Hans Podlipnik on clay and was runner-up? | SELECT score FROM table_name_47 WHERE surface = "clay" AND opponent = "hans podlipnik" AND outcome = "runner-up" | sql_create_context |
CREATE TABLE table_name_10 (
Id VARCHAR
) | What is the 2011 value of the 2012 grand slam tournaments? | SELECT 2011 FROM table_name_10 WHERE 2012 = "grand slam tournaments" | sql_create_context |
CREATE TABLE table_65481 (
"Club" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Against" real
) | What's the against of South Warrnambool when the draw is less than 0? | SELECT SUM("Against") FROM table_65481 WHERE "Club" = 'south warrnambool' AND "Draws" < '0' | wikisql |
CREATE TABLE table_16352 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What is the number in series of 'say uncle'? | SELECT "No. in series" FROM table_16352 WHERE "Title" = 'Say Uncle' | wikisql |
CREATE TABLE table_56524 (
"Chapter" text,
"University" text,
"City" text,
"State" text,
"Conference" text,
"Founding Date" real,
"Status" text
) | Which chapter was founded later than 2012? | SELECT "Chapter" FROM table_56524 WHERE "Founding Date" > '2012' | wikisql |
CREATE TABLE table_name_80 (
attendance VARCHAR,
opponent VARCHAR
) | How many people attended when opponent was twins? | SELECT COUNT(attendance) FROM table_name_80 WHERE opponent = "twins" | sql_create_context |
CREATE TABLE table_76509 (
"Finished" text,
"Horse" text,
"Jockey" text,
"Trainer" text,
"Odds" text
) | What are the Odds for the Horse called Ready's Echo? | SELECT "Odds" FROM table_76509 WHERE "Horse" = 'ready''s echo' | wikisql |
CREATE TABLE table_name_99 (
country VARCHAR,
language_s_ VARCHAR,
literary_tradition VARCHAR
) | What nation was the film from that was in english and had a Literary tradition of canadian literature? | SELECT country FROM table_name_99 WHERE language_s_ = "english" AND literary_tradition = "canadian literature" | sql_create_context |
CREATE TABLE table_18844 (
"Autonomous Community" text,
"Hydroelectric power" real,
"Wind power" real,
"Solar power" real,
"Biomass power" real,
"Solid waste power" real,
"Total Renewable Generation" real,
"Total Electricity Demand" real,
"% Renewable of Total Electricity Demand" tex... | What is the community with a wind power of 1042? | SELECT "Autonomous Community" FROM table_18844 WHERE "Wind power" = '1042' | wikisql |
CREATE TABLE table_name_11 (
province VARCHAR,
city VARCHAR
) | Which province is Pamplona located in? | SELECT province FROM table_name_11 WHERE city = "pamplona" | sql_create_context |
CREATE TABLE table_58957 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
) | In the 1958-59 season, what league did the team play in? | SELECT "League" FROM table_58957 WHERE "Season" = '1958-59' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | how many patients whose year of death is less than or equal to 2180 and diagnoses icd9 code is 7098? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2180.0" AND diagnoses.icd9_code = "7098" | mimicsql_data |
CREATE TABLE table_38923 (
"Year (Ceremony)" real,
"Original title" text,
"English title" text,
"Director" text,
"Result" text
) | What was the Director with a Ceremony of 2001? | SELECT "Director" FROM table_38923 WHERE "Year (Ceremony)" = '2001' | wikisql |
CREATE TABLE table_6537 (
"Year" real,
"Location" text,
"Gold" text,
"Silver" text,
"Bronze" text
) | Who won bronze is 2006? | SELECT "Bronze" FROM table_6537 WHERE "Year" = '2006' | wikisql |
CREATE TABLE manufacturers (
code number,
name text,
headquarter text,
founder text,
revenue number
)
CREATE TABLE products (
code number,
name text,
price number,
manufacturer number
) | Find the name and revenue of the company that earns the highest revenue in each city. | SELECT name, MAX(revenue), headquarter FROM manufacturers GROUP BY headquarter | spider |
CREATE TABLE table_name_53 (
averaging_time VARCHAR,
regulatory_citation VARCHAR
) | what is the averaging time when the regulatory citation is 40 cfr 50.4(b)? | SELECT averaging_time FROM table_name_53 WHERE regulatory_citation = "40 cfr 50.4(b)" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, list by the mean salary from high to low please. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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 t... | count the number of patients whose admission year is less than 2150 and lab test name is cortisol? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2150" AND lab.label = "Cortisol" | mimicsql_data |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of job_id and department_id in a bar chart, and rank by the DEPARTMENT_ID in descending. | SELECT JOB_ID, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC | nvbench |
CREATE TABLE addresses (
address_id number,
address_content text,
city text,
zip_postcode text,
state_province_county text,
country text,
other_address_details text
)
CREATE TABLE customer_orders (
order_id number,
customer_id number,
order_status text,
order_date time,
... | Find the name of customers who are living in Colorado? | SELECT t1.customer_name FROM customers AS t1 JOIN customer_addresses AS t2 ON t1.customer_id = t2.customer_id JOIN addresses AS t3 ON t2.address_id = t3.address_id WHERE t3.state_province_county = "Colorado" | spider |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Of the hardest courses in the STDABRD department , have I taken any ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'STDABRD' AND program_course.workload = (SELECT M... | advising |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE SuggestedEdits (
Id number,
... | Average Reputation Of SO Users where reputation > 200. | SELECT AVG(Reputation) AS AVG_REP, COUNT(Id) AS "total_users" FROM Users WHERE Reputation > 200 | sede |
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE offering_instructor (
offering_ins... | In order to fulfill the MDE requirement , what easy course can I take ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou... | advising |
CREATE TABLE table_25134 (
"Position" real,
"1990\u20131991" text,
"1991\u20131992" text,
"1992\u20131993" text,
"1993\u20131994" text,
"1994\u20131995" text
) | Who was ranked in the same position in 1991-1992 as Drew Kachtik in 1993-1994? | SELECT "1991\u20131992" FROM table_25134 WHERE "1993\u20131994" = 'Drew Kachtik' | wikisql |
CREATE TABLE table_31584 (
"Camp" text,
"Place" text,
"Province" text,
"Location" text,
"Period" text
) | Tell me the period for red rock | SELECT "Period" FROM table_31584 WHERE "Place" = 'red rock' | wikisql |
CREATE TABLE services (
service_id number,
organization_id number,
service_type_code text,
service_details text
)
CREATE TABLE things (
thing_id number,
organization_id number,
type_of_thing_code text,
service_type_code text,
service_details text
)
CREATE TABLE properties (
pro... | What are the distinct id and type of the thing that has the status 'Close' or has a status record before the date '2017-06-19 02:59:21 | SELECT DISTINCT T2.thing_id, T2.type_of_thing_code FROM timed_status_of_things AS T1 JOIN things AS T2 ON T1.thing_id = T2.thing_id WHERE T1.status_of_thing_code = 'Close' OR T1.date_and_date < '2017-06-19 02:59:21' | spider |
CREATE TABLE table_18862490_2 (
year INTEGER,
score VARCHAR
) | What is the first yar that someone won with a score of 68-66-68-71=273? | SELECT MIN(year) FROM table_18862490_2 WHERE score = 68 - 66 - 68 - 71 = 273 | sql_create_context |
CREATE TABLE table_name_86 (
established VARCHAR,
club VARCHAR
) | What is the total number of the established club of Lehigh Valley Storm? | SELECT COUNT(established) FROM table_name_86 WHERE club = "lehigh valley storm" | sql_create_context |
CREATE TABLE table_50398 (
"Institution" text,
"Location" text,
"Founded" real,
"Affiliation" text,
"Enrollment" real,
"Team Nickname" text,
"Primary conference" text,
"Home Rink" text
) | Where is the location for the home rink Triangle sports plex/Greensboro ice house? | SELECT "Location" FROM table_50398 WHERE "Home Rink" = 'triangle sports plex/greensboro ice house' | wikisql |
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... | 列出病人70995116医疗记录中医疗费总额在8532.47元以上的入院诊断疾病编码和名称 | SELECT IN_DIAG_DIS_CD, IN_DIAG_DIS_NM FROM t_kc21 WHERE PERSON_ID = '70995116' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc24 WHERE MED_AMOUT >= 8532.47) | css |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
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... | 列出82042800患者在医院6342249看病的就诊记录里出院科室是外科科室的部分 | SELECT * FROM hz_info JOIN zyjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.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 person_info_hz_i... | css |
CREATE TABLE table_26179 (
"Neighbourhood" text,
"% 0-19" text,
"% 20-39" text,
"% 40-59" text,
"% 60-74" text,
"% 75 +" text
) | What is every value for % 20-39 if % 0-19 is 21,11%? | SELECT "% 20-39" FROM table_26179 WHERE "% 0-19" = '21,11%' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.