If you had different roles on a website perhaps, user, developer, adm开发者_如何转开发in, maybe moderators user levels.
How would a database view help? Whats the difference between querying the base table and the view table?
View is just a stored select query for popular scenario allowing execution time optimization. View is just faster than query.
Of course you can prepare special views for your website roles, and query views instead of tables to show filtered or aggregated data.
View can refer to many tables. Thus, instead of granting permissions for each table individually you can give permissions for the view. Also, underlying data in views is readonly (by default; some servers let you create editable views), as name VIEW
implies. Usually(not always!) querying views is faster than querying tables.
精彩评论