context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_name_78 (
points INTEGER,
entrant VARCHAR
) | Which Entrant of stp march engineering scored the lowest points? | SELECT MIN(points) FROM table_name_78 WHERE entrant = "stp march engineering" | sql_create_context |
CREATE TABLE table_6192 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" text
) | When Venue of A has Attendance of 4,365? | SELECT "Date" FROM table_6192 WHERE "Venue" = 'a' AND "Attendance" = '4,365' | wikisql |
CREATE TABLE table_34928 (
"Year" real,
"Award" text,
"Nominated work" text,
"Category" text,
"Result" text
) | What award has breakthrough performance as the category? | SELECT "Award" FROM table_34928 WHERE "Category" = 'breakthrough performance' | wikisql |
CREATE TABLE table_name_31 (
total_tenure_time VARCHAR,
name VARCHAR,
uninterrupted_rank VARCHAR,
total_tenure_rank VARCHAR
) | What is the total tenure time of Warren Magnuson, who had an uninterrupted rank larger than 4 and a total tenure rank larger than 9? | SELECT total_tenure_time FROM table_name_31 WHERE uninterrupted_rank > 4 AND total_tenure_rank > 9 AND name = "warren magnuson" | sql_create_context |
CREATE TABLE table_23449363_1 (
round VARCHAR,
clubs_involved VARCHAR
) | Which rounds had 32 clubs involved? | SELECT round FROM table_23449363_1 WHERE clubs_involved = 32 | sql_create_context |
CREATE TABLE diagnoses (
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 demographic (... | count the number of patients whose days of hospital stay is greater than 29 and procedure icd9 code is 5091? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "29" AND procedures.icd9_code = "5091" | mimicsql_data |
CREATE TABLE table_71697 (
"Builder" text,
"Model" text,
"Length (ft/m)" text,
"Order Year" text,
"Fuel Propulsion" text,
"Fleet Series (Quantity)" text
) | Which Fleet Series (Quantity) that has a Builder of mci, and an Order Year of 2002? | SELECT "Fleet Series (Quantity)" FROM table_71697 WHERE "Builder" = 'mci' AND "Order Year" = '2002' | wikisql |
CREATE TABLE table_name_40 (
finals_goals INTEGER,
total_goals INTEGER
) | What is the Average Finals Goals if the Total Goals is less than 1? | SELECT AVG(finals_goals) FROM table_name_40 WHERE total_goals < 1 | sql_create_context |
CREATE TABLE table_68332 (
"Sydney" text,
"Melbourne" text,
"Perth" text,
"Adelaide" text,
"Gold Coast" text,
"Auckland" text
) | Which Syndney's Gold coast, Adelaide, Melbourne, and Auckland were all no? | SELECT "Sydney" FROM table_68332 WHERE "Gold Coast" = 'no' AND "Adelaide" = 'no' AND "Melbourne" = 'no' AND "Auckland" = 'no' | wikisql |
CREATE TABLE table_5512 (
"RBIs" real,
"Player" text,
"Team" text,
"Date" text,
"Opponent" text
) | Which player is associated with the date June 14, 1969? | SELECT "Player" FROM table_5512 WHERE "Date" = 'june 14, 1969' | wikisql |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 奚冰蓝这位病患从一0年一月二十六日到一三年十二月十八日,有多少位医生给他看过病 | SELECT COUNT(DISTINCT mzjzjlb.ZZYSGH) FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '奚冰蓝' AND mzjzjlb.JZKSRQ BETWEEN '2010-01-26' AND '2013-12-18' | css |
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,
... | for the first time this month, when was patient 82132 prescribed furosemide and ferrous sulfate (liquid) at the same time? | SELECT t1.startdate FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'furosemide' AND admissions.subject_id = 82132 AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 's... | mimic_iii |
CREATE TABLE diagnoses (
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 prescriptions... | how many married patients have had thyroid stimulating hormone lab test? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab.label = "Thyroid Stimulating Hormone" | mimicsql_data |
CREATE TABLE table_name_35 (
attendance VARCHAR,
date VARCHAR
) | What is the attendance from November 3, 1974? | SELECT attendance FROM table_name_35 WHERE date = "november 3, 1974" | sql_create_context |
CREATE TABLE table_54083 (
"D 39 \u221a" text,
"D 40 \u221a" text,
"D 41 \u221a" text,
"D 42 \u221a" text,
"D 43 \u221a" text,
"D 44 \u221a" text,
"D 45 \u221a" text,
"D 46 \u221a" text,
"D 47 \u221a" text,
"D 48 \u221a" text
) | What's the D 44 when D 46 is d 26? | SELECT "D 44 \u221a" FROM table_54083 WHERE "D 46 \u221a" = 'd 26' | wikisql |
CREATE TABLE table_name_7 (
wins INTEGER,
year VARCHAR,
points VARCHAR,
class VARCHAR,
team VARCHAR
) | What is the highest wins that has 350cc as the class, yamaha for the team, with points less than 37, and a year after 1979? | SELECT MAX(wins) FROM table_name_7 WHERE class = "350cc" AND team = "yamaha" AND points < 37 AND year > 1979 | sql_create_context |
CREATE TABLE table_name_73 (
opponent VARCHAR,
outcome VARCHAR,
surface VARCHAR
) | Who did Thomaz Bellucci play against when he became runner-up on a clay surface? | SELECT opponent FROM table_name_73 WHERE outcome = "runner-up" AND surface = "clay" | sql_create_context |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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,
... | 这家6526650的医疗机构给患者做蒲地蓝消炎口服液检查记录共有多少 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '6526650' AND t_kc22.SOC_SRT_DIRE_NM = '蒲地蓝消炎口服液' | css |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | 医院4523226所有的记录里,根据科室名与出院的时候诊断编码的区别看一下自费额度与总医疗费用相比的最小值并按升序来排列显示 | SELECT t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD, MIN(t_kc24.PER_EXP) FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4523226' GROUP BY t_kc21.MED_ORG_DEPT_NM, t_kc21.OUT_DIAG_DIS_CD ORDER BY MIN(t_kc24.PER_EXP / t_kc24.MED_AMOUT) | css |
CREATE TABLE table_name_10 (
finish VARCHAR,
start VARCHAR
) | What was 13's finish? | SELECT finish FROM table_name_10 WHERE start = "13" | sql_create_context |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is primary disease and diagnoses short title of subject name caren obrien? | SELECT demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Caren Obrien" | mimicsql_data |
CREATE TABLE table_name_26 (
winning_driver VARCHAR,
race_name VARCHAR
) | What driver won the VII Rand Grand Prix? | SELECT winning_driver FROM table_name_26 WHERE race_name = "vii rand grand prix" | sql_create_context |
CREATE TABLE table_15866 (
"Player" text,
"No." real,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | Which school did Herb Williams go to? | SELECT "School/Club Team" FROM table_15866 WHERE "Player" = 'Herb Williams' | wikisql |
CREATE TABLE table_name_18 (
Id VARCHAR
) | What was the 2012 result associated with a 2007 finish of 2R and a 2009 of 1R? | SELECT 2012 FROM table_name_18 WHERE 2007 = "2r" AND 2009 = "1r" | sql_create_context |
CREATE TABLE table_name_15 (
opponents VARCHAR,
partner VARCHAR
) | What is the name of the opponent when anastasia pivovarova was the partner? | SELECT opponents FROM table_name_15 WHERE partner = "anastasia pivovarova" | sql_create_context |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | 在医院6828719中列出患者14284593就诊科室名称不包含心血管病的全部门诊就诊记录的流水号都是什么? | SELECT mzjzjlb.JZLSH FROM hz_info JOIN mzjzjlb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE hz_info.RYBH = '14284593' AND hz_info.YLJGDM = '6828719' AND NOT mzjzjlb.JZKSMC LIKE '%心血管病%' | css |
CREATE TABLE table_name_41 (
finish VARCHAR,
win_percentage VARCHAR,
wins VARCHAR
) | Which finish had a win percentage that was more than 0.598 and also had less than 53 wins? | SELECT finish FROM table_name_41 WHERE win_percentage > 0.598 AND wins < 53 | sql_create_context |
CREATE TABLE table_name_34 (
score VARCHAR,
loss VARCHAR
) | What is the score of the game that was a loss to Dotson (2-3)? | SELECT score FROM table_name_34 WHERE loss = "dotson (2-3)" | sql_create_context |
CREATE TABLE services (
service_id number,
service_name text
)
CREATE TABLE first_notification_of_loss (
fnol_id number,
customer_id number,
policy_id number,
service_id number
)
CREATE TABLE customers (
customer_id number,
customer_name text
)
CREATE TABLE claims (
claim_id numbe... | Find the claim that has the largest total settlement amount. Return the effective date of the claim. | SELECT t1.effective_date FROM claims AS t1 JOIN settlements AS t2 ON t1.claim_id = t2.claim_id GROUP BY t1.claim_id ORDER BY SUM(t2.settlement_amount) DESC LIMIT 1 | spider |
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | i would like to find flights from COLUMBUS to MINNEAPOLIS on monday june fourteenth early in the morning or in the evening sunday 6 13 thank you | 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 ((((flight.departure_time BETWEEN 0 AND 800) AND date_day.day_number = 13 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_nam... | atis |
CREATE TABLE table_name_95 (
front_side_bus VARCHAR,
frequency VARCHAR
) | What is the front-side bus for the processor whose frequency is 733MHz? | SELECT front_side_bus FROM table_name_95 WHERE frequency = "733mhz" | sql_create_context |
CREATE TABLE table_name_69 (
position_in_2012_13 VARCHAR,
number_of_seasons_in_ligue_1 VARCHAR,
ligue_1_titles VARCHAR
) | Tell me the position in 2012-13 and number of seasons in leigue 1 of 30 with ligue 1 titles of 1 | SELECT position_in_2012_13 FROM table_name_69 WHERE number_of_seasons_in_ligue_1 = 30 AND ligue_1_titles = 1 | sql_create_context |
CREATE TABLE table_71271 (
"Year" real,
"Venue" text,
"Winner" text,
"Country" text,
"Score" real
) | What was the average year that the venue was Bokskogens? | SELECT AVG("Year") FROM table_71271 WHERE "Venue" = 'bokskogens' | wikisql |
CREATE TABLE table_name_55 (
chng VARCHAR,
rank VARCHAR,
prev VARCHAR
) | What chng has a rank greater than 6, with 12 as a prev? | SELECT chng FROM table_name_55 WHERE rank > 6 AND prev = 12 | sql_create_context |
CREATE TABLE table_27459 (
"Rank" real,
"Rider" text,
"Sat 29 May" text,
"Mon 31 May" text,
"Tues 1 June" text,
"Wed 2 June" text,
"Thurs 3 June" text,
"Fri 4 June" text
) | If Tuesday 1 June is 20' 59.60 107.834mph, what is the rank maximum? | SELECT MAX("Rank") FROM table_27459 WHERE "Tues 1 June" = '20'' 59.60 107.834mph' | wikisql |
CREATE TABLE table_67341 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
) | Which grid has a time/retired of +3.9 secs in less than 96 laps? | SELECT AVG("Grid") FROM table_67341 WHERE "Time/Retired" = '+3.9 secs' AND "Laps" < '96' | wikisql |
CREATE TABLE table_name_32 (
pumpers VARCHAR,
tankers VARCHAR,
brigade VARCHAR,
cars VARCHAR,
staffing VARCHAR
) | How many Pumpers have Cars of 1, and a Staffing of volunteer, and a Brigade of grovedale, and Tankers smaller than 1? | SELECT COUNT(pumpers) FROM table_name_32 WHERE cars = "1" AND staffing = "volunteer" AND brigade = "grovedale" AND tankers < 1 | sql_create_context |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY... | For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and department_id . | SELECT PHONE_NUMBER, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) | nvbench |
CREATE TABLE table_27036 (
"Processor" text,
"Brand name" text,
"Model (list)" text,
"Cores" real,
"L2 Cache" text,
"Socket" text,
"TDP" text
) | What is the value for model if processor is Kentsfield and brand name is Xeon? | SELECT "Model (list)" FROM table_27036 WHERE "Processor" = 'Kentsfield' AND "Brand name" = 'Xeon' | wikisql |
CREATE TABLE instructor (
ID varchar(5),
name varchar(20),
dept_name varchar(20),
salary numeric(8,2)
)
CREATE TABLE department (
dept_name varchar(20),
building varchar(15),
budget numeric(12,2)
)
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
... | Return a bar chart about the distribution of dept_name and the sum of salary , and group by attribute dept_name. | SELECT dept_name, SUM(salary) FROM instructor GROUP BY dept_name ORDER BY salary | nvbench |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semest... | Who will be teaching computing infrastructure courses ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN area ON course_offering.course_id = area.course_id WHERE area.area LIKE '%... | advising |
CREATE TABLE user (
uid int,
user_id varchar,
name varchar
)
CREATE TABLE review (
rid int,
business_id varchar,
user_id varchar,
rating float,
text longtext,
year int,
month varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_addr... | Find all Hotels in Dallas with at least 50 reviews | SELECT business.name FROM business, category WHERE business.city = 'Dallas' AND business.review_count >= 50 AND category.business_id = business.business_id AND category.category_name = 'Hotels' | yelp |
CREATE TABLE table_name_21 (
score VARCHAR,
record VARCHAR
) | What is the Score of the game with a Record of 29 23 13? | SELECT score FROM table_name_21 WHERE record = "29–23–13" | sql_create_context |
CREATE TABLE table_name_10 (
no10 VARCHAR,
no8 VARCHAR
) | What was the No. 10 team that has No. 8 of Diana? | SELECT no10 FROM table_name_10 WHERE no8 = "diana" | 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... | 自二零零四年九月二十日开始,截止到二零二一年三月十八日,患者19598745的病历最主要是哪家医院的 | SELECT gwyjzb.MED_SER_ORG_NO FROM gwyjzb WHERE gwyjzb.PERSON_ID = '19598745' AND gwyjzb.IN_HOSP_DATE BETWEEN '2004-09-20' AND '2021-03-18' GROUP BY gwyjzb.MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT fgwyjzb.MED_SER_ORG_NO FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '19598745' AND fgwyjzb.IN_HOSP_DATE BETWEEN ... | css |
CREATE TABLE table_name_23 (
pos VARCHAR,
year INTEGER
) | What was the position of the teams before 1973? | SELECT pos FROM table_name_23 WHERE year < 1973 | sql_create_context |
CREATE TABLE table_name_2 (
bbc_two_rank VARCHAR,
bbc_one_rank VARCHAR,
bbc_one_total_viewing VARCHAR
) | What is the BBC 2 rank when BBC 1 is 1st rank and the total viewing is 9,840,000? | SELECT bbc_two_rank FROM table_name_2 WHERE bbc_one_rank = "1st" AND bbc_one_total_viewing = "9,840,000" | sql_create_context |
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... | A bar chart about the average of maximum price of wines each year, bin the year into the weekday interval
, order by the total number in desc. | SELECT Year, AVG(MAX(Price)) FROM wine ORDER BY AVG(MAX(Price)) DESC | nvbench |
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, return a bar chart about the distribution of name and the average of manufacturer , and group by attribute name, and could you order by the X-axis in ascending please? | SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name | nvbench |
CREATE TABLE table_name_25 (
opponent VARCHAR,
time VARCHAR
) | Who was the opponent in the match that lasted 1:22? | SELECT opponent FROM table_name_25 WHERE time = "1:22" | sql_create_context |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CRE... | in this year, patient 022-127262 got admitted to the hospital? | SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '022-127262' AND DATETIME(patient.hospitaladmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | eicu |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | what is diagnoses icd9 code and drug name of subject id 65652? | SELECT diagnoses.icd9_code, prescriptions.drug FROM diagnoses INNER JOIN prescriptions ON diagnoses.hadm_id = prescriptions.hadm_id WHERE diagnoses.subject_id = "65652" | mimicsql_data |
CREATE TABLE table_name_60 (
grid INTEGER,
laps VARCHAR
) | What is the grid total for cars that went 17 laps? | SELECT SUM(grid) FROM table_name_60 WHERE laps = 17 | sql_create_context |
CREATE TABLE head (
head_ID int,
name text,
born_state text,
age real
)
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num... | I want to see trend of the number of creation by creation, order from low to high by the X. | SELECT Creation, COUNT(Creation) FROM department GROUP BY Creation ORDER BY Creation | nvbench |
CREATE TABLE table_name_5 (
written_by VARCHAR,
prod_code VARCHAR,
directed_by VARCHAR
) | Who wrote the episode with a production code greater than 1.4 direcyed by rick wallace? | SELECT written_by FROM table_name_5 WHERE prod_code > 1.4 AND directed_by = "rick wallace" | sql_create_context |
CREATE TABLE table_203_394 (
id number,
"title" text,
"author" text,
"date" number,
"length\n(first edition)" text
) | which title was published before 1921 ? | SELECT "title" FROM table_203_394 WHERE "date" < 1921 | squall |
CREATE TABLE Reservations (
Room VARCHAR,
Adults VARCHAR,
Kids VARCHAR
)
CREATE TABLE Rooms (
RoomId VARCHAR,
maxOccupancy VARCHAR
) | List how many times the number of people in the room reached the maximum occupancy of the room. The number of people include adults and kids. | SELECT COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE T2.maxOccupancy = T1.Adults + T1.Kids | sql_create_context |
CREATE TABLE table_59256 (
"Team" text,
"Outgoing manager" text,
"Manner of departure" text,
"Date of vacancy" text,
"Replaced by" text,
"Date of appointment" text,
"Position in table" text
) | What kind of Replaced has a Manner of departure of end of contract on dec. 16, 2008? | SELECT "Replaced by" FROM table_59256 WHERE "Manner of departure" = 'end of contract' AND "Date of appointment" = 'dec. 16, 2008' | wikisql |
CREATE TABLE authorship (
authid number,
instid number,
paperid number,
authorder number
)
CREATE TABLE authors (
authid number,
lname text,
fname text
)
CREATE TABLE inst (
instid number,
name text,
country text
)
CREATE TABLE papers (
paperid number,
title text
) | Which papers have 'Stephanie Weirich' as an author? | SELECT t3.title FROM authors AS t1 JOIN authorship AS t2 ON t1.authid = t2.authid JOIN papers AS t3 ON t2.paperid = t3.paperid WHERE t1.fname = "Stephanie" AND t1.lname = "Weirich" | spider |
CREATE TABLE table_67488 (
"Film" text,
"Director(s)" text,
"Writer(s)" text,
"Recipient" text,
"Date" text,
"Award" text
) | Name the recipient for jamaica and award of 6,947 | SELECT "Recipient" FROM table_67488 WHERE "Award" = '£6,947' AND "Film" = 'jamaica' | 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 the number of patients whose gender is m and drug name is aztreonam? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.drug = "Aztreonam" | mimicsql_data |
CREATE TABLE table_46008 (
"Nat." text,
"Name" text,
"Since" text,
"App(L/C/E)" text,
"Goals(L/C/E)" text,
"Ends" real,
"Transfer fee" text
) | What are the goals for Pelletieri in ARG? | SELECT "Goals(L/C/E)" FROM table_46008 WHERE "Nat." = 'arg' AND "Name" = 'pelletieri' | wikisql |
CREATE TABLE table_2226343_1 (
laps VARCHAR,
average_speed__mph_ VARCHAR
) | How many laps have an average speed (mph) of 140.22? | SELECT laps FROM table_2226343_1 WHERE average_speed__mph_ = "140.22" | sql_create_context |
CREATE TABLE table_22659 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location" text,
"Record" text
) | How many different records were there in the games that ended in w 70-66? | SELECT COUNT("Record") FROM table_22659 WHERE "Score" = 'W 70-66' | wikisql |
CREATE TABLE Ref_Payment_Methods (
payment_method_code CHAR(10),
payment_method_description VARCHAR(80)
)
CREATE TABLE Performers_in_Bookings (
Order_ID INTEGER,
Performer_ID INTEGER
)
CREATE TABLE Marketing_Regions (
Marketing_Region_Code CHAR(15),
Marketing_Region_Name VARCHAR(255),
Mark... | What are the number of the names of the workshop groups that have bookings with status code 'stop'?, list how many store name from low to high order. | SELECT Store_Name, COUNT(Store_Name) FROM Bookings AS T1 JOIN Drama_Workshop_Groups AS T2 ON T1.Workshop_Group_ID = T2.Workshop_Group_ID WHERE T1.Status_Code = "stop" GROUP BY Store_Name ORDER BY COUNT(Store_Name) | nvbench |
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 varchar(2)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | Scatter. what is the average salary of employees who have a commission percentage that is not null? | SELECT DEPARTMENT_ID, AVG(SALARY) FROM employees WHERE COMMISSION_PCT <> "null" GROUP BY DEPARTMENT_ID | nvbench |
CREATE TABLE table_73326 (
"District" text,
"Vacator" text,
"Reason for change" text,
"Successor" text,
"Date successor seated" text
) | What is every district for reason for change is died August 9, 1964? | SELECT "District" FROM table_73326 WHERE "Reason for change" = 'Died August 9, 1964' | wikisql |
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChang... | Get the Posts for programming languages. | SELECT * FROM Posts WHERE Tags LIKE '%java' | sede |
CREATE TABLE table_1272844_2 (
vote VARCHAR,
air_date VARCHAR
) | What was the vote tally on the episode aired May 5, 2005? | SELECT vote FROM table_1272844_2 WHERE air_date = "May 5, 2005" | sql_create_context |
CREATE TABLE table_204_506 (
id number,
"seasons" number,
"team" text,
"ch.wins" number,
"promotions" number,
"relegations" number
) | what team is the only team with 2 wins ? | SELECT "team" FROM table_204_506 WHERE "ch.wins" = 2 | squall |
CREATE TABLE table_32091 (
"Player" text,
"Nationality" text,
"Position" text,
"Years in Toronto" text,
"School/Club Team" text
) | What year(s) did Hakeem Olajuwon play Center for Toronto? | SELECT "Years in Toronto" FROM table_32091 WHERE "Player" = 'hakeem olajuwon' | wikisql |
CREATE TABLE table_10720 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What did Essendon score as the Away team? | SELECT "Away team score" FROM table_10720 WHERE "Away team" = 'essendon' | wikisql |
CREATE TABLE table_33219 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What was the rank for czechoslovakia with 1 bronze? | SELECT "Rank" FROM table_33219 WHERE "Bronze" = '1' AND "Nation" = 'czechoslovakia' | wikisql |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE ReviewTaskResultTypes (
Id number,
Name text,
Description text
)
CREATE TAB... | Oldest comments containing a given phrase. | SELECT PostId AS "post_link", UserId AS "user_link", CreationDate, 'text', Score FROM Comments WHERE Text LIKE '%##SearchTerm##%' ORDER BY CreationDate LIMIT 250 | sede |
CREATE TABLE table_1193568_1 (
election_date VARCHAR,
electorate VARCHAR
) | what's the election date where electorate is christchurch country | SELECT election_date FROM table_1193568_1 WHERE electorate = "Christchurch Country" | sql_create_context |
CREATE TABLE table_18771 (
"Serial & Branch" real,
"Seaman" text,
"Mechanical" text,
"Secretariat" text,
"Supply" text,
"Electrical" text,
"Radio Electrical" text,
"Regulating" text,
"Medical" text
) | How many serial branches have radio electrial = rea-iv? | SELECT COUNT("Serial & Branch") FROM table_18771 WHERE "Radio Electrical" = 'REA-IV' | wikisql |
CREATE TABLE table_204_429 (
id number,
"battle" text,
"location" text,
"date(s)" text,
"engagement remarks" text,
"victor" text
) | what was the only battle in gonzales ? | SELECT "battle" FROM table_204_429 WHERE "location" = 'gonzales' | squall |
CREATE TABLE table_24195 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | How many items are listed under the column of U.S. viewers for episode 'Bite Me'? | SELECT COUNT("U.S. viewers (millions)") FROM table_24195 WHERE "Title" = 'Bite Me' | wikisql |
CREATE TABLE table_name_51 (
attendance VARCHAR,
home_team VARCHAR
) | what is the attendance when the home team is chester city? | SELECT attendance FROM table_name_51 WHERE home_team = "chester city" | sql_create_context |
CREATE TABLE table_name_64 (
frequency VARCHAR,
voltage VARCHAR,
part_number_s_ VARCHAR
) | Which frequency has voltage of 1.6v and part number kp80524kx300256kc80524kx300256pmg30002002aa? | SELECT frequency FROM table_name_64 WHERE voltage = "1.6v" AND part_number_s_ = "kp80524kx300256kc80524kx300256pmg30002002aa" | sql_create_context |
CREATE TABLE wrestler (
wrestler_id number,
name text,
reign text,
days_held text,
location text,
event text
)
CREATE TABLE elimination (
elimination_id text,
wrestler_id text,
team text,
eliminated_by text,
elimination_move text,
time text
) | List the names of wrestlers in descending order of days held. | SELECT name FROM wrestler ORDER BY days_held DESC | spider |
CREATE TABLE table_182499_1 (
location VARCHAR,
substrate VARCHAR
) | give the location of subtrate coproporphyrinogen iii | SELECT location FROM table_182499_1 WHERE substrate = "Coproporphyrinogen III" | sql_create_context |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE icustays (
row_id number,... | what were the four frequent specimen tests that were conducted? | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4 | mimic_iii |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
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... | what is the number of patients whose primary disease is atrial fibrillation\thoracoscopic maze procedure bilateral/sda and year of death is less than or equal to 2115? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "ATRIAL FIBRILLATION\THORACOSCOPIC MAZE PROCEDURE BILATERAL/SDA" AND demographic.dod_year <= "2115.0" | mimicsql_data |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about School_ID over the All_Neutral , and list by the All_Neutral in ascending. | SELECT All_Neutral, School_ID FROM basketball_match ORDER BY All_Neutral | nvbench |
CREATE TABLE table_55401 (
"Ship's name" text,
"Date entered service" text,
"Date withdrawn" text,
"Tonnage" real,
"Type of Ship" text
) | what is the least tonnage for the ship(s) that entered service on 11 february 1983? | SELECT MIN("Tonnage") FROM table_55401 WHERE "Date entered service" = '11 february 1983' | wikisql |
CREATE TABLE table_23292220_3 (
episode VARCHAR,
daves_team VARCHAR
) | In how many episodes was Dave's team made up of David Walliams and Louis Walsh? | SELECT COUNT(episode) FROM table_23292220_3 WHERE daves_team = "David Walliams and Louis Walsh" | 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 locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varc... | Use a histogram to show the department's id and corresponding employees' first name, and order by the y axis in desc please. | SELECT FIRST_NAME, DEPARTMENT_ID FROM employees ORDER BY DEPARTMENT_ID DESC | nvbench |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
h... | is the value of wbc x 1000 of patient 029-16431 last measured on the first hospital visit greater than the value second to last measured on the first hospital visit? | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-16431' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... | eicu |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE prescriptions (
... | what are the five most commonly conducted specimen tests? | SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 5 | mimic_iii |
CREATE TABLE table_name_35 (
year INTEGER,
game VARCHAR
) | Which Year has a Game of resident evil 4? | SELECT AVG(year) FROM table_name_35 WHERE game = "resident evil 4" | sql_create_context |
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,
... | which drug is prescribed to patient with patient id 3343? | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.subject_id = "3343" | mimicsql_data |
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_start_date DATETIME,
booking_end_date DATETIME
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
availa... | How many bookings does each booking status have? List the booking status code and the number of corresponding bookings, and order from high to low by the total number please. | SELECT booking_status_code, COUNT(*) FROM Apartment_Bookings GROUP BY booking_status_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE weather (
date text,
max_temperature_f number,
mean_temperature_f number,
min_temperature_f number,
max_dew_point_f number,
mean_dew_point_f number,
min_dew_point_f number,
max_humidity number,
mean_humidity number,
min_humidity number,
max_sea_level_pressure_inc... | What is the name, latitude, and city of the station that is located the furthest South? | SELECT name, lat, city FROM station ORDER BY lat LIMIT 1 | spider |
CREATE TABLE table_name_58 (
to_par VARCHAR,
score VARCHAR,
country VARCHAR
) | What is Top Par, when Score is less than 68, and when Country is England? | SELECT to_par FROM table_name_58 WHERE score < 68 AND country = "england" | sql_create_context |
CREATE TABLE pitstops (
driverid VARCHAR
)
CREATE TABLE results (
driverid VARCHAR
)
CREATE TABLE drivers (
forename VARCHAR,
surname VARCHAR,
driverid VARCHAR
) | What are the drivers' first, last names and id who had more than 8 pit stops or participated in more than 5 race results? | SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN pitstops AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 8 UNION SELECT T1.forename, T1.surname, T1.driverid FROM drivers AS T1 JOIN results AS T2 ON T1.driverid = T2.driverid GROUP BY T1.driverid HAVING COUNT(*) > 5 | 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 patients whose days of hospital stay is greater than 2 and procedure icd9 code is 8949? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "2" AND procedures.icd9_code = "8949" | mimicsql_data |
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
pat... | what is the pricing for sodium chloride 0.9% 1,000 ml bag? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'medication' AND cost.eventid IN (SELECT medication.medicationid FROM medication WHERE medication.drugname = 'sodium chloride 0.9% 1,000 ml bag') | eicu |
CREATE TABLE table_22114 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
) | What year was Tim Holden first elected? | SELECT MIN("First elected") FROM table_22114 WHERE "Incumbent" = 'Tim Holden' | wikisql |
CREATE TABLE table_25200461_9 (
population VARCHAR,
city VARCHAR
) | If the city is Santa Clara, what is the population total number? | SELECT COUNT(population) FROM table_25200461_9 WHERE city = "Santa Clara" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.