3 ms·
I believe this is what foreign keys are for, and also, they are usually both ints/uuids/etc so generally they are interchangeable. I fail to see how custome
by fleitz 11y ago
I believe this is what foreign keys are for, and also, they are usually both ints/uuids/etc so generally they are interchangeable.
I fail to see how
customer.id = product.id
is any less obvious of a bug than
customer.customerID = product.productID
- jessaustin 11y agoWith aliases that first expression might be: c.id = p.id That seems like an easy error to make...
- liotier 11y ago> With aliases that first expression might be: c.id = p.id Which is why I don't use aliases, so that future me doesn't have to wonder what the hell he wrote a few months ago.
- rlucas 11y agoOnce an application has been alive for more than a few months, I find it often is subject to self-joins and other query approaches which pretty much beg for aliases in the name of legibility.
- dsp1234 11y agosubject to self-joins and other query approaches Which means that the original argument about reserveration_id vs id doesn't matter since it's likely that both table and column aliases would be needed anyways.