Could you please list the first and last names of all the customers that have at least two cards?
select t2.customer_first_name, t2.customer_last_name from customers_cards as t1 join customers as t2 on t1.customer_id = t2.customer_id group by t1.customer_id having count ( * ) > = 2
Please add their IDs into the table?
select t1.customer_id, t2.customer_first_name, t2.customer_last_name from customers_cards as t1 join customers as t2 on t1.customer_id = t2.customer_id group by t1.customer_id having count ( * ) > = 2
What are the addresses of all the customers with credit cards?
select t2.customer_address from customers_cards as t1 join customers as t2 on t1.customer_id = t2.customer_id where t1.card_type_code = "Credit"
What is the email of the customer that has the credit card with the earliest date valid from?
select t2.customer_email from customers_cards as t1 join customers as t2 on t1.customer_id = t2.customer_id where t1.date_valid_from = ( select min ( date_valid_from ) from customers_cards )