Re: identity columns

From: Nis Jorgensen <nis_at_dkik.dk>
Date: Mon, 04 Feb 2002 10:48:47 +0100
Message-ID: <5pls5u0dui2i2ckbj4orhe2vqdckujtjse_at_4ax.com>


On Sun, 3 Feb 2002 00:05:06 -0500, "John" <ru_re_re_move_zel_at_ecl_re_re_move_ipse.net> wrote:

>Here's why I go for singular:
>When looking at table "Order" I see columns OrderId, Quantity, Price, etc.
>If I make the table plural - shouldn't everything be plural?

Not necessarily

>I have a number of naming rules in place so my group doesn't go
>nuts when writing database code - one of them being that if we make
>a synthetic key for a table - it's always "TableNameId" and
>OrdersId seems kinda awkward - but I know you hate those synthetic keys
>anyway <s>

Well, in the case of plural table names, I tend to use singular for the id field. The point: You have some rules you are currently using. Joe is proposing some other rules. Then you shouldn't argue that his rules don't work because they are incompatible with yours - but rather that you prefer yours for reasons 1, 2 etc

>The funny thing about this thread - however - is how somebody brought
>up the issue of books - alluding to how we should follow something because
>it's in a book. One common coding convention in SQL books is to
>use upper case for all sql keywords. The thing I found in project
>maintenance
>is that I don't care so much about the sql as I do about everything else
>in the proc, view, query or whatever it is I'm looking at.
>Case in point:
>
>case1: SELECT OrderId, Quantity FROM Orders
>-or-
>case2: select OrderId, Quantity from Orders
>
>I've been doing a little research into graphic design theory and it's
>carried over into other areas of my development life. Having something
>in UPPER CASE draws attention to it - is that where you want the
>attention drawn? I'm pretty good with the sql syntax at this point so
>I'd rather have attention drawn to the other parts of the sql code.

My 2 cents: The important part is to have the keywords and the identifiers easily distinguishable from one another. Poor man's syntax colouring.

-- 
Nis Jorgensen
Amsterdam

Please include only relevant quotes, and reply below the quoted text. Thanks
Received on Mon Feb 04 2002 - 10:48:47 CET

Original text of this message