Overview
Thetab_emplea table stores comprehensive employee information including personal data, contact details, family information, and labor-related fields. This is the core employee master data table in the payroll system.
Table Definition
Column Reference
Basic Employee Data
Unique employee identifier (typically Colombian cédula/ID number). Primary key.
Employee first name(s). Must be at least 3 characters, cannot be empty or only whitespace.Constraint:
TRIM(nom_emplea) != '' AND LENGTH(nom_emplea) >= 3Employee last name(s). Must be at least 2 characters, cannot be empty or only whitespace.Constraint:
TRIM(ape_emplea) != '' AND LENGTH(ape_emplea) >= 2Gender indicator:
TRUE: Femenino (Female)FALSE: Masculino (Male)
Employee address. Must be at least 5 characters.Constraint:
TRIM(dir_emplea) != '' AND LENGTH(dir_emplea) >= 510-digit phone number (Colombian mobile format).Constraint:
tel_emplea = FLOOR(tel_emplea) (must be integer)Socioeconomic stratum (Colombian classification system, 1-6):
- 1: Bajo-Bajo (Very Low)
- 2: Bajo (Low)
- 3: Medio-Bajo (Medium-Low)
- 4: Medio (Medium)
- 5: Medio-Alto (Medium-High)
- 6: Alto (High)
ind_estrato BETWEEN 1 AND 6Personal Data
Marital status indicator:
- 0: Soltero (Single)
- 1: Casado (Married)
- 2: Divorciado (Divorced)
- 3: Viudo (Widowed)
- 4: Otro (Other)
ind_est_civil BETWEEN 0 AND 4Number of children (0-9).Constraint:
num_hijos >= 0 AND num_hijos = FLOOR(num_hijos)Blood type (e.g., A+, O-, AB+, etc.).
Employee age in years. Must be at least 16 (minimum working age in Colombia).Constraint:
val_edad >= 16Consider calculating from birth date instead of storing directly
Labor Data
Foreign key to tab_cargos (employee position/role).
Employee basic monthly salary in Colombian Pesos.Constraint:
val_sal_basico >= 0Date when employee joined the company.
Constraints
Primary Key
- id_emplea: Unique employee ID (cédula)
Foreign Keys
- id_cargo → tab_cargos(id_cargo)
- ON DELETE CASCADE
- ON UPDATE CASCADE
Check Constraints
- nom_emplea: Not empty, minimum 3 characters
- ape_emplea: Not empty, minimum 2 characters
- dir_emplea: Not empty, minimum 5 characters
- tel_emplea: Must be integer (10 digits)
- ind_estrato: 1-6 (Colombian socioeconomic strata)
- ind_est_civil: 0-4 (marital status codes)
- num_hijos: >= 0, must be integer
- val_edad: >= 16 (minimum working age)
- val_sal_basico: >= 0
Sample Data
Example Employees
Reference Data
Gender Codes
| ind_genero | Description |
|---|---|
| TRUE | Femenino (Female) |
| FALSE | Masculino (Male) |
Marital Status Codes
| ind_est_civil | Description |
|---|---|
| 0 | Soltero (Single) |
| 1 | Casado (Married) |
| 2 | Divorciado (Divorced) |
| 3 | Viudo (Widowed) |
| 4 | Otro (Other) |
Socioeconomic Strata (Colombian System)
| ind_estrato | Description | Characteristics |
|---|---|---|
| 1 | Bajo-Bajo | Lowest income, subsidized services |
| 2 | Bajo | Low income, partial subsidies |
| 3 | Medio-Bajo | Lower-middle income |
| 4 | Medio | Middle income |
| 5 | Medio-Alto | Upper-middle income, pays surcharges |
| 6 | Alto | High income, pays higher surcharges |
Blood Types
Common values: A+, A-, B+, B-, AB+, AB-, O+, O-Usage Examples
List All Employees
Find High Earners
Employees by Position
Calculate Years of Service
Employees by Gender
Employees Eligible for Transport Allowance
Demographics Report
Related Tables
- tab_cargos: Defines employee positions (id_cargo)
- tab_novedades: Records payroll novelties per employee
- tab_nomina: Stores final payroll calculations per employee
Notes
Colombian phone numbers (tel_emplea) typically start with 3 and have 10 digits total. Mobile numbers follow the format 3XX XXX XXXX.
The ind_estrato field is specific to Colombia’s socioeconomic stratification system, used for determining utility rates and social benefits.