What is the main advantage of views?
If we delete the table in which our view based then view will exist?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Midhun TpRank #388 · 6.5K reputationPosted Oct 28, 2016, 2:48 AM EDT
aditya immadi144 reputationPosted Oct 28, 2016, 3:24 AM EDT
Muhammad Abdullah31 reputationPosted Oct 28, 2016, 3:28 AM EDT
aditya immadi144 reputationPosted Oct 28, 2016, 3:34 AM EDT
1. Views can hide complexity
If you have a query that requires joining several tables, or has complex logic or calculations, you can code all that logic into a view, then select from the view just like you would a table.
2. Views can be used as a security mechanism
A view can select certain columns and/or rows from a table, and permissions set on the view instead of the underlying tables. This allows surfacing only the data that a user needs to see.
3. Views can simplify supporting legacy code
If you need to refactor a table that would break a lot of code, you can replace the table with a view of the same name. The view provides the exact same schema as the original table, while the actual schema has changed. This keeps the legacy code that references the table from breaking, allowing you to change the legacy code at your leisure.
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Oct 28, 2016, 4:12 AM EDT