6 age Business Rules

6.1 Introduction to business rules

The following are a list of business rules pertaining to the age database. A business rule is a written statement specifying what the information system (i.e., any system that is designed to handle fish ageing data) must do or how it must be structured.

There are three recognized types of business rules:

Fact

Certainty or an existence in the information system

Formula

Calculation employed in the information system

Validation

Constraint on a value in the information system



Fact rules are shown on the ERD by the cardinality (e.g., one-to-many) of table relationships. Referential constraints, range checks, and algorithms both in the database and during data validation implement the formula and validation type rules.



6.2 Summary of rules

Trip details (t_trip)

origin

Must be a valid data origin code as listed in the t_origin table.

Yr

Must be a valid 4 digit year less than or equal to the current year.

trip_code

Should be (but not necessarily) a valid alphanumeric code to uniquely identify a trip, survey, or landing as listed in the header tables of such databases as trawl, market, or obs_lfs.

Area

Must be a valid area code as listed in the area_codes table in the rdb table.

Species

Must be a valid species code as listed in the curr_spp table in the rdb database.

status_date

Must be a valid date.



Fish details (t_fish)

origin

Must be a valid data origin code as listed in the t_origin table.

Yr

Must be a valid 4 digit year less than or equal to the current year.

trip_code

Should be (but not necessarily) a valid alphanumeric code to uniquely identify a trip, survey, or landing as listed in the header tables of such databases as trawl, market, or obs_lfs.

sample_no

Must be an integer greater than zero.

sub_sample_no

Must contain a value. Default = "-1".

area

Must be a valid area code as listed in the area_codes table in the rdb table.

Species

Must be a valid species code as listed in the curr_spp table in the rdb database.

fish_no

Must be an integer greater than zero.

Lgth

Must be an integer greater than zero.

lgth_code

Must be either "E" or "R".

sex

Must be a valid sex code as listed in the t_sex_codes table in the rdb database.

gonad_stage Must be a valid gonad stage code as listed in the t_gon_stg_meth table in the rdb database for research data.  For observer and market sampling data must be a value of between "1" and "5".

Weight

Must be a number greater than zero.

otolith_weight

Must be a number greater than zero.

otolith_weight2

Must be a number greater than zero.

otolith_lgth

Must be a number greater than zero.

otolith_width

Must be a number greater than zero.

Material1

Must be a valid ageing material code as listed in the t_material table in the rdb database.

Material2

Must be a valid ageing material code as listed in the t_material table in the rdb database.

fish_select_meth

Must be a value of either "1", "2", or "3".



Age reading details (t_reading)

origin

Must be a valid data origin code as listed in the t_origin table.

Yr

Must be a valid 4 digit year less than or equal to the current year.

trip_code

Should be (but not necessarily) a valid alphanumeric code to uniquely identify a trip, survey, or landing as listed in the header tables of such databases as trawl, market, or obs_lfs.

sample_no

Must be an integer greater than zero.

sub_sample_no

Must contain a value. Default = "-1".

area

Must be a valid area code as listed in the area_codes table in the rdb table.

Species

Must be a valid species code as listed in the curr_spp table in the rdb database.

fish_no

Must be an integer greater than zero.

reading_no

Must be an integer greater than zero.

reading_date

Must be a valid date.

Material

Must be a valid ageing material code as listed in the t_material table in the rdb database.

Method

Must be a valid ageing method code as listed in the t_age_meth table.

Reader

Must be a valid reader code as listed in the t_reader table.

Result1}

Result3}

result4}

result5}

result6}

Must be a number greater than or equal to zero.

error1

Must be a number greater than or equal to zero.

Age

Must be a number greater than or equal to zero.



Ageing material catalog details (t_catalog)

origin

Must be a valid data origin code as listed in the t_origin table.

Yr

Must be a valid 4 digit year less than or equal to the current year.

trip_code

Should be (but not necessarily) a valid alphanumeric code to uniquely identify a trip, survey, or landing as listed in the header tables of such databases as trawl, market, or obs_lfs.

sample_no

Must be an integer greater than zero.

sub_sample_no

Must contain a value. Default = "-1".

area

Must be a valid area code as listed in the area_codes table in the rdb table.

Species

Must be a valid species code as listed in the curr_spp table in the rdb database.

fish_no

Must be an integer greater than zero.

Material

Must be a valid ageing material code as listed in the t_material table in the rdb database.

status_date

Must be a valid date.



Age details (t_age)

origin

Must be a valid data origin code as listed in the t_origin table.

Yr

Must be a valid 4 digit year less than or equal to the current year.

trip_code

Should be (but not necessarily) a valid alphanumeric code to uniquely identify a trip, survey, or landing as listed in the header tables of such databases as trawl, market, or obs_lfs.

sample_no

Must be an integer greater than zero.

sub_sample_no

Must contain a value. Default = "-1".

area

Must be a valid area code as listed in the area_codes table in the rdb table.

Species

Must be a valid species code as listed in the curr_spp table in the rdb database.

fish_no

Must be an integer greater than zero.

agreed_result1

Must be a number greater or equal to zero.

Method

Must be a valid ageing method code as listed in the t_age_meth table.

agreed_age

Must be a number greater or equal to zero.

agreed_error1

Must be a number greater or equal to zero.



Age material origin codes (t_origin)

code

Must contain a unique code.

Description

Must contain a value.



Age material type codes (t_material)

code

Must contain a unique code.

Description

Must contain a value.



Age material reader codes (t_reader)

code

Must contain a unique code.

Name

Must contain a value.

Ageing method codes (t_age_meth) code

code                                                                              Must contain a unique code.                                                             
description Must contain a value.


Updated : 5 March 2008