diff --git a/删除.sql b/删除.sql new file mode 100644 index 0000000..9763862 --- /dev/null +++ b/删除.sql @@ -0,0 +1,36 @@ + +-- 删除ID为30的客户记录 +DELETE FROM customers WHERE T_id = 30; + +-- 删除所有电话号码以12开头的客户记录 +DELETE FROM customers WHERE T_phone LIKE '12%'; +-- 删除ID为001的菜单项记录 +DELETE FROM menu_items WHERE M_id = '001'; + +-- 删除所有价格大于50的菜单项记录 +DELETE FROM menu_items WHERE M_price > 50; +-- 删除ID为001的折扣规则记录 +DELETE FROM discount_rules WHERE M_id = '001'; + +-- 删除所有折扣小于0.8的折扣规则记录 +DELETE FROM discount_rules WHERE discount < 0.8; +-- 删除ID为TABLE06的餐桌记录 +DELETE FROM tables WHERE Cz_id = 'TABLE06'; + +-- 删除所有状态为空闲的餐桌记录 +DELETE FROM tables WHERE Cz_zt = '空闲'; +-- 删除ID为01的员工记录 +DELETE FROM workers WHERE W_id = '01'; + +-- 删除所有状态为0的员工记录 +DELETE FROM workers WHERE W_stat = 0; +-- 删除ID为27的订单记录 +DELETE FROM orders WHERE O_id = 27; + +-- 删除所有时间在2024-12-27之前的订单记录 +DELETE FROM orders WHERE time < '2024-12-27 00:00:00'; +-- 删除ID为20的账单记录 +DELETE FROM bills WHERE B_id = 20; + +-- 删除所有金额大于50的账单记录 +DELETE FROM bills WHERE S_price > 50;