context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_7193 (
"Year" real,
"Award" text,
"Category" text,
"Nominee" text,
"Result" text
) | How many years were they nominated for outstanding musical? | SELECT COUNT("Year") FROM table_7193 WHERE "Nominee" = 'outstanding musical' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean... | Number of other's comments on my posts. | SELECT p.Id AS "post_link", COUNT(*) AS count_ FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE p.OwnerUserId = '##UserId:int##' AND p.OwnerUserId != c.UserId GROUP BY p.Id ORDER BY count_ DESC | sede |
CREATE TABLE table_16384648_2 (
capacity INTEGER,
team_nickname VARCHAR
) | For the flyers, what's the minimum capacity? | SELECT MIN(capacity) FROM table_16384648_2 WHERE team_nickname = "Flyers" | sql_create_context |
CREATE TABLE mzjybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH number,
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,
... | 名叫奚芳芳的病患的检验报告单的报告日期在14年4月18日以前的是在哪些住院门诊的?列出流水号 | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '奚芳芳' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2014-04-18' UNI... | css |
CREATE TABLE table_56971 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Record" text
) | When was the home game when the New Jersey team's record became 7-23-7? | SELECT "Date" FROM table_56971 WHERE "Home" = 'new jersey' AND "Record" = '7-23-7' | wikisql |
CREATE TABLE table_name_38 (
date VARCHAR,
home_team VARCHAR
) | When did fitzroy play at home? | SELECT date FROM table_name_38 WHERE home_team = "fitzroy" | sql_create_context |
CREATE TABLE table_203_77 (
id number,
"album title" text,
"format" text,
"year" number,
"original label" text,
"chart positions" text
) | what was the earliest released album ? | SELECT "album title" FROM table_203_77 ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_3779 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Decision" text,
"Location/Attendance" text,
"Record" text
) | If the score is 5-3, who made the decision? | SELECT "Decision" FROM table_3779 WHERE "Score" = '5-3' | wikisql |
CREATE TABLE table_10636 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team played an away team with a score of 6.4 (40)? | SELECT "Home team score" FROM table_10636 WHERE "Away team score" = '6.4 (40)' | wikisql |
CREATE TABLE table_204_218 (
id number,
"name" text,
"faith" text,
"type" text,
"gov" text,
"opened" number,
"intake" number,
"dcsf number" number,
"ofsted number" number,
"web" text,
"coordinates" text
) | what is the first gov on the list ? | SELECT "gov" FROM table_204_218 WHERE id = 1 | squall |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
... | count the number of drugs that have been prescribed since 03/2105 to patient 002-27661. | SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-27661')) AND STRFTIME('%y-%m', medication.drugstarttime) >= '2105-03' | eicu |
CREATE TABLE table_203_298 (
id number,
"rank" number,
"name" text,
"nation(s)" text,
"born" text,
"ascended" text,
"years reigned" text
) | besides bhumibol adulyadej , which other people were born in december ? | SELECT "name" FROM table_203_298 WHERE "name" <> 'bhumibol adulyadej' AND "born" = 12 | squall |
CREATE TABLE table_39625 (
"Aircraft" text,
"Origin" text,
"Type" text,
"Versions" text,
"In service" real
) | Where is the origin of the tth version? | SELECT "Origin" FROM table_39625 WHERE "Versions" = 'tth' | wikisql |
CREATE TABLE classroom (
building VARCHAR,
capacity VARCHAR
) | How many rooms whose capacity is less than 50 does the Lamberton building have? | SELECT COUNT(*) FROM classroom WHERE building = 'Lamberton' AND capacity < 50 | sql_create_context |
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... | 参照不同科室的名字和不一样的入院诊断算一算医院8435928所有的记录里患者平均有多少岁,保存里面平均年纪不大于29岁的记录 | SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '8435928' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM HAVING AVG(PERSON_AGE) < 29 | css |
CREATE TABLE table_31196 (
"Skip (Club)" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real
) | When nicole backe (nanaimo curling club) is the skip (club) how many sets of w's are there? | SELECT COUNT("W") FROM table_31196 WHERE "Skip (Club)" = 'Nicole Backe (Nanaimo Curling Club)' | wikisql |
CREATE TABLE table_46598 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | Who was the opponent in UFC 66 who lasted for more than 1 round? | SELECT "Opponent" FROM table_46598 WHERE "Round" > '1' AND "Event" = 'ufc 66' | wikisql |
CREATE TABLE table_name_92 (
record VARCHAR,
home VARCHAR
) | What is the record for the NY Rangers? | SELECT record FROM table_name_92 WHERE home = "ny rangers" | sql_create_context |
CREATE TABLE table_52673 (
"Name" text,
"Title" text,
"Start term" real,
"End term" real,
"House" text
) | What is the total End term with a Title of prince regent of bavaria? | SELECT SUM("End term") FROM table_52673 WHERE "Title" = 'prince regent of bavaria' | wikisql |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
) | Who is the person whose age is below 30? | SELECT name FROM person WHERE age < 30 | spider |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Number of edits per question.. | SELECT p.Id, p.Id AS "post_link", (SELECT COUNT(ph.Id) FROM PostHistory AS ph WHERE (ph.PostHistoryTypeId = 4 OR ph.PostHistoryTypeId = 5) AND ph.PostId = 1 AND (ph.UserId IS NULL OR ph.UserId != (SELECT ph2.UserId FROM PostHistory AS ph2 WHERE ph2.PostId = ph.PostId AND ph2.PostHistoryTypeId = 1))) FROM Posts AS p WHE... | sede |
CREATE TABLE table_name_48 (
owner VARCHAR,
branding VARCHAR
) | Who is the owner with the branding fox fm? | SELECT owner FROM table_name_48 WHERE branding = "fox fm" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TAB... | when was the last time that patient 027-165214 had the heartrate maximum since 123 days ago? | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-165214')) AND NOT vitalperiodic.heartrate IS NU... | eicu |
CREATE TABLE table_10975034_5 (
pick__number VARCHAR,
college VARCHAR
) | What is the pick number of regina? | SELECT pick__number FROM table_10975034_5 WHERE college = "Regina" | sql_create_context |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number... | Most-viewed questions that I have answered. | SELECT QuestionPosts.Id AS "post_link", QuestionPosts.ViewCount FROM Posts AS AnswerPosts JOIN Posts AS QuestionPosts ON AnswerPosts.ParentId = QuestionPosts.Id WHERE AnswerPosts.PostTypeId = 2 AND AnswerPosts.OwnerUserId = 9662601 ORDER BY QuestionPosts.ViewCount DESC | sede |
CREATE TABLE table_52616 (
"Block A" text,
"Akira" text,
"Atsushi Aoki" text,
"Black Tiger V" text,
"Jado" text,
"Milano Collection A.T." text,
"Prince Devitt" text,
"Tiger Mask IV" text
) | What is the Prince Devitt when Block A is Yamato? | SELECT "Prince Devitt" FROM table_52616 WHERE "Block A" = 'yamato' | wikisql |
CREATE TABLE table_61606 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Sandy Lyle's To Par? | SELECT "To par" FROM table_61606 WHERE "Player" = 'sandy lyle' | wikisql |
CREATE TABLE table_name_72 (
model VARCHAR,
engine_code VARCHAR,
years VARCHAR,
torque VARCHAR
) | Which model was made from 2001 2004, with a Torque of n m (lb ft) @ 3750, and an Engine code of n42b18 / n46b18? | SELECT model FROM table_name_72 WHERE years = "2001–2004" AND torque = "n·m (lb·ft) @ 3750" AND engine_code = "n42b18 / n46b18" | sql_create_context |
CREATE TABLE table_15212 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Decision" text,
"Attendance" real,
"Record" text
) | Decision of parent, and a Visitor of Philadelphia, and a Date of January 27 had what score? | SELECT "Score" FROM table_15212 WHERE "Decision" = 'parent' AND "Visitor" = 'philadelphia' AND "Date" = 'january 27' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | provide the number of patients whose insurance is medicare and procedure long title is insertion of endotracheal tube? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicare" AND procedures.long_title = "Insertion of endotracheal tube" | mimicsql_data |
CREATE TABLE table_train_228 (
"id" int,
"ejection_fraction_ef" int,
"hiv_infection" bool,
"heart_disease" bool,
"body_weight" float,
"body_mass_index_bmi" float,
"allergy_to_beef" bool,
"NOUSE" float
) | must weigh a minimum of 110 pounds | SELECT * FROM table_train_228 WHERE body_weight >= 110 | criteria2sql |
CREATE TABLE employee (
eid number(9,0),
name varchar2(30),
salary number(10,2)
)
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin var... | Bar chart of the total number from each origin, could you sort total number in desc order? | SELECT origin, COUNT(*) FROM flight GROUP BY origin ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_12303563_2 (
runners_up VARCHAR,
nation VARCHAR
) | what's the runners-up with nation being malaysia | SELECT runners_up FROM table_12303563_2 WHERE nation = "Malaysia" | sql_create_context |
CREATE TABLE table_47251 (
"Barangay" text,
"Urban/rural" text,
"Geographic character" text,
"Population (2007)" real,
"Population (2010)" real
) | WHAT IS THE POPULATION OF 2007 WHEN 2010 POPULATION WAS SMALLER THAN 1282? | SELECT COUNT("Population (2007)") FROM table_47251 WHERE "Population (2010)" < '1282' | wikisql |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | Posts which have at least one close flag/vote for recommend a tool. | SELECT Posts.Body, Posts.Id AS "post_link", Posts.Score AS Votes FROM PendingFlags INNER JOIN Posts ON Posts.Id = PendingFlags.PostId WHERE Posts.ClosedDate IS NULL AND PendingFlags.CloseAsOffTopicReasonTypeId = '##Id##' | sede |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtim... | how many times does patient 011-55939 make chest tube in 06/last year? | SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '011-55939')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.ce... | eicu |
CREATE TABLE table_42102 (
"Ecozone" text,
"Area (km\u00b2) Territorial waters" real,
"Area (km\u00b2) Exclusive Economic Zone" real,
"Percentage of total area (forEEZ)" real,
"Percentage of marine area (forEEZ)" real
) | What is the smallest area of territorial waters with an exclusive economic zone area more than 704,849 and a percentage of total area greater than 6.8? | SELECT MIN("Area (km\u00b2) Territorial waters") FROM table_42102 WHERE "Area (km\u00b2) Exclusive Economic Zone" > '704,849' AND "Percentage of total area (forEEZ)" > '6.8' | wikisql |
CREATE TABLE table_name_94 (
visitor VARCHAR,
date VARCHAR
) | Who was the visitor on december 15, 1976? | SELECT visitor FROM table_name_94 WHERE date = "december 15, 1976" | sql_create_context |
CREATE TABLE table_18862490_2 (
player VARCHAR,
score VARCHAR
) | What players had teh score of 64-71-67-67=269? | SELECT player FROM table_18862490_2 WHERE score = 64 - 71 - 67 - 67 = 269 | sql_create_context |
CREATE TABLE table_204_228 (
id number,
"year" number,
"title" text,
"credit" text,
"role" text,
"notes" text
) | what did seth produce next , after cry wolf ? | SELECT "title" FROM table_204_228 WHERE "year" > (SELECT "year" FROM table_204_228 WHERE "title" = 'cry_wolf') ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_name_44 (
location VARCHAR,
established VARCHAR
) | What is the location of the university that was established in 2000? | SELECT location FROM table_name_44 WHERE established = 2000 | sql_create_context |
CREATE TABLE table_name_76 (
grid INTEGER,
driver VARCHAR,
laps VARCHAR
) | What was Jack Brabham's highest grid when his laps were more than 90? | SELECT MAX(grid) FROM table_name_76 WHERE driver = "jack brabham" AND laps > 90 | sql_create_context |
CREATE TABLE table_name_2 (
date VARCHAR,
home VARCHAR
) | What is the date of the game where the NY Islanders are the home team? | SELECT date FROM table_name_2 WHERE home = "ny islanders" | sql_create_context |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | what are the fares between NEW YORK and LOS ANGELES on monday morning | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND C... | atis |
CREATE TABLE table_61378 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the competition that was at serravalle, san marino? | SELECT "Competition" FROM table_61378 WHERE "Venue" = 'serravalle, san marino' | wikisql |
CREATE TABLE table_name_57 (
lost INTEGER,
pct VARCHAR,
tied VARCHAR,
years VARCHAR
) | What is the highest number lost when the number tied is more than 42, the years are less than 132, and the PCT is less than 0.5729000000000001? | SELECT MAX(lost) FROM table_name_57 WHERE tied > 42 AND years < 132 AND pct < 0.5729000000000001 | sql_create_context |
CREATE TABLE table_44226 (
"Position" real,
"Driver / Passenger" text,
"Equipment" text,
"Bike No" real,
"Points" real
) | What is the most noteworthy Bike No that has a Position bigger than 1, and a Points bigger than 369, and an Equipment of zabel-wsp? | SELECT MAX("Bike No") FROM table_44226 WHERE "Position" > '1' AND "Points" > '369' AND "Equipment" = 'zabel-wsp' | wikisql |
CREATE TABLE table_2108684_1 (
episode VARCHAR,
run_time VARCHAR
) | What episode had a run time of 23:38? | SELECT episode FROM table_2108684_1 WHERE run_time = "23:38" | sql_create_context |
CREATE TABLE table_63062 (
"Position" real,
"Team" text,
"Played" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Scored" real,
"Conceded" real,
"Points" real
) | What are the lowest conceded with 1 draw, and a score larger than 14? | SELECT MIN("Conceded") FROM table_63062 WHERE "Draws" = '1' AND "Scored" > '14' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | what is the number of patients whose procedure icd9 code is 2501 and drug route is td? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "2501" AND prescriptions.route = "TD" | mimicsql_data |
CREATE TABLE table_name_7 (
rank VARCHAR,
col__m_ INTEGER
) | What is the rank when the col is larger than 0? | SELECT COUNT(rank) FROM table_name_7 WHERE col__m_ > 0 | sql_create_context |
CREATE TABLE table_20928649_1 (
record VARCHAR,
cardinals_points VARCHAR
) | What was the record for the game where the cardinals scored 7 points? | SELECT record FROM table_20928649_1 WHERE cardinals_points = 7 | sql_create_context |
CREATE TABLE table_name_38 (
events INTEGER,
top_25 VARCHAR,
cuts_made VARCHAR
) | How many events have a Top-25 of 1 and made less than 1 cut? | SELECT MAX(events) FROM table_name_38 WHERE top_25 = 1 AND cuts_made < 1 | sql_create_context |
CREATE TABLE diagnoses_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,
... | what was the last ward id of patient 18678 last year? | SELECT transfers.wardid FROM transfers WHERE transfers.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 18678) AND NOT transfers.wardid IS NULL AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') ORDER BY transfers.intime DESC LIMIT 1 | mimic_iii |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Cou... | Top Users by Badges and Location. | SELECT OwnerUserId AS "user_link", PostTypeId, ParentId, Score FROM Posts WHERE OwnerUserId IN (SELECT Id FROM Users WHERE LOWER(Location) LIKE '%##Location##%' OR UPPER(Location) LIKE '%##Location##%') AND ((LOWER(Tags) LIKE '%##Tags##%' OR UPPER(Tags) LIKE '%##Tags##%') OR (ParentId IN (SELECT Id FROM Posts WHERE LOW... | sede |
CREATE TABLE table_38947 (
"Game" real,
"December" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What were the Points in the game with a Score of 2 7? | SELECT SUM("Points") FROM table_38947 WHERE "Score" = '2–7' | wikisql |
CREATE TABLE attribute_definitions (
attribute_id number,
attribute_name text,
attribute_data_type text
)
CREATE TABLE catalog_contents_additional_attributes (
catalog_entry_id number,
catalog_level_number number,
attribute_id number,
attribute_value text
)
CREATE TABLE catalog_structure (... | Find the dates on which more than one revisions were made. | SELECT date_of_latest_revision FROM catalogs GROUP BY date_of_latest_revision HAVING COUNT(*) > 1 | spider |
CREATE TABLE table_57198 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | What date was moena to aprica the course? | SELECT "Date" FROM table_57198 WHERE "Course" = 'moena to aprica' | wikisql |
CREATE TABLE table_63744 (
"School" text,
"Location" text,
"Mascot" text,
"Enrollment" real,
"IHSAA Football Class" text,
"Primary Conference" text,
"County" text
) | What is the primary conference with a IHSAA Football Class of A, at South Decatur school? | SELECT "Primary Conference" FROM table_63744 WHERE "IHSAA Football Class" = 'a' AND "School" = 'south decatur' | wikisql |
CREATE TABLE table_16724844_1 (
mens_45 VARCHAR,
mens_40 VARCHAR
) | What was the mens 45 when mens 40 was Sunwest Razorbacks def Sydney Mets? | SELECT mens_45 FROM table_16724844_1 WHERE mens_40 = "SunWest Razorbacks def Sydney Mets" | sql_create_context |
CREATE TABLE table_59443 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What is the surface on 15 August 2009? | SELECT "Surface" FROM table_59443 WHERE "Date" = '15 august 2009' | wikisql |
CREATE TABLE table_11183 (
"Rank" text,
"City" text,
"Height" text,
"Stories" real,
"Completed" real
) | How many stories were done in 2008 with a 16 rank? | SELECT COUNT("Stories") FROM table_11183 WHERE "Completed" = '2008' AND "Rank" = '16' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE cost (
row_id number,
subject_... | in 03/this year when did patient 70516 get a lab test for the last time? | SELECT labevents.charttime FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 70516) AND DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m', labevents.charttime) = '03' ORDER BY labevents... | mimic_iii |
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDispl... | Popular tags 2017 January - 2018 July. | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS Rank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS "Questions in 2017-2018", num.Num AS "Questions total" FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id =... | sede |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id nu... | My answers ordered by score. My answers ordered by score | SELECT a.Score, a.Body, q.Id, q.Title, q.CreationDate FROM Posts AS q INNER JOIN Posts AS a ON a.PostTypeId = 3 WHERE a.OwnerUserId = '##UserId##' ORDER BY a.Score | sede |
CREATE TABLE table_name_97 (
team_name VARCHAR,
losses VARCHAR,
games VARCHAR
) | Who is the team that has played more than 18 games and has 6 losses? | SELECT team_name FROM table_name_97 WHERE losses = 6 AND games > 18 | sql_create_context |
CREATE TABLE table_1341568_34 (
elected INTEGER,
incumbent VARCHAR
) | What year was incumbent Martin Lancaster elected? | SELECT MIN(elected) FROM table_1341568_34 WHERE incumbent = "Martin Lancaster" | sql_create_context |
CREATE TABLE table_27722734_12 (
game INTEGER
) | What number was the first game? | SELECT MIN(game) FROM table_27722734_12 | sql_create_context |
CREATE TABLE table_name_84 (
place VARCHAR,
player VARCHAR,
score VARCHAR
) | What place did Bob May get when his score was 72-66=138? | SELECT place FROM table_name_84 WHERE score = 72 - 66 = 138 AND player = "bob may" | sql_create_context |
CREATE TABLE table_name_13 (
wins INTEGER,
year VARCHAR,
points VARCHAR
) | How many wins did the team, which had more than 110 points, have in 1989? | SELECT SUM(wins) FROM table_name_13 WHERE year = 1989 AND points > 110 | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessD... | Answer Count Rank by User. | WITH RankedUsers AS (SELECT RANK() OVER (ORDER BY COUNT(*) DESC) AS Rank, OwnerUserId, COUNT(*) AS AnswerCount FROM Posts WHERE PostTypeId = 2 AND NOT OwnerUserId IS NULL GROUP BY OwnerUserId) SELECT Rank, OwnerUserId AS "user_link", AnswerCount FROM RankedUsers WHERE Rank < 100 OR OwnerUserId = '##UserId##' ORDER BY R... | sede |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
... | what was the average value for arterial bp [systolic] for patient 4401 in the previous day? | 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 = 4401)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arter... | mimic_iii |
CREATE TABLE table_61787 (
"Sign" text,
"Domicile" text,
"Detriment" text,
"Exaltation" text,
"Fall" text
) | Which sign has a fall of Venus? | SELECT "Sign" FROM table_61787 WHERE "Fall" = 'venus' | wikisql |
CREATE TABLE table_name_4 (
country VARCHAR,
name VARCHAR
) | Name the country with pol k | SELECT country FROM table_name_4 WHERE name = "polák" | sql_create_context |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and revenue , and group by attribute founder. | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name | nvbench |
CREATE TABLE table_name_97 (
roll INTEGER,
decile VARCHAR,
authority VARCHAR,
name VARCHAR
) | What is the smallest roll with an Authority of state, a Name of newfield park school, and a Decile smaller than 2? | SELECT MIN(roll) FROM table_name_97 WHERE authority = "state" AND name = "newfield park school" AND decile < 2 | sql_create_context |
CREATE TABLE table_25425 (
"Date" text,
"Location" text,
"Opponent" text,
"Cards Points" real,
"Opp. Points" real,
"Record" text
) | Name the opponent for 11-1 | SELECT "Opponent" FROM table_25425 WHERE "Record" = '11-1' | wikisql |
CREATE TABLE table_name_74 (
lead VARCHAR,
second VARCHAR,
third VARCHAR
) | What is the lead with a second of Vicki Adams and a third of Anna Sloan? | SELECT lead FROM table_name_74 WHERE second = "vicki adams" AND third = "anna sloan" | sql_create_context |
CREATE TABLE table_18600760_7 (
pop__2010_ VARCHAR,
county VARCHAR,
geo_id VARCHAR
) | In Cavalier County and the geo id is larger than 3801931620.0, what is the population? | SELECT pop__2010_ FROM table_18600760_7 WHERE county = "Cavalier" AND geo_id > 3801931620.0 | sql_create_context |
CREATE TABLE table_22356 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
) | What number episode in the series was titled 'Never the Bride'? | SELECT "No. in series" FROM table_22356 WHERE "Title" = 'Never the Bride' | wikisql |
CREATE TABLE table_1410384_1 (
voice_actor__english_1998___pioneer_ VARCHAR,
voice_actor__japanese_ VARCHAR
) | how many voice actor (englbeingh 1998 / pioneer) with voice actor (japanese) being shinobu satouchi | SELECT COUNT(voice_actor__english_1998___pioneer_) FROM table_1410384_1 WHERE voice_actor__japanese_ = "Shinobu Satouchi" | sql_create_context |
CREATE TABLE table_16043 (
"Year" real,
"Broadcast date" text,
"BBC One total viewing" real,
"BBC One Rank" text,
"BBC Two total viewing" text,
"BBC Two Rank" text
) | How many years did BBC One rank 20th? | SELECT COUNT("Year") FROM table_16043 WHERE "BBC One Rank" = '20th' | wikisql |
CREATE TABLE table_25631 (
"Season" text,
"Junior (South) Winners" text,
"Intermediate (South) Winners" text,
"Minor (South) Winners" text,
"Primary (South) Winners" text
) | If the primary (South) winners is Inter The Bloomfield, what is the season total number? | SELECT COUNT("Season") FROM table_25631 WHERE "Primary (South) Winners" = 'Inter The Bloomfield' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE proced... | indicate the daily maximum volume of pacu out pacu urine that patient 21134 has had since 512 days ago. | SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 21134)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'pac... | mimic_iii |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varcha... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of first_name and department_id , and I want to list from low to high by the DEPARTMENT_ID. | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID | nvbench |
CREATE TABLE table_33451 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | How many people attended the game against the cincinnati bengals? | SELECT COUNT("Attendance") FROM table_33451 WHERE "Opponent" = 'cincinnati bengals' | wikisql |
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 ... | 门诊诊断为疾病P75.635的患者的检测指标177326数值的平均值以及最值分别是多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN jybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'P75.635' AND jyjgzbb.JCZBDM = '177326' | css |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | count the number of patients whose drug code was ns451000. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "NS451000" | mimicsql_data |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | What are the names and the accumulated prices of all products in the store Plot them as a bar chart, and could you list from high to low by the X-axis? | SELECT Name, SUM(Price) FROM Products GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_28628309_9 (
totals VARCHAR,
average VARCHAR,
category VARCHAR
) | What is the total listed when the average is 0.667 and the category is 3-pt field goal percentage? | SELECT totals FROM table_28628309_9 WHERE average = "0.667" AND category = "3-pt field goal percentage" | sql_create_context |
CREATE TABLE table_68236 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the score when the Washington Nationals had a record of 11-10? | SELECT "Score" FROM table_68236 WHERE "Record" = '11-10' | wikisql |
CREATE TABLE table_67635 (
"Prod. No." text,
"Title" text,
"Written by" text,
"Directed by" text,
"Original airdate" text
) | Who directed the episode written by Dan Serafin and aired on July 23, 2008? | SELECT "Directed by" FROM table_67635 WHERE "Written by" = 'dan serafin' AND "Original airdate" = 'july 23, 2008' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description t... | Top 100 Posts by score. | SELECT p.PostTypeId, p.Id, p.ParentId, p.Title, p.Body, p.Tags, p.OwnerUserId, u.DisplayName, u.AboutMe, u.ProfileImageUrl, u.Reputation, u.WebsiteUrl, u.Location, u.CreationDate, u.LastAccessDate FROM Posts AS p LEFT JOIN Users AS u ON p.OwnerUserId = u.Id WHERE p.PostTypeId = 1 ORDER BY Score DESC LIMIT 100 | sede |
CREATE TABLE table_name_12 (
results VARCHAR,
district VARCHAR
) | What were the results for the incumbent from Iowa 2 district? | SELECT results FROM table_name_12 WHERE district = "iowa 2" | sql_create_context |
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... | calculate the total number of married patients who had rt & lt heart angiocard | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.short_title = "Rt & lt heart angiocard" | mimicsql_data |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDat... | Questions with no answers and no activity for 6 months.. | SELECT q.Id AS "post_link", q.AnswerCount AS Answers FROM Posts AS q WHERE q.LastActivityDate < '2011-05-06' AND q.ViewCount <= 100 AND q.PostTypeId = 1 ORDER BY Score DESC | sede |
CREATE TABLE table_19418696_3 (
name VARCHAR,
qb_rating VARCHAR
) | Which QB had a rating of 72.3? | SELECT name FROM table_19418696_3 WHERE qb_rating = "72.3" | sql_create_context |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Has_amenity (
dormid INTEGER,
amenid INTEGER
)
CREATE TABLE Dorm_amenity (
amenid ... | Bar chart of mean age from each city code, and list in ascending by the city_code. | SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY city_code | nvbench |
CREATE TABLE table_40709 (
"Location" text,
"Control" text,
"Type" text,
"Enrollment" real,
"Founded" real
) | With 10,894 students enrolled, in what year was this private RU/VH institution located in Troy, New York founded? | SELECT AVG("Founded") FROM table_40709 WHERE "Type" = 'ru/vh' AND "Control" = 'private' AND "Enrollment" > '10,894' AND "Location" = 'troy, new york' | wikisql |
CREATE TABLE table_name_58 (
best INTEGER,
team VARCHAR,
qual_2 VARCHAR
) | What is the best time for a rusport driver with a qual 2 time of 1:10.166? | SELECT MAX(best) FROM table_name_58 WHERE team = "rusport" AND qual_2 = "1:10.166" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.