Treffynnon
Joined 16 years ago
Joined 16 years ago
An illustration in bad pseudocode:
PRIMARY KEY (account_number, transaction_date) SELECT
-- first_name
, last_name
, email_address
FROM users
When parsed it will look like this query error to the system: SELECT
, last_name
, email_address
FROM usersAvoid - in this context means that where it does not make sense (for performance, readability, etc reasons) then don't follow the guide. Follow it where possible and be mindful of when you deviate that you're adding to tech debt.
The indexes set out against a table can generally be accessed with a query making it very easy to work out what existing index suits your use case best.
Try - in this context means where it doesn't make sense (for performance, readability, etc reasons) then don't follow the guide. Follow it where possible and be mindful of when you deviate that you're adding to tech debt.
1. putting the comma before doesn't actually make commenting out columns easier - it just moves the problem to the other end of the list. Just try commenting out `first_name` in your example and you'll see what I mean.
2. because normal convention would be for the comma to come immediately after an item in written English.
Not all players will be on the same team, but they still participate in the league so I disagree with this example terminology shift.
You would end up with a slightly more generalised naming like this in my opinion:
- athletes - teams - leagues
In this particular case there are no suitable collective terms.
What I meant is that if you don't have a unique column to make, say, a primary key with then you need to make it unique by adding (an)other column(s) to it in the key definition. Each additional column being a degree of difference/separation in my mind as I was writing it.
I hope that explanation makes sense and doesn't confuse the issue further.
I'd like to get your feedback on what you think it could say to make this clearer - I want to convey:
a. it must be unique.
b. you can have multi-column keys (some users - especially those tied to an ORM - don't actually know that you can do this).