Monday, 21 December 2015

Data fields and domains

In previous post we have seen about the entities, in this post let us see about the data fields and domains. Data field is nothing but a column header or label describing instances of an entity. The data field Customer Name describes name of each Customer. The data field Model Number identifies each model.

Domain


The complete set of all possible values that a data field may have is called a domain. For example, the domain 'Gender' may have set of values such as {Male, Female}. A domain is a set of validation criteria that can be applied to more than one data field, For example, the following data fields, 'Delivery Charge', 'Service Charge', 'Order Amount', 'Transport Cost' can be have data instances which are validated by the domain 'Amount'.

A data field may never contain values outside of its assigned domain. For example, a data field 'Quantity' assigned with the domain 'Integer' can never contain a text value such as 'One' or 'SUM'. The domain values are defined by specifying actual set of values (for example, data field 'User Role' may be limited to 'Buyer' or 'Seller') or set of rules (For example, 'Order Amount' field never contain negative values such as '-1000').


Types of Domains:


There are three different types of domains, such as Format, List, Range.

Format: Format domain specify the standard types of instances a data fields can have in database (Example-int, char, varchar, text).

List: List domain contains the finite set of values from which to choose. List domains are refinement of format domains. The format domain for Gender field might be Char(10). This domain also can be defined by list of possible values such as {male, female}.

Range: Range domain validate the set of values between the minimum and maximum gap. For example, Year of Study for bachelor degree must be between 1 to 4. 


Uses of Domain:


Domains validate the data before inserting into the fields, so that the quality fo data is maintained. For example, data field Quantity assigned with the domain Integer, never inserts a character data such as One. The domains improves the overall communication of the data model. It helps to analyse the existing model and improves the efficiency of building new model.

I hope this post will give you basic understanding of the data field, in the next post, let us see about the cardinality in data modeling.
Post a Comment