I’ve read lots about using local storage for android but how would I connect to an SQL database online to send and get data?
For example, if I was making a game and wanted to create a worldwide high score table, how would I store that online and make sure it was only available to that app?
I would recommend you to implement a Web Service on the server. And use The Web Service as a layer between your SQL Server database and your Android application.
Have a read about Three-tier architecture.