Question: Find the first names of all customers that live in Brazil and have an invoice.
Schema: create table customer (firstname varchar, customerid varchar, country varchar, PRIMARY KEY (firstname)); create table invoice (customerid varchar, PRIMARY KEY (customerid))
SQL: select distinct t1.firstname from customer as t1 join invoice as t2 on t1.customerid = t2.customerid where t1.country = "brazil"