Flattened queries 3, 5, 6, and 7