Question: What are the coupon amount of the coupons owned by both good and bad customers?
Schema: create table discount_coupons (coupon_amount varchar, coupon_id varchar, PRIMARY KEY (coupon_amount)); create table customers (coupon_id varchar, good_or_bad_customer varchar, PRIMARY KEY (coupon_id))
SQL: select t1.coupon_amount from discount_coupons as t1 join customers as t2 on t1.coupon_id = t2.coupon_id where t2.good_or_bad_customer = 'good' intersect select t1.coupon_amount from discount_coupons as t1 join customers as t2 on t1.coupon_id = t2.coupon_id where t2.good_or_bad_customer = 'bad'