context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE t_kc24 ( MED_SAFE_PAY_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, MED_CLINIC_ID text, REF_SLT_FLG number, CLINIC_SLT_DATE time, COMP_ID text, PERSON_ID text, FLX_MED_ORG_ID text, INSU_TYPE text, MED_AMOUT number, PER_ACC_PAY number, OVE_PAY numb...
从03年9月17到06年10月6日这段时间,医疗机构5908391记录的病人平均住院时长是多少
SELECT AVG(IN_HOSP_DAYS) FROM t_kc21 WHERE MED_SER_ORG_NO = '5908391' AND IN_HOSP_DATE BETWEEN '2003-09-17' AND '2006-10-06'
css
CREATE TABLE Student_Tests_Taken ( registration_id INTEGER, date_test_taken DATETIME, test_result VARCHAR(255) ) CREATE TABLE Subjects ( subject_id INTEGER, subject_name VARCHAR(120) ) CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATET...
Find the dates of the tests taken with result 'Pass', and count them by a line chart, and order by the x-axis from low to high.
SELECT date_test_taken, COUNT(date_test_taken) FROM Student_Tests_Taken WHERE test_result = "Pass" ORDER BY date_test_taken
nvbench
CREATE TABLE table_30925 ( "Stage" real, "Winner" text, "General classification" text, "Mountains Classification" text, "Points classification" text, "Sprints Classification" text, "Team Classification" text )
Name the team classification for thomas de gendt
SELECT "Team Classification" FROM table_30925 WHERE "Winner" = 'Thomas De Gendt'
wikisql
CREATE TABLE table_203_646 ( id number, "year" number, "competition" text, "venue" text, "position" text, "notes" text )
following the world championships in seville , what was the next venue for the world championships ?
SELECT "venue" FROM table_203_646 WHERE "competition" = 'world championships' AND "year" > (SELECT "year" FROM table_203_646 WHERE "competition" = 'world championships' AND "venue" = 'seville') ORDER BY "year" LIMIT 1
squall
CREATE TABLE table_37730 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
What was the score of the game that led to a 79-77 record?
SELECT "Score" FROM table_37730 WHERE "Record" = '79-77'
wikisql
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE d_labitems ( row_id number, itemid number, label te...
how much was the total amount patient 30460 had received?
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 30460))
mimic_iii
CREATE TABLE table_7209 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text )
What is Aberdeen team's date of vacancy?
SELECT "Date of vacancy" FROM table_7209 WHERE "Team" = 'aberdeen'
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...
在8814772号医院就诊的患者出院时查出的疾病编码,患上不同疾病的患者们的平均年龄是多少岁啊?
SELECT t_kc21.OUT_DIAG_DIS_CD, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '8814772' GROUP BY t_kc21.OUT_DIAG_DIS_CD
css
CREATE TABLE table_name_43 ( points VARCHAR, club VARCHAR )
How many points for the skater from club btsc?
SELECT COUNT(points) FROM table_name_43 WHERE club = "btsc"
sql_create_context
CREATE TABLE Player ( pID numeric(5,0), pName varchar(20), yCard varchar(3), HS numeric(5,0) ) CREATE TABLE Tryout ( pID numeric(5,0), cName varchar(20), pPos varchar(8), decision varchar(3) ) CREATE TABLE College ( cName varchar(20), state varchar(2), enr numeric(5,0) )
Find the name and training hours of players whose hours are below 1500. Plot them as pie chart.
SELECT pName, HS FROM Player WHERE HS < 1500
nvbench
CREATE TABLE table_name_12 ( name VARCHAR, displacement VARCHAR )
what is the name when the displacement is 8,305 t?
SELECT name FROM table_name_12 WHERE displacement = "8,305 t"
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 jybgb ( BBCJBW text, BBDM tex...
23887920这个患者的身高和体重是多少?
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '23887920'
css
CREATE TABLE table_203_374 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many gold medals does poland have ?
SELECT "gold" FROM table_203_374 WHERE "nation" = 'poland'
squall
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, Cr...
Top 100 users from Hyderbad India.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location FROM Users WHERE Location LIKE '%Hyderabad%' ORDER BY Reputation DESC LIMIT 1000
sede
CREATE TABLE table_204_155 ( id number, "rank" number, "heat" number, "athlete" text, "nationality" text, "time" number, "notes" text )
who is the only cyclist from brazil ?
SELECT "athlete" FROM table_204_155 WHERE "nationality" = 'brazil'
squall
CREATE TABLE table_68791 ( "Institution" text, "Team" text, "City" text, "Province" text, "First season" real, "Head coach" text, "Enrollment" real, "Football stadium" text, "Capacity" real )
What's the name of the city whose first season was in 1996?
SELECT "City" FROM table_68791 WHERE "First season" = '1996'
wikisql
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
这个名叫的冯晓霜的患者被门诊诊断为妊娠合并精神障碍,看一下他总蛋白的检测结果定量及其单位
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM person_info JOIN hz_info JOIN mzjzjlb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJ...
css
CREATE TABLE table_10472 ( "Date" text, "Tournament" text, "Location" text, "Purse( $ )" real, "Winner" text, "Score" text, "1st Prize( $ )" real )
What is average prize for first place with a $500,000 purse in the Franklin Quest Championship?
SELECT AVG("1st Prize( $ )") FROM table_10472 WHERE "Purse( $ )" = '500,000' AND "Tournament" = 'franklin quest championship'
wikisql
CREATE TABLE table_name_84 ( team_1 VARCHAR, team_2 VARCHAR )
What is Team 1, when Team 2 is Saint Louis?
SELECT team_1 FROM table_name_84 WHERE team_2 = "saint louis"
sql_create_context
CREATE TABLE table_51933 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
what is the grid when the laps is more than 0, the time/retired is engine and the driver is pedro de la rosa?
SELECT "Grid" FROM table_51933 WHERE "Laps" > '0' AND "Time/Retired" = 'engine' AND "Driver" = 'pedro de la rosa'
wikisql
CREATE TABLE table_204_416 ( id number, "chip" text, "flash size" text, "eeprom" number, "sram" number, "frequency\n[mhz]" number, "package" text )
what microcontroller has the same flash size as at90s4414
SELECT "chip" FROM table_204_416 WHERE "chip" <> 'at90s4414' AND "flash size" = (SELECT "flash size" FROM table_204_416 WHERE "chip" = 'at90s4414')
squall
CREATE TABLE table_name_1 ( party VARCHAR, municipality VARCHAR )
Municipality of tampere involves which party?
SELECT party FROM table_name_1 WHERE municipality = "tampere"
sql_create_context
CREATE TABLE table_204_179 ( id number, "season" number, "division" number, "tms." number, "pos." number, "fa cup" text, "afc cl" number )
which year was the most pos .
SELECT "season" FROM table_204_179 WHERE "pos." = (SELECT MAX("pos.") FROM table_204_179)
squall
CREATE TABLE table_16119 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
what is the total number of playoffs where regular season is 6th, southwest
SELECT COUNT("Playoffs") FROM table_16119 WHERE "Regular Season" = '6th, Southwest'
wikisql
CREATE TABLE Timed_Status_of_Things ( thing_id INTEGER, Date_and_Date DATETIME, Status_of_Thing_Code CHAR(15) ) CREATE TABLE Customer_Event_Notes ( Customer_Event_Note_ID INTEGER, Customer_Event_ID INTEGER, service_type_code CHAR(15), resident_id INTEGER, property_id INTEGER, date_m...
Show the total number of each type of each thing using a pie chart.
SELECT Type_of_Thing_Code, COUNT(Type_of_Thing_Code) FROM Things AS T1 JOIN Organizations AS T2 ON T1.organization_id = T2.organization_id GROUP BY Type_of_Thing_Code
nvbench
CREATE TABLE table_name_61 ( gold VARCHAR, silver VARCHAR, nation VARCHAR )
What is the total number of gold medals of slovakia, which has less than 1 silver medal?
SELECT COUNT(gold) FROM table_name_61 WHERE silver < 1 AND nation = "slovakia"
sql_create_context
CREATE TABLE table_2832 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who is the high rebounds for game 64?
SELECT "High rebounds" FROM table_2832 WHERE "Game" = '64'
wikisql
CREATE TABLE table_name_96 ( date VARCHAR, film VARCHAR )
When did the film 'Monsters' come out?
SELECT date FROM table_name_96 WHERE film = "monsters"
sql_create_context
CREATE TABLE table_13693 ( "Lane" real, "Name" text, "Country" text, "Reaction Time" real, "Time" real )
How many Times have a Reaction Time larger than 0.17500000000000002, and a Lane of 3?
SELECT COUNT("Time") FROM table_13693 WHERE "Reaction Time" > '0.17500000000000002' AND "Lane" = '3'
wikisql
CREATE TABLE status ( station_id INTEGER, bikes_available INTEGER, docks_available INTEGER, time TEXT ) CREATE TABLE trip ( id INTEGER, duration INTEGER, start_date TEXT, start_station_name TEXT, start_station_id INTEGER, end_date TEXT, end_station_name TEXT, end_station...
Bar chart x axis date y axis the number of date, could you display by the total number from high to low?
SELECT date, COUNT(date) FROM weather ORDER BY COUNT(date) DESC
nvbench
CREATE TABLE table_62382 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
What week had an attendance more than 63,268 and Kansas City Chiefs as the opponent?
SELECT COUNT("Week") FROM table_62382 WHERE "Attendance" > '63,268' AND "Opponent" = 'kansas city chiefs'
wikisql
CREATE TABLE table_46523 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Time" text, "Location" text )
Which Opponent has a Location of gold coast , australia, and a Method of submission (punches)?
SELECT "Opponent" FROM table_46523 WHERE "Location" = 'gold coast , australia' AND "Method" = 'submission (punches)'
wikisql
CREATE TABLE table_name_22 ( Id VARCHAR )
What is the 2002 result where 2011 and 2000 are 1R?
SELECT 2002 FROM table_name_22 WHERE 2011 = "1r" AND 2000 = "1r"
sql_create_context
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostLinks ( Id number, CreationDate time, PostId number, RelatedPostId number, LinkTypeId number ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, Dele...
gg test of poorly answer questions for apps.
SELECT * FROM Posts WHERE AnswerCount > 5 AND CommentCount > 5 AND ViewCount > 50 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND AcceptedAnswerId IS NULL AND Tags LIKE '%##Tag1##%' AND CreationDate > '2015-12-21'
sede
CREATE TABLE table_80231 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
With a Rank of 19, and a Start of 14, what was the finish?
SELECT "Finish" FROM table_80231 WHERE "Rank" = '19' AND "Start" = '14'
wikisql
CREATE TABLE table_6326 ( "Year" real, "Chassis" text, "Engine" text, "Start" text, "Finish" text, "Team" text )
What is the Engine with 3 as the start in the year of 2007?
SELECT "Engine" FROM table_6326 WHERE "Start" = '3' AND "Year" = '2007'
wikisql
CREATE TABLE table_name_76 ( weblink VARCHAR, college_or_campus_name VARCHAR )
What Weblink has a College or Campus Name of anna university college of engineering tindivanam?
SELECT weblink FROM table_name_76 WHERE college_or_campus_name = "anna university college of engineering tindivanam"
sql_create_context
CREATE TABLE table_13886 ( "Name" text, "Position" text, "Date of Appointment" text, "Date of Birth" text, "Date of Retirement" text )
What is Hon. Vicente Q. Roxas appointment date?
SELECT "Date of Appointment" FROM table_13886 WHERE "Name" = 'hon. vicente q. roxas'
wikisql
CREATE TABLE table_name_96 ( delegate VARCHAR, placement_in_miss_universe VARCHAR, hometown VARCHAR )
Which Delegate has a Placement in Miss Universe of fourth runner-up, and a Hometown of makati , rizal?
SELECT delegate FROM table_name_96 WHERE placement_in_miss_universe = "fourth runner-up" AND hometown = "makati , rizal"
sql_create_context
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the sum of salary bin hire_date by weekday, and I want to sort y axis in descending order.
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY SUM(SALARY) DESC
nvbench
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, ...
找出从零四年十月二十五开始算,直到一八年的二月十八,这段时间里患者52950661在医院7572010开的所有药的名字和编码
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '52950661' AND gwyjzb.MED_SER_ORG_NO = '7572010' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-10-25' AND '2018-02-18' UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb...
css
CREATE TABLE table_name_40 ( attendance VARCHAR, date VARCHAR )
Where Date is october 14 what is the attendance?
SELECT attendance FROM table_name_40 WHERE date = "october 14"
sql_create_context
CREATE TABLE table_27987767_2 ( points_margin VARCHAR, winners VARCHAR )
how many total number of points margin when brive is the winners
SELECT COUNT(points_margin) FROM table_27987767_2 WHERE winners = "Brive"
sql_create_context
CREATE TABLE table_31289 ( "Season" text, "Level" text, "Division" text, "Section" text, "Position" text, "Movements" text )
what is the name of the level for the 7th position
SELECT "Level" FROM table_31289 WHERE "Position" = '7th'
wikisql
CREATE TABLE table_name_25 ( score VARCHAR, opponent VARCHAR, game VARCHAR, february VARCHAR )
What is Score, when Game is less than 61, when February is less than 11, and when Opponent is '@ Buffalo Sabres'?
SELECT score FROM table_name_25 WHERE game < 61 AND february < 11 AND opponent = "@ buffalo sabres"
sql_create_context
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course_prerequisite ( pre_course_id ...
Will Dr. Emily Zinnemann be teaching any classes next semester ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND instructor.name LIKE '%Emily Zinnemann%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.o...
advising
CREATE TABLE table_3148 ( "Rank" real, "English title" text, "Chinese title" text, "Average" real, "Peak" real, "Premiere" real, "Finale" real, "HK viewers" text )
What is the largest average for the episode with 1.97 million Hong Kong viewers?
SELECT MAX("Average") FROM table_3148 WHERE "HK viewers" = '1.97 million'
wikisql
CREATE TABLE table_29504351_2 ( best_finish VARCHAR, earnings__$_ VARCHAR )
What is the best finish for the player whose earnings was $421050?
SELECT best_finish FROM table_29504351_2 WHERE earnings__$_ = 421050
sql_create_context
CREATE TABLE table_203_452 ( id number, "pos" number, "no" number, "driver" text, "team" text, "laps" number, "time/retired" text, "grid" number, "points" number )
which driver scored the least amount of points ?
SELECT "driver" FROM table_203_452 ORDER BY "points" LIMIT 1
squall
CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address VARCHAR(255), building_manager VARCHAR(50), building_phone VARCHAR(80) ) CREATE TABLE View_Unit_Status ( apt_id INTEG...
What are dates of birth of all the guests whose gender is 'Male', and count them by a bar chart, sort in ascending by the total number please.
SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male" ORDER BY COUNT(date_of_birth)
nvbench
CREATE TABLE table_name_12 ( team VARCHAR, sponsor VARCHAR )
what is the sponsor of motorola
SELECT team FROM table_name_12 WHERE sponsor = "motorola"
sql_create_context
CREATE TABLE table_name_67 ( opponent VARCHAR, date VARCHAR, type VARCHAR, round VARCHAR )
Which Opponent has a Type of tko, and a Round of 2 (6) on 2006-09-20?
SELECT opponent FROM table_name_67 WHERE type = "tko" AND round = "2 (6)" AND date = "2006-09-20"
sql_create_context
CREATE TABLE table_name_94 ( opponent VARCHAR, january VARCHAR, score VARCHAR )
What is Opponent, when January is greater than 19, and when Score is '7 - 2'?
SELECT opponent FROM table_name_94 WHERE january > 19 AND score = "7 - 2"
sql_create_context
CREATE TABLE table_name_28 ( standings VARCHAR, champions VARCHAR )
What is the Standings of Eintracht Braunschweig?
SELECT standings FROM table_name_28 WHERE champions = "eintracht braunschweig"
sql_create_context
CREATE TABLE table_name_35 ( top_10 VARCHAR, wins VARCHAR, poles VARCHAR )
How many Top 10s have Wins larger than 0, and Poles larger than 0?
SELECT COUNT(top_10) FROM table_name_35 WHERE wins > 0 AND poles > 0
sql_create_context
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as ...
In next term is 463 available ?
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 463 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016
advising
CREATE TABLE schedule ( Cinema_ID int, Film_ID int, Date text, Show_times_per_day int, Price float ) CREATE TABLE cinema ( Cinema_ID int, Name text, Openning_year int, Capacity int, Location text ) CREATE TABLE film ( Film_ID int, Rank_in_series int, Number_in_seaso...
For each record in schedule, show average of the price for each day in a bar chart, and show in desc by the X.
SELECT Date, AVG(Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Date ORDER BY Date DESC
nvbench
CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, lan...
list the time of the hospital admission of patient 30267 in this year.
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 30267 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
mimic_iii
CREATE TABLE table_21322 ( "Rank" real, "1-year peak" text, "5-year peak" text, "10-year peak" text, "15-year peak" text, "20-year peak" text )
What is the highest rank when Garry Kasparov, 2879 is the 1-year peak?
SELECT MAX("Rank") FROM table_21322 WHERE "1-year peak" = 'Garry Kasparov, 2879'
wikisql
CREATE TABLE table_51446 ( "Tournament" text, "Wins" real, "Top-5" real, "Top-10" real, "Top-25" real, "Events" real, "Cuts made" real )
Which top ten, having less than 12 cuts less than 2 top five, and events smaller than 14, is the highest?
SELECT MAX("Top-10") FROM table_51446 WHERE "Cuts made" < '12' AND "Top-5" < '2' AND "Events" < '14'
wikisql
CREATE TABLE ref_characteristic_types ( characteristic_type_code text, characteristic_type_description text ) CREATE TABLE ref_product_categories ( product_category_code text, product_category_description text, unit_of_measure text ) CREATE TABLE characteristics ( characteristic_id number, ...
Count the number of characteristics of the 'flax' product.
SELECT COUNT(*) FROM products AS t1 JOIN product_characteristics AS t2 ON t1.product_id = t2.product_id JOIN characteristics AS t3 ON t2.characteristic_id = t3.characteristic_id WHERE t1.product_name = "flax"
spider
CREATE TABLE table_14273 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Name the highest Bronze which has a Gold larger than 2 and a Rank of total?
SELECT MAX("Bronze") FROM table_14273 WHERE "Gold" > '2' AND "Rank" = 'total'
wikisql
CREATE TABLE table_name_58 ( crowd VARCHAR, away_team VARCHAR )
How many attended the game with north melbourne as the away side?
SELECT crowd FROM table_name_58 WHERE away_team = "melbourne"
sql_create_context
CREATE TABLE table_76017 ( "Driver" text, "Team" text, "Laps" real, "Time/Retired" text, "Grid" real, "Points" real )
What grid has 78 laps, and Ronnie Bremer as driver?
SELECT "Grid" FROM table_76017 WHERE "Laps" = '78' AND "Driver" = 'ronnie bremer'
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 me about the correlation between School_ID and ACC_Percent , and group by attribute ACC_Home in a scatter chart.
SELECT School_ID, ACC_Percent FROM basketball_match GROUP BY ACC_Home
nvbench
CREATE TABLE VoteTypes ( Id number, Name text ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, ...
Answers: Zero-score accepted - Tag parameter.
SELECT a.Id AS "post_link", q.Tags FROM Posts AS q, Posts AS a WHERE a.Score = 0 AND q.AcceptedAnswerId = a.Id AND q.Tags LIKE LOWER('%##Tag##%') ORDER BY q.Id LIMIT 100
sede
CREATE TABLE table_name_26 ( winner VARCHAR, runner_up VARCHAR )
What team was the winner when the runner-up shows both teams awarded championship after a draw.?
SELECT winner FROM table_name_26 WHERE runner_up = "both teams awarded championship after a draw."
sql_create_context
CREATE TABLE table_name_37 ( lane VARCHAR, swimmer VARCHAR )
Which lane is Goksu Bicer in?
SELECT lane FROM table_name_37 WHERE swimmer = "goksu bicer"
sql_create_context
CREATE TABLE Activity ( actid INTEGER, activity_name varchar(25) ) CREATE TABLE Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) CREATE TABLE Faculty ( FacID INTEGER, Lname VARCHAR(15), Fname VARCHAR(15), Ra...
Show the number of faculty members for each rank in a bar chart, I want to order by the y-axis from low to high.
SELECT Rank, COUNT(Rank) FROM Faculty GROUP BY Rank ORDER BY COUNT(Rank)
nvbench
CREATE TABLE table_12962773_13 ( current_club VARCHAR, player VARCHAR )
Name the current club for player sacha giffa
SELECT current_club FROM table_12962773_13 WHERE player = "Sacha Giffa"
sql_create_context
CREATE TABLE table_12786 ( "Flight Day" text, "Song" text, "Artist" text, "Played for" text, "Links" text )
What links were used on flight day 16?
SELECT "Links" FROM table_12786 WHERE "Flight Day" = 'day 16'
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...
00年7月25日-19年6月25日,患者柳庆雪的768438指标情况
SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_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.YLJG...
css
CREATE TABLE CLASS ( crs_code VARCHAR )
How many courses are offered?
SELECT COUNT(DISTINCT crs_code) FROM CLASS
sql_create_context
CREATE TABLE table_name_17 ( date VARCHAR, score VARCHAR )
On what day was the game that ended in a score of 97-38?
SELECT date FROM table_name_17 WHERE score = "97-38"
sql_create_context
CREATE TABLE table_12438 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is Date, when Home Team is 'Chester City'?
SELECT "Date" FROM table_12438 WHERE "Home team" = 'chester city'
wikisql
CREATE TABLE table_name_31 ( unit VARCHAR, type VARCHAR )
Which unite had the type wwer-440/213?
SELECT unit FROM table_name_31 WHERE type = "wwer-440/213"
sql_create_context
CREATE TABLE table_23191 ( "Player" text, "Games Played" real, "Rebounds" real, "Assists" real, "Steals" real, "Blocks" real, "Points" real )
How many rebounds did Rhonda Mapp make?
SELECT MAX("Rebounds") FROM table_23191 WHERE "Player" = 'Rhonda Mapp'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
give me the number of patients whose ethnicity is white - russian and admission year is less than 2154?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND demographic.admityear < "2154"
mimicsql_data
CREATE TABLE table_name_37 ( power_rpm VARCHAR, torque__nm__rpm VARCHAR )
Tell me the power when the torque is n m (lb ft)/*n m (lb ft) @1750
SELECT power_rpm FROM table_name_37 WHERE torque__nm__rpm = "n·m (lb·ft)/*n·m (lb·ft) @1750"
sql_create_context
CREATE TABLE ref_document_types ( document_type_code text, document_type_name text, document_type_description text ) CREATE TABLE employees ( employee_id number, role_code text, employee_name text, gender_mfu text, date_of_birth time, other_details text ) CREATE TABLE document_loca...
What are the roles with three or more employees? Give me the role codes.
SELECT role_code FROM employees GROUP BY role_code HAVING COUNT(*) >= 3
spider
CREATE TABLE table_2110959_1 ( season VARCHAR, pct__percentage VARCHAR )
In what season was the pct % 0.552?
SELECT season FROM table_2110959_1 WHERE pct__percentage = "0.552"
sql_create_context
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...
在13-09-23到19-11-29内,患者17320230所有检验报告单的审核日期时间给列出来
SELECT jybgb.SHSJ 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 = '17320230' AND jybgb.BGRQ BETWEEN '2013-09-23' AND '2019-11-29' UNION...
css
CREATE TABLE table_name_66 ( in_production VARCHAR, codename VARCHAR )
Is Jasper being producted?
SELECT in_production FROM table_name_66 WHERE codename = "jasper"
sql_create_context
CREATE TABLE table_60033 ( "Letter" text, "American" text, "British" text, "Australian" text, "Examples" text )
What is the Australian for the American ?
SELECT "Australian" FROM table_60033 WHERE "American" = 'ɑ'
wikisql
CREATE TABLE t_kc21 ( MED_CLINIC_ID text, OVERALL_CD_ORG text, OVERALL_CD_PERSON text, COMP_ID text, PERSON_ID text, PERSON_NM text, IDENTITY_CARD text, SOC_SRT_CARD text, PERSON_SEX number, PERSON_AGE number, IN_HOSP_DATE time, OUT_HOSP_DATE time, DIFF_PLACE_FLG numb...
患者16935106有哪些医疗记录被开了853.43元以上的药品?列出医疗就诊编号
SELECT MED_CLINIC_ID FROM t_kc21 WHERE PERSON_ID = '16935106' AND MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc22 WHERE AMOUNT > 853.43)
css
CREATE TABLE table_60049 ( "Draft" real, "Round" text, "Pick" real, "Player" text, "Nationality" text )
Which Player has a Draft of 1994, a Pick larger than 8, a Round of 10, and a Nationality of canada?
SELECT "Player" FROM table_60049 WHERE "Draft" = '1994' AND "Pick" > '8' AND "Round" = '10' AND "Nationality" = 'canada'
wikisql
CREATE TABLE table_67650 ( "Res." text, "Record" text, "Opponent" text, "Type" text, "Rd., Time" text, "Date" text )
What is the record of the match on 2009-07-18?
SELECT "Record" FROM table_67650 WHERE "Date" = '2009-07-18'
wikisql
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE flight ( flno number(4,0), origin var...
Show all origins and the number of flights from each origin with a pie chart.
SELECT origin, COUNT(*) FROM flight GROUP BY origin
nvbench
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
Out of total number of patients admitted before 2198, how many of them were married.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2198"
mimicsql_data
CREATE TABLE table_57939 ( "Year" text, "Driver" text, "Constructor" text, "Category" text, "Location" text, "Report" text )
What company constructed the vehicle when the driver shows as not held?
SELECT "Constructor" FROM table_57939 WHERE "Driver" = 'not held'
wikisql
CREATE TABLE table_24807774_1 ( afghan VARCHAR, arabic VARCHAR )
how many arabic scottish is afghan
SELECT afghan FROM table_24807774_1 WHERE arabic = "Scottish"
sql_create_context
CREATE TABLE student_course_attendance ( student_id VARCHAR, course_id VARCHAR, date_of_attendance VARCHAR ) CREATE TABLE courses ( course_id VARCHAR, course_name VARCHAR )
List the id of students who attended statistics courses in the order of attendance date.
SELECT T2.student_id FROM courses AS T1 JOIN student_course_attendance AS T2 ON T1.course_id = T2.course_id WHERE T1.course_name = "statistics" ORDER BY T2.date_of_attendance
sql_create_context
CREATE TABLE table_name_72 ( shot__percentage INTEGER, country VARCHAR, ends_lost VARCHAR )
What is the sum shot % when the country is finland, and an ends lost is larger than 49?
SELECT SUM(shot__percentage) FROM table_name_72 WHERE country = "finland" AND ends_lost > 49
sql_create_context
CREATE TABLE table_name_50 ( position VARCHAR, name VARCHAR )
What is the position of Allen Gamboa?
SELECT position FROM table_name_50 WHERE name = "allen gamboa"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id t...
find the diagnoses title and description of diagnoses icd9 code 7761.
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.icd9_code = "7761"
mimicsql_data
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE ReviewTaskResultTypes ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAc...
Community Owned posts by User.
SELECT Posts.Id AS "post_link", Posts.Title, Posts.AnswerCount, Posts.CommunityOwnedDate FROM Posts WHERE Posts.OwnerUserId = @UserId AND Posts.CommunityOwnedDate > 0 ORDER BY Posts.CommunityOwnedDate DESC
sede
CREATE TABLE Accounts ( account_id INTEGER, customer_id INTEGER, account_name VARCHAR(50), other_account_details VARCHAR(255) ) CREATE TABLE Financial_Transactions ( transaction_id INTEGER, previous_transaction_id INTEGER, account_id INTEGER, card_id INTEGER, transaction_type VARCHA...
Bar chart x axis customer last name y axis how many customer last name, could you list from high to low by the X-axis?
SELECT customer_last_name, COUNT(customer_last_name) FROM Customers GROUP BY customer_last_name ORDER BY customer_last_name DESC
nvbench
CREATE TABLE table_3284 ( "Player" text, "Position" text, "Starter" text, "Touchdowns" real, "Extra points" real, "Field goals" real, "Points" real )
How many starters are there at right tackle?
SELECT COUNT("Starter") FROM table_3284 WHERE "Position" = 'Right tackle'
wikisql
CREATE TABLE table_29258 ( "Overall rank" real, "Country" text, "Overall life expectancy" real, "Male life expectancy" real, "Male rank" real, "Female life expectancy" real, "Female rank" real )
Name the most female life expectancy for djibouti
SELECT MAX("Female life expectancy") FROM table_29258 WHERE "Country" = 'Djibouti'
wikisql
CREATE TABLE PersonFriend ( name VARCHAR )
Find the person who has exactly one friend.
SELECT name FROM PersonFriend GROUP BY name HAVING COUNT(*) = 1
sql_create_context