คำนวณปริมาณไขมันที่ผู้ป่วย 15107 ได้รับ 20% ในวันที่ 23/11/2104 ไม่จำเป็นต้องใช้ตารางทั้งหมด
calculate patient 15107's total intake of lipids 20% on 11/23/2104.It is not neccessary to use all the tables.
 diagnoses_icd:  row_id [ number]  subject_id [ number]  hadm_id [ number]  icd9_code [ text]  charttime [ time] 
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15107)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'lipids 20%' AND d_items.linksto = 'inputevents_cv') AND STRFTIME('%y-%m-%d', inputevents_cv.charttime) = '2104-11-23'