code: def _calculatePolicy(self):
          
          cmd = '''
                UPDATE policy
                   SET action = (
                       SELECT action
                         FROM (SELECT state, action, MAX(value)
                                 FROM Q
                                GROUP BY state) AS A
                         WHERE policy.state = A.state
                         GROUP BY state);'''
          self._cur.execute(cmd)
          self._conn.commit()
docs: This implements argmax() over the actions of Q.