qfedu-linux-advanced-level/day9/homework/h6.sql

22 lines
501 B
MySQL
Raw Normal View History

2023-08-24 21:54:42 +08:00
/*
NULL
*/
-- 进入 bookdb 数据库
USE bookdb;
-- 更新关联个人信息表数据为NULL
UPDATE profile_info SET login_id = NULL WHERE login_id = 1002;
-- 更新关联图片集表数据为NULL
UPDATE images SET user_id = NULL WHERE user_id = 1002;
-- 删除 login_id 为 1002 的用户
DELETE
FROM login
WHERE login_id = 1002;
-- 显示效果
SELECT * FROM login;
SELECT * FROM profile_info;
SELECT * FROM images;