Views

Views provide an alternative to direct reference of Babase tables. Views appear to be tables, but are really pre-composed queries into the underlying Babase tables. Views can be used almost anywhere in Babase in place of a table, specifically, they can be queried just like tables. An SQL query can freely intermix the use of tables and views.

Important

Babase uses views to hide implementation details, details that may change as Babase develops. Tables that have names ending in _DATA should not be used, there is always a view of the data in these tables that may be used in their place. Tables ending in _DATA may change in future Babase minor releases, breaking queries and programs that use the table. Use of the corresponding views will ensure compatibility with future Babase releases.

Views make it easy to reuse complex or commonly used queries, or portions of queries. They allow a database designed around the capabilities of the computer to be interacted with in a fashion that makes sense to people. Although the views do not appear in the entity relationship diagrams that document the underlying database, and so are omitted from the high level overview these diagrams provide, most Babase users will greatly benefit if they take the time to understand how the views fit into the overall database and will usually find it easier to work with the views than with the underlying tables.

Table 2.4. The Babase Views

Group Membership and Life Events
View One row for each Purpose Tables/Views used
CENSUS_DEMOG CENSUS row Maintenance of CENSUS rows that are extended with DEMOG information. CENSUS, DEMOG
CENSUS_DEMOG_SORTED CENSUS row Maintenance of CENSUS_DEMOG rows in a pre-sorted fashion. CENSUS, DEMOG
CYCPOINTS_CYCLES CYCPOINTS row Maintenance of CYCPOINTS rows that are extended with CYCLES information. CYCLES, CYCPOINTS
CYCPOINTS_CYCLES_SORTED CYCPOINTS row The CYCPOINTS_CYCLES view sorted by CYCLES.Sname, by CYCPOINTS.Date. CYCLES, CYCPOINTS
DEMOG_CENSUS DEMOG row Maintenance of DEMOG rows. CENSUS, DEMOG
DEMOG_CENSUS_SORTED CENSUS row Maintenance of DEMOG_CENSUS rows in a pre-sorted fashion. CENSUS, DEMOG
GROUPS_HISTORY GROUPS row Depiction of GROUPS rows in a more human-readable format. GROUPS
PARENTS BIOGRAPH row for which there is either a row in MATERNITIES with a record of the individual's mother or there is a row in DAD_DATA with a record of the individual's father -- with a non-NULLDad_consensus. Easy access to parental information. BIOGRAPH, MATERNITIES, DAD_DATA, MEMBERS
POTENTIAL_DADS (completed) female reproductive event for every male more than 2192 days old (approximately 6 years) present in the mother's group during her fertile period Research into paternity, especially the selection of potential fathers for further genetic testing. MATERNITIES, MEMBERS (multiple times), ACTOR_ACTEES (multiple times), BIOGRAPH, RANKDATES, MATUREDATES
PROPORTIONAL_RANKS RANKS row Automatic calculation of proportional ranks from the ordinal ranks in RANKS. RANKS
 
