Sure, I can help you create a query for this. However, to create an accurate SQL query, I need to know the exact table structures. In particular, I need to know:
1. The name of the employee table, and its column names.
2. The name of the related tables, and their column names.
3. The relationship between these tables (foreign keys).
4. Which tables contain the 'title', 'last name', 'gender', 'city', and 'state' data.
For the purpose of this answer, let's assume we have two tables: `employees` and `locations`.
The `employees` table has the following columns: `emp_id`, `first_name`, `last_name`, `gender`, `title`, and `location_id`.
The `locations` table has the following columns: `loc_id`, `city`, and `state`.
Here's an example of how your query might look:
```sql
SELECT
e.last_name AS 'Name',
e.gender AS 'Gender',
l.city AS 'Work City',
l.state AS 'Work State'
FROM
employees e
JOIN
locations l ON e.location_id = l.loc_id
WHERE
e.title = 'Senior Sales Associate'
ORDER BY
l.state ASC,
e.last_name ASC;
```
This query first selects the desired columns from the `employees` and `locations` tables, assigning them the requested aliases. It then joins the two tables on their shared `location_id`/`loc_id` column. The `WHERE` clause filters the results to only include rows where the title is 'Senior Sales Associate'. Finally, the `ORDER BY` clause sorts the results first by state in ascending order, and then by last name in ascending order within each state group.
As for optimizing the column widths, printing the resulting dynaset, and writing your name on the output, these are tasks typically handled by the application or tool you're using to run the SQL query, rather than within the SQL query itself. You'd need to check the documentation or help resources for that tool to see how to do this.
If your table structure is different, please provide the correct structure and I will adjust the query accordingly.