On 2017/11/20 6:33 PM, Igor Korot wrote:
On Mon, Nov 20, 2017 at 10:12 AM, R Smith <rsm...@rsweb.co.za> wrote:
The reason why this is bad? Mostly a primary Key serves as a lookup for
other tables linking to a very specific record. Imagine your query that
added fruit to recipes where needed has the fruit's primary keys shuffled,
the next day will see some really weird recipes when Banana ends up where
Pear was intended.  Next you'll want to insert Watermelon...  :)
For this specific problem you have a FOREIGN KEY... ON UPDATE CASCADE.

But yes - this problem is very weird. Unless its some kind of
educational/home work....

Thank you.

Oh, yes!, good thing Igor mentioned this.

IF you do have foreign keys on that primary key that CASCADEs updates or revert the children to NULL or such, that given query can be very devastating and/or Painfully slow.
Something to keep in mind.


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

Reply via email to