视图对于复杂的查询,在多次使用后,维护是一件非常麻烦的事情解决:定义视图视图本质就是对查询的一个封装定义视图123create view stuscore asselect students.*,scores.score from scoresinner join students on scores.stuid=students.id;视图的用途就是查询1select * from stuscore;操作1234567891011121314151617-- 查询视图内容等同于查询表操作SELECT * from bookallinfo where cataory = '历史传记';-- 视图实现模糊查找SELECT * from bookallinfo where bookname like "%小%";-- 更新多字段UPDATE booktable SET bookname = "小时代1",authorid=0,score = NULL where id = 2;-- 删除-- 逻辑删除和物理删除-- 逻辑删除小时代书UPDATE booktable set isdelete = "true" where id = 2-- 物理删除-- DELETE from booktable WHERE bookname = "鬼吹灯"DELETE from booktable