Programming

What is T-SQL

You can probably guess that T-SQL is somehow related to the SQL language, which in turn is somehow related to databases.

And this is in fact true, but in order to clearly understand what T-SQL is, you must first understand what a relational database and the SQL language are essentially.

So first we will go through all the basic concepts and learn all the necessary information that will lead you smoothly to a clear understanding of what T-SQL is.

What is a database
A database is any set of information that is stored in a certain way, for the purpose of further using that information.

However, if we talk about databases that are used in information systems on computers, we will, of course, be talking about the so-called relational databases.

A relational database is ordered information connected to each other by certain relationships. It is presented in the form of tables, which are all this information.

At the heart of the relational model is the theory of sets, which implies the union of different objects into one whole, under one whole in the database is precisely what is meant by a table.

Note! The normalization of databases in simple words.

What is a DBMS
We found out that a database is an ordered set of information, but here another question arises, and how all this information looks physically on the computer?

And it is represented, of course, in the form of files, formed in a special format.

So the next question arises, how do you create such a file and open it in order to view all the information, in other words, how do you create a database and manage all the information in the database?

To do this, there must be a tool, i.e. a special program. And such a program is a DBMS – a database management system, abbreviated DBMS.

On their capabilities and popularity, we can distinguish the following DBMS:

  • Microsoft SQL Server;
  • Oracle Database;
  • MySQL;
  • PostgreSQL.

What is SQL

Now we understand that the information in a relational database is ordered and logically represented in the form of tables, and all this information is stored and managed by a special program called a DBMS.

But how can we access and manipulate the data? In other words, how do we get information out of the database, how do we add, remove or change information in the database?

To do this, there must be a special mechanism that allows us to manipulate data. And this is precisely the mechanism of the SQL language.

SQL (Structured Query Language) is a structured query language, using this language to write special queries to the database in order to retrieve these data and manipulate them.

What is T-SQL

SQL language is a standard, it is implemented in all relational databases, but each database has an extension of this standard, a so-called dialect of SQL language.

And so we’re getting to the heart of our question today – what is T-SQL.

T-SQL is an extension of the SQL language implemented in Microsoft SQL Server.

T-SQL is an abbreviated name for the language, and the full name is Transactional SQL.

T-SQL has all the features of SQL, but it is designed to solve the problems of programming, not related to relational data. In other words, in T-SQL you can fully program using variables, loops, conditional structures and other features. T-SQL allows us to implement complex business logic algorithms in the form of stored procedures and functions, thereby creating so-called “programs” inside the database.

In addition, T-SQL simplifies writing SQL queries due to the huge number of built-in system functions, and allows you to administer SQL Server and get system information using system views, procedures and functions.