SELECT statement in depth → SQL Queries

We will start will basics and will go till in depth of select statement.

Simplified select statement looks like below

  • If you want to select everything from table
  • If you want to select selected columns
  • A SELECT statement that retrieves two columns and a calculated value on one specific column.
  • SELECT data in given date range

Expanded syntax of the SELECT statement

  • SELECT statement that name the column in result set
  • How to concatenate String in SELECT SQL queries
  • How to do Arithmetic operations in SELECT SQL Queries
  • How DISTINCT in SELECT SQL Queries

In this we get distinct combinations of EmployeeID and ShipperID.

  • How to use TOP in SQL Queries

It will give you top five orders Ordered by EmployeeID. Always use ORDER BY clause otherwise you will random results.

It returns you top 2 % results.

Credit : Murachs SQL Server 2019 for Developers

Software engineer, Leading highly scalable product @scale of million records per day.