title: what is the best approach to creating 1-many relationship in dynamo db/
body: <p>based on answer here for creating one-to-many (<a href="https://stackoverflow.com/questions/55152296/how-to-model-one-to-one-one-to-many-and-many-to-many-relationships-in-dynamodb">How to model one-to-one, one-to-many and many-to-many relationships in DynamoDB</a>) . I understand we need to add a Global Secondary Index (GSI)  to the employee table below. what would be the GSI be here and as an example query, how does the query look like to find an employee with the highest salary , or youngest under a particular manager</p>
  <pre><code>Employee table:
  
  Partition Key: eId
  
  ╔═══════╦═════════════╦════════╗════════
  ║  eId  ║ mgId ║  Age ║ salary ║  Name  ║
  ╠═══════╬═════════════╬════════╣════════
  ║ P1    ║ O1   ║  37  ║ 42000  ║ Jim    ║
  ║ P2    ║ O1   ║  38  ║ 40000  ║ Andy   ║
  ║ P3    ║ O2   ║  35  ║ 45000  ║ Angela ║
  ╚═══════╩═════════════╩════════╝════════
  manager table:
  
  Partition Key: mngrId
  
  ╔═════════╦════════╗
  ║ mgId    ║ Name   ║
  ╠═════════╬════════╣
  ║ O1      ║ Dwight ║
  ║ O2      ║ Micheal║
  ╚═════════╩════════╝
  </code></pre>