add some relations and sql queries