How many customers have two orders or less
select count ( * ) from ( select t2.customer_name from orders as t1 join customers as t2 on t1.customer_id = t2.customer_id group by t2.customer_id having count ( * ) < = 2 )
How many total customer are there?
select count ( * ) from customers
Of the customers with two orders or less, what are their names?
select t2.customer_name from orders as t1 join customers as t2 on t1.customer_id = t2.customer_id group by t2.customer_id having count ( * ) < = 2