April 1st, 2013, 06:15 PM
Understanding VIEWS in SQL
Are these statements true or false?
1 - Views do not have a tabular structure, they are just custom designed queries and do not carry any data and so they take only few bytes of data.
2 - It takes longer processing time to retrieve data from a view compared to a table because the system has to query the table first and build the view, then retrieve the data from the view.
3 - Views are only SELECT statemets.
4 - Creating views is limiting too. One won't be able to change the tables structure as the views wont be able to work no more.
April 1st, 2013, 07:51 PM
4 true or false, depending on the change
April 1st, 2013, 08:45 PM
2 doesn't make sense to be false.
Originally Posted by r937
April 1st, 2013, 11:50 PM
that's because this part is wrong --
Originally Posted by zxcvbnm
because the system has to query the table first and build the view, then retrieve the data from the view.it doesn't "build the view" that way at all
instead, it uses the view definition to merge with the SELECT statement that references the view, then simple executes the resulting query
(yeah, it takes a few more cycles to combine the sql from two sources, but that's insignificant compared to data retrieval)