context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_name_76 ( country VARCHAR, score VARCHAR )
What country scored 67?
SELECT country FROM table_name_76 WHERE score = 67
sql_create_context
CREATE TABLE table_name_6 ( first_match VARCHAR, final_position VARCHAR, competition VARCHAR )
What was the date of the first match of the Fifa Club World Cup that ended with the final position as winners?
SELECT first_match FROM table_name_6 WHERE final_position = "winners" AND competition = "fifa club world cup"
sql_create_context
CREATE TABLE table_name_41 ( category VARCHAR, year VARCHAR )
Which category had a year of 1991?
SELECT category FROM table_name_41 WHERE year = 1991
sql_create_context
CREATE TABLE table_1320857_1 ( je_armstrong VARCHAR, wh_archer VARCHAR )
Who is J.E. Armstrong when W.H. Archer is D.M. Lawson?
SELECT je_armstrong FROM table_1320857_1 WHERE wh_archer = "D.M. Lawson"
sql_create_context
CREATE TABLE table_8855 ( "Pick" real, "Player" text, "Position" text, "Nationality" text, "Former Team" text )
Which Nationality has a Former Team of denver nuggets?
SELECT "Nationality" FROM table_8855 WHERE "Former Team" = 'denver nuggets'
wikisql
CREATE TABLE HOTELS ( pets_allowed_yn VARCHAR, price_range INTEGER )
Show the average price of hotels for different pet policy.
SELECT pets_allowed_yn, AVG(price_range) FROM HOTELS GROUP BY pets_allowed_yn
sql_create_context
CREATE TABLE table_25854 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Series" text )
Name the location attendance for dirk nowitzki , caron butler (17)
SELECT "Location Attendance" FROM table_25854 WHERE "High points" = 'Dirk Nowitzki , Caron Butler (17)'
wikisql
CREATE TABLE table_43260 ( "Week of" text, "Tier" text, "Winner" text, "Runner-up" text, "Semi finalists" text )
When Gigi Fern ndez Natalia Zvereva 6 2, 6 1 won, who was the Tier II Runner-up?
SELECT "Runner-up" FROM table_43260 WHERE "Tier" = 'tier ii' AND "Winner" = 'gigi fernández natalia zvereva 6–2, 6–1'
wikisql
CREATE TABLE table_76883 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Location" text, "Record" text )
How many games have a score of 85-92?
SELECT COUNT("Game") FROM table_76883 WHERE "Score" = '85-92'
wikisql
CREATE TABLE table_name_8 ( gold INTEGER, rank VARCHAR, silver VARCHAR )
What is the least number of gold medals won among nations ranked 1 with no silver medals?
SELECT MIN(gold) FROM table_name_8 WHERE rank = 1 AND silver < 1
sql_create_context
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, ...
what are the four most frequent drugs that were prescribed in the same month to the patients aged 20s after they had been diagnosed with atrial fibrillation in this year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE ...
mimic_iii
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 ...
Will 351 be taught by Prof. Jonathan Brumit next semester ?
SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 351 AND instructor.name LIKE '%Jonathan Brumit%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering...
advising
CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, admission_type text, days_stay text, insurance text, ethnicity text, expire_flag text, admission_location t...
what is average age of patients whose insurance is private and days of hospital stay is 7?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.insurance = "Private" AND demographic.days_stay = "7"
mimicsql_data
CREATE TABLE table_name_61 ( class VARCHAR, part_2 VARCHAR )
What was the class when part 2 was *h t?
SELECT class FROM table_name_61 WHERE part_2 = "*hēt"
sql_create_context
CREATE TABLE table_name_28 ( game INTEGER, score VARCHAR )
Which Game has a Score of 101-109 (ot)?
SELECT AVG(game) FROM table_name_28 WHERE score = "101-109 (ot)"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
what is date of birth of subject name shawn green?
SELECT demographic.dob FROM demographic WHERE demographic.name = "Shawn Green"
mimicsql_data
CREATE TABLE table_49036 ( "Name" text, "Team" text, "Qual 1" text, "Qual 2" text, "Best" text )
What is Name, when Best is 1:15.673?
SELECT "Name" FROM table_49036 WHERE "Best" = '1:15.673'
wikisql
CREATE TABLE Sportsinfo ( StuID VARCHAR, hoursperweek INTEGER )
Show all student IDs with more than total 10 hours per week on all sports played.
SELECT StuID FROM Sportsinfo GROUP BY StuID HAVING SUM(hoursperweek) > 10
sql_create_context
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, ...
Which courses am I required to take prior to UC 325 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT...
advising
CREATE TABLE table_62071 ( "Tournament" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text )
What is the 2002 result where 2011 and 2000 are 1R?
SELECT "2002" FROM table_62071 WHERE "2011" = '1r' AND "2000" = '1r'
wikisql
CREATE TABLE table_204_937 ( id number, "rank" number, "lane" number, "athlete" text, "time" number )
who placed after manjeet kaur ?
SELECT "athlete" FROM table_204_937 WHERE id = (SELECT id FROM table_204_937 WHERE "athlete" = 'manjeet kaur') + 1
squall
CREATE TABLE table_13024 ( "Rank" real, "Map Reference Number" real, "Census Statistical Area" text, "2007 Population" real, "Lake(s)" text )
What is the map reference number for Lake Superior with a larger population than 65,216
SELECT COUNT("Map Reference Number") FROM table_13024 WHERE "Lake(s)" = 'lake superior' AND "2007 Population" > '65,216'
wikisql
CREATE TABLE jyjgzbb ( JYZBLSH text, YLJGDM text, BGDH text, BGRQ time, JYRQ time, JCRGH text, JCRXM text, SHRGH text, SHRXM text, JCXMMC text, JCZBDM text, JCFF text, JCZBMC text, JCZBJGDX text, JCZBJGDL number, JCZBJGDW text, SBBM text, YQBH text...
编号为63566626307检验报告单的标本代码、名称、状态都是什么?
SELECT BBDM, BBMC, BBZT FROM jybgb WHERE BGDH = '63566626307'
css
CREATE TABLE table_31625 ( "Year" text, "Men's singles" text, "Women's singles" text, "Men's doubles" text, "Women's doubles" text )
Who played men's doubles when men's singles were played by wong peng soon and Women's singles was played by cecilia samuel, in 1952?
SELECT "Men's doubles" FROM table_31625 WHERE "Men's singles" = 'wong peng soon' AND "Women's singles" = 'cecilia samuel' AND "Year" = '1952'
wikisql
CREATE TABLE course_offering ( offering_id int, course_id int, semester int, section_number int, start_time time, end_time time, monday varchar, tuesday varchar, wednesday varchar, thursday varchar, friday varchar, saturday varchar, sunday varchar, has_final_proje...
Am I eligible for ASIAN 594 in Spring semester ?
SELECT COUNT(*) > 0 FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE table_33163 ( "Country" text, "Date" text, "Label" text, "Format" text, "Catalogue" text )
What format does Japan use?
SELECT "Format" FROM table_33163 WHERE "Country" = 'japan'
wikisql
CREATE TABLE table_name_67 ( pick__number VARCHAR, college VARCHAR )
How many picks did the College of USC wind up getting?
SELECT COUNT(pick__number) FROM table_name_67 WHERE college = "usc"
sql_create_context
CREATE TABLE table_name_2 ( date VARCHAR, opponent VARCHAR, match VARCHAR, ground VARCHAR )
On what date was the match higher than 8 on ground A against Guiseley?
SELECT date FROM table_name_2 WHERE match > 8 AND ground = "a" AND opponent = "guiseley"
sql_create_context
CREATE TABLE mzb ( CLINIC_ID text, COMP_ID text, DATA_ID text, DIFF_PLACE_FLG number, FERTILITY_STS number, FLX_MED_ORG_ID text, HOSP_LEV number, HOSP_STS number, IDENTITY_CARD text, INPT_AREA_BED text, INSURED_IDENTITY number, INSURED_STS text, INSU_TYPE text, IN...
名叫王芳茵的参保人住院时支付的金额中有多少次是整数?
SELECT COUNT(*) FROM zyb WHERE zyb.PERSON_SEX = '王芳茵' AND MOD(zyb.MED_CLINIC_ID, 1) = 0
css
CREATE TABLE table_25372 ( "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 )
How many rebound did the person who scored 147 points have?
SELECT COUNT("Rebounds") FROM table_25372 WHERE "Points" = '147'
wikisql
CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER, city_code VARCHAR(3) ) CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), ...
What is the last name of each student who is not allergic to any type of food? Count them with a bar chart.
SELECT LName, COUNT(LName) FROM Student WHERE NOT StuID IN (SELECT T1.StuID FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy WHERE T2.AllergyType = "food") GROUP BY LName
nvbench
CREATE TABLE table_57832 ( "Name" text, "Years" text, "Gender" text, "Area" text, "Authority" text, "Decile" real, "Roll" real )
What was the sum roll of Karaka area?
SELECT SUM("Roll") FROM table_57832 WHERE "Area" = 'karaka'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, ...
on 06/22/last year', what was average arterial bp [diastolic] of patient 25523?
SELECT AVG(chartevents.valuenum) 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 = 25523)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte...
mimic_iii
CREATE TABLE table_204_918 ( id number, "week" number, "date" text, "opponent" text, "result" text, "record" text, "attendance" number, "bye" text )
what is the total number of points scored ?
SELECT SUM("result" + "result") FROM table_204_918
squall
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, ...
matlab questions with a close flag/vote.
SELECT DISTINCT pt.PostId AS "post_link" FROM PostTags AS pt INNER JOIN PendingFlags AS pf ON pf.PostId = pt.PostId AND pf.FlagTypeId IN (13, 14) INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE t.TagName = 'outlook'
sede
CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wardid number, admissionheight number, admissionweight number, dischargeweight number, hospitaladmittime time, ...
has volume (ml) heparin been given to patient 030-4181 in 06/last year?
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 = '030-4181')) AND intakeoutput.cellpath LIKE '%intake%' AND intakeoutput...
eicu
CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE swimme...
Give me the comparison about the average of meter_100 over the meter_200 , and group by attribute meter_200.
SELECT meter_200, AVG(meter_100) FROM swimmer GROUP BY meter_200
nvbench
CREATE TABLE table_name_64 ( original_air_date VARCHAR, production_code VARCHAR )
What is the air date for the episode with production code ad1c13?
SELECT original_air_date FROM table_name_64 WHERE production_code = "ad1c13"
sql_create_context
CREATE TABLE table_21034801_1 ( game INTEGER, record VARCHAR )
What was the numer of the game when the record was 4-0?
SELECT MAX(game) FROM table_21034801_1 WHERE record = "4-0"
sql_create_context
CREATE TABLE table_26144632_1 ( prize_fund___¥__ VARCHAR, location VARCHAR )
What is the prize for the tournament at Ibaraki?
SELECT prize_fund___¥__ FROM table_26144632_1 WHERE location = "Ibaraki"
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 procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give the number of patients whose drug type is base and lab test name is red blood cells.
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.drug_type = "BASE" AND lab.label = "Red Blood Cells"
mimicsql_data
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuo...
when is the first time that patient 14671 has the maximum arterial bp mean value on the current icu visit?
SELECT chartevents.charttime 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 = 14671) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WH...
mimic_iii
CREATE TABLE table_name_95 ( city_of_license VARCHAR, call_sign VARCHAR )
Name the city of license for call sign of kcmp
SELECT city_of_license FROM table_name_95 WHERE call_sign = "kcmp"
sql_create_context
CREATE TABLE film_text ( film_id SMALLINT, title VARCHAR(255), description TEXT ) CREATE TABLE language ( language_id TINYINT UNSIGNED, name CHAR(20), last_update TIMESTAMP ) CREATE TABLE film ( film_id SMALLINT UNSIGNED, title VARCHAR(255), description TEXT, release_year YEAR,...
Find all the payment dates for the payments with an amount larger than 10 and the payments handled by a staff person with the first name Elsa, and count them by a bar chart, order Y in desc order.
SELECT payment_date, COUNT(payment_date) FROM payment WHERE amount > 10 UNION SELECT T1.payment_date FROM payment AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = 'Elsa' ORDER BY COUNT(payment_date) DESC
nvbench
CREATE TABLE table_22265261_1 ( age VARCHAR, sp VARCHAR )
How old was the horse when the SP was 200/1?
SELECT COUNT(age) FROM table_22265261_1 WHERE sp = "200/1"
sql_create_context
CREATE TABLE table_204_812 ( id number, "#" number, "prime minister" text, "date of birth" text, "start date\nof (first) term" text, "age at beginning\nof (first) term" text, "end date\nof (final) term" text, "total time in\noffice" text, "date of death" text, "lifespan" text )
was edmund barton or alfred deakin younger at the beginning of his first term ?
SELECT "prime minister" FROM table_204_812 WHERE "prime minister" IN ('edmund barton', 'alfred deakin') ORDER BY "age at beginning\nof (first) term" LIMIT 1
squall
CREATE TABLE table_204_922 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
who was the only nation with 5 gold medals ?
SELECT "nation" FROM table_204_922 WHERE "gold" = 5
squall
CREATE TABLE date_day ( month_number int, day_number int, year int, day_name varchar ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE equipment_sequence ( aircraft_code_sequence varchar, aircraft_code varchar ) CREATE TABLE aircraft ( aircraft_code varchar,...
what 's the earliest flight from SAN FRANCISCO to BOSTON
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = ...
atis
CREATE TABLE table_9355 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High assists" text, "Location Attendance" text, "Record" text )
What are the High assists for Team houston?
SELECT "High assists" FROM table_9355 WHERE "Team" = 'houston'
wikisql
CREATE TABLE table_51223 ( "Jurisdiction" text, "For Prohibition" real, "Percent For" real, "Against Prohibition" real, "Percent Against" real )
What is the highest percent supporting prohibition when the number opposing is less than 2,978 and the percent opposing is less than 31.2 while the number supporting is less than 9,461?
SELECT MAX("Percent For") FROM table_51223 WHERE "Against Prohibition" < '2,978' AND "Percent Against" < '31.2' AND "For Prohibition" < '9,461'
wikisql
CREATE TABLE table_name_95 ( fleet_number VARCHAR, model VARCHAR )
What is the fleet number for the model of Gillig Phantom 3096TB?
SELECT fleet_number FROM table_name_95 WHERE model = "gillig phantom 3096tb"
sql_create_context
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TAB...
please give me the flights from KANSAS CITY to CHICAGO on 6 16
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'CHICAGO' AND date_day.day_number = 16 AND date_day.month_number = 6 AND d...
atis
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
自2009年12月28起,到2021年9月30日,编号为68417064的患者在医疗机构1278762看过几次门诊
SELECT COUNT(*) 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 = '68417064' AND mzjzjlb.JZKSRQ BETWEEN '2009-12-28' AND '2021-09-30' AND mzjzjlb.YLJGDM = '1278762'
css
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistory ( Id number, PostHistoryTypeId number, PostId number, RevisionGUID other, CreationDate time, U...
Accepted answers to questions by now-anonymous users.
SELECT a.Id AS "post_link" FROM Posts AS a INNER JOIN Posts AS q ON q.AcceptedAnswerId = a.Id LEFT OUTER JOIN Users AS u ON q.OwnerUserId = u.Id WHERE a.OwnerUserId = '##UserId##' AND u.Id IS NULL
sede
CREATE TABLE table_name_66 ( week VARCHAR, opponent VARCHAR )
On what Week was the Detroit Lions the Opponent?
SELECT week FROM table_name_66 WHERE opponent = "detroit lions"
sql_create_context
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE FlagTypes ( Id number, Name text, Description text ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ...
All tag names in decending order of uses.
SELECT TagName, 'count' FROM Tags ORDER BY 'count' DESC
sede
CREATE TABLE table_38422 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real )
Which Points have a Drawn larger than 0, and a Lost larger than 1?
SELECT AVG("Points") FROM table_38422 WHERE "Drawn" > '0' AND "Lost" > '1'
wikisql
CREATE TABLE table_38548 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text, "Time" text, "Location" text )
Which method did pride bushido 10 have ?
SELECT "Method" FROM table_38548 WHERE "Event" = 'pride bushido 10'
wikisql
CREATE TABLE table_11406866_2 ( opponent VARCHAR, tv VARCHAR, game_site VARCHAR )
who is the opponent where tv is abc and game site is tampa stadium
SELECT opponent FROM table_11406866_2 WHERE tv = "ABC" AND game_site = "Tampa Stadium"
sql_create_context
CREATE TABLE table_204_101 ( id number, "#" number, "title" text, "producer(s)" text, "performer (s)" text, "sample(s)" text, "length" text )
what is the number of songs with a length over 4 minutes ?
SELECT COUNT("title") FROM table_204_101 WHERE "length" >= 4
squall
CREATE TABLE table_204_876 ( id number, "ecclesiastical jurisdictions" text, "latin name" text, "type" text, "rite" text, "ecclesiastical province" text, "established" text, "area (km2)" number )
which is the only one with 1074 km
SELECT "ecclesiastical jurisdictions" FROM table_204_876 WHERE "area (km2)" = '1074'
squall
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE mzjzjlb_jybgb ( YLJGDM_MZJZJLB text, BGDH number, YLJGDM number ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, ...
门诊上一般被诊断为疾病O32.933的患者的检测指标830460数值的平均值以及最值会是怎样的数据
SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN mzjzjlb_jybgb ON mzjzjlb.YLJGDM = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND mzjzjlb_jybgb.YLJGDM = jybgb.YLJ...
css
CREATE TABLE table_11951237_1 ( production_code INTEGER, original_air_date VARCHAR )
What is the production code for the show that aired on October 27, 1994?
SELECT MAX(production_code) FROM table_11951237_1 WHERE original_air_date = "October 27, 1994"
sql_create_context
CREATE TABLE table_77559 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team score when home team score is 20.12 (132)?
SELECT "Away team score" FROM table_77559 WHERE "Home team score" = '20.12 (132)'
wikisql
CREATE TABLE table_name_33 ( venue VARCHAR, notes VARCHAR, competition VARCHAR )
Which Venue has Notes of 58.25 m, and a Competition of world championships?
SELECT venue FROM table_name_33 WHERE notes = "58.25 m" AND competition = "world championships"
sql_create_context
CREATE TABLE table_23230 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real, "Joined" real )
Name the type for hobart college
SELECT "Type" FROM table_23230 WHERE "Institution" = 'Hobart College'
wikisql
CREATE TABLE table_203_476 ( id number, "no." number, "title (latin)" text, "title (english translation)" text, "subject" text, "date" text )
how many titles did not list an english translation ?
SELECT COUNT(*) FROM table_203_476 WHERE "title (english translation)" IS NULL
squall
CREATE TABLE table_204_463 ( id number, "year" number, "division" number, "league" text, "regular season" text, "playoffs" text, "open cup" text )
what is the number of times the seattle sounders has reached the 2nd round of the open cup ?
SELECT COUNT(*) FROM table_204_463 WHERE "open cup" = '2nd round'
squall
CREATE TABLE Users ( user_id INTEGER, role_code VARCHAR(15), user_name VARCHAR(40), user_login VARCHAR(40), password VARCHAR(40) ) CREATE TABLE Images ( image_id INTEGER, image_alt_text VARCHAR(80), image_name VARCHAR(40), image_url VARCHAR(255) ) CREATE TABLE Document_Structures (...
what are the different role codes for users, and how many users have each?
SELECT role_code, COUNT(*) FROM Users GROUP BY role_code
nvbench
CREATE TABLE table_name_3 ( railway_number_s_ VARCHAR, class VARCHAR )
What is the railway number of the aw class?
SELECT railway_number_s_ FROM table_name_3 WHERE class = "aw"
sql_create_context
CREATE TABLE table_name_38 ( births__000s_ INTEGER, deaths VARCHAR )
What is the average births that had a death rate of 0.4
SELECT AVG(births__000s_) FROM table_name_38 WHERE deaths = 0.4
sql_create_context
CREATE TABLE DEPARTMENT ( DEPT_CODE varchar(10), DEPT_NAME varchar(30), SCHOOL_CODE varchar(8), EMP_NUM int, DEPT_ADDRESS varchar(20), DEPT_EXTENSION varchar(4) ) CREATE TABLE ENROLL ( CLASS_CODE varchar(5), STU_NUM int, ENROLL_GRADE varchar(50) ) CREATE TABLE COURSE ( CRS_CODE...
how many students are in each department?, and display X from high to low order.
SELECT DEPT_CODE, COUNT(*) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE DESC
nvbench
CREATE TABLE table_name_71 ( date_of_birth VARCHAR, player VARCHAR )
When was roshan mahanama born?
SELECT date_of_birth FROM table_name_71 WHERE player = "roshan mahanama"
sql_create_context
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) 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 employees ( EMPLOYEE_ID decimal(6,0), FIRST_NAME varchar(20), ...
For those employees who was hired before 2002-06-21, draw a line chart about the change of commission_pct over hire_date , could you list by the X in descending?
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY HIRE_DATE DESC
nvbench
CREATE TABLE table_41649 ( "Year" text, "Starts" real, "Cuts Made" real, "Wins" real, "Top 10" real, "Top 25" real, "Earnings (\u20ac)" real, "Money list rank" text )
What is the average number of starts when the money list rank is 108 and the rank in the top 25 is greater than 4?
SELECT AVG("Starts") FROM table_41649 WHERE "Money list rank" = '108' AND "Top 25" > '4'
wikisql
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) 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...
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, visualize a scatter chart about the correlation between employee_id and salary .
SELECT EMPLOYEE_ID, SALARY FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
nvbench
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 ...
看看住院就诊49376399892的入住病区的名称是什么?病区的代码是什么?床位号是什么
SELECT RZBQDM, RZBQMC, RYCWH FROM zyjzjlb WHERE JZLSH = '49376399892'
css
CREATE TABLE table_7941 ( "Heat" real, "Lane" real, "Name" text, "Country" text, "Mark" text, "React" real )
What country does Glory Alozie play for?
SELECT "Country" FROM table_7941 WHERE "Name" = 'glory alozie'
wikisql
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose...
what are the four most frequent procedures that followed in the same hospital visit for the patients who were diagnosed with mal neo bronch/lung nec in this year?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
mimic_iii
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
give the maximum number of days of hospital stay for patients who had liver transplant.
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT"
mimicsql_data
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREA...
this year patient 027-82318 has been diagnosed with hiv positive - cd4 > 350?
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-82318')) AND diagnosis.diagnosisname = 'hiv positive - cd4 > 350' AND DA...
eicu
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id...
what was the top four of the most frequent procedures until 3 years ago?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM procedures_icd WHERE DATETIME(procedures_icd.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY procedur...
mimic_iii
CREATE TABLE table_44199 ( "NTSC M" text, "PAL B,G,H" text, "PAL I" text, "PAL N" text, "PAL M" text )
What is the NTSC M for Pal M 525/60?
SELECT "NTSC M" FROM table_44199 WHERE "PAL M" = '525/60'
wikisql
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text,...
Closed posts by votes on answers. This is used to see how many closed questions have up, down and neutral voted answers. A single post can be in all three categories if there is an answer which is positive, negative and neutral.
WITH ClosedPostsVotes AS (SELECT p.Id AS "Post Link", SUM(CASE WHEN a.Score > 0 THEN 1 ELSE 0 END) AS Up, SUM(CASE WHEN a.Score < 0 THEN 1 ELSE 0 END) AS Down, SUM(CASE WHEN a.Score = 0 THEN 1 ELSE 0 END) AS Neutral FROM Posts AS p INNER JOIN Posts AS a ON a.ParentId = p.Id WHERE NOT p.ClosedDate IS NULL GROUP BY p.Id)...
sede
CREATE TABLE table_name_21 ( opponent VARCHAR, game VARCHAR )
Who is the opponent in game 7?
SELECT opponent FROM table_name_21 WHERE game = 7
sql_create_context
CREATE TABLE table_204_771 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
how many countries in this competition had more than two silver medals ?
SELECT COUNT("nation") FROM table_204_771 WHERE "silver" > 2
squall
CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar, admit_term int, predicted_graduation_semester int, degree varchar, minor varchar, internship varch...
What has Dr. India Plough taught in the past ?
SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, instructor, offering_instructor WHERE course_offering.semester < (SELECT SEMESTERalias0.semester_id FROM semester AS SEMESTERalias0 WHERE SEMESTERalias0.semester = 'WN' AND SEMESTERalias0.year = 2016) AND course.course_id = cour...
advising
CREATE TABLE table_19508 ( "Rank" real, "State" text, "Revenue (millions)" text, "Population" real, "Revenue per capita" text, "Spending (millions)" text, "Spending per capita" text, "Net contribution per capita" text, "Presidential majority 2000/2004" text, "Presidential majorit...
What was the spending per capita when the revenue per capita was $7,755?
SELECT "Spending per capita" FROM table_19508 WHERE "Revenue per capita" = '$7,755'
wikisql
CREATE TABLE table_name_58 ( week INTEGER, result VARCHAR )
What was the last week when the team had a bye week?
SELECT MAX(week) FROM table_name_58 WHERE result = "bye"
sql_create_context
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 d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABL...
what are the five most commonly prescribed medications for patients who were previously prescribed nystatin ointment within 2 months, a year before?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'nystatin ointment' AND DATETIME(prescriptions.startdate, 'start o...
mimic_iii
CREATE TABLE table_7833 ( "Team" text, "Head Coach" text, "City" text, "Stadium" text, "Capacity" real )
What is the Capacity of the Rainer Kraft's Stadium?
SELECT AVG("Capacity") FROM table_7833 WHERE "Head Coach" = 'rainer kraft'
wikisql
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...
Zero-answer zero-upvote unclosed questions with no recent updates since date.
SELECT p.Title, p.CreationDate, p.LastActivityDate, p.Tags, 'http://stackoverflow.com/questions/' + CAST(p.Id AS TEXT(50)) AS Link FROM Posts AS p LEFT JOIN PostLinks AS l ON l.PostId = p.Id LEFT JOIN Votes AS v ON p.Id = v.PostId WHERE p.PostTypeId = 1 AND p.AnswerCount = 0 AND p.Score <= 0 AND l.Id IS NULL AND v.Id I...
sede
CREATE TABLE table_37964 ( "Callsign" text, "Area served" text, "Frequency" text, "Band" text, "On-air ID" text, "Purpose" text )
Name the frequency with on-air ID of 1way fm
SELECT "Frequency" FROM table_37964 WHERE "On-air ID" = '1way fm'
wikisql
CREATE TABLE table_name_10 ( sodium VARCHAR, lithium VARCHAR, rubidium VARCHAR )
what is the properties of sodium when lithium is h a l o g e n s and rubidium is nacl (2.1)?
SELECT sodium FROM table_name_10 WHERE lithium = "h a l o g e n s" AND rubidium = "nacl (2.1)"
sql_create_context
CREATE TABLE table_3295 ( "Season" real, "Series" text, "Team" text, "Races" real, "Wins" real, "Poles" real, "F/Laps" real, "Podiums" real, "Points" real, "Position" text )
What is the smallest number of races competed in with 11 podiums?
SELECT MIN("Races") FROM table_3295 WHERE "Podiums" = '11'
wikisql
CREATE TABLE table_name_61 ( team_2 VARCHAR )
Name the 2nd leg for defence force
SELECT 2 AS nd_leg FROM table_name_61 WHERE team_2 = "defence force"
sql_create_context
CREATE TABLE table_19829 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." text )
What is the total of all Shot PCT occurrences when the value of Blank Ends is 8?
SELECT COUNT("Shot Pct.") FROM table_19829 WHERE "Blank Ends" = '8'
wikisql
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...
what is subject name of subject id 3343?
SELECT demographic.name FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
what is the number of patients who have drug code vori200?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "VORI200"
mimicsql_data
CREATE TABLE table_14980 ( "Stage" text, "Time" text, "Name" text, "Length" text, "Winner" text, "Rally leader" text )
What was the Winner of the SS5 Stage?
SELECT "Winner" FROM table_14980 WHERE "Stage" = 'ss5'
wikisql