Physical Traits
View One row for each Purpose Tables/Views used
ESTROGENS HORMONE_RESULT_DATA row with an estrogen kit Easy access to estrogen data. BIOGRAPH, HORMONE_KITS, HORMONE_PREP_DATA, HORMONE_PREP_SERIES, HORMONE_RESULT_DATA, HORMONE_SAMPLE_DATA, TISSUE_DATA, UNIQUE_INDIVS
GLUCOCORTICOIDS HORMONE_RESULT_DATA row with a glucocorticoid kit. Easy access to glucocorticoid data. BIOGRAPH, HORMONE_KITS, HORMONE_PREP_DATA, HORMONE_PREP_SERIES, HORMONE_RESULT_DATA, HORMONE_SAMPLE_DATA, TISSUE_DATA, UNIQUE_INDIVS
HORMONE_PREPS HORMONE_PREP_DATA row Presents HORMONE_PREP_DATA with identifying information from TISSUE_DATA and BIOGRAPH. Also useful for maintaining data in HORMONE_PREP_DATA. BIOGRAPH, HORMONE_PREP_DATA, HORMONE_PREP_SERIES, HORMONE_SAMPLE_DATA, TISSUE_DATA, UNIQUE_INDIVS
HORMONE_RESULTS HORMONE_RESULT_DATA row Presents HORMONE_RESULT_DATA with identifying information from TISSUE_DATA and BIOGRAPH. Also useful for maintaining data in HORMONE_RESULT_DATA. BIOGRAPH, HORMONE_KITS, HORMONE_PREP_SERIES, HORMONE_RESULT_DATA, HORMONE_SAMPLE_DATA, TISSUE_DATA, UNIQUE_INDIVS
HORMONE_SAMPLES HORMONE_SAMPLE_DATA row Presents HORMONE_SAMPLE_DATA with identifying information from TISSUE_DATA and BIOGRAPH. Also useful for maintaining data in HORMONE_SAMPLE_DATA. BIOGRAPH, HORMONE_SAMPLE_DATA, TISSUE_DATA, UNIQUE_INDIVS
PROGESTERONES HORMONE_RESULT_DATA row with a progesterone kit. Easy access to progesterone data. BIOGRAPH, HORMONE_KITS, HORMONE_PREP_DATA, HORMONE_PREP_SERIES, HORMONE_RESULT_DATA, HORMONE_SAMPLE_DATA, TISSUE_DATA, UNIQUE_INDIVS
TESTOSTERONES HORMONE_RESULT_DATA row with a testosterone kit. Easy access to testosterone data. BIOGRAPH, HORMONE_KITS, HORMONE_PREP_DATA, HORMONE_PREP_SERIES, HORMONE_RESULT_DATA, HORMONE_SAMPLE_DATA, TISSUE_DATA, UNIQUE_INDIVS
THYROID_HORMONES HORMONE_RESULT_DATA row with a thyroid hormone kit. Easy access to thyroid hormone data. BIOGRAPH, HORMONE_KITS, HORMONE_PREP_DATA, HORMONE_PREP_SERIES, HORMONE_RESULT_DATA, HORMONE_SAMPLE_DATA, TISSUE_DATA, UNIQUE_INDIVS
WOUNDSPATHOLOGIES WP_AFFECTEDPARTS row Querying of wounds/pathologies data (without heal updates). WP_REPORTS, WP_OBSERVERS, WP_DETAILS, WP_AFFECTEDPARTS, BODYPARTS
WP_DETAILS_AFFECTEDPARTS WP_AFFECTEDPARTS row Upload of WP_DETAILS and WP_AFFECTEDPARTS rows. WP_DETAILS, WP_AFFECTEDPARTS, BODYPARTS
WP_HEALS WP_HEALUPDATES row Upload and viewing of WP_HEALUPDATES rows. WP_REPORTS, WP_DETAILS, WP_AFFECTEDPARTS, BODYPARTS, WP_HEALUPDATES
WP_REPORTS_OBSERVERS WP_REPORTS row Upload of WP_REPORTS and WP_OBSERVERS rows. WP_REPORTS, WP_OBSERVERS
Sexual Cycles
View One row for each Purpose Tables/Views used
CYCLES_SEXSKINS CYCLES row Maintenance of SEXSKINS rows. CYCLES, SEXSKINS
CYCLES_SEXSKINS_SORTED CYCLES row The CYCLES_SEXSKINS view sorted by CYCLES.Sname, by SEXSKINS.Date. CYCLES, SEXSKINS
MATERNITIES birth or fetal loss Summarizes (completed) reproductive events. BIOGRAPH, PREGS, CYCPOINTS, CYCLES
MTD_CYCLES CYCLES row Presents CYCLES together with Mdate, Tdate, and Ddate CYCPOINTS information for a view of an "entire" sexual cycle as a single row. CYCLES, CYCPOINTS
SEXSKINS_CYCLES SEXSKINS row Maintenance of SEXSKINS rows. CYCLES, SEXSKINS
SEXSKINS_CYCLES_SORTED SEXSKINS row The SEXSKINS_CYCLES view sorted by CYCLES.Sname, by SEXSKINS.Date. CYCLES, SEXSKINS
SEXSKINS_REPRO_NOTES SEXSKINS row, or REPRO_NOTES row Maintenance of SEXSKINS rows. CYCLES, REPRO_NOTES, SEXSKINS
 
