A new project is coming around and I will help with some Business Intelligence tasks. Today I started to study TSQL for this new project, the idea is to get the basics and some concepts about it and during the work I’ll improve this knowledge.

The next step is to learn the following topics:

  • Learn Select
  • Concept of DML, DDL
  • Create table
  • Data Types
  • Store Procedures
  • View

 

TSQL

The last article I showed how to do a SELECT command, but just to refresh our mind:

Learning TSQL for a project

It returns a list of all rows of the table ordered by name.

Making it interesting, I used the INNER JOIN command to get information about two tables and then do a calculation.

Learning TSQL for a project

An interesting point for me is that you can make calculations in a SELECT command, yes, I didn’t know that and now I know 😀

Another interesting point is that you can add texts in a SELECT command.

A good option is to use DISTINCT, it is used to prevent the retrieval of duplicates titles.

Learning TSQL for a project

SELECT INTO is great to create temporary tables or permanent tables by the results of the SELECT command. Interesting!!!

Learning TSQL for a project

Something that made my brain think more to solve is about using correlated subqueries when I understood, I realized that it is simple. To understand it, try to find where the data is and then what the SELECT command does after the result.

Learning TSQL for a project

Learning TSQL for a project

When you understand how the IN and EXISTS work, it will become easier to build a command like that and you can have great results on searches!

Learning TSQL for a project

Leave a Comment

Your email address will not be published. Required fields are marked *