
use socle;
CREATE TABLE company_compensation (
	id INT AUTO_INCREMENT PRIMARY KEY,
    
    country  varchar(255) NULL,
	city  varchar(255) NULL,
    
	site VARCHAR(1) NULL,
	matricule VARCHAR(255) NULL,
	department VARCHAR(255) NULL,
	`function` VARCHAR(255) NULL,
	internal_grade VARCHAR(255) NULL,
    
	gender VARCHAR(2) NULL,
	birthday  VARCHAR(255) NULL,
    hiring_date  VARCHAR(255) NULL,
	function_code VARCHAR(255) NULL, 
	subfunction_code VARCHAR(255) NULL, -- changed instead of discipline_code 
    
	collaborative_path VARCHAR(255) NULL, -- changed instead of level_career_path  
	grade VARCHAR(255) NULL, -- changed instead of job_grade
	number_employees_supervised INT NULL,
	devise VARCHAR(10) NULL,
	gross_annual_salary Decimal(10,3),
    
	number_monthly_salary VARCHAR(255) NULL,
	type_overtime_pay VARCHAR(255) NULL,
	seniority_bonus Decimal(10,3) NULL, -- new
	schooling_allowance Decimal(10,3) NULL, -- new
	meal_allowance Decimal(10,3)  NULL,
    
	location_allowance Decimal(10,3)  NULL,
	transportation_allowance Decimal(10,3)  NULL,
	other_bonuses_awarded_last_year Decimal(10,3) NULL , -- changed instead of other_bonuses_awarded
	fixed_allowances Decimal(10,3),
	eligibility_performance_bonus VARCHAR(1) NULL,
    
	target_performance_bonus Decimal(3,3),
	total_amount_performance_bonus_awarded Decimal(10,3),
	eligibility_commissions VARCHAR(1) NULL,
	target_variable_sales_compensation Decimal(3,3) NULL ,
	total_amount_sales_bonus_awarded Decimal(10,3) NULL,
    
	total_amount_sales_commissions_awarded Decimal(10,3) NULL,
	car_benefit_eligibility VARCHAR(1) NULL,
	annual_cost_car_depreciation Decimal(10,3) NULL,
    car_allocation_eligibility varchar(1) NULL ,
	annual_cost_car_allocation Decimal(10,3) NULL ,
    
    job VARCHAR(255) NULL,
	companyId INT NULL,
	FOREIGN KEY (companyId) REFERENCES company(id) ON DELETE CASCADE ON UPDATE CASCADE
);