create table empresas
(
id int,
name varchar(255)
);
create table diretores (
id int,
name varchar(255),
empresa int
);
insert into empresas (id, name) values (1, "empresa_1");
insert into diretores (id, name, empresa) values (1, "diretor_1", 1);
insert into diretores (id, name, empresa) values (2, "diretor_2", 1);
select count(*) from diretores where empresa = 1;
Y3JlYXRlIHRhYmxlIGVtcHJlc2FzIAooCiAgaWQgaW50LAogIG5hbWUgdmFyY2hhcigyNTUpCik7CgpjcmVhdGUgdGFibGUgZGlyZXRvcmVzICgKICBpZCBpbnQsCiAgbmFtZSB2YXJjaGFyKDI1NSksCiAgZW1wcmVzYSBpbnQKKTsKCmluc2VydCBpbnRvIGVtcHJlc2FzIChpZCwgbmFtZSkgdmFsdWVzICgxLCAiZW1wcmVzYV8xIik7CgppbnNlcnQgaW50byBkaXJldG9yZXMgKGlkLCBuYW1lLCBlbXByZXNhKSB2YWx1ZXMgKDEsICJkaXJldG9yXzEiLCAxKTsKaW5zZXJ0IGludG8gZGlyZXRvcmVzIChpZCwgbmFtZSwgZW1wcmVzYSkgdmFsdWVzICgyLCAiZGlyZXRvcl8yIiwgMSk7CgpzZWxlY3QgY291bnQoKikgZnJvbSBkaXJldG9yZXMgd2hlcmUgZW1wcmVzYSA9IDE7