Re: Updating the SQL key value



bill wrote:

I will add a autonumbering PK

Auto-numbered synthetic primary keys are the root of all evil. They usually
indicate a lazy approach to database design. There is almost always a
natural column or combination of columns that can be used as a primary key
without the need to add an extra, redundant numerical column which doesn't
contain any useful information.

Assuming that the you never plan on having two events that occur
concurrently, your "order" column is a perfect natural candidate key.
(Though it's a little poorly named, given that ORDER is a SQL keyword.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
.



Relevant Pages

  • Re: Updating the SQL key value
    ... Auto-numbered synthetic primary keys are the root of all evil. ... usually indicate a lazy approach to database design. ... What if your database must be upgraded and the logic changes? ... I don't get it why you think of that as 'the root of all evil'. ...
    (comp.lang.php)
  • Re: Updating the SQL key value
    ... Auto-numbered synthetic primary keys are the root of all evil. ... indicate a lazy approach to database design. ... natural column or combination of columns that can be used as a primary key ...
    (comp.lang.php)
  • Re: Advanced SQL
    ... For an overview to data modeling and database design. ... "The definition of second normal form states that only tables with composite ... primary keys can be in 1NF but not in 2NF" ...
    (comp.databases.theory)