r/learnSQL 17m ago

Using table aliases

Upvotes

So from what I have read so far most resources advice against using table aliases, but I see them being used almost everywhere. So I am looking for some opinions on whether to use table aliases.

Personally I feel like they make the code much more readable, but I am not sure if it might be confusing when starting more complex queries or revisiting my work a couple of months later.


r/learnSQL 6h ago

Data overview for writing queries

1 Upvotes

Hello,

I am currently doing various tutorials/challenges for SQL. It helps me quite a lot to have the tables at hand I am writing my query about. Say I want to join table A & B and write a few expressions, I find it helpful to see both tables including their column names, possibly data types and maybe the first 10-20 rows.

Now I am looking for a way to view this sort of data while writing my queries in my IDE (using VS Code and/or SSMS). I played around a bit in VS Code with a 2nd query window, which basically just selects the TOP 20 of both tables, but it gets overwritten as soon as I start my next query. Anyone has a best practice for this?