作業:
4) UPDATE stmd SET depart_class="164E31" WHERE depart_class="164D21"
7) DELETE FROM stmd WHERE depart_class="164D22" AND address LIKE "台北市%";
8) DELETE FROM stmd WHERE student_no LIKE "10014G%" AND address NOT LIKE "台北市%";
葉柏鐘03-11 17:47:
作業:
3) SELECT * FROM `stmd` WHERE student_no LIKE "%D%" AND student_name LIKE "陳%"; #####
4) UPDATE stmd SET depart_class="164E31" WHERE depart_class="164D21"; #####
7) DELETE FROM stmd WHERE depart_class="164D22" AND address LIKE "台北市%"; #####
8) DELETE FROM stmd WHERE student_no LIKE "10014G%" AND address NOT LIKE "台北市%";
尤秋英04-08 18:10:
-- 4. 按廠商編號 由大到小排序,列出 ordering_xxx 資料表中 訂購 p 小於等於 '12' 的所有資料列 --
CEATE TABLE temp_xxx SELECT * FROM `ordering_xxx` WHERE p <=12 ORDER BY s DESC;
-- 另存到一個資料表 temp_xxx --
- 12. 列出 ordering_xxx 資料表中,被訂購總數量 大於 900 者的 P_id (產品編號)與 總數量
-- >> 在答案紙上寫下來即可
SELECT p, SUM(qty) AS total_quantity
FROM ordering_xxx
GROUP BY p
HAVING SUM(qty) > 900;