database: agencia (nome_agencia, cidade_agencia, fundos) cliente (nome_cliente, rua_cliente, cidade_cliente) conta (nome_agencia, numero_conta, saldo) emprestimo (nome_agencia, numero_emprestimo,total) depositante (nome_cliente, numero_conta) devedor (nome_cliente, numero_emprestimo) SELECT rua_cliente, numero_conta FROM cliente, conta WHERE rua_cliente LIKE '%Rua a%', conta.numero_conta; This select would show results from column "rua_cliente" having "Rua a" and its "numero_conta" related results?
I'm not quite sure what you are after - is it just that you need to know how many contact records there are for each client
Unless the cliente and conta tables themselves have a relationship (basically a column that link them together, either directly or through other tables), there isn't a good way to do this.