7 Nonfish_bycatch business rules
7.1 Introduction to business rules
The following are a list of business rules applying to the
nonfish_bycatch database. A business rule is a written statement
specifying what the information system 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.
7.2 Summary of rules
Nonfish_bycatch trip record (t_trip)
|
trip_key
|
Must be a unique integer greater than zero.
|
|
vessel_key
|
Must be a valid vessel key.
|
|
start_date
|
Must be a legitimate date after (and including) December 1996.
|
|
end_date
|
Must be a legitimate date after (and including) December 1996.
|
|
|
Multiple column checks on date:
The start date must not be later than the finish date.
The dates should be within a period of eight weeks of each
other.
|
|
observer
|
Must be a legitimate value, (i.e., None, Company, Mfish,
Both).
|
|
signature
|
Must be a valid 1 character code ("Y" = yes, "N"
= no).
|
Nonfish_bycatch station record (t_station)
|
trip_key
|
Must be equal to a trip_key as listed in the t_trip table.
|
|
station_key
|
Must be a unique integer greater than zero for a given
trip_key.
|
|
target_sp
|
Must be a valid 3 character fish species code as listed in the
curr_spp table in the rdb database.
|
|
fishing_method
|
Must be a valid 3 character fishing code, as listed in
Appendix 1.
|
|
datetime
|
The start date of the station must be a legitimate date. Time
caught must be a valid 24-hour time between 0000-2359.
|
|
|
Multiple column checks on station start date, trip start
date and trip finish date:
The station date must fall within the range of the trip start
and finish dates.
|
|
latitude
|
Must be a real number that represents a valid latitude and the
value in degrees should fall within the range of "33 to "56.
|
|
longitude
|
Must be a real number that represents a valid longitude and
the value in degrees should fall within the range of 164 to 190.
|
|
|
(Note: values greater than 180 degrees represent values
traditionally recorded as west of Greenwich).
|
Nonfish_bycatch catch record (t_catch)
|
|
Multiple columns check on trip_key and station_key:
The combination of trip_key and station_key must exist in the
t_station table.
|
|
catch_key
|
Must be a unique integer greater than zero for a given
catch_key.
|
|
species
|
Must be a valid 3 character species code as listed in the
curr_spp table in the rdb database and should be one of the valid
code as listed in Appendix 1.
|
|
number_caught
|
Must be an integer greater than zero.
|
|
sex
|
Must be a valid sex code ("0" = unsexed, "1"
= male, "2" = female, "3" = unknown-unable to
determine).
|
|
alive
|
Must be a valid 1 character code ("D" = Dead, or "A"
= Alive).
|
|
retained
|
Must be a valid 1 character code ("Y" = yes, "N"
= no).
|