context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_19764939_1 ( club_world_cup VARCHAR, player VARCHAR )
Name the total number of club worl cup for djibril cisse
SELECT COUNT(club_world_cup) FROM table_19764939_1 WHERE player = "Djibril Cisse"
sql_create_context
CREATE TABLE table_1892 ( "No. in series" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Name the air date that chris long directed
SELECT "Original air date" FROM table_1892 WHERE "Directed by" = 'Chris Long'
wikisql
CREATE TABLE table_name_13 ( home_team VARCHAR )
Which Home team score had a Home team of Fitzroy?
SELECT home_team AS score FROM table_name_13 WHERE home_team = "fitzroy"
sql_create_context
CREATE TABLE table_name_15 ( shigella VARCHAR, yersinia VARCHAR )
Tell me the shigella and yscn
SELECT shigella FROM table_name_15 WHERE yersinia = "yscn"
sql_create_context
CREATE TABLE table_name_53 ( week INTEGER, time__cst_ VARCHAR, game_site VARCHAR )
What is the lowest week that has 7:15 p.m. as the time (cst) and fedexfield as the game site?
SELECT MIN(week) FROM table_name_53 WHERE time__cst_ = "7:15 p.m." AND game_site = "fedexfield"
sql_create_context
CREATE TABLE table_67931 ( "Year" text, "League" text, "Reg. Season" text, "Playoffs" text, "Avg. attendance \u2020" text )
What league has an average attendance of 244?
SELECT "League" FROM table_67931 WHERE "Avg. attendance \u2020" = '244'
wikisql
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is average age of patients whose gender is f and discharge location is long term care hospital?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.gender = "F" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL"
mimicsql_data
CREATE TABLE broadcast ( channel_id number, program_id number, time_of_day text ) CREATE TABLE program ( program_id number, name text, origin text, launch number, owner text ) CREATE TABLE channel ( channel_id number, name text, owner text, share_in_percent number, ...
Find the total rating ratio for each channel owner.
SELECT SUM(rating_in_percent), owner FROM channel GROUP BY owner
spider
CREATE TABLE student ( name VARCHAR, id VARCHAR ) CREATE TABLE takes ( id VARCHAR, course_id VARCHAR ) CREATE TABLE course ( course_id VARCHAR, dept_name VARCHAR )
Find the name of students who didn't take any course from Biology department.
SELECT name FROM student WHERE NOT id IN (SELECT T1.id FROM takes AS T1 JOIN course AS T2 ON T1.course_id = T2.course_id WHERE T2.dept_name = 'Biology')
sql_create_context
CREATE TABLE table_name_53 ( year_s__won VARCHAR, finish VARCHAR, player VARCHAR )
What year did player steve jones, who had a t60 finish, win?
SELECT year_s__won FROM table_name_53 WHERE finish = "t60" AND player = "steve jones"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
在门诊诊断为疾病T69.925的这些患者的籍贯代码、名称都是什么以及相应人数是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) 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 wdmzjzjlb.JZZDBM = 'T69.925' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE table_12300 ( "Rank" real, "Athlete" text, "Taijiquan" real, "Taijijian" real, "Total" real )
What is the highest rank of the athlete with a Taijiquan higher than 9.64 and a total more than 19.69?
SELECT MAX("Rank") FROM table_12300 WHERE "Taijiquan" > '9.64' AND "Total" > '19.69'
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...
列举出在06年8月30日到2008年5月14日内蒋锐锋病患所有检验报告单的审核日期时间是那几天?
SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '蒋...
css
CREATE TABLE table_37372 ( "Date" text, "League position" text, "Opponents" text, "Venue" text, "Result" text, "Score F\u2013A" text, "Attendance" real )
How many were in attendance for a result of D, at H venue, and Arsenal as an opponent?
SELECT "Attendance" FROM table_37372 WHERE "Result" = 'd' AND "Venue" = 'h' AND "Opponents" = 'arsenal'
wikisql
CREATE TABLE region ( region_id number, region_name text, date text, label text, format text, catalogue text ) CREATE TABLE member ( member_id number, member_name text, party_id text, in_office text ) CREATE TABLE party_events ( event_id number, event_name text, par...
Return the name of the party with the most members.
SELECT T2.party_name FROM member AS T1 JOIN party AS T2 ON T1.party_id = T2.party_id GROUP BY T1.party_id ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_1342256_18 ( candidates VARCHAR, incumbent VARCHAR )
Who are all of the candidates in the election featuring james r. domengeaux?
SELECT candidates FROM table_1342256_18 WHERE incumbent = "James R. Domengeaux"
sql_create_context
CREATE TABLE table_21188 ( "Episode number" real, "Episode" text, "Rating" text, "Share" real, "Rating/Share (18-49)" text, "Viewers (millions)" text, "Rank (Overall)" text )
How many were the shares when the viewers reached 3.11 million?
SELECT COUNT("Share") FROM table_21188 WHERE "Viewers (millions)" = '3.11'
wikisql
CREATE TABLE table_41872 ( "Rank" real, "Name" text, "Team" text, "Games" real, "Points" real )
What is the rank of the player with less than 34 points?
SELECT SUM("Rank") FROM table_41872 WHERE "Points" < '34'
wikisql
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many spanish speaking patients are operated with procedure coronary arteriography using two catheters?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.language = "SPAN" AND procedures.long_title = "Coronary arteriography using two catheters"
mimicsql_data
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Stack bar chart of school_id vs All_Home based on acc road
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road
nvbench
CREATE TABLE table_74250 ( "Date/Location" text, "Mens singles" text, "Womens Singles" text, "U21 Mens" text, "U21 Womens" text, "Mixed Restricted" text, "Mixed Veteran" text )
Who was the U21 Mens winner when Mike Marsden was the mixed restricted winner and Claire Nelson was the U21 Womens winner?
SELECT "U21 Mens" FROM table_74250 WHERE "Mixed Restricted" = 'Mike Marsden' AND "U21 Womens" = 'Claire Nelson'
wikisql
CREATE TABLE table_12438767_1 ( network VARCHAR, local_name VARCHAR )
In how many networks the local name of the franchise was 'in sickness and in health'?
SELECT COUNT(network) FROM table_12438767_1 WHERE local_name = "In Sickness and in Health"
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...
find me the death status and primary language that patient with patient id 3623 prefers.
SELECT demographic.language, demographic.expire_flag FROM demographic WHERE demographic.subject_id = "3623"
mimicsql_data
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is average age of patients whose admission type is emergency and year of birth is greater than 1821?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year > "1821"
mimicsql_data
CREATE TABLE table_name_23 ( rank INTEGER, average VARCHAR )
What rank has an average of 6.33?
SELECT AVG(rank) FROM table_name_23 WHERE average = 6.33
sql_create_context
CREATE TABLE table_5735 ( "Date" text, "Course" text, "Distance" text, "Race" text, "Class" text, "Position" text, "Jockey" text, "Odds" text )
what player scored 9/1
SELECT "Jockey" FROM table_5735 WHERE "Odds" = '9/1'
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, ...
在04年9月17日到14年4月8日这个期间内,病患52767851主要看哪个医生?
SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '52767851' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-09-17' AND '2014-04-08' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERS...
css
CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE Badges ( Id number, UserId numb...
How many of the people with accounts answered questions?.
SELECT DISTINCT COUNT(u.Id) FROM Users AS u, Posts AS p WHERE p.PostTypeId = 2 AND u.Id = p.OwnerUserId
sede
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comme...
Old questions with a specific tag. Brings up those open question with no accepted answer of a certain time old with a tag.
SELECT q.Id AS "post_link", q.Score AS "Votes", q.CreationDate AS "Posted", q.LastActivityDate AS "Last Active", q.ViewCount AS "Views", q.CommentCount AS "Comments" FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id WHERE q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL AND q.ClosedDate IS NULL AND q.CreationDate < D...
sede
CREATE TABLE table_name_54 ( english_name VARCHAR, color VARCHAR )
Which English name has a Color of green?
SELECT english_name FROM table_name_54 WHERE color = "green"
sql_create_context
CREATE TABLE table_68706 ( "Date" text, "Visiting team" text, "Final score" text, "Host team" text, "Stadium" text )
What is the Stadium that hosts the team Jacksonville Jaguars?
SELECT "Stadium" FROM table_68706 WHERE "Host team" = 'jacksonville jaguars'
wikisql
CREATE TABLE church ( Church_ID int, Name text, Organized_by text, Open_Date int, Continuation_of text ) CREATE TABLE people ( People_ID int, Name text, Country text, Is_Male text, Age int ) CREATE TABLE wedding ( Church_ID int, Male_ID int, Female_ID int, Year ...
Bar chart x axis open date y axis how many open date
SELECT Open_Date, COUNT(Open_Date) FROM church
nvbench
CREATE TABLE table_7126 ( "Track" real, "Recorded" text, "Catalogue" text, "Release date" text, "Chart peak" text, "Song title" text, "Writer(s)" text, "Time" text )
Which Catalogue has a Writer(s) of mark james?
SELECT "Catalogue" FROM table_7126 WHERE "Writer(s)" = 'mark james'
wikisql
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is marital status and admission type of subject name jerry deberry?
SELECT demographic.marital_status, demographic.admission_type FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_17827271_1 ( roleplay VARCHAR, actor_in_original_production VARCHAR )
What RolePlay actor played the same role Alison Pargeter played in the original production?
SELECT roleplay FROM table_17827271_1 WHERE actor_in_original_production = "Alison Pargeter"
sql_create_context
CREATE TABLE table_67959 ( "Year" real, "Population (Region total)" real, "Population (Stanthorpe)" real, "Population (Warwick)" real, "Population (Allora)" real, "Population (Glengallan)" real, "Population (Rosenthal)" real )
When were the years on which warwick had a population greater than 10,956 and allora had a population bigger than 2,439?
SELECT SUM("Year") FROM table_67959 WHERE "Population (Warwick)" = '10,956' AND "Population (Allora)" > '2,439'
wikisql
CREATE TABLE table_name_66 ( wins VARCHAR, top_25 VARCHAR, events VARCHAR )
What is the Wins of the Top-25 of 1 and 7 Events?
SELECT wins FROM table_name_66 WHERE top_25 = 1 AND events = 7
sql_create_context
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
how many patients are born before 2170 and lab tested with urine??
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2170" AND lab.fluid = "Urine"
mimicsql_data
CREATE TABLE table_name_64 ( attendance VARCHAR, record VARCHAR )
When the record was 4-4, how many people attended?
SELECT attendance FROM table_name_64 WHERE record = "4-4"
sql_create_context
CREATE TABLE table_64982 ( "Tournament" text, "1986" text, "1988" text, "1989" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text )
What's the 1997 if 1993 has a 1R, 1995 has a 3R, and 1999 has a 1R?
SELECT "1997" FROM table_64982 WHERE "1999" = '1r' AND "1995" = '3r' AND "1993" = '1r'
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is admission location and date of death of subject id 7273?
SELECT demographic.admission_location, demographic.dod FROM demographic WHERE demographic.subject_id = "7273"
mimicsql_data
CREATE TABLE table_11538 ( "State" text, "Interview" real, "Swimsuit" real, "Evening Gown" real, "Average" real )
What is the total for the state of new york and a swimsuit less than 9.394?
SELECT SUM("Interview") FROM table_11538 WHERE "State" = 'new york' AND "Swimsuit" < '9.394'
wikisql
CREATE TABLE table_10141 ( "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 when the home team scored 10.8 (68)?
SELECT "Away team" FROM table_10141 WHERE "Home team score" = '10.8 (68)'
wikisql
CREATE TABLE table_15582870_1 ( college VARCHAR, choice VARCHAR )
Which college did draft pick #143 attend?
SELECT college FROM table_15582870_1 WHERE choice = 143
sql_create_context
CREATE TABLE table_14532_1 ( capital VARCHAR, region VARCHAR )
What is the capital of Umbria?
SELECT capital FROM table_14532_1 WHERE region = "Umbria"
sql_create_context
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
when was patient 80671 prescribed a drug for the last time until 02/2103?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 80671) AND STRFTIME('%y-%m', prescriptions.startdate) <= '2103-02' ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_203_135 ( id number, "institution" text, "location" text, "founded" number, "type" text, "enrollment" number, "joined" number, "nickname" text )
which aac school has the most students ?
SELECT "institution" FROM table_203_135 ORDER BY "enrollment" DESC LIMIT 1
squall
CREATE TABLE table_name_21 ( location VARCHAR, _number___county VARCHAR, enrollment VARCHAR )
What is the location with enrollment of 316 and county is 68 Randolph?
SELECT location FROM table_name_21 WHERE _number___county = "68 randolph" AND enrollment = 316
sql_create_context
CREATE TABLE table_75402 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
Home Team of chicago bulls, and a Result of 81-83 (3-2) involved what game?
SELECT "Game" FROM table_75402 WHERE "Home Team" = 'chicago bulls' AND "Result" = '81-83 (3-2)'
wikisql
CREATE TABLE table_8883 ( "Episode" text, "Air Date" text, "Timeslot" text, "Rating" real, "Share" real, "18-49" text, "Viewers" text, "Weekly Rank" text )
What is the lowest Share, when Rating is greater than 1.3, and when Air Date is May 28, 2008?
SELECT MIN("Share") FROM table_8883 WHERE "Rating" > '1.3' AND "Air Date" = 'may 28, 2008'
wikisql
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE tr...
was there any microbiology test results for the urine of patient 83182 in 2105?
SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182) AND microbiologyevents.spec_type_desc = 'urine' AND STRFTIME('%y', microbiologyevents.charttime) = '2105'
mimic_iii
CREATE TABLE table_name_98 ( goals_against INTEGER, position VARCHAR, wins VARCHAR, losses VARCHAR )
What is the average number of goals against with more than 12 wins, 12 losses, and a position greater than 3?
SELECT AVG(goals_against) FROM table_name_98 WHERE wins > 12 AND losses = 12 AND position > 3
sql_create_context
CREATE TABLE table_34268 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Venue" text, "Attendance" text )
When has a Result of l 27-7 and an Opponent of at minnesota vikings?
SELECT "Date" FROM table_34268 WHERE "Result" = 'l 27-7' AND "Opponent" = 'at minnesota vikings'
wikisql
CREATE TABLE table_28672269_1 ( date_of_commissioning VARCHAR, unit_number VARCHAR )
What are Unit 2's dates of commissioning?
SELECT COUNT(date_of_commissioning) FROM table_28672269_1 WHERE unit_number = 2
sql_create_context
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_labitems ( row_id number, itemid...
when did patient 97314 have the maximum amount of potassium in 03/this year for the first time?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 97314) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRE...
mimic_iii
CREATE TABLE fgwyjzb ( 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, ...
在4933227这个医院的患者22167047的就诊记录中哪些名称中不包含重症的就诊科室
SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_ID = '22167047' AND gwyjzb.MED_SER_ORG_NO = '4933227' AND NOT gwyjzb.MED_ORG_DEPT_NM LIKE '%重症%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '22167047' AND fgwyjzb.MED_SER_ORG_NO = '4933227' AND NOT fgwyjzb.MED_ORG_DEPT_NM LIKE '%重症%'
css
CREATE TABLE table_50977 ( "Round" real, "Pick" real, "Overall" real, "Name" text, "Position" text, "College" text )
How much Overall has a Position of wr, and a College of alberta?
SELECT SUM("Overall") FROM table_50977 WHERE "Position" = 'wr' AND "College" = 'alberta'
wikisql
CREATE TABLE table_23662356_3 ( average VARCHAR, number_of_dances VARCHAR )
What was the average score for the couple that had 4 dances?
SELECT average FROM table_23662356_3 WHERE number_of_dances = 4
sql_create_context
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Dorm_amenity ( ameni...
Find the number of students whose age is older than the average age for each gender.
SELECT Sex, COUNT(*) FROM Student WHERE Age > (SELECT AVG(Age) FROM Student) GROUP BY Sex
nvbench
CREATE TABLE table_name_31 ( league VARCHAR, sport VARCHAR, club VARCHAR )
Which league is for baseball with Laredo Apaches?
SELECT league FROM table_name_31 WHERE sport = "baseball" AND club = "laredo apaches"
sql_create_context
CREATE TABLE table_16575609_1 ( cfl_team VARCHAR, player VARCHAR )
Who picked dimitri tsoumpas?
SELECT cfl_team FROM table_16575609_1 WHERE player = "Dimitri Tsoumpas"
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...
在08年10月25日到15年12月6日这段日子病人吕莹玉使用的药品有多些是自付比例低于0.73的呢?
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '吕莹玉' AND t_kc22.STA_DATE BETWEEN '2008-10-25' AND '2015-12-06' AND t_kc22.SELF_PAY_PRO < 0.73
css
CREATE TABLE table_name_88 ( final_position___round VARCHAR, competition VARCHAR )
What is the final position/round of the UEFA cup?
SELECT final_position___round FROM table_name_88 WHERE competition = "uefa cup"
sql_create_context
CREATE TABLE table_50153 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
In the match played against Telford United, who was the home team?
SELECT "Home team" FROM table_50153 WHERE "Away team" = 'telford united'
wikisql
CREATE TABLE table_33888 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What was the score on October 16, 1983?
SELECT "Score" FROM table_33888 WHERE "Date" = 'october 16, 1983'
wikisql
CREATE TABLE zzmzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH number, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZ...
名叫孔红艳的病人在2002年11月10日至2007年9月10日内测验人为13231895的所有检验结果指标记录的检验指数的流水号是啥?
SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb...
css
CREATE TABLE table_name_73 ( number_of_jews__wjc_ INTEGER, metro_area VARCHAR, rank__arda_ VARCHAR )
How many number of WJC Jews in the Los Angeles Metro Area has a ARDA rank of more than 2?
SELECT SUM(number_of_jews__wjc_) FROM table_name_73 WHERE metro_area = "los angeles" AND rank__arda_ > 2
sql_create_context
CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, sc...
Does Sebens teach upper level courses ?
SELECT DISTINCT course.department, course.name, course.number 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.ins...
advising
CREATE TABLE table_41087 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Notes" text )
What is the Notes with a Venue that is venice, italy?
SELECT "Notes" FROM table_41087 WHERE "Venue" = 'venice, italy'
wikisql
CREATE TABLE table_23730973_5 ( no INTEGER, rating VARCHAR )
What number episode had a rating of 4.7?
SELECT MIN(no) FROM table_23730973_5 WHERE rating = "4.7"
sql_create_context
CREATE TABLE table_62780 ( "Title" text, "Series" text, "Director" text, "Production Number" text, "Release date" text )
What is the release date of the mm series, which has the title tom thumb in trouble?
SELECT "Release date" FROM table_62780 WHERE "Series" = 'mm' AND "Title" = 'tom thumb in trouble'
wikisql
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) 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, meter_700 text, Time text ) CREATE...
Draw a bar chart about the distribution of Time and ID , and sort y-axis in ascending order please.
SELECT Time, ID FROM swimmer ORDER BY ID
nvbench
CREATE TABLE table_name_39 ( investment_income VARCHAR, other_social_security_benefits VARCHAR, occupational_pensions VARCHAR, working_tax_credit VARCHAR )
Occupational pensions of 7%, and a Working tax credit of 2%, and a Other social security benefits of 6% has what investment income?
SELECT investment_income FROM table_name_39 WHERE occupational_pensions = "7%" AND working_tax_credit = "2%" AND other_social_security_benefits = "6%"
sql_create_context
CREATE TABLE jyjgzbb ( BGDH text, BGRQ time, CKZFWDX text, CKZFWSX number, CKZFWXX number, JCFF text, JCRGH text, JCRXM text, JCXMMC text, JCZBDM text, JCZBJGDL number, JCZBJGDW text, JCZBJGDX text, JCZBMC text, JLDW text, JYRQ time, JYZBLSH text, ...
患者77448008在2009年8月4日到2021年6月15日内都做了什么检查把检验报告单号列出来
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJGDM AND mzjzjlb_jybgb.BGDH ...
css
CREATE TABLE table_name_32 ( event VARCHAR, championship VARCHAR )
With a Championship of 1959 USAC Championship Car Season what is the event?
SELECT event FROM table_name_32 WHERE championship = "1959 usac championship car season"
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...
58661647患者被门诊诊断为疾病I06.952的降钙素原的结果定量是什么?单位都是什么?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb...
css
CREATE TABLE table_28093 ( "Round" real, "Circuit" text, "Location" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Winning team" text )
Where was the round 1 race?
SELECT "Location" FROM table_28093 WHERE "Round" = '1'
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...
在05年10月21日到21年8月18日内,患者70307655最常看那些病?
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_ID = '70307655' AND qtb.IN_HOSP_DATE BETWEEN '2005-10-21' AND '2021-08-18' GROUP BY qtb.IN_DIAG_DIS_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_ID = '70307655' AND gyb.IN_HOSP_DATE...
css
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...
编码为53573541的患者的检验报告单对应的检验结果指标均正常的是哪些?列出其检验报告单号都是啥呀?
SELECT jybgb.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '53573541' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FROM jyjgzbb WH...
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ...
when did patient 23929 receive a lab test in 08/last year last time?
SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 23929) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND STRFTIME('%m', labevents.charttime) = '08' ORDER BY labevents...
mimic_iii
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_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, t...
CMPLXSYS 541 is taught by whom ?
SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'CMPLXSYS' AND course.number = 541 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offeri...
advising
CREATE TABLE table_44484 ( "Season" real, "Player" text, "Club" text, "Nationality" text, "Goals" real )
Which seaosn had a player of rohan ricketts?
SELECT COUNT("Season") FROM table_44484 WHERE "Player" = 'rohan ricketts'
wikisql
CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL...
Show the number of date account opened from each date account opened
SELECT date_account_opened, COUNT(date_account_opened) FROM Accounts
nvbench
CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
Compare all countries with a bar chart, display Y-axis in desc order.
SELECT Country, COUNT(Country) FROM artist GROUP BY Country ORDER BY COUNT(Country) DESC
nvbench
CREATE TABLE table_80220 ( "Year" real, "Alabama" text, "Arkansas" text, "Auburn" text, "Ole Miss" text, "Mississippi St." text )
Who was the Ole Miss player associated with Chuck Dicus?
SELECT "Ole Miss" FROM table_80220 WHERE "Arkansas" = 'chuck dicus'
wikisql
CREATE TABLE table_7592 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the total number of Total with more than 16 rank for the nation of Romania with more than 0 for silver?
SELECT COUNT("Total") FROM table_7592 WHERE "Rank" > '16' AND "Nation" = 'romania' AND "Silver" > '0'
wikisql
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...
看看患者05968496的医疗记录中哪几次开的药品金额超过6385.54元?列出医疗就诊编码
SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '05968496' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 6385.54)
css
CREATE TABLE month ( month_number int, month_name text ) CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, ...
list DAILY flights from OAKLAND to BOSTON using CO
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE ((CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'OAKLAND' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST...
atis
CREATE TABLE table_name_44 ( date VARCHAR, game VARCHAR )
On what date was game 3 played?
SELECT date FROM table_name_44 WHERE game = 3
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, ...
医疗记录中患者年龄不高于20岁的平均医疗费总额是多少
SELECT AVG(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.PERSON_AGE <= 20)
css
CREATE TABLE table_52998 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
Which Competition had a Result of 3-0 and VEnue of Suwon?
SELECT "Competition" FROM table_52998 WHERE "Result" = '3-0' AND "Venue" = 'suwon'
wikisql
CREATE TABLE table_11092 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the score of the home team at junction oval?
SELECT "Home team score" FROM table_11092 WHERE "Venue" = 'junction oval'
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 patients whose year of birth is less than 2060 and lab test fluid is cerebrospinal fluid (csf)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2060" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE table_28089666_1 ( written_by VARCHAR, production_code VARCHAR )
Who wrote episode with production code 1.01?
SELECT written_by FROM table_28089666_1 WHERE production_code = "1.01"
sql_create_context
CREATE TABLE table_59649 ( "Golden Rivers" text, "Wins" real, "Byes" real, "Losses" real, "Draws" real, "Against" real )
What is the highest number of wins when there are more than 2 byes?
SELECT MAX("Wins") FROM table_59649 WHERE "Byes" > '2'
wikisql
CREATE TABLE table_name_48 ( teams VARCHAR, name VARCHAR )
What is the team with the name Boumediene Abderahmane?
SELECT teams FROM table_name_48 WHERE name = "boumediene abderahmane"
sql_create_context
CREATE TABLE table_18904831_5 ( high_rebounds VARCHAR, high_points VARCHAR )
Who did the most high rebounds in the game where Sales (17) did the high points?
SELECT high_rebounds FROM table_18904831_5 WHERE high_points = "Sales (17)"
sql_create_context
CREATE TABLE table_60642 ( "Year" real, "Total Horses" real, "Working Horses" text, "Total Cattle" real, "Oxen" real, "Bulls" text, "Cows" real, "Pigs" real, "Sheep and Goats" real )
What is the number of bulls that has oxen larger than 113.8, and a sheep and goats larger than 4533.4, and a cows smaller than 3987, and a total horses larger than 5056.5?
SELECT "Bulls" FROM table_60642 WHERE "Oxen" > '113.8' AND "Sheep and Goats" > '4533.4' AND "Cows" < '3987' AND "Total Horses" > '5056.5'
wikisql
CREATE TABLE finrev_fed_key_17 ( state_code number, state text, #_records text ) CREATE TABLE ndecoreexcel_math_grade8 ( year number, state text, all_students text, average_scale_score number ) CREATE TABLE finrev_fed_17 ( state_code number, idcensus number, school_district tex...
Which state get the highest revenue?
SELECT T2.state FROM finrev_fed_key_17 AS T2 JOIN finrev_fed_17 AS T1 ON T1.state_code = T2.state_code GROUP BY T2.state ORDER BY SUM(t_fed_rev) DESC LIMIT 1
studentmathscore
CREATE TABLE table_name_2 ( points VARCHAR, chassis VARCHAR )
Tell me the total number of points with chassis of tf103
SELECT COUNT(points) FROM table_name_2 WHERE chassis = "tf103"
sql_create_context