Suppose I have two tables in a parent - child relationship. Let's call them "sites" and "buildings" where a "site" is a parent of one or more "buildings". I want the IDs to be unique across databases so I will be using GUIDs for the IDs.
Should I prefer generic names for the ID fields in the tables or strongly typed names and why?
Example 1 (Generic Names):
CREATE TABLE sites (
id VARCHAR(38) NOT NULL,
-- other attributes
);
CREATE TABLE buildings (
id VARCHAR(38) NOT NULL,
parent_id VARCHAR(38) NOT NULL,
-- other attributes
);
Example 2 (Strongly Typed Names):
CREATE TABLE sites (
site_guid VARCHAR(38) NOT NULL,
-- other attributes
);
CREATE TABLE buildings (
building_guid VARCHAR(38) NOT NULL,
site_guid VARCHAR(38) NOT NULL,
-- other attributes
);