What Is SQL Server?
One of the things that was confusing for me when I was first starting to work with databases was what the difference was between SQL Server, MySQL, T-SQL, PostgreSQL, PL/SQL, SQL, Oracle Database, and more. What language should I start with first? What is the difference between them? What will help me most to land a job? These were all questions that I was asking myself.
What I didn’t realize at first was that some of the things listed above are languages and some are Relational Database Management Systems (RDBMS). A RDBMS is similar in function to an IDE that would be used for object oriented code development (like how MS Visual Studio would be used for developing C/C++ code). You can use an RDBMS to write SQL code and manage database objects.
The table above shows what belongs in each category. Please note that SQL is the base language. T-SQL and PL/SQL are extensions for the SQL language and are similar to each other.
SQL code can be used to view, update, or delete data or objects in a database. It is important to note that SQL is not like other programming languages that you have used because it is a set oriented domain specific language. What does that mean? It means that it is designed for a specific purpose – handling database queries. The way that you write code in SQL is different than you would write code in C or Python because the whole language is designed around this purpose. We will see how this affects our code in the next post.
For the following posts I will be using SQL Server Management Studio (SSMS) as a RDBMS which uses T-SQL as a language.
You should be able to download SSMS here (I will be using SSMS 18). Just run the installer and follow the instructions. When you have SSMS installed go ahead and run it. You should connect to the Local DB as pictured:
Now that we have SSMS installed lets install a sample database to work with. For these posts I will be using the Northwind and Pubs sample database. You can download it here. Download both of the .sql files and open them in SSMS by pressing Ctrl+O and then selecting the file. When you have the file open, you can execute it by either pressing F5 or clicking the execute button on the menu.
Once you have executed both of the files you can open the object explorer by pressing F8 if you do not already see it on the left side of the screen. Expand the databases folder to confirm that both Northwind and pubs are are showing up.
In the next tutorial I will give more information about SQL regarding what it is used for and we will write some of our first SQL queries.