context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_30797 (
"Player" text,
"Matches" real,
"Overs" text,
"Wickets" real,
"Average" text,
"Economy" text,
"BBI" text,
"4wi" real
) | Who is the player when the economy is 6.14? | SELECT "Player" FROM table_30797 WHERE "Economy" = '6.14' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 查一下医疗费用的明细记录25299557093里药品数乘以它的单价是不是等于药品的总价 | SELECT (SELECT QTY * UNIVALENT FROM t_kc22 WHERE MED_EXP_DET_ID = '25299557093') = (SELECT AMOUNT FROM t_kc22 WHERE MED_EXP_DET_ID = '25299557093') | css |
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_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE status (
station_i... | For those dates that have the 5 highest cloud cover rates, please bin the date into day of the week interval and compute their average cloud cover. | SELECT date, AVG(cloud_cover) FROM weather | nvbench |
CREATE TABLE table_37920 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | Which Set 2 has a Set 1 of 25 15, and a Score of 3 0? | SELECT "Set 2" FROM table_37920 WHERE "Set 1" = '25–15' AND "Score" = '3–0' | wikisql |
CREATE TABLE table_name_18 (
type VARCHAR,
in_service VARCHAR,
vessel VARCHAR
) | What type of ship is a Kobben class vessel that has been in service longer than 2? | SELECT type FROM table_name_18 WHERE in_service > 2 AND vessel = "kobben class" | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Number of new Users each month [AskDifferent]. | SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) AS CD, COUNT(*) FROM Users GROUP BY DATEADD(MONTH, DATEDIFF(MONTH, 0, CreationDate), 0) ORDER BY CD | sede |
CREATE TABLE table_name_26 (
hdtv VARCHAR,
content VARCHAR,
television_service VARCHAR
) | What is the HDTV that has television service of tv 8 mont blanc and content is general television? | SELECT hdtv FROM table_name_26 WHERE content = "general television" AND television_service = "tv 8 mont blanc" | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | how many patients whose year of birth is less than 2167 and drug name is heparin flush midline (100 units/ml)? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2167" AND prescriptions.drug = "Heparin Flush Midline (100 units/ml)" | mimicsql_data |
CREATE TABLE table_77178 (
"Season" real,
"League" text,
"Finish" text,
"Wins" real,
"Losses" real,
"Ties" real
) | What is the highest wins for the NFL with a finish of 1st, and more than 6 losses? | SELECT MAX("Wins") FROM table_77178 WHERE "League" = 'nfl' AND "Finish" = '1st' AND "Losses" > '6' | 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 who do not work in departments with managers that have ids between 100 and 200, visualize a scatter chart about the correlation between salary and commission_pct . | SELECT SALARY, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE match (
Round real,
Location text,
Country text,
Date text,
Fastest_Qualifying text,
Winning_Pilot text,
Winning_Aircraft text
)
CREATE TABLE airport_aircraft (
ID int,
Airport_ID int,
Aircraft_ID int
)
CREATE TABLE aircraft (
Aircraft_ID int(11),
Aircraft ... | What is the number of each winning aircraft? Visualize by bar chart, could you sort bar from high to low order? | SELECT Aircraft, COUNT(Aircraft) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY Aircraft ORDER BY Aircraft DESC | nvbench |
CREATE TABLE song (
song_name varchar2(50),
artist_name varchar2(50),
country varchar2(20),
f_id number(10),
genre_is varchar2(20),
rating number(10),
languages varchar2(20),
releasedate Date,
resolution number(10)
)
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(... | Display a pie chart for how many songs were released for each format? | SELECT formats, COUNT(*) FROM files GROUP BY formats | nvbench |
CREATE TABLE branch (
Branch_ID int,
Name text,
Open_year text,
Address_road text,
City text,
membership_amount text
)
CREATE TABLE member (
Member_ID int,
Card_Number text,
Name text,
Hometown text,
Level int
)
CREATE TABLE membership_register_branch (
Member_ID int,
... | Count the hometown by hometown using a bar chart, and show by the bars in ascending. | SELECT Hometown, COUNT(Hometown) FROM member GROUP BY Hometown ORDER BY Hometown | nvbench |
CREATE TABLE mzb (
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... | 统计一下医疗记录中医院8058667的住院诊断为非器质性睡眠障碍的最低医疗费总金额是多少元钱?最高医疗费总金额多少钱? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '8058667' AND qtb.IN_DIAG_DIS_NM = '非器质性睡眠障碍' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '8058667' AND gyb.IN_DIAG_DIS_NM = '非器质性睡眠障碍' UNION... | css |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
... | how many hours does it have been since the first time patient 55281 stayed in ward 33 on the current hospital visit? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', transfers.intime)) FROM transfers WHERE transfers.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 55281 AND admissions.dischtime IS NULL)) AND transfers... | mimic_iii |
CREATE TABLE table_54662 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What home team scored 23.17 (155)? | SELECT "Home team" FROM table_54662 WHERE "Home team score" = '23.17 (155)' | wikisql |
CREATE TABLE table_17282875_3 (
team__number1 VARCHAR
) | When they played San Lorenzo, what was the score of the second leg? | SELECT 2 AS nd_leg FROM table_17282875_3 WHERE team__number1 = "San Lorenzo" | sql_create_context |
CREATE TABLE table_name_65 (
points VARCHAR,
played INTEGER
) | How many Points have a Played larger than 18? | SELECT COUNT(points) FROM table_name_65 WHERE played > 18 | sql_create_context |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_M... | 患者朱和颂的各检验科室的编码及名称在医疗就诊07371082275中均为? | SELECT JYKSBM, JYKSMC FROM jybgb WHERE JZLSH = '07371082275' | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varcha... | For those employees who did not have any job in the past, draw a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, could you sort by the Y in ascending please? | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_4906 (
"Player" text,
"Nationality" text,
"Position" text,
"From" real,
"School/Country" text
) | What position was played ealier then 2004? | SELECT "Position" FROM table_4906 WHERE "From" < '2004' | wikisql |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose... | indicate the daily minimum arterial bp mean of patient 28447 since 11/30/2101. | SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arte... | mimic_iii |
CREATE TABLE table_70766 (
"Name" text,
"Country" text,
"Type" text,
"Moving from" text,
"Transfer window" text,
"Ends" real,
"Transfer fee" text,
"Source" text
) | What is moving from esp with transfer fee of youth system? | SELECT "Moving from" FROM table_70766 WHERE "Country" = 'esp' AND "Transfer fee" = 'youth system' | wikisql |
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... | Show sum team id from each all home, and display by the X-axis from high to low. | SELECT All_Home, SUM(Team_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home DESC | nvbench |
CREATE TABLE table_32365 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
) | What team had a qual 1 of 1:02.755? | SELECT "Team" FROM table_32365 WHERE "Qual 1" = '1:02.755' | wikisql |
CREATE TABLE table_11664625_2 (
original_air_date VARCHAR,
no_in_season VARCHAR
) | What is the original air date of season 18? | SELECT original_air_date FROM table_11664625_2 WHERE no_in_season = 18 | sql_create_context |
CREATE TABLE table_name_70 (
home_team VARCHAR,
away_team VARCHAR
) | Who was the home team against Geelong? | SELECT home_team AS score FROM table_name_70 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_204_668 (
id number,
"#" number,
"menteri besar" text,
"took office" text,
"left office" text,
"party" text
) | how long did ungku abdul aziz abdul majid serve ? | SELECT "left office" - "took office" FROM table_204_668 WHERE "menteri besar" = 'ungku abdul aziz abdul majid' | squall |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE vitalperiodic (
... | what are the four most frequent drugs that patients were prescribed with during the same hospital encounter after being diagnosed with pain - moderate this year? | SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'pain - moderate... | eicu |
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
... | For those employees who did not have any job in the past, show me about the change of department_id over hire_date in a line chart, and list x axis from high to low order please. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_203_90 (
id number,
"religious\ngroup" text,
"population\n%" text,
"growth\n(1991-2001)" text,
"sex ratio\n(total)" number,
"literacy\n(%)" text,
"work participation\n(%)" text,
"sex ratio\n(rural)" number,
"sex ratio\n(urban)" number,
"sex ratio\n(child)" numb... | which religious group has the highest population % ? | SELECT "religious\ngroup" FROM table_203_90 ORDER BY "population\n%" DESC LIMIT 1 | squall |
CREATE TABLE Plays_games (
StuID VARCHAR
)
CREATE TABLE Student (
StuID VARCHAR
) | Show ids of students who don't play video game. | SELECT StuID FROM Student EXCEPT SELECT StuID FROM Plays_games | sql_create_context |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
C... | Users with Yearling badge. | SELECT u.CreationDate, u.Id, u.Id AS "user_link" FROM Users AS u INNER JOIN Badges AS b ON b.UserId = u.Id WHERE b.Name = 'Yearling' AND u.Reputation = 1 GROUP BY u.Id, u.CreationDate ORDER BY u.Id | sede |
CREATE TABLE table_63151 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text
) | What is the Week number on September 6, 1946? | SELECT SUM("Week") FROM table_63151 WHERE "Date" = 'september 6, 1946' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number... | total python questions by month SO-PT. | WITH t1 AS (SELECT TIME_TO_STR(p.CreationDate, '%Y') AS Year, TIME_TO_STR(p.CreationDate, '%m') AS Month, COUNT(*) AS totalQuestions, COUNT(AcceptedAnswerId) AS AcceptedAnswers FROM Posts AS p WHERE Tags LIKE '%pandas%' GROUP BY TIME_TO_STR(p.CreationDate, '%Y'), TIME_TO_STR(p.CreationDate, '%m')) SELECT DATE(CONCAT(Ye... | sede |
CREATE TABLE table_67065 (
"Season" real,
"Series" text,
"Wins" text,
"Podiums" text,
"Position" text
) | What is the value for Position, when the Series is the Macau Grand Prix, and when the Season is before 2007? | SELECT "Position" FROM table_67065 WHERE "Series" = 'macau grand prix' AND "Season" < '2007' | 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 PostHistoryTypes (
Id number,
Name te... | Have your own first posts been questions or an answers?. | SELECT Id AS "post_link", 'post_type' = CASE PostTypeId WHEN 1 THEN 'Question' WHEN 2 THEN 'Answer' ELSE '???' END FROM Posts WHERE (PostTypeId = 1 OR PostTypeId = 2) AND OwnerUserId = '##UserID##' ORDER BY Id LIMIT 10 | sede |
CREATE TABLE table_name_36 (
round VARCHAR,
pick VARCHAR
) | What is the round of pick 63? | SELECT round FROM table_name_36 WHERE pick = 63 | sql_create_context |
CREATE TABLE table_name_72 (
college VARCHAR,
position VARCHAR,
pick__number VARCHAR,
round VARCHAR
) | Pick # smaller than 46, and a Round of 5, and a Position of defensive tackle involves which college? | SELECT college FROM table_name_72 WHERE pick__number < 46 AND round = 5 AND position = "defensive tackle" | sql_create_context |
CREATE TABLE table_204_325 (
id number,
"class" text,
"name" text,
"company" text,
"residence" text,
"term expires dec 31" number,
"notes" text
) | what is the name of the company at the top of the chart ? | SELECT "company" FROM table_204_325 WHERE id = 1 | squall |
CREATE TABLE Ref_Transaction_Types (
transaction_type_code VARCHAR(10),
transaction_type_description VARCHAR(80)
)
CREATE TABLE Purchases (
purchase_transaction_id INTEGER,
purchase_details VARCHAR(255)
)
CREATE TABLE Lots (
lot_id INTEGER,
investor_id INTEGER,
lot_details VARCHAR(255)
)
... | Return the number of the lot details of lots that belong to investors with details 'l'?, and show in desc by the x axis. | SELECT lot_details, COUNT(lot_details) FROM Investors AS T1 JOIN Lots AS T2 ON T1.investor_id = T2.investor_id WHERE T1.Investor_details = "l" GROUP BY lot_details ORDER BY lot_details DESC | nvbench |
CREATE TABLE table_name_48 (
athlete VARCHAR,
result VARCHAR
) | What was the athlete with a final result of 4.30? | SELECT athlete FROM table_name_48 WHERE result = "4.30" | sql_create_context |
CREATE TABLE table_3490 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | Name the least number in series for james quinn | SELECT MIN("No. in series") FROM table_3490 WHERE "Directed by" = 'James Quinn' | wikisql |
CREATE TABLE table_29127804_3 (
date VARCHAR,
location VARCHAR
) | what is the date of the game played in the bangalore , karnataka, india location | SELECT date FROM table_29127804_3 WHERE location = "Bangalore , Karnataka, India" | sql_create_context |
CREATE TABLE table_38508 (
"Name" text,
"Type" text,
"Date" text,
"Condition" text,
"Ownership" text
) | What is the Name of the Historic House of the 18th Century? | SELECT "Name" FROM table_38508 WHERE "Type" = 'historic house' AND "Date" = '18th century' | wikisql |
CREATE TABLE table (
position VARCHAR,
player VARCHAR,
Chivu VARCHAR
) | Name the position for chivu | SELECT position FROM table WHERE player = Chivu | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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 locations (
LOCAT... | For those employees who do not work in departments with managers that have ids between 100 and 200, return a bar chart about the distribution of hire_date and the sum of employee_id bin hire_date by time, display total number from high to low order. | SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_6299 (
"Player" text,
"Sacks" real,
"INT'S" real,
"Yards" real,
"Average" real,
"Long" text
) | What is Randy Scott's lowest yards when there are 0 INTs and more than 3 sacks? | SELECT MIN("Yards") FROM table_6299 WHERE "INT'S" = '0' AND "Player" = 'randy scott' AND "Sacks" > '3' | wikisql |
CREATE TABLE table_name_48 (
record VARCHAR,
date VARCHAR
) | What's the record for january 10? | SELECT record FROM table_name_48 WHERE date = "january 10" | sql_create_context |
CREATE TABLE table_1342256_32 (
incumbent VARCHAR,
district VARCHAR
) | Who is the sitting Representative In the New York 10 polling area race? | SELECT incumbent FROM table_1342256_32 WHERE district = "New York 10" | sql_create_context |
CREATE TABLE table_78515 (
"Date" text,
"Visiting Team" text,
"Final Score" text,
"Host Team" text,
"Stadium" text
) | Tell me the date for pittsburgh steelers | SELECT "Date" FROM table_78515 WHERE "Visiting Team" = 'pittsburgh steelers' | wikisql |
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 vitalperiodi... | for the last time during this month, when did patient 021-80293 get a lab test? | SELECT 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 = '021-80293')) AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_T... | 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... | 赵文敏病人的药品消费低于860.27元的医疗记录有哪几次,医疗就诊编号是多少 | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '赵文敏' AND NOT t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 860.27) | css |
CREATE TABLE table_name_86 (
transfer_fee VARCHAR,
name VARCHAR
) | What is the transfer fee for Paolo Vanoli? | SELECT transfer_fee FROM table_name_86 WHERE name = "paolo vanoli" | sql_create_context |
CREATE TABLE table_17102076_10 (
high_assists VARCHAR,
score VARCHAR
) | Name the high assists for score being l 98 118 (ot) | SELECT high_assists FROM table_17102076_10 WHERE score = "L 98–118 (OT)" | sql_create_context |
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 PostFeedback (
Id number,
PostId number,
IsAnon... | Number of questions by year. | SELECT TIME_TO_STR(CreationDate, '%y') AS the_year, COUNT(*) FROM Posts GROUP BY TIME_TO_STR(CreationDate, '%y') ORDER BY TIME_TO_STR(CreationDate, '%y') | sede |
CREATE TABLE table_77520 (
"Team" text,
"Games Played" real,
"Wins" real,
"Losses" real,
"Ties" real,
"Goals For" real,
"Goals Against" real
) | what is the total number of goals for when the ties is more than 0, the goals against is more than 35 and the wins is less than 2? | SELECT COUNT("Goals For") FROM table_77520 WHERE "Ties" > '0' AND "Goals Against" > '35' AND "Wins" < '2' | wikisql |
CREATE TABLE gyb (
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... | 从2002年5月9日起,截止到2012年5月19日,6959651这个医院有多少科室涉及的医疗费总额不在90.82元以下 | SELECT COUNT(*) FROM (SELECT qtb.MED_ORG_DEPT_CD FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '6959651' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2002-05-09' AND '2012-05-19' GROUP BY qtb.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) >= 90.82 UNION SELECT gyb.MED_ORG_DEPT_CD FROM... | css |
CREATE TABLE table_name_21 (
Lieutenant VARCHAR,
left_office VARCHAR
) | Who was Lieutenant Governor to the governor that left office on January 14, 1929? | SELECT Lieutenant AS governor FROM table_name_21 WHERE left_office = "january 14, 1929" | sql_create_context |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | Show the name of the product that is cheapest in each product category with their minimum price with a bar graph, and sort from high to low by the bars. | SELECT Name, MIN(Price) FROM Products GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_54666 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the away team score at victoria park? | SELECT "Away team score" FROM table_54666 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_11094950_1 (
team VARCHAR,
division VARCHAR,
location VARCHAR
) | Which teams were in the central division and located in livonia? | SELECT team FROM table_11094950_1 WHERE division = "Central" AND location = "Livonia" | sql_create_context |
CREATE TABLE table_76463 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | When was the score 56-26? | SELECT "Date" FROM table_76463 WHERE "Record" = '56-26' | wikisql |
CREATE TABLE record (
ID int,
Result text,
Swimmer_ID int,
Event_ID int
)
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimme... | A bar chart for finding the number of the names of stadiums that some Australian swimmers have been to, could you list by the total number from high to low? | SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name ORDER BY COUNT(T4.Name) DESC | nvbench |
CREATE TABLE table_59629 (
"Episode No." text,
"Airdate" text,
"Time" text,
"Ratings (5 capital cities)" real,
"Timeslot rank" text,
"Overall nightly rank" text
) | What was the rating of the episode Wonder Drug? | SELECT "Ratings (5 capital cities)" FROM table_59629 WHERE "Episode No." = 'wonder drug' | wikisql |
CREATE TABLE table_204_906 (
id number,
"#" number,
"title" text,
"songwriters" text,
"producer(s)" text,
"performer" text
) | what is the number of tracks that have no songwriters ? | SELECT COUNT(*) FROM table_204_906 WHERE "songwriters" IS NULL | squall |
CREATE TABLE table_name_3 (
party VARCHAR,
name VARCHAR
) | Fran ois Gendron was in which party? | SELECT party FROM table_name_3 WHERE name = "françois gendron" | sql_create_context |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | Show the average age for male and female students Visualize by bar chart, I want to rank by the mean age in asc please. | SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) | nvbench |
CREATE TABLE table_55720 (
"Race Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Constructor" text,
"Report" text
) | What was the race that featured stirling moss winning with a maserati at aintree? | SELECT "Race Name" FROM table_55720 WHERE "Constructor" = 'maserati' AND "Circuit" = 'aintree' AND "Winning driver" = 'stirling moss' | 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_CLINIC_ID text,
MED_DIRE_CD tex... | 根据不一样的科室名计算出3519389这家医院全部诊疗记录里,统筹基金与医疗总费用平均的比值 | SELECT t_kc21.MED_ORG_DEPT_NM, AVG(t_kc24.OVE_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '3519389' GROUP BY t_kc21.MED_ORG_DEPT_NM | css |
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... | 在医疗就诊45488624657中,开出的哪些药的名称中包含丁酸?其对应的价格呢 | SELECT SOC_SRT_DIRE_CD, SOC_SRT_DIRE_NM, AMOUNT FROM t_kc22 WHERE MED_CLINIC_ID = '45488624657' AND SOC_SRT_DIRE_NM LIKE '%丁酸%' | css |
CREATE TABLE table_name_77 (
release_date VARCHAR,
frequency VARCHAR
) | What's the release date of the processor with 2.8 ghz of frequency? | SELECT release_date FROM table_name_77 WHERE frequency = "2.8 ghz" | sql_create_context |
CREATE TABLE table_name_69 (
goals_scored INTEGER,
points VARCHAR,
place VARCHAR,
team VARCHAR
) | For Once Municipal, what were the goals scored that had less than 27 points and greater than place 1? | SELECT AVG(goals_scored) FROM table_name_69 WHERE place > 1 AND team = "once municipal" AND points < 27 | sql_create_context |
CREATE TABLE table_1341604_22 (
party VARCHAR,
candidates VARCHAR
) | what's the party with candidates being silvio conte (r) unopposed | SELECT party FROM table_1341604_22 WHERE candidates = "Silvio Conte (R) Unopposed" | sql_create_context |
CREATE TABLE table_72309 (
"Strongs #" real,
"Hebrew word" text,
"Strongs Transliteration" text,
"Strongs Words Compounded" text,
"English Spelling" text
) | What is the strongs transliteration of the hebrew word ? | SELECT "Strongs Transliteration" FROM table_72309 WHERE "Hebrew word" = 'יוֹחָנָן' | wikisql |
CREATE TABLE table_30108930_6 (
cfl_team VARCHAR,
pick__number VARCHAR
) | Which CFL team was pick #35? | SELECT cfl_team FROM table_30108930_6 WHERE pick__number = 35 | sql_create_context |
CREATE TABLE table_18504 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What district does Harlan Hagen represent? | SELECT "District" FROM table_18504 WHERE "Incumbent" = 'Harlan Hagen' | wikisql |
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... | 在哪些医疗记录中病患68782989被开出过金额高于4261.3元的药品?这些对应的就诊编号为多少? | SELECT gwyjzb.MED_CLINIC_ID FROM gwyjzb WHERE gwyjzb.PERSON_ID = '68782989' AND gwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 4261.3) UNION SELECT fgwyjzb.MED_CLINIC_ID FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '68782989' AND fgwyjzb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FR... | css |
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),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | What are total salaries and department id for each department that has more than 2 employees. Show scatter chart. | SELECT DEPARTMENT_ID, SUM(SALARY) FROM employees GROUP BY DEPARTMENT_ID | nvbench |
CREATE TABLE table_name_75 (
socket VARCHAR,
release_price___usd__ VARCHAR,
turbo VARCHAR
) | Which socket goes with the item with release price of $378 and turbo of 6/6/8/9? | SELECT socket FROM table_name_75 WHERE release_price___usd__ = "$378" AND turbo = "6/6/8/9" | 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... | 门诊诊断的患者为疾病G14.222的检测指标872554数值的平均值以及最值都分别有多少? | SELECT AVG(jyjgzbb.JCZBJGDL), MIN(jyjgzbb.JCZBJGDL), MAX(jyjgzbb.JCZBJGDL) FROM mzjzjlb JOIN zyjybgb JOIN jyjgzbb ON mzjzjlb.YLJGDM = zyjybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = zyjybgb.JZLSH_MZJZJLB AND zyjybgb.YLJGDM = jyjgzbb.YLJGDM AND zyjybgb.BGDH = jyjgzbb.BGDH WHERE mzjzjlb.JZZDBM = 'G14.222' AND jyjgzbb.JCZBDM =... | 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... | How many of the christian scientist patients had a hyaline casts lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "CHRISTIAN SCIENTIST" AND lab.label = "Hyaline Casts" | mimicsql_data |
CREATE TABLE table_26790 (
"Contestant" text,
"Starting Weight (kg)" text,
"Final Weight (kg)" text,
"Weight Lost (kg)" text,
"Percentage Lost" text,
"Position (out of Eliminated Contestants)" text
) | What is the starting weight if weight lost is 54.6? | SELECT "Starting Weight (kg)" FROM table_26790 WHERE "Weight Lost (kg)" = '54.6' | wikisql |
CREATE TABLE table_2516282_3 (
partner VARCHAR,
score VARCHAR
) | Who was the partner when the score was 7 5, 7 6 (7 5)? | SELECT partner FROM table_2516282_3 WHERE score = "7–5, 7–6 (7–5)" | sql_create_context |
CREATE TABLE table_3969 (
"Proceed to Quarter-final" text,
"Match points" text,
"Aggregate score" text,
"Points margin" real,
"Eliminated from competition" text
) | Who was eliminated from the competition when pau proceed to the quarter final? | SELECT "Eliminated from competition" FROM table_3969 WHERE "Proceed to Quarter-final" = 'Pau' | wikisql |
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,
friday varchar,
saturday varchar,
sunday varchar,
has_final_proje... | Of all classes which ones offer 18 credits ? | SELECT DISTINCT name, number FROM course WHERE credits = 18 AND department = 'EECS' | advising |
CREATE TABLE table_name_81 (
nhl_team VARCHAR,
position VARCHAR,
college_junior_club_team VARCHAR
) | What NHL team has a player in the position of Left Wing that came from the Toronto Marlboros (omjhl)? | SELECT nhl_team FROM table_name_81 WHERE position = "left wing" AND college_junior_club_team = "toronto marlboros (omjhl)" | sql_create_context |
CREATE TABLE table_52004 (
"Number & Name" text,
"Description" text,
"Livery" text,
"Owner(s)" text,
"Date" real
) | What livery was worn on the date before 1936, with the description of Gresley RF? | SELECT "Livery" FROM table_52004 WHERE "Date" < '1936' AND "Description" = 'gresley rf' | 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... | 知道在03年9月5日到09年6月13日内医院4849032的科室690涉及到多少医疗费用吗 | SELECT SUM(MED_AMOUT) FROM t_kc24 WHERE MED_CLINIC_ID IN (SELECT MED_CLINIC_ID FROM t_kc21 WHERE MED_SER_ORG_NO = '4849032' AND MED_ORG_DEPT_CD = '690') AND CLINIC_SLT_DATE BETWEEN '2003-09-05' AND '2009-06-13' | css |
CREATE TABLE table_name_57 (
college VARCHAR,
position VARCHAR
) | Position of running back involves which college? | SELECT college FROM table_name_57 WHERE position = "running back" | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospit... | what organism was found in patient 025-19271's first test of urine, catheter specimen since 18 months ago? | SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-19271')) AND microlab.culturesite = 'urine, catheter specimen' AND DA... | eicu |
CREATE TABLE table_name_12 (
event VARCHAR,
opponent VARCHAR
) | What is the event where the opponent was Chris Barden? | SELECT event FROM table_name_12 WHERE opponent = "chris barden" | sql_create_context |
CREATE TABLE table_74915 (
"Pick #" real,
"Round" text,
"Player" text,
"Position" text,
"College" text
) | In what Round was a player from College of Connecticut drafted? | SELECT "Round" FROM table_74915 WHERE "College" = 'connecticut' | wikisql |
CREATE TABLE table_63408 (
"Year" text,
"Matches" real,
"Tries" real,
"Goals" real,
"Points" real
) | What are the highest points with 2012 as the year? | SELECT MAX("Points") FROM table_63408 WHERE "Year" = '2012' | wikisql |
CREATE TABLE table_69001 (
"Engine code" text,
"Displacement" text,
"Power, Torque@rpm" text,
"Redline (rpm)" real,
"Year" real
) | What is the average Redline RPM of engines with engine code M57TUD30, made after 2002? | SELECT AVG("Redline (rpm)") FROM table_69001 WHERE "Engine code" = 'm57tud30' AND "Year" > '2002' | wikisql |
CREATE TABLE table_name_46 (
governors_1950 VARCHAR,
general_1950 VARCHAR
) | What is the Governors 1950 when the General 1950 is general 1979? | SELECT governors_1950 FROM table_name_46 WHERE general_1950 = "general 1979" | sql_create_context |
CREATE TABLE table_204_255 (
id number,
"constituency number" number,
"name" text,
"reserved for (sc/st/none)" text,
"district" text,
"number of electorates (2009)" number
) | the number of electorates represented in the niwari segment is more than those in which other segment ? | SELECT "name" FROM table_204_255 WHERE "number of electorates (2009)" < (SELECT "number of electorates (2009)" FROM table_204_255 WHERE "name" = 'niwari') | squall |
CREATE TABLE invoice_lines (
id INTEGER,
invoice_id INTEGER,
track_id INTEGER,
unit_price NUMERIC(10,2),
quantity INTEGER
)
CREATE TABLE invoices (
id INTEGER,
customer_id INTEGER,
invoice_date TIMESTAMP,
billing_address VARCHAR(70),
billing_city VARCHAR(40),
billing_state V... | List the top 5 genres by number of tracks. List genres name and total tracks. Visualize by pie chart. | SELECT T1.name, COUNT(*) FROM genres AS T1 JOIN tracks AS T2 ON T2.genre_id = T1.id GROUP BY T1.id ORDER BY COUNT(*) DESC LIMIT 5 | nvbench |
CREATE TABLE diagnoses (
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 (... | how many patients whose diagnoses short title is schizophrenia nos-unspec and lab test abnormal status is abnormal? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Schizophrenia NOS-unspec" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_5023 (
"Games" real,
"Drawn" real,
"Lost" real,
"Points difference" text,
"Points" real
) | Name the sum of drawn for points less than 6 and games more than 8 | SELECT SUM("Drawn") FROM table_5023 WHERE "Points" < '6' AND "Games" > '8' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.