context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
i... | when was the first time patient 013-38992 was having less than 93.0 sao2 on the current icu visit? | 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-38992') AND patient.unitdischargetime IS NULL) ... | eicu |
CREATE TABLE table_42341 (
"Year" text,
"Matches" text,
"Wins" text,
"Losses" text,
"No Result" text,
"Success Rate" text
) | what was the win for the 6 matches? | SELECT "Wins" FROM table_42341 WHERE "Matches" = '6' | wikisql |
CREATE TABLE table_169766_13 (
show VARCHAR,
new_returning_same_network VARCHAR
) | Which show was sent to syndication for its new/returning/same network. | SELECT show FROM table_169766_13 WHERE new_returning_same_network = "Syndication" | sql_create_context |
CREATE TABLE table_203_277 (
id number,
"entered" number,
"wrestler" text,
"place" text,
"eliminated by" text,
"time" text
) | how many wrestlers had a time of 6:47 ? | SELECT COUNT("wrestler") FROM table_203_277 WHERE "time" = '06:47' | squall |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | What is the number of countries in the artist table?, I want to order from high to low by the x-axis. | SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY Country DESC | nvbench |
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... | 在2008-05-01到2010-01-25期间,6493695这个医疗机构的统筹金额消耗量如何 | SELECT SUM(t_kc24.OVE_PAY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '6493695' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2008-05-01' AND '2010-01-25' | css |
CREATE TABLE table_40292 (
"Week #" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" real,
"Result" text
) | On which week was the beatles the original artist and the order # smaller than 10? | SELECT "Week #" FROM table_40292 WHERE "Original artist" = 'the beatles' AND "Order #" < '10' | wikisql |
CREATE TABLE table_52202 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Rebounds" real
) | Which game did was Bud Eley a player in? | SELECT "Games" FROM table_52202 WHERE "Name" = 'bud eley' | wikisql |
CREATE TABLE table_54432 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | Which tournament has a 2011 of 1r? | SELECT "Tournament" FROM table_54432 WHERE "2011" = '1r' | wikisql |
CREATE TABLE table_23409 (
"No. overall" text,
"No. in series" real,
"Family/families" text,
"Location(s)" text,
"Original air date" text
) | Name the number of families for uk30 | SELECT COUNT("Family/families") FROM table_23409 WHERE "No. overall" = 'UK30' | 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... | 奚冰蓝这位病患从一0年一月二十六日到一三年十二月十八日,有多少位医生给他看过病 | SELECT COUNT(wdmzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN wdmzjzjlb 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 WHERE person_info.XM = '奚冰蓝' AND wdmzjzjlb.JZKSRQ BETWEEN '2010-01-26' AND '2013-12-18' UNION SELECT COUNT(bd... | css |
CREATE TABLE table_name_33 (
place VARCHAR,
performance VARCHAR
) | What place had 14:11.15 as the performance? | SELECT place FROM table_name_33 WHERE performance = "14:11.15" | sql_create_context |
CREATE TABLE table_name_18 (
purpose VARCHAR,
band VARCHAR,
frequency VARCHAR
) | Band of am, and a Frequency of 0 846 has what purpose? | SELECT purpose FROM table_name_18 WHERE band = "am" AND frequency = "0 846" | sql_create_context |
CREATE TABLE table_23670057_5 (
current_club VARCHAR,
height__m_ VARCHAR
) | Which clubs have players with height 2.14m? | SELECT current_club FROM table_23670057_5 WHERE height__m_ = "2.14" | sql_create_context |
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity numbe... | What is the name of the dorm with both a TV Lounge and Study Room listed as amenities? | SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3.amenity_name = 'TV Lounge' INTERSECT SELECT T1.dorm_name FROM dorm AS T1 JOIN has_amenity AS T2 ON T1.dormid = T2.dormid JOIN dorm_amenity AS T3 ON T2.amenid = T3.amenid WHERE T3... | spider |
CREATE TABLE table_name_3 (
clubs VARCHAR,
number_of_fixtures VARCHAR
) | What is the Clubs when there are 4 for the number of fixtures? | SELECT clubs FROM table_name_3 WHERE number_of_fixtures = 4 | sql_create_context |
CREATE TABLE table_28211103_1 (
winner VARCHAR,
st_kilda_score VARCHAR
) | Who is the winner when the st kilda score is 13.10.88? | SELECT winner FROM table_28211103_1 WHERE st_kilda_score = "13.10.88" | sql_create_context |
CREATE TABLE table_1157867_2 (
name VARCHAR,
notes VARCHAR,
builder VARCHAR
) | Which locomotives 12' x 17' are both ex-industrial and built by Manning Wardle? | SELECT name FROM table_1157867_2 WHERE notes = "Ex-industrial" AND builder = "Manning Wardle" | sql_create_context |
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE department (
dept_code text,
dept_name text,
school_code text,
emp_num number,
dept_address text,
dept_extension text
)
CREATE TABLE employee (
emp_num number,
em... | How many classes are professor whose last name is Graztevski has? | SELECT COUNT(*) FROM employee AS T1 JOIN class AS T2 ON T1.emp_num = T2.prof_num WHERE T1.emp_lname = 'Graztevski' | spider |
CREATE TABLE table_2730 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who had highest points in game 5? | SELECT "High points" FROM table_2730 WHERE "Game" = '5' | 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... | 在2006年3月24日到2007年3月10日这段时间,投保人潘安民单一药品最大购买次数是多少? | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '潘安民' AND t_kc22.STA_DATE BETWEEN '2006-03-24' AND '2007-03-10' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE table_name_26 (
record VARCHAR,
location_attendance VARCHAR
) | What was the season record when the location attendance was Air Canada Centre 19,800? | SELECT record FROM table_name_26 WHERE location_attendance = "air canada centre 19,800" | sql_create_context |
CREATE TABLE table_name_73 (
specific_orbital_energy VARCHAR,
orbital_period VARCHAR
) | Orbital period of 89 to 128 min has what specific orbital energy? | SELECT specific_orbital_energy FROM table_name_73 WHERE orbital_period = "89 to 128 min" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | count the number of patients whose diagnoses short title is dmii oth uncntrld and drug route is pr? | 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 = "DMII oth uncntrld" AND prescriptions.route = "PR" | mimicsql_data |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 在04年7月4日到08年4月7日内医院2206684门诊医疗记录的数量总共是多少呢? | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2206684' AND t_kc21.IN_HOSP_DATE BETWEEN '2004-07-04' AND '2008-04-07' AND t_kc21.CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_62126 (
"Player" text,
"Height" real,
"Position" text,
"Year born (Age)" text,
"Current Club" text
) | Which Current Club has a Player of bassem balaa? | SELECT "Current Club" FROM table_62126 WHERE "Player" = 'bassem balaa' | wikisql |
CREATE TABLE table_name_2 (
popular_votes INTEGER,
year VARCHAR,
office VARCHAR,
percentage VARCHAR
) | How many votes for the candidate after 1992, 1.59% of the vote, and the office of us representative 4? | SELECT AVG(popular_votes) FROM table_name_2 WHERE office = "us representative 4" AND percentage = "1.59%" AND year > 1992 | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subje... | count the number of patients who have already received the esophagoscopy nec two or more times in 2102. | 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 = 'esophagoscopy nec') A... | mimic_iii |
CREATE TABLE table_67944 (
"Date" text,
"Round" text,
"Opponents" text,
"Result F\u2013A" text,
"Attendance" real
) | Name the attendance for 4 january 2004 | SELECT "Attendance" FROM table_67944 WHERE "Date" = '4 january 2004' | wikisql |
CREATE TABLE table_17627 (
"Municipality" text,
"Population" real,
"Police officers" real,
"Residents per officer" real,
"Total costs (2005)" text,
"Cost per capita" text,
"Case burden" real,
"Crime rate per 1,000 people" real,
"Police force" text
) | What is the cost per capita in the Courtenay municipality? | SELECT "Cost per capita" FROM table_17627 WHERE "Municipality" = 'Courtenay' | wikisql |
CREATE TABLE table_74129 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text,
"Points" real
) | What is the highest entry in November for the game 20? | SELECT MAX("November") FROM table_74129 WHERE "Game" = '20' | wikisql |
CREATE TABLE table_1341663_11 (
result VARCHAR,
incumbent VARCHAR
) | In the race involving Billy Lee Evans as the seated Representative, was he elected again? | SELECT result FROM table_1341663_11 WHERE incumbent = "Billy Lee Evans" | sql_create_context |
CREATE TABLE table_name_52 (
score VARCHAR,
date VARCHAR,
home VARCHAR,
visitor VARCHAR
) | Which Score has a Home of quebec nordiques, and a Visitor of vancouver blazers on february 28? | SELECT score FROM table_name_52 WHERE home = "quebec nordiques" AND visitor = "vancouver blazers" AND date = "february 28" | sql_create_context |
CREATE TABLE table_40087 (
"Name" text,
"Status" text,
"Authors" text,
"Unit" text,
"Location" text
) | Which author is located in Mexico? | SELECT "Authors" FROM table_40087 WHERE "Location" = 'mexico' | wikisql |
CREATE TABLE table_17001658_10 (
date VARCHAR,
team VARCHAR
) | On what date was the team Philadelphia? | SELECT date FROM table_17001658_10 WHERE team = "Philadelphia" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory... | Retrieve Answered Questions Tagged as 'Java' Created In The Month of January 2018. | SELECT Q.Id, Q.AcceptedAnswerId, Q.CreationDate, Q.Score, Q.Body AS "Question Body", Q.Title AS "Question Title", A.Body AS "Answer Body", Q.Tags FROM Posts AS Q INNER JOIN Posts AS A ON Q.AcceptedAnswerId = A.Id WHERE Q.Tags = '<##tag?java##>' AND Q.CreationDate BETWEEN '2018-01-01' AND '2018-01-31' AND Q.Score >= 0 O... | sede |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
Rejection... | Interest groups, user affinity Tagvector. | SELECT TOP(200) AS TagName, ROUND(10 * MIN(merit) * (AVG(merit) - STDEVP(merit)) / (AVG(merit) + STDEVP(merit)), 0) AS affinity_index, MAX(merit) AS mx, MIN(merit) AS mn FROM (SELECT Posts.OwnerUserId AS userId, TagName, ROUND(SQRT(COUNT(*)), 0) AS merit FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER J... | sede |
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... | provide the number of patients whose admission year is less than 2119 and diagnoses icd9 code is 70714? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2119" AND diagnoses.icd9_code = "70714" | mimicsql_data |
CREATE TABLE table_name_49 (
year INTEGER,
city VARCHAR,
score VARCHAR
) | What is the lowest year that has chester-le-street as the city, with 345 runs as the score? | SELECT MIN(year) FROM table_name_49 WHERE city = "chester-le-street" AND score = "345 runs" | sql_create_context |
CREATE TABLE table_46979 (
"2004/ 05" text,
"2006/ 07" text,
"2007/ 08" text,
"2009/ 10" text,
"2010/ 11" text,
"2011/ 12" text,
"2012/ 13" text
) | What was the 2012/13 result for the tournament that had a 2006/07 and 2007/08 finish of LQ, with the tournament not held in 2009/10? | SELECT "2012/ 13" FROM table_46979 WHERE "2007/ 08" = 'lq' AND "2006/ 07" = 'lq' AND "2009/ 10" = 'tournament not held' | wikisql |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE job... | What courses that I 've taken are among the hardest in the AAPTIS department ? | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN student_record ON student_record.course_id = course.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'AAPTIS' AND program_course.workload = (SELECT MA... | advising |
CREATE TABLE table_name_5 (
sales__billion_ INTEGER,
company VARCHAR,
profits__billion_$_ VARCHAR
) | What is the average sales in billions of walmart, which has more than 15.7 billion in profits? | SELECT AVG(sales__billion_) AS $_ FROM table_name_5 WHERE company = "walmart" AND profits__billion_$_ > 15.7 | sql_create_context |
CREATE TABLE table_1827690_4 (
no VARCHAR,
elected VARCHAR
) | When 1462/63 was the elected what was the no.? | SELECT no FROM table_1827690_4 WHERE elected = "1462/63" | sql_create_context |
CREATE TABLE table_name_64 (
year INTEGER,
sideline_reporter_s_ VARCHAR
) | What was the earliest year featuring Sideline reporter(s) of michelle tafoya and suzy kolber? | SELECT MIN(year) FROM table_name_64 WHERE sideline_reporter_s_ = "michelle tafoya and suzy kolber" | sql_create_context |
CREATE TABLE table_15700367_6 (
runs_conceded VARCHAR,
name VARCHAR
) | How many runs conceded for chaminda vaas? | SELECT runs_conceded FROM table_15700367_6 WHERE name = "Chaminda Vaas" | sql_create_context |
CREATE TABLE flight (
flno number,
origin text,
destination text,
distance number,
departure_date time,
arrival_date time,
price number,
aid number
)
CREATE TABLE employee (
eid number,
name text,
salary number
)
CREATE TABLE aircraft (
aid number,
name text,
di... | Show name and distance for all aircrafts. | SELECT name, distance FROM aircraft | spider |
CREATE TABLE table_16729063_2 (
date VARCHAR,
opponent VARCHAR
) | What date was the opponent the Los Angeles Raiders? | SELECT date FROM table_16729063_2 WHERE opponent = "Los Angeles Raiders" | sql_create_context |
CREATE TABLE table_33339 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | WHAT HOME TEAM SCORED 9.11 (65)? | SELECT "Home team" FROM table_33339 WHERE "Home team score" = '9.11 (65)' | wikisql |
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,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 哪一天结束34024998197这个门诊的就诊呢 | SELECT JZJSSJ FROM mzjzjlb WHERE JZLSH = '34024998197' | css |
CREATE TABLE table_name_93 (
to_par VARCHAR,
player VARCHAR,
place VARCHAR,
country VARCHAR,
score VARCHAR
) | How far to par did ed furgol from the United States get when he scored less than 72 and was placed at t3? | SELECT to_par FROM table_name_93 WHERE country = "united states" AND score < 72 AND place = "t3" AND player = "ed furgol" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 90761150的患者身高达到多少厘米了,体重达到多少公斤了 | SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGDM... | css |
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 all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of hire_date and the average of salary bin hire_date by time, sort by the Y from low to high. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_61083 (
"Date of release" text,
"Title" text,
"Billboard peak" real,
"RIAA cert." text,
"Label" text
) | What label is released on September 20, 2005? | SELECT "Label" FROM table_61083 WHERE "Date of release" = 'september 20, 2005' | wikisql |
CREATE TABLE table_5783 (
"Call sign" text,
"Frequency" text,
"City of License" text,
"Owner" text,
"Format" text
) | Which format is in St. George with a frequency of 0 107.3 fm? | SELECT "Format" FROM table_5783 WHERE "City of License" = 'st. george' AND "Frequency" = '0 107.3 fm' | wikisql |
CREATE TABLE table_name_37 (
total INTEGER,
nation VARCHAR
) | What was the most total medals awarded to Poland? | SELECT MAX(total) FROM table_name_37 WHERE nation = "poland" | sql_create_context |
CREATE TABLE table_name_40 (
margin INTEGER,
country VARCHAR
) | What is canada's margin? | SELECT SUM(margin) FROM table_name_40 WHERE country = "canada" | sql_create_context |
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,
... | how many patients with death staus 0 have been diagnosed with preterm nec1750-1999g? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "0" AND diagnoses.short_title = "Preterm NEC 1750-1999g" | mimicsql_data |
CREATE TABLE table_29533 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"U.S. viewers (millions)" text,
"Original U.S. air date" text,
"Prod. code" real
) | Name who wrote the production code 322 | SELECT "Written by" FROM table_29533 WHERE "Prod. code" = '322' | wikisql |
CREATE TABLE table_15190346_2 (
stadium VARCHAR,
bowl_game VARCHAR
) | What stadium was the 1994 Gator Bowl in? | SELECT stadium FROM table_15190346_2 WHERE bowl_game = "1994 Gator Bowl" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate n... | what was the monthly average value of weight for patient 018-119251 until 11/2105? | SELECT AVG(patient.admissionweight) FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-119251') AND NOT patient.admissionweight IS NULL AND STRFTIME('%y-%m', patient.unitadmittime) <= '2105-11' GROUP BY STRFTIME('%y-%m', patient.... | eicu |
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 jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decima... | For all employees who have the letters D or S in their first name, visualize a bar chart about the distribution of job_id and the average of department_id , and group by attribute job_id, order the average of department id in ascending order. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY AVG(DEPARTMENT_ID) | nvbench |
CREATE TABLE table_name_58 (
interface VARCHAR,
product VARCHAR
) | What is the interface of the product xerox travel scanner 100? | SELECT interface FROM table_name_58 WHERE product = "xerox travel scanner 100" | sql_create_context |
CREATE TABLE table_name_81 (
opposing_teams VARCHAR,
date VARCHAR
) | What is Opposing Teams, when Date is '11/10/1991'? | SELECT opposing_teams FROM table_name_81 WHERE date = "11/10/1991" | sql_create_context |
CREATE TABLE table_203_654 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
) | in 1926 brazilian football , how many teams scored above 10 points in the season ? | SELECT COUNT("team") FROM table_203_654 WHERE "points" > 10 | squall |
CREATE TABLE table_64675 (
"Rank:" real,
"Premier:" text,
"Assumed Office:" text,
"Left Office:" text,
"TOTAL Time in Office:" text
) | What is the TOTAL Time in Office with a rank smaller than 18, and premier is Joh Bjelke-Petersen? | SELECT "TOTAL Time in Office:" FROM table_64675 WHERE "Rank:" < '18' AND "Premier:" = 'joh bjelke-petersen' | wikisql |
CREATE TABLE table_24807774_1 (
bosnian VARCHAR,
cook_islands VARCHAR
) | how many bosnian in cook islands is sri lankan | SELECT bosnian FROM table_24807774_1 WHERE cook_islands = "Sri Lankan" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
d... | when was patient 85131 prescribed the drug neo*iv*chlorothiazide and d5w at the same time for the last time until 19 months ago? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'neo*iv*chlorothiazide' AND admissions.subject_id = 85131 AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-19 mon... | mimic_iii |
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER... | A bar chart about what are the different product names? What is the average product price for each of them?, sort X from low to high order. | SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY Product_Name | nvbench |
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 do not work in departments with managers that have ids between 100 and 200, give me the comparison about manager_id over the last_name by a bar chart, could you show in desc by the Y-axis? | SELECT LAST_NAME, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY MANAGER_ID DESC | nvbench |
CREATE TABLE table_name_75 (
area_km_2 INTEGER,
official_name VARCHAR
) | Can you tell me the sum of Area km 2 that has the Official Name of glenelg? | SELECT SUM(area_km_2) FROM table_name_75 WHERE official_name = "glenelg" | sql_create_context |
CREATE TABLE table_1974545_3 (
basketball_arena VARCHAR,
capacity VARCHAR
) | How many basketball arenas are there that belong to a school with a capacity of 3,000? | SELECT COUNT(basketball_arena) FROM table_1974545_3 WHERE capacity = "3,000" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 统计一下医疗记录中医院8058667的住院诊断为非器质性睡眠障碍的最低医疗费总金额是多少元钱?最高医疗费总金额多少钱? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc21_t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8058667' AND t_kc21.IN_DIAG_DIS_NM = '非器质性睡眠障碍') | css |
CREATE TABLE table_11750 (
"Town/City" text,
"Population" real,
"Operator" text,
"First year" real,
"Duration" text
) | What is Ivaipor , pr's biggest population? | SELECT MAX("Population") FROM table_11750 WHERE "Town/City" = 'ivaiporã, pr' | wikisql |
CREATE TABLE table_204_986 (
id number,
"#" number,
"event year" number,
"season" text,
"flag bearer" text
) | who was the first samoan flag bearer at the olympic games ? | SELECT "flag bearer" FROM table_204_986 ORDER BY "event year" LIMIT 1 | squall |
CREATE TABLE table_name_62 (
gold INTEGER,
rank VARCHAR,
silver VARCHAR
) | What shows for gold when the rank is less than 3, and silver less than 1? | SELECT SUM(gold) FROM table_name_62 WHERE rank < 3 AND silver < 1 | sql_create_context |
CREATE TABLE table_name_91 (
silver VARCHAR,
gold INTEGER
) | What is the number in total of silver with a gold smaller than 0? | SELECT COUNT(silver) FROM table_name_91 WHERE gold < 0 | sql_create_context |
CREATE TABLE table_41890 (
"RR Romaja" text,
"M\u2013R Romaja" text,
"Hangul" text,
"Hanja" text,
"Name origin" text,
"Capital" text,
"Region" text,
"Korean dialect" text,
"Post-1896 Provinces" text
) | What is the Korean dialect in the daegu capital? | SELECT "Korean dialect" FROM table_41890 WHERE "Capital" = 'daegu' | 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... | 孔傲晴病患在医院9262295的门诊就诊中,有哪些就诊科室名包含遗传的所有门诊就诊记录的流水号信息 | SELECT txmzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN txmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX WHERE person_info.XM = '孔傲晴' AND hz_info.YLJGDM = '9262295' AND txmzjzjlb.JZKSMC LIKE '%遗传%' UNION SELECT ftxmzjzjlb.... | css |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | K71.024病人在医院9062886出院时的医疗记录中最低和最高医疗费一共是多少钱? | 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 = '9062886' AND gwyjzb.OUT_DIAG_DIS_CD = 'K71.024' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '9062886' AND fgwyjzb.OUT_D... | css |
CREATE TABLE table_1771753_3 (
race_time VARCHAR,
team VARCHAR,
laps VARCHAR
) | When 228 is the lap and chip ganassi racing is the team what is the race time? | SELECT race_time FROM table_1771753_3 WHERE team = "Chip Ganassi Racing" AND laps = "228" | sql_create_context |
CREATE TABLE table_55560 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In the game where Collingwood is the home team what is the score of the away team? | SELECT "Away team score" FROM table_55560 WHERE "Home team" = 'collingwood' | wikisql |
CREATE TABLE table_8061 (
"Rank" text,
"Margin" text,
"Opponent" text,
"Venue" text,
"Season" text
) | What is the Rank that has a Venue of bellerive oval , hobart, and a Margin of 115 runs? | SELECT "Rank" FROM table_8061 WHERE "Venue" = 'bellerive oval , hobart' AND "Margin" = '115 runs' | wikisql |
CREATE TABLE gwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | 0497811这家医院全部就诊记录中大病支付的额度比上总医疗费的值里的最小值按照不一样的科室编码和入院诊断疾病编码算算看 | SELECT gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gwyjzb.MED_SER_ORG_NO = '0497811' GROUP BY gwyjzb.MED_ORG_DEPT_CD, gwyjzb.IN_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_CD, fgwyjzb.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY... | css |
CREATE TABLE table_name_11 (
place VARCHAR,
score VARCHAR
) | WHAT IS THE PLACE WITH THE SCORE 69-71-66-73=279? | SELECT place FROM table_name_11 WHERE score = 69 - 71 - 66 - 73 = 279 | sql_create_context |
CREATE TABLE PostTypes (
Id number,
Name text
)
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,
Delet... | Stuff Ids inside user names. | SELECT STUFF(DisplayName, 5, 0, Id) FROM Users ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | how many patients have had neurology consultation done until 4 years ago? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'neurology consultation' AND DATETIME(treatment.treatmenttime) <= DATETIME(CURRENT_TIME(), '-4 year')) | eicu |
CREATE TABLE train (
Train_ID int,
Name text,
Time text,
Service text
)
CREATE TABLE station (
Station_ID int,
Name text,
Annual_entry_exit real,
Annual_interchanges real,
Total_Passengers real,
Location text,
Main_Services text,
Number_of_Platforms int
)
CREATE TABLE t... | Bar chart x axis location y axis the average of number of platforms | SELECT Location, AVG(Number_of_Platforms) FROM station GROUP BY Location | nvbench |
CREATE TABLE table_19766_1 (
country VARCHAR
) | How many millions of $ were spent in Iceland in 1948/49? | SELECT MAX(1948 AS _49__) AS $_millions_ FROM table_19766_1 WHERE country = "Iceland" | sql_create_context |
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 hz_info (
KH text,
KLX number... | 之前,患者彭璇玑的异常情况有什么? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE table_28613 (
"#" real,
"Player" text,
"Points" real,
"Rebounds" real,
"Assists" real,
"Opponent" text,
"Date" text
) | List the number of assists against illinois-chicago. | SELECT "Assists" FROM table_28613 WHERE "Opponent" = 'Illinois-Chicago' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
... | 从08年7月20日到13年10月17日这段时间里,患者38917711所有检验结果指标记录中的检测方法都有什么啊? | (SELECT jyjgzbb.JCFF FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD ... | 从一六年九月十二日到一九年二月二十四日,患者47306460在找哪位医生就诊的次数最多 | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '47306460' AND t_kc21.IN_HOSP_DATE BETWEEN '2016-09-22' AND '2019-02-24' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 | css |
CREATE TABLE song (
song_name VARCHAR,
releasedate VARCHAR
) | What is the name of the song that was released in the most recent year? | SELECT song_name, releasedate FROM song ORDER BY releasedate DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_14392 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | When is the lane less than 5 and is named gnes kov cs? | SELECT "Time" FROM table_14392 WHERE "Lane" < '5' AND "Name" = 'ágnes kovács' | wikisql |
CREATE TABLE table_44504 (
"Date" text,
"Time" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | Which Date has a Set 1 of 21 25? | SELECT "Date" FROM table_44504 WHERE "Set 1" = '21–25' | wikisql |
CREATE TABLE table_name_34 (
ends VARCHAR,
name VARCHAR
) | When does Donaldson's move end? | SELECT ends FROM table_name_34 WHERE name = "donaldson" | sql_create_context |
CREATE TABLE table_558 (
"Basic stem (root)" text,
"Present stem" text,
"Non-present stem" text,
"Participle" text,
"Verbal noun" text,
"Short stem" text,
"Meaning" text
) | What is the verbal noun connected to the participle e-duki? | SELECT "Verbal noun" FROM table_558 WHERE "Participle" = 'e-duki' | wikisql |
CREATE TABLE table_name_18 (
gold INTEGER,
nation VARCHAR,
rank VARCHAR
) | What is the total gold from New zealand and a rank less than 14? | SELECT SUM(gold) FROM table_name_18 WHERE nation = "new zealand" AND rank < 14 | sql_create_context |
CREATE TABLE farm_competition (
Competition_ID int,
Year int,
Theme text,
Host_city_ID int,
Hosts text
)
CREATE TABLE city (
City_ID int,
Official_Name text,
Status text,
Area_km_2 real,
Population real,
Census_Ranking text
)
CREATE TABLE farm (
Farm_ID int,
Year in... | I want to know the proportion of the average population for each status. | SELECT Status, AVG(Population) FROM city GROUP BY Status | nvbench |
CREATE TABLE pilot (
Pilot_ID int,
Pilot_name text,
Rank int,
Age int,
Nationality text,
Position text,
Join_Year int,
Team text
)
CREATE TABLE pilot_record (
Record_ID int,
Pilot_ID int,
Aircraft_ID int,
Date text
)
CREATE TABLE aircraft (
Aircraft_ID int,
Orde... | What is the proportion of positions of pilots? | SELECT Position, COUNT(Position) FROM pilot GROUP BY Position | nvbench |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.