The Best Way to Learn SQL for Beginners
In this article, we will take a look at ways in which you can learn Structured Query Language, or SQL. Before we begin, we should answer the question — what is “SQL?”
What are the components of SQL Server?
When you think about Microsoft SQL, what comes to mind first is probably T-SQL, Microsoft’s implementation of the SQL programming language. T-SQL is short for Transact Structured Query Language, and it focuses on SELECT statements.
But there are many other aspects of SQL Server.
- Database Administration (DBA) focuses on the SQL Server engine and databases. Instead of querying data, you manage them, including patching and backups.
- SQL Server Reporting Services (SSRS) allow you to create reports based on database data.
- SQL Server Analysis Services (SSAS) create cubes or models of your existing data. Cubes are used in the SSAS MDX version, and models are created in the SSAS Tabular version. These cubes can take some time to set up, but once you do, both cubes and models can make your analysis quicker and easier to interrogate.
- In SQL Server Integration Services (SSIS), you create data flows. This enables you to transform your data from one form to another.
Last Updated March 2021
From Tables and SELECT queries to advanced SQL. SQL Server 2012, 2014, 2016, 2017, 2019, exams 70-461 and 70-761 | By Phillip BurtonExplore Course
So when you wonder how you can learn SQL, your first question should be: What aspect of SQL do you wish to understand?
In which order should I learn the SQL Server components?
What is the best introduction to SQL Server? It depends on what your job requirements are. However, there are basically two different job types:
- A data role – whether that is for data analysis or data scientist
- A database administration role (DBA)
Either way, I suggest that you start with T-SQL. You will then be able to create SELECT statements, create tables, and insert as many rows of data as you want.
- If you want a data role, then you should master SQL SELECT statements.
- If you want a DBA role, then you need enough knowledge of T-SQL to use it in the real world for your DBA needs.
Once you understand the basics of SQL Server, you can then expand on it.
- If you want a database administration role, then you can then concentrate on learning DBA.
- If you want a data role, then I would suggest looking at SSRS next. SSAS and SSIS are more specialized and can be left until later.
Either path is an excellent intro to SQL Server.
Downloading and installing SQL Server
One of the best ways to learn SQL Server is to practice it on your own computer. You can do this if you install Microsoft SQL Server on your computer – it’s free. And you can install it on your Windows laptop or desktop.
There are two main versions that I can recommend:
- Microsoft SQL Server Developer edition. This fully featured version includes the features in the full-price Enterprise edition. While you are not licensed to use it for commercial purposes, it is ideal for learning SQL.
- Microsoft SQL Server Express edition. This has fewer features than the Developer edition. However, it installs more quickly in less hard drive space. It is also licensed for commercial use.
To download these programs, go to the Microsoft SQL Server website.
If you want to learn more than T-SQL, then download the SQL Server Developer edition. It gives you more Database Administration (DBA) functionality. It also comes with the components needed for SSIS, SSAS, and SSRS.
Once you have installed this version, you will have the back engine to SQL Server. You will also need a front engine, which allows you to have a user interface. This front engine is different depending on what aspect of SQL Server you want to learn.
A front engine for SSIS, SSAS, and SSRS
If you wish to learn SSIS, SSAS, or SSRS, then the easiest front engine you can use is Microsoft’s Visual Studio. The free Community edition is great for personal use, and you can download it from the Visual Studio website.
If you want to use it for SSIS, SSAS, or SSRS, some add-ins are needed.
- For Visual Studio 2017 and earlier, you need to install SQL Server Data Tools (SSDT):
- For Visual Studio 2019 and later, you need to install additional components within SQL Server:
A front engine for T-SQL and DBA
Do you want to create T-SQL statements or learn Database Administration? If so, you should install SQL Server Management Studio (SSMS).
This front-end is a user interface for SQL Server and allows you to execute T-SQL queries. Again, this is FREE. Download it by clicking here.
Creating your first queries
Hopefully, you have now installed SQL Server and SSMS, so you can open SSMS and connect to your database. If you have done a standard installation of SQL Server, then your database would either be:
- “localhost,” or
- “.” (that’s a dot / full stop / period).
From within SSMS, you can create your first T-SQL Statements.
You can do this by using one of the built-in system tables. One example of these is sys.objects in the master database. You could write the following T-SQL command and press the Execute button:
SELECT * FROM master.sys.objects
This will display every single row and column in that table. From there, you can narrow it down. If all you want is the “object_id” column, you can change the code to:
SELECT object_id FROM master.sys.objects
Success! You have now created your first T-SQL command.
For other useful SQL commands, refer to Udemy’s latest blog, which covers all the statements you’ll want to know.
What do you need to learn?
If you want to learn SQL Server, you should have a structured way of doing it.
To determine what you should learn, I suggest turning to the experts.
Microsoft had two exams relating to T-SQL called 70-461 and 70-761. Microsoft also had an exam for DBAs called 70-462. Mastery of these requirements means a high skill level in T-SQL or DBA. Sadly, these exams are no longer available.
Have you identified any requirements that you need? This is when an online course could assist you with your learning experience. Why not look at Udemy? Udemy is one of the best learning platforms out there.
In my Udemy video course for T-SQL, I teach all of the requirements of the 70-461 and 70-761 exams. You’ll learn the following:
- How to create an SQL database and tables, and our first queries.
- Find out about data types and functions.
- Take a deep dive into the SELECT statement. I also show you how to remember the order of the six principal clauses. This is a standard interview question for job applicants to a data analysis role.
- Go deeper, creating queries, procedures, triggers, and functions.
- Then build on your knowledge, going further with T-SQL.
Once you have mastered these requirements, you will feel confident with T-SQL. You can now use your newfound SQL knowledge in creating SELECT statements. This can allow you to retrieve data in other environments, such as Python, Excel, Tableau, Power BI, and other applications.
Want to learn a different aspect of SQL Server? Please look at my other online SQL tutorials for:
- Database Administration
- SQL Server Reporting Services (SSRS)
- SQL Server Integration Services (SSIS)
- SSAS (Multidimension MDX)
- SSAS (Tabular) components.
Have a look at the links included in this article and see what you need to begin working in SQL Server. Then check out some of my SQL courses and see how much more you could learn.
Thank you very much for reading, and keep learning!
Top courses in SQL
SQL students also learn
Empower your team. Lead the industry.
Get a subscription to a library of online courses and digital learning tools for your organization with Udemy for Business.