context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
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... | 在医院1027298的医疗记录中显示出院诊断出号码J20.239疾病的人的最低和最高医疗费合计金额是多少? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1027298' AND gwyjzb.OUT_DIAG_DIS_CD = 'J20.239' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1027298' AND fgwyjzb.OUT_D... | css |
CREATE TABLE table_4748 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the away team at punt road oval? | SELECT "Away team" FROM table_4748 WHERE "Venue" = 'punt road oval' | wikisql |
CREATE TABLE table_16383 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Which player's college is Saskatchewan? | SELECT "Player" FROM table_16383 WHERE "College" = 'Saskatchewan' | wikisql |
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE repair (
repair_I... | A bar chart for listing the number of the names of technicians in ascending order of age. | SELECT Name, COUNT(Name) FROM technician GROUP BY Name ORDER BY Age | nvbench |
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area TEXT,
isAVA TEXT
)
CREATE TABLE grapes (
ID INTEGER,
Grape TEXT,
Color TEXT
)
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TE... | Plot the number of county by grouped by county as a bar graph, and order Y-axis in ascending order. | SELECT County, COUNT(County) FROM appellations GROUP BY County ORDER BY COUNT(County) | nvbench |
CREATE TABLE table_22834834_2 (
championship VARCHAR,
year VARCHAR
) | Who is the championship for the year of 1993? | SELECT championship FROM table_22834834_2 WHERE year = 1993 | sql_create_context |
CREATE TABLE table_203_109 (
id number,
"treaty" text,
"organization" text,
"introduced" number,
"signed" number,
"ratified" number
) | how long did it take for the international covenant on civil and political rights to be signed before it was ratified ? | SELECT "signed" - "introduced" FROM table_203_109 WHERE "treaty" = 'international covenant on civil and political rights' | squall |
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 emergency hospital admission patients who were admitted before the year 2165? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.admityear < "2165" | mimicsql_data |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugst... | so what's the minimum bun value of patient 021-25705 in a month before? | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-25705')) AND lab.labname = 'bun' AND DATETIME(lab.labresulttime, 'start of mon... | eicu |
CREATE TABLE table_name_78 (
location VARCHAR,
year VARCHAR,
score VARCHAR
) | Which Location has a Year larger than 2006, and a Score of 6 3, 6 3? | SELECT location FROM table_name_78 WHERE year > 2006 AND score = "6–3, 6–3" | sql_create_context |
CREATE TABLE team_franchise (
franchise_id TEXT,
franchise_name TEXT,
active TEXT,
na_assoc TEXT
)
CREATE TABLE player_award_vote (
award_id TEXT,
year INTEGER,
league_id TEXT,
player_id TEXT,
points_won NUMERIC,
points_max INTEGER,
votes_first NUMERIC
)
CREATE TABLE hall_o... | Show the trend about the number of attendance at home games change over the years, bin year into year interval, I want to show in desc by the X. | SELECT year, SUM(attendance) FROM home_game ORDER BY year DESC | nvbench |
CREATE TABLE table_203_871 (
id number,
"#" number,
"player" text,
"pos" text,
"pts" number,
"tries" number,
"conv" number,
"pens" number,
"drop" number,
"opposition" text,
"venue" text,
"date" text
) | how many people that are not diego dominguez have scored at least 24 points in a match for italy ? | SELECT COUNT("player") FROM table_203_871 WHERE "player" <> 'diego dominguez' AND "pts" >= 24 | squall |
CREATE TABLE table_37801 (
"Position" text,
"Number" real,
"Name" text,
"Height" text,
"Weight" real,
"Class" text,
"Hometown" text,
"Games\u2191" real
) | What is the average games of Tony Dixon? | SELECT AVG("Games\u2191") FROM table_37801 WHERE "Name" = 'tony dixon' | wikisql |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
ic... | when was the last test performed since 12/2105 in the lab on patient 016-27397? | SELECT lab.labresulttime FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-27397')) AND STRFTIME('%y-%m', lab.labresulttime) >= '2105-12' ORDER BY lab.lab... | eicu |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Student (
StuID INTEGER,
LName... | How many male and female assistant professors do we have, list y axis in ascending order. | SELECT Sex, COUNT(*) FROM Faculty WHERE Rank = "AsstProf" GROUP BY Sex ORDER BY COUNT(*) | nvbench |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
... | High-reputation users who no longer visit the site. | SELECT Id AS "user_link", LastAccessDate FROM Users WHERE Reputation >= '##MinReputation##' ORDER BY LastAccessDate | sede |
CREATE TABLE table_10391 (
"Round" text,
"Pick" text,
"Player" text,
"Position" text,
"Nationality" text,
"Team" text,
"College" text
) | Which team has Pick 13 in Round 2? | SELECT "Team" FROM table_10391 WHERE "Round" = '2' AND "Pick" = '13' | wikisql |
CREATE TABLE table_25987 (
"Player" text,
"Games Played" real,
"Minutes" real,
"Field Goals" real,
"Three Pointers" real,
"Free Throws" real,
"Rebounds" real,
"Assists" real,
"Blocks" real,
"Steals" real,
"Points" real
) | If the player is Jasmine Wynne, what is the minimum number of steals? | SELECT MIN("Steals") FROM table_25987 WHERE "Player" = 'Jasmine Wynne' | wikisql |
CREATE TABLE table_name_3 (
flt_goals INTEGER,
league_cup_apps VARCHAR,
league_cup_goals VARCHAR,
position VARCHAR
) | What is the highest FLT goals with 0 league cup goals, a GK position, and 2 league cup apps? | SELECT MAX(flt_goals) FROM table_name_3 WHERE league_cup_goals = 0 AND position = "gk" AND league_cup_apps = "2" | sql_create_context |
CREATE TABLE table_203_450 (
id number,
"team" text,
"outgoing manager" text,
"manner of departure" text,
"date of vacancy" text,
"replaced by" text,
"date of appointment" text,
"position in table" text
) | how many outgoing managers were appointed in november 2007 ? | SELECT COUNT("outgoing manager") FROM table_203_450 WHERE "date of appointment" = 11 AND "date of appointment" = 2007 | squall |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Stack bar chart of school_id vs ACC_Road based on all home, and show by the Y-axis from high to low please. | SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY School_ID DESC | nvbench |
CREATE TABLE table_203_356 (
id number,
"type" text,
"diagonal (mm)" text,
"width (mm)" text,
"height (mm)" text,
"area (mm2)" text,
"stops (area)" number,
"crop factor" text
) | what is the different in area between the 1/10 and the 1/8 ? | SELECT ABS((SELECT "area (mm2)" FROM table_203_356 WHERE "type" = '1/10"') - (SELECT "area (mm2)" FROM table_203_356 WHERE "type" = '1/8"')) | squall |
CREATE TABLE lessons (
lesson_id number,
customer_id number,
lesson_status_code text,
staff_id number,
vehicle_id number,
lesson_date time,
lesson_time text,
price number
)
CREATE TABLE addresses (
address_id number,
line_1_number_building text,
city text,
zip_postcode t... | What is the first name of all employees who do not give any lessons? | SELECT first_name FROM staff EXCEPT SELECT T2.first_name FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id | spider |
CREATE TABLE table_name_42 (
score_final INTEGER,
rank_final VARCHAR,
year VARCHAR
) | Which Score-Final has a Rank-Final of 2, and a Year smaller than 2008? | SELECT SUM(score_final) FROM table_name_42 WHERE rank_final = 2 AND year < 2008 | sql_create_context |
CREATE TABLE table_name_64 (
member_state VARCHAR
) | What is the 2011 value with a 2008 value of 0.3 and is a member state of the European Union? | SELECT 2011 FROM table_name_64 WHERE 2008 = "0.3" AND member_state = "european union" | sql_create_context |
CREATE TABLE table_51013 (
"Constituency" text,
"Electorate" real,
"Votes" real,
"Turnout" real,
"Spoilt" real,
"Percent Yes" real
) | WHAT IS THE LOWEST TURNOUT FOR AN ELECTORATE LARGER THAN 47,822 AND SPOILT OF 2,333? | SELECT MIN("Turnout") FROM table_51013 WHERE "Electorate" > '47,822' AND "Spoilt" = '2,333' | wikisql |
CREATE TABLE party_host (
Party_ID int,
Host_ID int,
Is_Main_in_Charge bool
)
CREATE TABLE party (
Party_ID int,
Party_Theme text,
Location text,
First_year text,
Last_year text,
Number_of_hosts int
)
CREATE TABLE host (
Host_ID int,
Name text,
Nationality text,
Age... | Show the total number of the last year of parties with the theme 'Spring' or 'Teqnology' with a bar chart, bin the last year into weekday interval, and count the first year. | SELECT Last_year, COUNT(Last_year) FROM party WHERE Party_Theme = "Spring" OR Party_Theme = "Teqnology" | nvbench |
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 cost (
costid num... | what are the medicines that were added to patient 006-123134 today compared to the ones yesterday? | SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.uniquepid = '006-123134') AND DATETIME(medication.drugstarttime, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT medication.drugname FROM medic... | eicu |
CREATE TABLE table_name_13 (
date VARCHAR,
opponent VARCHAR
) | What is Date, when Opponent is At Saskatchewan Roughriders? | SELECT date FROM table_name_13 WHERE opponent = "at saskatchewan roughriders" | 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... | give me the number of patients whose drug code is myco500i? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "MYCO500I" | mimicsql_data |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
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,... | When is 510 being given next semester ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM course, course_offering, semester WHERE course.course_id = course_offe... | advising |
CREATE TABLE table_17501 (
".308 Winchester cartridge type" text,
"100 m group (mm)" text,
"100 m group ( MOA )" text,
"300 m group (mm)" text,
"300 m group ( MOA )" text
) | For which 300 m group ( moa ) is the 300 m group (mm) 45 | SELECT "300 m group ( MOA )" FROM table_17501 WHERE "300 m group (mm)" = '45' | wikisql |
CREATE TABLE table_48175 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | what is the record when the event is shido usa mma and the opponent is raphael assun o? | SELECT "Record" FROM table_48175 WHERE "Event" = 'shido usa mma' AND "Opponent" = 'raphael assunção' | wikisql |
CREATE TABLE table_58850 (
"Drug" text,
"Mean" real,
"Pleasure" real,
"Psychological dependence" real,
"Physical dependence" real
) | What is the total number of Pleasure(s), when Psychological Dependence is greater than 1.9, and when Drug is 'Benzodiazepines'? | SELECT COUNT("Pleasure") FROM table_58850 WHERE "Psychological dependence" > '1.9' AND "Drug" = 'benzodiazepines' | wikisql |
CREATE TABLE table_37819 (
"2005/ 06" text,
"2006/ 07" text,
"2007/ 08" text,
"2008/ 09" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
) | Which 2009/10 has a 2005/06 of not held, and a 2010/11 of not held? | SELECT "2009/ 10" FROM table_37819 WHERE "2005/ 06" = 'not held' AND "2010/ 11" = 'not held' | wikisql |
CREATE TABLE table_71997 (
"Region" text,
"Date" real,
"Label" text,
"Format" text,
"Catalog" text
) | What was the label's format LP and catalog of CH-9192? | SELECT "Label" FROM table_71997 WHERE "Format" = 'lp' AND "Catalog" = 'ch-9192' | wikisql |
CREATE TABLE table_name_72 (
scored INTEGER,
date VARCHAR
) | How many times did Sham Kwok Fai score in the game that was played on 22 February 2006? | SELECT SUM(scored) FROM table_name_72 WHERE date = "22 february 2006" | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TA... | Meta Stack Exchange posts with votes before they were created. | SELECT pv.age AS "post_age", pv.VoteId AS "vote_id", pv.VoteTypeId AS "vote_type", pv.UserId AS "vote_user", pv.UserId AS "user_link", pv.Id AS "post_link" FROM (SELECT DATEDIFF(day, CAST(p.CreationDate AS DATE), CreationDate) AS age, p.Id, v.Id AS VoteId, v.VoteTypeId, v.UserId FROM Posts AS p LEFT JOIN Votes AS v ON ... | sede |
CREATE TABLE table_name_64 (
regular_season VARCHAR,
league VARCHAR,
year VARCHAR
) | WHICH Regular Season has a League of npsl, and a Year of 2008? | SELECT regular_season FROM table_name_64 WHERE league = "npsl" AND year = "2008" | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | give me the number of patients whose discharge location is snf and lab test name is bilirubin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.discharge_location = "SNF" AND lab.label = "Bilirubin" | mimicsql_data |
CREATE TABLE table_26267849_11 (
semi_finals_result VARCHAR,
performance_order VARCHAR
) | Name the number of semi final results for 12 performance order | SELECT COUNT(semi_finals_result) FROM table_26267849_11 WHERE performance_order = 12 | sql_create_context |
CREATE TABLE table_71217 (
"Group" real,
"Half-Life (s)" real,
"Decay Constant (s \u22121 )" real,
"Yield, Neutrons per Fission" real,
"Fraction" real
) | What is the decay constant with a half-life less than 22.72, a yield, neutrons per fission of 0.0031000000000000003, and a group number less than 3? | SELECT COUNT("Decay Constant (s \u22121 )") FROM table_71217 WHERE "Half-Life (s)" < '22.72' AND "Yield, Neutrons per Fission" = '0.0031000000000000003' AND "Group" < '3' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Medallas faltantes en puntuacion de candidato. | SELECT DISTINCT Name AS Medalla FROM Badges WHERE Name IN ('Civic Duty', 'Cleanup', 'Constituent', 'Convention', 'Copy Editor', 'Deputy', 'Electorate', 'Enthusiast', 'Explainer', 'Investor', 'Marshal', 'Organizer', 'Quorum', 'Refiner', 'Sportsmanship', 'Strunk & White', 'Tag Editor', 'Reviewer', 'Steward', 'Yearling') ... | sede |
CREATE TABLE table_20783 (
"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 latest episode in season 2 directed by jamie babbit? | SELECT MAX("No. in season") FROM table_20783 WHERE "Directed by" = 'Jamie Babbit' | wikisql |
CREATE TABLE table_name_14 (
ihsaa_football_class VARCHAR,
county VARCHAR,
school VARCHAR
) | Which IHSAA Football Class has a County of 77 sullivan, and a School of union dugger? | SELECT ihsaa_football_class FROM table_name_14 WHERE county = "77 sullivan" AND school = "union dugger" | sql_create_context |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location... | count the number of patients who received a procedure since 2101 for excise bone for gft nec. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'excise bone for gft nec') AND STRFTIME('%y', procedu... | mimic_iii |
CREATE TABLE table_63306 (
"Player" text,
"Int'l Debut" text,
"Year" real,
"Cross Code Debut" text,
"Date" text,
"Position" text
) | Which player had a Cross Code Debut of the RL test v France, International Debut of RU Test v Ireland in years after 1955? | SELECT "Player" FROM table_63306 WHERE "Cross Code Debut" = 'rl test v france' AND "Year" > '1955' AND "Int'l Debut" = 'ru test v ireland' | wikisql |
CREATE TABLE table_1140119_5 (
constructor VARCHAR,
race_name VARCHAR
) | Would built the winning car in the IV J.C.C. Jersey Road Race? | SELECT constructor FROM table_1140119_5 WHERE race_name = "IV J.C.C. Jersey Road Race" | sql_create_context |
CREATE TABLE weather (
date TEXT,
max_temperature_f INTEGER,
mean_temperature_f INTEGER,
min_temperature_f INTEGER,
max_dew_point_f INTEGER,
mean_dew_point_f INTEGER,
min_dew_point_f INTEGER,
max_humidity INTEGER,
mean_humidity INTEGER,
min_humidity INTEGER,
max_sea_level_pre... | For those dates that have the 5 highest cloud cover rates, please bin the date into weekdays interval and compute their total cloud cover, and show y-axis from low to high order. | SELECT date, SUM(cloud_cover) FROM weather ORDER BY SUM(cloud_cover) | nvbench |
CREATE TABLE table_name_18 (
loss INTEGER,
avg_g VARCHAR
) | WHAT IS THE LOSS WITH AN AVERAGE OF 89.9? | SELECT SUM(loss) FROM table_name_18 WHERE avg_g = 89.9 | sql_create_context |
CREATE TABLE table_23292220_5 (
first_broadcast VARCHAR,
jasons_team VARCHAR
) | Name the first broadcast for trisha goddard and glenn wool | SELECT first_broadcast FROM table_23292220_5 WHERE jasons_team = "Trisha Goddard and Glenn Wool" | sql_create_context |
CREATE TABLE table_name_57 (
rounds VARCHAR,
entrant VARCHAR
) | what is the rounds when the entrant is scuderia ferrari marlboro? | SELECT rounds FROM table_name_57 WHERE entrant = "scuderia ferrari marlboro" | sql_create_context |
CREATE TABLE table_name_23 (
total INTEGER,
nation VARCHAR,
silver VARCHAR,
gold VARCHAR
) | What is the average total when the silver is larger than 2, and a gold larger than 1, and a nation of total? | SELECT AVG(total) FROM table_name_23 WHERE silver > 2 AND gold > 1 AND nation = total | sql_create_context |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
ha... | what is the name of procedure patient 14397 has been given two times in this month? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 143... | mimic_iii |
CREATE TABLE table_2272 (
"-Butadiene" text,
"10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) absolute" text,
"10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) relative" text,
"\u0394H \u2021 /kcal mol \u22121" text,
"\u0394S \u2021 /cal mol \u22121 K \u22121" text
) | Name the 10 4 k /min 1 (30 c) ( 1-2%) relative for 17.3 | SELECT "10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) relative" FROM table_2272 WHERE "10 4 k /min \u22121 (30 \u00b0C) (\u00b1 1-2%) absolute" = '17.3' | wikisql |
CREATE TABLE table_29734 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many games were held on January 5? | SELECT COUNT("Game") FROM table_29734 WHERE "Date" = 'January 5' | wikisql |
CREATE TABLE hz_info_zyjzjlb (
JZLSH number,
YLJGDM number,
zyjzjlb_id number
)
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,
... | 患者彭云亭的检验报告结果指标均异常的检验报告单号是什么 | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb ON person_info.RYBH = 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 mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '彭云亭' AND NOT ... | css |
CREATE TABLE table_64948 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest number of bronze medals for a nation with fewer than 1 total medal? | SELECT MIN("Bronze") FROM table_64948 WHERE "Total" < '1' | wikisql |
CREATE TABLE table_71099 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
) | What is the number of females that has the Polish language? | SELECT "females" FROM table_71099 WHERE "Language" = 'polish' | wikisql |
CREATE TABLE table_66325 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What did the golfer from Australia score? | SELECT "Score" FROM table_66325 WHERE "Country" = 'australia' | wikisql |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Reviewer (
rID int,
name text
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
) | Visualize the total smallest rating of different movie title using a bar chart, and sort by the X in asc please. | SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY T2.title | nvbench |
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... | 有哪些人申请超过23份检验报告单在医疗就诊20918494970中?列出这些申请人工号是什么?姓名是什么? | SELECT SQRGH, SQRXM FROM jybgb WHERE JZLSH = '20918494970' GROUP BY SQRGH HAVING COUNT(*) > 23 | css |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE ... | show all flights between SAN FRANCISCO and PHILADELPHIA for 9 15 | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 15 AND date_day.month_number = 9 ... | atis |
CREATE TABLE table_79983 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real,
"Roll" real
) | What area is named Mackenzie college? | SELECT "Area" FROM table_79983 WHERE "Name" = 'mackenzie college' | wikisql |
CREATE TABLE table_30187 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | How many dates did the episode with a production code of 804 originally air on? | SELECT COUNT("Original air date") FROM table_30187 WHERE "Production code" = '804' | wikisql |
CREATE TABLE entrepreneur (
Company VARCHAR,
People_ID VARCHAR,
Money_Requested VARCHAR
)
CREATE TABLE people (
Name VARCHAR,
People_ID VARCHAR
) | List the names of entrepreneurs and their companies in descending order of money requested? | SELECT T2.Name, T1.Company FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested | sql_create_context |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 按照科室的不同名字和入院诊断的不同编码算算看医院5532316所有记载里患者的平均年纪 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5532316' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.IN_DIAG_DIS_CD | css |
CREATE TABLE table_59798 (
"Season" text,
"League" text,
"Teams" text,
"Home" text,
"Away" text
) | Which team had a season 1954-55? | SELECT "Teams" FROM table_59798 WHERE "Season" = '1954-55' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | how many government insurance patients had emergency room admission? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Government" AND demographic.admission_location = "EMERGENCY ROOM ADMIT" | mimicsql_data |
CREATE TABLE table_62089 (
"Device" text,
"Carrier" text,
"Package Version" text,
"Applications" text,
"Software Platform" text
) | WHAT IS THE DEVICE WITH MTS MOBILITY? | SELECT "Device" FROM table_62089 WHERE "Carrier" = 'mts mobility' | wikisql |
CREATE TABLE table_28099 (
"Season #" real,
"Episode #" real,
"Title" text,
"Director(s)" text,
"Writer(s)" text,
"Original Air Date" text
) | Name the directors for peter gawler | SELECT "Director(s)" FROM table_28099 WHERE "Writer(s)" = 'Peter Gawler' | wikisql |
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
arrival_date date,
price number(7,2),
aid number(9,0)
)
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE... | Display a bar chart for what is the name of each aircraft and how many flights does each one complete?, show in asc by the names. | SELECT name, COUNT(*) FROM flight AS T1 JOIN aircraft AS T2 ON T1.aid = T2.aid GROUP BY T1.aid ORDER BY name | nvbench |
CREATE TABLE table_name_21 (
area__km²_ INTEGER,
population VARCHAR,
country VARCHAR,
rank VARCHAR
) | What's the smallest area in Russia that is ranked 23 with a population more than 522,800? | SELECT MIN(area__km²_) FROM table_name_21 WHERE country = "russia" AND rank = 23 AND population > 522 OFFSET 800 | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | 能知道患者赵雪风在2008.2.14到20-09.12.1这段时间,2986060这个医疗机构给他开的西药量吗 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '赵雪风' AND t_kc22.STA_DATE BETWEEN '2008-02-14' AND '2009-12-01' AND t_kc21.MED_SER_ORG_NO = '2986060' AND t_kc22.MED_INV_ITEM... | css |
CREATE TABLE table_name_9 (
manufacturer VARCHAR,
fuel_type VARCHAR
) | What is the Manufacturer with a Fuel Type that is diesel? | SELECT manufacturer FROM table_name_9 WHERE fuel_type = "diesel" | sql_create_context |
CREATE TABLE table_10280 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/retired" text,
"Grid" real
) | Tell me the Laps for time/retired of +8 laps | SELECT "Laps" FROM table_10280 WHERE "Time/retired" = '+8 laps' | wikisql |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE procedures_icd (
... | what are the top five most common procedures that followed within 2 months for patients who received liver transplant nec in 2104? | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admi... | mimic_iii |
CREATE TABLE table_10342194_3 (
amount_of_trees VARCHAR,
_that_require_replacement VARCHAR,
district VARCHAR
) | What is the amount of trees, that require replacement when district is leninsky? | SELECT amount_of_trees, _that_require_replacement FROM table_10342194_3 WHERE district = "Leninsky" | sql_create_context |
CREATE TABLE table_name_68 (
rank INTEGER,
date VARCHAR
) | Date of 7 september 1996 includes which highest rank athlete? | SELECT MAX(rank) FROM table_name_68 WHERE date = "7 september 1996" | sql_create_context |
CREATE TABLE table_8829 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What was Ralph Shoaf's pick number? | SELECT "Pick" FROM table_8829 WHERE "Name" = 'ralph shoaf' | wikisql |
CREATE TABLE table_name_78 (
role VARCHAR,
closing_broadway_cast VARCHAR
) | Which role had a closing broadway cast of Adam Grupper? | SELECT role FROM table_name_78 WHERE closing_broadway_cast = "adam grupper" | sql_create_context |
CREATE TABLE table_19086 (
"Code" real,
"County" text,
"Former Province" text,
"Area (km 2 )" text,
"Population Census 2009" real,
"Capital" text
) | how many capital with population census 2009 being 284657 | SELECT COUNT("Capital") FROM table_19086 WHERE "Population Census 2009" = '284657' | 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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients whose admission type is urgent and lab test fluid is pleural? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE table_17542 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | what's the minimum production code written by jay sommers & dick chevillat and al schwartz | SELECT MIN("Production code") FROM table_17542 WHERE "Written by" = 'Jay Sommers & Dick Chevillat and Al Schwartz' | wikisql |
CREATE TABLE table_name_64 (
facility_id INTEGER,
call_sign VARCHAR
) | WHich Facility ID has a Call sign of wnpr? | SELECT AVG(facility_id) FROM table_name_64 WHERE call_sign = "wnpr" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who did not have any job in the past, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart, and show by the x axis in ascending please. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_75840 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | From which region is the album with release date of 19 June 2007? | SELECT "Region" FROM table_75840 WHERE "Date" = '19 june 2007' | wikisql |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
... | what are the top five commonly prescribed drugs that patients were prescribed after having received a packed cell transfusion treatment since 6 years ago within the same hospital visit? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FR... | mimic_iii |
CREATE TABLE table_name_41 (
incumbent VARCHAR,
first_elected VARCHAR,
district VARCHAR
) | Who is the incumbent who was first elected before 2002 from the maryland 3 district? | SELECT incumbent FROM table_name_41 WHERE first_elected < 2002 AND district = "maryland 3" | sql_create_context |
CREATE TABLE table_204_573 (
id number,
"#" number,
"title" text,
"performer(s)" text,
"film" text,
"length" text
) | which song has the most time ? | SELECT "title" FROM table_204_573 ORDER BY "length" DESC LIMIT 1 | squall |
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 departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For those employees who was hired before 2002-06-21, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id by a bar chart, and rank from low to high by the x-axis. | SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID | nvbench |
CREATE TABLE table_name_19 (
icao VARCHAR,
iata VARCHAR
) | What is the ICAO when the IATA is ika? | SELECT icao FROM table_name_19 WHERE iata = "ika" | sql_create_context |
CREATE TABLE table_24840 (
"Type" text,
"Registration" text,
"Design" text,
"Construction" text,
"Service" text,
"Construction date" text,
"Conformity to original design" text,
"Interest" text,
"Number existing in Switzerland" text,
"Number existing worldwide" text,
"Status" ... | What are all types where registration is HB-OPU? | SELECT "Type" FROM table_24840 WHERE "Registration" = 'HB-OPU' | wikisql |
CREATE TABLE table_name_97 (
preliminaries VARCHAR,
interview VARCHAR,
state VARCHAR,
evening_gown VARCHAR,
average VARCHAR
) | What is the preliminaries of the contestant from Massachusetts with an evening gown higher than 8.631, an average less than 8.791, and an interview higher than 8.608? | SELECT COUNT(preliminaries) FROM table_name_97 WHERE evening_gown > 8.631 AND average < 8.791 AND state = "massachusetts" AND interview > 8.608 | sql_create_context |
CREATE TABLE editor (
Editor_ID int,
Name text,
Age real
)
CREATE TABLE journal (
Journal_ID int,
Date text,
Theme text,
Sales int
)
CREATE TABLE journal_committee (
Editor_ID int,
Journal_ID int,
Work_Type text
) | Give me a scatter chart of showing the id and the number of journal committees they are on. | SELECT T1.Editor_ID, COUNT(*) FROM editor AS T1 JOIN journal_committee AS T2 ON T1.Editor_ID = T2.Editor_ID GROUP BY T1.Editor_ID | nvbench |
CREATE TABLE table_name_35 (
date VARCHAR,
tie_no VARCHAR
) | What is the date of game with tie number of 10? | SELECT date FROM table_name_35 WHERE tie_no = "10" | sql_create_context |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TAB... | Amount of questions closed after 3 leading close votes in the Close Vote review queue. Amount of posts closed (and not closed) after 'n' leading close votes in the Close Vote review queue (counts/consider the vote/flag which triggered the review activity) AND with
at least 5 close/do not close votes in total (this is... | SELECT p.Id AS "post_link", pf.PostId, vt.Name, pf.CreationDate FROM Posts AS p INNER JOIN PostFeedback AS pf ON pf.PostId = p.Id INNER JOIN VoteTypes AS vt ON vt.Id = pf.VoteTypeId WHERE NOT p.ClosedDate IS NULL AND pf.PostId = 3923221 ORDER BY pf.PostId, pf.CreationDate DESC LIMIT 50 | sede |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TAB... | In EECS 569 how is work load ? | SELECT DISTINCT program_course.workload FROM course, program_course WHERE course.department = 'EECS' AND course.number = 569 AND program_course.course_id = course.course_id | advising |
CREATE TABLE table_21000 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | What date was the opponent the Los Angeles Raiders? | SELECT "Date" FROM table_21000 WHERE "Opponent" = 'Los Angeles Raiders' | wikisql |
CREATE TABLE table_test_20 (
"id" int,
"ejection_fraction_ef" int,
"anemia" bool,
"gender" string,
"bleeding" int,
"systolic_blood_pressure_sbp" int,
"left_main_coronary_artery_stenosis" int,
"hemoglobin_a1c_hba1c" float,
"renal_disease" bool,
"creatinine_clearance_cl" float,
... | impaired renal function ( creatinine > 200 mmol ) at the time of cell therapy | SELECT * FROM table_test_20 WHERE renal_disease = 1 OR creatinine_clearance_cl > 200 | criteria2sql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.