You can use a query like this to display data from table b if table a is missing some info like so:
select a.f1, coalesce(a.f2, b.f2) as f2 from a left join b on a.f1 = b.f1;
+------+------+
| f1 | f2 |
+------+------+
| X1 | Y1 |
| X2 | Z2 |
| X3 | Y2 |
+------+------+
Note that this will not change your table. It'll just output information as you desire.
If you want to actually update table a and populate missing values with those from table b, you can do something like this:
update a inner join b on a.f1 = b.f1
set a.f2 = b.f2
where a.f2 is null and b.f2 is not null;
Then, your table a will look like this:
select * from a;
+------+------+
| f1 | f2 |
+------+------+
| X1 | Y1 |
| X2 | Z2 |
| X3 | Y2 |
+------+------+
Example tables I used are:
create table a (f1 char(2), f2 char(2));
create table b (f1 char(2), f2 char(2));
insert into a values ('X1', 'Y1'), ('X2', null), ('X3', 'Y2');
insert into b values ('X1', 'Z1'), ('X2', 'Z2'), ('X3', null);
NULLor are they empty strings? They're not the same thing.