T-SQL vs SQL differences

  • This is a relatively pedantic but necessary question as I have seen differing explanations on the subject.

    If I say I know SQL is that different to saying I know T-SQL, for example, T-SQL is obviously the Microsoft adaptation of SQL but if someone says that they know T-SQL does that mean that they know all the programming aspects of this.

    The other reason I ask this question is that a company called Learning Tree has two different courses entitled:

    SQL Server Transact-SQL Programming: Hands On (532)

    Developing SQL Queries for SQL Server: Hands On (534)

    There is a different emphasis to the above courses, as in 534 there isn't anything on procedural statements, error handling etc. Is it more honest to say you know SQL rather than T-SQL if you don't have sufficient experience of the programming aspects, but are nevertheless using SQL within SQL Server?

  • If you say "SQL" and "SQL Server" as part your knowledge set, I'd say you know T-SQL. Do you know the new 2012 paging methods? I'm not up on those, so does that mean I don't know SQL or T-SQL? No, I just don't have that construct in my toolbelt yet. But unless we're discussing PL/SQL vs. T-SQL or ANSI SQL vs. T-SQL, then saying SQL when referring to SQL Server is the same as saying T-SQL. But it never hurts to be clear. I do try, most of the time, to type T-SQL when referring to SQL Server, just for clarity.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • OK, so on my CV/resume, would I put T-SQL and SQL in the section for knowledge of programming languages or just T-SQL?

    I guess my initial idea was that T-SQL was more than the original SQL as it adds aspects of error checking, procedural statements etc.

  • I guess that SQL refers to the ANSI SQL language.

    T-SQL to the Microsoft implementation of that language including the programming aspects.

    There's also P/L-SQL which is Oracle's implementation of that same language with their own programming language.

    B

  • meridius10 (2/10/2013)


    OK, so on my CV/resume, would I put T-SQL and SQL in the section for knowledge of programming languages or just T-SQL?

    If you came to me with that on your CV you could well expect to be asked for the differences between them in the interview, and I would not be looking for 'one's MS and one's ANSI', I'd be looking for cases where the ANSI standard says one thing and MS's implementation is different.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I came to SQL Server from using Access so this is why I am asking these questions... At the same time, algorithms in website search engines are mainly working with keywords so it seems that a large part of the recruitment process is candidates needing to make sure that they put the right one's in.

    Just an additional question; what's the norm in working styles, if there is one? Do most developers use views to select as much of the query as possible and then modify the T-SQL or do they just type out the code straight off?

  • meridius10 (2/10/2013)


    I came to SQL Server from using Access so this is why I am asking these questions... At the same time, algorithms in website search engines are mainly working with keywords so it seems that a large part of the recruitment process is candidates needing to make sure that they put the right one's in.

    Just an additional question; what's the norm in working styles, if there is one? Do most developers use views to select as much of the query as possible and then modify the T-SQL or do they just type out the code straight off?

    That's a harder question. It gets to programming methodology, best practices, local practices, and finally, how the optimizer works. As a general concept, think of views as a masking mechanism. They hide stuff for security or for complexity. But, never forget that it's just a query. What happens is that people start thinking of views as tables (and they are absolutely not) and then JOIN one view to another or nest a view inside a view inside a view. Then, you're shooting the optimizer in the head and people are frequently surprised at how bad performance gets. So, in answer to your question, it depends.

    As to putting SQL or T-SQL on your resume, Gail might flog you for it, but I wouldn't see it as that big a deal if you had both. Although, honestly, you could just put SQL and SQL Server and most people would just infer T-SQL. For the fundamentals, SELECT FROM WHERE UPDATE INSERT DELETE, the differences between T-SQL and ANSI SQL are minimal. I realize we're trying to match our CVs to what search engines return, but I suspect that's impossible. Especially when people post job requirements that mean you have to be a DBA, a SAN Admin, a developer, a hardware expert, SharePoint guru, network architect and sub-atomic physicist with a top secret clearance, 2 years of experience and they're willing to pay $50k. In short, no one meets the requirements because anyone with all that knowledge and skill has a LOT more than 2 years experience and expects to make MUCH more than $50k.

    Instead, I'd focus on honesty and clarity on your CV. Let me know what you've done and what you know. Lies and exaggerations will burn you.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • You are right about the honesty bit but there is always a fine line between promoting oneself for the employment market in order to get an interview and going over the top and this is only learnt over time.

    I started a short assignment last year on reporting in SQL Server using a vendors adaptation of SSRS which was nowhere near as good as the Microsoft version (in fact it was a dummed down version of the application with no possibility of creating a matrix). I passed their verbal test on what is an INNER JOIN etc. at interview. I had been used to creating views and practising using AdventureWorks on SSMS at home. Then when the role started there was the choice between a blank compiler or a GUI which produced SQL that could not be reversed back into the interface once it had been modified, no database diagram and many many tables. I am surprised I lasted as long as I did, but it gave me an opportunity to go back to basics and actually practise typing out SQL and trying to understand the code rather than just copying and pasting views or using queries as I had done in Access.

    In fact I had taken other tests through agencies but they were mainly multiple choice and had more DBA type questions than those for a data analyst or possibly a developer (although I am not sure exactly what is required for those roles). Part of the problem was coming from an Access background where there is a lot of hand holding. It was good having that experience because now I am preparing these skills for the future.

    Employers are very demanding in the current job market and there is quite a lot to learn around SQL Server in general in order to be appealing to them. In many jobs they are looking for T-SQL, SSRS, SSIS, SSAS for BI, DBA experience skills for DBA and .NET and T-SQL for developer roles. and as you hinted, candidates also need to prove that they are capable of flying to the moon and back in less than two minutes.

  • meridius10 (2/10/2013)


    If I say I know SQL is that different to saying I know T-SQL, for example, T-SQL is obviously the Microsoft adaptation of SQL but if someone says that they know T-SQL does that mean that they know all the programming aspects of this.

    First, if someone say that they know T-SQL, you have to consider the source and the level. I know a lot of good people that have taken certification exams and have studied T-SQL on their own and they still don't "know all the programming aspects of this". For example, I've been working with and studying T-SQL since 1996 and, just yesterday, I learned a new very high performance trick for counting concurrent sessions in a log file. Someoe who has only taken a course in T-SQL (including certs) or have actually attained a certification might only be qualified to say they can use the basics. They are not necessarily worth a hill of beans when it comes to "really" knowing T-SQL. I currently know of no MS course that teaches how to use a Numbers or Tally table (for example). I currently know of no MS course that teaches the very high performance method of calculating the difference between two differently partitioned ROW_NUMs to calulate the number of concurrent sessions at a given oit in time.

    To wit, taking courses in T-SQL simply qualifies you to move onto the next step. It's like a high school diploma that says you did some time and you know some stuff but not necessarily a lot of stuff.

    So far as someone saying they "know" SQL... they can't know "ALL" SQL because every engine has its own dialect and extensions. Something as simple as returning a result set to a GUI can be as simple as a SELECT (T-SQL) or as complex as having to write a reference cursor (Oracle).

    SQL is NOT SQL. Most engines don't even follow the ANSI standards 100%.

    So far as specialization goes, it depends. I've seen some people who are ok at a couple of things do very well for themselves. I've also seen hard core T-SQL-only folks do very well (like me, for example).

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I personally decided against Microsoft exams because as well as beginning to learn T-SQL and SQL Server, I also wanted to learn programming languages and widen my experience in applications and IT, so needed to divide my time according to my own needs. Unfortunately, I haven't been writing T-SQL as long as you but am just building up my experience bit by bit.

    There seems to be a gap between training and what an employer can actually ask you (which can be anything!). What I am finding good though is downloading videos from youtube and have learnt a lot from these on technical subjects. I am wondering if there are any good and downloadable video resources you can recommend in terms of a series of videos? (I know joes2pros do some but these are pay products!). I have some from learnvisualstudio.net but these are for SQL Server 2005.

    What I am finding interesting is actually getting explanations of coding from videos rather than going through vast amounts of written and poorly or unexplained code or heavy texts that are not realistic based on the time frame required to learn a particular subject. Technical writing has improved but many books are still not up to scratch.

    I guess though that if you learn something over a number of years and get good experience in what you are doing, that is the best thing.

  • You're not alone. Even some of the "best" authors suck wind when it comes to teaching be it through the written word or through videos. I've stopped recommending some of the video sites that I was familiar with because not only did they not do such a hot job, some of the information they were passing out as "best practices" was just flat out wrong, IMHO. For example, using a recursive CTE to "count" or create a sequence is absolutely one of the worst ways both performance and resource usage wise, yet the videos on the subject never gave such a warning. In fact, the videos that I say on the subject did just the opposite and actually recommended the damned things as the "modern way to do such a thig i SQL Serv 2005 and up".

    I find the same thing in books. Although there are a great number of good to great authors, I sometimes wonder what they were thinking when they set out to teach someone T-SQL. Even some of the very-greats, who do a wonderful job explaining some advanced techniques, seem to fall real short in the order of revelation and writing "simple" things that are supposed to create understanding. This is especially true in the latest MS Press Certification Study books. It seems, mostly because the books say so, that you need to already have a year or two of experience. Most of them are not targeted for fundamentals which, coincidently, may Developers seem to be missing, nowadays.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Many thanks for your reply. I am glad I am not alone in struggling to find good books and training resources. IT training is generally expensive and I don't have a budget to go on 4-day training courses so I am basically doing everything myself and trying to imagine workplace scenarios where an employer would ask me to do x or y etc. This is not easy, but upgrading my skills from Access to SQL Server was no option as Access is not an in demand database. I did attend a T-SQL training course at Learning Tree but that was a one off as they had reduced the price of the course by 70%.

    The combination of training resources I am using now is youtube, internet articles, forums and books. However, the books are very much a hit and miss process. The "in easy steps" series are not bad (the earlier editions were better as the code was more amalgamated and now it is split up (although I must say with more explanations)). I would say generally though, unless you have a hefty training budget then there is an element of pot luck and even with the training courses your understanding will depend on the strength of the training materials, quality of the teacher and your learning curve. I guess some people are naturals at picking things up, but for me it can sometimes be a slog as I prefer regimented and formal training programs so I can then understand the basics of an application's capability in full.

    The great fault in technical writing is reams of unexplained code which results in the reader trying and think out what the program means and if they are going through it for the first time, this can be hard and open to misinterpretation.

    When I first studied foreign languages, there was a formal training process involving a dictionary and grammar book. Sadly, this type of formal and logical approach is missing in many programming books as well as an affinity with the potential reader. In other words many books seem to be written by authors who do not spend adequate time thinking about their audience.

  • I think the problem with most MS based training courses is that they often focus on only the new shiny-shiny toys that you get, eg in T-SQL for 2012 these are the windows functions, or on the DBA side the High availability stuff.

    My advice is keep hanging out here at SSC and read the articles, if theres anything you want to know then somoene has probably written an article on it. I've been a T-SQL coder since 2002, but its only the last 2-3 years that I've started to knock a lot of bad habits on the head after having read the forums and articles written by people like Jeff (to name a few).

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices

  • Thanks. I will make more use of this site as a resource for SQL Server!

  • If you are trying to learn T-SQL, you can't go very far wrong picking up Itzik Ben-Gan's book. He has a fundamentals book and the Inside book.

    I don't know of any free resource that's going to do a good, thorough, and accurate job of teaching t-sql. You'll either have to bounce around a lot or find a for pay resource. Sorry. But it's true.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic. Login to reply