Unit group table

The business units of a company are typically organized into various groups or hierarchies.

For example, most companies have a geographical dispersion of units, in which case there will be groups representing continents, countries, regions, states, etc.

There may also be groups representing different brands (e.g., many hotel companies own multiple brands). There may also be groups representing the managerial hierarchies of the company, or anything else that the business wants to report aggregated data by.

A unit group has:

  • an ID by which it is referred to in query filters
  • a name used to display it to the user
  • an optional "parent pointer" that shows which super-group it belongs to (this is necessary to represent a hierarchy of groups)

Table description

DESCRIBE TABLE unitgroup
 key                | name                        | encoding |
 unitgroupid        | UnitGroup identifier        | TEXT     |
 name               | UnitGroup name              | TEXT     |
 parent_unitgroupid | Parent UnitGroup identifier | TEXT     |

Sample query

SELECT unitgroupid, name, parent_unitgroupid FROM unitgroup

Result

 unitgroupid          | name                 | parent_unitgroupid |
 Region               | Region               |                    |
 Atlantic Northeast   | Atlantic Northeast   | Region             |
 Atlantic Southeast   | Atlantic Southeast   | Region             |
 Midsouth             | Midsouth             | Region             |
 Midwest              | Midwest              | Region             |
 Northwest            | Northwest            | Region             |
 Pacific              | Pacific              | Region             |
 Southwest            | Southwest            | Region             |
 Country/State        | Country/State        |                    |
 USA                  | USA                  | Country/State      |
 Alabama              | Alabama              | USA                |
 Arizona              | Arizona              | USA                |
 Arkansas             | Arkansas             | USA                |
 California           | California           | USA                |
 District of Columbia | District of Columbia | USA                |
 Florida              | Florida              | USA                |
 Georgia              | Georgia              | USA                |
 Illinois             | Illinois             | USA                |
 Maryland             | Maryland             | USA                |
 Massachusetts        | Massachusetts        | USA                |
 Michigan             | Michigan             | USA                |
 Minnesota            | Minnesota            | USA                |
 Nevada               | Nevada               | USA                |
 New Jersey           | New Jersey           | USA                |
 New York             | New York             | USA                |
 Oregon               | Oregon               | USA                |
 South Carolina       | South Carolina       | USA                |
 Texas                | Texas                | USA                |
 Washington           | Washington           | USA                |