Tests for join, where and order.