2 ms·
And it also breaks if two non-key columns are named the same. This makes naming key columns differently a defence technique, so you stop people from using natu
by faho 5y ago
And it also breaks if two non-key columns are named the same.
This makes naming key columns differently a defence technique, so you stop people from using natural joins.
- thom 5y agoI generally use a prefix for columns based on the relation name, but preserving the name of keys (so a foreign key to user_id is user_id, not order_user_id etc). You obviously can't use natural joins if you end up with _multiple_ foreign keys with different roles, but generally I find this a better way to live all round. Never having to rename five 'name' columns in some output to make it clear which is which etc.