context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_1397655_1 (
other_programming_sources VARCHAR,
year_acquired VARCHAR
) | how many channels were gained in 1997 | SELECT COUNT(other_programming_sources) FROM table_1397655_1 WHERE year_acquired = 1997 | 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,... | 查一查医院9861939全部医疗就诊的记录里按科室和入院时的诊断不同算出病人平均岁数有多大,然后把其中平均值小于3岁的记录留下 | SELECT MED_ORG_DEPT_NM, IN_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '9861939' GROUP BY MED_ORG_DEPT_NM, IN_DIAG_DIS_NM HAVING AVG(PERSON_AGE) < 3 | css |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number... | what were the top four most common drugs that followed within 2 months for the patients who were given contr cerebr arteriogram during this year? | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures ... | mimic_iii |
CREATE TABLE table_59008 (
"Engine" text,
"Power" text,
"Torque" text,
"0\u2013100km/h (62mph)" text,
"Top speed" text
) | What is the 0-100km/h (62mph) of the supercharged 5.4l v8 engine? | SELECT "0\u2013100km/h (62mph)" FROM table_59008 WHERE "Engine" = 'supercharged 5.4l v8' | wikisql |
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperat... | Group by the local authorities and count the number of local authorities, and then group by services, could you display in desc by the x-axis? | SELECT services, COUNT(services) FROM station GROUP BY local_authority, services ORDER BY services DESC | nvbench |
CREATE TABLE table_203_700 (
id number,
"year" number,
"species" text,
"height" text,
"location grown" text,
"state" text,
"notes" text
) | was the white spruce used in 1985 from michigan or minnesota ? | SELECT "state" FROM table_203_700 WHERE "species" = 'white spruce' AND "year" = 1985 | squall |
CREATE TABLE table_63754 (
"Title" text,
"Series" text,
"Director" text,
"Production Num." text,
"Release date" text
) | Who is the Director of Fish Tales? | SELECT "Director" FROM table_63754 WHERE "Title" = 'fish tales' | 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... | how many patients whose primary disease is ruq pain? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RUQ PAIN" | mimicsql_data |
CREATE TABLE table_name_83 (
home VARCHAR,
visitor VARCHAR,
leading_scorer VARCHAR
) | What is the home team of the game where the Grizzlies were the visitor team and Rudy Gay (21) was the leading scorer? | SELECT home FROM table_name_83 WHERE visitor = "grizzlies" AND leading_scorer = "rudy gay (21)" | sql_create_context |
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... | 分别列出医疗就诊00968911685里面开出药品的定价上限金额高于898.72元的药品都是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_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 = '00968911685' AND t_kc22.UP_LIMIT_AMO > 898.72 | css |
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
CREATE TABLE gas_station (
Station_ID int,
Open_Year int,
Location text,
Manager_Name text,
Vice_Manager_Name text,
Representative_Name text
)
CREATE TABLE company (
Company_ID int,
Rank i... | Draw a pie chart to show all main industry and total market value in each industry. | SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry | nvbench |
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 l... | count the number of patients diagnosed with nausea - with vomiting within 2 months after they have been diagnosed with ards in 2105. | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'nausea - with vomiting' AND STRFTIME('%y', diagnosis.diagnosistime) = '2105') AS t1 JOIN (SELECT patient.uni... | eicu |
CREATE TABLE Invoices (
invoice_number INTEGER,
order_id INTEGER,
invoice_date DATETIME
)
CREATE TABLE Order_Items (
order_item_id INTEGER,
order_id INTEGER,
product_id INTEGER,
product_quantity VARCHAR(50),
other_order_item_details VARCHAR(255)
)
CREATE TABLE Orders (
order_id INT... | What are the first names and ids for customers who have two or more accounts, and rank in desc by the X. | SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id ORDER BY T2.customer_first_name DESC | nvbench |
CREATE TABLE Guests (
guest_id INTEGER,
gender_code CHAR(1),
guest_first_name VARCHAR(80),
guest_last_name VARCHAR(80),
date_of_birth DATETIME
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking_status_code CHAR(15),
booking_star... | How many apartment bookings in each day? Show me a line chart grouping by booking end date, and show by the booking_end_date from high to low. | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings GROUP BY booking_end_date ORDER BY booking_end_date DESC | nvbench |
CREATE TABLE table_5069 (
"Ranking" real,
"Nationality" text,
"Name" text,
"Years" text,
"Goals" real
) | What ranking has the nationality of spain and the goals of 26? | SELECT "Ranking" FROM table_5069 WHERE "Nationality" = 'spain' AND "Goals" = '26' | wikisql |
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 cost (
costid num... | what is the name of drug that patient 022-3713 is allergic to since 104 months ago. | SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-3713')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(), '-... | eicu |
CREATE TABLE table_name_73 (
opponent VARCHAR,
record VARCHAR
) | Which opponent has a Record of 54-38? | SELECT opponent FROM table_name_73 WHERE record = "54-38" | sql_create_context |
CREATE TABLE table_203_57 (
id number,
"year" number,
"round" text,
"against" text,
"score" text,
"scorers" text
) | largest victory | SELECT "score" FROM table_203_57 ORDER BY "score" - "score" DESC LIMIT 1 | squall |
CREATE TABLE table_27487712_1 (
result VARCHAR,
incumbent VARCHAR
) | What was the result of the election with incumbent john lewis? | SELECT result FROM table_27487712_1 WHERE incumbent = "John Lewis" | sql_create_context |
CREATE TABLE table_name_52 (
size_km² INTEGER,
density_hab_km VARCHAR
) | what is the size km when the density hab/km is 8,321? | SELECT SUM(size_km²) FROM table_name_52 WHERE density_hab_km = 8 OFFSET 321 | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 67143371696医疗就诊的出院日期是哪一年几月几日 | SELECT OUT_HOSP_DATE FROM t_kc21 WHERE MED_CLINIC_ID = '67143371696' | css |
CREATE TABLE Department (
DNO INTEGER,
Division VARCHAR(2),
DName VARCHAR(25),
Room VARCHAR(5),
Building VARCHAR(13),
DPhone INTEGER
)
CREATE TABLE Gradeconversion (
lettergrade VARCHAR(2),
gradepoint FLOAT
)
CREATE TABLE Minor_in (
StuID INTEGER,
DNO INTEGER
)
CREATE TABLE St... | A bar chart shows the distribution of Days and the amount of Days , and group by attribute Days. | SELECT Days, COUNT(Days) FROM Course GROUP BY Days ORDER BY Credits | nvbench |
CREATE TABLE table_10863 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What was the result of the Competition of euro 2000 qualifier? | SELECT "Result" FROM table_10863 WHERE "Competition" = 'euro 2000 qualifier' | wikisql |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | 68891668患者之前是哪个就诊医院 | (SELECT mzjzjlb.YLJGDM 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 = '68891668') UNION (SELECT zyjzjlb.YLJGDM FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.K... | css |
CREATE TABLE Player (
pID numeric(5,0),
pName varchar(20),
yCard varchar(3),
HS numeric(5,0)
)
CREATE TABLE College (
cName varchar(20),
state varchar(2),
enr numeric(5,0)
)
CREATE TABLE Tryout (
pID numeric(5,0),
cName varchar(20),
pPos varchar(8),
decision varchar(3)
) | A bar chart about what are the names and number of hours spent training for each player who trains for less than 1500 hours?, and display in descending by the y axis. | SELECT pName, HS FROM Player WHERE HS < 1500 ORDER BY HS DESC | nvbench |
CREATE TABLE table_31099 (
"Stage" real,
"Winner" text,
"General Classification" text,
"Mountains Classification" text,
"Sprint Classification" text,
"Young Rider Classification" text,
"Team Classification" text,
"Aggressive Rider" text
) | Who is listed under the general classifcation where Ben Swift won and Cameron Meyer was listed under the young rider? | SELECT "General Classification" FROM table_31099 WHERE "Winner" = 'Ben Swift' AND "Young Rider Classification" = 'Cameron Meyer' | wikisql |
CREATE TABLE table_name_68 (
rank VARCHAR,
qual VARCHAR
) | Which Rank has a Qual of 145.144? | SELECT rank FROM table_name_68 WHERE qual = "145.144" | sql_create_context |
CREATE TABLE table_22756 (
"Name" text,
"Country" text,
"Seasons" text,
"Championship Titles" text,
"Race entries (Starts)" text,
"Poles" real,
"Wins" real,
"Podiums" real,
"Fastest Laps" real,
"Points" text
) | Name the country for hideki noda category:articles with hcards | SELECT "Country" FROM table_22756 WHERE "Name" = 'Hideki Noda Category:Articles with hCards' | wikisql |
CREATE TABLE table_name_53 (
year VARCHAR,
passenger_change VARCHAR
) | What is the year that saw a passenger change of +32,9%? | SELECT COUNT(year) FROM table_name_53 WHERE passenger_change = "+32,9%" | sql_create_context |
CREATE TABLE table_5429 (
"Locale" text,
"Skip" text,
"Ends Won" real,
"Ends Lost" real,
"Blank Ends" real,
"Stolen Ends" real,
"Shot Pct." real
) | What's the highest Ends Lost with a shot % greater than 77, 11 blank ends, 7 stolen ends, and more than 44 ends one? | SELECT MAX("Ends Lost") FROM table_5429 WHERE "Shot Pct." > '77' AND "Blank Ends" = '11' AND "Stolen Ends" = '7' AND "Ends Won" > '44' | wikisql |
CREATE TABLE table_38579 (
"Designation HD" text,
"Constellation" text,
"Date sent" text,
"Arrival date" text,
"Message" text
) | Which constellation has hd 75732 as a destignation HD? | SELECT "Constellation" FROM table_38579 WHERE "Designation HD" = 'hd 75732' | wikisql |
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
... | Who teaches HUMGEN 643 next semester ? | 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 course ON course.course_id = course_offering.course_id INNER JOIN semester... | advising |
CREATE TABLE table_name_41 (
date VARCHAR,
decision VARCHAR
) | What was the date of the game that had a decision of wall? | SELECT date FROM table_name_41 WHERE decision = "wall" | sql_create_context |
CREATE TABLE Student_Course_Enrolment (
date_of_completion VARCHAR,
registration_id VARCHAR
)
CREATE TABLE Student_Tests_Taken (
registration_id VARCHAR,
test_result VARCHAR
) | What are the completion dates of all the tests that have result 'Fail'? | SELECT T1.date_of_completion FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Fail" | sql_create_context |
CREATE TABLE table_53120 (
"Pick" real,
"Player" text,
"Country of origin*" text,
"PBA team" text,
"College" text
) | What college did pick 33 attend? | SELECT "College" FROM table_53120 WHERE "Pick" = '33' | wikisql |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | 从零一年五月十六号到一九年七月二十三医疗机构3199188未就业人员的就诊花的总医疗费559.51元以上的就诊记录数量 | SELECT COUNT(*) FROM t_kc21 WHERE MED_SER_ORG_NO = '3199188' AND IN_HOSP_DATE BETWEEN '2001-05-16' AND '2019-07-23' AND INSURED_STS = '未就业' AND MED_AMOUT >= 559.51 | css |
CREATE TABLE table_20810 (
"Official #" real,
"TF1 #" real,
"French title" text,
"English title" text,
"Air date (France)" text,
"Original Beechwood Bunny Tale / Source material" text
) | Who was responsible for original beechwood bunny tale / source material for the episode title 'Papa Bramble's Secret'? | SELECT "Original Beechwood Bunny Tale / Source material" FROM table_20810 WHERE "English title" = 'Papa Bramble''s Secret' | wikisql |
CREATE TABLE table_name_81 (
lijsttrekker VARCHAR,
cabinet VARCHAR,
fractievoorzitter VARCHAR
) | What is Lijsttrekker, when Cabinet is 'Hans Van Mierlo', and when Fractievoorzitter is 'Thom De Graaf'? | SELECT lijsttrekker FROM table_name_81 WHERE cabinet = "hans van mierlo" AND fractievoorzitter = "thom de graaf" | sql_create_context |
CREATE TABLE table_204_684 (
id number,
"wrestler:" text,
"times:" number,
"date:" text,
"location:" text,
"notes:" text
) | when did steve corino win his first wsl title ? | SELECT "date:" FROM table_204_684 WHERE "wrestler:" = 'steve corino' ORDER BY "date:" LIMIT 1 | squall |
CREATE TABLE table_name_96 (
game VARCHAR,
score VARCHAR,
points VARCHAR
) | How many Games have a Score of 5 4, and Points smaller than 49? | SELECT COUNT(game) FROM table_name_96 WHERE score = "5–4" AND points < 49 | sql_create_context |
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_fli... | list all flights from ATLANTA to BALTIMORE thursday morning | 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 ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 24 AND date_day.month_number = 5 AN... | atis |
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text,
meter_300 text,
meter_400 text,
meter_500 text,
meter_600 text,
meter_700 text,
Time text
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE... | A bar chart for finding the number of the names of stadiums that some Australian swimmers have been to, list by the name in ascending. | SELECT T4.Name, COUNT(T4.Name) FROM swimmer AS t1 JOIN record AS t2 ON t1.ID = t2.Swimmer_ID JOIN event AS t3 ON t2.Event_ID = t3.ID JOIN stadium AS t4 ON t4.ID = t3.Stadium_ID WHERE t1.Nationality = 'Australia' GROUP BY T4.Name ORDER BY T4.Name | nvbench |
CREATE TABLE table_65707 (
"Score" text,
"2007" text,
"2008" text,
"2009" text,
"2010" text,
"2011" text,
"2012" text
) | What 2009 has 18.5% as the 2007? | SELECT "2009" FROM table_65707 WHERE "2007" = '18.5%' | wikisql |
CREATE TABLE table_name_48 (
heat_rank INTEGER,
lane VARCHAR,
time VARCHAR
) | Tell me the average heat rank with a lane of 2 and time less than 27.66 | SELECT AVG(heat_rank) FROM table_name_48 WHERE lane = 2 AND time < 27.66 | sql_create_context |
CREATE TABLE table_name_9 (
body_styles VARCHAR,
engine VARCHAR
) | What body styles have devaux-hall inline 6 as the engine? | SELECT body_styles FROM table_name_9 WHERE engine = "devaux-hall inline 6" | sql_create_context |
CREATE TABLE table_13426649_1 (
original_air_date VARCHAR,
_number VARCHAR
) | How many different original air dates did the episode number 6 have? | SELECT COUNT(original_air_date) FROM table_13426649_1 WHERE _number = 6 | sql_create_context |
CREATE TABLE table_32694 (
"Year" text,
"Date" text,
"Stages" text,
"Distance" text,
"Winner" text
) | In what year saw a total distance of 1,870.23 km? | SELECT "Year" FROM table_32694 WHERE "Distance" = '1,870.23 km' | wikisql |
CREATE TABLE table_5671 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Who was the opponent when Brown (9-5) took the loss? | SELECT "Opponent" FROM table_5671 WHERE "Loss" = 'brown (9-5)' | 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 whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, find job_id and the amount of job_id , and group by attribute job_id, and visualize them by a bar chart, and order in desc by the names. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID ORDER BY JOB_ID DESC | nvbench |
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... | Show me about the correlation between Team_ID and School_ID , and group by attribute All_Games in a scatter chart. | SELECT Team_ID, School_ID FROM basketball_match GROUP BY All_Games | nvbench |
CREATE TABLE table_59050 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To Par" text
) | How many scores have a Place of t5? | SELECT COUNT("Score") FROM table_59050 WHERE "Place" = 't5' | wikisql |
CREATE TABLE gyb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 按照出院诊断出来的疾病编号和科室名称的不相同为条件,把医院1383573全部医疗就诊记录中患者的年龄列出来得到的平均数是多些? | SELECT qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD, AVG(qtb.PERSON_AGE) FROM qtb WHERE qtb.MED_SER_ORG_NO = '1383573' GROUP BY qtb.MED_ORG_DEPT_NM, qtb.OUT_DIAG_DIS_CD UNION SELECT gyb.MED_ORG_DEPT_NM, gyb.OUT_DIAG_DIS_CD, AVG(gyb.PERSON_AGE) FROM gyb WHERE gyb.MED_SER_ORG_NO = '1383573' GROUP BY gyb.MED_ORG_DEPT_NM, gyb.... | css |
CREATE TABLE table_1213511_3 (
nhl_team VARCHAR,
player VARCHAR
) | How many teams did Bob Peppler play for? | SELECT COUNT(nhl_team) FROM table_1213511_3 WHERE player = "Bob Peppler" | sql_create_context |
CREATE TABLE table_train_248 (
"id" int,
"anemia" bool,
"prostate_specific_antigen_psa" float,
"hemoglobin_a1c_hba1c" float,
"body_weight" float,
"fasting_triglycerides" int,
"hyperlipidemia" bool,
"hgb" int,
"fasting_total_cholesterol" int,
"fasting_ldl_cholesterol" int,
"bo... | prostate specific antigen ( psa ) > 4 ng / ml; | SELECT * FROM table_train_248 WHERE prostate_specific_antigen_psa > 4 | criteria2sql |
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,... | provide the number of patients whose age is less than 54 and item id is 51032? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "54" AND lab.itemid = "51032" | mimicsql_data |
CREATE TABLE table_name_67 (
television_network VARCHAR,
type_of_network VARCHAR,
founded VARCHAR
) | What television network, founded in 2002, has a community type of network? | SELECT television_network FROM table_name_67 WHERE type_of_network = "community" AND founded = "2002" | sql_create_context |
CREATE TABLE table_47269 (
"Name" text,
"Years" text,
"League" real,
"Scottish Cup" real,
"League Cup" real,
"Europe" real,
"Total" real
) | Which Total has a Name of alex mcleish category:articles with hcards, and a League smaller than 494? | SELECT AVG("Total") FROM table_47269 WHERE "Name" = 'alex mcleish category:articles with hcards' AND "League" < '494' | wikisql |
CREATE TABLE table_name_14 (
car___motorcycle VARCHAR,
speed VARCHAR
) | What car/motorcycle goes 91.813mph? | SELECT car___motorcycle FROM table_name_14 WHERE speed = "91.813mph" | sql_create_context |
CREATE TABLE table_name_8 (
bronze VARCHAR,
total VARCHAR,
silver VARCHAR
) | What is the total number of bronze medals with more than 1 medal total and fewer than 1 silver medal? | SELECT COUNT(bronze) FROM table_name_8 WHERE total > 1 AND silver < 1 | sql_create_context |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | Return a bar chart on what is the average base price of rooms, for each bed type?, and sort from high to low by the mean baseprice. | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice) DESC | nvbench |
CREATE TABLE table_66698 (
"Name" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real
) | Which decile has an Area of welcome bay, and an Authority of state? | SELECT "Decile" FROM table_66698 WHERE "Area" = 'welcome bay' AND "Authority" = 'state' | wikisql |
CREATE TABLE table_58977 (
"Week 9 Oct 23" text,
"Week 10 Oct 30" text,
"Week 11 Nov 6" text,
"Week 12 Nov 13" text,
"Week 13 Nov 20" text,
"Week 14 Nov 27" text,
"Week 15 (Final) Dec 3" text
) | What was Week 15 when Week 12 was Notre Dame (7-2)? | SELECT "Week 15 (Final) Dec 3" FROM table_58977 WHERE "Week 12 Nov 13" = 'notre dame (7-2)' | wikisql |
CREATE TABLE table_55016 (
"Date" text,
"Score" text,
"Set 1" text,
"Set 2" text,
"Set 3" text,
"Total" text
) | On what date was the total 25 45? | SELECT "Date" FROM table_55016 WHERE "Total" = '25–45' | wikisql |
CREATE TABLE table_76070 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the total where the gold is larger than 2? | SELECT COUNT("Total") FROM table_76070 WHERE "Gold" > '2' | wikisql |
CREATE TABLE table_31644 (
"Pick #" real,
"MLS Team" text,
"Player" text,
"Position" text,
"Affiliation" text
) | Tell me the affiliation for pick number less than 59 and position of gk | SELECT "Affiliation" FROM table_31644 WHERE "Pick #" < '59' AND "Position" = 'gk' | wikisql |
CREATE TABLE table_1456056_1 (
Id VARCHAR
) | Name the most of 2500-3000ft | SELECT MAX(2500 AS _3000ft) FROM table_1456056_1 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | what is the discharge location for the patient annette haris? | SELECT demographic.discharge_location FROM demographic WHERE demographic.name = "Annette Harris" | mimicsql_data |
CREATE TABLE table_name_65 (
record VARCHAR,
team VARCHAR
) | What was the record of Utah? | SELECT record FROM table_name_65 WHERE team = "utah" | sql_create_context |
CREATE TABLE table_46541 (
"Wicket" text,
"Runs" real,
"Batting partners" text,
"Batting team" text,
"Fielding team" text,
"Venue" text,
"Season" text
) | How many runs did mahela jayawardene and thilan samaraweera have? | SELECT SUM("Runs") FROM table_46541 WHERE "Batting partners" = 'mahela jayawardene and thilan samaraweera' | wikisql |
CREATE TABLE table_1431467_4 (
first_elected VARCHAR,
incumbent VARCHAR
) | Who was everyone first elected when incumbent was John J. Hemphill? | SELECT first_elected FROM table_1431467_4 WHERE incumbent = "John J. Hemphill" | sql_create_context |
CREATE TABLE table_20553 (
"Vehicle" text,
"EPA rated All-electric range" text,
"EPA rated combined fuel economy" text,
"Alaska ( Juneau )" text,
"California (San Francisco)" text,
"Mid-Atlantic South (Washington, D.C.)" text,
"U.S. national average electric mix" text,
"Southeast (Atlant... | What was the US national average electric mix rating for the vehicle that was rated 280 g/mi (174 g/km) in the Midwest? | SELECT "U.S. national average electric mix" FROM table_20553 WHERE "Midwest (Des Moines)" = '280 g/mi (174 g/km)' | wikisql |
CREATE TABLE table_204_697 (
id number,
"song" text,
"artist(s)" text,
"concert" number,
"film" number,
"1978 album" number,
"2002 album" number
) | which artist has the most concerts ? | SELECT "artist(s)" FROM table_204_697 ORDER BY "concert" DESC LIMIT 1 | squall |
CREATE TABLE table_204_104 (
id number,
"title" text,
"genre" text,
"sub\u00addivisions" text,
"libretto" text,
"premiere date" text,
"place, theatre" text,
"notes" text
) | what number of acts does il giustino have ? | SELECT "sub\u00addivisions" FROM table_204_104 WHERE "title" = 'il giustino' | squall |
CREATE TABLE table_78308 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | Who was North Melbourne's home opponent? | SELECT "Home team" FROM table_78308 WHERE "Away team" = 'north melbourne' | wikisql |
CREATE TABLE table_2296507_1 (
stellar_classification VARCHAR,
system VARCHAR
) | Name number of stellar classification for 3 neptune planets < 1 au | SELECT COUNT(stellar_classification) FROM table_2296507_1 WHERE system = "3 Neptune planets < 1 AU" | sql_create_context |
CREATE TABLE wdmzjzjlb (
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... | 6107007医疗机构在二零零二年十月九日到二零零六年十二月二十日期间一共有多少新生儿门诊的就诊记录 | SELECT COUNT(*) FROM wdmzjzjlb WHERE wdmzjzjlb.YLJGDM = '6107007' AND wdmzjzjlb.JZKSRQ BETWEEN '2002-10-09' AND '2006-12-20' AND wdmzjzjlb.ZSEBZ > 0 UNION SELECT COUNT(*) FROM bdmzjzjlb WHERE bdmzjzjlb.YLJGDM = '6107007' AND bdmzjzjlb.JZKSRQ BETWEEN '2002-10-09' AND '2006-12-20' AND bdmzjzjlb.ZSEBZ > 0 | css |
CREATE TABLE table_31970 (
"Heat Rank" real,
"Lane" real,
"Swimmer" text,
"Country" text,
"Time" real,
"Overall Rank" text
) | Which country is ranked 56 overall and has a heat rank smaller than 8? | SELECT "Country" FROM table_31970 WHERE "Heat Rank" < '8' AND "Overall Rank" = '56' | wikisql |
CREATE TABLE table_203_228 (
id number,
"#" number,
"title" text,
"songwriters" text,
"producer(s)" text,
"performer (s)" text
) | how many tracks in word ... life have at most two songwriters ? | SELECT COUNT("title") FROM table_203_228 WHERE "songwriters" <= 2 | squall |
CREATE TABLE table_27044 (
"Episode" real,
"First Air Date" text,
"Rating (18\u201349)" text,
"Share (18\u201349)" real,
"Viewers (millions)" text,
"Rank (timeslot)" text,
"Rank (night)" text
) | What was the 18 to 49 rating when 9.50 million watched? | SELECT "Rating (18\u201349)" FROM table_27044 WHERE "Viewers (millions)" = '9.50' | wikisql |
CREATE TABLE table_12845 (
"Election" text,
"1st Member" text,
"1st Party" text,
"2nd Member" text,
"2nd Party" text
) | Which 1st Party has a 2nd Member of william rawson shaw, and a 1st Member of sir james stansfeld? | SELECT "1st Party" FROM table_12845 WHERE "2nd Member" = 'william rawson shaw' AND "1st Member" = 'sir james stansfeld' | wikisql |
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
JCRXM text,
JCXMMC text,
JCZBDM text,
JCZBJGDL number,
JCZBJGDW text,
JCZBJGDX text,
JCZBMC text,
JLDW text,
JYRQ time,
JYZBLSH text,
... | 从2007年8月3日开始,截止到2009年8月24日,请把81818459的病人总共被开出的所有检验报告单中的标本采集部位给列出来 | SELECT jybgb.BBCJBW 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.RYBH = '81818459' AND jybgb.BGRQ BETWEEN '2007-08-03' AND '2009-08-24' UNI... | css |
CREATE TABLE table_204_982 (
id number,
"party/electoral alliance" text,
"seats" number,
"change" number,
"votes" number,
"%" text
) | which one has the least vote | SELECT "party/electoral alliance" FROM table_204_982 ORDER BY "votes" LIMIT 1 | squall |
CREATE TABLE t_kc21 (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 在06年4月21日到13年11月4日期间这个4162567号医院有几个科室收取的医疗费总额高于6541.72元的啊? | SELECT COUNT(*) FROM (SELECT t_kc21.MED_ORG_DEPT_CD FROM t_kc21 JOIN t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '4162567' AND t_kc24.CLINIC_SLT_DATE BETWEEN '2006-04-21' AND '2013-11-04' GROUP BY t_kc21.MED_ORG_DEPT_CD HAVING SUM(t_kc24.MED_AMOUT) > 6541.72) AS T | css |
CREATE TABLE publication_keyword (
kid int,
pid int
)
CREATE TABLE domain_publication (
did int,
pid int
)
CREATE TABLE cite (
cited int,
citing int
)
CREATE TABLE author (
aid int,
homepage varchar,
name varchar,
oid int
)
CREATE TABLE domain_author (
aid int,
did in... | return me all the papers in PVLDB after 2000 in ' University of Michigan ' . | SELECT publication.title FROM author, journal, organization, publication, writes WHERE journal.name = 'PVLDB' AND organization.name = 'University of Michigan' AND organization.oid = author.oid AND publication.jid = journal.jid AND publication.year > 2000 AND writes.aid = author.aid AND writes.pid = publication.pid | academic |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE 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,
... | 查一下16年12月29日到19年4月9日这期间内,小儿肛肠外科在治疗疾病P15.892上的平均住院费用 | SELECT AVG(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.MED_ORG_DEPT_NM = '小儿肛肠外科' AND gwyjzb.IN_HOSP_DATE BETWEEN '2016-12-29' AND '2019-04-09' AND gwyjzb.IN_DIAG_DIS_CD = 'P15.892' AND gwyjzb.CLINIC_TYPE = '住院' UNION SELECT AVG(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.MED_ORG_DEPT_NM = '小儿肛肠外科' AND fgwyjzb.IN_HOSP... | css |
CREATE TABLE table_61439 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What venue was the 2000 AFC Asian Cup qualification held at? | SELECT "Venue" FROM table_61439 WHERE "Competition" = '2000 afc asian cup qualification' | wikisql |
CREATE TABLE table_name_22 (
attendance INTEGER,
week VARCHAR,
date VARCHAR
) | What is the average attendance at week earlier than 6 on October 14, 2001? | SELECT AVG(attendance) FROM table_name_22 WHERE week < 6 AND date = "october 14, 2001" | sql_create_context |
CREATE TABLE table_1621 (
"Official Name" text,
"Status" text,
"Area km 2" text,
"Population" real,
"Census Ranking" text
) | What is the population of Cardwell? | SELECT MIN("Population") FROM table_1621 WHERE "Official Name" = 'Cardwell' | wikisql |
CREATE TABLE table_name_2 (
position_in_1960_1961 VARCHAR,
clubs VARCHAR
) | What position did the Belenenses club occupy in 1960/61? | SELECT position_in_1960_1961 FROM table_name_2 WHERE clubs = "belenenses" | sql_create_context |
CREATE TABLE Lives_in (
stuid INTEGER,
dormid INTEGER,
room_number INTEGER
)
CREATE TABLE Dorm (
dormid INTEGER,
dorm_name VARCHAR(20),
student_capacity INTEGER,
gender VARCHAR(1)
)
CREATE TABLE Dorm_amenity (
amenid INTEGER,
amenity_name VARCHAR(25)
)
CREATE TABLE Has_amenity (
... | How many students are living in a dorm with a TV Lounge? Show a bar chart grouping by first name, and could you display by the x-axis in ascending? | SELECT Fname, COUNT(Fname) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid WHERE T2.dormid IN (SELECT T3.dormid FROM Has_amenity AS T3 JOIN Dorm_amenity AS T4 ON T3.amenid = T4.amenid WHERE T4.amenity_name = 'TV Lounge') GROUP BY Fname ORDER BY Fname | nvbench |
CREATE TABLE table_79989 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Opponent" text,
"Score" text
) | What is the score of the game that was played against Maria Kondratieva? | SELECT "Score" FROM table_79989 WHERE "Opponent" = 'maria kondratieva' | wikisql |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者87197835在2013-01-25以前的检验报告单是在哪些门诊就诊的?列出门诊就诊流水号 | 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 = '87197835' AND NOT mzjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ >= '2013-01-25' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb... | css |
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE comment_instructor (
instructor_id int,
student_id int,
score int,
comment_text varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_cred... | When is Research Topics being offered ? | SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o... | advising |
CREATE TABLE medicine (
id number,
name text,
trade_name text,
fda_approved text
)
CREATE TABLE enzyme (
id number,
name text,
location text,
product text,
chromosome text,
omim number,
porphyria text
)
CREATE TABLE medicine_enzyme_interaction (
enzyme_id number,
me... | For every medicine id, what are the names of the medicines that can interact with more than one enzyme? | SELECT T1.id, T1.name FROM medicine AS T1 JOIN medicine_enzyme_interaction AS T2 ON T2.medicine_id = T1.id GROUP BY T1.id HAVING COUNT(*) >= 2 | spider |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescription... | count the number of patients whose primary disease is pneumonia;human immunodefiency virus;rule out tuberculosis and year of birth is less than 2065? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "PNEUMONIA;HUMAN IMMUNODEFIENCY VIRUS;RULE OUT TUBERCULOSIS" AND demographic.dob_year < "2065" | mimicsql_data |
CREATE TABLE table_name_94 (
tournament VARCHAR
) | What is the 2009 entry for the row that has a 2007 entry of A and a tournament entry of US Open? | SELECT 2009 FROM table_name_94 WHERE 2007 = "a" AND tournament = "us open" | sql_create_context |
CREATE TABLE table_name_71 (
alvin_greene__d_ VARCHAR,
jim_demint__r_ VARCHAR
) | What was the vote for Alvin Green when Jim DeMint was 62%? | SELECT alvin_greene__d_ FROM table_name_71 WHERE jim_demint__r_ = "62%" | sql_create_context |
CREATE TABLE table_71383 (
"Name" text,
"Street address" text,
"Years as tallest" text,
"Height ft / m" text,
"Floors" real
) | Name the years as tallest when floors are larger than 18 | SELECT "Years as tallest" FROM table_71383 WHERE "Floors" > '18' | wikisql |
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,... | 在医院6541262中就诊科室名称不包含正骨科的所有医疗就诊记录有哪些属于患者24171615? | SELECT * FROM t_kc21 WHERE t_kc21.PERSON_ID = '24171615' AND t_kc21.MED_SER_ORG_NO = '6541262' AND NOT t_kc21.MED_ORG_DEPT_NM LIKE '%正骨科%' | css |
CREATE TABLE table_name_14 (
programming VARCHAR,
channel VARCHAR
) | Which Programming has a Channel of 35.4? | SELECT programming FROM table_name_14 WHERE channel = 35.4 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.