context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE zyb (
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... | 列出从2000年6月5日到2019年12月1日,患者75549243被开出的所有药品的编号、数量、名字、单价、数额多少? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '75549243' AND qtb.IN_HOSP_DATE BETWEEN '2000-06-05' AND '2019-12-01' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_k... | css |
CREATE TABLE table_18646 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | When was incumbent Leo E. Allen first elected? | SELECT MIN("First elected") FROM table_18646 WHERE "Incumbent" = 'Leo E. Allen' | wikisql |
CREATE TABLE table_37888 (
"Auction House" text,
"Year" real,
"Event" text,
"Price" real,
"GBP Price" real
) | What is the average GBP Price with an event in Monterey, a RM auction house, and a price of $154,000 later than 2003? | SELECT AVG("GBP Price") FROM table_37888 WHERE "Event" = 'monterey' AND "Auction House" = 'rm' AND "Price" = '154,000' AND "Year" > '2003' | wikisql |
CREATE TABLE table_13232 (
"Rank" real,
"Player" text,
"Wickets" real,
"Average" real,
"Career" text
) | What was the career of the rank higher than 1, with an average less than 36.13 and 15 wickets, and player George O'Brien? | SELECT "Career" FROM table_13232 WHERE "Rank" > '1' AND "Average" < '36.13' AND "Wickets" = '15' AND "Player" = 'george o''brien' | wikisql |
CREATE TABLE table_26638600_3 (
lites_2_race_two_winning_team VARCHAR,
lites_1_race_two_winning_team VARCHAR
) | Who is the lites 2 race two winning team when #11 Performance Tech is the lites 1 race two winning team? | SELECT lites_2_race_two_winning_team FROM table_26638600_3 WHERE lites_1_race_two_winning_team = "#11 Performance Tech" | sql_create_context |
CREATE TABLE table_name_81 (
gold INTEGER,
total INTEGER
) | For countries that won more than 32 gold medals, what was the highest number of golds? | SELECT MAX(gold) FROM table_name_81 WHERE total > 32 | 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,
... | how many patients whose year of birth is less than 2031 and diagnoses short title is dysphagia nec? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2031" AND diagnoses.short_title = "Dysphagia NEC" | mimicsql_data |
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 prescription... | how many patients whose marital status is married and procedure long title is transfusion of packed cells? | 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.long_title = "Transfusion of packed cells" | mimicsql_data |
CREATE TABLE table_50382 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the average pick with 85 overall in a round lower than 3? | SELECT AVG("Pick") FROM table_50382 WHERE "Overall" = '85' AND "Round" < '3' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | User Answer Accepted Rate (per tag). Gives the percentage of accepted answers for a user, per tag. | SELECT t.TagName, COUNT(*) AS NumAnswers, SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) AS NumAccepted, (SUM(CASE WHEN q.AcceptedAnswerId = a.Id THEN 1 ELSE 0 END) * 100.0 / COUNT(*)) AS AcceptedPercent FROM Posts AS a INNER JOIN Posts AS q ON a.ParentId = q.Id INNER JOIN PostTags AS pt ON pt.PostId = q.Id... | sede |
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_id varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE semester (
... | What classes can I finish this semester that are a prerequisite for most other classes ? | SELECT COUNT(DISTINCT COURSE_PREREQUISITEalias0.course_id), COURSEalias0.department, COURSEalias0.name, COURSEalias0.number FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course AS COURSEalias1, course_offering AS COURSE_OFFERINGali... | advising |
CREATE TABLE table_49631 (
"Game" text,
"Date" text,
"Home Team" text,
"Result" text,
"Road Team" text
) | Which road team has a result of 117-114? | SELECT "Road Team" FROM table_49631 WHERE "Result" = '117-114' | wikisql |
CREATE TABLE table_58165 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What is the name of the team with a qual 1 time of 1:17.481? | SELECT "Team" FROM table_58165 WHERE "Qual 1" = '1:17.481' | wikisql |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE R... | D&D family views vs total views. | WITH results AS (SELECT (SELECT SUM(ViewCount) FROM Posts WHERE PostTypeId = 1 AND (Posts.Tags LIKE '%dnd%' OR Posts.Tags LIKE '%pathfinder%' OR Posts.Tags LIKE '%dungeons-and-dragons%')) AS DndViews, (SELECT SUM(ViewCount) FROM Posts WHERE PostTypeId = 1) AS TotalViews) SELECT DndViews, TotalViews, (DndViews * 1.0 / T... | sede |
CREATE TABLE table_80336 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
) | Which date has 3 as the goal? | SELECT "Date" FROM table_80336 WHERE "Goal" = '3' | wikisql |
CREATE TABLE table_1341453_40 (
first_elected VARCHAR,
incumbent VARCHAR
) | When was incumbent Bud Shuster first elected? | SELECT first_elected FROM table_1341453_40 WHERE incumbent = "Bud Shuster" | sql_create_context |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 检验报告单在2006年1月26日到2013年1月28日医疗机构4874392内开出的数量有多少? | SELECT COUNT(*) FROM zyjybgb WHERE zyjybgb.YLJGDM = '4874392' AND zyjybgb.BGRQ BETWEEN '2006-01-26' AND '2013-01-28' UNION SELECT COUNT(*) FROM mzjybgb WHERE mzjybgb.YLJGDM = '4874392' AND mzjybgb.BGRQ BETWEEN '2006-01-26' AND '2013-01-28' | css |
CREATE TABLE table_66303 (
"Score" text,
"Shooter" text,
"Date" text,
"Comp" text,
"Place" text
) | What's the date when the score was 690.3? | SELECT "Date" FROM table_66303 WHERE "Score" = '690.3' | wikisql |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayNa... | Users with most Necromancer badges. Most decorated users | SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS rank, UserId AS "user_link", COUNT(*) AS badges FROM Badges WHERE Name = 'Necromancer' GROUP BY UserId ORDER BY Badges DESC LIMIT 120 | sede |
CREATE TABLE Sales (
sales_transaction_id INTEGER,
sales_details VARCHAR(255)
)
CREATE TABLE Transactions (
transaction_id INTEGER,
investor_id INTEGER,
transaction_type_code VARCHAR(10),
date_of_transaction DATETIME,
amount_of_transaction DECIMAL(19,4),
share_count VARCHAR(40),
oth... | A line chart for what are the number of the dates of transactions with at least 100 share count or amount bigger than 100?, and sort from high to low by the X-axis. | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE share_count >= 100 OR amount_of_transaction >= 100 ORDER BY date_of_transaction DESC | nvbench |
CREATE TABLE table_2562572_27 (
dominant_religion__2002_ VARCHAR,
population__2011_ VARCHAR
) | What are the dominant religions in the place with a population of 83? | SELECT dominant_religion__2002_ FROM table_2562572_27 WHERE population__2011_ = "83" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
h... | when did patient 32168 have a hemoglobin test for the first time on their first hospital visit? | SELECT labevents.charttime FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'hemoglobin') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 32168 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime ... | mimic_iii |
CREATE TABLE table_20704243_5 (
us_viewers__in_millions_ VARCHAR,
series__number VARCHAR
) | Name the number of viewers for series number 50 | SELECT us_viewers__in_millions_ FROM table_20704243_5 WHERE series__number = 50 | sql_create_context |
CREATE TABLE table_47539 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
) | What is the Grid of R gis Laconi's bike that is a Kawasaki zx-10r? | SELECT "Grid" FROM table_47539 WHERE "Bike" = 'kawasaki zx-10r' AND "Rider" = 'régis laconi' | wikisql |
CREATE TABLE table_36616 (
"Athlete" text,
"Event" text,
"Quarterfinal" text,
"Semifinal" text,
"Final" text
) | What is the event result for athlete Ali Ekranpour? | SELECT "Event" FROM table_36616 WHERE "Athlete" = 'ali ekranpour' | wikisql |
CREATE TABLE table_name_20 (
prom__m_ VARCHAR,
class VARCHAR,
height__m_ VARCHAR
) | What is the prom with Hewitt class and a Height (m) of 715? | SELECT prom__m_ FROM table_name_20 WHERE class = "hewitt" AND height__m_ = 715 | sql_create_context |
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
)
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
) | Draw a pie chart for how many captains with younger than 50 are in each rank? | SELECT Rank, COUNT(*) FROM captain WHERE age < 50 GROUP BY Rank | nvbench |
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... | During the Spring of 2019 how many professors teach LATIN 993 ? | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'LATIN' AND course.number = 993 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offe... | advising |
CREATE TABLE paper (
paperid int,
title varchar,
venueid int,
year int,
numciting int,
numcitedby int,
journalid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE cite (
citi... | How many citations does li dong 's Semantic Parsing paper have ? | SELECT DISTINCT COUNT(cite.citingpaperid) FROM author, cite, keyphrase, paperkeyphrase, writes WHERE author.authorname = 'li dong' AND keyphrase.keyphrasename = 'Semantic Parsing' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND writes.authorid = author.authorid AND writes.paperid = cite.citedpaperid AND writ... | scholar |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE diagnosis (
diagnosisid num... | what are the four most frequent specimen tests since 3 years ago? | SELECT t1.culturesite FROM (SELECT microlab.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microlab WHERE DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-3 year') GROUP BY microlab.culturesite) AS t1 WHERE t1.c1 <= 4 | eicu |
CREATE TABLE table_57706 (
"Date" text,
"Course" text,
"Distance" text,
"Type" text,
"Winner" text
) | What type of race took place on the course Orta San Giulio to Milan? | SELECT "Type" FROM table_57706 WHERE "Course" = 'orta san giulio to milan' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE... | For all employees who have the letters D or S in their first name, give me the trend about employee_id over hire_date . | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_nam... | Plot how many booking start date by grouped by booking start date as a bar graph | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings | nvbench |
CREATE TABLE table_14070 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What tournament is played on a carpet surface? | SELECT "Tournament" FROM table_14070 WHERE "Surface" = 'carpet' | wikisql |
CREATE TABLE table_63776 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | What is the total number for the position that has less than 2 draws, less than 9 losses and more than 24? | SELECT COUNT("Position") FROM table_63776 WHERE "Drawn" < '2' AND "Lost" < '9' AND "Points" > '24' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar... | ENVIRON 255 courses will be taught by how many professors in Fall 2008 ? | SELECT COUNT(DISTINCT instructor.instructor_id) FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ENVIRON' AND course.number = 255 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.of... | advising |
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,
... | provide the number of patients whose insurance is self pay and lab test name is fibrin degradation products? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Self Pay" AND lab.label = "Fibrin Degradation Products" | mimicsql_data |
CREATE TABLE table_name_11 (
feet INTEGER,
latitude__n_ VARCHAR,
metres VARCHAR
) | What is the average feet that has a Latitude (N) of 35 48 35 , and under 8,047m? | SELECT AVG(feet) FROM table_name_11 WHERE latitude__n_ = "35°48′35″" AND metres < 8 OFFSET 047 | sql_create_context |
CREATE TABLE schedule (
Cinema_ID int,
Film_ID int,
Date text,
Show_times_per_day int,
Price float
)
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cine... | A bar chart showing the number of films each cinema has, order Y-axis from low to high order. | SELECT Name, COUNT(Name) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name ORDER BY COUNT(Name) | nvbench |
CREATE TABLE table_name_82 (
label VARCHAR,
format VARCHAR,
region VARCHAR
) | What was the label in the region of Argentina and had a format of CD? | SELECT label FROM table_name_82 WHERE format = "cd" AND region = "argentina" | sql_create_context |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
ap... | Show the facility codes of apartments with more than 4 bedrooms, and count them by a bar chart | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code | nvbench |
CREATE TABLE table_75637 (
"Country" text,
"Political Rights 2010" real,
"Civil Liberties 2010" real,
"Status 2010" text,
"Political Rights 2011" real,
"Civil Liberties 2011" real,
"Status 2011" text,
"Political Rights 2012" real,
"Civil Liberties 2012" real,
"Status 2012" text,
... | How many civil liberties 2013 values are associated with a 2010 political rights value of 6, civil liberties 2012 values over 5, and political rights 2011 under 6? | SELECT COUNT("Civil Liberties 2013") FROM table_75637 WHERE "Political Rights 2010" = '6' AND "Civil Liberties 2012" > '5' AND "Political Rights 2011" < '6' | wikisql |
CREATE TABLE table_27756014_1 (
score VARCHAR,
game VARCHAR
) | What is the score of game 4? | SELECT score FROM table_27756014_1 WHERE game = 4 | sql_create_context |
CREATE TABLE table_name_76 (
home VARCHAR,
visitor VARCHAR
) | Name the home with chicago visiting | SELECT home FROM table_name_76 WHERE visitor = "chicago" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | how many patients whose lab test name is alveolar-arterial gradient? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Alveolar-arterial Gradient" | 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,
... | how much is the minimum cost for a hospital that contains indomethacin until 4 years ago? | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'indomethacin') AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.hadm_id) AS t1 | mimic_iii |
CREATE TABLE table_30831 (
"Round" real,
"Date" text,
"Grand Prix" text,
"Circuit" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text
) | Who won the race on June 26? | SELECT "Race Winner" FROM table_30831 WHERE "Date" = 'June 26' | wikisql |
CREATE TABLE table_name_41 (
year INTEGER,
competition VARCHAR
) | What year was the competition vitry-sur-seine humarathon? | SELECT AVG(year) FROM table_name_41 WHERE competition = "vitry-sur-seine humarathon" | sql_create_context |
CREATE TABLE table_35955 (
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is the score of the tournament on November 5, 2007 with a carpet surface? | SELECT "Score" FROM table_35955 WHERE "Surface" = 'carpet' AND "Date" = 'november 5, 2007' | wikisql |
CREATE TABLE table_10773 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where was the game played where North Melbourne was the away team? | SELECT "Venue" FROM table_10773 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight 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 TA... | what is the cost of LIMOUSINE service in PHILADELPHIA | SELECT DISTINCT ground_service.ground_fare FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'LIMOUSINE' | atis |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | how many patients whose lab test name is renal epithelial cells? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Renal Epithelial Cells" | mimicsql_data |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | in 2105, what is the list of the five most frequent specimen tests ordered for patients in the same hospital visit after being diagnosed with loc osteoarth nos-l/leg? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnos... | mimic_iii |
CREATE TABLE table_name_5 (
name VARCHAR,
pos VARCHAR,
club VARCHAR,
height VARCHAR
) | What D Player with a Height of m (ft 4in) is in the Spandau 04 Club? | SELECT name FROM table_name_5 WHERE club = "spandau 04" AND height = "m (ft 4in)" AND pos = "d" | sql_create_context |
CREATE TABLE table_name_34 (
area INTEGER,
name VARCHAR,
municipal_code VARCHAR
) | What's the area of ask y, with a Municipal code less than 1247? | SELECT SUM(area) FROM table_name_34 WHERE name = "askøy" AND municipal_code < 1247 | sql_create_context |
CREATE TABLE table_22756549_1 (
winner VARCHAR,
runner_up_a VARCHAR
) | Who won when V. A. Muthiah was the runner-up? | SELECT winner FROM table_22756549_1 WHERE runner_up_a = "V. A. Muthiah" | sql_create_context |
CREATE TABLE table_73580 (
"No. in Series" real,
"No. in Season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | When did the episode viewed by 10.50 millions of people in the US run for the first time? | SELECT "Original air date" FROM table_73580 WHERE "U.S. viewers (millions)" = '10.50' | wikisql |
CREATE TABLE table_2818164_4 (
no_in_series INTEGER,
directed_by VARCHAR,
original_air_date VARCHAR
) | What is the series number for the episode directed by jay sandrich that aired October 23, 1986? | SELECT MIN(no_in_series) FROM table_2818164_4 WHERE directed_by = "Jay Sandrich" AND original_air_date = "October 23, 1986" | sql_create_context |
CREATE TABLE table_71462 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | What label is the ALCA-9197 Catalog? | SELECT "Label" FROM table_71462 WHERE "Catalog" = 'alca-9197' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,... | 孙文敏病患从07年9月1日到2018年9月21日之间所有检测结果指标记录的检测员为编码02458651的检验指标流水号是多少? | SELECT jyjgzbb.JYZBLSH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jyb... | css |
CREATE TABLE table_10106 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Which home team had a crowd size of 14,000 at Junction Oval? | SELECT "Home team" FROM table_10106 WHERE "Crowd" > '14,000' AND "Venue" = 'junction oval' | wikisql |
CREATE TABLE d_icd_diagnoses (
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
)
... | calculate the number of patients who had received a fiber-optic bronchoscopy procedure until 1 year ago. | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'fiber-optic bronchoscopy') AND DATETIME(procedures_i... | mimic_iii |
CREATE TABLE inst (
name VARCHAR,
instid VARCHAR
)
CREATE TABLE papers (
paperid VARCHAR
)
CREATE TABLE authorship (
instid VARCHAR,
paperid VARCHAR
) | Find the name of the organization that has published the largest number of papers. | SELECT t1.name FROM inst AS t1 JOIN authorship AS t2 ON t1.instid = t2.instid JOIN papers AS t3 ON t2.paperid = t3.paperid GROUP BY t1.name ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_test_10 (
"id" int,
"left_ventricular_ejection_fraction_lvef" int,
"systolic_blood_pressure_sbp" int,
"immunosuppressive_disease" bool,
"systolic_arterial_pressure_sap" int,
"lymphomas" bool,
"left_ventricular_dysfunction" bool,
"tissue_hypoperfusion" bool,
"heart_... | prior history of heart failure, left ventricular dysfunction or cardiomyopathy | SELECT * FROM table_test_10 WHERE heart_disease = 1 OR left_ventricular_dysfunction = 1 OR cardiomyopathy = 1 | criteria2sql |
CREATE TABLE table_72444 (
"County" text,
"Population" real,
"Per capita income" text,
"Median household income" text,
"Median family income" text
) | What is the per capita income of shasta? | SELECT "Per capita income" FROM table_72444 WHERE "County" = 'Shasta' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | 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, what is the relationship between employee_id and manager_id ? | SELECT EMPLOYEE_ID, MANAGER_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_70 (
country VARCHAR,
player VARCHAR
) | What country does Bobby Nichols play for? | SELECT country FROM table_name_70 WHERE player = "bobby nichols" | 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... | 在11-12-13到19-01-19期间内,患者凤飞尘被开出的所有检验报告单中的标本采集部位需要列出来 | SELECT jybgb.BBCJBW FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND 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_MZJZJL... | css |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | count the number of patients whose primary disease is pneumonia and procedure short title is circumcision. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "PNEUMONIA" AND procedures.short_title = "Circumcision" | mimicsql_data |
CREATE TABLE table_name_81 (
years VARCHAR,
jersey_number_s_ VARCHAR
) | What years did jersey number 55 play? | SELECT years FROM table_name_81 WHERE jersey_number_s_ = "55" | sql_create_context |
CREATE TABLE table_name_72 (
rookie_of_the_year VARCHAR,
season VARCHAR
) | Who was the Rookie of the Year for the Season in 2000? | SELECT rookie_of_the_year FROM table_name_72 WHERE season = 2000 | sql_create_context |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
previous_transaction_id INTEGER,
account_id INTEGER,
card_id INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DOUBLE,
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(... | What are the different card types, and how many transactions have been made with each Visualize by bar chart, could you order bars in asc order? | SELECT card_type_code, COUNT(*) FROM Financial_Transactions AS T1 JOIN Customers_Cards AS T2 ON T1.card_id = T2.card_id GROUP BY T2.card_type_code ORDER BY card_type_code | nvbench |
CREATE TABLE table_name_99 (
total VARCHAR,
finish VARCHAR
) | What is the total when the finish was t44? | SELECT total FROM table_name_99 WHERE finish = "t44" | 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
) | What is the total revenue of each manufacturer, and order in desc by the names. | SELECT Name, SUM(Revenue) FROM Manufacturers GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_name_48 (
date VARCHAR,
away_team VARCHAR
) | On which date did Footscray play an away game? | SELECT date FROM table_name_48 WHERE away_team = "footscray" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 就诊患者35446983768被开出了哪些名字里包含多奈哌齐的药品花了多少钱? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '35446983768' AND t_kc22.SOC_SRT_DIRE_NM LIKE '%多奈哌齐%' | css |
CREATE TABLE table_name_21 (
home_team VARCHAR
) | What did Hawthorn score as the home team? | SELECT home_team AS score FROM table_name_21 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE table_204_673 (
id number,
"name" text,
"egot completed" text,
"emmy" number,
"grammy" number,
"oscar" number,
"tony" number
) | of those actresses receiving a tony after 1960 , which took the most amount of years to get their egot completed . | SELECT "name" FROM table_204_673 WHERE "tony" > 1960 ORDER BY "egot completed" DESC LIMIT 1 | squall |
CREATE TABLE table_204_51 (
id number,
"week #" text,
"theme" text,
"song choice" text,
"original artist" text,
"order #" number,
"result" text
) | which came first , the judge 's choice or birth year song ? | SELECT "theme" FROM table_204_51 WHERE "theme" IN ("judge's choice", 'birth year songs') ORDER BY "order #" LIMIT 1 | squall |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
C... | 名称不包含神经科的科室开出的所有医疗费用在医疗就诊33693601206中明细项目是哪些呢? | SELECT * FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '33693601206' AND NOT t_kc22.MED_ORG_DEPT_NM LIKE '%神经科%' | css |
CREATE TABLE table_29676 (
"Week #" text,
"Theme" text,
"Song Choice" text,
"Original Artist" text,
"Order #" text,
"Result" text
) | What was the result of the Top 12 Men theme? | SELECT "Result" FROM table_29676 WHERE "Theme" = 'Top 12 Men' | wikisql |
CREATE TABLE table_16677887_2 (
opponent VARCHAR,
bills_first_downs VARCHAR
) | What team were the bills playing where their first down was 23? | SELECT opponent FROM table_16677887_2 WHERE bills_first_downs = 23 | sql_create_context |
CREATE TABLE Course_Authors_and_Tutors (
author_id INTEGER,
author_tutor_ATB VARCHAR(3),
login_name VARCHAR(40),
password VARCHAR(40),
personal_name VARCHAR(80),
middle_name VARCHAR(80),
family_name VARCHAR(80),
gender_mf VARCHAR(1),
address_line_1 VARCHAR(80)
)
CREATE TABLE Courses... | Find the number of courses for each subject in a bar chart, and order total number in desc order. | SELECT subject_name, COUNT(*) FROM Courses AS T1 JOIN Subjects AS T2 ON T1.subject_id = T2.subject_id GROUP BY T1.subject_id ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_99 (
country VARCHAR,
place VARCHAR,
score VARCHAR
) | What is the Country with the T3 Place Player with a Score of 71-76-71=218? | SELECT country FROM table_name_99 WHERE place = "t3" AND score = 71 - 76 - 71 = 218 | sql_create_context |
CREATE TABLE table_66604 (
"Frequency" text,
"Call sign" text,
"Branding" text,
"Format" text,
"Owner" text
) | What format is Premi re Cha ne? | SELECT "Format" FROM table_66604 WHERE "Branding" = 'première chaîne' | wikisql |
CREATE TABLE table_51902 (
"Draw" real,
"Artist" text,
"Song" text,
"Rank" real,
"Points" real,
"A. Krajka" real,
"Gj. Leka" real,
"B. Haxhia" real,
"D. Tukiqi" real,
"R. Magjistari" real,
"Gj. Xhuvani" real,
"A. Sk\u00ebnderaj" real
) | For R. Magjistari scores over 12, what is the highest number of points? | SELECT MAX("Points") FROM table_51902 WHERE "R. Magjistari" > '12' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | what was the name of the specimen test that patient 031-22988 last received until 03/2104. | SELECT microlab.culturesite FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-22988')) AND STRFTIME('%y-%m', microlab.culturetakentime) <= '2104... | eicu |
CREATE TABLE table_name_41 (
drawn VARCHAR,
lost VARCHAR,
played VARCHAR
) | How many games drawn when there are 78 losses and over 121 games played? | SELECT COUNT(drawn) FROM table_name_41 WHERE lost = 78 AND played > 121 | sql_create_context |
CREATE TABLE table_11622829_1 (
date VARCHAR,
score VARCHAR
) | What are all the dates with a score of 203 (-13)? | SELECT date FROM table_11622829_1 WHERE score = "203 (-13)" | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | Questions I've answered that are closed. | SELECT Score AS "question_score", Id AS "post_link", ClosedDate FROM Posts WHERE PostTypeId = 1 AND NOT ClosedDate IS NULL AND Id IN (SELECT ParentId FROM Posts WHERE NOT ParentId IS NULL AND OwnerUserId = '##MyID##') | sede |
CREATE TABLE airport (
airport_code varchar,
airport_name text,
airport_location text,
state_code varchar,
country_name varchar,
time_zone_code varchar,
minimum_connect_time int
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description... | explain the restriction AP/57 | SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/57' | atis |
CREATE TABLE table_50294 (
"Parameter" text,
"1st stage" text,
"2nd stage" text,
"3rd stage" text,
"4th stage" text
) | What is the third stage that has the first phase of 5,443kg? | SELECT "3rd stage" FROM table_50294 WHERE "1st stage" = '5,443kg' | 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 demographic (
subject_id text,
hadm_id t... | what is procedure short title of procedure icd9 code 9744? | SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "9744" | 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
) | how many products are there for each manufacturer?, display in desc by the bar. | SELECT T2.Name, COUNT(*) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime t... | what was the last procedure time patient 035-14278 has had during a year before? | SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-14278')) AND DATETIME(treatment.treatmenttime, 'start of year... | eicu |
CREATE TABLE Products (
Product_Name VARCHAR,
Product_Price VARCHAR
) | List the name of products in ascending order of price. | SELECT Product_Name FROM Products ORDER BY Product_Price | sql_create_context |
CREATE TABLE table_name_71 (
year INTEGER,
runner_s__up VARCHAR
) | Which Year has a Runner(s)-up of tammie green? | SELECT MIN(year) FROM table_name_71 WHERE runner_s__up = "tammie green" | sql_create_context |
CREATE TABLE document_locations (
document_id number,
location_code text,
date_in_location_from time,
date_in_locaton_to time
)
CREATE TABLE documents_to_be_destroyed (
document_id number,
destruction_authorised_by_employee_id number,
destroyed_by_employee_id number,
planned_destruction... | How many document types are there? | SELECT COUNT(*) FROM ref_document_types | spider |
CREATE TABLE table_76884 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | What is the earliest game with a score of 99-89? | SELECT MIN("Game") FROM table_76884 WHERE "Score" = '99-89' | wikisql |
CREATE TABLE table_name_17 (
score VARCHAR,
game VARCHAR,
points VARCHAR
) | Which Score has a Game larger than 7, and Points smaller than 14? | SELECT score FROM table_name_17 WHERE game > 7 AND points < 14 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.