Best way to organize data table

I want to design a data table, the table will have at least 6 columns and infinite rows (huge number).

I will display the table pagewise by limiting the number of rows per page.

I want to provide the user with table functionality as much as possible, ex- sorting filtering, etc

I have two questions,

1) what is the best and intuitive way to provide the filtering feature when the column is large?

2) How to provide the sorting function to the user? The best way known is to provide the sorting when the user clicks on the header and since the table is pagewise, how to provide the local sorting(i.e only sort the page) and global sort (sort entire content of the database)?

Please note: Table is used to display only on desktop.