Show all the customers.
select * from customers
Which customers have both New and Pending orders?
select * from customers as t1 join customer_orders as t2 on t1.customer_id = t2.customer_id where t2.order_status_code = "New" intersect select * from customers as t1 join customer_orders as t2 on t1.customer_id = t2.customer_id where t2.order_status_code = "Pending"
Show these customers' names and addresses.
select t1.customer_name, t1.customer_address from customers as t1 join customer_orders as t2 on t1.customer_id = t2.customer_id where t2.order_status_code = "New" intersect select t1.customer_name, t1.customer_address from customers as t1 join customer_orders as t2 on t1.customer_id = t2.customer_id where t2.order_status_code = "Pending"