Singular or Plural

  • This seems like a discussion from just the other day - but it was actually six years ago!

    Here is my thinking about it:

    Some tables represent entities that are "top level" like the following, and a singular name just sounds right.

    Customer (CustomerID),  Account (AccountID),  Inventory (ItemID)

    Other tables exist only in relation to a top level table. Their primary key is basically a combination of foreign keys, and a plural name makes more sense.

    Orders (CustomerID,ItemID,OrderTime),  Payments (AccountID,PaymentTime),  Visits (PatientID,ScheduleTime)

     

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

  • From one perspective, it really doesn't matter which method you choose as long as you're consistent. However, if you choose pluralism, it becomes difficult to maintain consistency.

    For example, I have a table called Customers and another called Addresses which stores all sorts of addresses. For customer-specific addresses, to maintain consistency, the relationship table would end up being CustomersAddresses. The naming gets really awkward really quickly the more you do it.

    Therefore, I personally prefer that the entity name reflect what is represented in a single record. If a single record represents a multiple of something (which would not follow data normalization rules) then let the entity name reflect that. Therefore, the name Customer, Address, and CustomerAddress become more appropriate and useful.

    I completely disagree with the notion that a singular entity name could lead one to perform RBAR processing. If it does, then you have more issues than a magazine! 😋

  • I have habits to use plural, but I've come to think singular makes more sense, especially in cases like Aaron listed where you create a join table.

  • I use singular - but will happily work with anything other than the naming convention of Oracle JDE tables I once had to work with - F0411, F300261 etc. Yeah, you get used to the common ones, but still, urgh!

    https://sqlrider.net - My technical blog

  • Aaron N. Cutshall wrote:

    From one perspective, it really doesn't matter which method you choose as long as you're consistent. However, if you choose pluralism, it becomes difficult to maintain consistency.

    For example, I have a table called Customers and another called Addresses which stores all sorts of addresses. For customer-specific addresses, to maintain consistency, the relationship table would end up being CustomersAddresses. The naming gets really awkward really quickly the more you do it.

    Therefore, I personally prefer that the entity name reflect what is represented in a single record. If a single record represents a multiple of something (which would not follow data normalization rules) then let the entity name reflect that. Therefore, the name Customer, Address, and CustomerAddress become more appropriate and useful.

    I completely disagree with the notion that a singular entity name could lead one to perform RBAR processing. If it does, then you have more issues than a magazine! 😋

    I'm on the sigular-naming thing, as well.  I normally name tables after what 1 row contains (The "Tally" and "Calendar" tables are examples of exceptions...).

    To emphasize your example, I hate the names that occur when a table is called "Companies".  Then, you would end up with CompaniesAddresses.

    And, yeah... I agree with your point on RBAR... big time!

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • sqlrider wrote:

    I use singular - but will happily work with anything other than the naming convention of Oracle JDE tables I once had to work with - F0411, F300261 etc. Yeah, you get used to the common ones, but still, urgh!

    I worked there in Operations and I was appalled by their naming. It's still the best example I have of why you don't need to rename things, but should do your best to get them right early.

  • Plural.  Each row is a singular instance

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

Viewing 7 posts - 76 through 81 (of 81 total)

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