context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE Comments (
Id number,
PostId number,
Score number,
Text text,
CreationDate time,
UserD... | Posts by score, from the bottom up. As requested in https://physics.meta.stackexchange.com/q/9813/.
Please don't use this query to go and downvote posts, which would make it self-reinforcing in a really ugly way. This information is relatively useful but please be mindful of how you use it.
Similarly, before you... | SELECT Posts.Id AS "post_link", Posts.OwnerUserId AS "user_link", Posts.Score, Posts.CreationDate, CASE WHEN Posts.PostTypeId = 2 THEN 'Answer' ELSE (CASE WHEN NOT Posts.ClosedDate IS NULL THEN 'Closed Question' ELSE 'Open Question' END) END AS "Post Type" FROM Posts JOIN PostTypes ON Posts.PostTypeId = PostTypes.Id OR... | sede |
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... | Give me the comparison about ACC_Percent over the All_Neutral , show in desc by the All_Neutral please. | SELECT All_Neutral, ACC_Percent FROM basketball_match ORDER BY All_Neutral DESC | nvbench |
CREATE TABLE table_32942 (
"Player" text,
"Nationality" text,
"Position" text,
"From" text,
"School/Country" text
) | What is the name of the player who begin playing for the LA Lakers in 1974? | SELECT "Player" FROM table_32942 WHERE "From" = '1974' | wikisql |
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID varchar(10),
DEPARTMENT_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
... | For those employees who was hired before 2002-06-21, return a bar chart about the distribution of hire_date and the average of salary bin hire_date by weekday, and could you list y axis from high to low order? | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(SALARY) DESC | nvbench |
CREATE TABLE table_45355 (
"Rank" text,
"Badge/Serial Number" text,
"Tenure" text,
"Date of death" text,
"Cause of death" text
) | What is the Rank of the Officer with Badge/Serial Number 11755 who died in Gunfire? | SELECT "Rank" FROM table_45355 WHERE "Cause of death" = 'gunfire' AND "Badge/Serial Number" = '11755' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 65516243这位患者的223859指标在一四年十一月十二日至一六年九月四日期间的情况 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.RYBH = '... | css |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime 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,
... | what is the diagnosis cost of poisoning-barbiturates? | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'diagnoses_icd' AND cost.event_id IN (SELECT diagnoses_icd.row_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'poisoning-barbiturates')) | mimic_iii |
CREATE TABLE table_35262 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Total of 3, and a Gold larger than 0, and a Nation of belarus, and a Silver larger than 2 has what sum of bronze? | SELECT SUM("Bronze") FROM table_35262 WHERE "Total" = '3' AND "Gold" > '0' AND "Nation" = 'belarus' AND "Silver" > '2' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | how many patients whose age is less than 48 and drug route is sl? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "48" AND prescriptions.route = "SL" | mimicsql_data |
CREATE TABLE table_name_25 (
overall INTEGER,
pick__number VARCHAR
) | How much Overall has a Pick # of 26? | SELECT SUM(overall) FROM table_name_25 WHERE pick__number = 26 | sql_create_context |
CREATE TABLE table_name_63 (
usn_2013 INTEGER,
cnn_2011 VARCHAR,
bw_2013 VARCHAR,
forbes_2011 VARCHAR
) | What is the USN 2013 ranking with a BW 2013 ranking less than 1000, a Forbes 2011 ranking larger than 17, and a CNN 2011 ranking less than 13? | SELECT SUM(usn_2013) FROM table_name_63 WHERE bw_2013 < 1000 AND forbes_2011 > 17 AND cnn_2011 < 13 | sql_create_context |
CREATE TABLE table_26479 (
"Episode #" real,
"Prod #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Originalairdate" text,
"Filmed" text
) | How many episodes have the title 'a perfect crime'? | SELECT COUNT("Episode #") FROM table_26479 WHERE "Title" = 'A Perfect Crime' | wikisql |
CREATE TABLE table_45476 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent in the final" text,
"Score in the final" text
) | What is the Date of the match with Opponent in the final Kenneth Carlsen? | SELECT "Date" FROM table_45476 WHERE "Opponent in the final" = 'kenneth carlsen' | wikisql |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,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 departments (
DEPARTMENT_ID decimal... | For those employees who do not work in departments with managers that have ids between 100 and 200, visualize a bar chart about the distribution of job_id and manager_id , and could you display by the bars in descending? | SELECT JOB_ID, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY JOB_ID DESC | nvbench |
CREATE TABLE table_48594 (
"Election" real,
"Leader" text,
"# of seats won" real,
"# of National votes" real,
"% of National vote" text,
"# of Prefectural votes" real,
"% of Prefectural vote" text
) | What is the average Election, when % Of Nation Vote is 45.23%, and when # Of Prefectural Votes is less than 14,961,199? | SELECT AVG("Election") FROM table_48594 WHERE "% of National vote" = '45.23%' AND "# of Prefectural votes" < '14,961,199' | wikisql |
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, visualize a bar chart about the distribution of founder and the sum of code , and group by attribute founder, and I want to sort in desc by the bar. | SELECT T2.Founder, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Founder ORDER BY T2.Founder DESC | nvbench |
CREATE TABLE table_name_74 (
tournament VARCHAR
) | WHAT IS THE 2011 PERFORMANCE AT THE MIAMI MASTERS? | SELECT 2011 FROM table_name_74 WHERE tournament = "miami masters" | sql_create_context |
CREATE TABLE table_name_19 (
scoring_rank VARCHAR,
year VARCHAR,
events_played VARCHAR,
rank VARCHAR
) | What is the Scoring rank when there are less than 21 events played with a rank of n/a in years less than 2011? | SELECT scoring_rank FROM table_name_19 WHERE events_played < 21 AND rank = "n/a" AND year < 2011 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE cost (
costid number,
... | what is the five most commonly given procedure for patients of 30s in 2103? | SELECT t1.treatmentname FROM (SELECT treatment.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 30 AND 39) AND STRFTIME('%y', treatment.treatmenttime) = '2103' GROUP BY treatment.t... | eicu |
CREATE TABLE table_name_53 (
attendance INTEGER,
record VARCHAR
) | Name the least attendance for 52-37 record | SELECT MIN(attendance) FROM table_name_53 WHERE record = "52-37" | sql_create_context |
CREATE TABLE table_16094 (
"School Year" text,
"Class A" text,
"Class AA" text,
"Class AAA" text,
"Class AAAA" text,
"Class AAAAA" text
) | Who was Class AAA during the same year that Class AAAAA was Brownsville Pace? | SELECT "Class AAA" FROM table_16094 WHERE "Class AAAAA" = 'Brownsville Pace' | wikisql |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | count the number of patients whose days of hospital stay is greater than 17 and drug name is potassium phosphate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "17" AND prescriptions.drug = "Potassium Phosphate" | mimicsql_data |
CREATE TABLE table_27833186_1 (
rider_names VARCHAR,
location VARCHAR,
horse_name VARCHAR
) | Who were the winning riders of the championship in Euer Valley, CA and whose horse was Magic Sirocco? | SELECT rider_names FROM table_27833186_1 WHERE location = "Euer Valley, CA" AND horse_name = "Magic Sirocco" | sql_create_context |
CREATE TABLE table_14959246_2 (
attendance VARCHAR,
date VARCHAR
) | What was the attendance at the game played on December 10, 1972? | SELECT attendance FROM table_14959246_2 WHERE date = "December 10, 1972" | sql_create_context |
CREATE TABLE table_15187735_19 (
segment_c VARCHAR,
segment_b VARCHAR
) | What is the segment C of the episode where segment B is Film Digitization? | SELECT segment_c FROM table_15187735_19 WHERE segment_b = "Film Digitization" | sql_create_context |
CREATE TABLE table_66275 (
"Date Released" text,
"Polling institute" text,
"Social Democratic" text,
"Socialist" text,
"Green-Communist" text,
"People's Party" text,
"Left Bloc" text,
"Lead" text
) | What is the result for the Green-Communist party when the Left Bloc has 3.6%? | SELECT "Green-Communist" FROM table_66275 WHERE "Left Bloc" = '3.6%' | wikisql |
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefin... | Top reputation users with no answer score. | SELECT u.Id AS "user_link", u.Reputation AS Reputation FROM Posts AS p INNER JOIN Users AS u ON p.OwnerUserId = u.Id GROUP BY u.Id, u.Reputation HAVING SUM(p.Score * (1 - ABS(SIGN(p.PostTypeId - 2)))) < 100000 ORDER BY Reputation DESC LIMIT 100 | sede |
CREATE TABLE table_23286112_12 (
high_rebounds VARCHAR,
game VARCHAR
) | Who had the highest rebounds in game 2? | SELECT high_rebounds FROM table_23286112_12 WHERE game = 2 | sql_create_context |
CREATE TABLE table_name_44 (
grid INTEGER,
time_retired VARCHAR
) | What is the average grid for the +2.2 secs time/retired? | SELECT AVG(grid) FROM table_name_44 WHERE time_retired = "+2.2 secs" | sql_create_context |
CREATE TABLE table_70328 (
"Tournament" text,
"2008" text,
"2010" text,
"2011" text,
"2012" text,
"2013" text
) | Name the 2011 with 2010 of 2r | SELECT "2011" FROM table_70328 WHERE "2010" = '2r' | 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... | 在5033672这家医院全部的医疗记录中,按照不一样的科室与出院诊断的病名算一下病人年龄的平均数 | SELECT MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '5033672' GROUP BY MED_ORG_DEPT_NM, OUT_DIAG_DIS_NM | css |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
val... | when was the first time patient 86555 was prescribed medication via po route? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 86555) AND prescriptions.route = 'po' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
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 microlab (
microl... | tell me patient 017-20711's total chest tube output: mediastinal r anterior output on last month/16. | SELECT SUM(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-20711')) AND intakeoutput.celllabel = 'chest... | eicu |
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... | Is the only person teaching Biochem Res-Med Stu Prof. Corrigan ? | SELECT DISTINCT course.department, course.name, course.number, instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.name LIKE '%Biochem Res-Med Stu%' AND NOT instructor.name LIKE '%Corrigan%' AND offering_instructor.instructor_id = i... | advising |
CREATE TABLE table_71744 (
"Position" text,
"Name" text,
"Party" text,
"First elected" real,
"District" text
) | Name the total number of first elected for dranesville | SELECT COUNT("First elected") FROM table_71744 WHERE "District" = 'dranesville' | wikisql |
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE PostHistory (
Id num... | List posts of deleted user. | SELECT Id AS "post_link", OwnerDisplayName FROM Posts WHERE OwnerDisplayName = 'user121799' | sede |
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
) | For those records from the products and each product's manufacturer, draw a bar chart about the distribution of name and the average of code , and group by attribute name, and display from high to low by the y-axis please. | SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Code DESC | nvbench |
CREATE TABLE table_name_18 (
attendance INTEGER,
league_position VARCHAR,
opponents VARCHAR
) | When in the 1st league position, how many people watch as they faced West Ham United? | SELECT MIN(attendance) FROM table_name_18 WHERE league_position = "1st" AND opponents = "west ham united" | sql_create_context |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean... | Sum - Number of Answer - Android. | SELECT COUNT(P.ViewCount) FROM Posts AS P WHERE NOT P.Tags LIKE '%android%' | sede |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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,
lan... | count the number of times that patient 26817 had had .45ns flush intake in 09/this year. | SELECT COUNT(*) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26817)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = '.45ns flush'... | mimic_iii |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
war... | when was the last time patient 74159 had surgery on the last hospital encounter? | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 74159 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY procedures_icd.charttime DESC LIMIT 1 | mimic_iii |
CREATE TABLE people (
People_ID int,
Sex text,
Name text,
Date_of_Birth text,
Height real,
Weight real
)
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 re... | Draw a bar chart about the distribution of Sex and the average of Height , and group by attribute Sex, and display in ascending by the Y. | SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY AVG(Height) | nvbench |
CREATE TABLE table_12562214_1 (
date__from_ VARCHAR,
date__to_ VARCHAR
) | what is the date (from) where date (to) is 1919? | SELECT date__from_ FROM table_12562214_1 WHERE date__to_ = "1919" | sql_create_context |
CREATE TABLE table_name_82 (
green_communist VARCHAR,
lead VARCHAR
) | What is the green-communist with a 15.5% lead? | SELECT green_communist FROM table_name_82 WHERE lead = "15.5%" | sql_create_context |
CREATE TABLE table_name_82 (
college_junior_club_team__league_ VARCHAR,
round INTEGER
) | WHAT IS THE LEAGUE WITH A ROUND LARGER THAN 6? | SELECT college_junior_club_team__league_ FROM table_name_82 WHERE round > 6 | sql_create_context |
CREATE TABLE table_44690 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the Rank of the Nation with more than 1 Gold and a more than 4 Total medals? | SELECT SUM("Rank") FROM table_44690 WHERE "Gold" > '1' AND "Total" > '4' | wikisql |
CREATE TABLE table_name_19 (
attendance INTEGER,
result VARCHAR,
year VARCHAR
) | What was the total attendance for a result of 7-23 before 1960? | SELECT SUM(attendance) FROM table_name_19 WHERE result = "7-23" AND year < 1960 | sql_create_context |
CREATE TABLE table_name_8 (
constructor VARCHAR,
circuit VARCHAR
) | What is the constructor where the circuit is Silverstone? | SELECT constructor FROM table_name_8 WHERE circuit = "silverstone" | sql_create_context |
CREATE TABLE table_57856 (
"Country" text,
"Population" text,
"Area (km\u00b2)" text,
"GDP (nominal)" text,
"GDP per capita (nominal)" text
) | Which population has a GDP (nominal) of $6.4 billion? | SELECT "Population" FROM table_57856 WHERE "GDP (nominal)" = '$6.4 billion' | wikisql |
CREATE TABLE table_5970 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | When did the Indians play a game with a record of 28-41? | SELECT "Date" FROM table_5970 WHERE "Record" = '28-41' | wikisql |
CREATE TABLE table_36732 (
"Year" text,
"Champion" text,
"Runner-up" text,
"Score" text,
"Surface" text
) | What is the surface of the match with Brian Gottfried as the runner-up? | SELECT "Surface" FROM table_36732 WHERE "Runner-up" = 'brian gottfried' | wikisql |
CREATE TABLE bdmzjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH number,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZD... | 名为任凌霜的病人有哪些检验报告单的检验结果指标均正常?列出这些检验报告的单号 | SELECT jybgb.BGDH 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 NOT ... | css |
CREATE TABLE tags (
index number,
id number,
tag text
)
CREATE TABLE torrents (
groupname text,
totalsnatched number,
artist text,
groupyear number,
releasetype text,
groupid number,
id number
) | What are the downloaded numbers and their release types? | SELECT SUM(totalsnatched), releasetype FROM torrents GROUP BY releasetype | whatcdhiphop |
CREATE TABLE table_41717 (
"Date" text,
"Opponent" text,
"Result" text,
"Score" text,
"Record" text,
"attendance" real
) | What is the Record with an attendance of more than 54,761, and a Result of loss? | SELECT "Record" FROM table_41717 WHERE "attendance" > '54,761' AND "Result" = 'loss' | wikisql |
CREATE TABLE table_40577 (
"Team" text,
"City" text,
"Inaugural season" text,
"Final season" text,
"Captain" text,
"Coach" text
) | Which City has the Bahawalpur Stags Team? | SELECT "City" FROM table_40577 WHERE "Team" = 'bahawalpur stags' | wikisql |
CREATE TABLE table_46044 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
) | Which Nationality has a Pick larger than 109, and a Round smaller than 5? | SELECT "Nationality" FROM table_46044 WHERE "Pick" > '109' AND "Round" < '5' | wikisql |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
Deletio... | Highest number of comments on a post. | SELECT 'site:///a/' + CAST(p.Id AS TEXT) + '/4918|' + CAST(p.Id AS TEXT) AS pLink, COUNT(*) AS cCount FROM Comments AS c LEFT JOIN Posts AS p ON c.PostId = p.Id GROUP BY p.Id HAVING '##limit?30##' <= COUNT(*) ORDER BY 2 DESC | sede |
CREATE TABLE table_name_97 (
method VARCHAR,
round VARCHAR,
opponent VARCHAR
) | what is the method for round 1 and the opponent is bobby mcmaster? | SELECT method FROM table_name_97 WHERE round = 1 AND opponent = "bobby mcmaster" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_dista... | show me a list of flights from DENVER to BALTIMORE on UA for 8 3 | 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, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 3 AND date_day.month_number = 8 AND... | atis |
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... | give me the number of patients whose diagnoses short title is backache nos and drug type is main? | 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.short_title = "Backache NOS" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_203_113 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
) | which of these countries was ranked next after yugoslavia ? | SELECT "nation" FROM table_203_113 WHERE "rank" = (SELECT "rank" FROM table_203_113 WHERE "nation" = 'yugoslavia') + 1 | squall |
CREATE TABLE table_17103566_1 (
team_2 VARCHAR,
result VARCHAR
) | What is team 2 where the result is ICL world by 8 wickets? | SELECT team_2 FROM table_17103566_1 WHERE result = "ICL World by 8 wickets" | sql_create_context |
CREATE TABLE table_28591 (
"Engine Family" text,
"Cylinder Layout" text,
"Displacement(s)" text,
"Injection type" text,
"Years produced" text
) | The engine family MaxxForce 5 in the years produced 2007-current, have what cylinder layout? | SELECT "Cylinder Layout" FROM table_28591 WHERE "Years produced" = '2007-current' AND "Engine Family" = 'MaxxForce 5' | wikisql |
CREATE TABLE table_26423157_2 (
seed VARCHAR,
school VARCHAR
) | What seed was California? | SELECT seed FROM table_26423157_2 WHERE school = "California" | sql_create_context |
CREATE TABLE table_38394 (
"Name" text,
"Years of Operation" text,
"Location" text,
"Historical Photos" text,
"Year Clubhouse Constructed" text,
"Sign-in/Bicker" text,
"Year co-ed" text
) | What is the location of the ivy club? | SELECT "Location" FROM table_38394 WHERE "Name" = 'the ivy club' | wikisql |
CREATE TABLE Customer_Orders (
Order_ID INTEGER,
Customer_ID INTEGER,
Store_ID INTEGER,
Order_Date DATETIME,
Planned_Delivery_Date DATETIME,
Actual_Delivery_Date DATETIME,
Other_Order_Details VARCHAR(255)
)
CREATE TABLE Ref_Service_Types (
Service_Type_Code CHAR(15),
Parent_Service_... | Show me a bar chart for what are the different product names? What is the average product price for each of them?, order by the X-axis from low to high. | SELECT Product_Name, AVG(Product_Price) FROM Products GROUP BY Product_Name ORDER BY Product_Name | nvbench |
CREATE TABLE table_name_64 (
fcc_info VARCHAR,
frequency_mhz VARCHAR
) | I need the FCC info on the radio Frequency MHz 107.5? | SELECT fcc_info FROM table_name_64 WHERE frequency_mhz = 107.5 | sql_create_context |
CREATE TABLE table_26218783_7 (
status VARCHAR,
sd VARCHAR
) | What is the status when sd is 15? | SELECT status FROM table_26218783_7 WHERE sd = 15 | sql_create_context |
CREATE TABLE table_32080 (
"Model" text,
"Release date" text,
"Sensor res., size" text,
"Lens(35mmequiv.) zoom, aperture" text,
"Screen size,pixels" text,
"Dimensions W\u00d7H\u00d7D (mm)" text,
"Weight" text
) | What is the screen size and pixel amount of model p5000 when the dimensions are 98 64.5 41? | SELECT "Screen size,pixels" FROM table_32080 WHERE "Dimensions W\u00d7H\u00d7D (mm)" = '98×64.5×41' AND "Model" = 'p5000' | wikisql |
CREATE TABLE table_37952 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Attendance" real
) | What week had a lower attendance than 51,423 but was still higher than the other weeks? | SELECT MAX("Week") FROM table_37952 WHERE "Attendance" < '51,423' | wikisql |
CREATE TABLE zyjzjlb_jybgb (
YLJGDM_ZYJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
X... | 在2013年5月6日到2020年3月14日这段日子编号09797743的病人开出的所有检验报告单的科室编码以及名称分别是什么? | SELECT jybgb.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '09797743' AND jybgb.BGRQ BETWEEN '2013-05-06' AND '2020-... | css |
CREATE TABLE table_35055 (
"Round" real,
"Player" text,
"Position" text,
"Nationality" text,
"College/Junior/Club Team" text
) | Which round was Brian Elder taken in? | SELECT MIN("Round") FROM table_35055 WHERE "Player" = 'brian elder' | wikisql |
CREATE TABLE table_2756 (
"Pos" text,
"##" real,
"Name" text,
"Team" text,
"Lap One" text,
"Lap Two" text,
"Lap Three" text,
"Lap Four" text,
"Total Time" text,
"Avg. Speed" text
) | How many lap two's did marco andretti do? | SELECT COUNT("Lap Two") FROM table_2756 WHERE "Name" = 'Marco Andretti' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM t... | 经过住院的患者81313263168其出院状态代码是多少呢? | SELECT CYZTDM FROM zyjzjlb WHERE JZLSH = '81313263168' | css |
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 countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0... | 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, visualize a line chart about the change of employee_id over hire_date . | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE table_name_63 (
circuit VARCHAR,
winning_constructor VARCHAR,
name VARCHAR
) | Name the circuit for darracq and name of cuban race | SELECT circuit FROM table_name_63 WHERE winning_constructor = "darracq" AND name = "cuban race" | sql_create_context |
CREATE TABLE table_name_94 (
money___ INTEGER,
country VARCHAR,
player VARCHAR
) | What was the average money for United States when Lanny Wadkins played? | SELECT AVG(money___) AS $__ FROM table_name_94 WHERE country = "united states" AND player = "lanny wadkins" | sql_create_context |
CREATE TABLE table_27275 (
"Pick #" real,
"CFL Team" text,
"Player" text,
"Position" text,
"College" text
) | Name the cfl team for steven turner | SELECT "CFL Team" FROM table_27275 WHERE "Player" = 'Steven Turner' | wikisql |
CREATE TABLE table_50856 (
"Internet Plan" text,
"Downstream" text,
"Upstream" text,
"Bandwidth Included" text,
"Price" text
) | What is Downstream, when Upstream is '384 kbit'? | SELECT "Downstream" FROM table_50856 WHERE "Upstream" = '384 kbit' | wikisql |
CREATE TABLE table_24775 (
"Dates (MDY)" text,
"Gross Sales" text,
"Tickets Sold / Available" text,
"Shows / Sellout" text,
"Sellout (%)" text
) | Between November 25 30, 2008 the sellout rate was at 75%, indicating that the ration between shows to sellout was what? | SELECT "Shows / Sellout" FROM table_24775 WHERE "Sellout (%)" = '75%' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 把患者水康成在3230609医院门诊看诊时,诊断内容书上无张力的就诊记录找出来 | SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN person_info_hz_info ON person_info.RYBH = person_info_hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND person_info_hz_info.KH = hz_info.KH AND person_info_hz_info.KLX = hz_info.KLX AND person_info_hz_i... | css |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
had... | what was the name of the lab test that patient 59728 had received last until 02/2104? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 59728) AND STRFTIME('%y-%m', labevents.charttime) <= '2104-02' ORDER BY labevents.charttime DESC LIMIT 1) | mimic_iii |
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
) | For those products with a price between 60 and 120, what is the relationship between price and manufacturer , and group by attribute name? | SELECT Price, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 GROUP BY Name | nvbench |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE Tags (
Id number,
TagName text,
Count ... | How many answers are there for a tag?. | SELECT COUNT(p1.Id) FROM Posts AS p1 INNER JOIN PostTags AS pt ON pt.TagId = @TagId INNER JOIN Posts AS p2 ON p1.ParentId = p2.Id WHERE p1.PostTypeId = 2 AND pt.PostId = p2.Id | sede |
CREATE TABLE table_name_3 (
length VARCHAR,
year VARCHAR
) | What is the length of the version from 2003? | SELECT length FROM table_name_3 WHERE year = 2003 | sql_create_context |
CREATE TABLE table_26824484_1 (
title VARCHAR,
directed_by VARCHAR,
written_by VARCHAR
) | Which episode was directed by Jeff Woolnough and written by Christopher Ambrose? | SELECT title FROM table_26824484_1 WHERE directed_by = "Jeff Woolnough" AND written_by = "Christopher Ambrose" | sql_create_context |
CREATE TABLE table_23345 (
"Rank" real,
"City" text,
"1890 census" text,
"1910 census" real,
"1920 census" real,
"1930 census" real,
"1940 census" real
) | For cities with a census of 74000 in 1920, what was their census in 1890? | SELECT "1890 census" FROM table_23345 WHERE "1920 census" = '74000' | wikisql |
CREATE TABLE aircraft (
aid number(9,0),
name varchar2(30),
distance number(6,0)
)
CREATE TABLE certificate (
eid number(9,0),
aid number(9,0)
)
CREATE TABLE flight (
flno number(4,0),
origin varchar2(20),
destination varchar2(20),
distance number(6,0),
departure_date date,
... | Can you give a histogram to compare the number of flights to each destination city?, show in asc by the x-axis. | SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination | nvbench |
CREATE TABLE table_train_197 (
"id" int,
"dyscrasia" bool,
"gender" string,
"bleeding" int,
"hemoglobin_a1c_hba1c" float,
"diabetic" string,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" float
) | known bleeding diathesis or dyscrasia | SELECT * FROM table_train_197 WHERE bleeding = 1 OR dyscrasia = 1 | criteria2sql |
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... | 自二零一六年四月二十五日开始,截止到二零二零年十月九日,患者54888449通过医疗机构7077401做了多少次检查 | SELECT COUNT(*) FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '54888449' AND t_kc22.STA_DATE BETWEEN '2016-04-25' AND '2020-10-09' AND qtb.MED_SER_ORG_NO = '7077401' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_name_21 (
team VARCHAR,
year INTEGER
) | Are there any Teams after 1997? | SELECT team FROM table_name_21 WHERE year > 1997 | sql_create_context |
CREATE TABLE table_name_96 (
set_1 VARCHAR,
score VARCHAR
) | What is the Set 1 with a Score with 3 2? | SELECT set_1 FROM table_name_96 WHERE score = "3–2" | sql_create_context |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total... | Before taking SWC 200 , what are some other courses that might be useful to take ? | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'SWC' AND number = 200 | advising |
CREATE TABLE table_72256 (
"Series #" real,
"Season #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
) | What is the season where the episode 'when worlds collide' was shown? | SELECT MAX("Season #") FROM table_72256 WHERE "Title" = 'When Worlds Collide' | wikisql |
CREATE TABLE table_10967 (
"Race" text,
"Circuit" text,
"Date" text,
"Pole position" text,
"Fastest lap" text,
"Winning driver" text,
"Constructor" text,
"Tyre" text,
"Report" text
) | Tell me the pole position for graham hill the fastest lap and winning driver of him on 30 may | SELECT "Pole position" FROM table_10967 WHERE "Fastest lap" = 'graham hill' AND "Winning driver" = 'graham hill' AND "Date" = '30 may' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | how many patients whose diagnoses short title is chr syst/diastl hrt fail? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Chr syst/diastl hrt fail" | mimicsql_data |
CREATE TABLE table_16409745_1 (
dimensions__mm_ VARCHAR,
product VARCHAR
) | What are the mm dimensions of the Plustek Mobileoffice D28 Corporate? | SELECT dimensions__mm_ FROM table_16409745_1 WHERE product = "Plustek MobileOffice D28 Corporate" | sql_create_context |
CREATE TABLE table_61514 (
"Region" text,
"Date" text,
"Label" text,
"Format(s)" text,
"Catalog" text
) | What is the dage of catalog asw 28033? | SELECT "Date" FROM table_61514 WHERE "Catalog" = 'asw 28033' | wikisql |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
) | How many females are in the network? | SELECT COUNT(*) FROM person WHERE gender = 'female' | spider |
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
)
... | find out the number of patients who have liver transplant primary disease and were admitted for more than 8 days in hospital. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND demographic.days_stay > "8" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.