context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
Return the average age of captains in each class, and I want to show from high to low by the total number.
SELECT Class, AVG(age) FROM captain GROUP BY Class ORDER BY AVG(age) DESC
nvbench
CREATE TABLE table_203_551 ( id number, "goal" number, "date" text, "venue" text, "opponent" text, "score" text, "result" text, "competition" text )
in what year was szalai 's first international goal ?
SELECT "date" FROM table_203_551 ORDER BY "date" LIMIT 1
squall
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost numbe...
have patient 010-20205 produce any med ct x2?
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-20205')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
eicu
CREATE TABLE table_name_82 ( enrolment INTEGER, founded VARCHAR, denomination VARCHAR, day_boarding VARCHAR )
What is the largest enrollment for anglican day schools founded after 1929?
SELECT MAX(enrolment) FROM table_name_82 WHERE denomination = "anglican" AND day_boarding = "day" AND founded > 1929
sql_create_context
CREATE TABLE table_2960 ( "Vehicle" text, "Operating mode" text, "EPA rated All-electric range" text, "EPA rated combined fuel economy" text, "Clean electric grid California (San Francisco)" text, "U.S. national average electric mix" text, "Dirty electric grid Rocky Mountains (Denver)" text ...
How many clean electric grid california (san francisco) figures are given for the Nissan Leaf?
SELECT COUNT("Clean electric grid California (San Francisco)") FROM table_2960 WHERE "Vehicle" = 'Nissan Leaf'
wikisql
CREATE TABLE table_204_206 ( id number, "saros" number, "member" number, "date" text, "time\n(greatest)\nutc" text, "type" text, "location\nlat,long" text, "gamma" number, "mag." number, "width\n(km)" number, "duration\n(min:sec)" text, "ref" number )
when will the next solar saros be after the may 24 , 2199 solar saros occurs ?
SELECT "date" FROM table_204_206 WHERE "date" > (SELECT "date" FROM table_204_206 WHERE "date" = 'may 24, 2199') ORDER BY "date" LIMIT 1
squall
CREATE TABLE table_71321 ( "School" text, "Location" text, "Total" real, "Crimean War" real, "Persian War" real, "Indian Mutiny" real, "1860-1878" real, "Zulu War" real, "Second Afghan War" text )
Which Crimean War has a 1860-1878 of 0, a Total of 1, and an Indian Mutiny larger than 0?
SELECT "Crimean War" FROM table_71321 WHERE "1860-1878" = '0' AND "Total" = '1' AND "Indian Mutiny" > '0'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime ...
did patient 18866's arterial bp mean on the last icu visit be greater than 69.0?
SELECT COUNT(*) > 0 FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18866) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid IN (SELE...
mimic_iii
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code tex...
tell me the number of hours since patient 006-172277 was admitted to the icu?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '006-172277' AND patient.unitdischargetime IS NULL
eicu
CREATE TABLE table_63523 ( "Club" text, "League" text, "Sport" text, "Venue" text, "Established" real, "Capacity" real )
What is the league established before 1930 with the rayo vallecano club?
SELECT "League" FROM table_63523 WHERE "Established" < '1930' AND "Club" = 'rayo vallecano'
wikisql
CREATE TABLE table_54058 ( "Name" text, "Tenure Begin" text, "Tenure End" real, "British monarch" text, "Czechoslovak president" text )
Who was the President of Czechoslovakia when an ambassador's tenure began in 1950?
SELECT "Czechoslovak president" FROM table_54058 WHERE "Tenure Begin" = '1950'
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 demographic ...
provide the number of patients who have ed route of drug administration and are diagnosed with coronary atherosclerosis of unspecified type of vessel, native or graft.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Cor ath unsp vsl ntv/gft" AND prescriptions.route = "ED"
mimicsql_data
CREATE TABLE table_204_854 ( id number, "#" number, "wrestlers" text, "reign" number, "date" text, "days\nheld" number, "location" text, "notes" text )
what wrestler held the title the longest ?
SELECT "wrestlers" FROM table_204_854 ORDER BY "days\nheld" DESC LIMIT 1
squall
CREATE TABLE table_name_97 ( score VARCHAR, opponent VARCHAR )
For the game against the Washington Bullets, what was the final score?
SELECT score FROM table_name_97 WHERE opponent = "washington bullets"
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 ...
Who 's teaching the ULCS classes next Winter ?
SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr...
advising
CREATE TABLE apartments ( apt_id number, building_id number, apt_type_code text, apt_number text, bathroom_count number, bedroom_count number, room_count text ) CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CRE...
Which apartment type code appears the most often?
SELECT apt_type_code FROM apartments GROUP BY apt_type_code ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE table_203_688 ( id number, "category" text, "speed\n(km/h)" number, "speed\n(mph)" number, "vehicle" text, "pilot" text, "date" text )
who was the pilot of the mit monarch b ?
SELECT "pilot" FROM table_203_688 WHERE "vehicle" = 'mit monarch b'
squall
CREATE TABLE table_204_641 ( id number, "pos" text, "no" number, "driver" text, "constructor" text, "laps" number, "time/retired" text, "grid" number, "points" number )
how many drivers finished at least 40 laps ?
SELECT COUNT("driver") FROM table_204_641 WHERE "laps" >= 40
squall
CREATE TABLE table_27902171_8 ( location_attendance VARCHAR, record VARCHAR )
Name the number of location attendance for 36-29 record
SELECT COUNT(location_attendance) FROM table_27902171_8 WHERE record = "36-29"
sql_create_context
CREATE TABLE table_65531 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Football Class" text, "County" text )
Which IHSAA Football Class has a School of wood memorial?
SELECT "IHSAA Football Class" FROM table_65531 WHERE "School" = 'wood memorial'
wikisql
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varc...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find job_id and the average of employee_id , and group by attribute job_id, and visualize them by a bar chart, rank by the Y-axis in descending.
SELECT JOB_ID, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY AVG(EMPLOYEE_ID) DESC
nvbench
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 the number of patients with primary disease abdominal pain who were aged less than 68 years?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ABDOMINAL PAIN" AND demographic.age < "68"
mimicsql_data
CREATE TABLE table_25374338_1 ( song_choice VARCHAR, original_artist VARCHAR )
What is the song choice where the original artist is Gino Paoli?
SELECT COUNT(song_choice) FROM table_25374338_1 WHERE original_artist = "Gino Paoli"
sql_create_context
CREATE TABLE table_18436 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Who was the incumbent in the Arkansas 2 district election?
SELECT "Incumbent" FROM table_18436 WHERE "District" = 'Arkansas 2'
wikisql
CREATE TABLE table_14564 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Which Date has an Opponent of @ mariners, and a Loss of hern ndez (0-1)?
SELECT "Date" FROM table_14564 WHERE "Opponent" = '@ mariners' AND "Loss" = 'hernández (0-1)'
wikisql
CREATE TABLE table_name_86 ( jury INTEGER, place VARCHAR, total VARCHAR )
What is the total of the jury that is 2nd place and the total is larger than 190?
SELECT SUM(jury) FROM table_name_86 WHERE place = "2nd" AND total > 190
sql_create_context
CREATE TABLE table_name_9 ( constructor VARCHAR, laps VARCHAR, grid VARCHAR )
What is the name of the constructor who has more than 50 laps and a grid of 7?
SELECT constructor FROM table_name_9 WHERE laps > 50 AND grid = 7
sql_create_context
CREATE TABLE table_21061 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter" text, "Year named" real, "Namesake" text )
When the longitude is 147.1w what is the namesake of the feature?
SELECT "Namesake" FROM table_21061 WHERE "Longitude" = '147.1W'
wikisql
CREATE TABLE table_name_55 ( constructor VARCHAR, driver VARCHAR )
who is the constructor when the driver is jenson button?
SELECT constructor FROM table_name_55 WHERE driver = "jenson button"
sql_create_context
CREATE TABLE table_204_679 ( id number, "place" text, "player" text, "country" text, "score" text, "to par" number, "money ($)" number )
which player placed above lawson little ?
SELECT "player" FROM table_204_679 WHERE "place" = (SELECT "place" FROM table_204_679 WHERE "player" = 'lawson little') - 1
squall
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
how much is the minimum total hospital cost that includes hypernatremia - etiology unknown?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT diagnosis.patientunitstayid FROM diagnosis WHERE diagnosis.diagnosisname = 'hypernatremia - etiology unknown')) GROUP BY...
eicu
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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,...
名为曹欣德的这位患者被门诊诊断为疾病Y51.041,查一下编号为909845检测指标的结果定量及其单位
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 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...
how many patients with arthropathy nos-unspec had a blood test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Arthropathy NOS-unspec" AND lab.fluid = "Blood"
mimicsql_data
CREATE TABLE table_2251578_4 ( province VARCHAR, elevation__m_ VARCHAR )
Which province has an elevation of 4550?
SELECT province FROM table_2251578_4 WHERE elevation__m_ = 4550
sql_create_context
CREATE TABLE table_28777 ( "Year (Ceremony)" text, "English title" text, "Arabic title" text, "Director" text, "Result" text )
When is the arabic title what is the english title?
SELECT "English title" FROM table_28777 WHERE "Arabic title" = 'ملح هذا البحر'
wikisql
CREATE TABLE table_name_64 ( finish VARCHAR, start VARCHAR, year VARCHAR, team VARCHAR )
What was the result after 1994 for team MB2 and 31 starts?
SELECT finish FROM table_name_64 WHERE year > 1994 AND team = "mb2" AND start = "31"
sql_create_context
CREATE TABLE table_204_541 ( id number, "name" text, "area" text, "height" text, "floors" number, "year" number )
how many of the 7 tallest buildings in kanpur , india were built before 2010 ?
SELECT COUNT("name") FROM table_204_541 WHERE "year" < 2010
squall
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...
Bar chart of school_id from each all games, and I want to sort total number from high to low order please.
SELECT All_Games, School_ID FROM basketball_match ORDER BY School_ID DESC
nvbench
CREATE TABLE table_15847 ( "Order Year" text, "Manufacturer" text, "Model" text, "Fleet Series (Quantity)" text, "Powertrain (Engine/Transmission)" text, "Fuel Propulsion" text )
who is the manufacturer for the order year 1998?
SELECT "Manufacturer" FROM table_15847 WHERE "Order Year" = '1998'
wikisql
CREATE TABLE table_name_80 ( byes INTEGER, wins VARCHAR, against VARCHAR, ntfa_div_2 VARCHAR )
Which Byes have an Against smaller than 1647, and an NTFA Div 2 of fingal valley, and Wins smaller than 14?
SELECT MAX(byes) FROM table_name_80 WHERE against < 1647 AND ntfa_div_2 = "fingal valley" AND wins < 14
sql_create_context
CREATE TABLE table_32199 ( "Round" real, "Overall" real, "Player" text, "Position" text, "School/Club Team" text )
In which round did Paul McDonald have an overall greater than 109?
SELECT MAX("Round") FROM table_32199 WHERE "Player" = 'paul mcdonald' AND "Overall" > '109'
wikisql
CREATE TABLE table_39555 ( "Paul McCartney" text, "Stuart" text, "McIntosh" text, "Whitten" text, "Linda McCartney" text )
Which Linda McCartney has a Stuart of electric guitar?
SELECT "Linda McCartney" FROM table_39555 WHERE "Stuart" = 'electric guitar'
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 ...
Over the next 2 years , is 353 offered ?
SELECT DISTINCT semester.semester, semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 353 AND semester.semester_id = course_offering.semester AND semester.year IN (2016, 2017)
advising
CREATE TABLE store ( store_id number, store_name text, type text, area_size number, number_of_product_category number, ranking number ) CREATE TABLE store_district ( store_id number, district_id number ) CREATE TABLE district ( district_id number, district_name text, headqu...
Find the name all districts with city area greater than 10 or population larger than 100000
SELECT district_name FROM district WHERE city_area > 10 OR city_population > 100000
spider
CREATE TABLE table_1971074_1 ( joined VARCHAR, location VARCHAR )
In how many different years did schools located in Logan Township, Pennsylvania join the Conference?
SELECT COUNT(joined) FROM table_1971074_1 WHERE location = "Logan Township, Pennsylvania"
sql_create_context
CREATE TABLE table_50195 ( "Player" text, "Country" text, "Year(s) won" real, "Total" real, "To par" real, "Finish" text )
What is Finish, when To Par is greater than 6, and when Year(s) Won is before 1961?
SELECT "Finish" FROM table_50195 WHERE "To par" > '6' AND "Year(s) won" < '1961'
wikisql
CREATE TABLE table_48925 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Which Week has a Date of december 8, 1991?
SELECT AVG("Week") FROM table_48925 WHERE "Date" = 'december 8, 1991'
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 demographic ...
give me the number of patients less than 41 years who have delta abnormal lab test status.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.flag = "delta"
mimicsql_data
CREATE TABLE table_name_16 ( attendance VARCHAR, date VARCHAR, week VARCHAR )
How many attendances have October 30, 1977 as the date, with a week greater than 7?
SELECT COUNT(attendance) FROM table_name_16 WHERE date = "october 30, 1977" AND week > 7
sql_create_context
CREATE TABLE table_name_59 ( water_depth VARCHAR, location VARCHAR, name VARCHAR )
What is the water depth of Sedco 702, located in Nigeria?
SELECT water_depth FROM table_name_59 WHERE location = "nigeria" AND name = "sedco 702"
sql_create_context
CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time...
Plot the number of home city by grouped by home city as a bar graph
SELECT Home_city, COUNT(Home_city) FROM driver GROUP BY Home_city
nvbench
CREATE TABLE table_38549 ( "Event" text, "2006\u201307" text, "2007\u201308" text, "2008\u201309" text, "2009\u201310" text, "2010\u201311" text, "2012\u201313" text )
Which 2008 09 has an Event of autumn gold?
SELECT "2008\u201309" FROM table_38549 WHERE "Event" = 'autumn gold'
wikisql
CREATE TABLE table_2068 ( "Role" text, "Original Broadway Cast" text, "Current Broadway Cast" text, "Original Toronto Cast" text, "First National Tour Cast" text, "Original Australian Cast" text, "Original West End Cast" text, "Current West End Cast" text, "Second National Tour Cast"...
What member of the original Toronto cast played the character played by Constantine Maroulis in the first national tour cast?
SELECT "Original Toronto Cast" FROM table_2068 WHERE "First National Tour Cast" = 'Constantine Maroulis'
wikisql
CREATE TABLE table_20396_1 ( poles VARCHAR, points VARCHAR )
How many poles had 78 points?
SELECT COUNT(poles) FROM table_20396_1 WHERE points = "78"
sql_create_context
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_ID number ) CREATE TABLE t_kc24 ( ACCOUNT_DASH_DATE time, ACCOUNT_DASH_FLG number, CASH_PAY number, CIVIL_SUBSIDY number, CKC102 number, CLINIC_ID text, CLINIC_SLT_DATE time, COMP_ID text, COM_ACC_PAY number, C...
药品767790125-w在医疗就诊01085834154中的医疗机构三大目录编码及名称都是什么?
SELECT t_kc22.MED_DIRE_CD, t_kc22.MED_DIRE_NM FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '01085834154' AND t_kc22.SOC_SRT_DIRE_CD = '767790125-w'
css
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
give me the number of patients less than 50 years who have diagnoses icd9 code 5849.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "50" AND diagnoses.icd9_code = "5849"
mimicsql_data
CREATE TABLE table_name_72 ( year INTEGER, nation_represented VARCHAR )
What is the latest result where a person from the Philippines won?
SELECT MAX(year) FROM table_name_72 WHERE nation_represented = "philippines"
sql_create_context
CREATE TABLE table_66546 ( "Draw" real, "Song" text, "Jury" real, "Televote" real, "Total" real, "Place" text )
What is the total of the jury that is 2nd place and the total is larger than 190?
SELECT SUM("Jury") FROM table_66546 WHERE "Place" = '2nd' AND "Total" > '190'
wikisql
CREATE TABLE table_name_37 ( race_name VARCHAR, circuit VARCHAR )
What is the name of the race for which the circuit was Snetterton?
SELECT race_name FROM table_name_37 WHERE circuit = "snetterton"
sql_create_context
CREATE TABLE ReviewRejectionReasons ( Id number, Name text, Description text, PostTypeId number ) CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswer...
Nr of discrete users posting questions about dotnetnuke per month.
SELECT x.Yr, x.Qr, COUNT(x.Id) AS NrPosts FROM (SELECT p.Id, YEAR(p.CreationDate) AS Yr, TIME_TO_STR(p.CreationDate, '%q') AS Qr FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id WHERE p.CreationDate > '2015-01-01' AND t.TagName = 'dotnetnuke') AS x GROUP BY x.Yr, x.Q...
sede
CREATE TABLE table_14515 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Name the date for postponed attendance
SELECT "Date" FROM table_14515 WHERE "Attendance" = 'postponed'
wikisql
CREATE TABLE table_204_650 ( id number, "season" number, "level" number, "name" text, "position" text, "nationality" text, "international\ncaps" number )
which country had the most people named player of the year ?
SELECT "nationality" FROM table_204_650 GROUP BY "nationality" ORDER BY COUNT("name") DESC LIMIT 1
squall
CREATE TABLE table_48747 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
Who was the player from the United States in T10 place with a score of 67-77=144?
SELECT "Player" FROM table_48747 WHERE "Country" = 'united states' AND "Place" = 't10' AND "Score" = '67-77=144'
wikisql
CREATE TABLE table_64017 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the sum of bronzes for teams with more than 0 silver and a total under 1?
SELECT SUM("Bronze") FROM table_64017 WHERE "Silver" > '0' AND "Total" < '1'
wikisql
CREATE TABLE musical ( Musical_ID int, Name text, Year int, Award text, Category text, Nominee text, Result text ) CREATE TABLE actor ( Actor_ID int, Name text, Musical_ID int, Character text, Duration text, age int )
Show names of musicals and the number of actors who have appeared in the musicals Show bar chart, and display Y-axis in ascending order please.
SELECT T2.Name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.Musical_ID = T2.Musical_ID GROUP BY T1.Musical_ID ORDER BY COUNT(*)
nvbench
CREATE TABLE table_2983 ( "Member State" text, "Population in thousands" text, "Population % of EU" text, "Area km 2" real, "Area % of EU" text, "Pop. density People/km 2" text )
How many inhabitants does Sweden have per square kilometer?
SELECT "Pop. density People/km 2" FROM table_2983 WHERE "Member State" = 'Sweden'
wikisql
CREATE TABLE table_73188 ( "Series #" real, "Episode #" real, "Title" text, "Directed by" text, "Written by" text, "Original airdate" text )
What was the title for episode 2?
SELECT "Title" FROM table_73188 WHERE "Episode #" = '2'
wikisql
CREATE TABLE table_5113 ( "Series Ep." text, "Episode" real, "Segment A" text, "Segment B" text, "Segment C" text, "Segment D" text )
What is Segment D of 20-08 series Ep.?
SELECT "Segment D" FROM table_5113 WHERE "Series Ep." = '20-08'
wikisql
CREATE TABLE table_name_69 ( lane INTEGER, name VARCHAR, time VARCHAR )
What is the lowest lane with Lorenzo Vismara and a time higher than 49.67?
SELECT MIN(lane) FROM table_name_69 WHERE name = "lorenzo vismara" AND time > 49.67
sql_create_context
CREATE TABLE table_9106 ( "Position" real, "Played" real, "Points" real, "Wins" real, "Draws" real, "Losses" real, "Goals for" real, "Goals against" real, "Goal Difference" real )
What is the average draws with less than 3 wins and more than 5 points?
SELECT AVG("Draws") FROM table_9106 WHERE "Wins" < '3' AND "Points" > '5'
wikisql
CREATE TABLE table_name_38 ( year INTEGER, result VARCHAR, nominee_s_ VARCHAR )
What is the latest year when Neal Baer was a nominee, and the result was nominated?
SELECT MAX(year) FROM table_name_38 WHERE result = "nominated" AND nominee_s_ = "neal baer"
sql_create_context
CREATE TABLE table_name_80 ( tournament VARCHAR )
Which 2010 has a Tournament of australian open?
SELECT 2010 FROM table_name_80 WHERE tournament = "australian open"
sql_create_context
CREATE TABLE table_41628 ( "Name" text, "Career" text, "Goals" real, "Appearances" real, "Goals/Game Ratio" real )
What is the sum of Rob Coldray's goals when he made fewer than 348 appearances with goals/game ratio less than 0.313?
SELECT SUM("Goals") FROM table_41628 WHERE "Goals/Game Ratio" < '0.313' AND "Name" = 'rob coldray' AND "Appearances" < '348'
wikisql
CREATE TABLE table_name_66 ( played INTEGER, against VARCHAR, lost VARCHAR, difference VARCHAR )
Which Played is the highest one that has a Lost smaller than 1, and a Difference of 6, and an Against larger than 2?
SELECT MAX(played) FROM table_name_66 WHERE lost < 1 AND difference = "6" AND against > 2
sql_create_context
CREATE TABLE table_27827 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" text )
What are the number in series of the pieces directed by Win Phelps and which number in season is 11?
SELECT "No. in series" FROM table_27827 WHERE "Directed by" = 'Win Phelps' AND "No. in season" = '11'
wikisql
CREATE TABLE table_20098199_2 ( representative VARCHAR, religion VARCHAR, prior_background VARCHAR )
Who has a religion of United Methodist and a prior background of a Congressional Aide?
SELECT representative FROM table_20098199_2 WHERE religion = "United Methodist" AND prior_background = "Congressional aide"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_nu...
ground transportation in OAKLAND
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'OAKLAND' AND ground_service.city_code = city.city_code
atis
CREATE TABLE table_name_72 ( to_par VARCHAR, player VARCHAR )
What is the to par that has bill collins as the player?
SELECT to_par FROM table_name_72 WHERE player = "bill collins"
sql_create_context
CREATE TABLE project_staff ( staff_id number, project_id number, role_code text, date_from time, date_to time, other_details text ) CREATE TABLE research_outcomes ( outcome_code text, outcome_description text ) CREATE TABLE organisations ( organisation_id number, organisation_t...
Which projects have no outcome? List the project details.
SELECT project_details FROM projects WHERE NOT project_id IN (SELECT project_id FROM project_outcomes)
spider
CREATE TABLE table_51801 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Series" text )
What is the combined crowd in Vancouver on may 22?
SELECT SUM("Attendance") FROM table_51801 WHERE "Home" = 'vancouver' AND "Date" = 'may 22'
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the number of patients whose admission year is less than 2152 and diagnoses short title is malnutrition mild degree?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2152" AND diagnoses.short_title = "Malnutrition mild degree"
mimicsql_data
CREATE TABLE table_name_41 ( round INTEGER, pick VARCHAR )
Name the sum of round for pick of 169
SELECT SUM(round) FROM table_name_41 WHERE pick = 169
sql_create_context
CREATE TABLE table_name_34 ( record VARCHAR, game VARCHAR, december VARCHAR )
Which Record has a Game larger than 32, and a December smaller than 21?
SELECT record FROM table_name_34 WHERE game > 32 AND december < 21
sql_create_context
CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE company ( Company_ID int, Rank i...
Find the rank of the companies in the banking industry order by their sales and profits in billion with a bar chart.
SELECT Company, Rank FROM company WHERE Main_Industry = 'Banking' ORDER BY Sales_billion, Profits_billion
nvbench
CREATE TABLE table_65409 ( "Date" text, "Internet Explorer" text, "Chrome" text, "Firefox" text, "Safari" text )
What was the firefox % was chrome was 25.08%?
SELECT "Firefox" FROM table_65409 WHERE "Chrome" = '25.08%'
wikisql
CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number...
select distinct u.Id , Reputation, DisplayName, WebsiteUrl, AboutMe, Views from Users u inner join.
SELECT DISTINCT u.Id, Reputation, DisplayName, WebsiteUrl, AboutMe, Views FROM Users AS u INNER JOIN Comments AS c ON c.UserId = u.Id WHERE u.Location LIKE '%new york%'
sede
CREATE TABLE table_name_96 ( gp_gs VARCHAR, total_points VARCHAR, year VARCHAR )
what was the gp/gs in 2003 when the total points was 'did not play'?
SELECT gp_gs FROM table_name_96 WHERE total_points = "did not play" AND year = "2003"
sql_create_context
CREATE TABLE table_name_70 ( silver INTEGER, gold VARCHAR, total VARCHAR )
What is listed as the highest Silver that also has a Gold of 4 and a Total that's larger than 25?
SELECT MAX(silver) FROM table_name_70 WHERE gold = 4 AND total > 25
sql_create_context
CREATE TABLE table_63533 ( "Club" text, "Wins" real, "Losses" real, "Draws" real, "Against" real )
What are the draws of Cobden when there are more than 3 losses?
SELECT AVG("Draws") FROM table_63533 WHERE "Losses" > '3' AND "Club" = 'cobden'
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...
在门诊诊断为疾病T69.925的这些患者的籍贯代码、名称都是什么以及相应人数是多少?
SELECT person_info.JGDM, person_info.JGMC, COUNT(person_info.RYBH) FROM person_info JOIN hz_info JOIN zzmzjzjlb 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 WHERE zzmzjzjlb.JZZDBM = 'T69.925' GROUP BY person_info.JGDM UNION SELECT...
css
CREATE TABLE table_204_603 ( id number, "pos" text, "no" number, "rider" text, "bike" text, "laps" number, "time" text, "grid" number, "points" number )
which rider finished first ?
SELECT "rider" FROM table_204_603 WHERE "pos" = 1
squall
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...
患者29261183在2011年5月8日至18年3月30日内被开出的所有检验报告单的科室编码还有名称能列出都是什么吗?
SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '29261183' AND jybgb.BGRQ BETWEEN '2011-05-08...
css
CREATE TABLE table_name_56 ( call_sign VARCHAR, erp_w INTEGER )
What is Call Sign, when ERP W is greater than 50?
SELECT call_sign FROM table_name_56 WHERE erp_w > 50
sql_create_context
CREATE TABLE undergoes ( patient number, procedures number, stay number, dateundergoes time, physician number, assistingnurse number ) CREATE TABLE procedures ( code number, name text, cost number ) CREATE TABLE trained_in ( physician number, treatment number, certifica...
What is the names of the physicians who prescribe medication Thesisin?
SELECT DISTINCT T1.name FROM physician AS T1 JOIN prescribes AS T2 ON T1.employeeid = T2.physician JOIN medication AS T3 ON T3.code = T2.medication WHERE T3.name = "Thesisin"
spider
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...
从0三年四月八日到一三年一月六日,患者华悦欣接受检查的次数有多少
SELECT COUNT(*) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '华悦欣' AND t_kc22.STA_DATE BETWEEN '2003-04-08' AND '2013-01-06' AND t_kc22.MED_INV_ITEM_TYPE = '检查费'
css
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE ReviewRejectionReasons ( Id number, Na...
Bronze badges for Ruby in London.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Users.Id AS "user_link", Reputation, Location FROM Users, Badges WHERE Users.Id = Badges.UserId AND Badges.Class = 3 AND Badges.TagBased = 1 AND Badges.Name = 'ruby' AND LOWER(Users.Location) LIKE LOWER('%London%') ORDER BY Reputation DESC
sede
CREATE TABLE table_name_66 ( city VARCHAR, building VARCHAR )
Which city contains Telus Plaza South?
SELECT city FROM table_name_66 WHERE building = "telus plaza south"
sql_create_context
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, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
What number of patients diagnosed with hyperacusis had a lab test for blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Hyperacusis" AND lab."CATEGORY" = "Blood Gas"
mimicsql_data
CREATE TABLE table_41123 ( "Rank" real, "Municipality" text, "Population (2010 Census)" real, "Population (2005 Census)" real, "Population (2000 Census)" real )
What is the lowest population (2010 Census) that has a rank smaller than 45, municipality of gimpo, and populaion (2000 Census) larger than 117,594?
SELECT MIN("Population (2010 Census)") FROM table_41123 WHERE "Population (2000 Census)" > '117,594' AND "Municipality" = 'gimpo' AND "Rank" < '45'
wikisql
CREATE TABLE table_20754016_2 ( height__cm_ VARCHAR, country VARCHAR )
How tall is the contestant from Guatemala?
SELECT height__cm_ FROM table_20754016_2 WHERE country = "Guatemala"
sql_create_context