def sql_parse(sql):
    """Parse sql expressions so the program can know when to flush memcached
	A normal sql expressions may contains several parts
	>> SELECT * FROM Data WHERE id = 123
	>> UPDATE Data SET uid = 1 cid = 2 WHERE id = 3
	>> DELETE FROM Data where id = 2

	Keyword SELECT UPDATE delete
	Condition   WHERE
	Parameters, id = 1, name = 'lerry'
	Only when you do a "UPDTAE" or "DELETE" opration you need to flush the memcached
	and you can set a memcached record when do a "INSERT" or "UPDATE" opration
	I don't want to do a very complex system, just support simple expressions is ok,
	I won't try to support expressions contains "JOIN" opration
	The default format of a memcached key is like "User:123", the table name and id will be splited
	by a semicolon

	"""
    _splited = sql.split()
    print(_splited)
    keyword = _splited[0].upper()
    if keyword in ['DELETE', 'UPDATE']:
        table_name = _splited[2] if keyword == 'DELETE' else _splited[1]
        print('%s' % table_name)
