Can you show me the customer names that have an invoice?
select firstname, lastname from customer where customerid in ( select customerid from customer intersect select customerid from invoice )
Can you also list their customer ids?
select distinct t1.firstname, t1.customerid from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t1.country = "Brazil"