context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_9 (
country VARCHAR,
nominating_festival VARCHAR
) | Name the country which has prix uip venezia | SELECT country FROM table_name_9 WHERE nominating_festival = "prix uip venezia" | 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 VoteTypes (
Id number,
Name text
)
C... | Number of comments and post by users organised by total UpVotes. | SELECT DisplayName, UpVotes, DownVotes, posts, comments, comments / posts FROM Users INNER JOIN (SELECT OwnerUserId, COUNT(OwnerUserId) AS posts FROM Posts GROUP BY OwnerUserId) AS numposts ON Users.Id = numposts.OwnerUserId INNER JOIN (SELECT UserId, COUNT(UserId) AS comments FROM Comments GROUP BY UserId) AS numcomme... | sede |
CREATE TABLE table_33291 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How big was the crowd at the match where the away team had a score of 10.14 (74)? | SELECT COUNT("Crowd") FROM table_33291 WHERE "Away team score" = '10.14 (74)' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName te... | Questions that I've answered that have not accepted an answer. TODO: add a requirement that the Q-asker has logged in in the past .... year
'
If any of the answers solved your problem, please [accept it](https://unix.stackexchange.com/help/someone-answers) by clicking the checkmark next to it. Thank you! | SELECT q.Id AS "post_link", q.CreationDate, a.Score, q.AnswerCount, (DATEDIFF(WEEK, u.LastAccessDate, GETDATE())) AS WeeksSinceUserLastLogin FROM Posts AS q INNER JOIN Posts AS a ON a.ParentId = q.Id JOIN Users AS u ON u.Id = q.OwnerUserId WHERE q.PostTypeId = 1 AND q.AcceptedAnswerId IS NULL AND q.ClosedDate IS NULL A... | sede |
CREATE TABLE table_name_63 (
office VARCHAR,
republican_ticket VARCHAR
) | Which Office has a Republican ticket of daniel h. conway? | SELECT office FROM table_name_63 WHERE republican_ticket = "daniel h. conway" | sql_create_context |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Find the total number of students enrolled in the colleges that were founded after the year of 1850 for each affiliation type Show bar chart, and list by the total number in ascending. | SELECT Affiliation, SUM(Enrollment) FROM university WHERE Founded > 1850 GROUP BY Affiliation ORDER BY SUM(Enrollment) | nvbench |
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 ... | what is the cost of a medication named pamidronate? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'prescriptions' AND cost.event_id IN (SELECT prescriptions.row_id FROM prescriptions WHERE prescriptions.drug = 'pamidronate') | mimic_iii |
CREATE TABLE table_40355 (
"number" real,
"symbol" text,
"name" text,
"empirical \u2020" text,
"Calculated" text,
"van der Waals" text,
"Covalent (single bond)" text,
"Covalent (triple bond)" text
) | What is the covalent (single bond) value of sodium? | SELECT "Covalent (single bond)" FROM table_40355 WHERE "name" = 'sodium' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
... | what is the daily maximum of output amt-blake drain a output of patient 017-58432 until 12/26/2105? | SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-58432')) AND intakeoutput.celllabel = 'outpu... | eicu |
CREATE TABLE table_name_49 (
points VARCHAR,
score VARCHAR,
game VARCHAR
) | How many Points have a Score of 1 3, and a Game larger than 82? | SELECT COUNT(points) FROM table_name_49 WHERE score = "1–3" AND game > 82 | sql_create_context |
CREATE TABLE table_26049 (
"Years led" text,
"Span of years led" real,
"Player" text,
"Titles won at point of lead" real,
"Total Career titles" real,
"Tournament at which lead began" text
) | At what tournament did pete sampras begin his lead? | SELECT "Tournament at which lead began" FROM table_26049 WHERE "Player" = 'Pete Sampras' | wikisql |
CREATE TABLE table_name_86 (
home_team VARCHAR,
away_team VARCHAR
) | What team was the home team when Tottenham Hotspur is the away team? | SELECT home_team FROM table_name_86 WHERE away_team = "tottenham hotspur" | sql_create_context |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station... | For dates had a minimum dew point smaller than any day in zip code 94107, show the total number of such days for each year using a bar chart, I want to rank Y from high to low order. | SELECT date, COUNT(date) FROM weather WHERE min_dew_point_f < (SELECT MIN(min_dew_point_f) FROM weather WHERE zip_code = 94107) ORDER BY COUNT(date) DESC | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost numbe... | what were the top four frequently performed lab tests for a patient during the same hospital encounter after being diagnosed with diarrhea the previous year? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diarrhea' AND DAT... | eicu |
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... | 从2006年9月3日起,截止到2007年5月5日,7452450这个医院有多少科室涉及的医疗费总额超过5876.89元 | SELECT COUNT(*) FROM (SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '7452450' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-09-03' AND '2007-05-05' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 5876.89) AS T | css |
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,
... | what is date of birth of subject name stephanie suchan? | SELECT demographic.dob FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_name_12 (
score_points VARCHAR,
event VARCHAR,
rank_points VARCHAR
) | What is Score Points, when Event is 'WC Rio De Janeiro', and when Rank Points is '10'? | SELECT score_points FROM table_name_12 WHERE event = "wc rio de janeiro" AND rank_points = "10" | sql_create_context |
CREATE TABLE table_name_72 (
place VARCHAR,
country VARCHAR
) | What place did the golfer take whose country is South Africa? | SELECT place FROM table_name_72 WHERE country = "south africa" | sql_create_context |
CREATE TABLE table_71088 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text,
"Stadium" text
) | Who was the opponent at the game that had a loss of Shields (1 1)? | SELECT "Opponent" FROM table_71088 WHERE "Loss" = 'shields (1–1)' | wikisql |
CREATE TABLE table_204_622 (
id number,
"year" number,
"competition" text,
"venue" text,
"position" text,
"event" text,
"notes" text
) | tell me the number of times they placed first . | SELECT COUNT(*) FROM table_204_622 WHERE "position" = 1 | squall |
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. Visualize by pie chart. | SELECT city, COUNT(*) FROM station GROUP BY city | nvbench |
CREATE TABLE table_name_37 (
novelty VARCHAR,
authors VARCHAR
) | What is the Novelty of the dinosaur, whose naming Author was Galton? | SELECT novelty FROM table_name_37 WHERE authors = "galton" | sql_create_context |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Suggested edit votes on a specific posts. | SELECT sv.Id, sv.CreationDate, CASE sv.VoteTypeId WHEN 2 THEN 'Approve' WHEN 3 THEN 'Reject' END AS Vote, sv.UserId AS "user_link", sv.TargetUserId AS "user_link", sv.TargetRepChange, sv.SuggestedEditId AS "suggested_edit_link" FROM SuggestedEdits AS se INNER JOIN SuggestedEditVotes AS sv ON se.Id = sv.SuggestedEditId ... | sede |
CREATE TABLE table_name_69 (
country VARCHAR,
winner_and_nominees VARCHAR
) | The winner and nominee 'Hidden Agenda' is from which country? | SELECT country FROM table_name_69 WHERE winner_and_nominees = "hidden agenda" | sql_create_context |
CREATE TABLE Services (
Service_ID INTEGER,
Service_Type_Code CHAR(15)
)
CREATE TABLE Events (
Event_ID INTEGER,
Service_ID INTEGER,
Event_Details VARCHAR(255)
)
CREATE TABLE Participants (
Participant_ID INTEGER,
Participant_Type_Code CHAR(15),
Participant_Details VARCHAR(255)
)
CREA... | Please draw a histogram to show the total number of participants in each type code, and sort Y from high to low order. | SELECT Participant_Type_Code, COUNT(Participant_Type_Code) FROM Participants GROUP BY Participant_Type_Code ORDER BY COUNT(Participant_Type_Code) DESC | nvbench |
CREATE TABLE table_42434 (
"Pos." real,
"Team" text,
"Wins" real,
"Ties" real,
"Losses" real,
"Goals" text,
"Diff." text,
"Points" text
) | How many average wins have USA as the team? | SELECT AVG("Wins") FROM table_42434 WHERE "Team" = 'usa' | wikisql |
CREATE TABLE table_name_85 (
class VARCHAR,
type VARCHAR
) | Which Class has a Type of 1 c n2t? | SELECT class FROM table_name_85 WHERE type = "1′c n2t" | sql_create_context |
CREATE TABLE table_63543 (
"Children of Earth" text,
"Run time" text,
"Writer" text,
"Director" text,
"Original airdate" text,
"Viewers (including HD) in millions" text
) | Who is the writer of Children of Earth of 'day four'? | SELECT "Writer" FROM table_63543 WHERE "Children of Earth" = 'day four' | wikisql |
CREATE TABLE table_77698 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
) | What's the result at psinet stadium when the cincinnati bengals are the opponent? | SELECT "Result" FROM table_77698 WHERE "Game site" = 'psinet stadium' AND "Opponent" = 'cincinnati bengals' | wikisql |
CREATE TABLE table_name_68 (
lner_class VARCHAR
) | What is the 1913 Class of the d32 LNER Class? | SELECT 1913 AS _class FROM table_name_68 WHERE lner_class = "d32" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | count the number of patients whose primary disease is liver transplant and procedure short title is opn/oth rep mtrl vlv-tis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND procedures.short_title = "Opn/oth rep mtrl vlv-tis" | mimicsql_data |
CREATE TABLE table_24794 (
"Pilot" text,
"Organization" text,
"Total Flights" real,
"USAF space flights" real,
"FAI space flights" real,
"Max Mach" text,
"Max speed (mph)" real,
"Max altitude (miles)" text
) | How many numbers were recorded under max speed for 1 USAF space flight and total flights 34? | SELECT COUNT("Max speed (mph)") FROM table_24794 WHERE "USAF space flights" = '1' AND "Total Flights" = '34' | wikisql |
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,... | 患者76364706被开出过金额不低于3367.94元的药品在哪几次医疗记录中?列出有什么医疗就诊编号? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '76364706' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3367.94) | css |
CREATE TABLE Customer_Orders (
order_id INTEGER,
customer_id INTEGER,
order_date DATETIME,
order_status_code VARCHAR(15)
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
order_quantity VARCHAR(80)
)
CREATE TABLE Products (
product_id INTEGER... | Bar chart x axis product name y axis how many product name, and I want to display in asc by the x axis. | SELECT product_name, COUNT(product_name) FROM Products GROUP BY product_name ORDER BY product_name | nvbench |
CREATE TABLE table_14679 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the score with lost as the result? | SELECT "Score" FROM table_14679 WHERE "Result" = 'lost' | wikisql |
CREATE TABLE table_47217 (
"Date" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text,
"Box Score" text,
"Report" text
) | When was the game at the North Shore Events Centre? | SELECT "Date" FROM table_47217 WHERE "Venue" = 'north shore events centre' | wikisql |
CREATE TABLE table_name_98 (
total INTEGER,
a_score INTEGER
) | What's the total when A Score was less than 6.9? | SELECT AVG(total) FROM table_name_98 WHERE a_score < 6.9 | sql_create_context |
CREATE TABLE table_74621 (
"Region" text,
"Year" real,
"Label" text,
"Format" text,
"Catalog" text
) | What is Candlelight Records format? | SELECT "Format" FROM table_74621 WHERE "Label" = 'candlelight records' | wikisql |
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturd... | give me flights from PITTSBURGH 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, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'PITTSBURGH' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL... | atis |
CREATE TABLE fielding_outfield (
player_id TEXT,
year INTEGER,
stint INTEGER,
glf NUMERIC,
gcf NUMERIC,
grf NUMERIC
)
CREATE TABLE team (
year INTEGER,
league_id TEXT,
team_id TEXT,
franchise_id TEXT,
div_id TEXT,
rank INTEGER,
g INTEGER,
ghome NUMERIC,
w INT... | Show the trend about the average of the number of attendance at home games change over the years, bin year into year interval, and could you list from high to low by the X-axis? | SELECT year, AVG(attendance) FROM home_game ORDER BY year DESC | nvbench |
CREATE TABLE table_73976 (
"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
) | Who wrote episode number 109 in the series? | SELECT "Written by" FROM table_73976 WHERE "No. in series" = '109' | 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... | 哪些医务人员在2012年5月30日到2014年9月25日期间为患者朱清佳检测指标204728的,提供一下工号及姓名 | SELECT jyjgzbb.JCRGH, jyjgzbb.JCRXM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb 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 = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB W... | css |
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... | 那个孙清涵的病人在2017年11月21日到2019年11月23日内所有检验结果指标记录中的仪器编号以及名称能不能给我详细列举出来? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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... | css |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE treatment (
treat... | what were the number of patients discharged from hospital? | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE head (
head_id number,
name text,
born_state text,
age number
)
CREATE TABLE department (
department_id number,
name text,
creation text,
ranking number,
budget_in_billions number,
num_employees number
)
CREATE TABLE management (
department_id number,
head_... | What are the distinct ages of the heads who are acting? | SELECT DISTINCT T1.age FROM management AS T2 JOIN head AS T1 ON T1.head_id = T2.head_id WHERE T2.temporary_acting = 'Yes' | spider |
CREATE TABLE table_name_28 (
ends INTEGER,
name VARCHAR
) | Name the average ends for weston | SELECT AVG(ends) FROM table_name_28 WHERE name = "weston" | sql_create_context |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
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... | 列出患者奚妮娜的检验报告单中结果指标均正常的检验报告单号 | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN mzjzjlb_jybgb 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 = mzjzjlb_jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND mzjzjl... | css |
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... | 列出患者20499920在10年5月11日到20年4月9日内被开出的所有检验报告单的检验报告单号是多少? | SELECT jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '20499920' AND jybgb.BGRQ BETWEEN '2010-05-11' AND '2020-... | css |
CREATE TABLE table_179 (
"State (linked to summaries below)" text,
"Senator" text,
"Party" text,
"Electoral history" text,
"Result" text,
"Candidates Winning candidate in bold" text
) | who won the senate seat in arkansas | SELECT "Senator" FROM table_179 WHERE "State (linked to summaries below)" = 'Arkansas' | 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... | 患者在进行78371715301医疗就诊时对应的是哪个门诊号或住院号 | SELECT CLINIC_ID FROM t_kc21 WHERE MED_CLINIC_ID = '78371715301' | css |
CREATE TABLE table_name_19 (
opponents_in_the_final VARCHAR,
surface VARCHAR,
date VARCHAR
) | Who was the opponents in the final on January 5, 2003, on a hard surface? | SELECT opponents_in_the_final FROM table_name_19 WHERE surface = "hard" AND date = "january 5, 2003" | sql_create_context |
CREATE TABLE table_1341423_22 (
party VARCHAR,
first_elected VARCHAR
) | Which party does the incumbent first elected in 1994 belong to? | SELECT party FROM table_1341423_22 WHERE first_elected = 1994 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_items (
row_id num... | how many times patient 7742 has received a endosc control gast hem procedure on the last hospital visit. | SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'endosc control gast hem') AND procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7742 AND NOT admissions.dis... | mimic_iii |
CREATE TABLE table_260938_1 (
base_10 VARCHAR,
peletier VARCHAR
) | Name the base 10 for peletier for bi llion | SELECT base_10 FROM table_260938_1 WHERE peletier = "Bi llion" | sql_create_context |
CREATE TABLE table_name_21 (
province VARCHAR,
iata VARCHAR
) | Which province's IATA is kix? | SELECT province FROM table_name_21 WHERE iata = "kix" | sql_create_context |
CREATE TABLE table_204_520 (
id number,
"outcome" text,
"no." number,
"date" number,
"championship" text,
"surface" text,
"opponent" text,
"score" text
) | what is the total of winners ? | SELECT COUNT(*) FROM table_204_520 WHERE "outcome" = 'winner' | squall |
CREATE TABLE table_42851 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" text,
"Team Record" text,
"Game Site" text
) | What is the Date, when the Team Record is 2-0? | SELECT "Date" FROM table_42851 WHERE "Team Record" = '2-0' | wikisql |
CREATE TABLE table_10623 (
"Episode #" real,
"Title" text,
"Airdate" text,
"Rating (Millions)" text,
"Rank" text
) | What was the rating of the episode 'After Hours'? | SELECT "Rating (Millions)" FROM table_10623 WHERE "Title" = 'after hours' | wikisql |
CREATE TABLE representative (
Party VARCHAR
) | What is the party that has the largest number of representatives? | SELECT Party, COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_46606 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real
) | Which country has Anselmo Da Silva in lane 2? | SELECT "Country" FROM table_46606 WHERE "Lane" < '2' AND "Name" = 'anselmo da silva' | wikisql |
CREATE TABLE table_16856 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | What is the largest jersey number for the player from maryland | SELECT MAX("No.") FROM table_16856 WHERE "School/Club Team" = 'Maryland' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | 患者22512141在14年10月25日至17年7月8日的补体C4指标记录 | SELECT * FROM hz_info JOIN zzmzjzjlb JOIN jybgb JOIN jyjgzbb ON 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 jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_i... | css |
CREATE TABLE table_19457_1 (
town_ships INTEGER,
village_groups VARCHAR
) | How many townships are there in the region with 376 village groups? | SELECT MAX(town_ships) FROM table_19457_1 WHERE village_groups = 376 | sql_create_context |
CREATE TABLE table_name_39 (
reference VARCHAR,
japanese_title VARCHAR
) | What reference is used with the title ? | SELECT reference FROM table_name_39 WHERE japanese_title = "アイシテル" | sql_create_context |
CREATE TABLE table_10236830_6 (
nomination VARCHAR,
film_name VARCHAR
) | Which nominations was the film 27 Stolen Kisses nominated for? | SELECT nomination FROM table_10236830_6 WHERE film_name = "27 Stolen Kisses" | sql_create_context |
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requirement varchar,
description varchar,
num_semesters int,
num_enrolled int,
has_discussion varchar,
has_lab varchar,
has_p... | Show me courses that include any parts of Digital Communication Signals and Systems and Devising Theatre . | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id WHERE (area.area LIKE '%Devising Theatre%' OR course.description LIKE '%Devising Theatre%' OR course.name LIKE '%Devising Theatre%') AND (area.area LIKE '%Digital Communication Signals and Syst... | advising |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text ... | How many unanswered questions are there for a tag?. | SELECT COUNT(p.Id) FROM Posts AS p INNER JOIN PostTags AS pt ON pt.TagId = @TagId WHERE pt.PostId = p.Id AND p.PostTypeId = 1 AND NOT p.AcceptedAnswerId IS NULL | sede |
CREATE TABLE table_name_26 (
record VARCHAR,
res VARCHAR,
event VARCHAR
) | What is the record for the loss in UFC 62? | SELECT record FROM table_name_26 WHERE res = "loss" AND event = "ufc 62" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id num... | Count answers with score 0 and at least one thanks comment by a low-rep user. | SELECT p.Score AS "score", COUNT(*) AS num, MAX(c.Id) AS "comment_link" FROM Comments AS c INNER JOIN Users AS u ON c.UserId = u.Id INNER JOIN Posts AS p ON c.PostId = p.Id WHERE u.Reputation <= '##maxrep:int?10##' AND p.PostTypeId = 2 AND Text COLLATE SQL_Latin1_General_CP1_CI_AS LIKE '%thankx%' AND p.Score <= 0 GROUP... | sede |
CREATE TABLE table_name_85 (
game_site VARCHAR,
week VARCHAR,
date VARCHAR
) | What Game Site has a Week smaller than 11, and a Date of october 21, 1973? | SELECT game_site FROM table_name_85 WHERE week < 11 AND date = "october 21, 1973" | sql_create_context |
CREATE TABLE table_1404414_2 (
code VARCHAR,
area__km_2__ VARCHAR
) | How many counties have an area of 1,205.4 km2? | SELECT COUNT(code) FROM table_1404414_2 WHERE area__km_2__ = "1,205.4" | sql_create_context |
CREATE TABLE table_name_92 (
non__stop VARCHAR,
plain_stop VARCHAR
) | If the Plain stop is , what is the Non- stop? | SELECT non__stop FROM table_name_92 WHERE plain_stop = "ㄷ" | sql_create_context |
CREATE TABLE table_45208 (
"English" text,
"Pali" text,
"Sanskrit" text,
"Chinese" text,
"Tibetan" text
) | Which Sanskrit has a Chinese of , and an English of cultivation of settling? | SELECT "Sanskrit" FROM table_45208 WHERE "Chinese" = '—' AND "English" = 'cultivation of settling' | wikisql |
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostHistory... | Find New Users Answering Each Other's Questions. | SELECT Users.Id, Posts.OwnerUserId FROM Users INNER JOIN Posts ON Users.Id = Posts.OwnerUserId WHERE Users.CreationDate BETWEEN '09/01/2018 00:00:00' AND '09/30/2018 00:00:00' | sede |
CREATE TABLE table_53698 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the score on 22 September 1972? | SELECT "Score" FROM table_53698 WHERE "Date" = '22 september 1972' | wikisql |
CREATE TABLE status (
station_id INTEGER,
bikes_available INTEGER,
docks_available INTEGER,
time TEXT
)
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station... | I want a bar chart to show the frequency of the dates that have the 5 highest cloud cover rates each day. | SELECT date, COUNT(date) FROM weather | nvbench |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 regions (
REGION_ID decimal(5,0),
... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of job_id and the sum of manager_id , and group by attribute job_id, and order Y-axis in desc order please. | SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC | nvbench |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varch... | How many upper-level classes are 15 credit hours ? | SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 15 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_21224 (
"Province" text,
"Skip" text,
"W" real,
"L" real,
"PF" real,
"PA" real,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
) | What is the top Points Allowed? | SELECT MAX("PA") FROM table_21224 | wikisql |
CREATE TABLE table_56346 (
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | On what date did a race occur at Long Beach? | SELECT "Date" FROM table_56346 WHERE "Location" = 'long beach' | wikisql |
CREATE TABLE table_19555 (
"Station (and code)" text,
"Managed by" text,
"Lines served" text,
"Station users 2007/8" real,
"Station users 2008/9" text,
"Year opened" text,
"Platforms" text,
"Borough" text
) | what is the name of the borough where station uses is 28702? | SELECT "Borough" FROM table_19555 WHERE "Station users 2008/9" = '28702' | wikisql |
CREATE TABLE table_29070 (
"Date" text,
"Time" text,
"Visiting team" text,
"Home team" text,
"Site" text,
"Broadcast" text,
"Result" text,
"Attendance" real
) | If the visiting team is Clemson, when was the time? | SELECT "Time" FROM table_29070 WHERE "Visiting team" = 'Clemson' | wikisql |
CREATE TABLE table_9275 (
"Wicket" text,
"Runs" text,
"Batting partners" text,
"Batting team" text,
"Fielding team" text,
"Venue" text,
"Date" text
) | What was the wicket ranking for the match featuring partners Mohammad Azharuddin and Ajay Jadeja and also a fielding team of Sri Lanka? | SELECT "Wicket" FROM table_9275 WHERE "Batting partners" = 'mohammad azharuddin and ajay jadeja' AND "Fielding team" = 'sri lanka' | wikisql |
CREATE TABLE table_18268826_1 (
directed_by VARCHAR,
us_viewers__million_ VARCHAR
) | Who directed the episode seen by 3.93 million people in the US? | SELECT directed_by FROM table_18268826_1 WHERE us_viewers__million_ = "3.93" | sql_create_context |
CREATE TABLE table_27755603_7 (
high_assists VARCHAR,
team VARCHAR
) | Who had the most assists agains New Orleans? | SELECT high_assists FROM table_27755603_7 WHERE team = "New Orleans" | sql_create_context |
CREATE TABLE table_68027 (
"Year" real,
"Result" text,
"Award" text,
"Category" text,
"Nominated work" text
) | what year has general nominated in the category or choice breakthrough artist? | SELECT COUNT("Year") FROM table_68027 WHERE "Nominated work" = 'general' AND "Category" = 'choice breakthrough artist' | wikisql |
CREATE TABLE table_8938 (
"Heat" real,
"Lane" real,
"Name" text,
"Country" text,
"Mark" text
) | What is the most lanes used that had a winner from Ireland? | SELECT MAX("Lane") FROM table_8938 WHERE "Country" = 'ireland' | wikisql |
CREATE TABLE table_24450 (
"Chassis code" text,
"Model no." text,
"Production years" text,
"Drivetrain" text,
"Transmission" text,
"Engine type" text,
"Engine code" text,
"Region(s)" text
) | Name the regions for usf45 | SELECT "Region(s)" FROM table_24450 WHERE "Chassis code" = 'USF45' | wikisql |
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... | 从2007年10月16日到2020年3月16日,列出病人沈智勇这期间所有检验报告单的审核日期时间 | SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '沈智勇' AND jybg... | css |
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... | 在哪几次医疗记录中给72363456患者开出过金额不低于7610.85元的药品以及医疗就诊编号是多少? | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '72363456' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 7610.85) | css |
CREATE TABLE table_25137 (
"Position" real,
"1990\u20131991" text,
"1991\u20131992" text,
"1992\u20131993" text,
"1993\u20131994" text,
"1994\u20131995" text
) | Who was ranked in the same position in 1990-1991 as Andy Roberts in 1993-1994? | SELECT "1990\u20131991" FROM table_25137 WHERE "1993\u20131994" = 'Andy Roberts' | wikisql |
CREATE TABLE venue (
venueid int,
venuename varchar
)
CREATE TABLE paperdataset (
paperid int,
datasetid int
)
CREATE TABLE author (
authorid int,
authorname varchar
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE writes (
paperid int,
authorid int
... | who published at ACL 2014 ? | SELECT DISTINCT writes.authorid FROM paper, venue, writes WHERE paper.year = 2014 AND venue.venueid = paper.venueid AND venue.venuename = 'ACL' AND writes.paperid = paper.paperid | scholar |
CREATE TABLE table_68286 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | Which country has t6 as a place and 75-70=145 as the score? | SELECT "Country" FROM table_68286 WHERE "Place" = 't6' AND "Score" = '75-70=145' | wikisql |
CREATE TABLE table_name_23 (
game INTEGER,
points VARCHAR,
march VARCHAR
) | What is the average game for March 8 with less than 84 points? | SELECT AVG(game) FROM table_name_23 WHERE points < 84 AND march = 8 | sql_create_context |
CREATE TABLE table_38966 (
"Week 2 Sept 7" text,
"Week 3 Sept 14" text,
"Week 4 Sept 21" text,
"Week 5 Sept 28" text,
"Week 6 Oct 5" text,
"Week 7 Oct 12" text,
"Week 10 Nov 2" text,
"Week 12 Nov 16" text,
"Week 14 Nov 30" text,
"Week 15 Dec 7" text,
"Week 16 (Final) Jan 9" t... | What was the week 7 opponent for the year that had a week 12 opponent of Oregon State (7-3)? | SELECT "Week 7 Oct 12" FROM table_38966 WHERE "Week 12 Nov 16" = 'oregon state (7-3)' | wikisql |
CREATE TABLE constructorstandings (
constructorstandingsid number,
raceid number,
constructorid number,
points number,
position number,
positiontext text,
wins number
)
CREATE TABLE laptimes (
raceid number,
driverid number,
lap number,
position number,
time text,
mi... | What is the name and date of the most recent race? | SELECT name, date FROM races ORDER BY date DESC LIMIT 1 | spider |
CREATE TABLE table_32073 (
"Tournament" text,
"2006" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What is the value for 2010 when the value for 2006 is A and the value for 2009 is 1R? | SELECT "2010" FROM table_32073 WHERE "2006" = 'a' AND "2009" = '1r' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
Owner... | Comments from one user under question from another user. | SELECT CONCAT('https://stats.meta.stackexchange.com/questions/', Posts.ParentId, '/', MyComments.PostId, '#comment', MyComments.Id, '_', MyComments.PostId) AS Link, MyComments.*, Posts.ParentId FROM (SELECT * FROM Comments WHERE UserId = '805') AS MyComments, Posts AS Posts WHERE Posts.Id = MyComments.PostId AND Posts.... | sede |
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... | 在13年3月19到13年9月25的这几个月,共有多少患者在医疗机构9085196的特需门诊就诊 | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '9085196' AND wdmzjzjlb.JZKSRQ BETWEEN '2013-03-19' AND '2013-09-25' AND wdmzjzjlb.TXBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '9085196' AND bdmzjzjlb.JZKSRQ BETWEEN '2013-03-19' AND '2013-09-25' AND bdmzjzjlb.TXBZ > 0 | css |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE procedures_icd (
r... | has the value of the temperature c (calc) of patient 6196 been normal until 07/2103? | SELECT COUNT(*) > 0 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 = 6196)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperature c (cal... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.