context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_17811 (
"#" real,
"Name" text,
"Tenure" text,
"Courtesy title" text,
"Court Rank" text,
"Revenues" text,
"Lineage" text
) | What is the number of the name for number 4? | SELECT COUNT("Name") FROM table_17811 WHERE "#" = '4' | 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... | 医疗就诊28989122618给病号93310389开的每种药品具体的名称及其每次的用量和频次都分别是什么? | SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '28989122618' | css |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
... | Upvotes by tag in 2015. how long before I get tag badges? | SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.CreationDate > '01/01/2015' GROUP BY TagName ORDER BY UpVotes DESC | sede |
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar,
review_count bigint,
is_open tinyint,
rating float,
state varchar
)
CREATE TABLE review (
rid int,
business_id varchar,
us... | Which Thai restaurant has the most number of reviews | SELECT business.name FROM business, category AS CATEGORY_0, category AS CATEGORY_1 WHERE CATEGORY_0.business_id = business.business_id AND CATEGORY_0.category_name = 'restaurant' AND CATEGORY_1.business_id = business.business_id AND CATEGORY_1.category_name = 'Thai' ORDER BY business.review_count DESC LIMIT 1 | yelp |
CREATE TABLE table_67659 (
"Date" text,
"Round" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real,
"Scorers" text
) | Which Scorers have a Venue of A, and an Opponent of arsenal? | SELECT "Scorers" FROM table_67659 WHERE "Venue" = 'a' AND "Opponent" = 'arsenal' | wikisql |
CREATE TABLE table_39619 (
"School" text,
"Mascot" text,
"Location" text,
"Enrollment" real,
"IHSAA Class" text,
"IHSAA Football Class" text,
"# / County" text
) | How many are enrolled at 49 Marion with the Warriors as their mascot? | SELECT COUNT("Enrollment") FROM table_39619 WHERE "# / County" = '49 marion' AND "Mascot" = 'warriors' | wikisql |
CREATE TABLE table_17410 (
"Jurisdiction" text,
"For Prohibition" real,
"Percent For" text,
"Against Prohibition" real,
"Percent Against" text
) | Name the max for prohibition. | SELECT MAX("For Prohibition") FROM table_17410 | wikisql |
CREATE TABLE table_77583 (
"Entrant" text,
"Constructor" text,
"Chassis" text,
"Engine \u2020" text,
"Tyre" text,
"Driver" text,
"Rounds" text
) | what is the chassis when the tyre is b, the engine is ferrari 050 ferrari 051 and the driver is rubens barrichello? | SELECT "Chassis" FROM table_77583 WHERE "Tyre" = 'b' AND "Engine \u2020" = 'ferrari 050 ferrari 051' AND "Driver" = 'rubens barrichello' | wikisql |
CREATE TABLE table_name_40 (
total VARCHAR,
player VARCHAR
) | What was Mark O'Meara's total? | SELECT total FROM table_name_40 WHERE player = "mark o'meara" | sql_create_context |
CREATE TABLE table_33399 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home teams score at Arden Street Oval? | SELECT "Home team score" FROM table_33399 WHERE "Venue" = 'arden street oval' | 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,
... | give me the number of patients whose admission year is less than 2197 and item id is 50925? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2197" AND lab.itemid = "50925" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | what is diagnoses long title and procedure long title of subject id 83678? | SELECT diagnoses.long_title, procedures.long_title FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "83678" | mimicsql_data |
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE inputevents_cv (
row_id nu... | when was patient 10266 prescribed a medication via pr route the first time during their first hospital visit? | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10266 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.route = 'pr' ORDER BY prescriptions.startdate LIMIT 1 | mimic_iii |
CREATE TABLE people (
people_id number,
name text,
height number,
weight number,
home town text
)
CREATE TABLE perpetrator (
perpetrator_id number,
people_id number,
date text,
year number,
location text,
country text,
killed number,
injured number
) | What are the names of perpetrators in country 'China' or 'Japan'? | SELECT T1.name FROM people AS T1 JOIN perpetrator AS T2 ON T1.people_id = T2.people_id WHERE T2.country = "China" OR T2.country = "Japan" | spider |
CREATE TABLE table_58897 (
"Class" text,
"Number(s)" text,
"Quantity" real,
"Year(s) of Manufacture" text,
"Type" text
) | Which class has fewer than 10 and number(s) names? | SELECT "Class" FROM table_58897 WHERE "Quantity" < '10' AND "Number(s)" = 'names' | wikisql |
CREATE TABLE table_name_36 (
date VARCHAR,
loss VARCHAR
) | What was the date of the game in which Holt (4-4) took the loss? | SELECT date FROM table_name_36 WHERE loss = "holt (4-4)" | sql_create_context |
CREATE TABLE table_name_87 (
period_active VARCHAR,
genre VARCHAR
) | What was the active period for the pop genre? | SELECT period_active FROM table_name_87 WHERE genre = "pop" | 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... | 患者秦承平的门诊诊断之前是什么样的? | SELECT mzjzjlb.JZZDBM, mzjzjlb.JZZDSM FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.person_info_XM = '秦承平' | css |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | 有哪些医院给病人31149555开了阿立哌唑片 | SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '31149555' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '阿立哌唑片') | css |
CREATE TABLE table_name_78 (
year VARCHAR,
baden VARCHAR
) | What's the year that has a Baden Freiburger FC? | SELECT COUNT(year) FROM table_name_78 WHERE baden = "freiburger fc" | sql_create_context |
CREATE TABLE table_6288 (
"Round" text,
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text
) | What was the date of the game against Hayes & Yeading United? | SELECT "Date" FROM table_6288 WHERE "Opponent" = 'hayes & yeading united' | wikisql |
CREATE TABLE table_11456251_5 (
number_of_generators VARCHAR,
power_capacity__gw_ VARCHAR
) | What is the number of generators where the power capicity is 78.7? | SELECT COUNT(number_of_generators) FROM table_11456251_5 WHERE power_capacity__gw_ = "78.7" | sql_create_context |
CREATE TABLE table_1875157_1 (
winnings VARCHAR,
position VARCHAR
) | How many wins in the season he finished 33rd | SELECT winnings FROM table_1875157_1 WHERE position = "33rd" | sql_create_context |
CREATE TABLE table_name_63 (
total INTEGER,
difficulty_score VARCHAR,
rank VARCHAR,
routine_score VARCHAR
) | What is the total with lower than rank 8, and higher than 27.6 score and 13.8 difficulty? | SELECT MIN(total) FROM table_name_63 WHERE rank > 8 AND routine_score > 27.6 AND difficulty_score = "13.8" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | what is procedure icd9 code and procedure short title of subject name alice nixon? | SELECT procedures.icd9_code, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.name = "Alice Nixon" | mimicsql_data |
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... | 查一下门诊就诊84028994033中病患的详细信息,包括身高、体重、体温、收缩压、舒张压、心率、呼吸频率、脉率 | SELECT wdmzjzjlb.SG, wdmzjzjlb.TZ, wdmzjzjlb.TW, wdmzjzjlb.SSY, wdmzjzjlb.SZY, wdmzjzjlb.XL, wdmzjzjlb.HXPLC, wdmzjzjlb.ML FROM wdmzjzjlb WHERE wdmzjzjlb.JZLSH = '84028994033' UNION SELECT bdmzjzjlb.SG, bdmzjzjlb.TZ, bdmzjzjlb.TW, bdmzjzjlb.SSY, bdmzjzjlb.SZY, bdmzjzjlb.XL, bdmzjzjlb.HXPLC, bdmzjzjlb.ML FROM bdmzjzjlb ... | css |
CREATE TABLE table_36438 (
"Date" text,
"City" text,
"Opponent" text,
"Results\u00b9" text,
"Type of game" text
) | What Opponent has a Results of 1:3? | SELECT "Opponent" FROM table_36438 WHERE "Results\u00b9" = '1:3' | wikisql |
CREATE TABLE table_name_71 (
score VARCHAR,
date VARCHAR,
away_team VARCHAR
) | What is the Score on 27 Jan 1990 with an Away Team of Queens Park Rangers? | SELECT score FROM table_name_71 WHERE date = "27 jan 1990" AND away_team = "queens park rangers" | sql_create_context |
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... | 从03年5月9日到08年7月26日,医院5071294一共有多少住院医疗记录 | SELECT COUNT(*) FROM zyb WHERE zyb.MED_TYPE = '5071294' AND zyb.IN_HOSP_DAYS BETWEEN '2003-05-09' AND '2008-07-26' | css |
CREATE TABLE table_203_515 (
id number,
"rank" number,
"city" text,
"passengers" number,
"ranking" number,
"airline" text
) | what was the number of passengers in phoenix arizona ? | SELECT "passengers" FROM table_203_515 WHERE "city" = 'phoenix' | squall |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 varch... | 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, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by weekday. | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | what were the four most frequent drugs prescribed to stroke male patients with age 60 or above during the same month after being diagnosed with stroke the last year? | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'stroke' AND DATETIME(diagnosis.diagnosistime, 'sta... | eicu |
CREATE TABLE table_name_67 (
sunk_by VARCHAR,
flag VARCHAR
) | Who sunk the ship with the flag of Norway? | SELECT sunk_by FROM table_name_67 WHERE flag = "norway" | sql_create_context |
CREATE TABLE table_52696 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"Team" text,
"College" text
) | What is the top round for the baltimore bullets with a Pick larger than 6? | SELECT MAX("Round") FROM table_52696 WHERE "Team" = 'baltimore bullets' AND "Pick" > '6' | wikisql |
CREATE TABLE table_203_549 (
id number,
"player" text,
"team" text,
"date" text,
"opponent" text,
"venue" text
) | what was the name of the player who accomplished this in 1999 but played for the boston red sox ? | SELECT "player" FROM table_203_549 WHERE "date" = 1999 AND "team" = 'boston red sox' | squall |
CREATE TABLE table_63973 (
"Year" real,
"Category" text,
"Recipients and nominees" text,
"Role/Episode" text,
"Result" text
) | Which Category was from before 2009 with a Role/Episode of Libby Goldstein and Junie Lowry-Johnson? | SELECT "Category" FROM table_63973 WHERE "Year" < '2009' AND "Role/Episode" = 'libby goldstein and junie lowry-johnson' | wikisql |
CREATE TABLE table_name_91 (
conversions INTEGER,
team VARCHAR,
tries VARCHAR
) | What is the average number of conversions for the Cardiff Blues with less than 14 tries? | SELECT AVG(conversions) FROM table_name_91 WHERE team = "cardiff blues" AND tries < 14 | sql_create_context |
CREATE TABLE table_71372 (
"Name" text,
"Period" text,
"Matches" text,
"Wins" text,
"Draws" text,
"Losses" text
) | How many matches has Mohammad Al-Shamlan played when there is 1 win? | SELECT "Matches" FROM table_71372 WHERE "Wins" = '1' AND "Name" = 'mohammad al-shamlan' | wikisql |
CREATE TABLE table_63554 (
"Player" text,
"Country" text,
"Year(s) won" text,
"Total" real,
"To par" text,
"Finish" text
) | what is the to par for geoff ogilvy? | SELECT "To par" FROM table_63554 WHERE "Player" = 'geoff ogilvy' | wikisql |
CREATE TABLE table_203_685 (
id number,
"no. in\nseries" number,
"no. in\nseason" number,
"title" text,
"directed by" text,
"written by" text,
"original air date" text
) | what were the total number of titles aired in november ? | SELECT COUNT("title") FROM table_203_685 WHERE "original air date" = 11 | squall |
CREATE TABLE table_35771 (
"Year" real,
"Champion" text,
"Venue" text,
"Location" text,
"Score" text
) | When did Kim Thompson win with 278 score? | SELECT SUM("Year") FROM table_35771 WHERE "Score" = '278' AND "Champion" = 'kim thompson' | wikisql |
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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40)... | For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of last_name and salary in a bar chart, and list bar in ascending order please. | SELECT LAST_NAME, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY LAST_NAME | nvbench |
CREATE TABLE table_255812_1 (
income_class__2007_ VARCHAR,
mayor VARCHAR
) | What are all the profits elegance (2007) in which mayor is ma. Ester a. Hamor | SELECT income_class__2007_ FROM table_255812_1 WHERE mayor = "Ma. Ester A. Hamor" | sql_create_context |
CREATE TABLE table_57112 (
"College Name" text,
"Location" text,
"District" text,
"Affiliation" text,
"Estd" text
) | Where is the coimbatore affilation that was established in 1982? | SELECT "Affiliation" FROM table_57112 WHERE "Estd" = '1982' AND "Location" = 'coimbatore' | wikisql |
CREATE TABLE table_name_10 (
representative VARCHAR,
termination_of_mission VARCHAR
) | Which Representative has a Termination of Mission as May 24, 1905? | SELECT representative FROM table_name_10 WHERE termination_of_mission = "may 24, 1905" | sql_create_context |
CREATE TABLE table_24431264_16 (
seed INTEGER,
player VARCHAR
) | What was david ferrer seeded? | SELECT MAX(seed) FROM table_24431264_16 WHERE player = "David Ferrer" | sql_create_context |
CREATE TABLE table_59602 (
"Opposing Teams" text,
"Against" real,
"Date" text,
"Venue" text,
"Status" text
) | Who was the name of the opposing team on 11/02/1961? | SELECT "Opposing Teams" FROM table_59602 WHERE "Date" = '11/02/1961' | wikisql |
CREATE TABLE table_21405 (
"Province" text,
"South Asians 2001" real,
"% 2001" text,
"South Asians 2011" real,
"% 2011" text
) | What was the percentage in 2011 of the province that had 2.4% population in 2001? | SELECT "% 2011" FROM table_21405 WHERE "% 2001" = '2.4%' | wikisql |
CREATE TABLE table_32897 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
) | In what city is the United Spirit Arena located? | SELECT "City" FROM table_32897 WHERE "Venue" = 'united spirit arena' | wikisql |
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_graduation_semester int,
degree varchar,
minor varchar,
internship varch... | Which courses are least difficult ? | SELECT DISTINCT course.name, course.number, program_course.workload FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.department = 'EECS' AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_course AS PROGRAM_COURSEalias1) | advising |
CREATE TABLE table_name_5 (
architecture_and_modelling VARCHAR,
unit_test VARCHAR,
projects_templates VARCHAR
) | Which Architecture and modelling has a Unit test of no, and a Projects templates of limited? | SELECT architecture_and_modelling FROM table_name_5 WHERE unit_test = "no" AND projects_templates = "limited" | sql_create_context |
CREATE TABLE table_name_42 (
score VARCHAR,
date VARCHAR
) | The competition that took place on 4 Apr 1997 ended with what as the score? | SELECT score FROM table_name_42 WHERE date = "4 apr 1997" | 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... | Zero-score uncommented, not accepted answers by a specific user. | SELECT SUM(CASE WHEN a.Score = 0 AND COALESCE(q.AcceptedAnswerId, 0) != a.Id AND a.CommentCount = 0 THEN 1 ELSE 0 END) AS "unappreciated_answers", COUNT(a.Id) AS "total_answers", 100 * CAST(SUM(CASE WHEN a.Score = 0 AND a.CommentCount = 0 THEN 1 ELSE 0 END) AS FLOAT) / COUNT(a.Id) AS "percentage_unappreciated" FROM Pos... | sede |
CREATE TABLE table_204_104 (
id number,
"title" text,
"genre" text,
"sub\u00addivisions" text,
"libretto" text,
"premiere date" text,
"place, theatre" text,
"notes" text
) | which was released earlier , artamene or merope ? | SELECT "title" FROM table_204_104 WHERE "title" IN ('artamene', 'merope') ORDER BY "premiere date" LIMIT 1 | squall |
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,
... | what is primary disease and procedure short title of subject id 2560? | SELECT demographic.diagnosis, procedures.short_title FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_train_202 (
"id" int,
"systolic_blood_pressure_sbp" int,
"body_weight" float,
"diabetic" string,
"qtc" int,
"diastolic_blood_pressure_dbp" int,
"body_mass_index_bmi" float,
"clinical_diagnosis" bool,
"NOUSE" float
) | qtc < 450 msec at screening | SELECT * FROM table_train_202 WHERE qtc < 450 | criteria2sql |
CREATE TABLE table_60180 (
"Week" text,
"Theme" text,
"Song Sung" text,
"Artist" text,
"Status" text
) | Which Artist has a Week of Top 12? | SELECT "Artist" FROM table_60180 WHERE "Week" = 'top 12' | 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 medicaid patients had (aorto)coronary bypass of three coronary arteries procedure? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Medicaid" AND procedures.long_title = "(Aorto)coronary bypass of three coronary arteries" | mimicsql_data |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
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 varch... | For those employees whose first name does not containing the letter M, display their average salary by binning the hire date into Month interval for visualizing a bar chart, and order in asc by the y axis. | SELECT HIRE_DATE, AVG(SALARY) FROM employees WHERE NOT FIRST_NAME LIKE '%M%' ORDER BY AVG(SALARY) | nvbench |
CREATE TABLE table_name_49 (
score VARCHAR,
opposition VARCHAR,
year VARCHAR
) | What was the score when the opposition was sussex after 1890? | SELECT score FROM table_name_49 WHERE opposition = "sussex" AND year > 1890 | sql_create_context |
CREATE TABLE table_1024710_2 (
province VARCHAR,
electorate VARCHAR
) | Which province is grey and bell electorate in | SELECT province FROM table_1024710_2 WHERE electorate = "Grey and Bell" | sql_create_context |
CREATE TABLE table_name_98 (
year INTEGER,
result VARCHAR
) | Tell me the highest year for result of 9th | SELECT MAX(year) FROM table_name_98 WHERE result = "9th" | sql_create_context |
CREATE TABLE Payments (
Payment_ID INTEGER,
Settlement_ID INTEGER,
Payment_Method_Code VARCHAR(255),
Date_Payment_Made DATE,
Amount_Payment INTEGER
)
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed... | Bin the claim date into Year interval and count them for visualizing a bar chart, and could you order by the the number of date claim settled from high to low? | SELECT Date_Claim_Settled, COUNT(Date_Claim_Settled) FROM Settlements ORDER BY COUNT(Date_Claim_Settled) DESC | nvbench |
CREATE TABLE table_48526 (
"Round" real,
"Pick" real,
"Overall" real,
"Name" text,
"Position" text,
"College" text
) | How many rounds have a Pick smaller than 10, and a Name of larry hendershot? | SELECT COUNT("Round") FROM table_48526 WHERE "Pick" < '10' AND "Name" = 'larry hendershot' | wikisql |
CREATE TABLE table_name_97 (
away_team VARCHAR,
venue VARCHAR
) | Which team plays at the Arden Street Oval? | SELECT away_team FROM table_name_97 WHERE venue = "arden street oval" | sql_create_context |
CREATE TABLE table_14006_1 (
bleeding_time VARCHAR,
condition VARCHAR
) | what's the bleeding time with condition being factor v deficiency | SELECT bleeding_time FROM table_14006_1 WHERE condition = "Factor V deficiency" | sql_create_context |
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... | what is the number of patients whose year of death is less than or equal to 2179 and procedure short title is aicd check? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2179.0" AND procedures.short_title = "AICD check" | mimicsql_data |
CREATE TABLE table_name_70 (
attendance INTEGER,
save VARCHAR,
record VARCHAR
) | WHAT IS THE NUMBER OF Attendance WITH A RECORD 94 36 | SELECT AVG(attendance) FROM table_name_70 WHERE save = "–" AND record = "94–36" | sql_create_context |
CREATE TABLE table_78298 (
"Pick" real,
"Round" text,
"Player" text,
"Position" text,
"School" text
) | What is Thad Jemison's position? | SELECT "Position" FROM table_78298 WHERE "Player" = 'thad jemison' | wikisql |
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,
... | what are the three lab tests that are given most frequently this year? | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE DATETIME(labevents.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY labevents.itemid) AS t1... | mimic_iii |
CREATE TABLE table_name_37 (
points_diff INTEGER,
points VARCHAR,
against VARCHAR,
lost VARCHAR
) | I want the lowest points diff for against being less than 578 and lost being 15 and points more than 26 | SELECT MIN(points_diff) FROM table_name_37 WHERE against < 578 AND lost = 15 AND points > 26 | sql_create_context |
CREATE TABLE table_40681 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total number of bronze when gold is less than 1 and silver is more than 1? | SELECT SUM("Bronze") FROM table_40681 WHERE "Gold" < '1' AND "Silver" > '1' | 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, give me the comparison about employee_id over the phone_number by a bar chart, show in ascending by the EMPLOYEE_ID. | SELECT PHONE_NUMBER, EMPLOYEE_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMPLOYEE_ID | nvbench |
CREATE TABLE table_204_358 (
id number,
"species" text,
"common name" text,
"ncbi accession #" text,
"ncbi name" text,
"length" text,
"sequence identity" text,
"sequence similarity" text,
"years since divergence from human (mya)" number
) | how many years has it been since the cow has diverged from human ? | SELECT "years since divergence from human (mya)" FROM table_204_358 WHERE "common name" = 'cow' | squall |
CREATE TABLE table_50490 (
"Position" real,
"Equipment" text,
"Points" real,
"Wins" text,
"Second" text,
"Third" text
) | What is Second, when Position is greater than 33, when Points is greater than 12, and when Equipment is Zabel-VMC? | SELECT "Second" FROM table_50490 WHERE "Position" > '33' AND "Points" > '12' AND "Equipment" = 'zabel-vmc' | wikisql |
CREATE TABLE person_info_hz_info (
RYBH text,
KH number,
KLX number,
YLJGDM number
)
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,... | 编号01352770在2014年10月3日到2016年4月14日期间所在检验所有结果指标记录中的仪器编号以及名称都是啥? | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = ... | css |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | Users sorted by profile views. | SELECT Id AS "user_link", Views FROM Users ORDER BY Views DESC | sede |
CREATE TABLE table_name_44 (
matches INTEGER,
rank VARCHAR
) | What is the number of matches for the player in rank 8? | SELECT MAX(matches) FROM table_name_44 WHERE rank = 8 | sql_create_context |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugsto... | just how many magnesium sulfate 4 gram/100 ml iv piggy back : 100 ml flex cont prescriptions were there during a year before? | SELECT COUNT(*) FROM medication WHERE medication.drugname = 'magnesium sulfate 4 gram/100 ml iv piggy back : 100 ml flex cont' AND DATETIME(medication.drugstarttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | eicu |
CREATE TABLE table_11480 (
"Date" text,
"Tournament" text,
"Winning score" text,
"To par" text,
"Margin of victory" text
) | What is the margin of victory of the tournament with a winning score of 70-67-64-71=272? | SELECT "Margin of victory" FROM table_11480 WHERE "Winning score" = '70-67-64-71=272' | wikisql |
CREATE TABLE table_5679 (
"Gauge" text,
"Railway" text,
"Class" text,
"Works no." text,
"Year" text,
"Builder" text
) | Which year has a railway class of 250? | SELECT "Year" FROM table_5679 WHERE "Class" = '250' | wikisql |
CREATE TABLE table_name_86 (
drawn VARCHAR,
lost VARCHAR,
points VARCHAR
) | Name the drawn with lost of 3 and points of 88 | SELECT drawn FROM table_name_86 WHERE lost = "3" AND points = "88" | sql_create_context |
CREATE TABLE Engineer_Skills (
engineer_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Assets (
asset_id INTEGER,
maintenance_contract_id INTEGER,
supplier_company_id INTEGER,
asset_details VARCHAR(255),
asset_make VARCHAR(20),
asset_model VARCHAR(20),
asset_acquired_date DATETIME,
... | Bar graph to show how many asset make from different asset make | SELECT asset_make, COUNT(asset_make) FROM Assets GROUP BY asset_make | nvbench |
CREATE TABLE table_204_576 (
id number,
"year" number,
"best" text,
"location" text,
"date" text,
"world rank" text
) | did bekele have a better world ranking in 2012 or 2007 ? | SELECT "year" FROM table_204_576 WHERE "year" IN (2012, 2007) ORDER BY "world rank" LIMIT 1 | squall |
CREATE TABLE table_44834 (
"Date" text,
"Opponent" text,
"Site" text,
"Result" text,
"Attendance" text
) | What was the result when there were 27,321 in attendance? | SELECT "Result" FROM table_44834 WHERE "Attendance" = '27,321' | 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... | 患者60467779曾经都做过哪些治疗项目 | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '60467779' AND t_kc22.MED_INV_ITEM_TYPE = '治疗费' UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED... | css |
CREATE TABLE table_name_19 (
erp_w VARCHAR,
call_sign VARCHAR
) | What is the ERP W with a call sign at w261cq? | SELECT erp_w FROM table_name_19 WHERE call_sign = "w261cq" | sql_create_context |
CREATE TABLE table_name_54 (
goals_against INTEGER,
wins INTEGER
) | what is the highest goals against when the wins is less than 1? | SELECT MAX(goals_against) FROM table_name_54 WHERE wins < 1 | sql_create_context |
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,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | Find the names of swimmers who has a result of 'win', and count them by a bar chart, rank X in asc order. | SELECT name, COUNT(name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID WHERE Result = 'Win' GROUP BY name ORDER BY name | nvbench |
CREATE TABLE table_14342592_8 (
touchdowns INTEGER,
player VARCHAR
) | Name the most touchdowns for becker | SELECT MAX(touchdowns) FROM table_14342592_8 WHERE player = "Becker" | sql_create_context |
CREATE TABLE table_10300 (
"Name" text,
"Type" text,
"Local board" text,
"Suburb" text,
"Authority" text,
"Decile" real
) | Which name is the learning/social difficulties type? | SELECT "Name" FROM table_10300 WHERE "Type" = 'learning/social difficulties' | wikisql |
CREATE TABLE table_25642873_2 (
extra_points VARCHAR,
touchdowns VARCHAR
) | The player who had 5 touchdowns had how many extra points? | SELECT extra_points FROM table_25642873_2 WHERE touchdowns = 5 | sql_create_context |
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 Allergy_Type (
Allergy VARCHAR(20),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | Create a bar chart showing how many allergytype across allergytype, and could you rank by the bars from high to low? | SELECT AllergyType, COUNT(AllergyType) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType DESC | nvbench |
CREATE TABLE table_1670921_2 (
batting_partners VARCHAR,
batting_team VARCHAR
) | What batting partners batted for pakistan? | SELECT batting_partners FROM table_1670921_2 WHERE batting_team = "Pakistan" | sql_create_context |
CREATE TABLE table_2368 (
"Institution" text,
"Location" text,
"Year Joined" real,
"Affiliation" text,
"Enrollment" real,
"Mascot" text,
"Colors" text
) | in what year did the colors red and gold join? | SELECT COUNT("Year Joined") FROM table_2368 WHERE "Colors" = 'Red and Gold' | wikisql |
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,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TAB... | Most popular StackOverflow tags in July 2018. | SELECT num.TagName AS Tag, ROW_NUMBER() OVER (ORDER BY rate.Rate DESC) AS MayRank, ROW_NUMBER() OVER (ORDER BY num.Num DESC) AS TotalRank, rate.Rate AS QuestionsInMay, num.Num AS QuestionsTotal FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AN... | sede |
CREATE TABLE table_3559 (
"Entered [A ]" text,
"Weeks in top 10" real,
"Single" text,
"Artist" text,
"Peak" real,
"Peak reached [A ]" text,
"Weeks at peak" real
) | What smallest amount in the weeks at peak column? | SELECT MIN("Weeks at peak") FROM table_3559 | wikisql |
CREATE TABLE table_48841 (
"Member" text,
"Party" text,
"Electorate" text,
"State" text,
"Term of office" text
) | Which State has an Electorate of Barton? | SELECT "State" FROM table_48841 WHERE "Electorate" = 'barton' | wikisql |
CREATE TABLE table_25216 (
"Year" text,
"Date" text,
"Driver" text,
"Team" text,
"Manufacturer" text,
"Laps" text,
"Miles (km)" text,
"Race Time" text,
"Average Speed (mph)" text,
"Report" text
) | Who was the manufacturer in the year when the race lasted 2:30:28? | SELECT "Manufacturer" FROM table_25216 WHERE "Race Time" = '2:30:28' | wikisql |
CREATE TABLE employee (
emp_fname VARCHAR,
emp_num VARCHAR
)
CREATE TABLE professor (
prof_office VARCHAR,
emp_num VARCHAR,
dept_code VARCHAR,
prof_high_degree VARCHAR
)
CREATE TABLE department (
dept_code VARCHAR,
dept_name VARCHAR
) | Find the first name and office of the professor who is in the history department and has a Ph.D. degree. | SELECT T1.emp_fname, T2.prof_office FROM employee AS T1 JOIN professor AS T2 ON T1.emp_num = T2.emp_num JOIN department AS T3 ON T3.dept_code = T2.dept_code WHERE T3.dept_name = 'History' AND T2.prof_high_degree = 'Ph.D.' | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.