Social and Multiparty Interactions
View One row for each Purpose Tables/Views used
ACTOR_ACTEES INTERACT row Maintenance of social interaction data, INTERACT rows and POINTS. A view optimized for highest performance when working with these tables. Analysis of social interaction data. INTERACT, PARTS
INTERACT INTERACT_DATA row Presents INTERACT_DATA with additional date and time columns that transform the underlying date and time columns in useful and interesting ways. INTERACT_DATA
INTERACT_SORTED INTERACT_DATA row Presents the INTERACT view sorted in a fashion expected to ease maintenance. INTERACT_DATA
MPI_EVENTS MPI_DATA row Analysis and correction of multiparty interaction data. MPI_DATA, MPI_PARTS, MPIACTS
POINTS POINT_DATA row Presents POINT_DATA with the Ptime column transformed into a column that may be useful and interesting. POINT_DATA
POINTS_SORTED POINTS row Presents POINTS sorted by Sid, and within that by Ptime. POINTS
SAMPLES_GOFF SAMPLES row Presents SAMPLES with an additional column Grp_of_focal, which has the group of the focal at the time of sampling. SAMPLES
 
Darting
View One row for each Purpose Tables/Views used
ANESTH_STATS unique ANESTHS.Dartid value -- for each darting during which additional anesthetic was administered Analysis and eyeballing of data involving additional administration of anesthetic when darting. ANESTHS
BODYTEMP_STATS unique BODYTEMPS.Dartid value -- for each darting having body temperature measurements Analysis and eyeballing of darting body temperature measurements. BODYTEMPS
CHEST_STATS unique CHESTS.Dartid value -- for each darting having chest circumference measurements Analysis and eyeballing of darting chest circumference measurements. CHESTS
CROWNRUMP_STATS unique CROWNRUMPS.Dartid value -- for each darting having crown-to-rump measurements Analysis and eyeballing of darting crown-to-rump measurements. CROWNRUMPS
DSAMPLES unique DARTINGS.Dartid value -- for each darting Visualization of all samples collected per darting. DARTINGS, MEMBERS, DART_SAMPLES
DENT_CODES unique TEETH.Dartid value -- for each darting with recorded tooth information Perusal and maintenance of TEETH rows by kind of tooth. TEETH
DENT_SITES unique TEETH.Dartid value -- for each darting with recorded tooth information Perusal of TEETH rows by position in the mouth. TEETH, TOOTHCODES
HUMERUS_STATS unique HUMERUSES.Dartid value -- for each darting having humerus length measurements Analysis and eyeballing of darting humerus length measurements. HUMERUSES
PCV_STATS unique PCVS.Dartid value -- for each darting having PCV measurements Analysis and eyeballing of darting PCV measurements. PCVS
TESTES_ARC_STATS unique TESTES_ARC.Dartid value -- for each darting having at least one measurement of testes length or width circumference Analysis of testes length and width measurements taken during darting. TESTES_ARC
TESTES_DIAM_STATS unique TESTES_DIAM.Dartid value -- for each darting having at least one measurement of testes length or width diameter Analysis of testes length and width measurements taken during darting. TESTES_DIAM
ULNA_STATS unique ULNAS.Dartid value -- for each darting having ulna length measurements Analysis and eyeballing of darting ulna length measurements. ULNAS
VAGINAL_PH_STATS unique VAGINAL_PHS.Dartid value -- for each darting having vaginal pH measurements Analysis and eyeballing of darting vaginal pH measurements. VAGINAL_PHS
 
