def get_group_usage(group, date, db):
    """
    Query the database for group usage on a specific date.

    :param group: str
    :param date: str
    :param db: object
    :return usage: int
    """
    terms = (group, date + '%',)
    db.execute('SELECT * FROM `group_stats` WHERE `group` = ? AND `datetime` LIKE ?', terms)
    result = db.fetchone()
    return int(result['usage'])