context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_16 (
mascot VARCHAR,
location VARCHAR
) | Who is the mascot for Mishawaka? | SELECT mascot FROM table_name_16 WHERE location = "mishawaka" | sql_create_context |
CREATE TABLE zyb (
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... | 统计医疗记录中医院0652199的出院诊断为H88.444的最低医疗费总额和最高医疗费总额分别是多少钱? | SELECT MIN(t_kc24.MED_AMOUT), MAX(t_kc24.MED_AMOUT) FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.MED_SER_ORG_NO = '0652199' AND qtb.OUT_DIAG_DIS_CD = 'H88.444' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.MED_SER_ORG_NO = '0652199' AND gyb.OUT_DIAG_DIS_CD = 'H88.444' UNION... | css |
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, find name and code , and group by attribute name, and visualize them by a bar chart. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name | nvbench |
CREATE TABLE table_1342149_13 (
incumbent VARCHAR,
first_elected VARCHAR
) | What is the incumbent for 1932? | SELECT incumbent FROM table_1342149_13 WHERE first_elected = 1932 | sql_create_context |
CREATE TABLE procedures (
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
)
... | what is maximum age of patients whose gender is m and primary disease is left femur fracture? | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "LEFT FEMUR FRACTURE" | mimicsql_data |
CREATE TABLE table_79056 (
"Name or route" text,
"type" text,
"elevation groundstation" real,
"elevation mountainstation" real,
"slope length" real,
"capacity in persons/hour" real,
"construction year(s)" text
) | Which slope length has a type of surface lift, and an elevation groundstation smaller than 1974, and a construction year(s) of 1971, and a Name or route of alpmatten 1? | SELECT "slope length" FROM table_79056 WHERE "type" = 'surface lift' AND "elevation groundstation" < '1974' AND "construction year(s)" = '1971' AND "Name or route" = 'alpmatten 1' | wikisql |
CREATE TABLE table_18821196_1 (
weekly_schedule VARCHAR,
tv_network_s_ VARCHAR
) | What is every weekly schedule of TV network Viasat 4? | SELECT weekly_schedule FROM table_18821196_1 WHERE tv_network_s_ = "Viasat 4" | sql_create_context |
CREATE TABLE Student_Course_Enrolment (
student_id VARCHAR
)
CREATE TABLE Students (
login_name VARCHAR,
student_id VARCHAR
) | Find the student ID and login name of the student with the most course enrollments | SELECT T1.student_id, T2.login_name FROM Student_Course_Enrolment AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id GROUP BY T1.student_id ORDER BY COUNT(*) DESC LIMIT 1 | sql_create_context |
CREATE TABLE table_28348757_3 (
production_code VARCHAR,
_number VARCHAR
) | Name the production code for number 8 | SELECT production_code FROM table_28348757_3 WHERE _number = 8 | sql_create_context |
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,
... | just how many 50 ml flex cont: magnesium sulfate 40 mg/ml ij soln prescriptions were there since 2105? | SELECT COUNT(*) FROM medication WHERE medication.drugname = '50 ml flex cont: magnesium sulfate 40 mg/ml ij soln' AND STRFTIME('%y', medication.drugstarttime) >= '2105' | eicu |
CREATE TABLE table_34943 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
) | What is the Site when the Result was w52-0? | SELECT "Site" FROM table_34943 WHERE "Result" = 'w52-0' | wikisql |
CREATE TABLE table_51203 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | What was the home team score when the away team scored 6.13 (49)? | SELECT "Home team score" FROM table_51203 WHERE "Away team score" = '6.13 (49)' | wikisql |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester i... | Are ES 395 and ES 629 available in the same semester ? | SELECT COUNT(*) > 0 FROM course AS COURSE_0, course AS COURSE_1, course_offering AS COURSE_OFFERING_0, course_offering AS COURSE_OFFERING_1, course_prerequisite WHERE COURSE_OFFERING_1.semester = COURSE_OFFERING_0.semester AND COURSE_0.course_id = COURSE_OFFERING_0.course_id AND COURSE_0.department = 'ES' AND COURSE_0.... | advising |
CREATE TABLE table_name_92 (
record VARCHAR,
date VARCHAR
) | What is the record for the game on January 19? | SELECT record FROM table_name_92 WHERE date = "january 19" | sql_create_context |
CREATE TABLE table_test_6 (
"id" int,
"scr" int,
"anemia" bool,
"blood_hemoglobin" int,
"bleeding" int,
"hemorrhagic_diseases" bool,
"stroke" bool,
"blood_platelet_counts" int,
"trauma" bool,
"renal_disease" bool,
"hematocrit_hct" float,
"hepatic_disease" bool,
"polyg... | polyglobulia | SELECT * FROM table_test_6 WHERE polyglobulia = 1 | criteria2sql |
CREATE TABLE table_name_62 (
ofsted_number INTEGER,
dcsf_number VARCHAR,
intake VARCHAR,
type VARCHAR
) | What is the junior type with an intake of 60 and a DCSF number less than 3386 with the smallest Ofsted number? | SELECT MIN(ofsted_number) FROM table_name_62 WHERE intake = 60 AND type = "junior" AND dcsf_number < 3386 | sql_create_context |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | Count the number of captains that have each rank. Visualize by bar chart. | SELECT Rank, COUNT(*) FROM captain GROUP BY Rank | nvbench |
CREATE TABLE table_19744915_15 (
rank VARCHAR,
couple VARCHAR
) | What is Michael and Melanie's rank? | SELECT rank FROM table_19744915_15 WHERE couple = "Michael and Melanie" | sql_create_context |
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,
... | how many days are passed since the last time patient 027-85328 stayed in ward 996 on the current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '027-85328' AND patient.wardid = 996 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
CREATE TABLE table_name_10 (
nationality VARCHAR,
college VARCHAR
) | What's the nationality of Louisiana Tech? | SELECT nationality FROM table_name_10 WHERE college = "louisiana tech" | sql_create_context |
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... | Give me the comparison about the sum of Weight over the Sex , and group by attribute Sex, and sort by the X-axis from low to high please. | SELECT Sex, SUM(Weight) FROM people GROUP BY Sex ORDER BY Sex | nvbench |
CREATE TABLE table_32549 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | How many were in the crowd at the Junction Oval venue? | SELECT "Crowd" FROM table_32549 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE player (
Player_ID int,
Player text,
Team text,
Age int,
Position text,
School_ID int
)
CREATE TABLE school_details (
School_ID int,
Nickname text,
Colors text,
League text,
Class text,
Division text
)
CREATE TABLE school_performance (
School_Id int,
... | For each denomination, return the denomination and the count of schools with that denomination Visualize by bar chart, order X-axis in desc order. | SELECT Denomination, COUNT(*) FROM school GROUP BY Denomination ORDER BY Denomination DESC | nvbench |
CREATE TABLE film_market_estimation (
Estimation_ID int,
Low_Estimate real,
High_Estimate real,
Film_ID int,
Type text,
Market_ID int,
Year int
)
CREATE TABLE film (
Film_ID int,
Title text,
Studio text,
Director text,
Gross_in_dollar int
)
CREATE TABLE market (
Mar... | How films are produced by each studio. Show bar chart. | SELECT Studio, COUNT(*) FROM film GROUP BY Studio | nvbench |
CREATE TABLE table_204_801 (
id number,
"year" number,
"derby\nwinner" text,
"galaxy" number,
"draw" number,
"chivas" number
) | how many matches has chivas won in the derby ? | SELECT COUNT(*) FROM table_204_801 WHERE "derby\nwinner" = 'chivas' | squall |
CREATE TABLE table_44407 (
"Date" text,
"Opponent#" text,
"Site" text,
"Result" text,
"Attendance" text
) | What is the attendance when the result was w61-7? | SELECT "Attendance" FROM table_44407 WHERE "Result" = 'w61-7' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 门诊诊断为疾病编号Y85.622的病人的低密度脂蛋白胆固醇的参考值界限下限和上限我可以看看吗? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jyjgzbb ON mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE mzjzjlb.JZZDBM = 'Y85.622' AND jyjgzbb.JCZBMC = '低密度脂蛋白胆固醇' | css |
CREATE TABLE table_name_5 (
arena VARCHAR,
founded VARCHAR
) | Which arena was founded in 2000? | SELECT arena FROM table_name_5 WHERE founded = 2000 | sql_create_context |
CREATE TABLE table_name_77 (
venue VARCHAR,
position_in_2005 VARCHAR
) | Can you tell me the Venue that has the Position in 2005 of 8? | SELECT venue FROM table_name_77 WHERE position_in_2005 = "8" | sql_create_context |
CREATE TABLE table_61284 (
"Player" text,
"Team" text,
"Matches" real,
"Inns" real,
"Runs" real,
"Balls" real,
"S/Rate" real,
"100s" real,
"Average" real
) | How many Matches have an Average larger than 26.53, and an S/Rate of 165.4, and a 100s smaller than 1? | SELECT COUNT("Matches") FROM table_61284 WHERE "Average" > '26.53' AND "S/Rate" = '165.4' AND "100s" < '1' | wikisql |
CREATE TABLE table_name_60 (
province VARCHAR,
icao VARCHAR
) | Name the Province with ICAO of zbcf? | SELECT province FROM table_name_60 WHERE icao = "zbcf" | sql_create_context |
CREATE TABLE category (
id int,
business_id varchar,
category_name varchar
)
CREATE TABLE user (
uid int,
user_id varchar,
name varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longit... | Find users whose average review rating is below 3 | SELECT user.name FROM review, user WHERE user.user_id = review.user_id GROUP BY user.name HAVING AVG(review.rating) < 3 | yelp |
CREATE TABLE table_203_442 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | how many friendly competitions occurred before september ? | SELECT COUNT(*) FROM table_203_442 WHERE "date" < 9 AND "competition" = 'friendly' | squall |
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... | Show all cities and corresponding number of students Plot them as bar chart, and sort x-axis from low to high order. | SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY city_code | nvbench |
CREATE TABLE table_204_517 (
id number,
"name" text,
"date of birth" text,
"club" text,
"division" text,
"appointed" text,
"time as manager" text
) | what club is listed next to june 4 , 1972 ? | SELECT "club" FROM table_204_517 WHERE "date of birth" = '4 june 1972' | squall |
CREATE TABLE Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Customers (
customer_id INTEGER,
customer_first_name VARCHAR(20)... | , could you sort y-axis in asc order? | SELECT card_type_code, SUM(card_number) FROM Customers_Cards GROUP BY card_type_code ORDER BY SUM(card_number) | nvbench |
CREATE TABLE table_29960 (
"Week" real,
"Date" text,
"Kickoff" text,
"Opponent" text,
"Final score" text,
"Team record" text,
"Game site" text,
"Attendance" real
) | How many times did the Centurions play the Rhein Fire? | SELECT COUNT("Game site") FROM table_29960 WHERE "Opponent" = 'Rhein Fire' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | Among patients who had sigmoid diverticulitis, colovestical fistula/sda as their primary disease, calculate the maximum age of divorcee patients. | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.diagnosis = "SIGMOID DIVERTICULITIS, COLOVESTICAL FISTULA/SDA" | mimicsql_data |
CREATE TABLE table_27946889_2 (
represent_province VARCHAR,
hometown VARCHAR
) | What is the represent province for the contestant whose hometown is Woerden? | SELECT represent_province FROM table_27946889_2 WHERE hometown = "Woerden" | sql_create_context |
CREATE TABLE table_12886178_4 (
points_for VARCHAR,
tries_for VARCHAR
) | What's the points for count for the club with tries for count of 29? | SELECT points_for FROM table_12886178_4 WHERE tries_for = "29" | sql_create_context |
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... | Show me about the distribution of Sex and the average of Height , and group by attribute Sex in a bar chart, and order x-axis from high to low order please. | SELECT Sex, AVG(Height) FROM people GROUP BY Sex ORDER BY Sex DESC | nvbench |
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,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE jybgb (
BBCJBW text,
BBDM tex... | 在2004年12月22日到08年7月12日内患者33538055所有检验人为72481499的检验结果指标记录的检验指标流水号具体都有啥? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.B... | css |
CREATE TABLE table_19855 (
"Stage" real,
"Winner" text,
"General classification" text,
"Points classification" text,
"Mountains classification" text,
"Combination classification" text,
"Team classification" text
) | Name all the team clasification where the combination classification is mederic clain | SELECT "Team classification" FROM table_19855 WHERE "Combination classification" = 'Mederic Clain' | wikisql |
CREATE TABLE table_14242 (
"Round" real,
"Pick #" real,
"Player" text,
"Position" text,
"College" text
) | Which round was the defensive tackle picked after 187? | SELECT AVG("Round") FROM table_14242 WHERE "Position" = 'defensive tackle' AND "Pick #" > '187' | wikisql |
CREATE TABLE table_53670 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the number of bronze that silver is smaller than 1 and gold bigger than 0? | SELECT AVG("Bronze") FROM table_53670 WHERE "Silver" < '1' AND "Gold" > '0' | 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... | 依科室与入院诊断的不同计算出医院3385540所有的就诊记载里患者的平均岁数,留下里面平均岁数小于14岁的记录 | SELECT qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '3385540' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.IN_DIAG_DIS_NM HAVING AVG(qtb.PERSON_AGE) < 14 UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.IN_DIAG_DIS_NM, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '3385540' GROUP... | css |
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... | what is the number of patients whose diagnoses short title is metabolic encephalopathy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Metabolic encephalopathy" | mimicsql_data |
CREATE TABLE table_31527 (
"Economy" text,
"1980" real,
"Gap from Thailand as of 1980 (times)" text,
"1985" real,
"1990" real,
"1995" real,
"2000" real,
"2005" real,
"2010" real,
"2012" real,
"Gap from Thailand as of 2012 (times)" text,
"GDP as of 2012 after purchasing po... | What is the max 2010 value for a 1980 gap value is 2.43? | SELECT MAX("2010") FROM table_31527 WHERE "Gap from Thailand as of 1980 (times)" = '2.43' | wikisql |
CREATE TABLE ref_transaction_types (
transaction_type_code text,
transaction_type_description text
)
CREATE TABLE sales (
sales_transaction_id number,
sales_details text
)
CREATE TABLE purchases (
purchase_transaction_id number,
purchase_details text
)
CREATE TABLE investors (
investor_id... | Show the dates of transactions if the share count is bigger than 100 or the amount is bigger than 1000. | SELECT date_of_transaction FROM transactions WHERE share_count > 100 OR amount_of_transaction > 1000 | spider |
CREATE TABLE table_name_28 (
mobile VARCHAR,
chrome VARCHAR
) | What percentage of users were using mobile browsers during the period in which 9.00% were using Chrome? | SELECT mobile FROM table_name_28 WHERE chrome = "9.00%" | sql_create_context |
CREATE TABLE table_name_65 (
grid INTEGER,
time VARCHAR
) | Which Grid has a Time of +13.999? | SELECT MIN(grid) FROM table_name_65 WHERE time = "+13.999" | sql_create_context |
CREATE TABLE table_name_40 (
date VARCHAR,
venue VARCHAR
) | When did a Venue of Antigua Recreation Ground happen? | SELECT date FROM table_name_40 WHERE venue = "antigua recreation ground" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | give me the number of patients whose age is less than 27 and admission year is less than 2123? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "27" AND demographic.admityear < "2123" | mimicsql_data |
CREATE TABLE table_202_54 (
id number,
"song" text,
"chinese" text,
"hito radio\ntop 10" number,
"9+2 music\ntop 15" number,
"global asia\ntop 15" number,
"ufo radio\ntop 15" number,
"channel [v]\ntop 20" number,
"mtv taiwan\ntop 20" number,
"yes 93.3\ntop 20" number
) | how many songs were on the mtv taiwan top 20 chart ? | SELECT COUNT("song") FROM table_202_54 WHERE NOT "mtv taiwan\ntop 20" IS NULL | squall |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents... | did patient 18159, came to the hospital since 3 years ago? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 18159 AND DATETIME(admissions.admittime) >= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_44665 (
"Rider" text,
"Manufacturer" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | How many laps has a grid of 5? | SELECT "Laps" FROM table_44665 WHERE "Grid" = '5' | wikisql |
CREATE TABLE table_name_84 (
name_of_tournament VARCHAR,
champions VARCHAR,
score VARCHAR
) | In What Tournament did Boris Becker have a Score of 7 6, 6 4? | SELECT name_of_tournament FROM table_name_84 WHERE champions = "boris becker" AND score = "7–6, 6–4" | sql_create_context |
CREATE TABLE table_name_70 (
away_team VARCHAR,
home_team VARCHAR
) | Who was South Melbourne's away team opponents? | SELECT away_team FROM table_name_70 WHERE home_team = "south melbourne" | sql_create_context |
CREATE TABLE table_32120 (
"Year" real,
"Team" text,
"Make" text,
"Engine" text,
"Class" text,
"Rank" text,
"Points" real
) | Tell me the most year for 3 points | SELECT MAX("Year") FROM table_32120 WHERE "Points" = '3' | 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,
... | 那个叫水幼安的患者报告日期在两千零四年九月八日之前的检验报告单对应了哪些住院就诊记录?其在住院时的就诊流水号具体为啥? | SELECT zyjzjlb.JZLSH FROM person_info JOIN hz_info JOIN zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE person_info.XM = '水幼安' AND NOT zyjzjlb.JZLSH IN (SELECT jybgb.JZLSH FROM jybgb WHERE jybgb.BGRQ >= '2004-09-08') | css |
CREATE TABLE table_204_859 (
id number,
"year" number,
"seniors (trood award & rodda medal)" text,
"reserves (rex hartley medal)" text,
"under 18's (bruce wilkinson medal)" text,
"under 16's (shaw/carter medal)" text
) | who is the first under 18 bruce wilkinson medal winner ? | SELECT "under 18's (bruce wilkinson medal)" FROM table_204_859 WHERE NOT "under 18's (bruce wilkinson medal)" IS NULL ORDER BY "year" LIMIT 1 | squall |
CREATE TABLE table_name_22 (
round VARCHAR,
method VARCHAR,
time VARCHAR
) | what is the total number of rounds when method is tko (punches) and time is 0:40? | SELECT COUNT(round) FROM table_name_22 WHERE method = "tko (punches)" AND time = "0:40" | sql_create_context |
CREATE TABLE manager (
Manager_ID int,
Name text,
Country text,
Working_year_starts text,
Age int,
Level int
)
CREATE TABLE railway (
Railway_ID int,
Railway text,
Builder text,
Built text,
Wheels text,
Location text,
ObjectNumber text
)
CREATE TABLE railway_manage ... | Show the working years of managers in descending order of their level, and count them by a line chart | SELECT Working_year_starts, COUNT(Working_year_starts) FROM manager ORDER BY Level DESC | nvbench |
CREATE TABLE table_17435 (
"#" real,
"President" text,
"Date of birth" text,
"Date of inauguration" text,
"Age at inauguration" text,
"End of term" text,
"Length of retirement" text,
"Date of death" text,
"Lifespan" text
) | who is the the president with date of inauguration being 4june1979 | SELECT "President" FROM table_17435 WHERE "Date of inauguration" = '4June1979' | wikisql |
CREATE TABLE table_1341663_33 (
candidates VARCHAR,
incumbent VARCHAR
) | Who were the candidates when Shirley Chisholm was the incumbent? | SELECT candidates FROM table_1341663_33 WHERE incumbent = "Shirley Chisholm" | sql_create_context |
CREATE TABLE table_name_83 (
birth_place VARCHAR,
monarchs_served VARCHAR,
entered_office VARCHAR
) | What is the birth place of the prime minister who served George V and entered office on 23 October 1922? | SELECT birth_place FROM table_name_83 WHERE monarchs_served = "george v" AND entered_office = "23 october 1922" | sql_create_context |
CREATE TABLE table_name_38 (
rank INTEGER,
name VARCHAR,
points VARCHAR
) | Which Rank has a Name of thomas morgenstern, and Points larger than 368.9? | SELECT AVG(rank) FROM table_name_38 WHERE name = "thomas morgenstern" AND points > 368.9 | sql_create_context |
CREATE TABLE table_204_854 (
id number,
"#" number,
"wrestlers" text,
"reign" number,
"date" text,
"days\nheld" number,
"location" text,
"notes" text
) | which wrestler is previous from vacant | SELECT "wrestlers" FROM table_204_854 WHERE id = (SELECT id FROM table_204_854 WHERE "wrestlers" = 'vacant') - 1 | squall |
CREATE TABLE table_name_16 (
opponent VARCHAR,
date VARCHAR
) | Who was the opponent on August 30? | SELECT opponent FROM table_name_16 WHERE date = "august 30" | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | Find All_Home and Team_ID , and group by attribute ACC_Road, and visualize them by a bar chart. | SELECT All_Home, Team_ID FROM basketball_match GROUP BY ACC_Road, All_Home | nvbench |
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,
XM text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC... | 从01年6月20日到2018年2月12日,患者邹浩慨统共在医疗机构6233907的门诊次数有多少? | SELECT COUNT(*) FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '邹浩慨' AND wdmzjzjlb.JZKSRQ BETWEEN '2001-06-20' AND '2018-02-12' AND wdmzjzjlb.YLJGDM = '6233907' UNI... | css |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text... | 从07年9月24日到19年9月4日患者钱建章的检测指标535180的情况是什么样的? | (SELECT * FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGD... | css |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 列出在医院0779082中患者郑家美名称包含注意的门诊诊断有什么门诊就诊记录? | 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 table_name_34 (
gold VARCHAR,
silver VARCHAR,
total VARCHAR
) | What is the total number of Gold, when Silver is 2, and when Total is less than 7? | SELECT COUNT(gold) FROM table_name_34 WHERE silver = 2 AND total < 7 | sql_create_context |
CREATE TABLE table_18037 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Game site" text,
"Record" text,
"Attendance" real
) | Where did they play the San Diego Chargers? | SELECT "Game site" FROM table_18037 WHERE "Opponent" = 'San Diego Chargers' | wikisql |
CREATE TABLE table_203_664 (
id number,
"club" text,
"town" text,
"founded" number,
"nickname" text,
"colours" text,
"home ground" text,
"titles" number,
"website" text
) | how many teams have the color red in their team colors ? | SELECT COUNT("club") FROM table_203_664 WHERE "colours" = 'red' | squall |
CREATE TABLE table_46323 (
"Club" text,
"Played" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Points difference" text,
"Bonus Points" text,
"Points" text
) | What is Drawn, when Club is Newport RFC? | SELECT "Drawn" FROM table_46323 WHERE "Club" = 'newport rfc' | wikisql |
CREATE TABLE table_35977 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
) | Score of 6 4, and a Opponent of @ marlins had what record? | SELECT "Record" FROM table_35977 WHERE "Score" = '6–4' AND "Opponent" = '@ marlins' | wikisql |
CREATE TABLE table_47935 (
"Hangul" text,
"\u2019Phagspa" text,
"Tibetan" text,
"Phoenician" text,
"Greek" text,
"Latin" text
) | to the Latin of f, y, u/v/w? | SELECT "Greek" FROM table_47935 WHERE "Latin" = 'f, y, u/v/w' | wikisql |
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,... | find the drug type and dose for oxacillin. | SELECT prescriptions.drug_type, prescriptions.drug_dose FROM prescriptions WHERE prescriptions.drug = "Oxacillin" | mimicsql_data |
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Scor... | Bar chart x axis position y axis how many position, and I want to list total number in desc order. | SELECT Position, COUNT(Position) FROM player GROUP BY Position HAVING AVG(Points) >= 20 ORDER BY COUNT(Position) DESC | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime tim... | how many days has passed since patient 31088 had a white blood cells laboratory test for the first time on the current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'white blood cells') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31088 AND a... | mimic_iii |
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 diagnosed with angioneurotic edema who had abnormal lab test status. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Angioneurotic edema" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_204_782 (
id number,
"state" text,
"title" text,
"name" text,
"entered office" text
) | how many people entered office in 1970 ? | SELECT COUNT(*) FROM table_204_782 WHERE "entered office" = 1970 | squall |
CREATE TABLE table_423 (
"Year" real,
"Product" text,
"Production" text,
"Consumption" text,
"Import" text,
"Export" text
) | The earliest year is 1996. | SELECT MIN("Year") FROM table_423 | wikisql |
CREATE TABLE table_31822 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Venue" text,
"Attendance" real,
"Record" text
) | Tell me the venue for record of 2-7 | SELECT "Venue" FROM table_31822 WHERE "Record" = '2-7' | wikisql |
CREATE TABLE status (
statusid number,
status text
)
CREATE TABLE results (
resultid number,
raceid number,
driverid number,
constructorid number,
number number,
grid number,
position number,
positiontext text,
positionorder number,
points number,
laps number,
ti... | Find the distinct driver id and the stop number of all drivers that have a shorter pit stop duration than some drivers in the race with id 841. | SELECT DISTINCT driverid, stop FROM pitstops WHERE duration < (SELECT MAX(duration) FROM pitstops WHERE raceid = 841) | spider |
CREATE TABLE table_name_57 (
away_team VARCHAR,
home_team VARCHAR
) | What was the score for the away team when they played collingwood? | SELECT away_team AS score FROM table_name_57 WHERE home_team = "collingwood" | sql_create_context |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE Posts (
... | Users with 2K rep who visited in the last 30 days. | SELECT Id AS "user_link", DATEDIFF(day, LastAccessDate, GETDATE()) AS DaysSinceLastVisit FROM Users WHERE Reputation >= 2000 AND DATEDIFF(day, LastAccessDate, GETDATE()) < 30 ORDER BY DaysSinceLastVisit | sede |
CREATE TABLE table_name_87 (
loss VARCHAR,
date VARCHAR
) | Which loss happened april 18? | SELECT loss FROM table_name_87 WHERE date = "april 18" | sql_create_context |
CREATE TABLE table_12962773_12 (
height VARCHAR,
no VARCHAR
) | What height is player number 9? | SELECT height FROM table_12962773_12 WHERE no = 9 | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE labevents (
row_id number,
... | what was the length of stay in patient 26195's first hospital stay? | SELECT STRFTIME('%j', admissions.dischtime) - STRFTIME('%j', admissions.admittime) FROM admissions WHERE admissions.subject_id = 26195 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_name_25 (
song VARCHAR,
rank VARCHAR,
points VARCHAR,
draw VARCHAR
) | Which song has more than 66 points, a draw greater than 3, and is ranked 3rd? | SELECT song FROM table_name_25 WHERE points > 66 AND draw > 3 AND rank = "3rd" | sql_create_context |
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 first time that patient 57023 got a microbiology test during a month before? | SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 57023) AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY microbiologyevent... | mimic_iii |
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,... | what is primary disease and lab test fluid of subject id 18372? | SELECT demographic.diagnosis, lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "18372" | mimicsql_data |
CREATE TABLE table_name_74 (
round INTEGER,
selection VARCHAR
) | How many rounds had a selection of 165? | SELECT SUM(round) FROM table_name_74 WHERE selection = 165 | sql_create_context |
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,
... | until 2102 what were the four most common lab tests? | 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 STRFTIME('%y', labevents.charttime) <= '2102' GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 4) | mimic_iii |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | i would like information on flights from SAN FRANCISCO to PITTSBURGH leaving after 2000 monday night | 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 ((date_day.day_number = 21 AND date_day.month_number = 2 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_1473672_6 (
nationality VARCHAR,
player VARCHAR
) | What country did Derek Black come from? | SELECT nationality FROM table_1473672_6 WHERE player = "Derek Black" | sql_create_context |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE food_service (
meal_code text,
meal_number int,
compartment text,
meal_description varchar
)
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airli... | what is the ground transportation from BOS airport to BOSTON downtown | SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'BOSTON' AND ground_service.airpor... | atis |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.