6 recruit business rules

6.1 Introduction to business rules

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

There are three recognised 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.

Formula and Validation rules are implemented by referential constraints, range checks, and algorithms both in the database and during validation.

Validation rules may be part of the preloading checks on the data as opposed to constraints or checks imposed by the database. These rules sometimes state that a value should be within a certain range. All such rules containing the word 'should' are conducted by preloading software. The use of the word 'should' in relation to these validation checks means that a warning message is generated when a value falls outside this range and the data are then checked further in relation to this value.


6.2 Summary of rules

Recruitment survey sites table (t_site)

id

Must contain an unique integer greater than 0..

site

Must have a value entered that is a valid survey site code as listed in the table t_site_codes.

samp_date

The sample date must be a legitimate date on or after 1 October 1996.

time_of_day

Time of the sample must be a valid 24-hour time and fall within the range of 0 - 2359. Also, time of the sample should be within the reasonable daylight hour's range of 600 - 1900.

high_tide

Time of high tide at the sample site must be a valid 24-hour time and fall within the range of 0 - 2359.

target_sp

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

no_target_sp

Must be an integer greater or equal to 0. The number of target species caught should not exceed 2000.

bycatch

Should consist of a space-separated list of bycatch species code (as listed in the curr_spp table of the rdb database) followed a integer greater than 0 that represents the number of that species caught.

comments

Can have any combination of up to 100 ASCII characters


Recruitment survey site codes table (t_site_codes)

site

Must contain a unique 3-character uppercase alphabetic code.

descrptn

Can have any combination of up to 30 ASCII characters.

map_sheet

Must be a valid NZMS 260 map sheet number. Valid map sheet prefixes range from A to Z and numbers from 1 to 50. See Appendix 2 for a complete map of the NZMS 260 map series.

grid_ref

Must be a valid combination of NZMS 260 grid northings and eastings Both northings and eastings range 0 to 999.

region

Must be a New Zealand geographic region name.



Recruitment length frequency table (t_lgth)

id

Must contain a valid sample identification number as listed in the t_site table.

species

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

measure_meth

Must contain a valid fish measurement method code as listed in the t_fish_meas_codes table of the rdb database.

lgth

Must be an integer greater than 0 and should be within the reasonable range of 30 - 200.


Multiple columns check on species and length:

The fish length should be less than the maximum-recorded fish length for the species as recorded in the curr_spp table in the rdb database.


Reasonable ranges for length by species.


Species code

minimum length

maximum length


KAH

35 1

70

no_a

Must be and integer greater than or equal to 0 and should be within the reasonable range of 1 - 50.


Updated : 16 November 2007