clear; clc;

ID = {'01', '02', '03'}';
COMPANY = {'AA', 'BB', 'CC'}';
REVENUE = {100, 200, 300}';
t1 = table(ID, COMPANY, REVENUE);

ID = {'01', '03', '04'}';
COMPANY = {'AA', 'Cc', 'DD'}';
ASSET = {1000, 7000, 8000}';
t2 = table(ID, COMPANY, ASSET);

t1.COMPANY = upper(t1.COMPANY);
t2.COMPANY = upper(t2.COMPANY);

t3 = outerjoin(t1, t2, 'Keys', {'COMPANY', 'ID'}, ...
              'mergeKeys', true)

t4 = innerjoin(t1, t2, 'Keys', {'COMPANY', 'ID'})
t5 = [t3; t4]