*****************************************************
CPE 366                                 Alex Dekhtyar
Cal Poly		  Computer Science Department
San Luis Obispo                College of Engineering 
California                   dekhtyar@csc.calpoly.edu
*****************************************************
                                         Mark Edwards
Cal Poly                    Animal Science Department   
San Luis Obispo                College of Agriculture
California                       msedward@calpoly.edu
*****************************************************
		 NUTRITION DATASET
                   Version 1.0
                February 2, 2008
*****************************************************
Sources: The data is provided by Dr. Mark Edwards 
         (Animal Science, Cal Poly). The dataset contains
         both real data, describing the animal units
         on Cal Poly campus, and the animal nutrition
         information, and simulated data.
******************************************************

This file describes the contents of the NUTRITION dataset
developed for the CPE 366, Database Design, Modeling and 
Implementation course at Cal Poly.

The dataset contains information about a large half-marathon
race that took place at some point somewhere in New England.
Each row represents information about one race participant,
and his/her achievements in the race.


General Conventions.

 1. All files in the dataset are CSV (comma-separated values) files.
 2. First line of each file provides the names of
    columns. Second line may be empty, or may contain
    the first row of the data.
 3. All string values are enclosed in single quotes (')
 

  The dataset contains the following files:

     - animals.csv     : information about animals
     - taxon.csv       : information about animal taxonomy
     - locations.csv   : information about farm locations 
                         for animal hosting
     - ingredient_categories.csv: information about categories of 
                         ingredients (feed) used by the nutritionists
                         in creating diets
     - ingredients.csv : information about ingredients used in creating
                         diets
     - diets.csv       : information about animal diets
     - diet_assignments.csv : infromation about assignment of diets
                         to animals
     - location_assignment.csv: information about of animal placement
                         in various farm locations
     - inventory.csv   : information about the quantity of ingredient stock
     - withdrawls.csv  : information about the ingredient stock depletion
     - users.csv       : information about user accounts associated with 
                         the database application


 Individual files have the following formats.

**************************************************************************

animals.csv

            HouseName : Name of the animal
        Color_NeckBand: color of the neck band worn by the animal
           ID_NeckBand: ID number on the animal's neckband
   ID_UELN Transponder: ID number of the RFID transponder of the animal
              ID_Other: any other form of identification of the animal
                        (optional)
            Date_Birth: Date of birth of the animal
             OwnerName: name of the animal's owner
               Date_In: date the animal arrived to the unit

Note: current dataset does not include animal gender. This may change in
      future versions.

Note: current dataset does not include animal species/breed (from taxon)
      for each animal. This may change in future versions.

**************************************************************************

taxon.csv
 
               GroupName : common name of the species group (e.g., "cow")
          Scientific Name: scientific name of the species/breed
             Common Name : common name of the species/breed



**************************************************************************

locations.csv

             LocationID : Unique identifier of each location (internal)
         Destination_Hx : Another unique identifier of each location
                          (used by the nutrition program)
                Name_Hx : name of the location (not unique)
             Space_Type : Type of space (Barn, Paddock, Pasture, ...)
               Capacity : Maximum allowed number of animals that can
                          be hosted in the space          
  Space_Designation_New : color code for the space
Subspace_Designation_New: subspace identifier (stall number for barns)
             Size_acres : size of the space in acres (only for pastures)
              Size_sqft : size of the space in square feet (unavailable
                          for current data)


**************************************************************************
ingredient_categories.csv
 
           Category_Id : unique identifier of ingredient categories 
                         (internal)
        Forage_category: main category of the ingredient (number)
     Forage_SubCategory: subcategory of the ingredient (number)
   Category Description: description of the category (string)

**************************************************************************

ingredients.csv

           Ingredient ID: unique identifier of ingredients (internal)
     Ingredient Category: category of the ingredient (see 
                          ingredient_categories.Category_ID)  
  Ingredient Description: description of the ingredient
              ORDER UNIT: unit of measurement in which the ingredient
                          is typically purchased
       Order Unit Weight: weight of one order unit of ingredient           
      Order Unit Measure: the unit in which the order unit is weighted
         Order Unit Case: unit in which the ingredient is delivered/
                          stocked (usually same as order unit, on occasion,
                          differs)
         Order Unit/Case: number of order units of ingredient per case.
              ISSUE UNIT: unit of measurement in which the ingredient is
                          depleted from the inventory (typically)
       Issue Unit Weight: weight of one issue unit of ingredient
      Issue Unit Measure: the unit in which the issue unit is weighted
                   Unit : additional unit of ingredient measurement
                    WGT : weight of one additional unit of ingredient
                MEASURE : unit of measure of additional units of ingredient

                   UNIT : another additional unit of ingredient measurement
                   WGT  : weight of UNIT
                MEASURE : unit of measure
                
                  $/UNIT: price per unit of ingredient
                    $/LB: price per 1 LB of ingredient
                    $/KG: price per 1 KG of ingredient
                  SOURCE: ingredient supplier
              MANUFAC_ID: id of the manufacturer of the ingredient

Note: UNIT, WGT (second column with this name) and MEASURE (second column
      with this name) are all G (for gramm), 1.0 and G (for gramm) 
      respectively.

Note: $/UNIT, $/LB, $/KG are missing for all ingredients in the dataset.


Note: when converting, measurement information needs to be stored elsewhere.

Note: MANUFAC_ID is not used in the dataset


**************************************************************************

diets.csv
       
Note: this file has two types of rows. Rows of type 1 include information
      about the type of diet (and its category/subcategory), AS WELL
      as information about one ingredient assignment within the diet.
      Rows of type 0 include only information about ingredient assignments
      for the diet described in the closest (from the top) row of type 1.

       Row_Type : type of row. 1 - contains general diet information + 
                                   ingredient assignment.
                               0 - contains ingredient assignment.
        Diet_ID : unique ID of the diet (Row_Type = 1)
       Diet_Type: type of the diet (e.g., "Standard") (Row_Type=1)
    Diet_SubType: subtype of the diet (Row_Type=1)
 Diet_Subsubtype: subsubtype of the diet (Row_Type=1)
         Feeding: meal number within a single diet (all Row_Type values)
       Food_Item: ordinal of a food item (ingredient) within the meal
                  (all Row_Type values) (see ingredients.Ingredient ID)
Ingredient_Description: description of the ingredient (see 
                  Ingredients.Ingredient Description)
          Amount: quantity of ingredient to be administered during the
                  given meal
      Issue_Unit: unit of the amount
    Issue_Weight: weight of the unit of the amount
   Issue_Measure: measure of the weight of the unit of the amount
               S: whether the meal is administered on Sunday   (Y/N)
               M: whether the meal is administered on Monday   (Y/N)
               T: whether the meal is administered on Tuesday  (Y/N)
               W: whether the meal is administered on Wednsday (Y/N)
               R: whether the meal is administered on Thursday (Y/N)
               F: whether the meal is administered on Friday   (Y/N)
              St: whether the meal is administered on Saturday (Y/N)
       Meal_Note: note on the meal
       Diet_Note: note on the diet
      
  
Note: There is no column indicating the time of each meal. However, this
       information is found inside the Meal_Note column in the form of 
       "AM" or "PM". 
  
**************************************************************************

diet_assignments.csv

    ID_NeckBand : Neckband id of an animal (see animals.ID_NeckBand and 
                  Note below)
         DietId : unique identifier of the diet (see diets.Diet_ID)
   Date_Assigned: date the diet was assigned to the specimen
     Assigned_By: userId of the user who completed the diet assignment
                  (see users.userId)

Note: Neckband ID is used as a unique identifier of the animal for this 
      dataset, because all Neckband IDs in the dataset are unique. This
      shall be treated as internal affair. That is, this was done for
      convenience sake and it SHALL NOT affect YOUR choice of the
      primary key for the specimens (animals) table.

Note: Only the assignment date is recorded in each row. 


**************************************************************************

location_assignment.csv

   ID_NeckBand : Neckband id of an animal (see animals.ID_NeckBand and 
                  Note below)
    LocationId : unique identifier of the loction (see locations.LocationID)
  Date_Assigned: date the location assignment is made
         UserID: userId of the user who authorized the assignment
                 (see users.userID)

Note: Neckband ID is used as a unique identifier of the animal for this 
      dataset, because all Neckband IDs in the dataset are unique. This
      shall be treated as internal affair. That is, this was done for
      convenience sake and it SHALL NOT affect YOUR choice of the
      primary key for the specimens (animals) table.           

Note: Only the destination location is recorded in each row.

**************************************************************************

inventory.csv

        Ingredient ID : unique id of the ingredient 
                        (see ingredients.Ingredient ID)  

Ingredient Description: description of the ingredient
                        (see ingredients.Ingredient Description)
                 Unit : unit in which the inventory is specified
              Quantity: quantity of the ingredient in stock
                  date: date of the inventory entry
                  user: userID of the user who recorded the inventory
                        (see users.userID)

**************************************************************************

withdrawls.csv

            Date : date of the ingredient withdrawl
            Time : time of the ingredient withdrawl
     IngredientID: unique identifier of the ingredient withdrawn
                   (see ingredients.Ingredient ID)
         Quantity: amount of the withdrawn ingredient
             Unit: unit in which the amount is measuered
           UserId: userId of the user who recorded (and performed?) the 
                   withdrawl


**************************************************************************
users.csv

                UserId : unique id of the user of the application
                   Name: Name of the user
          User Category: category of the user (string), defines permissions
 User Category Numeric : category of the user (number)
 
Note: User Category -> User Category Numeric   and
      User Category Numeric -> User Category are 
      asserted on this table.


**************************************************************************
**************************************************************************



**************************************************************************
**************************************************************************