Assignment Operator

The name itself is saying that, it assigns values to the variables or fields of a table. We have only one assignment operator ‘=’ in SQL Server. It plays a key role while writing queries. We cannot write complex queries without Assignment

Read More

Arithmetic Operators

Arithmetic operators perform mathematical operations on two or more than two expressions with same datatypes. These Operators are same as arithmetic operators in other programming languages. Arithmetic operators supports numeric datatypes like Tinyint, Smallint, Int, Bigint, Decimal, Float…The datatype of the result

Read More

Operators

Operators are the symbols to perform an action for the given expressions. The following are the list of operators available in SQL Server. Arithmetic operators Assignment operator Comparison operators Logical operators String concatenation operator Bitwise operators Unary operators Operator Precedence: When a

Read More

Order by

Order by Order by clause is used to sort the records of a result set in ascending or descending order. It can be applied to more than one column. We use two keywords to sort the records. ASC and DESC. ASC is

Read More

Where Clause

Where Where clause is used to filter the records returned by the query. It works on all DML (Data Manipulation Language) statements. We can also use where for more than one column by taking the combination of AND/OR operators. We can not

Read More

The Alias

Alias Name Alias name is a name which is given to a database Table or a column temporarily. Generally we create Alias by using the keyword called ‘AS’.  We can also create without this keyword as ‘AS’ keyword is optional in SQL Server.

Read More

The TOP Clause

TOP The TOP clause is used to return top N records from the result set. We can also fetch the required percentage rows from the result set. Syntax: SELECT TOP Number/Percent <Column Name(s)> FROM Table_Name; Examples: TOP with Number: ———————————————————————- USE [AdventureWorks2012];

Read More

SELECT Distinct

Distinct The DISTINCT keyword eliminates duplicate records in a  column from the result and returns only the Distinct values. Syntax:  SELECT DISTINCT <Column_Name> FROM Table_Name; Example: ——————————————————————— USE [AdventureWorks2012]; GO SELECT DISTINCT [OrganizationLevel] FROM [HumanResources].[Employee]; ——————————————————————— The first line of the above statement indicates that

Read More

Installing Adventureworks database

Installing AdventureWorks My next article onward, we are going to start writing queries. So you should have some data to work on and which should be in sync with my data. One of the possibility for you guys to get in sync with

Read More

SQL Server Management Studio(SSMS) – The SQL Server UI

SQL Server Management Studio SSMS is the user interface to connect to SQL Server engine. Connecting to SSMS Follow the below steps to connect & work with SQL Server. Step 1: Click on Start button — All programs — Microsoft SQL Server

Read More