Free SQL Download to practice queries

In this tutorial, we will cover how you can download relational database management system for free to practice SQL queries at home. Most of the people always have a question "Like Python and R, Is there any free software where they can learn and practice SQL queries?". Answer is yes. Before getting into details of installation process, we need to understand what is SQL and how it is connected to relational database management system.
What is SQL (Structured Query Language)?
SQL is a programming language, mainly used for data manipulation on data stored in a relational database management system. We can select, create, modify data (rows and columns) from tables using SQL queries. We can also modify and delete tables using queries.
What is RDBMS (Relational Database Management System)?
Relational Database Management System (RDBMS) is a software system that stores data in a tabular form. Most databases used in businesses these days are relational databases, as opposed to a CSV or Excel Files. SQL is the language used for communicating with data in RDBMS.

How to download SQL Server for free?

Microsoft SQL Server is a powerful relational database management system owned by Microsoft. It is the most popular RBDMS used in both small and big organizations. It is an enterprise system which is not available for free but Microsoft offers a free version of it which is called SQL Server Express edition.
Benefits of using SQL SERVER Express Edition
  1. You can create SQL tables by simply importing CSV files. You don't need to create sample data manually.
  2. You can create and execute stored procedures.
  3. You will get feel of how SQL is used in companies.
  4. It supports Window Functions like ROW_NUMBER, RANK, NTILE and DENSE_RANK etc.
Steps to download and install SQL Server Express Edition
  1. Go to Microsoft website and download SQL Server 2017 Express Edition. Click on Download now button as shown below.
    SQL Server Express
  2. After completing above step, click on the downloaded file. It will take you to the screen shown in the following image.

    Select the Basic install option. This new installation feature selects all of the most commonly used configuration options and is ideal for the beginning MSSQL user.
  3. It will install the software. When installation is completed, it will show information like connection settings, and file locations.
    Next step is to install SQL Server Management Studio (SSMS) by pressing Install SSMS button. It is IDE like RStudio or Spyder which helps to manage database and code with ease.
  4. Once you click on the above Install SSMS button, it will take you to the page as shown below. Click on Download SQL Server Management Studio 18.0 (GA) link. Downloading of the software will begin after that. It may take some time as it's 0.5 GB sized file.
  5. Install SSMS Software. Open it once installation is completed. It will show the screen where it asks you to connect to Server. Click on Connectbutton.
    Server Name : PC_Name\SQLEXPRESS. In the following image, DELL is the PC_NAME.
Are you facing issue in connection and getting the following error?
Cannot connect to XXXXXX. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
To fix this issue, follow the steps below.
  1. Open SQL Server 2017 Configuration Manager and then go to SQL Server Network configuration and then click on Protocols for SQLEXPRESS and make sure both Named Pipes and TCP/IP are enabled. Right-click to enable them.
  2. Right-click on TCP/IP and go to Properties. Now Select IP Addresses Tab and then go to the last item IP All and enter 1433 in TCP Port.
  3. Press Window + R shortcut to open run window and then type services.msc. It will open Services window and then search for SQL SERVER(SQLEXPRESS) and then Start the service by right click on it.
  4. Open SQL Server Management Studio again. If it's already opened, reopen it.
How to use SQL Server Management Studio?
1. Press CTRL + N to open New Query where you can write your SQL query.
2. Check databases by clicking on Databases folder shown under Object Explorer
3. How to check current database in use?
SELECT DB_NAME() AS [Current Database]
Run the above command and press F5 shortcut to execute or submit sql query.
4. How to create a fake dummy table
USE tempdb;
create table employeetbl (employee_id integer, first_name varchar(10), salary float)
insert into employeetbl (employee_id,first_name,salary) values (123, 'Deep', 44561)
Select * from employeetbl
USE tempdb refers to database you want to use.
5. How to import CSV File?
1. Right click on Databases folder and click on New Database option and then type any name you want to assign (let's say newdb.

2. Right click on newdb >> Tasks >> Import Flat File
3. Select CSV file and import it.
6. How to create a simple stored procedure?
CREATE PROCEDURE sampleproc
AS
BEGIN
    SELECT AGE, Attrition, HourlyRate
 FROM 
      Employee_details
    ORDER BY 
        HourlyRate;
END;

EXECUTE sampleproc;
Limitations of SQL SERVER Express Edition
  1. Maximum database size of 10 GB per database
  2. No SQL Server Agent service
  3. SQL Server Integration Services and Analysis Services are not available.
Related Posts
About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has over 8 years of experience in data science. During his tenure, he has worked with global clients in various domains like Banking, Insurance, Telecom and Human Resource.

1 Response to "Free SQL Download to practice queries"
  1. Much obliged for sharing the data, keep doing awesome... I truly delighted in investigating your site. great asset... How To Download

    ReplyDelete

Next → ← Prev
Love this Post? Spread the Word!
Share