context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | Which teacher gives the class EPID 709 ? | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EPID' AND course.number = 709 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offering.o... | advising |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE patient (
unique... | count the number of people who were prescribed heparin sod (porcine) within 2 months following a diagnosis of hypothyroidism. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'hypothyroidism') AS t1 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient... | eicu |
CREATE TABLE table_37740 (
"Name" text,
"Hanzi" text,
"Language" text,
"Launch" real,
"Owner" text
) | Which hanzi's name is nmtv mongolian satellite television? | SELECT "Hanzi" FROM table_37740 WHERE "Name" = 'nmtv mongolian satellite television' | wikisql |
CREATE TABLE table_name_69 (
terrain VARCHAR,
stage VARCHAR
) | What was the terrain for stage 10 of the tour? | SELECT terrain FROM table_name_69 WHERE stage = "10" | sql_create_context |
CREATE TABLE book (
book_id number,
title text,
issues number,
writer text
)
CREATE TABLE publication (
publication_id number,
book_id number,
publisher text,
publication_date text,
price number
) | What are the dates of publications in descending order of price? | SELECT publication_date FROM publication ORDER BY price DESC | spider |
CREATE TABLE table_name_80 (
game VARCHAR,
location VARCHAR,
date VARCHAR
) | What Game has a Location of Philadelphia Spectrum and a Date of April 1? | SELECT game FROM table_name_80 WHERE location = "philadelphia spectrum" AND date = "april 1" | sql_create_context |
CREATE TABLE table_69905 (
"Kanji" text,
"Name" text,
"Builder" text,
"Laid down" text,
"Launched" text,
"Completed" text
) | What is the launch date of ? | SELECT "Launched" FROM table_69905 WHERE "Kanji" = '栗' | wikisql |
CREATE TABLE table_name_85 (
Id VARCHAR
) | Name the total number of 2010 for when 2009 is less than 14, 2008 is less than 15 and 2005 is 3 | SELECT COUNT(2010) FROM table_name_85 WHERE 2009 < 14 AND 2008 < 15 AND 2005 = 3 | sql_create_context |
CREATE TABLE table_26703 (
"Major version" text,
"Minor version" text,
"WebKit version" text,
"Operating System" text,
"Release date" text,
"Features" text
) | What was the major version when the webkit version was 528.17? | SELECT "Major version" FROM table_26703 WHERE "WebKit version" = '528.17' | 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 procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | provide the number of patients taking base type drug medication who were hospitalized for more than 2 days. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "2" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE table_1140113_5 (
report VARCHAR,
winning_driver VARCHAR
) | What was the report of Mike Hawthorn's winning race? | SELECT report FROM table_1140113_5 WHERE winning_driver = "Mike Hawthorn" | 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... | 号码33992574为团队成员最常开的药品排序是什么样的? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '33992574' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC UNION SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.ME... | css |
CREATE TABLE table_21258_1 (
crude_death_rate VARCHAR,
deaths VARCHAR
) | Among deaths 106 000 how many is crude rate. | SELECT crude_death_rate FROM table_21258_1 WHERE deaths = "106 000" | sql_create_context |
CREATE TABLE table_51833 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Event" text,
"Notes" text
) | Which venue had a note of 3:34.88 after 2003? | SELECT "Venue" FROM table_51833 WHERE "Year" > '2003' AND "Notes" = '3:34.88' | wikisql |
CREATE TABLE table_27537518_6 (
location VARCHAR,
attendance VARCHAR
) | Where was the game seen by 10056 people played? | SELECT location FROM table_27537518_6 WHERE attendance = 10056 | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE a... | since 65 months ago, when patient 007-9626 was prescribed for the last time a drug? | SELECT medication.drugstarttime FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-9626')) AND DATETIME(medication.drugstarttime) >= DATETIME... | eicu |
CREATE TABLE reservations (
code number,
room text,
checkin text,
checkout text,
rate number,
lastname text,
firstname text,
adults number,
kids number
)
CREATE TABLE rooms (
roomid text,
roomname text,
beds number,
bedtype text,
maxoccupancy number,
basepric... | Which rooms cost between 120 and 150? Give me the room names. | SELECT roomname FROM rooms WHERE baseprice BETWEEN 120 AND 150 | spider |
CREATE TABLE table_18443 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
) | What is the earliest year that a candidate was first elected? | SELECT MIN("First elected") FROM table_18443 | 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... | 开塞露(含甘油)在医疗就诊81908180508中的医疗机构三大目录编码是什么?名称是什么? | SELECT t_kc22.MED_DIRE_CD, t_kc22.MED_DIRE_NM 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 = '81908180508' AND t_kc22.SOC_SRT_DIRE_NM = '开塞露(含甘油)' | css |
CREATE TABLE people (
Weight VARCHAR,
People_ID VARCHAR
)
CREATE TABLE entrepreneur (
People_ID VARCHAR,
Money_Requested VARCHAR
) | What are the weights of entrepreneurs in descending order of money requested? | SELECT T2.Weight FROM entrepreneur AS T1 JOIN people AS T2 ON T1.People_ID = T2.People_ID ORDER BY T1.Money_Requested DESC | sql_create_context |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREA... | how many days has it been since the last time patient 004-79017 stayed in ward 185 during the current hospital encounter. | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '004-79017' AND patient.wardid = 185 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime DESC LIMIT 1 | eicu |
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... | 医院3003256所有医疗记录的个人账户支出与医疗费总额是多大平均比值,在2011-07-03到2013-04-26内? | SELECT AVG(t_kc24.PER_ACC_PAY) FROM qtb JOIN t_kc24 ON qtb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE qtb.MED_SER_ORG_NO = '3003256' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2011-07-03' AND '2013-04-26' UNION SELECT AVG(t_kc24.PER_ACC_PAY) FROM gyb JOIN t_kc24 ON gyb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE gyb.MED_SER_OR... | css |
CREATE TABLE table_204_700 (
id number,
"name" text,
"developer" text,
"release" text,
"type" text,
"game flow" text,
"setting" text
) | in what year was twilight heroes released ? | SELECT "release" FROM table_204_700 WHERE "name" = 'twilight heroes' | squall |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE month (
month_number int,
month_name text
)
CREATE TABLE... | what about the EA flights arriving in PITTSBURGH between 1200 and 1600 in the afternoon | SELECT DISTINCT flight.flight_id FROM airport_service, city, flight WHERE ((flight.arrival_time <= 1600 AND flight.arrival_time >= 1200) AND city.city_code = airport_service.city_code AND city.city_name = 'PITTSBURGH' AND flight.to_airport = airport_service.airport_code) AND flight.airline_code = 'EA' | atis |
CREATE TABLE table_name_52 (
score VARCHAR,
date VARCHAR
) | What was the score on September 8? | SELECT score FROM table_name_52 WHERE date = "september 8" | sql_create_context |
CREATE TABLE table_15869204_6 (
score VARCHAR,
game VARCHAR
) | WHAT WAS THE SCORE FOR GAME 31? | SELECT score FROM table_15869204_6 WHERE game = 31 | sql_create_context |
CREATE TABLE procedures_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,
... | how much should patient 16904 have to pay for their stay at the hospital when they came to the hospital last time? | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16904 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) | mimic_iii |
CREATE TABLE table_41763 (
"Lane" real,
"Name" text,
"Country" text,
"Mark" text,
"React" real
) | What is the mark for Kim Collins? | SELECT "Mark" FROM table_41763 WHERE "Name" = 'kim collins' | wikisql |
CREATE TABLE table_32464 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Where was the game when Collingwood was the home team? | SELECT "Venue" FROM table_32464 WHERE "Away team" = 'collingwood' | wikisql |
CREATE TABLE field (
fieldid int
)
CREATE TABLE paperfield (
fieldid int,
paperid int
)
CREATE TABLE journal (
journalid int,
journalname varchar
)
CREATE TABLE paperkeyphrase (
paperid int,
keyphraseid int
)
CREATE TABLE keyphrase (
keyphraseid int,
keyphrasename varchar
)
CREA... | what papers are typically cited by tom mitchell and oren etzioni | SELECT DISTINCT author.authorname, cite.citedpaperid, COUNT(cite.citedpaperid) FROM author, cite, paper, writes WHERE author.authorname IN ('tom mitchell', 'oren etzioni') AND paper.paperid = cite.citedpaperid AND writes.authorid = author.authorid AND writes.paperid = paper.paperid GROUP BY cite.citedpaperid, author.au... | scholar |
CREATE TABLE Rating (
rID int,
mID int,
stars int,
ratingDate date
)
CREATE TABLE Movie (
mID int,
title text,
year int,
director text
)
CREATE TABLE Reviewer (
rID int,
name text
) | What are the titles of all movies that have between 3 and 5 stars, and count them by a bar chart, and display X-axis in ascending order. | SELECT title, COUNT(title) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID WHERE T1.stars BETWEEN 3 AND 5 GROUP BY title ORDER BY title | nvbench |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE intakeoutput (
... | what is the five most frequent drugs that were prescribed in the same month to the patients in the same age 30s after they had been diagnosed with myopathy, until 2103? | 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 = 'myopathy' AND STRFTIME('%y', diagnosis.diagnosisti... | eicu |
CREATE TABLE table_name_67 (
rounds VARCHAR,
team VARCHAR,
rider VARCHAR
) | What is the rounds of rider Mika Kallio 1 of the Ducati Marlboro team? | SELECT rounds FROM table_name_67 WHERE team = "ducati marlboro team" AND rider = "mika kallio 1" | sql_create_context |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Participates_in (
stuid INTEGER,
actid INTEGER
)
CREATE TABLE Faculty_Participates_in (
FacID IN... | Show me a bar chart for how many students are advised by each rank of faculty? List the rank and the number of students, list by the names in asc. | SELECT Rank, COUNT(*) FROM Faculty AS T1 JOIN Student AS T2 ON T1.FacID = T2.Advisor GROUP BY T1.Rank ORDER BY Rank | nvbench |
CREATE TABLE table_name_17 (
time VARCHAR,
event VARCHAR,
venue VARCHAR
) | What's the Time for an Event of 4x100 m relay and has a Venue of Frankfurt? | SELECT time FROM table_name_17 WHERE event = "4x100 m relay" AND venue = "frankfurt" | 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... | give me the number of female patients primarily suffering from congestive heart failure. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "F" AND demographic.diagnosis = "CONGESTIVE HEART FAILURE" | mimicsql_data |
CREATE TABLE table_25008327_8 (
slovak VARCHAR,
ukrainian VARCHAR
) | What area all values for Slovak when value for Ukranian is , ? | SELECT slovak FROM table_25008327_8 WHERE ukrainian = "пес, собака" | sql_create_context |
CREATE TABLE table_30380 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real
) | Who wrote the episode titled 'man talk'? | SELECT "Written by" FROM table_30380 WHERE "Title" = 'Man Talk' | 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... | 患者58997444在二00五年七月十四日到二0一四年三月十三日期间,最常找的医生是哪位 | SELECT gwyjzb.OUT_DIAG_DOC_CD, gwyjzb.OUT_DIAG_DOC_NM FROM gwyjzb WHERE gwyjzb.PERSON_ID = '58997444' AND gwyjzb.IN_HOSP_DATE BETWEEN '2005-07-14' AND '2014-03-13' GROUP BY gwyjzb.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.OUT_DIAG_DOC_CD, fgwyjzb.OUT_DIAG_DOC_NM FROM fgwyjzb WHERE fgwyjzb.PERS... | css |
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... | Show me a bar chart for what are the department names and how many employees work in each of them?, could you list in asc by the bars? | SELECT DEPARTMENT_NAME, COUNT(*) FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID GROUP BY DEPARTMENT_NAME ORDER BY DEPARTMENT_NAME | nvbench |
CREATE TABLE table_2623 (
"Name" text,
"#" real,
"Position" text,
"Height" text,
"Weight" real,
"Year" text,
"Home Town" text,
"High School" text
) | Which highschool has senior (rs) for the year? | SELECT "High School" FROM table_2623 WHERE "Year" = 'Senior (RS)' | 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... | 科室31515因疾病W23.015产生的住院平均费用有多少在2008年6月11日至2013年3月29日之间? | SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_CD = '31515' AND gwyjzb.IN_HOSP_DATE BETWEEN '2008-06-11' AND '2013-03-29' AND gwyjzb.IN_DIAG_DIS_CD = 'W23.015' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_CD = '31515' AND fgwyjzb.IN_HOSP_D... | css |
CREATE TABLE table_30493 (
"Name" text,
"Corporate name" text,
"Regional district" text,
"Incorporation date (city)" text,
"Population (2011)" real,
"Population (2006)" real,
"Change (%)" text,
"Area (km\u00b2)" text,
"Population density" text
) | What is the area of the corporation named the powell river, the corporation of the city of? | SELECT "Area (km\u00b2)" FROM table_30493 WHERE "Corporate name" = 'Powell River, The Corporation of the City of' | wikisql |
CREATE TABLE table_55887 (
"Software" text,
"Latest stable date (version)" text,
"Cost ( USD )" text,
"Open source" text,
"License" text
) | Name the cost for latest stable date of online | SELECT "Cost ( USD )" FROM table_55887 WHERE "Latest stable date (version)" = 'online' | wikisql |
CREATE TABLE table_name_75 (
margin_of_victory VARCHAR,
date VARCHAR
) | What is the margin of victory of the tournament on 5 Jun 1988? | SELECT margin_of_victory FROM table_name_75 WHERE date = "5 jun 1988" | sql_create_context |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 在18年9月23日到2021年10月29日内病患93673084的有多少检验结果指标记录的检测人为窦虹雨的检验指标流水号? | SELECT jyjgzbb.JYZBLSH FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM A... | css |
CREATE TABLE table_67676 (
"Position" real,
"Club" text,
"Played" real,
"Points" text,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | Which average wins have a Club of barcelona atl tic, and Goals for larger than 56? | SELECT AVG("Wins") FROM table_67676 WHERE "Club" = 'barcelona atlètic' AND "Goals for" > '56' | wikisql |
CREATE TABLE table_25149 (
"Year" real,
"Championship" text,
"54 holes" text,
"Winning score" text,
"Margin" text,
"Runner(s)-up" text
) | Name the winning score for pga championship | SELECT "Winning score" FROM table_25149 WHERE "Championship" = 'PGA Championship' | wikisql |
CREATE TABLE table_42053 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | What is the lowest drawn that has a played greater than 19, with a position less than 2? | SELECT MIN("Drawn") FROM table_42053 WHERE "Played" > '19' AND "Position" < '2' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic ... | Count the number of divorce patients who belong to a black/cape verdean ethnic background. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.ethnicity = "BLACK/CAPE VERDEAN" | mimicsql_data |
CREATE TABLE table_28079 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | Who was the director for episodes that were written be Matthew Lau? | SELECT "Directed by" FROM table_28079 WHERE "Written by" = 'Matthew Lau' | wikisql |
CREATE TABLE table_28994 (
"Dibrugarh" text,
"Kanyakumari" text,
"Vivek Express /15905/15906" text,
"Indian Railways" text,
"4286km" text,
"55" real,
"Weekly" text,
"82.30 hrs(~3.5 days)" text
) | How long does the 2579km route take? | SELECT "82.30 hrs(~3.5 days)" FROM table_28994 WHERE "4286km" = '2579km' | wikisql |
CREATE TABLE table_25310 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Cowboys points" real,
"Opponents" real,
"Record" text
) | How many opponents have a 1-0 record against the Cowboys? | SELECT "Opponents" FROM table_25310 WHERE "Record" = '1-0' | 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 was hired before 2002-06-21, visualize a bar chart about the distribution of hire_date and the sum of salary bin hire_date by time, and order by the y-axis from low to high please. | SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(SALARY) | nvbench |
CREATE TABLE table_name_17 (
language VARCHAR,
book_title VARCHAR
) | What language is the book Miss Macintosh, My Darling in? | SELECT language FROM table_name_17 WHERE book_title = "miss macintosh, my darling" | sql_create_context |
CREATE TABLE table_9968 (
"Type" text,
"Year" real,
"Block" text,
"Displacement" text,
"Mainly For" text
) | What type is the 105/107e Block from a year prior to 1960? | SELECT "Type" FROM table_9968 WHERE "Block" = '105/107e' AND "Year" < '1960' | wikisql |
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, visualize a bar chart about the distribution of name and the average of code , and group by attribute name. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name | nvbench |
CREATE TABLE table_69030 (
"Riding" text,
"Candidate's Name" text,
"Gender" text,
"Residence" text,
"Occupation" text,
"Votes" real,
"Rank" text
) | Which Gender has a Residence of Haliburton? | SELECT "Gender" FROM table_69030 WHERE "Residence" = 'haliburton' | wikisql |
CREATE TABLE table_name_8 (
laps INTEGER,
team VARCHAR,
points VARCHAR
) | What is the sum of lap for the Dale Coyne Racing Team, and 0 points? | SELECT SUM(laps) FROM table_name_8 WHERE team = "dale coyne racing" AND points = 0 | sql_create_context |
CREATE TABLE table_train_106 (
"id" int,
"gender" string,
"pregnancy_or_lactation" bool,
"mini_mental_state_examination_mmse" int,
"uncontrolled_diabetes" bool,
"blood_glucose" int,
"rosen_modified_hachinski_ischemic_score" int,
"body_mass_index_bmi" float,
"age" float,
"NOUSE" f... | mmse score of 16 _ 26 inclusive. | SELECT * FROM table_train_106 WHERE mini_mental_state_examination_mmse >= 16 AND mini_mental_state_examination_mmse <= 26 | criteria2sql |
CREATE TABLE table_name_65 (
home_team VARCHAR,
away_team VARCHAR
) | What was the home team score with an away team of Melbourne? | SELECT home_team AS score FROM table_name_65 WHERE away_team = "melbourne" | sql_create_context |
CREATE TABLE table_name_77 (
name_of_horse VARCHAR,
year_inducted VARCHAR,
broodmare_sire VARCHAR
) | What horse was induced in 2011 with a sire of cowboy p-12? | SELECT name_of_horse FROM table_name_77 WHERE year_inducted = 2011 AND broodmare_sire = "cowboy p-12" | sql_create_context |
CREATE TABLE Settlements (
Settlement_ID INTEGER,
Claim_ID INTEGER,
Date_Claim_Made DATE,
Date_Claim_Settled DATE,
Amount_Claimed INTEGER,
Amount_Settled INTEGER,
Customer_Policy_ID INTEGER
)
CREATE TABLE Customers (
Customer_ID INTEGER,
Customer_Details VARCHAR(255)
)
CREATE TABLE... | Calculate the average amount for all the payments processed with Visa of each day of week using a bar chart, rank y-axis in descending order. | SELECT Date_Payment_Made, AVG(Amount_Payment) FROM Payments WHERE Payment_Method_Code = 'Visa' ORDER BY AVG(Amount_Payment) DESC | nvbench |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | when was patient 027-5581's last diagnosis time a year before for cardiac arrest - un-witnessed? | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-5581')) AND diagnosis.diagnosisname = 'cardiac arrest - un-wi... | eicu |
CREATE TABLE table_name_29 (
start INTEGER,
pens VARCHAR,
conv VARCHAR,
tries VARCHAR
) | What is the largest start for a player with 14 conv, 10 tries and more than 22 pens? | SELECT MAX(start) FROM table_name_29 WHERE conv = 14 AND tries = 10 AND pens > 22 | sql_create_context |
CREATE TABLE table_204_78 (
id number,
"no." number,
"train no." text,
"origin" text,
"destination" text,
"train name" text
) | tell me the number of trains headed for jolarpet junction . | SELECT COUNT("train name") FROM table_204_78 WHERE "destination" = 'jolarpet junction' | squall |
CREATE TABLE table_1140067_2 (
date VARCHAR,
race VARCHAR
) | What was the date for monaco grand prix? | SELECT date FROM table_1140067_2 WHERE race = "Monaco Grand Prix" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | how many patients whose admission location is transfer from hosp/extram and procedure icd9 code is 40? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "TRANSFER FROM HOSP/EXTRAM" AND procedures.icd9_code = "40" | mimicsql_data |
CREATE TABLE table_44571 (
"Skip" text,
"Third" text,
"Second" text,
"Lead" text,
"City" text
) | WHAT IS THE SKIP WITH A THIRD OF DEANNA DOIG? | SELECT "Skip" FROM table_44571 WHERE "Third" = 'deanna doig' | wikisql |
CREATE TABLE table_name_23 (
started VARCHAR,
end_source VARCHAR,
country VARCHAR,
loan_club VARCHAR
) | When was the loan started when the coutry is eng, the loan club is sunderland and the end source is south wales echo? | SELECT started FROM table_name_23 WHERE country = "eng" AND loan_club = "sunderland" AND end_source = "south wales echo" | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE PostFeedback (
Id number,
PostId numb... | Select Top in Union test. | WITH S AS (SELECT 1 AS "index" UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6) SELECT 1 AS "order", 'index' FROM S WHERE 2 * ('index' / 2) = 'index' LIMIT 2 UNION ALL SELECT 2 AS "order", 'index' FROM S WHERE 3 * ('index' / 3) = 'index' ORDER BY 'order', 'index' LIMIT 2 | sede |
CREATE TABLE postseason (
year INTEGER,
round TEXT,
team_id_winner TEXT,
league_id_winner TEXT,
team_id_loser TEXT,
league_id_loser TEXT,
wins INTEGER,
losses INTEGER,
ties INTEGER
)
CREATE TABLE salary (
year INTEGER,
team_id TEXT,
league_id TEXT,
player_id TEXT,
... | Visualize the general trend of how many year over the year, and display X-axis in descending order. | SELECT year, COUNT(year) FROM home_game ORDER BY year DESC | nvbench |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | What is the total number of each ship type? Give me a bar chart. | SELECT Type, COUNT(Type) FROM ship GROUP BY Type | nvbench |
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
)
... | give me the number of patients whose religion is episcopalian and lab test name is phosphate? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "EPISCOPALIAN" AND lab.label = "Phosphate" | mimicsql_data |
CREATE TABLE table_name_84 (
score VARCHAR,
opponent VARCHAR,
record VARCHAR
) | Which Score has an Opponent of @ la lakers, and a Record of 8-6? | SELECT score FROM table_name_84 WHERE opponent = "@ la lakers" AND record = "8-6" | sql_create_context |
CREATE TABLE player (
Player_ID int,
Player text,
Years_Played text,
Total_WL text,
Singles_WL text,
Doubles_WL text,
Team int
)
CREATE TABLE country (
Country_id int,
Country_name text,
Capital text,
Official_native_language text
)
CREATE TABLE match_season (
Season re... | Return a bar chart on how many players played each position?, show the total number in asc order. | SELECT Position, COUNT(*) FROM match_season GROUP BY Position ORDER BY COUNT(*) | nvbench |
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 procedure short title of procedure icd9 code 92? | SELECT procedures.short_title FROM procedures WHERE procedures.icd9_code = "92" | mimicsql_data |
CREATE TABLE table_name_98 (
league_goals INTEGER,
name VARCHAR,
league_cup_apps VARCHAR,
fa_cup_goals VARCHAR,
position VARCHAR
) | What is the League Goals when the FA Cup Goals are 0, position is mf, League Cup Apps of 0, and name is Ben Thornley? | SELECT AVG(league_goals) FROM table_name_98 WHERE fa_cup_goals = "0" AND position = "mf" AND league_cup_apps = "0" AND name = "ben thornley" | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational... | Tell me the prerequisites for BIOMEDE 530 and 241 . | SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE (COURSE_1.number = 530 OR COURSE_1.number = 241) AND COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.depar... | advising |
CREATE TABLE table_204_644 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"record" text,
"game site" text,
"bye" text
) | which game had a larger gap in score between the two teams , week 9 or week 11 ? | SELECT "week" FROM table_204_644 WHERE "week" IN (9, 11) ORDER BY ABS("result" - "result") DESC LIMIT 1 | squall |
CREATE TABLE table_31427 (
"Prefix class" text,
"Type and usage" text,
"Example" text,
"Equivalent" text,
"Reference" text
) | What is every example for the equivalent of NTE160? | SELECT "Example" FROM table_31427 WHERE "Equivalent" = 'NTE160' | wikisql |
CREATE TABLE table_name_21 (
date VARCHAR,
home VARCHAR,
visitor VARCHAR
) | What is the date of the match when Detroit is the home team and Colorado is the visiting team? | SELECT date FROM table_name_21 WHERE home = "detroit" AND visitor = "colorado" | 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... | how many patients are diagnosed with unspecified problem with head, neck, or trunk and treated with base drug type? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Unspecified problem with head, neck, or trunk" AND prescriptions.drug_type = "BASE" | mimicsql_data |
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... | 姓名叫魏正雅的参保人在2011年2月1日到2018年3月19日内她的门诊检查费用一共有多少? | SELECT SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '魏正雅' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2011-02-01' AND '2018-03-19' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
a... | i'd like a flight tomorrow late from NASHVILLE to HOUSTON with DINNER please | 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, food_service WHERE (((((flight.departure_time <= 2400 AND flight.departure_time >= 2000) AND date_day.day_number = 20 AND date_day.month_number = 1 AN... | atis |
CREATE TABLE table_name_50 (
result VARCHAR,
week VARCHAR
) | What was the result for week 2? | SELECT result FROM table_name_50 WHERE week = 2 | sql_create_context |
CREATE TABLE table_22824319_3 (
rebounds INTEGER,
player VARCHAR
) | Name the most rebounds for larry smith | SELECT MAX(rebounds) FROM table_22824319_3 WHERE player = "Larry Smith" | sql_create_context |
CREATE TABLE table_46918 (
"County" text,
"Tunnel" text,
"Type" text,
"Length (Imperial)" text,
"Date of opening" text
) | What Tunnel has an Imperial Length of 307 yd? | SELECT "Tunnel" FROM table_46918 WHERE "Length (Imperial)" = '307 yd' | wikisql |
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerUserId number,
AutoRenameCount number,
LastAutoRename time,
Score number,
ApprovedByUserId number,
ApprovalDate time
)
CREATE TABLE PostHistory (
Id number,
PostHistoryT... | Custom Off Topic close reasons. | SELECT * FROM CloseAsOffTopicReasonTypes WHERE DeactivationDate IS NULL | sede |
CREATE TABLE ship (
Ship_ID int,
Name text,
Type text,
Nationality text,
Tonnage int
)
CREATE TABLE mission (
Mission_ID int,
Ship_ID int,
Code text,
Launched_Year int,
Location text,
Speed_knots int,
Fate text
) | Show different types of ships and the number of ships of each type. Show a pie chart. | SELECT Type, COUNT(*) FROM ship GROUP BY Type | nvbench |
CREATE TABLE table_76212 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Gross" text
) | What is Title, when Studio is 'Embassy Pictures'? | SELECT "Title" FROM table_76212 WHERE "Studio" = 'embassy pictures' | wikisql |
CREATE TABLE table_61038 (
"Date" text,
"Name" text,
"Nationality" text,
"Tonnage (GRT)" real,
"Fate" text
) | How much tonnage Tonnage (GRT) has a Nationality of united kingdom, and a Date of 27 june 1941? | SELECT COUNT("Tonnage (GRT)") FROM table_61038 WHERE "Nationality" = 'united kingdom' AND "Date" = '27 june 1941' | wikisql |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
) | For those products with a price between 60 and 120, return a bar chart about the distribution of name and manufacturer , and display by the Name in desc. | SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Name DESC | nvbench |
CREATE TABLE Fault_Log_Parts (
fault_log_entry_id INTEGER,
part_fault_id INTEGER,
fault_status VARCHAR(10)
)
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_... | How many engineers does each staff contact? Show a bar chart, rank in ascending by the staff_name. | SELECT staff_name, COUNT(staff_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY staff_name ORDER BY staff_name | nvbench |
CREATE TABLE table_203_654 (
id number,
"position" number,
"team" text,
"points" number,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"for" number,
"against" number,
"difference" number
) | which team was the top scoring team ? | SELECT "team" FROM table_203_654 ORDER BY "points" DESC LIMIT 1 | squall |
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 headquarter and the average of code , and group by attribute headquarter, and visualize them by a bar chart, order by the x axis in desc please. | SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T2.Headquarter DESC | nvbench |
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... | Show me the number of patients born before 2120 who were ordered a pleural fluid lab test. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2120" AND lab.fluid = "Pleural" | mimicsql_data |
CREATE TABLE Ref_budget_codes (
budget_type_code VARCHAR,
budget_type_description VARCHAR
) | List all budget type codes and descriptions. | SELECT budget_type_code, budget_type_description FROM Ref_budget_codes | sql_create_context |
CREATE TABLE table_12896 (
"Outcome" text,
"Date" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score in the final" text
) | What was the outcome on 11 October 2009, when his partner was Jordan Kerr? | SELECT "Outcome" FROM table_12896 WHERE "Partner" = 'jordan kerr' AND "Date" = '11 october 2009' | wikisql |
CREATE TABLE table_29384 (
"Player" text,
"Team" text,
"Matches" real,
"Overs" text,
"Wickets" real,
"Average" text,
"Economy" text,
"BBI" text,
"4wi" real,
"5wi" real
) | What is the 4wi when the economy is 7.82? | SELECT "4wi" FROM table_29384 WHERE "Economy" = '7.82' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.