Check out example codes for "sql declare variable single line". It will help you in understanding the concepts better.

Code Example 1

-- Old clunky way of doing things prior to SQL Server 2008
DECLARE @myVar VARCHAR(100);
SET @myVar = 'Some Value';

-- New, amazing way of declaring variables
DECLARE @myVar VARCHAR(100) = 'Some Value';

Learn ReactJs, React Native from akashmittal.com