def make_collections_query(value, tag=None):
    """Creates sql and values to query database for collections."""
    
    # init buffers
    sqls = []
    values = []
    
    # init value
    value_like = "%%%s%%" % value.lower()
    
    # search by DBID
    if tag == '[ID]':
        sqls.append("(id = ?)""")
        values.append(value)
    
    # search all fields
    else:
        sqls.append("(LOWER(title) LIKE ?)")
        values.append(value_like)
    
    return sqls, values