def select_random_offensive_category(conn):
    """
    Obtains one random offensive category from the database.
    :param conn: A handle to the database connection.
    :return: A random category id.
    """
    conn[1].execute("SELECT id FROM categories WHERE offensive = 1 ORDER "
                    + "BY RANDOM() LIMIT 1")
    return conn[1].fetchall()[0][0]