• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Decent or good sql query writing tutorial??

KAMAZON

Golden Member

Here is the problem I am running into guys, maybe some of you propellerhead or informed people can help me out. Every single SQL book I have read such as SQL for Dummies, Beginning SQL, and SQL for Beginners, et. al, and every single SQL training video I've watched whether it's from CBT Nuggets to other vendors, totally lacks a comprehensive review of writing queries using various commands. Heck, I've even gone to various websites that teach SQL such as SQL-Tutorial.Com, SQL-Tutorial2.Com, W3Schools.Com, and several others. All seem to go through some basic Select queries (whoop de do) and don't go in depth. After that they seem to jump straight into writing SPs. Books online is a great resource but it gets complicated for a brand new SQL programmer who has no programming background (Except I knew how to draw a mean animated comic in QBasic 15 years ago loll).

I don't want to jump into writing SPs as I can't even write a decent query, and correct me if I am wrong, but I need to know how to do this before I can write decent SPs. Don't I need to spend the bulk of my time in learning how to write a proper query before I can write SPs really well?
 
Basic SELECT statements are just about all SQL offers. The ony thing advanced about SQL is how to adapt it to your specific database.

Once you have mastered SELECT, INSERT and UPDATE you then put them together in stored prcoedures. All other statements tend to be database specific so most tutorials won't go into them. What advanced techniques exactly are you trying to learn? I would recommend a book that specifically covers your choosen database.
 
What I was trying to learn was how to use the most common used statements such as Join, Union, Case, As, etc. I guess I just need to work very hard at trying to find varius examples and making them work for me, or just go straight into learning SPs.

I was also confused still about Variables, but those I can just go find info on. Thanks for the reply.
 
Originally posted by: KAMAZON
What I was trying to learn was how to use the most common used statements such as Join, Union, Case, As, etc. I guess I just need to work very hard at trying to find varius examples and making them work for me, or just go straight into learning SPs.

I was also confused still about Variables, but those I can just go find info on. Thanks for the reply.

You can find examples of all those you mentioned in SQL online books.


SQL Server 2005 books online

 
By far the easiest and best book to use is the SAMS Learn SQL in 10 minutes.

It's great and is damn easy to follow as it is a collection of 10 minute lessons in writing sql statements.

You'll find lessons on Joins, Creates, Updates etc etc.


So easy to follow. Plus you can download a free database and follow along in the lessons seeing the exact same results. I brought a copy to work and everyone borrows it as the "SQL for mere Mortals" looks like an encyclopedia.
 
Yah I mentioned w3schools in my post, and they were deffinately good, but it's too basic at the moment.
 
Pick a database. Read the manual. Anything beyond basic queries is going to get into database specific stuff anyway. The concepts will be portable but the details of the syntax will not. I'd personally recommend postgres, as they take care to mention whenever a piece of syntax is not part of official standards and the manual in general is quite good (I thought).

You'll also want to look into creating relatively complex schemas (learn ddl) because you really can't practise interesting queries without interesting relationships.
 
Back
Top