Question: What is the order id and order details for the order more than two invoices.
Schema: create table orders (order_id varchar, order_details varchar, PRIMARY KEY (order_id)); create table invoices (order_id varchar, PRIMARY KEY (order_id))
SQL: select t2.order_id, t2.order_details from invoices as t1 join orders as t2 on t1.order_id = t2.order_id group by t2.order_id having count(*) > 2