> >> Can I use the Guid as primary key? I am newbie to sql and mysql > >> management. > > > > Using such auto-generated surrogate keys is always a really bad idea > > and the straightest and shortest way to data inconsistency hell > > (especially through duplicates). > > you've seen two guids generate as duplicates ?
You missed my point - *exactly*. ;-) The very point of "natural" (as opposed to "surrogate") keys is that any real world "thing" (such as e.g. a person) represented by a database entity must have exactly one *and only one* matching record in the corresponding database table. Auto-generated "GUID"s are exactly what does *not* prevent the generation of several records for one single real-world "thing". By simple multiple manual entry of the same data several times due to operator error. Identifying a "thing" by a natural identifier, i.e. one that is actually unique for each and every "thing" *in the real-world* does prevent such inconsistency. I once came across an article describing one of the probably worst cases of database havoc caused by surrogate keys in computer history - the EMR system of the US veterans health administration. According to this article, they face the problem today that each and every individual veteran has an arbitrary, unknown number of corresponding database records - and there's no way to reconcile this mess due to the sheer volume and various technical issues such as typos etc. Sincerely, Wolfgang -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.