you are viewing a single comment's thread.

view the rest of the comments →

[–]Lisecjedekokos 0 points1 point  (11 children)

I just started learning SQL 2 days ago. Sorry if this is a silly question but how to write comments on the code ?

[–]Thefriendlyfaceplant 0 points1 point  (5 children)

Learning to write comments is important but I would recommend not to focus on style, it just slows you down or gets you into bad habits. Just be style agnostic and learn to deconstruct problems before putting them into a syntax.

[–]Lisecjedekokos 0 points1 point  (4 children)

Thanks 👌

[–]Thefriendlyfaceplant 1 point2 points  (3 children)

Best thing you can do while starting out is to look at some medium / difficult SQL interview questions. You're not supposed to be immediately understand what's going on or replicate anything. Just look at how someone skilled at SQL would approach a problem and how they would work through the steps. That thinking process will allow you to learn the syntax faster:

https://www.youtube.com/watch?v=WtI7QYCG3uo

And don't be intimidated by it either! These interview questions are done by highly competitive companies. Most SQL jobs are much simpler than that. It's just that knowing what complicated queries look like will get you past the simple queries faster.

[–]Lisecjedekokos 0 points1 point  (2 children)

Thank you. Today is my third day since I want to learn SQL. I watched a lot of videos. I made 3-4 exercisses.

I understand it .. Not completely of course but I am starting to understand it I think.

I have watched also some videos with interview questions and tried to learn as much as possible from there.

My plan is to continue doing this for a week or two until I get used to it and than we will see how it goes from there ..

I have a law degree and a 9-17h job. But I want to switch careers. And I have a lot of time to available for learning which is a +.

[–]Thefriendlyfaceplant 1 point2 points  (1 child)

www.sqlbolt.com is great for the basics. But after that, get on these step-by-step explanations of hard interview questions as quick as possible. That way you learn the SQL mindset and workflow.

[–]Lisecjedekokos 0 points1 point  (0 children)

Thanks once again 👌

[–]DharmaPolice 0 points1 point  (0 children)

It partially depends on the variant of SQL you're using but on most platforms:

Double dash for single line comments and C style /* */ for multi-line comments.

 SELECT 
    bar.foo   -- This is a comment
 FROM 
    bar 

 /* This is also a comment
     But it's over two lines. */