On Wed, 12 Jun 2013 13:55:25 +0400 dd <durga.d...@gmail.com> wrote: > I am trying minimize queries on Authors table. For every deletion of > record from Books, it needs to check in Authors table. One extra > query execution is there. I am trying minimize that.
You might not be aware of what you can do in a single query delete from authors where Name = 'Hamilton' and AuthorId not in (select AuthorId from Author_Books) That query will avoid deletion of authors represented among the books without running afoul of referential integrity constraint enforcement. HTH. --jkl _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users