Naming Two Fields that aren't *Quite* the Same

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two tables ([tblBook] and [tblBook_Ext]) with the same number of
fields. One of the tables ([tblBook_Ext]) is updated by an external source.
Then I bring these two tables together in a query, join them using their keys
([ISBN]), and compare their fields ([Title], [Author], [Binding], etc.).

My question is a practical and a philosophical one: should these fields
share the same name, if they don't necessarily share the same values? Or
should I name them something like [Title] And [TitleExt]?
 
naming conventions are a combination of what works and what makes sense to
you; the general guideline is to be consistent in whatever naming convention
you choose to use. personally, i never name any two fields in a database
exactly the same. in your situation, since you are specifically using a
comparison query on the two tables, you may find it easier and less
confusing to name the "matching" fields in the two tables the same, then add
a common prefix or suffix to the name of each field in at least one of the
two tables. that way, can easily identify which table a particular field
belongs to - and also what the field's "mirror" field is, in the other
table.

hth
 
Murp said:
I have two tables ([tblBook] and [tblBook_Ext]) with the same number of
fields. One of the tables ([tblBook_Ext]) is updated by an external source.
Then I bring these two tables together in a query, join them using their keys
([ISBN]), and compare their fields ([Title], [Author], [Binding], etc.).

My question is a practical and a philosophical one: should these fields
share the same name, if they don't necessarily share the same values?

I think the column names should be the same in each table because they
derive from the same domain (books).

In your data dictionary they may have different class names e.g.

external_book_title_value
internal_book_title_value

When it comes to implementation, the class name is generally reflected
in the table name e.g.

CREATE TABLE ExternalBooks (
ISBN CHAR(10) NOT NULL PRIMARY KEY,
title VARCHAR (70) NOT, ...
);

CREATE TABLE InternalBooks (
ISBN CHAR(10) NOT NULL PRIMARY KEY,
title VARCHAR (70) NOT, ...
);

Jamie.

--
 
Back
Top