Advanced databases university assignment, sort-merge-join algorithm in DBMS