Indeed, you will need a distant server to host your database and will use the AJAX plugin from Construct to communicate with that server and retrieve the values you are looking for from the client's side.
You can check some tutorial like this one :
construct.net/en/tutorials/creating-own-leaderboard-1032
or
construct.net/en/tutorials/online-high-score-table-ajax-202
in order to see how AJAX works with communicating with a distant server, and what kind of script you can have on your server.
The tutorials use Construct 2, but the theory is the same with Construct 3, and you can even make use of the JSON plugin and data structure for your exchanges with Construct 3.