context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_204_582 ( id number, "model" text, "launch" text, "code name" text, "fab (nm)" number, "bus interface" text, "memory (mib)" text, "core clock (mhz)" number, "memory clock (mhz)" number, "config core1" text, "fillrate\nmoperations/s" number, "fillrate\nm...
what is the next code name after sst1 ?
SELECT "code name" FROM table_204_582 WHERE id = (SELECT id FROM table_204_582 WHERE "code name" = 'sst1') + 1
squall
CREATE TABLE table_name_18 ( surface VARCHAR, opponents VARCHAR )
Which surface do opponents of Thomas Oger Nicolas Tourte have?
SELECT surface FROM table_name_18 WHERE opponents = "thomas oger nicolas tourte"
sql_create_context
CREATE TABLE table_name_22 ( visitor VARCHAR, home VARCHAR )
Who was the visiting team when the home team was Seattle?
SELECT visitor FROM table_name_22 WHERE home = "seattle"
sql_create_context
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, had...
on their first hospital encounter what was diagnosed with patient 10425 for the first time?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10425 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime L...
mimic_iii
CREATE TABLE table_name_82 ( method VARCHAR, round VARCHAR, event VARCHAR )
What is the method of the match after round 1 in the k-1 andy memorial 2001 japan gp final?
SELECT method FROM table_name_82 WHERE round > 1 AND event = "k-1 andy memorial 2001 japan gp final"
sql_create_context
CREATE TABLE table_69307 ( "Outcome" text, "Tournament" text, "Surface" text, "Partner" text, "Opponent in the final" text, "Score" text )
What was the outcome of the tournament in Edinburgh?
SELECT "Outcome" FROM table_69307 WHERE "Tournament" = 'edinburgh'
wikisql
CREATE TABLE table_11115 ( "Jurisdiction" text, "Voted Yes" real, "Percent Yes" real, "Voted No" real, "Percent No" real )
What is the highest percent yes in Alberta, which had less than 5,354 vote yes and less than 731,975 vote no?
SELECT MAX("Percent Yes") FROM table_11115 WHERE "Voted Yes" < '5,354' AND "Jurisdiction" = 'alberta' AND "Voted No" < '731,975'
wikisql
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 jyjgzbb ( BGDH text, BGRQ tim...
在病患61732704的检验报告单中哪些号码是检验结果指标全部不正常的?
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_57050 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is Richmond score as the away team?
SELECT "Away team score" FROM table_57050 WHERE "Away team" = 'richmond'
wikisql
CREATE TABLE table_name_72 ( date VARCHAR, championship VARCHAR )
What is Date, when Championship is Mackay?
SELECT date FROM table_name_72 WHERE championship = "mackay"
sql_create_context
CREATE TABLE table_50410 ( "Branding" text, "Callsign" text, "Frequency" text, "Power (kW)" text, "Location" text )
Which frequency is located in Dagupan?
SELECT "Frequency" FROM table_50410 WHERE "Location" = 'dagupan'
wikisql
CREATE TABLE table_27616663_1 ( result VARCHAR, original_artist VARCHAR )
What was the result of the performance of the song by Caetano Veloso?
SELECT result FROM table_27616663_1 WHERE original_artist = "Caetano Veloso"
sql_create_context
CREATE TABLE table_train_247 ( "id" int, "mini_mental_state_examination_mmse" int, "creatinine_consistently" float, "creatinine_clearance_cl" float, "seizure_disorder" bool, "age" float, "NOUSE" float )
creatinine clearance < 60 and / or serum creatinine consistently > 1.5 mg / dl;
SELECT * FROM table_train_247 WHERE creatinine_clearance_cl < 60 OR creatinine_consistently > 1.5
criteria2sql
CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, UserId number, UserDisplayName text, Comment text, Text text, ContentLicense text ) CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationD...
Trust building: Average reputation of users that post answers.
SELECT answers.year, Average_reputation_answers = SUM(Reputation.SUM_GOLD / CAST(Answers.posts AS FLOAT)) OVER (ORDER BY Answers.year rows BETWEEN unbounded preceding AND CURRENT ROW) FROM (SELECT Year = DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0), Posts = COUNT(Id) FROM Posts WHERE PostTypeId = 2 GROUP BY DATE...
sede
CREATE TABLE table_35410 ( "Year" real, "Jewish" real, "Muslim" real, "Christian" real, "Druze" real, "Total" real )
How many muslims have a jewish of 112,803, and a year after 2008?
SELECT SUM("Muslim") FROM table_35410 WHERE "Jewish" = '112,803' AND "Year" > '2008'
wikisql
CREATE TABLE CloseReasonTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, Body text, OwnerUserId number, ...
Find all answers for elasticsearch questions.
SELECT COUNT(1) FROM Posts AS p INNER JOIN Posts AS pp ON p.ParentId = pp.Id INNER JOIN PostTags AS pt ON pt.PostId = p.ParentId INNER JOIN Users AS u ON p.OwnerUserId = u.Id INNER JOIN Users AS up ON pp.OwnerUserId = up.Id WHERE pt.TagId = 86394 AND p.PostTypeId = 2
sede
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, give me the comparison about price over the name , and group by attribute founder, display y axis in desc order.
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Price DESC
nvbench
CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine ( id number, name text, trade_name text, fda_approved text ) CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, me...
What are the distinct name, location and products of the enzymes which has any 'inhibitor' interaction?
SELECT DISTINCT T1.name, T1.location, T1.product FROM enzyme AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.enzyme_id = T1.id WHERE T2.interaction_type = 'inhibitor'
spider
CREATE TABLE table_name_95 ( Id VARCHAR )
What is the value for 2010 when the 2012 value is Q2?
SELECT 2010 FROM table_name_95 WHERE 2012 = "q2"
sql_create_context
CREATE TABLE table_39741 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
What is the total number of Top-5 when the Top-25 is 6, and a Cuts made are less than 12?
SELECT COUNT("Top-5") FROM table_39741 WHERE "Top-25" = '6' AND "Cuts made" < '12'
wikisql
CREATE TABLE table_67850 ( "Year" real, "Chassis" text, "Engine" text, "Tyres" text, "Points" real )
What is the total point for the year listed in 1988?
SELECT SUM("Points") FROM table_67850 WHERE "Year" = '1988'
wikisql
CREATE TABLE table_3664 ( "Series #" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "U.S. viewers (millions)" text )
How many episodes are titled 'it's called hazing, look it up'?
SELECT COUNT("Series #") FROM table_3664 WHERE "Title" = 'It''s Called Hazing, Look It Up'
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...
审核的人在检验结果指标记录编码为54706568513的工号以及姓名分别是啥?
SELECT jyjgzbb.SHRGH, jyjgzbb.SHRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '54706568513'
css
CREATE TABLE Catalog_Structure ( catalog_level_number INTEGER, catalog_id INTEGER, catalog_level_name VARCHAR(50) ) CREATE TABLE Catalog_Contents_Additional_Attributes ( catalog_entry_id INTEGER, catalog_level_number INTEGER, attribute_id INTEGER, attribute_value VARCHAR(255) ) CREATE TABL...
Find the names of catalog entries with level number 8, and count them by a bar chart, and rank in descending by the y axis.
SELECT catalog_entry_name, COUNT(catalog_entry_name) FROM Catalog_Contents AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.catalog_entry_id = t2.catalog_entry_id WHERE t2.catalog_level_number = "8" GROUP BY catalog_entry_name ORDER BY COUNT(catalog_entry_name) DESC
nvbench
CREATE TABLE table_name_88 ( points INTEGER, match INTEGER )
What is the lowest points for a match before 14?
SELECT MIN(points) FROM table_name_88 WHERE match > 14
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
how many patients whose primary disease is atrial septal defect\mitral valve replacement;repair atrial-septal defect/sda and year of death is less than or equal to 2126?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL SEPTAL DEFECT\MITRAL VALVE REPLACEMENT;REPAIR ATRIAL-SEPTAL DEFECT/SDA" AND demographic.dod_year <= "2126.0"
mimicsql_data
CREATE TABLE table_8719 ( "Year" real, "Competition" text, "Venue" text, "Position" text, "Event" text )
Name the Venue which has a Position of 5th?
SELECT "Venue" FROM table_8719 WHERE "Position" = '5th'
wikisql
CREATE TABLE table_66427 ( "Rank" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the Rank of the Swimmer with a Time of 2:25.65 in a Lane larger than 3?
SELECT AVG("Rank") FROM table_66427 WHERE "Time" = '2:25.65' AND "Lane" > '3'
wikisql
CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, tough_tests int, heavy_papers int, cares_for_students int, heavy_assignments ...
THEORY 249 , when was it last offered ?
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'THEORY' AND course.number = 249 AND semester.semester_id = course_offering.semester ORDER BY semester.year DESC LIMIT 1
advising
CREATE TABLE table_name_86 ( label VARCHAR, region VARCHAR, catalog VARCHAR )
What label is associated with the United Kingdom and the chem036 catalog?
SELECT label FROM table_name_86 WHERE region = "united kingdom" AND catalog = "chem036"
sql_create_context
CREATE TABLE table_name_92 ( kickoff___et__ VARCHAR, game_site VARCHAR )
What is the kickoff time for the game that was at Ralph Wilson Stadium?
SELECT kickoff___et__ FROM table_name_92 WHERE game_site = "ralph wilson stadium"
sql_create_context
CREATE TABLE table_53034 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the smallest total for a nation with more than 1 silver?
SELECT MIN("Total") FROM table_53034 WHERE "Silver" > '1'
wikisql
CREATE TABLE wrestler ( wrestler_id number, name text, reign text, days_held text, location text, event text ) CREATE TABLE elimination ( elimination_id text, wrestler_id text, team text, eliminated_by text, elimination_move text, time text )
Return the name of the wrestler who had the lowest number of days held.
SELECT name FROM wrestler ORDER BY days_held LIMIT 1
spider
CREATE TABLE table_name_39 ( winner VARCHAR, course VARCHAR )
Name the winner for genoa to livorno
SELECT winner FROM table_name_39 WHERE course = "genoa to livorno"
sql_create_context
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, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
编号为16392541751这个门诊就诊的病人体征记录的日期是哪天
SELECT JLSJ FROM mzjzjlb WHERE JZLSH = '16392541751'
css
CREATE TABLE user_profiles ( followers INTEGER )
Find the maximum and total number of followers of all users.
SELECT MAX(followers), SUM(followers) FROM user_profiles
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,...
what is admission location and admission time of subject id 17519?
SELECT demographic.admission_location, demographic.admittime FROM demographic WHERE demographic.subject_id = "17519"
mimicsql_data
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 jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE employees ( EMPLO...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about salary over the phone_number by a bar chart.
SELECT PHONE_NUMBER, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200)
nvbench
CREATE TABLE table_1341843_15 ( incumbent VARCHAR, first_elected VARCHAR )
Who's the incumbent of the district with first election held in 1950?
SELECT incumbent FROM table_1341843_15 WHERE first_elected = "1950"
sql_create_context
CREATE TABLE table_79840 ( "Tournament" text, "2000" text, "2001" text, "2002" text, "Career SR" text, "Career Win-Loss" text )
Which career win-loss record has a 1r in 2002, a 2r in 2000 and a 2r in 2001?
SELECT "Career Win-Loss" FROM table_79840 WHERE "2002" = '1r' AND "2000" = '2r' AND "2001" = '2r'
wikisql
CREATE TABLE table_203_336 ( id number, "#" number, "date" text, "opponent" text, "score" text, "win" text, "loss" text, "save" text, "attendance" number, "record" text )
total games played against the white sox in july ?
SELECT COUNT(*) FROM table_203_336 WHERE "opponent" = 'white sox'
squall
CREATE TABLE table_40173 ( "Candidate" text, "Votes" real, "Percentage" text, "Counties" real, "Delegates" real )
What is the highest Counties when Mitt Romney was the candidate with less than 0 delegates?
SELECT MAX("Counties") FROM table_40173 WHERE "Candidate" = 'mitt romney' AND "Delegates" < '0'
wikisql
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...
Show the relation between team id and school_id for each All_Games using a scatter chart
SELECT Team_ID, School_ID FROM basketball_match GROUP BY All_Games
nvbench
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...
what is the number of patients whose primary disease is sepsis and admission year is less than 2187?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "SEPSIS" AND demographic.admityear < "2187"
mimicsql_data
CREATE TABLE table_4574 ( "Commodity" text, "2001-02" text, "2002-03" text, "2003-04" text, "2004-05" text, "2005-06" text, "2006-07" text )
What is the 2005-05 production for milk?
SELECT "2004-05" FROM table_4574 WHERE "Commodity" = 'milk'
wikisql
CREATE TABLE table_5500 ( "Name" text, "Hanzi" text, "Origin" text, "Launch" real, "Owner" text )
With a Hanzi of , what is the name?
SELECT "Name" FROM table_5500 WHERE "Hanzi" = '深圳卫视'
wikisql
CREATE TABLE table_74353 ( "No." real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text, "U.S. viewers (million)" text )
Which episode number saw 1.312 million U.S. Wviewers?
SELECT "No." FROM table_74353 WHERE "U.S. viewers (million)" = '1.312'
wikisql
CREATE TABLE table_name_23 ( block VARCHAR, cospar_id VARCHAR )
What block has a COSPAR ID of 1995-060a?
SELECT block FROM table_name_23 WHERE cospar_id = "1995-060a"
sql_create_context
CREATE TABLE table_54247 ( "Year" real, "Award" text, "Category" text, "Nominee" text, "Result" text )
What is the result for the best new musical nominee?
SELECT "Result" FROM table_54247 WHERE "Nominee" = 'best new musical'
wikisql
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( ...
how many patients whose admission type is elective and procedure icd9 code is 4632?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.icd9_code = "4632"
mimicsql_data
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 primary disease of subject name jerry deberry?
SELECT demographic.diagnosis FROM demographic WHERE demographic.name = "Jerry Deberry"
mimicsql_data
CREATE TABLE table_140968_1 ( size___s_base_pair__ VARCHAR, molecular_weight_kda VARCHAR )
How many base pairs are there if the molecular weight is 102?
SELECT COUNT(size___s_base_pair__) FROM table_140968_1 WHERE molecular_weight_kda = "102"
sql_create_context
CREATE TABLE table_204_501 ( id number, "institution" text, "location" text, "nickname" text, "founded" number, "type" text, "enrollment" number, "joined" number )
which two institutions joined the same year as clarke university ?
SELECT "institution" FROM table_204_501 WHERE "institution" <> 'clarke university' AND "joined" = (SELECT "joined" FROM table_204_501 WHERE "institution" = 'clarke university')
squall
CREATE TABLE course ( course_id varchar(8), title varchar(50), dept_name varchar(20), credits numeric(2,0) ) CREATE TABLE student ( ID varchar(5), name varchar(20), dept_name varchar(20), tot_cred numeric(3,0) ) CREATE TABLE takes ( ID varchar(5), course_id varchar(8), sec_...
Draw a bar chart for how many total credits are offered by each department?
SELECT dept_name, SUM(credits) FROM course GROUP BY dept_name
nvbench
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 ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
what was the name of a drug patient 12726 was last prescribed in this month?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12726) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
CREATE TABLE table_72216 ( "Taxonomy" text, "Species in the world" real, "Species in Peru" real, "Species in the Peruvian Amazon" real, "Peru Vs. world (Percent)" real, "Peruvian Amazon Vs. Peru (Percent)" real )
what's the maximum peru vs. world (percent) with 9672 species in the world
SELECT MAX("Peru Vs. world (Percent)") FROM table_72216 WHERE "Species in the world" = '9672'
wikisql
CREATE TABLE table_14342210_13 ( class VARCHAR, prior_experience VARCHAR )
How many entries are there for class when the prior experience is shasta h.s.
SELECT COUNT(class) FROM table_14342210_13 WHERE prior_experience = "Shasta H.S."
sql_create_context
CREATE TABLE table_26630 ( "Name" text, "Deceased Spouse" text, "Cause of Death" text, "Date of Spouses Death" text, "Length of Marriage" text, "Children Together" text, "Current Marital Status" text )
Name the deceased spouse for length of marriage being 24 years
SELECT "Deceased Spouse" FROM table_26630 WHERE "Length of Marriage" = '24 years'
wikisql
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTa...
SFF Top Views and Answer Score for Top ID Category Tags.
WITH Questions AS (SELECT *, (SELECT SUM(A.Score) FROM Posts AS A WHERE A.ParentId = Q.Id) AS "answerscore" FROM Posts AS Q WHERE Q.PostTypeId = 1) SELECT 'All' AS "questions", ROUND(AVG(CAST(ViewCount AS FLOAT)), 0) AS "views", ROUND(AVG(CAST(AnswerCount AS FLOAT)), 2) AS "answers", ROUND(AVG(CAST(AnswerScore AS FLOAT...
sede
CREATE TABLE table_15412 ( "Name" text, "Entered Office" text, "Left Office" text, "Party" text, "First Minister" text )
What is the Left Office of cabinet secretary for culture and external affairs named?
SELECT "Name" FROM table_15412 WHERE "Left Office" = 'cabinet secretary for culture and external affairs'
wikisql
CREATE TABLE hz_info_mzjzjlb ( JZLSH number, YLJGDM number, mzjzjlb_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 jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND...
css
CREATE TABLE table_name_73 ( hometown VARCHAR, candidate VARCHAR )
What is the Hometown of Candidate Lenny Veltman?
SELECT hometown FROM table_name_73 WHERE candidate = "lenny veltman"
sql_create_context
CREATE TABLE table_name_78 ( place VARCHAR, player VARCHAR )
WHAT IS THE PLACE WITH PLAYER mark o'meara?
SELECT place FROM table_name_78 WHERE player = "mark o'meara"
sql_create_context
CREATE TABLE table_203_161 ( id number, "pos." text, "div." number, "no." number, "team" text, "drivers" text, "car" text, "laps" number, "qual.\npos." number )
which team did falkner , smith and bates drive for ?
SELECT "team" FROM table_203_161 WHERE "drivers" = 'john faulkner'
squall
CREATE TABLE table_name_9 ( silver INTEGER, nation VARCHAR, total VARCHAR )
How many Silver medals for the Nation of Turkey with a Total of less than 2?
SELECT SUM(silver) FROM table_name_9 WHERE nation = "turkey" AND total < 2
sql_create_context
CREATE TABLE table_name_64 ( venue VARCHAR, result VARCHAR )
Where was the game held that resulted in a draw?
SELECT venue FROM table_name_64 WHERE result = "draw"
sql_create_context
CREATE TABLE table_13943239_1 ( location VARCHAR, episode VARCHAR )
Where was held the ceremony for the 12th Pride of Britain Awards?
SELECT location FROM table_13943239_1 WHERE episode = "12th Pride of Britain Awards"
sql_create_context
CREATE TABLE Customer_Address_History ( customer_id INTEGER, address_id INTEGER, date_from DATETIME, date_to DATETIME ) CREATE TABLE Contacts ( contact_id INTEGER, customer_id INTEGER, gender VARCHAR(1), first_name VARCHAR(80), last_name VARCHAR(50), contact_phone VARCHAR(80) ) ...
Show me a bar chart with the product name and their frequency, list from low to high by the y axis please.
SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY COUNT(product_name)
nvbench
CREATE TABLE table_52918 ( "Date" text, "Competition" text, "Venue" text, "Result" text, "Score" text, "Goals" text )
What date was a game played at Headingley Stadium?
SELECT "Date" FROM table_52918 WHERE "Venue" = 'headingley stadium'
wikisql
CREATE TABLE table_name_95 ( winning__percentage INTEGER, lost VARCHAR, goals_for VARCHAR )
What is the lowest win percentage for teams with more than 23 losses and more than 386 goals for?
SELECT MIN(winning__percentage) FROM table_name_95 WHERE lost > 23 AND goals_for > 386
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE time_zone ( time_zone_code tex...
show me the flights from DENVER that go to PITTSBURGH and then ATLANTA
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANTA' AND CITY_2.ci...
atis
CREATE TABLE table_9995 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Which player plays for australia?
SELECT "Player" FROM table_9995 WHERE "Country" = 'australia'
wikisql
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
how many hours have been passed since patient 004-64091 was diagnosed with s/p maze procedure to the first time on their current hospital encounter?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091...
eicu
CREATE TABLE table_2417340_4 ( successor VARCHAR, vacator VARCHAR, district VARCHAR )
What was the successor for vacant alabama 3rd?
SELECT successor FROM table_2417340_4 WHERE vacator = "Vacant" AND district = "Alabama 3rd"
sql_create_context
CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE appellations ( no numbe...
What are the areas and counties for all appelations?
SELECT area, county FROM appellations
spider
CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) 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, JO...
For those employees who do not work in departments with managers that have ids between 100 and 200, for commission_pct, hire_date, visualize the trend, and sort by the x-axis in desc.
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_name_19 ( games VARCHAR, sport VARCHAR, medal VARCHAR )
When did Pakistan win a Gold Medal in Field Hockey?
SELECT games FROM table_name_19 WHERE sport = "field hockey" AND medal = "gold"
sql_create_context
CREATE TABLE player ( player_id number, name text, position text, club_id number, apps number, tries number, goals text, points number ) CREATE TABLE competition ( competition_id number, year number, competition_type text, country text ) CREATE TABLE club_rank ( ran...
List the position of players and the average number of points of players of each position.
SELECT position, AVG(points) FROM player GROUP BY position
spider
CREATE TABLE mzjzjlb ( HXPLC number, HZXM text, JLSJ time, JZJSSJ time, JZKSBM text, JZKSMC text, JZKSRQ time, JZLSH text, JZZDBM text, JZZDSM text, JZZTDM number, JZZTMC text, KH text, KLX number, MJZH text, ML number, MZZYZDZZBM text, MZZYZDZZMC ...
编号为19416849的患者在门诊诊断为慢性阻塞性肺病伴有急性加重的白蛋白的时候其结果定量是什么及其单位是什么呢?
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDSM = '慢性阻塞性肺病伴有急性加重' AND hz_in...
css
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
how many patients whose drug code is enox80i and lab test category is blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "ENOX80I" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Publicity badges awarded within a given period.
SELECT UserId AS "user_link", SUM(CASE WHEN Name = 'Publicist' THEN 1 ELSE 0 END) AS Publicist, SUM(CASE WHEN Name = 'Booster' THEN 1 ELSE 0 END) AS Booster, SUM(CASE WHEN Name = 'Announcer' THEN 1 ELSE 0 END) AS Announcer, SUM(CASE WHEN (Name = 'Announcer') OR (Name = 'Booster') OR (Name = 'Publicist') THEN 1 ELSE 0 E...
sede
CREATE TABLE table_name_61 ( rank INTEGER, constituency VARCHAR, swing_to_gain VARCHAR )
what is the lowest rank when the constituency is edinburgh northern and leith and the swing to gain is less than 4.16?
SELECT MIN(rank) FROM table_name_61 WHERE constituency = "edinburgh northern and leith" AND swing_to_gain < 4.16
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, ...
门诊给患者王灵慧诊断为混合性焦虑和抑郁障碍,666198这个检测指标的结果定量和单位分别是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW 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.JZ...
css
CREATE TABLE table_24357 ( "Type of Record" text, "Attendance" real, "Date/Year" text, "Stadium" text, "Result/Games" text )
When 27585 is the attendance what are the results of the games?
SELECT "Result/Games" FROM table_24357 WHERE "Attendance" = '27585'
wikisql
CREATE TABLE table_1036189_1 ( other_features VARCHAR, functional_type VARCHAR )
For the functional type of light ball, what were the other features?
SELECT other_features FROM table_1036189_1 WHERE functional_type = "Light Ball"
sql_create_context
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom t...
what is the maximum hospital cost for a person with neuropathy in diabetes during the previous year?
SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'neuropathy in diabetes')) AND DATETIME(cost.chargetime, 'start ...
mimic_iii
CREATE TABLE table_19681738_1 ( total VARCHAR, hancock__number VARCHAR )
how many times was total considered when hancock # was 1394
SELECT COUNT(total) FROM table_19681738_1 WHERE hancock__number = 1394
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
what is the number of patients whose marital status is married and admission year is less than 2200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2200"
mimicsql_data
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE date_day ...
what is the cost of a flight from BOSTON to DENVER
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_...
atis
CREATE TABLE table_name_57 ( started_round VARCHAR, last_match VARCHAR )
What was the started round for the competition that had the last match on January 16, 2008?
SELECT started_round FROM table_name_57 WHERE last_match = "january 16, 2008"
sql_create_context
CREATE TABLE table_29398373_2 ( chairman VARCHAR, captain VARCHAR )
Name the chairman for iker casillas
SELECT chairman FROM table_29398373_2 WHERE captain = "Iker Casillas"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( i...
when did patient 028-55868 first have the maximum systemicdiastolic value?
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 = '028-55868')) AND NOT vitalperiodic.systemicdiastoli...
eicu
CREATE TABLE table_48031 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Which home team had an away team of Reading?
SELECT "Home team" FROM table_48031 WHERE "Away team" = 'reading'
wikisql
CREATE TABLE table_name_58 ( agg VARCHAR, team_2 VARCHAR )
What is the aggregate for the tie with a team 2 of Irtysh?
SELECT agg FROM table_name_58 WHERE team_2 = "irtysh"
sql_create_context
CREATE TABLE table_2543 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" text, "Position" text )
How many teams have 7th position?
SELECT COUNT("Team") FROM table_2543 WHERE "Position" = '7th'
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, ...
从03年1月23日至2006年7月17日之间何秀越病患所有检测结果指标记录的质检人为85147197的检验指标流水号是多少?
(SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM =...
css
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restr...
what is the abbreviation D10
SELECT DISTINCT aircraft_code FROM aircraft WHERE aircraft_code = 'D10'
atis
CREATE TABLE table_25374 ( "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 )
Who are all the players with 156 rebounds?
SELECT "Player" FROM table_25374 WHERE "Rebounds" = '156'
wikisql
CREATE TABLE table_name_33 ( date VARCHAR, road_team VARCHAR, result VARCHAR )
Which Date has a Road Team of chicago, and a Result of 88-85 (ot)?
SELECT date FROM table_name_33 WHERE road_team = "chicago" AND result = "88-85 (ot)"
sql_create_context
CREATE TABLE table_78802 ( "Service name" text, "Owner" text, "Catch-up period" text, "Streamed" text, "Download" text, "Technology" text )
What is the download of the varies catch-up period?
SELECT "Download" FROM table_78802 WHERE "Catch-up period" = 'varies'
wikisql