def _get_quantities_for_bnf_codes(db, bnf_codes):
    """
    Return the prescribed quantity matrices for the given list of BNF codes
    """
    return db.query(
        """
        SELECT
          bnf_code, quantity
        FROM
          presentation
        WHERE
          bnf_code IN ({})
        """.format(
            ",".join(["?"] * len(bnf_codes))
        ),
        bnf_codes,
    )