Primary key/foreign Key naming convention [closed]

If the two columns have the same name in both tables (convention #2), you can use the USING syntax in SQL to save some typing and some boilerplate noise:

SELECT name, address, amount
  FROM employees JOIN payroll USING (employee_id)

Another argument in favor of convention #2 is that it’s the way the relational model was designed.

The significance of each column is
partially conveyed by labeling it with
the name of the corresponding domain.

Leave a Comment