context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
language text,
marital_status text,
ethnicity text,
age number
)
CREATE ... | i would like to know the daily average amount of replete that patient 20251 has received since 21 months ago. | SELECT AVG(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20251)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab... | mimic_iii |
CREATE TABLE table_48670 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"Location Attendance" text,
"Record" text
) | What is High Rebounds, when Location Attendance is 'Time Warner Cable Arena 10,848'? | SELECT "High rebounds" FROM table_48670 WHERE "Location Attendance" = 'time warner cable arena 10,848' | wikisql |
CREATE TABLE table_51471 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who is the home team that played the away team that scored 11.13 (79)? | SELECT "Home team score" FROM table_51471 WHERE "Away team score" = '11.13 (79)' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 从0一年七月二十七日开始,截止到一一年六月十八日,将近十年间找医生59717906医治的门诊病人有多少 | SELECT COUNT(person_info.RYBH) FROM hz_info JOIN mzjzjlb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_info.YLJGDM = hz_info.YLJGD... | css |
CREATE TABLE table_name_55 (
batting_team VARCHAR,
venue VARCHAR
) | What batting team played in Karachi? | SELECT batting_team FROM table_name_55 WHERE venue = "karachi" | sql_create_context |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
semester int,
section_number int,
start_time time,
end_time time,
monday varchar,
tuesday varchar,
wednesday varchar,
thursday varchar... | When it comes to next semester , what upper-level electives are offered that do n't meet on Monday or Friday ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course... | advising |
CREATE TABLE table_68129 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
) | How many races have less than 2 podiums and 19th position before 2009? | SELECT AVG("Races") FROM table_68129 WHERE "Podiums" < '2' AND "Position" = '19th' AND "Season" < '2009' | wikisql |
CREATE TABLE table_74841 (
"Region" text,
"Date" text,
"Label" text,
"Format" text,
"Catalog" text
) | Which Format has a Region of united states, and a Catalog of kem 072? | SELECT "Format" FROM table_74841 WHERE "Region" = 'united states' AND "Catalog" = 'kem 072' | 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... | Count of Question with no Accepted Answer. | SELECT COUNT(Q.Id) FROM Posts AS Q WHERE Q.AcceptedAnswerId IS NULL AND Q.PostTypeId = 1 AND q.ClosedDate IS NULL | sede |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
... | Top Android Users in Barcelona. | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE table_11677691_7 (
player VARCHAR,
school VARCHAR
) | Which player is from Joliet Catholic HIgh School? | SELECT player FROM table_11677691_7 WHERE school = "Joliet Catholic High school" | sql_create_context |
CREATE TABLE table_name_54 (
score VARCHAR,
to_par VARCHAR,
country VARCHAR
) | What is the score of the player with a To Par of +1 from Spain? | SELECT score FROM table_name_54 WHERE to_par = "+1" AND country = "spain" | 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 number of american indian/alaska native patients who were born before 2083. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND demographic.dob_year < "2083" | mimicsql_data |
CREATE TABLE table_8289 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | Which tournament had an opponent of petra krejsov tereza smitkov ? | SELECT "Tournament" FROM table_8289 WHERE "Opponents" = 'petra krejsová tereza smitková' | wikisql |
CREATE TABLE table_58155 (
"Grand Prix" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Constructor" text,
"Report" text
) | When was the Austrian Grand Prix? | SELECT "Date" FROM table_58155 WHERE "Grand Prix" = 'austrian grand prix' | wikisql |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE FlagTypes (
Id ... | How many unanswered EOL questions are there?. This is a rough estimate | SELECT Id AS "post_link", Score, CreationDate, ViewCount, Tags FROM Posts WHERE Id NOT IN (SELECT ParentId FROM Posts WHERE PostTypeId = 2 AND Score >= 1 AND ClosedDate IS NULL) AND (Tags LIKE '%10.%' OR Tags LIKE '%9.%' OR Tags LIKE '%8.%' OR Tags LIKE '%11.04%' OR Tags LIKE '%7.%' OR Tags LIKE '%6.%') AND ClosedDate ... | sede |
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machine_series text,
value_points real,
quality_rank int
)
CREATE TABLE repair_assignment (
technician_id int,
repair_ID int,
Machine_ID int
)
CREATE TABLE repair (
repair_ID int,
name text,
... | What are the names of the technicians by ascending order of quality rank for the machine they are assigned, and count them by a pie chart | SELECT Name, COUNT(Name) FROM repair_assignment AS T1 JOIN machine AS T2 ON T1.Machine_ID = T2.Machine_ID JOIN technician AS T3 ON T1.technician_id = T3.technician_id GROUP BY Name ORDER BY T2.quality_rank | nvbench |
CREATE TABLE table_14282 (
"Rank" real,
"Rowers" text,
"Country" text,
"Time" text,
"Notes" text
) | What country had a 6:55.23 time? | SELECT "Country" FROM table_14282 WHERE "Time" = '6:55.23' | wikisql |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER... | Show all allergy types and the number of allergies in each type by a pie chart. | SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType | 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_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking... | Return the number of booking start date for the apartments that have type code 'Duplex' for each year in a bar chart, and could you rank y axis in asc order? | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" ORDER BY COUNT(booking_start_date) | nvbench |
CREATE TABLE table_name_54 (
season VARCHAR,
date VARCHAR
) | What season had a date of 30 august 1980 | SELECT season FROM table_name_54 WHERE date = "30 august 1980" | sql_create_context |
CREATE TABLE table_name_96 (
release_date VARCHAR,
format VARCHAR,
title VARCHAR
) | What is the release date of vhs super callanetics? | SELECT release_date FROM table_name_96 WHERE format = "vhs" AND title = "super callanetics" | sql_create_context |
CREATE TABLE table_name_39 (
country VARCHAR,
player VARCHAR
) | Which country does Adam Scott play for? | SELECT country FROM table_name_39 WHERE player = "adam scott" | sql_create_context |
CREATE TABLE table_37639 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game Site" text,
"Attendance" text
) | Record of 0 8 had what lowest week? | SELECT MIN("Week") FROM table_37639 WHERE "Record" = '0–8' | wikisql |
CREATE TABLE table_18893428_1 (
constructor VARCHAR,
driver VARCHAR
) | Who is the constructor for the car driven by George Heath? | SELECT constructor FROM table_18893428_1 WHERE driver = "George Heath" | sql_create_context |
CREATE TABLE table_201_14 (
id number,
"crossing" text,
"carries" text,
"location" text,
"coordinates" text
) | which bridge has their location in summit , delaware ? | SELECT "crossing" FROM table_201_14 WHERE "location" = 'summit, delaware' | squall |
CREATE TABLE table_32314 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where did South Melbourne go to play a team at home? | SELECT "Home team" FROM table_32314 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE table_name_84 (
hanzi VARCHAR,
name VARCHAR
) | Which hanzi's name is nmtv mongolian satellite television? | SELECT hanzi FROM table_name_84 WHERE name = "nmtv mongolian satellite television" | sql_create_context |
CREATE TABLE table_name_36 (
nat VARCHAR,
name VARCHAR
) | Where is Rix from? | SELECT nat FROM table_name_36 WHERE name = "rix" | sql_create_context |
CREATE TABLE table_19789597_6 (
opponent VARCHAR,
date VARCHAR
) | Who was the game on July 12 played against? | SELECT opponent FROM table_19789597_6 WHERE date = "July 12" | sql_create_context |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 在哪几次医疗记录中患者彭宏才被开出过金额不低于82.93元的药品?列出医疗就诊编号有哪些? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '彭宏才' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 82.93) | css |
CREATE TABLE Faculty_Participates_in (
FacID INTEGER,
actid INTEGER
)
CREATE TABLE Activity (
actid INTEGER,
activity_name varchar(25)
)
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR... | how many students are advised by each rank of faculty? List the rank and the number of students. | SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (... | how many hours has it been since the last time patient 030-42006 was given a pt test on their current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006' AND patient.hosp... | eicu |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE treatment (
trea... | until 1 year ago, what were the three most frequently diagnosed conditions? | SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year') GROUP BY diagnosis.diagnosisname) AS t1 WHERE t1.c1 <= 3 | eicu |
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
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_co... | How many apartment bookings for each weekday? Draw a bar chart binning booking start date by weekday interval. | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id | nvbench |
CREATE TABLE table_49652 (
"Stop no." text,
"Platform" text,
"Line" text,
"Stopping pattern" text,
"Destination" text
) | What is Stopping Pattern, when Platform is 4? | SELECT "Stopping pattern" FROM table_49652 WHERE "Platform" = '4' | wikisql |
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 offering_instructor (
offering_instructor_id int,
offering_id int,
ins... | Before noon , what upper level electives are available ? | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.end_time <= '12:00:00' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semest... | advising |
CREATE TABLE table_15887683_9 (
dar VARCHAR,
television_service VARCHAR,
n° VARCHAR
) | Name the total number of dar for disney channel and number is 613 | SELECT COUNT(dar) FROM table_15887683_9 WHERE television_service = "Disney Channel" AND n° = 613 | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 12592992患者在11年9月27日至17年3月31日之内检测甲状腺摄取实验的医务人员工号及姓名各是什么? | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON 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_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.... | css |
CREATE TABLE table_10825 (
"Year" real,
"Artist" text,
"Mintage (Proof)" text,
"Issue Price (Proof)" text,
"Mintage (BU)[ clarification needed ]" text,
"Issue Price (BU)[ clarification needed ]" text
) | What's the Issue Price (BU) [Clarification Needed] with a Year larger than 2002 and Mintage (Proof) of 50,000? | SELECT "Issue Price (BU)[ clarification needed ]" FROM table_10825 WHERE "Year" > '2002' AND "Mintage (Proof)" = '50,000' | wikisql |
CREATE TABLE table_45008 (
"Position" real,
"Name" text,
"Played" real,
"Drawn" real,
"Lost" real,
"Points" real
) | What was the drawn amount for teams with points of 12 and played smaller than 10? | SELECT AVG("Drawn") FROM table_45008 WHERE "Points" = '12' AND "Played" < '10' | wikisql |
CREATE TABLE table_name_70 (
grid INTEGER,
time VARCHAR,
laps VARCHAR
) | Can you tell me the highest Grid that has the Time of +15.532, and the Laps larger than 23? | SELECT MAX(grid) FROM table_name_70 WHERE time = "+15.532" AND laps > 23 | sql_create_context |
CREATE TABLE table_name_11 (
competition VARCHAR,
date VARCHAR
) | What competition took place on 28/04/1906? | SELECT competition FROM table_name_11 WHERE date = "28/04/1906" | sql_create_context |
CREATE TABLE table_43909 (
"Rank" real,
"Company" text,
"Headquarters" text,
"Industry" text,
"Sales (billion $)" real,
"Profits (billion $)" real,
"Assets (billion $)" real,
"Market Value (billion $)" real
) | What is the average market value in billions of the company with less than 1,705.35 billions in assets, sales of 175.05 billions, and is ranked less than 19? | SELECT AVG("Market Value (billion $)") FROM table_43909 WHERE "Assets (billion $)" < '1,705.35' AND "Sales (billion $)" = '175.05' AND "Rank" < '19' | wikisql |
CREATE TABLE table_16603 (
"Date" text,
"Founder" text,
"Extroversion Scales" text,
"People-task orientation scale" text,
"Introverted, Task-Oriented" text,
"Extroverted, Task-Oriented" text,
"Extroverted, Relationship-Oriented" text,
"Introverted, Relationship Oriented" text,
"Moder... | what's the extroverted, relationship-oriented where extroverted, task-oriented is director | SELECT "Extroverted, Relationship-Oriented" FROM table_16603 WHERE "Extroverted, Task-Oriented" = 'Director' | wikisql |
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
)
CREATE TABLE tags (
index number,
id number,
tag text
) | Find me top 10 albums ranked by their popularity. | SELECT groupname FROM torrents WHERE releasetype = "album" ORDER BY totalsnatched DESC LIMIT 10 | whatcdhiphop |
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 Votes (
Id number,
PostId number,
VoteTypeId nu... | Post count, view count, view/post ratio per day, for a tag. | SELECT DATE(p.CreationDate) AS pdate, COUNT(*) AS nposts_per_day, SUM(p.ViewCount) AS nviews_per_day, SUM(p.ViewCount) / COUNT(*) AS view_post_ratio FROM Tags JOIN PostTags AS pt ON Tags.Id = pt.TagId JOIN Posts AS p ON pt.PostId = p.Id WHERE Tags.TagName = @TagName GROUP BY DATE(p.CreationDate) ORDER BY pdate DESC | sede |
CREATE TABLE table_name_59 (
stage VARCHAR,
malaysian_rider_classification VARCHAR
) | Which stage had suhardi hassan in the Malaysian rider classification? | SELECT stage FROM table_name_59 WHERE malaysian_rider_classification = "suhardi hassan" | sql_create_context |
CREATE TABLE table_name_76 (
apr_2013 INTEGER,
jun_2011 INTEGER
) | What is the average Apr 2013 with a Jun 2011 less than 14? | SELECT AVG(apr_2013) FROM table_name_76 WHERE jun_2011 < 14 | sql_create_context |
CREATE TABLE table_16324 (
"Number Range" text,
"Builder" text,
"Introduced" real,
"No. Built" real,
"Region" text,
"Withdrawn" real
) | What is the minimum introduced value for the Departmental region? | SELECT MIN("Introduced") FROM table_16324 WHERE "Region" = 'Departmental' | wikisql |
CREATE TABLE table_4226 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | What episode number in the series was directed by Winrich Kolbe? | SELECT MIN("No. in series") FROM table_4226 WHERE "Directed by" = 'Winrich Kolbe' | wikisql |
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ tim... | 从2007年8月29日开始,截止到2013年5月22日,请把彭飞沉的这位病人总共被开出的检验报告单的审核日期时间给列出来 | SELECT zyjybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN zyjybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB WHERE person_info.XM = '彭飞沉' ... | css |
CREATE TABLE table_21549 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | Who did the most high rebounds in the game played on November 1? | SELECT "High rebounds" FROM table_21549 WHERE "Date" = 'November 1' | wikisql |
CREATE TABLE table_name_30 (
name VARCHAR,
moving_to VARCHAR
) | What is Name, when Moving To is 'NEC Nijmegen'? | SELECT name FROM table_name_30 WHERE moving_to = "nec nijmegen" | sql_create_context |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Descr... | Total number of views for a given tag. | SELECT SUM(ViewCount) AS Views FROM Posts AS Questions INNER JOIN PostTags ON Questions.Id = PostTags.PostId INNER JOIN Tags ON PostTags.TagId = Tags.Id WHERE Questions.PostTypeId = 1 AND Tags.TagName = '##tagname##' | sede |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE txmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
K... | 在03年1月5日到10年11月6日期间,病患20286940的所有检验结果指标记录的检测人为58375381的检验指标流水号分别是多少? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B... | css |
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 ... | provide the number of dead patients who were less than 43 years of age. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "1" AND demographic.age < "43" | mimicsql_data |
CREATE TABLE table_name_62 (
played INTEGER,
points VARCHAR,
drawn VARCHAR,
lost VARCHAR
) | What is the highest played with more than 0 draws, less than 3 losses, and less than 27 points? | SELECT MAX(played) FROM table_name_62 WHERE drawn > 0 AND lost < 3 AND points < 27 | sql_create_context |
CREATE TABLE table_30164 (
"Series episode" real,
"Season episode" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in million)" text
) | What was the episode number veiwed by 7.43 million viewers? | SELECT MAX("Series episode") FROM table_30164 WHERE "U.S. viewers (in million)" = '7.43' | wikisql |
CREATE TABLE document_sections_images (
section_id number,
image_id number
)
CREATE TABLE images (
image_id number,
image_alt_text text,
image_name text,
image_url text
)
CREATE TABLE document_sections (
section_id number,
document_code text,
section_sequence number,
section_co... | What are the names and urls of images, sorted alphabetically? | SELECT image_name, image_url FROM images ORDER BY image_name | spider |
CREATE TABLE table_29450 (
"Club" text,
"Chairman" text,
"Current manager" text,
"Team captain" text,
"Kitmaker" text,
"Shirt sponsor" text
) | What is the club when the shirt sponsor is e-lotto.be? | SELECT "Club" FROM table_29450 WHERE "Shirt sponsor" = 'e-lotto.be' | wikisql |
CREATE TABLE intakeoutput (
intakeoutputid number,
patientunitstayid number,
cellpath text,
celllabel text,
cellvaluenumeric number,
intakeoutputtime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartr... | what is the five most frequently ordered lab test until 4 years ago for patients whose age is 40s? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND DATETIME(lab.labresulttime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY lab.labname) AS t1 WHER... | eicu |
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,... | 来医疗机构7149475看病的人里,非本地的患者人数是多少 | SELECT COUNT(t_kc21.PERSON_ID) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7149475' AND t_kc21.REMOTE_SETTLE_FLG = '异地1' OR t_kc21.REMOTE_SETTLE_FLG = '异地2' | css |
CREATE TABLE table_17854 (
"Candidate" text,
"Background" text,
"Original Team" text,
"Age" real,
"Hometown" text,
"Result" text
) | Where was Kristen Kirchner from? | SELECT "Hometown" FROM table_17854 WHERE "Candidate" = 'Kristen Kirchner' | wikisql |
CREATE TABLE mountain (
id int,
name text,
Height real,
Prominence real,
Range text,
Country text
)
CREATE TABLE camera_lens (
id int,
brand text,
name text,
focal_length_mm real,
max_aperture real
)
CREATE TABLE photos (
id int,
camera_lens_id int,
mountain_id ... | I want to know the proportion of the total number for each color. | SELECT color, COUNT(color) FROM photos GROUP BY color | nvbench |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversa... | select * from Posts where Id = 13091458;. | SELECT * FROM Posts WHERE Id = 13091458 | sede |
CREATE TABLE table_name_25 (
location VARCHAR,
league_division VARCHAR,
club VARCHAR
) | What is the location for the first division, Sun Pegasus Club? | SELECT location FROM table_name_25 WHERE league_division = "first division" AND club = "sun pegasus" | sql_create_context |
CREATE TABLE table_31233 (
"Seed" real,
"Rank" real,
"Player" text,
"Points" real,
"Points defending" real,
"Points won" real,
"New points" real,
"Status" text
) | How many points are listed when the rank is 17? | SELECT MAX("Points") FROM table_31233 WHERE "Rank" = '17' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body t... | Rep Curve, rounded to the nearest 100. | SELECT ROUND(Reputation / 100, 0) * 100 AS rep, COUNT(*) AS number_of_users FROM (SELECT * FROM Users WHERE Reputation != 1 AND Reputation != 101) AS a GROUP BY ROUND(Reputation / 100, 0) * 100 ORDER BY ROUND(Reputation / 100, 0) * 100 | sede |
CREATE TABLE table_11621799_1 (
winner VARCHAR,
score VARCHAR
) | Who was the winner when the score was 281 (-6)? | SELECT winner FROM table_11621799_1 WHERE score = "281 (-6)" | sql_create_context |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId ... | Top Palestinians on Stackoverflow. | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, CreationDate, LastAccessDate, Views FROM Users WHERE LOWER(Location) LIKE '%palestine%' OR LOWER(Location) LIKE '%palestinian%' ORDER BY Reputation DESC | sede |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | how many patients whose primary disease is chest pain and admission year is less than 2133? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "CHEST PAIN" AND demographic.admityear < "2133" | mimicsql_data |
CREATE TABLE table_31651 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
) | Tell me the date of goal 5 | SELECT "Date" FROM table_31651 WHERE "Goal" = '5' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
pat... | what was patient 005-48105's heartrate average today? | SELECT AVG(vitalperiodic.heartrate) FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-48105')) AND NOT vitalperiodic.heartrate IS NULL... | eicu |
CREATE TABLE table_8717 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text
) | Which Event has a Competition of chicago marathon, and a Year larger than 2004? | SELECT "Event" FROM table_8717 WHERE "Competition" = 'chicago marathon' AND "Year" > '2004' | wikisql |
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 ReviewTaskResults (
Id number,
Review... | Answers of a user ordered by reaction time. | WITH Raw AS (SELECT A.Id, CAST((JULIANDAY(CreationDate) - JULIANDAY(Q.CreationDate)) AS INT) AS Seconds FROM Posts AS Q, Posts AS A WHERE A.ParentId = Q.Id AND A.OwnerUserId = '##AccountId:int##') SELECT RANK() OVER (ORDER BY Seconds, Id) AS TimeRank, Id AS "post_link", Seconds FROM Raw ORDER BY TimeRank | sede |
CREATE TABLE table_23214055_2 (
ezhavas VARCHAR,
syrian_christians VARCHAR
) | Name the ezhavas and syrian christians being 26.2 | SELECT ezhavas FROM table_23214055_2 WHERE syrian_christians = "26.2" | sql_create_context |
CREATE TABLE table_name_86 (
laps VARCHAR,
grid VARCHAR,
rider VARCHAR
) | How many laps did ben spies do on the grid less than 7? | SELECT COUNT(laps) FROM table_name_86 WHERE grid < 7 AND rider = "ben spies" | sql_create_context |
CREATE TABLE table_78161 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | How many attended the game on march 16 after over 64 games? | SELECT "Location Attendance" FROM table_78161 WHERE "Game" > '64' AND "Date" = 'march 16' | wikisql |
CREATE TABLE table_name_12 (
player VARCHAR,
place VARCHAR,
country VARCHAR
) | What player has t7 as the place, with tje United States as the country? | SELECT player FROM table_name_12 WHERE place = "t7" AND country = "united states" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
d... | what is in the last hospital encounter minimum protein - csf value of patient 022-47232? | SELECT MIN(lab.labresult) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-47232' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospital... | eicu |
CREATE TABLE table_name_2 (
opponent VARCHAR,
record VARCHAR
) | Which opponent has a record of 44-28? | SELECT opponent FROM table_name_2 WHERE record = "44-28" | sql_create_context |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE 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 ... | 根据科室的名字不同、出院时的诊断不同计算出医院6501681所有的记录里患者就诊时的平均年纪 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM, AVG(t_kc21.PERSON_AGE) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '6501681' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_NM | css |
CREATE TABLE table_39214 (
"Round" real,
"Pick #" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | What is the lowest pick number of John Scully? | SELECT MIN("Pick #") FROM table_39214 WHERE "Name" = 'john scully' | wikisql |
CREATE TABLE table_2950964_5 (
_number VARCHAR,
title VARCHAR
) | The Empty House audiobook has what #? | SELECT _number FROM table_2950964_5 WHERE title = "The Empty House" | sql_create_context |
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
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
... | when was the first time patient 83225 had surgery? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83225) ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_65454 (
"Athlete" text,
"Shooting Score (pts)" text,
"Fencing Victories (pts)" text,
"Swimming Time (pts)" text,
"Equestrian Time (pts)" text,
"Running Time (pts)" text,
"Total" real
) | Which Fencing Victories (pts) has a Shooting Score (pts) of 187 (1180) and a Total smaller than 5640? Question 1 | SELECT "Fencing Victories (pts)" FROM table_65454 WHERE "Shooting Score (pts)" = '187 (1180)' AND "Total" < '5640' | wikisql |
CREATE TABLE table_name_31 (
year INTEGER,
loser VARCHAR,
location VARCHAR
) | What's the earliest year the new york giants lost at new meadowlands stadium? | SELECT MIN(year) FROM table_name_31 WHERE loser = "new york giants" AND location = "new meadowlands stadium" | sql_create_context |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
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
)
CR... | what are the newly prescribed drugs of patient 14467 today compared to those prescribed yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... | mimic_iii |
CREATE TABLE table_73856 (
"Result" text,
"Date" text,
"Race" text,
"Venue" text,
"Group" text,
"Distance" text,
"Weight (kg)" text,
"Jockey" text,
"Winner/2nd" text
) | How man teams had a total weight of 57.5? | SELECT COUNT("Group") FROM table_73856 WHERE "Weight (kg)" = '57.5' | wikisql |
CREATE TABLE table_name_66 (
percentage INTEGER,
total_blocks INTEGER
) | What is the highest percentage when there are more than 361 blocks? | SELECT MAX(percentage) FROM table_name_66 WHERE total_blocks > 361 | sql_create_context |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | was the value of hgb in patient 016-34108 last measured on the first hospital visit greater than the second to last value measured on the first hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-34108' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
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... | Comparison between angular and react. | SELECT DATEADD(m, DATEDIFF(m, 0, CreationDate), 0) AS Month, Tags.TagName AS Tag, COUNT(*) AS Questions FROM Tags LEFT JOIN PostTags ON PostTags.TagId = Tags.Id LEFT JOIN Posts ON Posts.Id = PostTags.PostId LEFT JOIN PostTypes ON PostTypes.Id = Posts.PostTypeId WHERE Tags.TagName = 'angular' AND PostTypes.Name = 'Quest... | sede |
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,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 在医疗机构6663690中哪17个科室在12年8月22日到13年10月8日间统筹金额消耗最多? | SELECT qtb.MED_ORG_DEPT_CD, qtb.MED_ORG_DEPT_NM FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6663690' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2012-08-22' AND '2013-10-08' GROUP BY qtb.MED_ORG_DEPT_CD ORDER BY SUM(t_kc24.OVE_PAY) DESC LIMIT 17 UNION SELECT gyb.MED_ORG_DEPT_CD,... | css |
CREATE TABLE table_name_35 (
minister VARCHAR,
term_start VARCHAR
) | Whose term started on 4 May 2006? | SELECT minister FROM table_name_35 WHERE term_start = "4 may 2006" | sql_create_context |
CREATE TABLE table_17280 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Record" text
) | What was the attendance of the game November 24 | SELECT "Location Attendance" FROM table_17280 WHERE "Date" = 'November 24' | wikisql |
CREATE TABLE table_11680175_1 (
schwante VARCHAR,
bärenklau VARCHAR
) | What was the number for Schwante where B renklau is 1.270? | SELECT schwante FROM table_11680175_1 WHERE bärenklau = "1.270" | sql_create_context |
CREATE TABLE table_10015132_14 (
school_club_team VARCHAR,
player VARCHAR
) | What school did Patrick O'Bryant play for? | SELECT school_club_team FROM table_10015132_14 WHERE player = "Patrick O'Bryant" | sql_create_context |
CREATE TABLE table_75944 (
"Round" text,
"Date" text,
"Home team" text,
"Score" text,
"Away team" text
) | What is the name of the home team on April 13, 2008 when Itabuna was the away team? | SELECT "Home team" FROM table_75944 WHERE "Date" = 'april 13, 2008' AND "Away team" = 'itabuna' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskSt... | How many tags per question for top questions?. | SELECT p.Id AS "post_link", p.Tags FROM Posts AS p WHERE p.PostTypeId = 1 AND p.ViewCount > 10000 ORDER BY p.ViewCount | sede |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.