"Lloyd" <ll...@cdactvm.in> wrote in
message news:op.up2ds4shlq4...@rccf019
> When we create a view what happens internally in sqlite?

It just saves the SQL text in the database schema, and incorporates it, 
sort of like a subroutine, in any query that uses the view.

> Does it
> select all the data from the table and then "insert" it in to the
> view?

No. Not doing this is precisely the difference between a table and a 
view.

> or would the records in the view keep references to records in
> main table?

"Records in the view" don't physically exist, and thus cannot maintain 
any references. Besides, it's not even theoretically possible to 
implement views this way, since "records in the view" don't necessarily 
correspond to any actual record in any table. Consider for example

create view MyView as
select min(field1)*max(field2) + 42
from MyTable group by field3;

Igor Tandetnik



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to