Have the database sorted?
Hi,
I have a database with a table called leaderboard. Is there a command that will sort the table alphabetically by the "name" column and save it in the same order? When I search online, I only find the "SELECT * FROM …" command, but I don't want to display the table sorted; I want to save it sorted within the table. Can someone help me?
It is not the task of DB to store and organize the tuple internally in the way you want. That is precisely why this is done in the query, preferably supported by an index(tree).
Depending on the database (you do not say what it is) your concern does not make any sense. That’s why you don’t think about it.
With an MS SQL-DB, you might. work with a clustered index – but also the success with a leaderboard is not a real sense.
What do you promise about the sorted storage?
Look at Index On. And then “order by”.