This actually means that the table is smoothed from its long form to the letter / symbol "r".
In your case there will be a red herring , because 'r' is not used anywhere in the request, and this is not necessary. Your query is not a good example of using aliases because there is only one table. If you join multiple tables, then anti-aliasing becomes convenient (although not required) to indicate which column of the column you are referring to in your various sentences.
You can simply remove the "r" and run your query.
SELECT * FROM database.table r WHERE column = 'whatever' AND otherColumn = 'whenever' ORDER BY id, name
Or use it just like: (although it is redundant here)
SELECT * FROM database.table r WHERE r.column = 'whatever' AND r.otherColumn = 'whenever' ORDER BY r.id, r.name
By the way, SQL code like this is the reason I tend to use the AS keyword to emphasize the fact that I'm an alias. Therefore, the FROM clause would look like this: FROM database.table AS r
As for what this unused alias does, there is a good question. I suppose this was abbreviated, copied and pasted from some old query that used an alias, but no one ever tried to remove it when it became unnecessary.
source share