more complicated joins
final SQL push