context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_78417 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was the home team in the game where North Melbourne was the away team? | SELECT "Home team score" FROM table_78417 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE table_56730 (
"Edition" real,
"Zone" text,
"Round" text,
"Date" text,
"Against" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Result" text
) | Which zone had m d lina gojnea monica niculescu as the opponent? | SELECT "Zone" FROM table_56730 WHERE "Opponents" = 'mădălina gojnea monica niculescu' | wikisql |
CREATE TABLE table_name_24 (
pronunciation_spelled_free VARCHAR,
pronunciation_spelled_checked VARCHAR
) | What is Pronunciation Spelled Free, when Pronunciation Spelled Checked is ' '? | SELECT pronunciation_spelled_free FROM table_name_24 WHERE pronunciation_spelled_checked = "ɑ" | sql_create_context |
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 swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_20... | Return a bar chart about the distribution of meter_200 and the amount of meter_200 , and group by attribute meter_200, and list by the bar in descending. | SELECT meter_200, COUNT(meter_200) FROM swimmer GROUP BY meter_200 ORDER BY meter_200 DESC | nvbench |
CREATE TABLE table_27462 (
"Rank" real,
"Rider" text,
"Sat 29 May" text,
"Mon 31 May" text,
"Tues 1 June" text,
"Wed 2 June" text,
"Thurs 3 June" text,
"Fri 4 June" text
) | How many times are listed for 31 May for the rider ranked 5? | SELECT COUNT("Mon 31 May") FROM table_27462 WHERE "Rank" = '5' | wikisql |
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,
... | Most common badges by count. | SELECT COUNT(UserId) AS Earned, Name, CASE WHEN Class = 1 THEN 'Gold' WHEN Class = 2 THEN 'Silver' WHEN Class = 3 THEN 'Bronze' END AS Class FROM Badges WHERE TagBased = 0 GROUP BY Name, Class ORDER BY Earned DESC | sede |
CREATE TABLE table_69827 (
"Rank" real,
"Player" text,
"Years" text,
"Games" real,
"Ast. Avg." real,
"Total Assists" real
) | How many assists does cam long average in under 132 games? | SELECT MAX("Ast. Avg.") FROM table_69827 WHERE "Player" = 'cam long' AND "Games" < '132' | wikisql |
CREATE TABLE table_name_56 (
most_recent VARCHAR,
height__m_ VARCHAR,
first_time_as_hc_climb VARCHAR
) | What was the most recent year a height of 2770 m and a HC climb before 1992 was climbed? | SELECT COUNT(most_recent) FROM table_name_56 WHERE height__m_ = "2770" AND first_time_as_hc_climb < 1992 | sql_create_context |
CREATE TABLE table_name_15 (
captain VARCHAR,
club VARCHAR
) | Who is the captain of Middlesbrough? | SELECT captain FROM table_name_15 WHERE club = "middlesbrough" | sql_create_context |
CREATE TABLE Tags (
Id number,
TagName text,
Count number,
ExcerptPostId number,
WikiPostId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
... | Number of Tags per day for one tag. | SELECT * FROM Tags LIMIT 20 | sede |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of revenue , and group by attribute name, show x axis in descending order. | SELECT T2.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC | nvbench |
CREATE TABLE table_74369 (
"Rank" real,
"Rider" text,
"Mon 30 May" text,
"Tues 31 May" text,
"Wed 1 June" text,
"Thurs 2 June" text,
"Fri 3 June" text
) | What is the Thurs 2 June time for the rider with a Fri 3 June time of 17' 36.58 128.554mph? | SELECT "Thurs 2 June" FROM table_74369 WHERE "Fri 3 June" = '17'' 36.58 128.554mph' | wikisql |
CREATE TABLE table_28501 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" real,
"Joined" real,
"Nickname" text
) | What is the nickname of the institution from Concordia University, Nebraska? | SELECT "Nickname" FROM table_28501 WHERE "Institution" = 'Concordia University, Nebraska' | wikisql |
CREATE TABLE fgwyjzb (
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,
... | 患者95900132在02年1月4日到14年9月24日内去了哪几个医院? | SELECT COUNT(gwyjzb.MED_SER_ORG_NO) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '95900132' AND gwyjzb.IN_HOSP_DATE BETWEEN '2002-01-04' AND '2014-09-24' UNION SELECT COUNT(fgwyjzb.MED_SER_ORG_NO) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '95900132' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2002-01-04' AND '2014-09-24' | 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 lab (
labid numbe... | count the number of patients who were given a stool microbiology test since 5 years ago. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'stool' AND DATETIME(microlab.culturetakentime) >= DATETIME(CURRENT_TIME(), '-5 year')) | eicu |
CREATE TABLE candidate (
Candidate_ID int,
People_ID int,
Poll_Source text,
Date text,
Support_rate real,
Consider_rate real,
Oppose_rate real,
Unsure_rate real
)
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight re... | A bar chart shows the distribution of Date_of_Birth and Weight , and order Y-axis in desc order please. | SELECT Date_of_Birth, Weight FROM people ORDER BY Weight DESC | nvbench |
CREATE TABLE table_78596 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
) | What is T2 Place Player Steve Flesch's Score? | SELECT MAX("Score") FROM table_78596 WHERE "Place" = 't2' AND "Player" = 'steve flesch' | wikisql |
CREATE TABLE table_47771 (
"Name" text,
"Built" text,
"Listed" text,
"Location" text,
"Borough" text
) | What is the Borough for the Seward listing on 1977-11-23? | SELECT "Borough" FROM table_47771 WHERE "Location" = 'seward' AND "Listed" = '1977-11-23' | wikisql |
CREATE TABLE body_builder (
body_builder_id number,
people_id number,
snatch number,
clean_jerk number,
total number
)
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
birth_date text,
birth_place text
) | What are the names of body builders whose total score is higher than 300? | SELECT T2.name FROM body_builder AS T1 JOIN people AS T2 ON T1.people_id = T2.people_id WHERE T1.total > 300 | spider |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | How many courses are taught by more than 2 professors ? | SELECT COUNT(DISTINCT course_offering.course_id) FROM course, course_offering, offering_instructor AS OFFERING_INSTRUCTOR_0, offering_instructor AS OFFERING_INSTRUCTOR_1, offering_instructor AS OFFERING_INSTRUCTOR_2 WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND OFFERING_INSTRUCTO... | advising |
CREATE TABLE table_name_73 (
position VARCHAR,
birthplace VARCHAR,
height__cm_ VARCHAR,
weight__kg_ VARCHAR
) | What is the Position with a height of less than 183, and a weight of less than 91 kg and born in bloomington, minnesota? | SELECT position FROM table_name_73 WHERE height__cm_ < 183 AND weight__kg_ < 91 AND birthplace = "bloomington, minnesota" | sql_create_context |
CREATE TABLE table_name_16 (
event VARCHAR,
venue VARCHAR
) | What event was held in Chihuahua, Mexico? | SELECT event FROM table_name_16 WHERE venue = "chihuahua, mexico" | sql_create_context |
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2)... | What is the sum of credit value of courses with more than one prerequisite for each department? Return a bar chart, and show in descending by the dept_name. | SELECT dept_name, SUM(credits) FROM course AS T1 JOIN prereq AS T2 ON T1.course_id = T2.course_id GROUP BY dept_name ORDER BY dept_name DESC | nvbench |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me the trend about department_id over hire_date with a line chart, and order by the X-axis in asc please. | SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY HIRE_DATE | nvbench |
CREATE TABLE table_232458_1 (
population__2010_census_ INTEGER,
area__km²_ VARCHAR
) | If the area is 66.34, what is the minimum (2010 census) population? | SELECT MIN(population__2010_census_) FROM table_232458_1 WHERE area__km²_ = "66.34" | sql_create_context |
CREATE TABLE table_56850 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | In the match where south melbourne was the away team, who was the home team? | SELECT "Home team" FROM table_56850 WHERE "Away team" = 'south melbourne' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | what is the marital status of Stephane Suchan? | SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_14844 (
"Minister" text,
"Party" text,
"Start date" text,
"End date" text,
"Prime Minister" text
) | Name the party with end date of 22 november 1980 | SELECT "Party" FROM table_14844 WHERE "End date" = '22 november 1980' | wikisql |
CREATE TABLE table_name_67 (
competition VARCHAR,
lost VARCHAR,
season VARCHAR
) | Which competition did not qualify for UEFA competitions in the 1970-71 season? | SELECT competition FROM table_name_67 WHERE lost = "did not qualify for uefa competitions" AND season = "1970-71" | sql_create_context |
CREATE TABLE table_204_283 (
id number,
"season" text,
"series" text,
"team" text,
"races" number,
"wins" number,
"poles" number,
"f/laps" number,
"podiums" number,
"points" number,
"position" text
) | total races in 2003 season | SELECT SUM("races") FROM table_204_283 WHERE "season" = 2003 | squall |
CREATE TABLE Participants_in_Events (
Event_ID INTEGER,
Participant_ID INTEGER
)
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)... | How many events have each participants attended? Show their average number by each participant type code using a bar chart, and list by the x axis in desc. | SELECT T1.Participant_Type_Code, AVG(COUNT(*)) FROM Participants AS T1 JOIN Participants_in_Events AS T2 ON T1.Participant_ID = T2.Participant_ID GROUP BY T1.Participant_Type_Code ORDER BY T1.Participant_Type_Code DESC | nvbench |
CREATE TABLE table_48693 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What was the score for the player from Scotland? | SELECT "Score" FROM table_48693 WHERE "Country" = 'scotland' | wikisql |
CREATE TABLE table_52845 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | How many in attendance with a loss of volquez (1 4)? | SELECT "Attendance" FROM table_52845 WHERE "Loss" = 'volquez (1–4)' | wikisql |
CREATE TABLE table_name_67 (
series VARCHAR,
season VARCHAR
) | What was the Series in 2009? | SELECT series FROM table_name_67 WHERE season = 2009 | sql_create_context |
CREATE TABLE table_name_40 (
record VARCHAR,
date VARCHAR
) | What was the record on March 27? | SELECT record FROM table_name_40 WHERE date = "march 27" | sql_create_context |
CREATE TABLE party_events (
Event_ID int,
Event_Name text,
Party_ID int,
Member_in_charge_ID int
)
CREATE TABLE region (
Region_ID int,
Region_name text,
Date text,
Label text,
Format text,
Catalogue text
)
CREATE TABLE party (
Party_ID int,
Minister text,
Took_offi... | How many members are in each party. Show bar chart. | SELECT Party_name, COUNT(*) FROM member AS T1 JOIN party AS T2 ON T1.Party_ID = T2.Party_ID GROUP BY T1.Party_ID | nvbench |
CREATE TABLE table_53890 (
"Tournament" text,
"Winner" text,
"Runner-up" text,
"Score" text,
"Third Place" text
) | what is the score when the runner-up is richard krajicek? | SELECT "Score" FROM table_53890 WHERE "Runner-up" = 'richard krajicek' | wikisql |
CREATE TABLE Accounts (
Account_ID INTEGER,
Statement_ID INTEGER,
Account_Details VARCHAR(255)
)
CREATE TABLE Projects (
Project_ID INTEGER,
Project_Details VARCHAR(255)
)
CREATE TABLE Ref_Document_Types (
Document_Type_Code CHAR(15),
Document_Type_Name VARCHAR(255),
Document_Type_Desc... | Show me a pie chart for how many documents are there of each type? | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code | nvbench |
CREATE TABLE table_25794138_1 (
captain VARCHAR,
team VARCHAR
) | Wh owas the captian of the north east stars? | SELECT captain FROM table_25794138_1 WHERE team = "North East Stars" | sql_create_context |
CREATE TABLE table_13642023_2 (
gtu_winning_team VARCHAR,
to_winning_team VARCHAR
) | Who was the GTU winning team when the TO winning team was #3 Camaro? | SELECT gtu_winning_team FROM table_13642023_2 WHERE to_winning_team = "#3 Camaro" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | give me the number of patients whose age is less than 86 and days of hospital stay is greater than 34? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "86" AND demographic.days_stay > "34" | mimicsql_data |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
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_NA... | For those employees who was hired before 2002-06-21, a bar chart shows the distribution of job_id and the average of department_id , and group by attribute job_id, show X in descending order please. | SELECT JOB_ID, AVG(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_78276 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What is the home teams score at Victoria Park? | SELECT "Home team score" FROM table_78276 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_name_17 (
home_team VARCHAR,
away_team VARCHAR
) | What is the name of the home team that played against Collingwood? | SELECT home_team FROM table_name_17 WHERE away_team = "collingwood" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTasks (
Id number,
ReviewTaskTypeId number,
CreationDate time,
DeletionDate time,
ReviewTaskStateId number,
PostId number,
SuggestedEditId number,
CompletedByReviewTaskId number
)
CRE... | Almost AbandonedClosed questions (one vote missing in question and/or answer). This query aims to identify borderline questions to the RemoveAbandonedClosed script described in https://meta.stackexchange.com/help/roomba. All criteria are met except score from question and/or answers(s) which are one vote off from autom... | SELECT q.Id AS "post_link" FROM Posts AS q INNER JOIN PostHistory AS ph ON ph.PostId = q.Id WHERE q.ClosedDate < CURRENT_TIMESTAMP() - 9 AND ph.PostHistoryTypeId = 10 AND ph.Comment NOT IN ('1', '101') AND NOT EXISTS(SELECT * FROM PostHistory AS ph WHERE ph.PostId = q.Id AND ph.PostHistoryTypeId = 14) AND q.Score <= 1 ... | sede |
CREATE TABLE table_31550 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What was the score of the Washington tournament? | SELECT "Score" FROM table_31550 WHERE "Tournament" = 'washington' | wikisql |
CREATE TABLE table_204_971 (
id number,
"m" number,
"date" text,
"tournament" text,
"round" text,
"ground" text,
"opponent" text,
"score" text,
"attendance" number,
"dinamo scorers" text,
"report" text
) | which team did they play first during this season ? | SELECT "opponent" FROM table_204_971 WHERE "m" = 1 | squall |
CREATE TABLE table_name_44 (
cuts_made INTEGER,
top_25 VARCHAR,
events VARCHAR
) | How many cuts did he make in the tournament with 3 top 25s and under 13 events? | SELECT MAX(cuts_made) FROM table_name_44 WHERE top_25 = 3 AND events < 13 | sql_create_context |
CREATE TABLE table_6703 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponent" text,
"Score" text
) | Which Opponent had a Surface of hard, and a Partner of maria elena camerin? | SELECT "Opponent" FROM table_6703 WHERE "Surface" = 'hard' AND "Partner" = 'maria elena camerin' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | what is diagnoses long title of subject name paul edwards? | SELECT diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Paul Edwards" | mimicsql_data |
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 was the name of the procedure that patient 4718 received two times until 08/2102. | SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t1.icd9_code FROM (SELECT procedures_icd.icd9_code, COUNT(procedures_icd.charttime) AS c1 FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 471... | mimic_iii |
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... | 在17年6月24日到17年11月6日期间,鲁丽泽这位参保人门诊西药费有多少元 | SELECT SUM(t_kc22.AMOUNT) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '鲁丽泽' AND t_kc21.CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2017-06-24' AND '2017-11-06' AND t_kc22.MED_INV_ITEM_TYPE = '西药费' | css |
CREATE TABLE gwyjzb (
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,
... | 以科室的名称和其出院时诊断出的疾病名为依据,把在2256042号医院就诊的患者所有医疗就诊记录中记录的年龄列出来平均得到什么数呢? | SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '2256042' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_NM UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_NM, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '22... | css |
CREATE TABLE table_name_13 (
date VARCHAR,
away_team VARCHAR
) | When was the away team geelong? | SELECT date FROM table_name_13 WHERE away_team = "geelong" | sql_create_context |
CREATE TABLE table_name_76 (
lost INTEGER,
points VARCHAR,
drawn VARCHAR,
played VARCHAR,
_percentage_won VARCHAR
) | What are the fewest losses for a player lower than 3, with wins fewer than 75%, 0 draws and 56 points? | SELECT MIN(lost) FROM table_name_76 WHERE played > 3 AND _percentage_won < 75 AND drawn = 0 AND points = 56 | sql_create_context |
CREATE TABLE table_63165 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
) | What was the score of Game 48? | SELECT "Score" FROM table_63165 WHERE "Game" = '48' | wikisql |
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserDisplayName text,
UserId number,
ContentLicense text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,... | Comments that vastly outscore the posts they're under. | SELECT Comments.Score AS "CS", Posts.Score AS "PS", ROUND(CAST(Comments.Score AS FLOAT) / CAST(Posts.Score AS FLOAT), 0.001) AS r, Comments.Id AS "comment_link", Users.Id AS "user_link", Posts.Id AS "post_link", Comments.CreationDate FROM Comments JOIN Posts ON Comments.PostId = Posts.Id LEFT JOIN Users ON Comments.Use... | sede |
CREATE TABLE table_name_7 (
to_par VARCHAR,
score VARCHAR
) | What is the To par of the Player with a Score of 70-72-73=215? | SELECT to_par FROM table_name_7 WHERE score = 70 - 72 - 73 = 215 | sql_create_context |
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... | 分别在哪几次医疗记录中给病患袁古韵开出过金额不低于3093.83元的药品?医疗就诊编号是多少? | SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '袁古韵' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3093.83) | css |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | For all employees who have the letters D or S in their first name, show me about the correlation between manager_id and department_id in a scatter chart. | SELECT MANAGER_ID, DEPARTMENT_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id t... | what is the number of patients on base type drug prescription who have diagnoses icd9 code 70715? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.icd9_code = "70715" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_67884 (
"City" text,
"Province/Region" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
) | What is RJCM's IATA? | SELECT "IATA" FROM table_67884 WHERE "ICAO" = 'rjcm' | wikisql |
CREATE TABLE table_17628022_2 (
play_by_play VARCHAR,
pregame_analysts VARCHAR
) | How many different play-by-play announcers also had pregame analysis by Darren Flutie, Eric Tillman and Greg Frers? | SELECT COUNT(play_by_play) FROM table_17628022_2 WHERE pregame_analysts = "Darren Flutie, Eric Tillman and Greg Frers" | sql_create_context |
CREATE TABLE table_72124 (
"Nation" text,
"Population (thousands)" real,
"Internet subscriptions (2000) (thousands of users)" real,
"Internet subscriptions (2008) (thousands of users)" real,
"% growth (2000\u20132008)" real,
"% Internet users" real
) | What is the percentage of growth in 2000-2008 in ethiopia? | SELECT "% growth (2000\u20132008)" FROM table_72124 WHERE "Nation" = 'Ethiopia' | wikisql |
CREATE TABLE table_name_19 (
Id VARCHAR
) | Name the 2004 which has a 2003 of 36,026? | SELECT 2004 FROM table_name_19 WHERE 2003 = "36,026" | sql_create_context |
CREATE TABLE table_29545993_3 (
Ends INTEGER,
stolen_ends VARCHAR,
l VARCHAR
) | What is the minimum ends lost record when the stolen ends records is 6 and the loss record is bigger than 5.0? | SELECT MIN(Ends) AS lost FROM table_29545993_3 WHERE stolen_ends = 6 AND l > 5.0 | sql_create_context |
CREATE TABLE table_74266 (
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What draft pick number was Ric Jackman? | SELECT MIN("Pick") FROM table_74266 WHERE "Player" = 'Ric Jackman' | wikisql |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
... | Draw a bar chart of meter 200 versus the average of id, show from high to low by the Y. | SELECT meter_200, AVG(ID) FROM swimmer GROUP BY meter_200 ORDER BY AVG(ID) DESC | nvbench |
CREATE TABLE table_15892 (
"Player" text,
"Years Played" text,
"Total W-L" text,
"Singles W-L" text,
"Doubles W-L" text
) | what's the total number of singles w-l with doubles w-l of 0 0 and total w-l of 3 1 | SELECT COUNT("Singles W-L") FROM table_15892 WHERE "Doubles W-L" = '0–0' AND "Total W-L" = '3–1' | wikisql |
CREATE TABLE table_55400 (
"Ship's name" text,
"Date entered service" text,
"Date withdrawn" text,
"Tonnage" real,
"Type of Ship" text
) | what is the ships name that is a twin screw ro-ro motorship and entered service on 11 february 1983? | SELECT "Ship's name" FROM table_55400 WHERE "Type of Ship" = 'twin screw ro-ro motorship' AND "Date entered service" = '11 february 1983' | wikisql |
CREATE TABLE table_name_50 (
season VARCHAR,
club VARCHAR,
round VARCHAR
) | Which season has the Werder Bremen Club and is in Round 2r? | SELECT season FROM table_name_50 WHERE club = "werder bremen" AND round = "2r" | sql_create_context |
CREATE TABLE table_name_32 (
date VARCHAR,
attendance VARCHAR,
man_of_the_match VARCHAR
) | What was the date when the attendance was n/a and the Man of the Match was unknown? | SELECT date FROM table_name_32 WHERE attendance = "n/a" AND man_of_the_match = "unknown" | sql_create_context |
CREATE TABLE table_name_81 (
time_retired VARCHAR,
driver VARCHAR
) | what is the time/retired when the driver is toulo de graffenried? | SELECT time_retired FROM table_name_81 WHERE driver = "toulo de graffenried" | sql_create_context |
CREATE TABLE table_27268238_5 (
economy VARCHAR
) | What is the 4wi when the economy is 7.82? | SELECT 4 AS wi FROM table_27268238_5 WHERE economy = "7.82" | sql_create_context |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_items (
row_id number,
itemid ... | had there been a microbiology test done until 35 months ago for patient 46330? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 46330) AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-35 month') | mimic_iii |
CREATE TABLE table_35755 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text
) | When the incumbent was William Elliott, what was the result? | SELECT "Result" FROM table_35755 WHERE "Incumbent" = 'william elliott' | wikisql |
CREATE TABLE table_name_54 (
score VARCHAR,
location_attendance VARCHAR
) | What was the score of the game at Great Western Forum? | SELECT score FROM table_name_54 WHERE location_attendance = "great western forum" | sql_create_context |
CREATE TABLE table_name_91 (
draws INTEGER,
wins VARCHAR,
position VARCHAR,
points VARCHAR,
conceded VARCHAR
) | Which Draws has Points smaller than 15, and a Conceded larger than 10, and a Position larger than 8, and Wins of 1? | SELECT MIN(draws) FROM table_name_91 WHERE points < 15 AND conceded > 10 AND position > 8 AND wins = 1 | sql_create_context |
CREATE TABLE School (
School_id text,
School_name text,
Location text,
Mascot text,
Enrollment int,
IHSAA_Class text,
IHSAA_Football_Class text,
County text
)
CREATE TABLE budget (
School_id int,
Year int,
Budgeted int,
total_budget_percent_budgeted real,
Invested in... | Show each county along with the number of schools, and display in ascending by the the total number . | SELECT County, COUNT(*) FROM School GROUP BY County ORDER BY COUNT(*) | nvbench |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | give me the number of widow patients who were admitted before 2150. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.admityear < "2150" | mimicsql_data |
CREATE TABLE table_34497 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
) | On what Week was the Result W 17-14? | SELECT AVG("Week") FROM table_34497 WHERE "Result" = 'w 17-14' | 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... | 来医院2171159就诊的医疗记录中显示入院时诊断为D38.070的最低和最高医疗费用总额是多少? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '2171159' AND t_kc21.IN_DIAG_DIS_CD = 'D38.070') | css |
CREATE TABLE table_49417 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | What is Finish, when Country is 'South Africa'? | SELECT "Finish" FROM table_49417 WHERE "Country" = 'south africa' | wikisql |
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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE chart... | in this month, the temperature c (calc) of patient 14467 had been normal? | 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 = 14467)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'temperature c (ca... | mimic_iii |
CREATE TABLE table_name_20 (
country VARCHAR,
place VARCHAR,
player VARCHAR
) | What country is Stephen Ames from with a place value of t9? | SELECT country FROM table_name_20 WHERE place = "t9" AND player = "stephen ames" | sql_create_context |
CREATE TABLE table_name_97 (
rank INTEGER,
country VARCHAR
) | What is the rank of Israel? | SELECT MAX(rank) FROM table_name_97 WHERE country = "israel" | sql_create_context |
CREATE TABLE table_74901 (
"Round" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning team" text
) | What Round was the Winning Team Engstler Motorsport Maurer Motorsport? | SELECT "Round" FROM table_74901 WHERE "Winning team" = 'engstler motorsport maurer motorsport' | wikisql |
CREATE TABLE table_name_69 (
school VARCHAR,
height VARCHAR
) | What school did the player that is 6-6 go to? | SELECT school FROM table_name_69 WHERE height = "6-6" | sql_create_context |
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 was the name of the procedure performed to patient 030-52327, two times during this month? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, COUNT(treatment.treatmenttime) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ... | eicu |
CREATE TABLE table_11489 (
"Player" text,
"Nationality" text,
"Position" text,
"Years for Jazz" text,
"School/Club Team" text
) | Who did mark eaton play for? | SELECT "School/Club Team" FROM table_11489 WHERE "Player" = 'mark eaton' | wikisql |
CREATE TABLE table_train_253 (
"id" int,
"pregnancy_or_lactation" bool,
"pre_eclampsia" bool,
"acute_ischemia" bool,
"pre_gestational_hypertension" bool,
"diabetic" string,
"smoking" bool,
"coronary_artery_disease_cad" bool,
"NOUSE" float
) | pregnant female with known type i or type ii diabetes mellitus. | SELECT * FROM table_train_253 WHERE pregnancy_or_lactation = 1 AND (diabetic = 'i' OR diabetic = 'ii') | criteria2sql |
CREATE TABLE table_20726262_2 (
production_code VARCHAR,
no_in_series VARCHAR
) | What was the production code for episode #1? | SELECT production_code FROM table_20726262_2 WHERE no_in_series = 1 | 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
)
... | count the number of patients whose diagnoses long title is personal history of transient ischemic attack (tia), and cerebral infarction without residual deficits? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Personal history of transient ischemic attack (TIA), and cerebral infarction without residual deficits" | mimicsql_data |
CREATE TABLE table_62232 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team (League)" text
) | what is the college/junior/club team (league) when the position is (c) and the round is higher than 2? | SELECT "College/Junior/Club Team (League)" FROM table_62232 WHERE "Position" = '(c)' AND "Round" > '2' | wikisql |
CREATE TABLE table_204_169 (
id number,
"athlete" text,
"event" text,
"race 1\ntime" text,
"race 2\ntime" text,
"total\ntime" text,
"total\nrank" number
) | what is the rank number of stefan shalamanov in the slalom event | SELECT "total\nrank" FROM table_204_169 WHERE "athlete" = 'stefan shalamanov' AND "event" = 'slalom' | squall |
CREATE TABLE table_204_525 (
id number,
"rank" number,
"player" text,
"county" text,
"tally" text,
"total" number,
"opposition" text
) | who is the first opposition in rank 27 ? | SELECT "opposition" FROM table_204_525 WHERE "rank" = 27 LIMIT 1 | squall |
CREATE TABLE table_11885 (
"Date" text,
"Opponent" text,
"Score" text,
"Site/Stadium" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Who was the opponent at Lindsey Nelson Stadium? | SELECT "Opponent" FROM table_11885 WHERE "Site/Stadium" = 'lindsey nelson stadium' | wikisql |
CREATE TABLE table_name_11 (
automobile_name VARCHAR,
manufacturer VARCHAR
) | What is the name of the car manufactured by Letecke Zavody N.P., Jinonice? | SELECT automobile_name FROM table_name_11 WHERE manufacturer = "letecke zavody n.p., jinonice" | sql_create_context |
CREATE TABLE table_name_53 (
constructor VARCHAR,
driver VARCHAR,
grid VARCHAR,
laps VARCHAR
) | Which Constructor has a Grid smaller than 24, more than 77 laps, and a Driver of jean-pierre beltoise? | SELECT constructor FROM table_name_53 WHERE grid < 24 AND laps > 77 AND driver = "jean-pierre beltoise" | 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 diagnoses_icd (
row_... | has there been any record of a microbiology test for patient 20603's sputum during this year? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20603) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 yea... | mimic_iii |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.