對於複雜的查詢,在屢次使用後,維護是一件很是麻煩的事情ui
解決:定義視圖spa
視圖本質就是對查詢的一個封裝code
定義視圖blog
create view stuscore as select students.*,scores.score from scores inner join students on scores.stuid=students.id;
視圖的用途就是查詢class
select * from stuscore;