Inventory
View One row for each Purpose Tables/Views used
LOCATIONS_FREE LOCATIONS row that isn't used in NUCACID_DATA or in TISSUE_DATA Querying of available ("free") locations for storing new samples LOCATIONS, NUCACID_DATA, TISSUE_DATA
NUCACID_CONCS NUCACID_CONC_DATA row Converting and standardizing units of nucleic acid concentration NUCACID_CONC_DATA, NUCACID_CONC_METHODS, NUCACID_LOCAL_IDS
NUCACIDS NUCACID_DATA row Showing data about nucleic acids in a human-readable format NUCACID_DATA, TISSUE_DATA, UNIQUE_INDIVS, BIOGRAPH, NUCACID_LOCAL_IDS, NUCACID_SOURCES
NUCACIDS_W_CONC NUCACID_DATA row Showing data about nucleic acids in a human-readable format, including concentrations from the most-recent quantifications NUCACID_DATA, NUCACID_CONC_DATA, TISSUE_DATA, UNIQUE_INDIVS, BIOGRAPH, NUCACID_LOCAL_IDS, NUCACID_SOURCES
TISSUES TISSUE_DATA row Showing data about tissue samples in a human-readable format TISSUE_DATA, UNIQUE_INDIVS, BIOGRAPH, TISSUE_LOCAL_IDS
TISSUES_HORMONES TISSUE_DATA row Providing an expanded set of information about tissue samples used for hormone analysis. Also useful for simultaneous upload of data to TISSUE_DATA and HORMONE_SAMPLE_DATA TISSUE_DATA, UNIQUE_INDIVS, BIOGRAPH, TISSUE_LOCAL_IDS, HORMONE_SAMPLE_DATA
 
SWERB Data (Group-level Geolocation Data)
View One row for each Purpose Tables/Views used
QUADS QUAD_DATA row Querying of X, Y coodinates from and maintenance of QUAD_DATA rows. QUAD_DATA
SWERB SWERB_DATA row -- for every SWERB event, departure from camp excluded Collects SWERB related information spread among several tables and separates geolocation points into X and Y coordinates. SWERB_DATA, QUADS, SWERB_BES, SWERB_DEPARTS_DATA, SWERB_DEPARTS_GPS
SWERB_DATA_XY SWERB_DATA row -- for every SWERB event, departure from camp excluded Separates SWERB_DATA geolocation points into X and Y coordinates for ease of maintenance. SWERB_DATA
SWERB_DEPARTS SWERB_DEPARTS_DATArow -- for every departure from camp of every observation team, for those observation teams which have collected SWERB data Collects departure related information spread among several tables and separates geolocation points into X and Y coordinates. SWERB_DEPARTS_DATA, SWERB_DEPARTS_GPS
SWERB_GW_LOCS SWERB_GW_LOC_DATA row -- for every geolocation of an object, of a grove or waterhole Collects SWERB grove and waterhole location information spread between tables and separates geolocation points into X and Y coordinates. SWERB_GW_LOC_DATA, QUADS
SWERB_GW_LOC_DATA_XY SWERB_GW_LOC_DATA row -- for every geolocation of an object, of a grove or waterhole Separates SWERB_GW_LOC_DATA geolocation points into X and Y coordinates for ease of maintenance. SWERB_GW_LOC_DATA
SWERB_LOC_GPS_XY SWERB_LOC_GPS row -- for every time a group is observed at a geolocated physical object, usually a grove or waterhole, and 2 GPS waypoints are required to by the protocol to collect the data Separates SWERB_LOC_GPS geolocation points into X and Y coordinates for ease of maintenance. SWERB_LOC_DATA, ADCODES
SWERB_LOCS SWERB_LOC_DATA row -- for every time a group is observed at a geolocated physical object, usually a grove or waterhole Presents the relationship between the groups and physical features of the landscape in a more comprehensive manner for simpler querying. SWERB_LOC_DATA, ADCODES
SWERB_UPLOAD row uploaded into SWERB This view returns no rows, it is used only to upload data into the swerb portion of Babase. SWERB_DEPARTS_DATA, SWERB_DEPARTS_GPS, SWERB_BES, SWERB_DATA, SWERB_LOC_DATA
 
Weather Data
View One row for each Purpose Tables/Views used
MIN_MAXS WREADINGS row Analysis and correlation of manually collected weather data. WREADINGS TEMPMINS TEMPMAXS RAINGAUGES
MIN_MAXS_SORTED WREADINGS row The MIN_MAXS view sorted for convienience. WREADINGS TEMPMINS TEMPMAXS RAINGAUGES

In addition to the above views there are a number of views which produce the group of a referenced individual as of a pertinent date. These views are all named after the table from which they are derived, with the addition of the suffixed _GRP. They are nearly identical to the table from which they derive, differing only by the addition of a column named Grp. The views which produce an individual's group are listed in the following table.

Table 2.5. The table_GRP Views



Page generated: 2024-04-18T15:21:50-04:00.