def delete_categories_for_queries_by_category_type_id(conn, category_type_id):
    if (is_conn(conn) and is_int(category_type_id)):
        cursor = conn.cursor()
        cursor.execute('DELETE FROM dbo.CategoryForQuery WHERE CategoryId                 IN (SELECT id FROM dbo.Categories WHERE CategoryType=?)', category_type_id)
        conn.commit()
    else:
        raise AttributeError('Connection object or Category Type ID                 was not provided')
def delete_categories_for_queries_by_category_type_id(conn, category_type_id):
    if (is_conn(conn) and is_int(category_type_id)):
        cursor = conn.cursor()
        cursor.execute('DELETE FROM dbo.CategoryForQuery WHERE CategoryId                 IN (SELECT id FROM dbo.Categories WHERE CategoryType=?)', category_type_id)
        conn.commit()
    else:
        raise AttributeError('Connection object or Category Type ID                 was not provided')