Primary Key

A primary key is a column or a group of columns which uniquely identifies the record in the table. If more than one column is used, it is called a composite key.

NetForum keys have the following properties:

  • They are a single column, not composite keys.
  • They are datatype: av_key. This is a custom data type base on the uniqueidentifier data type. The data stored in these columns are GUIDs.
  • They follow the NetForum naming convention. The primary key should end with a "_key" suffix. In most cases the primary key name will be the prefix of the table plus this suffix. For example, the prefix for ev_event is "evt". So the primary key of this table is "evt_key".
  • There are cases where the table is a sub-table of another NetForum table. This is different than a child table, in that, the sub-table has a one to one relationship with the main table. For example, the ev_event_fee table is a sub-table of the oe_product table. It is used to store additional product information which relates only to Event Fees. Because of the one to one relationship between these tables, the primary key of the ev_event_fee table is "fee_prd_key", which is also a foreign key which links to oe_product. It inherits its primary key from the main table.

See Also