context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_1701371_2 (
pixels VARCHAR,
hardware_colours VARCHAR
) | How many pixels would be found in a hardware colour of 8? | SELECT pixels FROM table_1701371_2 WHERE hardware_colours = 8 | sql_create_context |
CREATE TABLE table_name_94 (
conference VARCHAR,
division VARCHAR,
home_stadium VARCHAR
) | At which Conference was the Division in the East, and the Home Stadium named fedexfield? | SELECT conference FROM table_name_94 WHERE division = "east" AND home_stadium = "fedexfield" | sql_create_context |
CREATE TABLE table_name_93 (
bronze INTEGER,
total VARCHAR,
gold VARCHAR,
nation VARCHAR
) | What is the highest amount of bronze china, which has more than 1 gold and more than 11 total, has? | SELECT MAX(bronze) FROM table_name_93 WHERE gold > 1 AND nation = "china" AND total > 11 | sql_create_context |
CREATE TABLE table_62251 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is Tom Kite with a Score of 68's To Par? | SELECT "To par" FROM table_62251 WHERE "Score" = '68' AND "Player" = 'tom kite' | wikisql |
CREATE TABLE table_173 (
"Country/Region" text,
"Show Title" text,
"Languages" text,
"Host" text,
"Channel" text,
"Premiere" text,
"Seasons" text,
"Status" text
) | What was the number of channels in New Zealand? | SELECT COUNT("Channel") FROM table_173 WHERE "Country/Region" = 'New Zealand' | wikisql |
CREATE TABLE table_name_50 (
runner_s__up VARCHAR,
premiered VARCHAR
) | Who was the runner-up for the show that premiered on March 25, 2002? | SELECT runner_s__up FROM table_name_50 WHERE premiered = "march 25, 2002" | sql_create_context |
CREATE TABLE table_name_34 (
round VARCHAR,
player VARCHAR
) | What round did Jamie Cooke play in? | SELECT round FROM table_name_34 WHERE player = "jamie cooke" | sql_create_context |
CREATE TABLE table_14598_9 (
females___percentage_ VARCHAR,
india_state_ut VARCHAR
) | What is the percentage of females where in India and are maharashtra? | SELECT females___percentage_ FROM table_14598_9 WHERE india_state_ut = "Maharashtra" | sql_create_context |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE patients (
row_id number,
subject_id number,
g... | how many patients died within 2 months after having been diagnosed until 2101 with acute gastritis w hmrhg? | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... | mimic_iii |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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 t... | 看一下病人尤慧捷住院诊断历史 | SELECT zyjzjlb.ZYZDBM, zyjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zy... | css |
CREATE TABLE table_68317 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
) | What Number has a Language listed as other? | SELECT "Number" FROM table_68317 WHERE "Language" = 'other' | wikisql |
CREATE TABLE table_37188 (
"Ship" text,
"Hull No." text,
"Builder" text,
"Home Port" text,
"Commissioned\u2013 Decommissioned" text,
"NVR page" text
) | Name the home port for kansas city | SELECT "Home Port" FROM table_37188 WHERE "Ship" = 'kansas city' | wikisql |
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 jybgb.BGDH FROM person_info JOIN hz_info JOIN wdmzjzjlb JOIN jybgb 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.JZLSH_MZJZJLB WHERE person_info.XM = '郑... | css |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE cost (
costid number,
uniquepi... | when was patient 007-7646 prescribed with dext 5%-nacl 0.45% 1000 ml lvp and ondansetron (pf) for the first time at the same time? | SELECT t1.drugstarttime FROM (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'dext 5%-nacl 0.45% 1000 ml lvp' AND patient.uniquepid = '007-7646') AS t1 JOIN (SELECT patient.uniquepid, medication.drug... | eicu |
CREATE TABLE table_60204 (
"Benalla DFL" text,
"Wins" real,
"Losses" real,
"Draws" real,
"Byes" real,
"Against" real
) | What is the total number of Losses, when Wins is '16', and when Against is less than 772? | SELECT COUNT("Losses") FROM table_60204 WHERE "Wins" = '16' AND "Against" < '772' | wikisql |
CREATE TABLE basketball_match (
team_id number,
school_id number,
team_name text,
acc_regular_season text,
acc_percent text,
acc_home text,
acc_road text,
all_games text,
all_games_percent number,
all_home text,
all_road text,
all_neutral text
)
CREATE TABLE university (... | Find how many school locations have the word 'NY'. | SELECT COUNT(*) FROM university WHERE location LIKE "%NY%" | spider |
CREATE TABLE table_16159 (
"Region/country" text,
"Local title" text,
"Network" text,
"Winners" text,
"Main presenters" text
) | What is the main presenter of bulgaria? | SELECT "Main presenters" FROM table_16159 WHERE "Region/country" = 'Bulgaria' | wikisql |
CREATE TABLE table_77217 (
"Rank" text,
"Name" text,
"Location" text,
"Length ( m )" text,
"Length ( ft )" text
) | Where is the longest arch with a length in meters of 64.2? | SELECT "Location" FROM table_77217 WHERE "Length ( m )" = '64.2' | wikisql |
CREATE TABLE table_9809 (
"Year" real,
"Team" text,
"Co-Drivers" text,
"Class" text,
"Laps" real,
"Pos." text,
"Class Pos." text
) | What were the co-drivers in 2008? | SELECT "Co-Drivers" FROM table_9809 WHERE "Year" = '2008' | wikisql |
CREATE TABLE table_name_56 (
pick VARCHAR,
college VARCHAR,
team VARCHAR
) | What was the pick for the game at the College of Kentucky with the team Washington Capitols? | SELECT pick FROM table_name_56 WHERE college = "kentucky" AND team = "washington capitols" | sql_create_context |
CREATE TABLE table_name_1 (
specification VARCHAR,
total_produced VARCHAR,
model VARCHAR
) | What is the specification of the locomotives with a total produced more than 19 and a model of fb-1? | SELECT specification FROM table_name_1 WHERE total_produced > 19 AND model = "fb-1" | sql_create_context |
CREATE TABLE jyjgzbb (
JYZBLSH text,
YLJGDM text,
BGDH text,
BGRQ time,
JYRQ time,
JCRGH text,
JCRXM text,
SHRGH text,
SHRXM text,
JCXMMC text,
JCZBDM text,
JCFF text,
JCZBMC text,
JCZBJGDX text,
JCZBJGDL number,
JCZBJGDW text,
SBBM text,
YQBH text... | 在12年2月8号到19年2月20号期间由医院0678334开出的检验报告单中,把不同检测指标名称以及不同检测指标结果定量单位下,检测指标结果定量的平均值列出来,并按平均值降序排序 | SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '0678334' AND BGRQ BETWEEN '2012-02-08' AND '2019-02-20' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) DESC | css |
CREATE TABLE table_name_19 (
attendance INTEGER,
opponent VARCHAR,
week VARCHAR
) | What was the highest attendance when the Atlanta Falcons played for a week smaller than 10? | SELECT MAX(attendance) FROM table_name_19 WHERE opponent = "atlanta falcons" AND week < 10 | sql_create_context |
CREATE TABLE table_name_36 (
pick VARCHAR,
year VARCHAR,
team VARCHAR,
position VARCHAR
) | What is the total pick number of the los angeles dodgers, which has a lhp position before 1979? | SELECT COUNT(pick) FROM table_name_36 WHERE team = "los angeles dodgers" AND position = "lhp" AND year < 1979 | sql_create_context |
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,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 医院6434630中,根据入院诊断疾病编码找出患不同疾病的病人平均年龄 | SELECT t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6434630' GROUP BY t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE diagnoses_icd (
row_id ... | count the current patients whose age is 60 or above. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age >= 60 | mimic_iii |
CREATE TABLE orders (
order_id number,
customer_id number,
order_status text,
date_order_placed time,
order_details text
)
CREATE TABLE order_items (
order_item_id number,
product_id number,
order_id number,
order_item_status text,
order_item_details text
)
CREATE TABLE custome... | What are the names of the customers who bought product 'food' at least once? | SELECT T1.customer_name FROM customers AS T1 JOIN orders AS T2 JOIN order_items AS T3 JOIN products AS T4 ON T1.customer_id = T2.customer_id AND T2.order_id = T3.order_id AND T3.product_id = T4.product_id WHERE T4.product_name = "food" GROUP BY T1.customer_id HAVING COUNT(*) >= 1 | spider |
CREATE TABLE table_train_48 (
"id" int,
"in_another_study" bool,
"renal_disease" bool,
"receiving_vasopressor" bool,
"sepsis" bool,
"hypotension" bool,
"septic_shock" bool,
"age" float,
"NOUSE" float
) | end stage renal disease | SELECT * FROM table_train_48 WHERE renal_disease = 1 | criteria2sql |
CREATE TABLE table_name_89 (
original_artist VARCHAR,
order__number VARCHAR
) | Which original artist had 5 as their order #? | SELECT original_artist FROM table_name_89 WHERE order__number = 5 | sql_create_context |
CREATE TABLE table_8244 (
"Team" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Overall" real
) | How many silver when the team is northwest territories and gold is less than 34? | SELECT COUNT("Silver") FROM table_8244 WHERE "Team" = 'northwest territories' AND "Gold" < '34' | wikisql |
CREATE TABLE table_14456 (
"Week" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" text
) | Who was the opponent when 48,121 people attended? | SELECT "Opponent" FROM table_14456 WHERE "Attendance" = '48,121' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text te... | Number of answers by a user in a timeframe. | SELECT Id AS "post_link", CreationDate FROM Posts WHERE OwnerUserId = '##UserId:int?4945##' AND PostTypeId = 2 AND CreationDate BETWEEN '2018-04-01 00:00:00' AND '2019-04-01 00:00:00' LIMIT 10 | sede |
CREATE TABLE table_48210 (
"Winner" text,
"Country" text,
"Winter Olympics" real,
"FIS Nordic World Ski Championships" text,
"Holmenkollen" text
) | what is the winter olympics year when the fis nordic world ski championships is 1976? | SELECT "Winter Olympics" FROM table_48210 WHERE "FIS Nordic World Ski Championships" = '1976' | wikisql |
CREATE TABLE table_name_8 (
game INTEGER,
series VARCHAR
) | Which Game has a Series of flyers win 3 0? Question 3 | SELECT MAX(game) FROM table_name_8 WHERE series = "flyers win 3–0" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | how much does it cost to get a lab oxyhemoglobin test? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'oxyhemoglobin') | eicu |
CREATE TABLE table_name_70 (
races VARCHAR,
poles INTEGER
) | What is the total number of Races with a Pole that is larger than 0? | SELECT COUNT(races) FROM table_name_70 WHERE poles > 0 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | how many patients whose drug type is base were diagnosed under diagnosis icd9 code v667? | 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.icd9_code = "V667" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | provide the number of patients whose admission type is elective and drug name is vitamin d? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Vitamin D" | mimicsql_data |
CREATE TABLE table_1341453_51 (
incumbent VARCHAR,
first_elected VARCHAR
) | Who's the incumbent in the district that first elected in 1969? | SELECT incumbent FROM table_1341453_51 WHERE first_elected = 1969 | sql_create_context |
CREATE TABLE table_15887683_5 (
ppv VARCHAR,
television_service VARCHAR
) | How many PPV values are listed for when television service Sky Cinema 1? | SELECT COUNT(ppv) FROM table_15887683_5 WHERE television_service = "Sky Cinema 1" | sql_create_context |
CREATE TABLE table_204_933 (
id number,
"year" number,
"competition" text,
"date" text,
"location" text,
"opponent" text,
"score" text,
"result" text,
"bye" text
) | how many games did the austrians win in the 1990s ? | SELECT COUNT(*) FROM table_204_933 WHERE "result" = 'win' | squall |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | until 2101 what was the first hospital discharge time of patient 32592? | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 32592 AND STRFTIME('%y', admissions.dischtime) <= '2101' ORDER BY admissions.dischtime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_64 (
class VARCHAR,
race VARCHAR
) | What is the class of the Charlotte Camel gt 500 race? | SELECT class FROM table_name_64 WHERE race = "charlotte camel gt 500" | sql_create_context |
CREATE TABLE table_51411 (
"Year" real,
"Film" text,
"Role" text,
"Leading Man" text,
"Director" text
) | What film was the director william a. wellman, later than 1931 with a leading man of george brent, and a Role of joan gordon, aka francine la rue? | SELECT "Film" FROM table_51411 WHERE "Director" = 'william a. wellman' AND "Year" > '1931' AND "Leading Man" = 'george brent' AND "Role" = 'joan gordon, aka francine la rue' | wikisql |
CREATE TABLE faculty (
facid number,
lname text,
fname text,
rank text,
sex text,
phone number,
room text,
building text
)
CREATE TABLE activity (
actid number,
activity_name text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex... | What are the first names of the faculty members playing both Canoeing and Kayaking? | SELECT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WHERE T3.activity_name = 'Canoeing' INTERSECT SELECT T1.lname FROM faculty AS T1 JOIN faculty_participates_in AS T2 ON T1.facid = T2.facid JOIN activity AS T3 ON T2.actid = T2.actid WH... | spider |
CREATE TABLE table_1161065_28 (
up_down VARCHAR,
hosted VARCHAR
) | What is the up/down at the venue that hosted 7 games? | SELECT up_down FROM table_1161065_28 WHERE hosted = 7 | sql_create_context |
CREATE TABLE table_30030 (
"Series #" real,
"Season #" text,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | How many series numbers are there when there were 15.8 u.s. viewers (millions)? | SELECT COUNT("Series #") FROM table_30030 WHERE "U.S. viewers (millions)" = '15.8' | wikisql |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters ... | When it comes to setting exams for her classes , does Prof. Elena Fort always do that ? | SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN... | advising |
CREATE TABLE table_64750 (
"Year" real,
"Game" text,
"Genre" text,
"Platform(s)" text,
"Developer(s)" text
) | Who was the developer of Call of Duty: Black Ops? | SELECT "Developer(s)" FROM table_64750 WHERE "Game" = 'call of duty: black ops' | wikisql |
CREATE TABLE table_name_93 (
year INTEGER,
wins VARCHAR,
losses VARCHAR
) | What is the total number of Year with Wins of 1, and Losses smaller than 1? | SELECT SUM(year) FROM table_name_93 WHERE wins = 1 AND losses < 1 | sql_create_context |
CREATE TABLE table_3210 (
"Region" text,
"Median income ( Intl.$ )" real,
"Below 40% of median income" text,
"Below 50% of median income" text,
"Below 60% of median income" text
) | In what region do 18.6% of the people make less than 50% of the median income? | SELECT "Region" FROM table_3210 WHERE "Below 50% of median income" = '18.6%' | wikisql |
CREATE TABLE table_41197 (
"Game" real,
"Date" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Set 4" text,
"Set 5" text,
"Result (sets)" text,
"Result (Pts)" text
) | What is the Set 5 with a Game that is 59? | SELECT "Set 5" FROM table_41197 WHERE "Game" = '59' | wikisql |
CREATE TABLE table_10838 (
"Rank" real,
"Constituency" text,
"Winning party 2007" text,
"Swing to gain" real,
"PC's place 2007" text,
"Result" text
) | What's the sum of swing to gain with a winning party 2007 of Conservative with a rank smaller than 5? | SELECT SUM("Swing to gain") FROM table_10838 WHERE "Winning party 2007" = 'conservative' AND "Rank" < '5' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | what is drug route of drug code mago140? | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "MAGO140" | mimicsql_data |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
Mark... | PostHistory TypeID 18 (Merged) - Empty. | SELECT * FROM PostHistory WHERE PostHistory.PostHistoryTypeId = 18 LIMIT 100 | sede |
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Docume... | Show the number of documents in each day for all documents on project with details 'Graph Database project' and bin document date by year interval with a line chart, display X from high to low order. | SELECT Document_Date, COUNT(Document_Date) FROM Documents AS T1 JOIN Projects AS T2 ON T1.Project_ID = T2.Project_ID WHERE T2.Project_Details = 'Graph Database project' ORDER BY Document_Date DESC | nvbench |
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... | Finding basic thank you comments (fewer than 20 characters). | SELECT c.Id AS "comment_link", c.Text AS "comment_body", (SELECT COUNT(c.Id) AS "comment_link" FROM Comments AS c WHERE (c.Text LIKE '%thank%' OR c.Text LIKE '%thx%') AND LENGTH(c.Text) < 20) AS "total_comments" FROM Comments AS c WHERE (c.Text LIKE '%thank%' OR c.Text LIKE '%thx%') AND LENGTH(c.Text) < 20 ORDER BY c.C... | sede |
CREATE TABLE table_name_61 (
date VARCHAR,
series VARCHAR
) | On which date did the Winfield Triple Challenge series take place? | SELECT date FROM table_name_61 WHERE series = "winfield triple challenge" | sql_create_context |
CREATE TABLE table_204_195 (
id number,
"team" text,
"home city" text,
"stadium" text,
"capacity" number,
"last season" text
) | how many people can attend a game in holon city arena ? | SELECT "capacity" FROM table_204_195 WHERE "stadium" = 'holon city arena' | squall |
CREATE TABLE weather (
date text,
max_temperature_f number,
mean_temperature_f number,
min_temperature_f number,
max_dew_point_f number,
mean_dew_point_f number,
min_dew_point_f number,
max_humidity number,
mean_humidity number,
min_humidity number,
max_sea_level_pressure_inc... | What is the average bike availablility for stations not in Palo Alto? | SELECT AVG(bikes_available) FROM status WHERE NOT station_id IN (SELECT id FROM station WHERE city = "Palo Alto") | spider |
CREATE TABLE table_79646 (
"Year" real,
"Player" text,
"Country" text,
"Score" text,
"To Par" text,
"Margin" real,
"Earnings ($)" real
) | How many years have a Player of joe durant, and Earnings ($) larger than 396,000? | SELECT COUNT("Year") FROM table_79646 WHERE "Player" = 'joe durant' AND "Earnings ($)" > '396,000' | wikisql |
CREATE TABLE table_7594 (
"Format name" text,
"Container" text,
"Video coding" text,
"Bit depth" real,
"Color sampling" text,
"Frame size" text,
"Video bit rate, Mbit/s" text,
"Audio coding" text
) | What format name has dv as video coding and 4:1:1 as the color sampling? | SELECT "Format name" FROM table_7594 WHERE "Video coding" = 'dv' AND "Color sampling" = '4:1:1' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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 departments (
DEPARTME... | For those employees who was hired before 2002-06-21, return a line chart about the change of commission_pct over hire_date . | SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_name_32 (
cfl_team VARCHAR,
college VARCHAR
) | Which cfl team was associated with the college of manitoba? | SELECT cfl_team FROM table_name_32 WHERE college = "manitoba" | sql_create_context |
CREATE TABLE table_name_30 (
attendance INTEGER,
round VARCHAR,
home VARCHAR,
date VARCHAR
) | What is the lowest attendance on Monday, November 10 when link pings hc was the home team and there were more than 18 rounds? | SELECT MIN(attendance) FROM table_name_30 WHERE home = "linköpings hc" AND date = "monday, november 10" AND round > 18 | sql_create_context |
CREATE TABLE table_47462 (
"Date" real,
"Tracks" text,
"Length" text,
"Label" text,
"Catalog" text
) | On what Date did Columbia release the Track 'Do it again'? | SELECT SUM("Date") FROM table_47462 WHERE "Label" = 'columbia' AND "Tracks" = 'do it again' | wikisql |
CREATE TABLE table_16151 (
"Country" text,
"Membership (from 2010)" real,
"Name of member organization" text,
"Year current Scouting organization joined WOSM" text,
"Year member organization was founded" text,
"Admits boys/girls" text
) | Does Venezuela admit only boys, only girls, or both? | SELECT "Admits boys/girls" FROM table_16151 WHERE "Country" = 'Venezuela' | wikisql |
CREATE TABLE table_name_82 (
pos INTEGER,
car__number VARCHAR
) | What was the average position of car number 59? | SELECT AVG(pos) FROM table_name_82 WHERE car__number = 59 | sql_create_context |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | Draw a bar chart about the distribution of name and meter_100 , and display from high to low by the names. | SELECT name, meter_100 FROM swimmer ORDER BY name DESC | nvbench |
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... | 在08849932571检验结果指标中记录的设备编码和仪器编号以及其名称分别是什么? | SELECT jyjgzbb.SBBM, jyjgzbb.YQBH, jyjgzbb.YQMC FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '08849932571' | css |
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 cost (
costid number,
uniquepi... | indicate the daily minimum volume of t tube that patient 027-8953 has had on the first intensive care unit visit. | SELECT MIN(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-8953') AND NOT patient.unitdischargetime IS ... | eicu |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_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,
H... | 42849404这个病人在医疗就诊14468972682中,开的什么药及其每次的用量和使用频次 | SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '14468972682' | css |
CREATE TABLE table_203_175 (
id number,
"rank" text,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many gold medals did italy receive ? | SELECT "gold" FROM table_203_175 WHERE "nation" = 'italy' | squall |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | what was the last time of patient 031-16123 urine, voided specimen microbiology test on their last hospital encounter? | SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-16123' AND NOT patient.hospitaldischargetime IS NULL ORDER BY... | eicu |
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,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 自二零一三年四月二十六日开始,截止到二零一六年八月三日,看看参保人89232453单一药品最大的购买次数共发生过多少次 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '89232453' AND t_kc22.STA_DATE BETWEEN '2013-04-26' AND '2016-08-03' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text... | how many patients have received a ins drug-elut coronry st procedure two times during the last year? | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ins drug-elut coronry... | mimic_iii |
CREATE TABLE airport_aircraft (
ID int,
Airport_ID int,
Aircraft_ID int
)
CREATE TABLE pilot (
Pilot_Id int(11),
Name varchar(50),
Age int(11)
)
CREATE TABLE match (
Round real,
Location text,
Country text,
Date text,
Fastest_Qualifying text,
Winning_Pilot text,
Win... | List the names of aircrafts and the number of times it won matches Plot them as bar chart, list by the total number in descending. | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_train_196 (
"id" int,
"systolic_blood_pressure_sbp" int,
"heart_disease" bool,
"renal_disease" bool,
"diabetic" string,
"diastolic_blood_pressure_dbp" int,
"serum_creatinine" float,
"hypertension" bool,
"NOUSE" float
) | subject has type ii diabetes | SELECT * FROM table_train_196 WHERE diabetic = 'ii' | criteria2sql |
CREATE TABLE table_66787 (
"Rank" text,
"Goals" text,
"Player" text,
"Club" text,
"Season" text
) | In what season was there a club of South Melbourne? | SELECT "Season" FROM table_66787 WHERE "Club" = 'south melbourne' | wikisql |
CREATE TABLE table_name_73 (
term_in_office VARCHAR,
electorate VARCHAR
) | What term did an Electorate of indi have in office? | SELECT term_in_office FROM table_name_73 WHERE electorate = "indi" | sql_create_context |
CREATE TABLE table_22774 (
"Outcome" text,
"Year" real,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What is the result in the final versos Jennifer Capriati? | SELECT "Outcome" FROM table_22774 WHERE "Opponent in the final" = 'Jennifer Capriati' | wikisql |
CREATE TABLE table_14407512_24 (
overall_nt_points VARCHAR,
points VARCHAR
) | Name the number of overall nt points for 248.9 | SELECT COUNT(overall_nt_points) FROM table_14407512_24 WHERE points = "248.9" | sql_create_context |
CREATE TABLE table_14703 (
"Name" text,
"Country" text,
"Loan Club" text,
"Started" text,
"Ended" text,
"Start Source" text,
"End Source" text
) | What is the End Source from the Hartlepool United Loan Club? | SELECT "End Source" FROM table_14703 WHERE "Loan Club" = 'hartlepool united' | wikisql |
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,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 在2007年9月14号到2018年6月15号医院3266292所有医疗就诊记录中非科室小儿口腔科是哪些呢? | SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '3266292' AND gwyjzb.IN_HOSP_DATE BETWEEN '2007-09-14' AND '2018-06-15' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '3266292' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2007-09-14' AND '2018-06-15' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '326629... | css |
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... | 89956655081的患者卡号以及卡类型在门诊就诊里分别是什么? | SELECT mzjzjlb.KH, mzjzjlb.KLX FROM mzjzjlb WHERE mzjzjlb.JZLSH = '89956655081' | css |
CREATE TABLE table_70574 (
"Riding" text,
"Candidate's Name" text,
"Gender" text,
"Residence" text,
"Occupation" text,
"Votes" real,
"Rank" text
) | What is the lowest number of Votes, when the Candidate's Name is Trevor Ennis? | SELECT MIN("Votes") FROM table_70574 WHERE "Candidate's Name" = 'trevor ennis' | wikisql |
CREATE TABLE table_77221 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Crowd" real,
"Box Score" text,
"Report" text
) | What was the number of the crowd when the Wollongong Hawks were the home team? | SELECT SUM("Crowd") FROM table_77221 WHERE "Home team" = 'wollongong hawks' | wikisql |
CREATE TABLE table_58861 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What is the Money ($) amount of the Player with a To par of e? | SELECT "Money ( $ )" FROM table_58861 WHERE "To par" = 'e' | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE allergy (
allergy... | what was the first chest tube output: pleural r anterior, lateral output time for patient 007-11182 on the first intensive care unit visit? | SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-11182') AND NOT patient.unitdischargetime IS NULL... | eicu |
CREATE TABLE table_75474 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which opponent has a game larger than 61, february smaller than 28, and fewer points than 69? | SELECT "Opponent" FROM table_75474 WHERE "Game" > '61' AND "February" < '28' AND "Points" < '69' | wikisql |
CREATE TABLE mzb (
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... | 患者44017290在二00五年十月十八日到二0一二年二月二十八日期间,最常去的是哪家医院 | SELECT qtb.MED_SER_ORG_NO FROM qtb WHERE qtb.PERSON_ID = '44017290' AND qtb.IN_HOSP_DATE BETWEEN '2005-10-18' AND '2012-02-28' GROUP BY qtb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.MED_SER_ORG_NO FROM gyb WHERE gyb.PERSON_ID = '44017290' AND gyb.IN_HOSP_DATE BETWEEN '2005-10-18' AND '2012-02-28' G... | css |
CREATE TABLE table_23292220_8 (
episode VARCHAR,
seans_team VARCHAR
) | In how many episodes did Sean's team include Jeremy Clarkson and James McQuillan? | SELECT COUNT(episode) FROM table_23292220_8 WHERE seans_team = "Jeremy Clarkson and James McQuillan" | sql_create_context |
CREATE TABLE table_name_41 (
team VARCHAR,
race_2 VARCHAR
) | What is Team, when Race 2 is '5'? | SELECT team FROM table_name_41 WHERE race_2 = "5" | sql_create_context |
CREATE TABLE table_56365 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the name of the competition that ended with a score of 2-1? | SELECT "Competition" FROM table_56365 WHERE "Score" = '2-1' | wikisql |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
... | Show the ids and details of the investors who have at least two transactions with type code 'SALE'. Plot them as bar chart. | SELECT T1.Investor_details, T1.investor_id FROM Investors AS T1 JOIN Transactions AS T2 ON T1.investor_id = T2.investor_id WHERE T2.transaction_type_code = "SALE" | nvbench |
CREATE TABLE table_23248869_8 (
game INTEGER,
high_points VARCHAR
) | What was the game when high points was david lee (30) | SELECT MIN(game) FROM table_23248869_8 WHERE high_points = "David Lee (30)" | sql_create_context |
CREATE TABLE table_61550 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" text
) | What is Greg Norman's score? | SELECT "Score" FROM table_61550 WHERE "Player" = 'greg norman' | wikisql |
CREATE TABLE table_name_15 (
attendance VARCHAR,
opponent VARCHAR
) | What was the attendance in the game against the Detroit Lions? | SELECT attendance FROM table_name_15 WHERE opponent = "detroit lions" | sql_create_context |
CREATE TABLE table_name_14 (
nationality VARCHAR,
round VARCHAR
) | What is the nationality of the player from round 7? | SELECT nationality FROM table_name_14 WHERE round = 7 | sql_create_context |
CREATE TABLE table_27659 (
"English" text,
"Latin" text,
"Proto-Italo-Western 1" text,
"Conservative Central Italian 1" text,
"Italian" text,
"Spanish" text,
"Catalan" text,
"Old French" text
) | What is every entry for Latin when Catalan is Mar? | SELECT "Latin" FROM table_27659 WHERE "Catalan" = 'mar' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.