context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_202_224 (
id number,
"party" text,
"candidate" text,
"votes" number,
"%" number
) | a candidate with the name of flash gordon approaching of what satirical political party came in last place in the 2001 general election in ochil ? | SELECT "party" FROM table_202_224 WHERE "candidate" = 'flash gordon approaching' | squall |
CREATE TABLE table_39670 (
"Date" text,
"Time" text,
"Visitor" text,
"Score" text,
"Home" text,
"Location/Attendance" text,
"Record" text
) | What is the home in mellon arena at 7:30 pm with a record o 2-5-2? | SELECT "Home" FROM table_39670 WHERE "Time" = '7:30 pm' AND "Location/Attendance" = 'mellon arena' AND "Record" = '2-5-2' | wikisql |
CREATE TABLE table_1342149_42 (
first_elected INTEGER,
district VARCHAR
) | In the District Tennessee 7 what is the number of first elected? | SELECT MAX(first_elected) FROM table_1342149_42 WHERE district = "Tennessee 7" | sql_create_context |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | show me the cheapest round trips from DALLAS to BALTIMORE | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... | atis |
CREATE TABLE table_203_377 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | the team with the most gold medals | SELECT "nation" FROM table_203_377 ORDER BY "gold" DESC LIMIT 1 | squall |
CREATE TABLE table_40923 (
"From" real,
"Goal" text,
"Round 1" text,
"Round 2" text,
"Round 3" text,
"Round 4" text,
"Round 5" text,
"Round 6+" text
) | What is Round 2 when Round 4 is Double and Round 3 is Single? | SELECT "Round 2" FROM table_40923 WHERE "Round 4" = 'double' AND "Round 3" = 'single' | wikisql |
CREATE TABLE table_26778 (
"Guberniya *" text,
"Total Population" real,
"Belarusian (\u0411\u0463\u043b\u043e\u0440\u0443\u0441\u043a\u0456\u0439)" real,
"Russian (\u0412\u0463\u043b\u0438\u043a\u043e\u0440\u0443\u0441\u043a\u0456\u0439)" real,
"Polish (\u041f\u043e\u043b\u044c\u0441\u043a\u0456\u04... | What are the polish population where guberniya is vitebsk? | SELECT "Polish (\u041f\u043e\u043b\u044c\u0441\u043a\u0456\u0439)" FROM table_26778 WHERE "Guberniya *" = 'Vitebsk' | wikisql |
CREATE TABLE table_14655757_1 (
player VARCHAR,
college VARCHAR
) | Which players college is Tennessee? | SELECT player FROM table_14655757_1 WHERE college = "Tennessee" | sql_create_context |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE... | Show me the trend using a line chart that group and count payment date, and then sort the bars in ascending order of date. | SELECT Date_Payment_Made, COUNT(Date_Payment_Made) FROM Payments GROUP BY Date_Payment_Made ORDER BY Date_Payment_Made | nvbench |
CREATE TABLE table_80035 (
"Country" text,
"Film title used in nomination" text,
"Language" text,
"Original name" text,
"Director" text
) | Which country is the director Roland Verhavert from? | SELECT "Country" FROM table_80035 WHERE "Director" = 'roland verhavert' | wikisql |
CREATE TABLE table_22135 (
"English name" text,
"Thai name" text,
"Abbr." text,
"Transcription" text,
"Sanskrit word" text,
"Zodiac sign" text
) | What's the zodiac sing for the month abbreviated as . .? | SELECT "Zodiac sign" FROM table_22135 WHERE "Abbr." = 'มี.ค.' | wikisql |
CREATE TABLE table_312 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | Which player is from Saguaro High School? | SELECT "Position" FROM table_312 WHERE "School" = 'Saguaro High School' | wikisql |
CREATE TABLE table_name_75 (
country VARCHAR,
player VARCHAR
) | What country is jack nicklaus from? | SELECT country FROM table_name_75 WHERE player = "jack nicklaus" | sql_create_context |
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
)
... | What is the number of patients with diagnoses icd9 code 43491 who died in or before 2155? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dod_year <= "2155.0" AND diagnoses.icd9_code = "43491" | mimicsql_data |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
a... | had patient 004-28929 had urine output until 11/01/2103. | 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 = '004-28929')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... | eicu |
CREATE TABLE table_name_25 (
constructor VARCHAR,
laps VARCHAR,
time_retired VARCHAR
) | Who built the car that went 53 laps with a Time/Retired of 1:17:09.672? | SELECT constructor FROM table_name_25 WHERE laps = 53 AND time_retired = "1:17:09.672" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 咱们医院的在00年4月27日到2000年12月12日内病人65980310的所有检验结果指标记录的检测人为韩乐音的检验指标流水号是多少号? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM A... | css |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those records from the products and each product's manufacturer, give me the comparison about the average of revenue over the founder , and group by attribute founder, and order from low to high by the bars. | SELECT Founder, AVG(Revenue) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder | nvbench |
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 inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttim... | what was patient 40435 diagnosed with first time in 2105. | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT diagnoses_icd.icd9_code FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 40435) AND STRFTIME('%y', diagnoses_icd.charttime) = '2105' ORDER BY diagn... | mimic_iii |
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... | Guess NAA flags on SU by comments. | SELECT 'http://superuser.com/questions/' + CAST(c.PostId AS TEXT) FROM Comments AS c INNER JOIN Posts AS p ON (p.Id = c.PostId) WHERE c.Text LIKE '%This does not provide an answer to the question.%' AND c.Score >= 0 AND p.Score <= 0 AND NOT EXISTS(SELECT * FROM PostHistory AS h WHERE PostHistoryTypeId IN (12, 13) AND h... | sede |
CREATE TABLE table_name_78 (
date VARCHAR,
score VARCHAR
) | What is the date of the game with a w 105-88 score? | SELECT date FROM table_name_78 WHERE score = "w 105-88" | sql_create_context |
CREATE TABLE table_13557843_7 (
high_rebounds VARCHAR,
team VARCHAR
) | who is the the high rebounds with team being vancouver | SELECT high_rebounds FROM table_13557843_7 WHERE team = "Vancouver" | sql_create_context |
CREATE TABLE table_name_81 (
venue VARCHAR,
result VARCHAR
) | Where was the game with the result of 22-20 played? | SELECT venue FROM table_name_81 WHERE result = "22-20" | sql_create_context |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE Votes (
Id number,
PostId number,
... | Top 20 comments by users and the scores. | SELECT Score, Id AS "comment_link" FROM Comments ORDER BY Score DESC LIMIT 20 | sede |
CREATE TABLE table_name_77 (
country VARCHAR,
medal VARCHAR,
event VARCHAR
) | What country has a silver medal in the boxing, heavyweight event? | SELECT country FROM table_name_77 WHERE medal = "silver" AND event = "boxing, heavyweight" | sql_create_context |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate ... | 2018. | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS LastQuarterRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsSeptember2018, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Post... | sede |
CREATE TABLE table_name_27 (
d_48 VARCHAR,
d_43 VARCHAR
) | What is the D48 when D 43 is plurality ?? | SELECT d_48 FROM table_name_27 WHERE d_43 = "plurality ↑" | sql_create_context |
CREATE TABLE table_23958944_5 (
no_by_season INTEGER,
us_viewers__in_millions_ VARCHAR
) | What episode was watched by 10.81 million US viewers? | SELECT MIN(no_by_season) FROM table_23958944_5 WHERE us_viewers__in_millions_ = "10.81" | sql_create_context |
CREATE TABLE table_49144 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
) | How many total rounds used the submission (choke) method? | SELECT SUM("Round") FROM table_49144 WHERE "Method" = 'submission (choke)' | wikisql |
CREATE TABLE course (
course_id text,
title text,
dept_name text,
credits number
)
CREATE TABLE prereq (
course_id text,
prereq_id text
)
CREATE TABLE department (
dept_name text,
building text,
budget number
)
CREATE TABLE takes (
id text,
course_id text,
sec_id text,... | How many courses are provided in each semester and year? | SELECT COUNT(*), semester, year FROM section GROUP BY semester, year | spider |
CREATE TABLE table_204_178 (
id number,
"number" text,
"south/west end" text,
"north/east end" text,
"formed" text,
"eliminated" text
) | is oregon route 69 newer than oregon route 90 ? | SELECT (SELECT "formed" FROM table_204_178 WHERE "number" = 'oregon route 69') > (SELECT "formed" FROM table_204_178 WHERE "number" = 'oregon route 90') | squall |
CREATE TABLE table_name_84 (
release_date VARCHAR,
format VARCHAR,
title VARCHAR
) | What is Release Date, when Format is CD, and when Title is Tsar Wars? | SELECT release_date FROM table_name_84 WHERE format = "cd" AND title = "tsar wars" | sql_create_context |
CREATE TABLE procedures (
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 ... | give me the number of patients whose discharge location is home and primary disease is mesenteric ischemia? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "HOME" AND demographic.diagnosis = "MESENTERIC ISCHEMIA" | mimicsql_data |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | For those employees who was hired before 2002-06-21, show me about the correlation between commission_pct and department_id in a scatter chart. | SELECT COMMISSION_PCT, DEPARTMENT_ID FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_70859 (
"Tournament" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | If the French Open tournament had 2r in 2012, what was it in 2009? | SELECT "2009" FROM table_70859 WHERE "2012" = '2r' AND "Tournament" = 'french open' | wikisql |
CREATE TABLE table_77893 (
"Name" text,
"City" text,
"Stadium" text,
"First season in first division" text,
"First season after most recent promotion" text
) | When was Alianza's first season in first division with a promotion after 1959? | SELECT "First season in first division" FROM table_77893 WHERE "First season after most recent promotion" = '1959' AND "Name" = 'alianza' | wikisql |
CREATE TABLE table_65177 (
"Japanese Title" text,
"Romaji Title" text,
"TV Station" text,
"Episodes" real,
"Average Ratings" text
) | Which TV Station has Average Ratings of 16.89%? | SELECT "TV Station" FROM table_65177 WHERE "Average Ratings" = '16.89%' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 姓名为葛虹颖的投保人花费了多少次的整数金额在住院期间? | SELECT COUNT(*) FROM t_kc21 WHERE PERSON_NM = '葛虹颖' AND CLINIC_TYPE = '住院' AND MOD(MED_AMOUT, 1) = 0 | css |
CREATE TABLE table_name_75 (
round VARCHAR,
time VARCHAR,
location VARCHAR
) | What is the total number of Round(s), when Time is 'n/a', and when Location is 'Canton, Ohio, USA'? | SELECT COUNT(round) FROM table_name_75 WHERE time = "n/a" AND location = "canton, ohio, usa" | sql_create_context |
CREATE TABLE table_68729 (
"Event" text,
"Time" text,
"Venue" text,
"Date" text,
"Notes" text
) | Which event was held in Beijing? | SELECT "Event" FROM table_68729 WHERE "Venue" = 'beijing' | wikisql |
CREATE TABLE table_name_88 (
grid INTEGER,
driver VARCHAR
) | What is mario dom nguez's average Grid? | SELECT AVG(grid) FROM table_name_88 WHERE driver = "mario domínguez" | sql_create_context |
CREATE TABLE Documents_with_Expenses (
Document_ID INTEGER,
Budget_Type_Code CHAR(15),
Document_Details VARCHAR(255)
)
CREATE TABLE Ref_Budget_Codes (
Budget_Type_Code CHAR(15),
Budget_Type_Description VARCHAR(255)
)
CREATE TABLE Statements (
Statement_ID INTEGER,
Statement_Details VARCHAR... | How many documents are created in each day? Bin the document date by year interval and group by document type with a group line chart, display by the x axis in descending. | SELECT Document_Date, COUNT(Document_Date) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name ORDER BY Document_Date DESC | nvbench |
CREATE TABLE table_name_73 (
rank INTEGER,
nationality VARCHAR,
time VARCHAR
) | What is the lowest rank with poland as the nationality and a time greater than 55.34? | SELECT MIN(rank) FROM table_name_73 WHERE nationality = "poland" AND time > 55.34 | sql_create_context |
CREATE TABLE table_25910 (
"Episode" text,
"First broadcast" text,
"Seans team" text,
"Daves team" text,
"Scores" text
) | What is the first broadcast date of the episode in which Dave's team is made up of Dave Johns and Sally Lindsay? | SELECT "First broadcast" FROM table_25910 WHERE "Daves team" = 'Dave Johns and Sally Lindsay' | wikisql |
CREATE TABLE table_name_8 (
season INTEGER,
home_team VARCHAR,
away_team VARCHAR
) | Can you tell me the highest Season that has the Home Team of chonburi, and the Away Team of melbourne victory? | SELECT MAX(season) FROM table_name_8 WHERE home_team = "chonburi" AND away_team = "melbourne victory" | sql_create_context |
CREATE TABLE table_33660 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | Who is Birmingham City's outgoing manager? | SELECT "Outgoing manager" FROM table_33660 WHERE "Team" = 'birmingham city' | wikisql |
CREATE TABLE table_49922 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Date" text
) | What is Away Team, when Home Team is 'Ipswich Town', and when Date is '6 February 1986'? | SELECT "Away team" FROM table_49922 WHERE "Home team" = 'ipswich town' AND "Date" = '6 february 1986' | wikisql |
CREATE TABLE table_1341586_44 (
candidates VARCHAR,
incumbent VARCHAR
) | Name all the candidates vying for Albert Bustamante's seat. | SELECT candidates FROM table_1341586_44 WHERE incumbent = "Albert Bustamante" | sql_create_context |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | In reference to EPID 813 , who has taught it in the past ? | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN semester... | advising |
CREATE TABLE table_48952 (
"Date" text,
"Venue" text,
"Opponents" text,
"Score" text,
"Round" text,
"Djurg\u00e5rden scorers" text,
"Attendance" text
) | What are the Opponents that have Djurg rden scorers of sj lund (2)? | SELECT "Opponents" FROM table_48952 WHERE "Djurg\u00e5rden scorers" = 'sjölund (2)' | wikisql |
CREATE TABLE table_204_800 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | how many sliver medal does bermuda has | SELECT "silver" FROM table_204_800 WHERE "nation" = 'bermuda' | squall |
CREATE TABLE table_11477 (
"Season" real,
"Series" text,
"Team Name" text,
"Races" text,
"Poles" text,
"Wins" text,
"Points" text,
"Final Placing" text
) | Which pole has a Season of 2009 and points of test driver? | SELECT "Poles" FROM table_11477 WHERE "Season" = '2009' AND "Points" = 'test driver' | wikisql |
CREATE TABLE table_203_860 (
id number,
"rank" number,
"city" text,
"population (2011)" number,
"population (2001)" number,
"state/territory" text
) | what is the total population for the 2011 year in the city of patna ? | SELECT "population (2011)" FROM table_203_860 WHERE "city" = 'patna' | squall |
CREATE TABLE table_39302 (
"Nationality" text,
"Matches" real,
"Drawn" real,
"Lost" real,
"Win %" real
) | Matches of 15, and a Win % smaller than 20 had what highest lost? | SELECT MAX("Lost") FROM table_39302 WHERE "Matches" = '15' AND "Win %" < '20' | wikisql |
CREATE TABLE table_27423 (
"Year" real,
"Competition Description" text,
"Location" text,
"Apparatus" text,
"Rank-Final" real,
"Score-Final" text,
"Rank-Qualifying" real,
"Score-Qualifying" text
) | How many competitions had a final score of 15.650? | SELECT COUNT("Competition Description") FROM table_27423 WHERE "Score-Final" = '15.650' | wikisql |
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_code varchar
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE flight_fare (
flight_id int,
f... | flights from INDIANAPOLIS to SEATTLE WASHINGTON | 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, state WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'INDIANAPOLIS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... | atis |
CREATE TABLE product (
product_id number,
product text,
dimensions text,
dpi number,
pages_per_minute_color number,
max_page_size text,
interface text
)
CREATE TABLE store_district (
store_id number,
district_id number
)
CREATE TABLE store (
store_id number,
store_name text... | How many stores are headquarted in each city? | SELECT t3.headquartered_city, COUNT(*) FROM store AS t1 JOIN store_district AS t2 ON t1.store_id = t2.store_id JOIN district AS t3 ON t2.district_id = t3.district_id GROUP BY t3.headquartered_city | spider |
CREATE TABLE table_name_38 (
tunnel VARCHAR,
length__imperial_ VARCHAR
) | What Tunnel has an Imperial Length of 307 yd? | SELECT tunnel FROM table_name_38 WHERE length__imperial_ = "307 yd" | sql_create_context |
CREATE TABLE table_28768469_7 (
game INTEGER,
location_attendance VARCHAR
) | What is listed in game when the location attendance is listed as Keyarena 16,841? | SELECT MAX(game) FROM table_28768469_7 WHERE location_attendance = "KeyArena 16,841" | sql_create_context |
CREATE TABLE table_name_92 (
score VARCHAR,
to_par VARCHAR,
player VARCHAR
) | What did vijay singh score with a +5 to par? | SELECT score FROM table_name_92 WHERE to_par = "+5" AND player = "vijay singh" | sql_create_context |
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,
... | tell me the discharge time and days for which patient with patient id 45962 was hospitalized. | SELECT demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.subject_id = "45962" | mimicsql_data |
CREATE TABLE table_name_59 (
attendance INTEGER,
date VARCHAR,
game VARCHAR
) | what is the attendance on the date of october 16 and the game is more than 5? | SELECT SUM(attendance) FROM table_name_59 WHERE date = "october 16" AND game > 5 | sql_create_context |
CREATE TABLE table_name_64 (
assists INTEGER,
games VARCHAR,
name VARCHAR
) | What is the average Assists, when Games is greater than 19, and when Name is 'Pablo Prigioni'? | SELECT AVG(assists) FROM table_name_64 WHERE games > 19 AND name = "pablo prigioni" | sql_create_context |
CREATE TABLE table_37701 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
) | What was the result for incumbent Joseph McKenna who was first elected in 1884? | SELECT "Result" FROM table_37701 WHERE "First elected" = '1884' AND "Incumbent" = 'joseph mckenna' | wikisql |
CREATE TABLE driver (
home_city VARCHAR,
age INTEGER
) | Show all home cities except for those having a driver older than 40. | SELECT home_city FROM driver EXCEPT SELECT home_city FROM driver WHERE age > 40 | sql_create_context |
CREATE TABLE procedures (
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 diagnoses (
... | what is date of birth and lab test name of subject name jerry deberry? | SELECT demographic.dob, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose days of hospital stay is greater than 16 and drug route is po? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "16" AND prescriptions.route = "PO" | mimicsql_data |
CREATE TABLE table_19953 (
"Name" text,
"Length" text,
"Tonnage" real,
"Built by" text,
"Year" real,
"Engines" text,
"Horsepowers" real,
"Former Names" text
) | Name the engines for state trust | SELECT "Engines" FROM table_19953 WHERE "Former Names" = 'State Trust' | wikisql |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE city (
city_code varchar,
city_name varchar,
state_code varchar,
country_name varchar,
time_zone_c... | list all the flights that takeoff from MKE | SELECT DISTINCT flight.flight_id FROM airport, flight WHERE airport.airport_code = 'MKE' AND flight.from_airport = airport.airport_code | atis |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE diagnoses_icd (
... | how much was patient 3125's body weight last measured during their current hospital encounter? | SELECT 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 = 3125 AND admissions.dischtime IS NULL)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items ... | mimic_iii |
CREATE TABLE station (
id INTEGER,
name TEXT,
lat NUMERIC,
long NUMERIC,
dock_count INTEGER,
city TEXT,
installation_date TEXT
)
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE weather (
date TEXT,
... | List the name and the number of stations for all the cities that have at least 15 stations with a bar chart. | SELECT city, COUNT(*) FROM station GROUP BY city | nvbench |
CREATE TABLE table_name_86 (
attendance VARCHAR,
opponent VARCHAR
) | What is the attendance when the opponent is the San Francisco 49ers? | SELECT attendance FROM table_name_86 WHERE opponent = "san francisco 49ers" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | count the number of patients whose admission type is elective and drug name is atorvastatin? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Atorvastatin" | mimicsql_data |
CREATE TABLE table_name_99 (
winner VARCHAR,
location VARCHAR
) | What is the winner for Virginia? | SELECT winner FROM table_name_99 WHERE location = "virginia" | sql_create_context |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
... | Create a bar chart showing meter_100 across meter 600, and display Y-axis in descending order. | SELECT meter_600, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
CREATE TABLE table_78503 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
) | When laps are less than 80 and Bruce mclaren is the driver, what is the grid? | SELECT "Grid" FROM table_78503 WHERE "Laps" < '80' AND "Driver" = 'bruce mclaren' | wikisql |
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr ... | How many rooms in each building have a capacity of over 50 Visualize by bar chart, and list in desc by the x axis. | SELECT building, COUNT(*) FROM classroom WHERE capacity > 50 GROUP BY building ORDER BY building DESC | nvbench |
CREATE TABLE table_41906 (
"Tie no" text,
"Home team" text,
"Score" text,
"Away team" text,
"Attendance" real
) | What is the sum of Attendance when macclesfield town was the way team? | SELECT SUM("Attendance") FROM table_41906 WHERE "Away team" = 'macclesfield town' | wikisql |
CREATE TABLE table_53043 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"School" text
) | Which is the biggest pick for Naperville Central High School? | SELECT MAX("Pick") FROM table_53043 WHERE "School" = 'naperville central high school' | wikisql |
CREATE TABLE table_43769 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"Record" text,
"Streak" text
) | Which Date has a Streak of win 1, and a Record of 8 4? | SELECT "Date" FROM table_43769 WHERE "Streak" = 'win 1' AND "Record" = '8–4' | wikisql |
CREATE TABLE table_10793 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | What was the loss for June 2? | SELECT "Loss" FROM table_10793 WHERE "Date" = 'june 2' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 医疗就诊47602760755具体负责出院诊断的是哪位医生,这位医生的编码和名称是什么 | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE MED_CLINIC_ID = '47602760755' | css |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Tags (
Id number,
TagName text,
Count num... | Recent short answers containing only links. Posts containing a body that is less than 8 chars long | SELECT Id AS "post_link", Body FROM Posts WHERE PostTypeId = 2 AND Id > 0 AND Id < 2000000 AND Body LIKE '%how can i%' AND NOT Body LIKE '%<blockquote>%' AND NOT Body LIKE '%<em>%' AND LENGTH(Body) < 1000 ORDER BY Id DESC | sede |
CREATE TABLE table_34794 (
"Date" text,
"Result" text,
"Score" text,
"Brazil scorers" text,
"Competition" text
) | Which Score has a Competition of world cup qualifying, and a Brazil scorers of baltazar, and a Date of march 14, 1954? | SELECT "Score" FROM table_34794 WHERE "Competition" = 'world cup qualifying' AND "Brazil scorers" = 'baltazar' AND "Date" = 'march 14, 1954' | wikisql |
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, show me about the distribution of name and revenue , and group by attribute headquarter in a bar chart, and could you list by the Revenue in desc? | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T2.Revenue DESC | nvbench |
CREATE TABLE table_17226 (
"State" text,
"Norwegian Americans (1980)" real,
"Percent (1980)" text,
"Norwegian Americans (1990)" real,
"Percent (1990)" text,
"Norwegian Americans (2000)" real,
"Percent (2000)" text,
"Norwegian Americans (2009)" real,
"Percent (2009)" text
) | what are all the percent (1990) where state is united states | SELECT "Percent (1990)" FROM table_17226 WHERE "State" = 'United States' | wikisql |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE days (
days_code varchar,
day_name varchar
)
... | what does the fare code YN mean | SELECT DISTINCT fare_basis_code FROM fare_basis WHERE fare_basis_code = 'YN' | atis |
CREATE TABLE phone_market (
Market_ID int,
Phone_ID text,
Num_of_stock int
)
CREATE TABLE market (
Market_ID int,
District text,
Num_of_employees int,
Num_of_shops real,
Ranking int
)
CREATE TABLE phone (
Name text,
Phone_ID int,
Memory_in_G int,
Carrier text,
Price... | Plot total number of memory in g by grouped by carrier as a bar graph, could you rank by the x axis from high to low please? | SELECT Carrier, SUM(Memory_in_G) FROM phone GROUP BY Carrier ORDER BY Carrier DESC | nvbench |
CREATE TABLE table_76851 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What is the name of the club when the played number is 22, and the try bonus was 0? | SELECT "Club" FROM table_76851 WHERE "Played" = '22' AND "Try bonus" = '0' | wikisql |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id numb... | how many people have had microbiological tests in their rapid respiratory viral antigen test? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'rapid respiratory viral antigen test') | mimic_iii |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 病患郑自珍大腿的检测各项指标结果如何? | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZ... | css |
CREATE TABLE table_name_14 (
motorcycle VARCHAR,
wins VARCHAR
) | How many times was the motorcycle ducati 916 2nd place when wins is less than 7? | SELECT SUM(2 AS nd_pl) FROM table_name_14 WHERE motorcycle = "ducati 916" AND wins < 7 | sql_create_context |
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 average age of patients whose ethnicity is white and admission year is greater than or equal to 2123? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.ethnicity = "WHITE" AND demographic.admityear >= "2123" | mimicsql_data |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | what are the four most frequent diagnoses that patients were diagnosed in the same hospital encounter after having received a packed cell transfusion procedure? | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.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, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_i... | mimic_iii |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_... | what's the name of the insurance for patient 18159 on the first hospital visit? | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 18159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | what are the five most frequently ordered medications since 2101? | SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE STRFTIME('%y', medication.drugstarttime) >= '2101' GROUP BY medication.drugname) AS t1 WHERE t1.c1 <= 5 | eicu |
CREATE TABLE table_9456 (
"Year" real,
"Winners" text,
"Score" text,
"Runners-up" text,
"Venue" text
) | WHICH Venue IS after 1992 with a Score of 1 0 and a Winners of us chaouia? | SELECT "Venue" FROM table_9456 WHERE "Year" > '1992' AND "Score" = '1 – 0' AND "Winners" = 'us chaouia' | wikisql |
CREATE TABLE table_57897 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What is the nationality of the player Tom Boswell? | SELECT "Nationality" FROM table_57897 WHERE "Player" = 'tom boswell' | wikisql |
CREATE TABLE table_57710 (
"Year" text,
"Division" text,
"League" text,
"Reg. Season" text,
"Playoffs" text,
"Open Cup" text
) | Name the league for 1994 | SELECT "League" FROM table_57710 WHERE "Year" = '1994' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistoryTypes (
Id numb... | Another Way for Generating Sequence Of Numbers. | WITH temp AS (SELECT n FROM (VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9)) AS temp(n)), nums AS (SELECT t1.n * 100 + t2.n * 10 + t3.n + 1 AS n FROM temp AS t1 CROSS JOIN temp AS t2 CROSS JOIN temp AS t3) SELECT n FROM nums ORDER BY n | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.