context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE GRADECONVERSION (
gradepoint INTEGER
) | Find the max and min grade point for all letter grade. | SELECT MAX(gradepoint), MIN(gradepoint) FROM GRADECONVERSION | sql_create_context |
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 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, a scatter chart shows the correlation between employee_id and salary . | SELECT EMPLOYEE_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_49874 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text
) | Can you tell me the average December rhat has the Opponent of @ toronto maple leafs? | SELECT AVG("December") FROM table_49874 WHERE "Opponent" = '@ toronto maple leafs' | wikisql |
CREATE TABLE table_51075 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Competition" text,
"Man of the Match" text
) | Who did they play when there were only 751 in attendance? | SELECT "Opponent" FROM table_51075 WHERE "Attendance" < '751' | wikisql |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId n... | Count of Questions in Period with Tag. | SELECT t.TagName, COUNT(DISTINCT q.Id) AS Question FROM PostTags AS pt JOIN Posts AS q ON q.Id = pt.PostId JOIN Tags AS t ON t.Id = pt.TagId WHERE PostTypeId = 1 AND t.TagName LIKE '%daml%' AND q.CreationDate > '2019-03-31 00:00:00' GROUP BY t.TagName ORDER BY Question DESC | sede |
CREATE TABLE table_name_49 (
laps INTEGER,
grid VARCHAR,
points VARCHAR,
team VARCHAR
) | What is the highest number of laps when there are less than 5 points for team garry rogers motorsport and the grid number is under 23? | SELECT MAX(laps) FROM table_name_49 WHERE points < 5 AND team = "garry rogers motorsport" AND grid < 23 | sql_create_context |
CREATE TABLE table_name_16 (
loss VARCHAR,
date VARCHAR
) | What was the loss on September 2? | SELECT loss FROM table_name_16 WHERE date = "september 2" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
sp... | in 2103 what was patient 67481's first hospital discharge time? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 67481 AND STRFTIME('%y', admissions.dischtime) = '2103' ORDER BY admissions.dischtime LIMIT 1 | mimic_iii |
CREATE TABLE table_dev_28 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"consent" bool,
"hemoglobin_a1c_hba1c" float,
"hematocrit_hct" float,
"fasting_triglycerides" int,
"fasting_blood_glucose_fbg" float,
"diastolic_blood_pressure_dbp" int,
"hba1c" float,
"... | systolic blood pressure greater than 160 mmhg, or diastolic blood pressure greater than 100 mmhg at screening | SELECT * FROM table_dev_28 WHERE systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100 | criteria2sql |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
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 CLASS (
CLASS_COD... | Count different addresses of each school with a bar chart, I want to order Y from low to high order. | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT ORDER BY COUNT(DISTINCT DEPT_ADDRESS) | nvbench |
CREATE TABLE table_16570286_2 (
highest_score VARCHAR,
innings VARCHAR,
player VARCHAR
) | What was the score when Donald Bradman in 9 innings? | SELECT highest_score FROM table_16570286_2 WHERE innings = 9 AND player = "Donald Bradman" | sql_create_context |
CREATE TABLE table_name_85 (
class VARCHAR,
laps VARCHAR,
team VARCHAR
) | What is the class of team liqui moly equipe, which has less than 71 laps? | SELECT class FROM table_name_85 WHERE laps < 71 AND team = "liqui moly equipe" | sql_create_context |
CREATE TABLE table_20963074_1 (
year__ceremony_ VARCHAR,
original_title VARCHAR
) | Name the year for reportaje a la muerte | SELECT year__ceremony_ FROM table_20963074_1 WHERE original_title = "Reportaje a la muerte" | sql_create_context |
CREATE TABLE table_65924 (
"Year" real,
"Venue" text,
"Competition" text,
"Kilkenny score" text,
"Waterford score" text
) | What yeae has 6-08 (24) as a waterford score? | SELECT "Year" FROM table_65924 WHERE "Waterford score" = '6-08 (24)' | wikisql |
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,
... | count the number of patients whose religion is catholic and lab test name is monocytes? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CATHOLIC" AND lab.label = "Monocytes" | mimicsql_data |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
Rejecti... | Top 100 users list in UAE. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%pakistan%' ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_19774 (
"Administrative division" text,
"Area (km\u00b2)" text,
"Population 2000 Census" real,
"Population (2010 Census)" real,
"Population density 2010 (/km\u00b2)" real
) | Name the population 2010 census for population 2000 census of 920599 | SELECT "Population (2010 Census)" FROM table_19774 WHERE "Population 2000 Census" = '920599' | wikisql |
CREATE TABLE table_1342426_18 (
candidates VARCHAR,
incumbent VARCHAR
) | How many candidates won the election of john n. sandlin? | SELECT COUNT(candidates) FROM table_1342426_18 WHERE incumbent = "John N. Sandlin" | sql_create_context |
CREATE TABLE table_27374004_4 (
position_in_table VARCHAR,
outgoing_manager VARCHAR
) | What was the team's position in table when Danny OST was the outgoing manager? | SELECT position_in_table FROM table_27374004_4 WHERE outgoing_manager = "Danny Ost" | sql_create_context |
CREATE TABLE tryout (
pid number,
cname text,
ppos text,
decision text
)
CREATE TABLE college (
cname text,
state text,
enr number
)
CREATE TABLE player (
pid number,
pname text,
ycard text,
hs number
) | How many students, on average, does each college have enrolled? | SELECT AVG(enr) FROM college | spider |
CREATE TABLE table_24364690_1 (
federal_subjects VARCHAR
) | What is the minimum 2007 USD in Kabardino-Balkaria? | SELECT MIN(2007 AS __usd_) FROM table_24364690_1 WHERE federal_subjects = "Kabardino-Balkaria" | sql_create_context |
CREATE TABLE table_43336 (
"Tournament" text,
"Wins" real,
"Top-5" real,
"Top-10" real,
"Top-25" real,
"Events" real,
"Cuts made" real
) | What is the lowest Wins with a Top-10 that is larger than 9? | SELECT MIN("Wins") FROM table_43336 WHERE "Top-10" > '9' | wikisql |
CREATE TABLE table_11594 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the largest lap number when the time was +31.982? | SELECT MAX("Laps") FROM table_11594 WHERE "Time" = '+31.982' | wikisql |
CREATE TABLE table_65394 (
"Year" real,
"Movie (in Kannada )" text,
"Director" text,
"Cast" text,
"Music Director" text
) | Who was the music director in 1971 for the movie Kalyani? | SELECT "Music Director" FROM table_65394 WHERE "Year" = '1971' AND "Movie (in Kannada )" = 'kalyani' | wikisql |
CREATE TABLE table_name_78 (
host VARCHAR,
city VARCHAR
) | What was the host for the round in Nashville? | SELECT host FROM table_name_78 WHERE city = "nashville" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
res... | list all nonstop flights on wednesday from BALTIMORE to NEWARK before 1200 | 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 (((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_tim... | atis |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 医院9831232从12年8月1日到2019年2月12日的门诊就诊中,有多少科室开出的检验报告单少于6张 | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB 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_inf... | css |
CREATE TABLE table_3512 (
"Outcome" text,
"No." text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | How many numbers correspond to the score in the final of 6 3, 6 4, 7 6 (13 11)? | SELECT COUNT("No.") FROM table_3512 WHERE "Score in the final" = '6–3, 6–4, 7–6 (13–11)' | wikisql |
CREATE TABLE table_46494 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"TV Time" text
) | What was the date of a week larger than 16? | SELECT "Date" FROM table_46494 WHERE "Week" > '16' | wikisql |
CREATE TABLE affiliated_with (
physician number,
department number,
primaryaffiliation boolean
)
CREATE TABLE patient (
ssn number,
name text,
address text,
phone text,
insuranceid number,
pcp number
)
CREATE TABLE appointment (
appointmentid number,
patient number,
pre... | How many patients' prescriptions are made by physician John Dorian? | SELECT COUNT(T1.ssn) FROM patient AS T1 JOIN prescribes AS T2 ON T1.ssn = T2.patient JOIN physician AS T3 ON T2.physician = T3.employeeid WHERE T3.name = "John Dorian" | spider |
CREATE TABLE table_name_75 (
score VARCHAR,
location VARCHAR
) | The competition located in Northampton had a resulting score of what? | SELECT score FROM table_name_75 WHERE location = "northampton" | sql_create_context |
CREATE TABLE table_58010 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How much did the home team st kilda score? | SELECT "Home team score" FROM table_58010 WHERE "Home team" = 'st kilda' | wikisql |
CREATE TABLE table_name_30 (
capacity INTEGER,
club VARCHAR
) | What was the largest capacity when the club was F.C. Igea Virtus Barcellona? | SELECT MAX(capacity) FROM table_name_30 WHERE club = "f.c. igea virtus barcellona" | sql_create_context |
CREATE TABLE table_76241 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Worldwide Gross" text
) | What is the Worldwide Gross of the Film with a Rank of 16? | SELECT "Worldwide Gross" FROM table_76241 WHERE "Rank" = '16' | wikisql |
CREATE TABLE Research_Outcomes (
outcome_code VARCHAR(10),
outcome_description VARCHAR(255)
)
CREATE TABLE Project_Staff (
staff_id DOUBLE,
project_id INTEGER,
role_code VARCHAR(10),
date_from DATETIME,
date_to DATETIME,
other_details VARCHAR(255)
)
CREATE TABLE Projects (
project_... | Scatter chart. what is the total amount of grant money given to each organization and what is its id? | SELECT SUM(grant_amount), organisation_id FROM Grants GROUP BY organisation_id | nvbench |
CREATE TABLE table_26695 (
"Season" real,
"Pl" real,
"W" real,
"L" real,
"D" real,
"Captain" text,
"Most runs" text,
"Most Wkts" text,
"Wkt Keeper" text
) | What is the lowest amount of L in any season? | SELECT MIN("L") FROM table_26695 | wikisql |
CREATE TABLE table_67304 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | What is the name of the constructor for Grid 1? | SELECT "Constructor" FROM table_67304 WHERE "Grid" = '1' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients whose discharge location is home and procedure long title is percutaneous aspiration of liver? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "HOME" AND procedures.long_title = "Percutaneous aspiration of liver" | mimicsql_data |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
) | Give me a pie chart to reflect the proportion of state and enr. | SELECT state, enr FROM College ORDER BY enr | nvbench |
CREATE TABLE field (
fieldid int
)
CREATE TABLE writes (
paperid int,
authorid int
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int... | Most cited papers on Parsing | SELECT DISTINCT cite.citedpaperid, COUNT(cite.citedpaperid) FROM cite, keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = cite.citedpaperid AND paper.paperid = paperkeyphrase.paperid GROUP BY cite.citedpaperid ORDER BY CO... | scholar |
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... | 名叫范寻芳的患者在门诊作诊断为疾病O57.354时的总蛋白的结果定量及其单位数据各自是多少? | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZ... | css |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
... | how much is a round trip fare from INDIANAPOLIS to SEATTLE | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1... | atis |
CREATE TABLE table_57528 (
"Episode" text,
"Air Date" text,
"Time slot (EST)" text,
"Rating" real,
"Share" real,
"18-49 (Rating/Share)" text,
"Viewers (m)" real,
"Rank (Overall)" text
) | What show that was aired on January 24, 2008 with a rating larger than 3.6 had the lowest viewers? How Many Viewers in the millions? | SELECT MIN("Viewers (m)") FROM table_57528 WHERE "Air Date" = 'january 24, 2008' AND "Rating" > '3.6' | wikisql |
CREATE TABLE table_name_97 (
height_m___feet VARCHAR,
name VARCHAR
) | What is the height for shanghai x-1 financial building? | SELECT height_m___feet FROM table_name_97 WHERE name = "shanghai x-1 financial building" | sql_create_context |
CREATE TABLE CLASS (
class_section VARCHAR,
crs_code VARCHAR
) | How many sections does course ACCT-211 has? | SELECT COUNT(DISTINCT class_section) FROM CLASS WHERE crs_code = 'ACCT-211' | sql_create_context |
CREATE TABLE table_22366 (
"Voting order" real,
"Country" text,
"Spokespersons" text,
"Commentator" text,
"Broadcaster" text
) | which countries were commentated on by gordana bonetti | SELECT "Country" FROM table_22366 WHERE "Commentator" = 'Gordana Bonetti' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | Comments regarding rep. | SELECT Id, PostId AS "post_link", Text FROM Comments WHERE LOWER(Text) LIKE '% rep %' ORDER BY LENGTH(Text), Id | sede |
CREATE TABLE table_16175217_1 (
children_per_donor VARCHAR,
allowed_recipients VARCHAR
) | List the possible children per donor levels for countries where the allowed recipients is no data. | SELECT children_per_donor FROM table_16175217_1 WHERE allowed_recipients = "no data" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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 te... | 由门诊诊断为硅肺Ⅲ期的检测的三碘甲状腺原氨酸数值的平均值以及最值分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '矽肺(硅肺)Ⅲ期' AND jyjgzbb.JCZBMC = '三碘甲状腺原氨酸' | css |
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... | get me the number of patients on sc route of drug administration who were diagnosed with hip joint replacement. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Joint replaced hip" AND prescriptions.route = "SC" | mimicsql_data |
CREATE TABLE table_2897457_1 (
nhl_team VARCHAR,
nationality VARCHAR
) | What team drafted a player from Sweden? | SELECT nhl_team FROM table_2897457_1 WHERE nationality = "Sweden" | sql_create_context |
CREATE TABLE table_1984697_85 (
idoe_profile VARCHAR,
city___town VARCHAR
) | What is the IDOE Profile in North Manchester? | SELECT idoe_profile FROM table_1984697_85 WHERE city___town = "North Manchester" | sql_create_context |
CREATE TABLE Mailshot_Customers (
mailshot_id INTEGER,
customer_id INTEGER,
outcome_code VARCHAR(15),
mailshot_customer_date DATETIME
)
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_status_code VARCHAR(15),
shipping_method_code VARCHAR(15),
order_placed... | Show all distinct product categories along with the number of mailshots in each category in a pie chart. | SELECT product_category, COUNT(*) FROM Mailshot_Campaigns GROUP BY product_category | nvbench |
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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, draw a scatter chart about the correlation between salary and department_id . | SELECT SALARY, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_74744 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
) | How many Ranks have ray pickrell as a Rider? | SELECT COUNT("Rank") FROM table_74744 WHERE "Rider" = 'ray pickrell' | wikisql |
CREATE TABLE table_train_100 (
"id" int,
"systolic_blood_pressure_sbp" int,
"stroke" bool,
"body_weight" float,
"diastolic_blood_pressure_dbp" int,
"rosen_modified_hachinski_ischemic_score" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | body mass index ( bmi ) between 19 and 30 kg / m2 and weigh at least 50 kg and no more than 100 kg. | SELECT * FROM table_train_100 WHERE (body_mass_index_bmi >= 19 AND body_mass_index_bmi <= 30) AND (body_weight >= 50 AND body_weight <= 100) | criteria2sql |
CREATE TABLE table_name_90 (
date VARCHAR,
time VARCHAR
) | What is Date, when Time is '56.49'? | SELECT date FROM table_name_90 WHERE time = "56.49" | sql_create_context |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE com... | Do you know whether SLAVIC 490 is hard ? | SELECT COUNT(*) > 0, program_course.workload FROM course, program_course WHERE course.department = 'SLAVIC' AND course.number = 490 AND program_course.course_id = course.course_id AND program_course.workload > 3 | advising |
CREATE TABLE table_6471 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Save" text
) | What Opponent played on the Date May 21? | SELECT "Opponent" FROM table_6471 WHERE "Date" = 'may 21' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE PendingFlags ... | rep loss -1 -> -2. | SELECT Id, DisplayName, (U.DownVotes * -2) AS Loss1, U.Reputation AS CurrentRep, (U.Reputation + U.DownVotes * -2) AS NewRep FROM Users AS U ORDER BY Loss1 LIMIT 100 | sede |
CREATE TABLE table_5419 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which Game is the highest one that has an Opponent of new york islanders, and a December larger than 10? | SELECT MAX("Game") FROM table_5419 WHERE "Opponent" = 'new york islanders' AND "December" > '10' | wikisql |
CREATE TABLE table_44235 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
) | Which School/Club Team has a Round smaller than 5, a Pick larger than 1, and a Player of reggie mckenzie? | SELECT "School/Club Team" FROM table_44235 WHERE "Round" < '5' AND "Pick" > '1' AND "Player" = 'reggie mckenzie' | 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 diagnoses (
... | show me the number of non-hospitalized patients who had urine potassium lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "0" AND lab.label = "Potassium, Urine" | mimicsql_data |
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... | 秦宛白患者以前的就诊医院是哪里 | SELECT mzjzjlb.YLJGDM 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.person_info_XM = '秦宛白' UNION SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb... | css |
CREATE TABLE table_name_9 (
office VARCHAR,
party VARCHAR,
representative VARCHAR
) | Which Office has a Party of rep, and a Representative of brian bosma? | SELECT office FROM table_name_9 WHERE party = "rep" AND representative = "brian bosma" | sql_create_context |
CREATE TABLE table_name_35 (
school_club_team VARCHAR,
position VARCHAR
) | For which school/club team did the player in the position of Guard/Forward play? | SELECT school_club_team FROM table_name_35 WHERE position = "guard/forward" | sql_create_context |
CREATE TABLE table_77231 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the average number of rounds for billy hicks who had an overall pick number bigger than 310? | SELECT AVG("Round") FROM table_77231 WHERE "Overall" > '310' AND "Name" = 'billy hicks' | wikisql |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description v... | 281 , does it have a lab ? | SELECT COUNT(*) > 0 FROM course WHERE department = 'EECS' AND has_lab = 'Y' AND number = 281 | advising |
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Engineer_Visits (
engineer_visit_id INTEGER,
contact_staff_id INTEGER,
engineer_id INTEGER,
fault_log_entry_id INTEGER,
fault_status VARCHAR(10),
visit_start_datetime DATETIME,
visit_end_datetime DAT... | How many staffs have contacted with each engineer? Give me a bar chart grouping by each engineer's first name, and could you display by the y-axis from low to high? | SELECT first_name, COUNT(first_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY first_name ORDER BY COUNT(first_name) | nvbench |
CREATE TABLE zyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | 从04年7月15日到05年2月17日内医院8674269的购药医疗记录的数目总共是多少啊? | SELECT COUNT(*) FROM gyb WHERE gyb.MED_TYPE = '8674269' AND gyb.IN_HOSP_DAYS BETWEEN '2004-07-15' AND '2005-02-17' | css |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,... | 在02年12月2日到13年6月19日期间,患者18407783被开出的检验报告单一共有多少个啊? | SELECT (SELECT COUNT(*) FROM hz_info JOIN mzjzjlb JOIN jybgb 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 WHERE hz_info.RYBH = '18407783' AND jybgb.BGRQ BETWEEN '2002-12-02' AND '2013-06-19'... | css |
CREATE TABLE table_204_399 (
id number,
"outcome" text,
"no." number,
"year" number,
"championship" text,
"opponent in the final" text,
"score" text
) | in what year did he win the most titles ? | SELECT "year" FROM table_204_399 WHERE "outcome" = 'winner' GROUP BY "year" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_name_29 (
method VARCHAR,
opponent VARCHAR
) | What is the method against Bj rn Bregy? | SELECT method FROM table_name_29 WHERE opponent = "björn bregy" | sql_create_context |
CREATE TABLE table_51728 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What is the Nationality of the player who had Position of guard from School/Club Team Notre Dame? | SELECT "Nationality" FROM table_51728 WHERE "Position" = 'guard' AND "School/Club Team" = 'notre dame' | wikisql |
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE railway_manage ... | Compare the total number of trains in each name by a bar graph, sort by the total number in ascending. | SELECT Name, COUNT(Name) FROM train GROUP BY Name ORDER BY COUNT(Name) | nvbench |
CREATE TABLE table_62359 (
"Year" real,
"Single" text,
"CHR chart peak" real,
"Album" text,
"Composer(s)" text
) | Jimmie Lee Sloas was the composer for what album? | SELECT "Album" FROM table_62359 WHERE "Composer(s)" = 'jimmie lee sloas' | wikisql |
CREATE TABLE table_name_30 (
country VARCHAR,
date VARCHAR
) | What is the country when the date shows October 24, 2008? | SELECT country FROM table_name_30 WHERE date = "october 24, 2008" | sql_create_context |
CREATE TABLE table_name_76 (
league VARCHAR,
fa_cup VARCHAR,
total VARCHAR
) | Which league has an FA cup greater than 0, with a total greater than 21? | SELECT league FROM table_name_76 WHERE fa_cup > 0 AND total > 21 | sql_create_context |
CREATE TABLE table_name_32 (
nation VARCHAR,
silver VARCHAR,
total VARCHAR,
bronze VARCHAR
) | What nation has a total less than 2, silver of 1 and bronze less than 1? | SELECT nation FROM table_name_32 WHERE total < 2 AND bronze < 1 AND silver = 1 | sql_create_context |
CREATE TABLE table_11095 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | What was the visiting team on october 23? | SELECT "Visiting Team" FROM table_11095 WHERE "Date" = 'october 23' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_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,
... | 病患号码是47642343的那个人在其医疗记录里被开出的药品均超出748.1元有多少次?以及具体的编号是多少? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '47642343' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 748.1) | css |
CREATE TABLE table_name_28 (
constructor VARCHAR,
driver VARCHAR,
laps VARCHAR,
qual VARCHAR
) | Which constructor has Chuck Weyant as a driver, 45 laps, and a qual of less than 142.29? | SELECT constructor FROM table_name_28 WHERE laps = 45 AND qual < 142.29 AND driver = "chuck weyant" | sql_create_context |
CREATE TABLE table_43089 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Giants' points" text,
"Opponents' Points" text,
"Record" text,
"TV Time" text,
"Attendance" text
) | What was the TV time for the game where the Giants had 14 points? | SELECT "TV Time" FROM table_43089 WHERE "Giants' points" = '14' | wikisql |
CREATE TABLE table_22496 (
"Athlete" text,
"Class" text,
"Event" text,
"Round of 64" text,
"Round of 32" text,
"Round of 16" text,
"Quarterfinals" text,
"Semifinals" text,
"Final/ Bronze medal match" text
) | When bas van erp was the athlete what was the quarterfinals? | SELECT "Quarterfinals" FROM table_22496 WHERE "Athlete" = 'Bas van Erp' | wikisql |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 那些被门诊诊断为持久的妄想性障碍的人他们的补体C4的检查结果的参考值范围下限和上限具体是多少呢? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | Top comments of all time. | SELECT PostId AS "post_link", Score, Text FROM Comments ORDER BY Score DESC LIMIT 250 | sede |
CREATE TABLE table_56644 (
"Model number" text,
"sSpec number" text,
"Frequency" text,
"L2 cache" text,
"Mult." text,
"Voltage" text,
"Socket" text,
"Release date" text,
"Part number(s)" text,
"Release price ( USD )" text
) | What is the L2 cache of the microprocessor with model number pentium dual-core t3400? | SELECT "L2 cache" FROM table_56644 WHERE "Model number" = 'pentium dual-core t3400' | wikisql |
CREATE TABLE table_19161046_1 (
notes VARCHAR,
model VARCHAR
) | What are the notes recorded for the model HIS HD4850 (512MB)? | SELECT notes FROM table_19161046_1 WHERE model = "HIS HD4850 (512MB)" | sql_create_context |
CREATE TABLE table_26809 (
"Episode no." real,
"Airdate" text,
"Viewers" text,
"BBC Three weekly ranking" text,
"Cable rank" text
) | How many individuals watched the show that had a bbc ranking of 6? | SELECT COUNT("Viewers") FROM table_26809 WHERE "BBC Three weekly ranking" = '6' | 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... | 看看这位94479415的患者在16年4月10日到18年12月15日期间,去医院看病最常去的是哪家 | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_ID = '94479415' AND IN_HOSP_DATE BETWEEN '2016-04-10' AND '2018-12-25' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE ENROLL (
CLASS_CODE varchar(5),
STU_NUM int,
ENROLL_GRADE varchar(50)
)
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 COURSE (
CRS_CODE... | A bar chart about how many different locations does each school have? | SELECT SCHOOL_CODE, COUNT(DISTINCT DEPT_ADDRESS) FROM DEPARTMENT | nvbench |
CREATE TABLE table_72572 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | In week 9 who were the opponent? | SELECT "Opponent" FROM table_72572 WHERE "Week" = '9' | wikisql |
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
) | Show the race class and number of races in each class with a bar chart, and list x axis in asc order please. | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class | nvbench |
CREATE TABLE table_name_83 (
hometown VARCHAR,
player VARCHAR
) | What is the hometown of Cody Zeller? | SELECT hometown FROM table_name_83 WHERE player = "cody zeller" | sql_create_context |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)... | when was patient 013-33898's heartrate less than 121.0 for the last time today? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-33898')) AND vitalperiodic.heartrate < 121.0 AN... | eicu |
CREATE TABLE table_31838 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Tell me the lowest round for total combat 15 | SELECT MIN("Round") FROM table_31838 WHERE "Event" = 'total combat 15' | wikisql |
CREATE TABLE table_66691 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | tell me the type that has the marostica to bibione course. | SELECT "Type" FROM table_66691 WHERE "Course" = 'marostica to bibione' | wikisql |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code ... | Bar chart of sum amount payment from each payment method code, and could you sort in asc by the Y? | SELECT Payment_Method_Code, SUM(Amount_Payment) FROM Payments GROUP BY Payment_Method_Code ORDER BY SUM(Amount_Payment) | nvbench |
CREATE TABLE injury_accident (
game_id int,
id int,
Player text,
Injury text,
Number_of_matches text,
Source text
)
CREATE TABLE stadium (
id int,
name text,
Home_Games int,
Average_Attendance real,
Total_Attendance real,
Capacity_Percentage real
)
CREATE TABLE game (
... | How many players are injured in each day? Show a bar chart, and I want to order from high to low by the x-axis. | SELECT Date, COUNT(Date) FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id GROUP BY Date ORDER BY Date DESC | nvbench |
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)... | Bar chart x axis event details y axis how many event details, and I want to sort by the X-axis in descending. | SELECT Event_Details, COUNT(Event_Details) FROM Events GROUP BY Event_Details ORDER BY Event_Details DESC | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.