Pre-requisites to install:

Operating System: Debian 9, with at least 2 GB RAM.

Note that, RHEL 7.3, Suse Linux, Ubuntu 16.04 is the official version supported by Microsoft. Other versions and Debian OS require some additional modifications to support SQL Server installation.

Commands to prepare Debian for installation:

sudo apt-get install curl
sudo apt-get install apt-transport-https

Edit below file to install libssl,

sudo nano /etc/apt/sources.list

Add below line to the list in file,

deb http://ftp.debian.org/debian jessie main

Ctrl+X, then Y and Enter for exit editing

sudo apt-get update
sudo apt-get install libssl1.0
sudo apt-get install gnupg
sudo apt-get install ufw

Commands to MS SQL Server Installation:

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list | sudo tee /etc/apt/sources.list.d/mssql-server.list
sudo apt-get update sudo apt-get install mssql-server
sudo /opt/mssql/bin/mssql-conf setup
systemctl status mssql-server --no-pager
sudo systemctl restart mssql-server.service
sudo ufw allow 1433
sudo ufw allow 1434

Commands to SQL Server Command-line tools installation:

curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update  
sudo apt-get install mssql-tools unixodbc-dev
sudo apt-get update 

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc	
source ~/.bashrc

Commands to Connect to SQL Server and Writing queries:

sqlcmd -S localhost -U SA -P 'Password'
CREATE DATABASE MyDB
GO
SELECT Name from sys.Databases
GO
QUIT