November 17, 2023 at 2:58 pm
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
November 17, 2023 at 3:45 pm
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!
LinkedIn: https://www.linkedin.com/in/sqlrv
Website: https://www.sqlrv.com
November 20, 2023 at 9:25 pm
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.
November 23, 2023 at 6:35 pm
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
November 24, 2023 at 4:43 am
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
Change is inevitable... Change for the better is not.
November 28, 2023 at 4:01 pm
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.
November 28, 2023 at 5:22 pm
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
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy