Match: Format: Sort by:
Search:

Database Coding Standards

Entity Relationship (ER) diagrams / schema

We like ER diagrams for DBs. We prefer the crows foot notation for relationships. Label each end of the relationship line with 1 or n and label the relationship with a helpful name. dia is our, current, ER diagramming tool. We sometimes use tedial2sql for translating ER to SQL.

See, also, Entity-relationship model

dia does not seem to do crows-feet so we can use:

Describe the relationship (e.g. uto_has_uto_shortlist to relate uto and uto_shortlist with a 1 (uto) to many (uto_shortlist), and define the field name used for the relationship (e.g. uto_crsid or uto_id).

e.g. uto_has_uto_shortlit (uto_crsid)

Procedural language element naming

Procedure/function name: what it does.

Table Names

Use underscores for join tables. For example a join table for customers and contacts would be called: Customer_Contacts

Only alphabetical characters are used except for underscores.

For all other tables the name is either one word or several concatenated together, e.g. Account, Person, ComputerOfficer

Field Names

Use underscores to separate the words that constitute the field name. e.g. Account_Name

A table "ID" field should be named as <TABLE_NAME>_ID, particular when using the field name in other tables as a foreign key.

View Names

Append view names with _view.

Trigger Names

Append view names with _trigger.