ID or Id

  • I prefer product_id. Using mixed case is a real p.i.t.a. on a case-sensitive server!!

    But, ProductId seems right to me if you're going to camel case.

    For example, say you had a different product id for export. I'd rather have a column name:

    ProductIdForExport

    than:

    ProductIDForExport

    Does that mean:

    Product/ID/... or

    Product/I/D/...??

    I say the latter, because if it was the former, it should have been written:

    ProductId 😀

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • ScottPletcher (1/22/2015)


    --

    But, ProductId seems right to me if you're going to camel case.

    --

    Camel case would be productId. ProductId is Pascal case 🙂

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I use ID because it looks better and feels structured in a world where structured is everything. Those that do not care about nomenclature are normally the ones who do not care about structure, which sort of makes me itch a little especially if their job is about said structure.

    I know it's picky, but it's sort of the same logic on why I would put more faith in someone who cared enough to tie his shoe versus someone who's untied shoe doesn't bother them in the database world.

    TIE YOUR SHOES! :hehe:

  • We use id, for example idProducts

  • I don't get why just "ID" is fully capitalized. Why not "addr"?

    Why is it:

    ProductID

    but:

    ProductAddr

    rather than:

    ProductADDR

    Why selectively capitalize just one abbreviation? Why the inconsistency?

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • The only proper naming convention is all caps with underscore seperators.

    On another note on the most jarring experience I had with naming conventions was using an open source ecommerce site that was developed in spain i believe so it used spanish style grammar for everything. So like name_first instead of first_name, nothing wrong with that it's just so easy to transpose it and type it the way you expect it to be.

  • ZZartin (1/23/2015)


    The only proper naming convention is all caps with underscore seperators.

    On another note on the most jarring experience I had with naming conventions was using an open source ecommerce site that was developed in spain i believe so it used spanish style grammar for everything. So like name_first instead of first_name, nothing wrong with that it's just so easy to transpose it and type it the way you expect it to be.

    Define 'proper'.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I tend to use ID, but that's I think my OCD coming in. ID is an acronym. Product is a word.

    ProductId would look funny to me.

  • Phil Parkin (1/23/2015)


    ZZartin (1/23/2015)


    The only proper naming convention is all caps with underscore seperators.

    On another note on the most jarring experience I had with naming conventions was using an open source ecommerce site that was developed in spain i believe so it used spanish style grammar for everything. So like name_first instead of first_name, nothing wrong with that it's just so easy to transpose it and type it the way you expect it to be.

    Define 'proper'.

    The one I use of course 😛

  • ScottPletcher (1/23/2015)


    I don't get why just "ID" is fully capitalized. Why not "addr"?

    Why is it:

    ProductID

    but:

    ProductAddr

    rather than:

    ProductADDR

    Why selectively capitalize just one abbreviation? Why the inconsistency?

    Exactly. I think it must be because people pronounce it eye-dee and it's all gone downhill from there.

    Perhaps some people will be swayed in future by the consistency argument.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Steve Jones - SSC Editor (1/23/2015)


    I tend to use ID, but that's I think my OCD coming in. ID is an acronym. Product is a word.

    ProductId would look funny to me.

    Acronyms are abbreviations which themselves are pronounced as words (Eg, NATO).

    ID is an initialism for Identity document. It's not an acronym.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I can live with mixed naming conventions, or even no convention, so long as the name given for each column makes sense and is consistent within the scope of that attribute.

    First, use descriptive names, not unusual abbreviations. For example, AlternateTitleID or alt_title_id, not ALTTLT.

    Another thing is, the same attribute should keep the same column name across tables. For example just use BirthDate on the Employee and Customer tables, not a table prefix like EmpBirthDate and CustBirthDate. Also, don't prefix column names with something like "FK" for foreign key. For example, ProductID on the OrderDetail table should simply be ProductID, not ProductID_FK. I guess some folks do that to avoid ambiguous names or prefixing table aliases in multi-join queries, but it's just not necessary. Prefixed aliases are simple enough to use.

    It also helps if the suffix describes the type of attribute in general. For example, "ID", "date", "desc", or "status".

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • Phil Parkin (1/23/2015)


    Steve Jones - SSC Editor (1/23/2015)


    I tend to use ID, but that's I think my OCD coming in. ID is an acronym. Product is a word.

    ProductId would look funny to me.

    Acronyms are abbreviations which themselves are pronounced as words (Eg, NATO).

    ID is an initialism for Identity document. It's not an acronym.

    Not, it isn't. ProductId stands for product identifier. To what "document" are you referring? Most manufacturing shops use CAD rather than actual documents now anyway.

    Edit:

    Same with CustomerId. Are you trying to say that means "Customer Identity Document" also??

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

  • Why selectively capitalize just one abbreviation? Why the inconsistency?

    If it involves this thing we call language, absolute consistency is elusive. As consistent as possible remains a worthy goal.

  • I think it's just that some company -- probably Microsoft -- did it in some of their early tables and people copied it without reflecting on whether it needed changed or not.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

Viewing 15 posts - 46 through 60 (of 103 total)

You must be logged in to reply to this topic. Login to reply