On 10 Nov 2013, at 10:54am, dd <durga.d...@gmail.com> wrote:

>  I have two tables in my database.
> 
>  After applying normalization, there are twelve tables with foreign
> key support.
> 
>  For insert/delete operations, it has to execute twelve queries
> instead of two. Is it recommended way?

You should not have to write twelve queries in your own programming.  If you 
have set up your FOREIGN KEYs correctly, SQLite should be doing that for you.  
The foreign keys facility should have allowed you to move some of your business 
model from your own programming into SQLite, which should be dealing with it in 
one place in a consistent way.

>  In delete case, do always need to check in parent table whether
> child key refers to any other rows in parent table?

Again, if you have set up your foreign keys correctly, SQLite should be doing 
the checking or deleting for you.  Whether SQLite will prevent you from 
deleting, or delete rows from other tables, depends which of these actions you 
have set up:

<http://www.sqlite.org/foreignkeys.html#fk_actions>

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

Reply via email to