Relationship between user and task in database in erpnext

hello
how to get tasks that assigned to use from db using server-side api
or what is the relationship between user and taks in database in erpnext
or how to trigger event when assign task to user