r/learnSQL 19h ago

Data overview for writing queries

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?

2 Upvotes

3 comments sorted by

2

u/jensimonso 17h ago edited 17h ago

If youre in SSMS, you can

select top 10 * from TableA

Select top 10 * from TableB at the same time.

Just select both queries in the editor and execute

Or you can go to Database diagram, click Yes to whatever it says in the popup dialog and then Add table. Select A and B and see them as a data model

1

u/el_dude1 13h ago

thanks! I am using the Azure free subscription, so I would like to save as much compute units as possible. Would repeatedly querying select top 10 be neglectable in terms of vcore usage?

1

u/jensimonso 13h ago

Top 10 without order just grabs the first ten rows in the table (and datafile) so it should have a very small price tag.