context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | A bar chart about what are the title and maximum price of each film?, and could you display by the Title in asc? | SELECT Title, MAX(T1.Price) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Title ORDER BY Title | nvbench |
CREATE TABLE wine (
No INTEGER,
Grape TEXT,
Winery TEXT,
Appelation TEXT,
State TEXT,
Name TEXT,
Year INTEGER,
Price INTEGER,
Score INTEGER,
Cases INTEGER,
Drink TEXT
)
CREATE TABLE appellations (
No INTEGER,
Appelation TEXT,
County TEXT,
State TEXT,
Area... | Compare the number of winery of the wines whose price is bigger than 100. | SELECT Winery, COUNT(Winery) FROM wine WHERE Price > 100 GROUP BY Winery | nvbench |
CREATE TABLE table_79990 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What was the surface of the game that resulted in a final score of 6-1 7-5? | SELECT "Surface" FROM table_79990 WHERE "Score" = '6-1 7-5' | wikisql |
CREATE TABLE table_77860 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Date" text
) | Name the away team score for lake oval | SELECT "Away team score" FROM table_77860 WHERE "Venue" = 'lake oval' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
... | what are the new medications prescribed for patient 28447 today compared to the ones yesterday? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 28447) AND DATETIME(prescriptions.startdate, 'start of day') = DATETIME(CURRENT_TIME(), 'start of day', '-0 day') EXCEPT SELECT prescriptions.drug FROM prescriptions WHERE... | mimic_iii |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE SuggestedEdits (
Id number,
PostId n... | Est-ce que mbraux (un pseudo au hasard :) a d j publi un post ?. | SELECT p.Id FROM Posts AS p JOIN Users AS u ON p.OwnerUserId = u.Id WHERE u.DisplayName = 'mbraux' | sede |
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 was hired before 2002-06-21, find hire_date and the average of employee_id bin hire_date by weekday, and visualize them by a bar chart, I want to order in ascending by the total number please. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_20453 (
"S No" real,
"Team (A)" text,
"Team (B)" text,
"Winner" text,
"Margin" text,
"Match Date" text
) | Name the number of team for 35 runs margin and india winner | SELECT COUNT("Team (B)") FROM table_20453 WHERE "Margin" = '35 runs' AND "Winner" = 'India' | wikisql |
CREATE TABLE qtb (
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... | 医疗就诊11758190455在出院时,诊断出来是什么疾病,以及该疾病相对应的编号是什么 | SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_DIAG_DIS_NM FROM qtb WHERE qtb.MED_CLINIC_ID = '11758190455' UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.MED_CLINIC_ID = '11758190455' UNION SELECT zyb.OUT_DIAG_DIS_CD, zyb.OUT_DIAG_DIS_NM FROM zyb WHERE zyb.MED_CLINIC_ID = '11758190455' UNION SELECT mzb.... | css |
CREATE TABLE table_35041 (
"Name" text,
"Year" real,
"Propulsion" text,
"launched by" text,
"Country" text
) | What is the name of the anti-ship missile that had a turbojet propulsion that was launched by a surface, sub after 1985? | SELECT "Name" FROM table_35041 WHERE "Propulsion" = 'turbojet' AND "Year" > '1985' AND "launched by" = 'surface, sub' | wikisql |
CREATE TABLE table_17052 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"MLB Draft" text
) | What's Shion Newton's MLB draft result? | SELECT "MLB Draft" FROM table_17052 WHERE "Player" = 'Shion Newton' | wikisql |
CREATE TABLE table_9060 (
"Event" text,
"Time" text,
"Club" text,
"Date" text,
"Meet" text,
"Location" text
) | Which Meet has a Club of centro de natacon carabobo? | SELECT "Meet" FROM table_9060 WHERE "Club" = 'centro de natacon carabobo' | wikisql |
CREATE TABLE zzmzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH number,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZ... | 姜岚翠这个病人的检验报告结果指标均正常的有哪些?检验报告单号是什么 | SELECT jybgb.BGDH FROM person_info JOIN hz_info JOIN zzmzjzjlb JOIN jybgb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = zzmzjzjlb.YLJGDM AND hz_info.KH = zzmzjzjlb.KH AND hz_info.KLX = zzmzjzjlb.KLX AND zzmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND zzmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '姜... | css |
CREATE TABLE table_13842 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | Which nation had 3 bronze? | SELECT "Nation" FROM table_13842 WHERE "Bronze" = '3' | wikisql |
CREATE TABLE table_55122 (
"Episode #" real,
"# in Season" real,
"Episode Name" text,
"Airdate" text,
"Location" text
) | What is the average episode # with a name of the origin of Donnie (part 1)? | SELECT AVG("Episode #") FROM table_55122 WHERE "Episode Name" = 'the origin of donnie (part 1)' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text,
person_info_CSD text,
person_info_CSRQ time,
person_info_GJDM text,
person_info_GJMC text,
person_info_JGDM text,
person_info_JGMC text,
person_info_MZDM text,
person_info_MZMC text,
person_info_XBDM ... | 从2007年10月16日到2020年3月16日,列出病人沈智勇这期间所有检验报告单的审核日期时间 | SELECT jybgb.SHSJ 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.person_info_XM = '沈智勇' AND jybgb.BGRQ BETWEEN '2007-10-16' AND '2020-03-16' ... | css |
CREATE TABLE table_64408 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
) | Can you tell me the lowest Rank that has the Nationality of australia, and the Name of leisel jones, and the Lane larger than 4? | SELECT MIN("Rank") FROM table_64408 WHERE "Nationality" = 'australia' AND "Name" = 'leisel jones' AND "Lane" > '4' | wikisql |
CREATE TABLE table_name_9 (
round INTEGER,
overall VARCHAR,
pick VARCHAR,
name VARCHAR
) | What is the lowest round of bob caldwell, who has a pick greater than 7 and an overall larger than 162? | SELECT MIN(round) FROM table_name_9 WHERE pick > 7 AND name = "bob caldwell" AND overall > 162 | 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 is the number of patients having their lap right hemicolectomy performed in a year before? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'lap right hemicolectomy') AND DATETIME(procedures_ic... | mimic_iii |
CREATE TABLE table_1708610_3 (
march_27_29 VARCHAR,
january_15_16 VARCHAR
) | Name march 27-29 where january 15-16 is january 15, 1991 | SELECT march_27_29 FROM table_1708610_3 WHERE january_15_16 = "January 15, 1991" | sql_create_context |
CREATE TABLE table_name_34 (
drawn VARCHAR,
losing_bp VARCHAR
) | With a Losing BP of 8, what is the drawn? | SELECT drawn FROM table_name_34 WHERE losing_bp = "8" | sql_create_context |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 把2004年9月8日到2020年2月21日期间患者王傲冬一共做过多少次检查查看一下 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '王傲冬' AND t_kc22.STA_DATE BETWEEN '2004-09-08' AND '2020-02-21' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE table_37065 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the first game played against the Chicago Black Hawks? | SELECT MIN("Game") FROM table_37065 WHERE "Opponent" = 'chicago black hawks' | wikisql |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperio... | calculate the number of patients who have stayed in the 523 ward in 2101. | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.wardid = 523 AND STRFTIME('%y', patient.unitadmittime) = '2101' | eicu |
CREATE TABLE table_43238 (
"Date" text,
"Source" text,
"Polling Agency" text,
"Davis" text,
"Gallagher" text,
"Higgins" text,
"McGuinness" text,
"Mitchell" text,
"Norris" text,
"Scallon" text
) | What is the Higgins with a Scallon that is 2%? | SELECT "Higgins" FROM table_43238 WHERE "Scallon" = '2%' | 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,
... | get me the drug code of oxazepam drug. | SELECT prescriptions.formulary_drug_cd FROM prescriptions WHERE prescriptions.drug = "Oxazepam" | mimicsql_data |
CREATE TABLE table_30330 (
"Year" real,
"Team" text,
"Number" real,
"Games" real,
"Kicks" real,
"Handballs" real,
"Total Disposals" real,
"Marks" real,
"Tackles" real,
"Goals" real,
"Behinds" real,
"Goal Accuracy %" text,
"Brownlow Medal Votes" real
) | How many marks are there when tackles are 3? | SELECT "Marks" FROM table_30330 WHERE "Tackles" = '3' | wikisql |
CREATE TABLE table_65913 (
"Hampden FL" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
) | What shows for against when draws are 0, and losses are 16? | SELECT AVG("Against") FROM table_65913 WHERE "Draws" = '0' AND "Losses" = '16' | wikisql |
CREATE TABLE table_name_20 (
record VARCHAR,
date VARCHAR
) | What is the record of the game on March 18? | SELECT record FROM table_name_20 WHERE date = "march 18" | sql_create_context |
CREATE TABLE table_56121 (
"Rank" real,
"Name" text,
"Team" text,
"Games" real,
"Assists" real
) | I want the team with assists greater than 118 and rank less than 2 | SELECT "Team" FROM table_56121 WHERE "Assists" > '118' AND "Rank" < '2' | wikisql |
CREATE TABLE table_65020 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
) | What was the outcome when the partner was Iryna Bremond? | SELECT "Outcome" FROM table_65020 WHERE "Partner" = 'iryna bremond' | wikisql |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLOYEE_ID decimal(6,0),
START_DATE date,
END_DATE date,
JOB_ID... | For those employees who do not work in departments with managers that have ids between 100 and 200, a bar chart shows the distribution of hire_date and the sum of salary bin hire_date by weekday, rank from high to low by the y axis. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) DESC | nvbench |
CREATE TABLE table_204_77 (
id number,
"number" text,
"builder" text,
"type" text,
"date" text,
"works number" number,
"notes" text
) | how many different types of diesel locomotives are dated after 1980 ? | SELECT COUNT("number") FROM table_204_77 WHERE "date" > 1980 | squall |
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_tests int,
heavy_papers int,
cares_for_students int,
heavy_assignments ... | Of the upper level classes , which get you 11 credits ? | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 11 AND program_course.category LIKE 'ULCS' | advising |
CREATE TABLE table_name_25 (
date VARCHAR,
label VARCHAR
) | What Date has a Label of grilled cheese? | SELECT date FROM table_name_25 WHERE label = "grilled cheese" | sql_create_context |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JO... | For all employees who have the letters D or S in their first name, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id. | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID | nvbench |
CREATE TABLE table_203_643 (
id number,
"year" number,
"award" text,
"group" text,
"result" text,
"notes" text
) | which award has wentworth miller been nominated for the most ? | SELECT "award" FROM table_203_643 GROUP BY "award" ORDER BY COUNT(*) DESC LIMIT 1 | squall |
CREATE TABLE table_12962773_14 (
no INTEGER,
player VARCHAR
) | What number does aleksandar apin wear? | SELECT MAX(no) FROM table_12962773_14 WHERE player = "Aleksandar Ćapin" | 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 demographic ... | what is the number of patients whose death status is 0 and year of birth is less than 2112? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2112" | mimicsql_data |
CREATE TABLE table_78655 (
"Date and time( UTC )" text,
"Type" real,
"Serial no." text,
"Launch site" text,
"Payload" text,
"Type of payload" text,
"Orbit" text,
"Outcome" text
) | When was the payload of Commercial Communications Satellite amc16? | SELECT "Date and time( UTC )" FROM table_78655 WHERE "Type of payload" = 'commercial communications satellite' AND "Payload" = 'amc16' | wikisql |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId n... | Whose questions have you answered. | SELECT answer.OwnerUserId AS "user_link", COUNT(*) AS number FROM Posts AS question INNER JOIN Posts AS answer ON question.PostTypeId = 1 AND answer.PostTypeId = 2 AND question.OwnerUserId = '##userid##' AND answer.ParentId = question.Id GROUP BY answer.OwnerUserId ORDER BY number DESC | sede |
CREATE TABLE table_name_87 (
fleet VARCHAR,
name VARCHAR
) | Which fleet was named Orenburg? | SELECT fleet FROM table_name_87 WHERE name = "orenburg" | 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 demographic ... | How many patients with ulcer of an other part of the foot stayed at hospital for more than 3 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "3" AND diagnoses.long_title = "Ulcer of other part of foot" | mimicsql_data |
CREATE TABLE circuits (
circuitid VARCHAR,
LOCATION VARCHAR,
country VARCHAR
) | Find the id and location of circuits that belong to France or Belgium? | SELECT circuitid, LOCATION FROM circuits WHERE country = "France" OR country = "Belgium" | sql_create_context |
CREATE TABLE table_35369 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | Which February has a Game of 64? | SELECT AVG("February") FROM table_35369 WHERE "Game" = '64' | wikisql |
CREATE TABLE table_1431467_4 (
candidates VARCHAR,
incumbent VARCHAR
) | Who were all candidate when incumbent was D. Wyatt Aiken? | SELECT candidates FROM table_1431467_4 WHERE incumbent = "D. Wyatt Aiken" | sql_create_context |
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 allergy (
allergy... | count how many times did patient 030-30152 go to hospital. | SELECT COUNT(DISTINCT patient.patienthealthsystemstayid) FROM patient WHERE patient.uniquepid = '030-30152' | eicu |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId num... | List of questions for a tag with score and closed date. | SELECT p.CreationDate, p.Id AS "post_link", p.ClosedDate, p.Score FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id WHERE t.TagName IN ('##Tag##') AND p.PostTypeId = 1 | sede |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 自2009年4月19日起,至2015年12月14日止,7542494的医院总共记录有多少医疗次数 | SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '7542494' AND t_kc21.IN_HOSP_DATE BETWEEN '2009-04-19' AND '2015-12-14' | css |
CREATE TABLE location (
restaurant_id int,
house_number int,
street_name varchar,
city_name varchar
)
CREATE TABLE geographic (
city_name varchar,
county varchar,
region varchar
)
CREATE TABLE restaurant (
id int,
name varchar,
food_type varchar,
city_name varchar,
rati... | give me some restaurants in alameda ? | SELECT location.house_number, restaurant.name FROM location, restaurant WHERE location.city_name = 'alameda' AND restaurant.id = location.restaurant_id | restaurants |
CREATE TABLE table_66734 (
"Goal" real,
"Date" text,
"Score" text,
"Result" text,
"Competition" text
) | Which Competition has the Date July 1, 2000? | SELECT "Competition" FROM table_66734 WHERE "Date" = 'july 1, 2000' | wikisql |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | how many patients born before the year 2066 speaks the language ptun? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.language = "PTUN" AND demographic.dob_year < "2066" | mimicsql_data |
CREATE TABLE table_42467 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Orlando" text,
"School/Club Team" text
) | What is the Years in Orlando for carlos arroyo? | SELECT "Years in Orlando" FROM table_42467 WHERE "Player" = 'carlos arroyo' | wikisql |
CREATE TABLE table_64385 (
"Rank" real,
"Artist" text,
"Album" text,
"Peak position" text,
"Sales" real,
"Certification" text
) | Who is the artist of the album Soul? | SELECT "Artist" FROM table_64385 WHERE "Album" = 'soul' | wikisql |
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 average age of patients whose marital status is married and discharge location is snf? | SELECT AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "MARRIED" AND demographic.discharge_location = "SNF" | mimicsql_data |
CREATE TABLE table_2150068_1 (
decay VARCHAR,
mass_kg_ VARCHAR
) | What was the decay for the sattelite that was 180 kg? | SELECT decay FROM table_2150068_1 WHERE mass_kg_ = "180" | sql_create_context |
CREATE TABLE table_56868 (
"Player" text,
"Height" text,
"School" text,
"Hometown" text,
"College" text,
"NBA Draft" text
) | The person with a Height of 6-8 went to which School? | SELECT "School" FROM table_56868 WHERE "Height" = '6-8' | wikisql |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varc... | For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about commission_pct over the last_name by a bar chart, list from high to low by the y axis please. | SELECT LAST_NAME, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY COMMISSION_PCT DESC | nvbench |
CREATE TABLE table_3158 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (millions)" text
) | What was the airdate of episode number 18? | SELECT "Original air date" FROM table_3158 WHERE "No. in season" = '18' | wikisql |
CREATE TABLE table_34698 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Who was the opponent on May 20? | SELECT "Opponent" FROM table_34698 WHERE "Date" = 'may 20' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | what are the top five most frequent laboratory tests among the patients 50s in this year? | SELECT t1.labname FROM (SELECT lab.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 50 AND 59) AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')... | eicu |
CREATE TABLE table_name_54 (
goals INTEGER,
name VARCHAR
) | What is the average goals for Essi Sainio? | SELECT AVG(goals) FROM table_name_54 WHERE name = "essi sainio" | sql_create_context |
CREATE TABLE table_23585197_3 (
artist VARCHAR,
songwriter_s_ VARCHAR
) | Which artist sang the song that ingela hemming wrote? | SELECT artist FROM table_23585197_3 WHERE songwriter_s_ = "Ingela Hemming" | sql_create_context |
CREATE TABLE table_11389 (
"Year" real,
"Main colour(s)" text,
"Additional colour(s)" text,
"Main sponsor(s)" text,
"Additional major sponsor(s)" text
) | What is the additional major sponsor(s) that has red as its main color after 1991? | SELECT "Additional major sponsor(s)" FROM table_11389 WHERE "Main colour(s)" = 'red' AND "Year" > '1991' | wikisql |
CREATE TABLE acceptance (
submission_id number,
workshop_id number,
result text
)
CREATE TABLE submission (
submission_id number,
scores number,
author text,
college text
)
CREATE TABLE workshop (
workshop_id number,
date text,
venue text,
name text
) | List the authors who do not have submission to any workshop. | SELECT author FROM submission WHERE NOT submission_id IN (SELECT submission_id FROM acceptance) | spider |
CREATE TABLE table_19179465_1 (
lost INTEGER,
points VARCHAR
) | How many games were lost when the club got 34 points | SELECT MIN(lost) FROM table_19179465_1 WHERE points = 34 | sql_create_context |
CREATE TABLE table_name_94 (
graduated INTEGER,
player VARCHAR
) | What year did Omar Gonzalez graduate? | SELECT SUM(graduated) FROM table_name_94 WHERE player = "omar gonzalez" | sql_create_context |
CREATE TABLE table_13120 (
"Mark" text,
"Wind*" text,
"Athlete" text,
"Nationality" text,
"Venue" text,
"Date" text
) | Which Mark has an Athlete of heike drechsler? | SELECT "Mark" FROM table_13120 WHERE "Athlete" = 'heike drechsler' | 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... | give me the number of patients whose admission type is newborn and item id is 50801? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "NEWBORN" AND lab.itemid = "50801" | mimicsql_data |
CREATE TABLE table_name_29 (
first_cap VARCHAR,
goals VARCHAR,
caps VARCHAR
) | When was the first cap associated with 39 caps and under 33 goals? | SELECT first_cap FROM table_name_29 WHERE goals < 33 AND caps = 39 | sql_create_context |
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number... | Post closers and their reputation (special present for @Magisch). | SELECT Closers.PostId AS "post_link", Users.Id AS "user_link", Users.Reputation FROM (SELECT PostId, JSON_EXTRACT_SCALAR(Text, '$.Voters0.Id') AS UserId FROM PostHistory WHERE PostHistoryTypeId = 10 UNION ALL SELECT PostId, JSON_EXTRACT_SCALAR(Text, '$.Voters1.Id') AS UserId FROM PostHistory WHERE PostHistoryTypeId = 1... | sede |
CREATE TABLE table_name_60 (
player VARCHAR,
year_s__won VARCHAR
) | Who won in 1983? | SELECT player FROM table_name_60 WHERE year_s__won = "1983" | sql_create_context |
CREATE TABLE table_45616 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent in the final" text,
"Score" text
) | What date did Namigata play against Wen-Hsin Hsu in the finals? | SELECT "Date" FROM table_45616 WHERE "Opponent in the final" = 'wen-hsin hsu' | wikisql |
CREATE TABLE Posts (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
ViewCount number,
Body text,
OwnerUserId number,
OwnerDisplayName text,
LastEditorUserId number,
LastEditorDisplayName text... | Search Brazilian By Tech Tag (Hiring Mode). | SELECT SUM(p.Score) AS TotalScore, u.Id AS "user_link", u.Reputation, u.Location FROM Users AS u, Posts AS p, PostTags AS pt, Tags AS t WHERE t.TagName = @tag AND pt.TagId = t.Id AND pt.PostId = p.ParentId AND p.PostTypeId = 2 AND u.Id = p.OwnerUserId AND (LOWER(u.Location) LIKE '%brazil%' OR LOWER(u.Location) LIKE '%b... | sede |
CREATE TABLE table_name_13 (
title VARCHAR,
original_air_date VARCHAR
) | What title aired on March 19, 1998? | SELECT title FROM table_name_13 WHERE original_air_date = "march 19, 1998" | sql_create_context |
CREATE TABLE table_53292 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | When was there a game at Arden Street Oval? | SELECT "Date" FROM table_53292 WHERE "Venue" = 'arden street oval' | wikisql |
CREATE TABLE table_name_60 (
opponents VARCHAR,
score VARCHAR
) | Which Opponents has a Score of 6 3, 6 4, 6 1? | SELECT opponents FROM table_name_60 WHERE score = "6–3, 6–4, 6–1" | sql_create_context |
CREATE TABLE table_16458 (
"No. in season" real,
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
) | Who directed an episode that had 2.81 million U.S. viewers? | SELECT "Directed by" FROM table_16458 WHERE "U.S. viewers (million)" = '2.81' | wikisql |
CREATE TABLE buildings (
id int,
name text,
City text,
Height int,
Stories int,
Status text
)
CREATE TABLE Office_locations (
building_id int,
company_id int,
move_in_year int
)
CREATE TABLE Companies (
id int,
name text,
Headquarters text,
Industry text,
Sales_... | compare the number of companies from different industries using a pie chart. | SELECT Industry, COUNT(*) FROM Companies GROUP BY Industry | nvbench |
CREATE TABLE table_43605 (
"Outcome" text,
"Date" text,
"Championship" text,
"Surface" text,
"Opponent" text,
"Score" text
) | what is the outcome when the surface is grass on 23 june 1997? | SELECT "Outcome" FROM table_43605 WHERE "Surface" = 'grass' AND "Date" = '23 june 1997' | wikisql |
CREATE TABLE table_46088 (
"Year" real,
"Dates" text,
"Champion" text,
"Country" text,
"Winning score" text,
"To par" text,
"Margin of victory" text,
"Tournament location" text,
"Purse ( $ )" text,
"Winner's share ($)" text
) | What tournament location has 1 stroke as the margin of victory, with 1,200,000 as the purse ($)? | SELECT "Tournament location" FROM table_46088 WHERE "Margin of victory" = '1 stroke' AND "Purse ( $ )" = '1,200,000' | wikisql |
CREATE TABLE table_49658 (
"Team" text,
"Coach" text,
"Home Ground" text,
"Location" text,
"Founded" real
) | Who is the coach for the Adelaide Galaxy team? | SELECT "Coach" FROM table_49658 WHERE "Team" = 'adelaide galaxy' | wikisql |
CREATE TABLE Product_Suppliers (
product_id INTEGER,
supplier_id INTEGER,
date_supplied_from DATETIME,
date_supplied_to DATETIME,
total_amount_purchased VARCHAR(80),
total_value_purchased DECIMAL(19,4)
)
CREATE TABLE Supplier_Addresses (
supplier_id INTEGER,
address_id INTEGER,
date... | How many customers use each payment method, and could you sort by the bars from high to low? | SELECT payment_method_code, COUNT(*) FROM Customers GROUP BY payment_method_code ORDER BY payment_method_code DESC | nvbench |
CREATE TABLE table_name_68 (
d_43 VARCHAR,
d_46 VARCHAR
) | What is the D 43 when D 46 is R 6? | SELECT d_43 FROM table_name_68 WHERE d_46 = "r 6" | sql_create_context |
CREATE TABLE table_33767 (
"Chapter" text,
"Chartered" text,
"School" text,
"State" text,
"Status" text,
"Charter Range" text
) | What are the active dates for the Montana State University chapter? | SELECT "Charter Range" FROM table_33767 WHERE "School" = 'montana state university' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime t... | how many days has it been since patient 92846 first adrenal hypofunction nec diagnosis in their current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'adrenal hypofunction nec') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM adm... | mimic_iii |
CREATE TABLE table_name_23 (
track VARCHAR,
time VARCHAR
) | What track has a time of 2:30? | SELECT track FROM table_name_23 WHERE time = "2:30" | sql_create_context |
CREATE TABLE table_name_20 (
rank INTEGER,
lane VARCHAR
) | What is the highest rank of a swimmer in lane 5? | SELECT MAX(rank) FROM table_name_20 WHERE lane = 5 | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_nam... | when was the last time patient 90663 had a foley output today. | SELECT outputevents.charttime FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 90663)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'fole... | mimic_iii |
CREATE TABLE table_20610 (
"Year" text,
"Stamp duty reserve tax" text,
"Standard Stamp Duty" text,
"Standard Duties Total Revenue (in \u20acmillion)" real,
"over Total Tax Revenue (in %)" text,
"over GDP (in %)" text
) | When the standard stamp duty is 367 what is the percentage over gdp? | SELECT "over GDP (in %)" FROM table_20610 WHERE "Standard Stamp Duty" = '367' | wikisql |
CREATE TABLE table_name_81 (
_number_of_candidates INTEGER,
general_election VARCHAR,
result VARCHAR,
_number_of_seats_won VARCHAR
) | What is the # of candidates of liberal majority with 51 wins and larger number of 2008 in general elections? | SELECT AVG(_number_of_candidates) FROM table_name_81 WHERE result = "liberal majority" AND _number_of_seats_won = 51 AND general_election > 2008 | sql_create_context |
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 allergy (
allergy... | what is the number of hours since patient 021-80293 first received the cultures - sputum on their current hospital encounter? | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', treatment.treatmenttime)) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-80293... | eicu |
CREATE TABLE table_name_79 (
away_team VARCHAR,
date VARCHAR,
home_team VARCHAR
) | Who was the Away team that played at Carlton on 11 June 1966? | SELECT away_team FROM table_name_79 WHERE date = "11 june 1966" AND home_team = "carlton" | sql_create_context |
CREATE TABLE table_dev_17 (
"id" int,
"gender" string,
"white_blood_cell_count_wbc" int,
"hemoglobin_a1c_hba1c" float,
"cd4_count" int,
"dyslipidemia" bool,
"renal_disease" bool,
"fasting_blood_glucose_fbg" float,
"creatinine_clearance_cl" float,
"platelet_count" float,
"high... | history of smoking | SELECT * FROM table_dev_17 WHERE smoking = 1 | criteria2sql |
CREATE TABLE table_name_48 (
race VARCHAR,
course VARCHAR,
jockey VARCHAR,
margin VARCHAR
) | what is the race when the jockey is frankie dettori, the margin is more than 3 and the course is yarmouth? | SELECT race FROM table_name_48 WHERE jockey = "frankie dettori" AND margin > 3 AND course = "yarmouth" | sql_create_context |
CREATE TABLE table_67480 (
"Name" text,
"Discovered" real,
"Museum" text,
"Museum city" text,
"Discoverer" text,
"Formation" text,
"Location" text
) | What is the name of the specimen that was discovered after 1987 and is in an Indianapolis, Indiana museum? | SELECT "Name" FROM table_67480 WHERE "Discovered" > '1987' AND "Museum city" = 'indianapolis, in' | wikisql |
CREATE TABLE table_name_72 (
away_team VARCHAR,
venue VARCHAR
) | What is the away team for the game at Windy Hill? | SELECT away_team FROM table_name_72 WHERE venue = "windy hill" | sql_create_context |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 能不能告诉我患者施志业在医疗记录中药品消费在1613.81元以上的医疗就诊有哪几次?医疗就诊的编号是多少 | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_NM = '施志业' AND NOT t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT <= 1613.81) | css |
CREATE TABLE table_11126 (
"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 when there was a game at Junction Oval? | SELECT SUM("Crowd") FROM table_11126 WHERE "Venue" = 'junction oval' | wikisql |
CREATE TABLE table_name_2 (
home_team VARCHAR,
venue VARCHAR
) | What team plays at home at Lake Oval? | SELECT home_team FROM table_name_2 WHERE venue = "lake oval" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.