select customer.gender as c0, customer.marital_status as c1, store.store_country as c2, store.store_state as c3, customer.education as c4 from customer as customer, sales_fact_1997 as sales_fact_1997, store as store where sales_fact_1997.customer_id = customer.customer_id and sales_fact_1997.store_id = store.store_id and (customer.gender in ('F', 'M')) and (store.store_state in ('CA', 'OR')) group by customer.gender, customer.marital_status, store.store_country, store.store_state, customer.education order by customer.gender ASC NULLS LAST, customer.marital_status ASC NULLS LAST, store.store_country ASC NULLS LAST, store.store_state ASC NULLS LAST, customer.education ASC NULLS LAST; |