I am modifying existing code to create a view, and was looking for commonly accepted set of style guidelines on how to rename the resulting columns in the view when the component table column names clash.
Perhaps you have written one yourself. Please share your guidelines.
CREATE OR REPLACE VIEW libraries_metadata AS
SELECT
l.id AS libraries_id
, l.description AS libraries_description
, l.name AS libraries_name
, lg.description AS library_groups_description
, lg.name AS library_groups_name
FROM
libraries l
INNER JOIN library_groups lg ON
l.library_group_id = lg.id
;
Note: I could not quickly find any guidelines on this here:
Are there any published coding style guidelines for SQL?