Tutorial Gateway

  • C
  • C#
  • Python
  • SQL
  • Java
  • JS
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs
  • MySQL

SQL Server Tutorial

In this SQL Tutorial, we will show the best way to learn SQL Server and explain everything about it. Which includes: How to create, alter, delete databases, and tables. DML, DDL statements, Built-in functions etc.

SQL Server stands for Structured Query Language is a nonprocedural language, which makes RDBMS (Relational Database Management Systems) possible. The SQL Server Query is the set of instructions used to interact with a relational database. SQL statements are aimed to Insert, Update or Manipulate, and Extract data from the Relational Database Management Systems.

Best Way to Learn SQL Tutorial

This section of SQL Tutorial explains about the creating Databases, Tables. Next, inserting, updating, selecting data from tables using filters, sorting, etc.

Learn SQL Database

A SQL Database helps us to organize the data logically using tables. The main advantage of storing data in a database is its efficient and fast retrieval of data. 

  1. Install Software
  2. Install the Adventure Works Database
  3. Attach Database
  4. Detach Database
  5. Restore Database
  6. Create, Rename, and Delete a Database
  7. Rename Database along with Files
  8. Get Database Names

SQL Server Tutorial on Tables

For a database designer, designing tables and their structure is an essential aspect. Here itself, one has to decide the tables, relationships, and data normalization. It includes many elements, this section of SQL Server tutorial explains the creating, renaming, and altering regular Tables and their columns, derived tables, and temporary tables.

  1. Create Table
  2. ALTER Table
  3. Rename Table
  4. Get Table Names
  5. Add Column
  6. Rename Column
  7. Get Column Names
  8. Local and Global Temporary Tables
  9. Table Variable
  10. Derived Tables

Data Type

  1. Data Types
  2. DataLength

Learn SQL Statements

SQL Server provides various statements for creating a new database, table structures, Select Statement. The SQL SELECT statement, which retrieves and returns data from the database, is the most commonly used. This SQL tutorial section explains all those DDL and DML commands available to work with the database.

  1. DML, DDL, DCL, and TCL Commands
  2. SELECT Statement
  3. ALIAS Column
  4. Select Distinct Statement
  5. Select Into Statement
  6. Insert Into Select Statement
  7. Insert Statement
  8. Update Statement
  9. Delete Statement
  10. Truncate Table
  11. Bulk Insert Statement
  12. Query Builder
  13. Pivot
  14. UnPivot
  15. Merge
  16. SubQuery
  17. CASE Statement
  18. Common Table Expressions (CTE)

Sql Server Clauses Tutorial

  1. List of Clauses with examples
  2. Group By Clause
  3. Having Clause
  4. Order By Clause
  5. Top Clause
  6. Where Clause

SQL Constraints and Indexes

The SQL Server constraints are the rules that will apply to table data. While we are inserting or deleting a record in a table, SQL checks these constraints and rejects the records that won’t meet the rules. Flor example, unique constraints won’t allow duplicates. This SQL Server tutorial section covers all the Indexes and the constraints or keys

  1. Primary Key
  2. Foreign Key
  3. Referential Integrity
  4. Check Constraint
  5. Default Constraint
  6. Unique Constraint
  7. Clustered Index
  8. Non-Clustered Index
  9. Filtered Index

Working with Nulls

While viewing the SQL data or working with data, Nulls are a bit problematic. Sometimes, we need to replace those Nulls or skip those entries. To resolve these problems, SQL has powerful functions that can work with Null values. So use this section to learn SQL Server Null functions.

  1. Coalesce
  2. IS NULL
  3. IS NOT NULL
  4. ISNULL

SQL Joins Tutorial

The most important, rather powerful feature of SQL Server is Joins, which helps you to join two or more tables to perform various operations. Without Joins, there is no concept of data normalization because we have to store the entire data in one table.

  1. Joins
  2. Cross Join
  3. Full Join
  4. Inner Join
  5. Left Join
  6. Right Join
  7. Self Join

SQL Tutorial on Operators

The following are the list of available SQL operators and statements.

  1. And & Or Operators
  2. Arithmetic Operators
  3. Between Operator
  4. Comparison Operators
  5. Exists
  6. Except
  7. Intersect
  8. In Operator
  9. Like Operator
  10. Not Exists
  11. Not In Operator
  12. Union
  13. Union All

SQL Tutorial on Decision Making Statements

  1. If-Else Statement
  2. Else-If Statement
  3. While Loop
  4. Nested While Loop
  5. Break Statement
  6. Continue
  7. Goto Statement
  8. IIF Function
  9. Choose Function

Sql Server Advanced Tutorial

It is an advanced SQL tutorial section. Here, you learn about View, Stored procedures, triggers, functions, Cursors, Etc.

  1. Change Data Capture
  2. Table partition
  3. Table Partitioning using Management Studio
  4. Try Catch
  5. Views
  6. User Defined Functions
    1. Alter User Defined Functions
  7. Stored Procedures
    1. Introduction to Stored Procedures
    2. Select Statement Inside the Stored procedure Example
    3. Insert Statement Inside a Stored Procedure Example
    4. Update Statement within the Stored Procedure
    5. Input Parameters in a Stored Procedures
    6. Output Parameters in a Stored Procedure
    7. Return Values in a Stored Procedure
    8. Insert Stored Procedure output into Temporary Table
    9. Useful System Stored Procedures
  8. Triggers
    1. Introduction to Triggers
    2. After Insert
    3. Instead Of Insert
    4. After Update
    5. Instead Of Update
    6. After Delete
    7. Instead Of Delete
  9. Cursors
    1. Static Cursor
    2. Dynamic Cursor
    3. Forward_Only Cursor
    4. Fast_Forward Cursor
    5. Keyset
  10. Transactions
    1. Transactions
    2. Nested Transactions
    3. ACID Properties

Learn SQL Server Management Studio

This SQL Server tutorial section covers the list of operations we can do using the Management studio

  1. Management Studio (SSMS) Introduction
  2. Install Management Studio (SSMS)
  3. Uninstall Management Studio (SSMS)
  4. Connect to Server using sqlcmd

SQL SSMS Tasks

  1. Create Login – SQL Server Authentication
  2. Create a Windows Login
  3. Creating Server Roles
  4. Login Errors
  5. Back Up Database
  6. Maintenance Plan
  7. Restore a database from .bak file

SQL Server Built-in Functions

The following are the list of available built-in functions in SQL Server. Within this SQL Server tutorial, we covered almost all of them with examples.

Sql Server Tutorial on Ranking Functions

The List of available Ranking functions are:

  1. Introduction to Ranking Functions
  2. Rank
  3. Dense_Rank
  4. Ntile
  5. Row_Number

SQL Tutorial on Mathematical Functions

Apart from basic math operators, which we discussed in the Arithmetic Operators section, there are standard and common Math functions in SQL Server. These Mathematical functions allow you to manipulate the numerical data, which is crucial in data processing. Please follow the The following this Mathematical functions link to view the tutorial on SQL Server Math functions.

SQL Tutorial on String Functions

A string in Sql is a group of charters stored in Varchar or Nvarchar data type, which is useful to store names, product descriptions, etc. SQL Server String functions enable you to manipulate the string data by searching for the given string and replacing it or adding so on. The list of available string function in SQL Server are String functions:

SQL Tutorial on Aggregate Functions

SQL Server Aggregate functions are used to extract the aggregated or high-level data. For instance, total sales in a region, product sale by country, etc. To use these aggregate functions, you have to use the Group By Clause for the non aggregated columns. Otherwise, it will throw an error.

If you want to use any expressions to restrict the records, then use Having Clause, not the Where Clause. This Agg Functions link will show you the tutorial on list of aggregate function available in SQL Server

Learn SQL Date Functions

In general, the SQL Date will store in dd-mm-yyyy hh:mm:ss format or any other system-specific format. There are some cases where we have to extract individual parts such as Month, Month Name, Year, Day, etc. In other times, we may have to format the Date, add or subtract a few days from the original date. In all these scenarios, we can use the built-in standard SQL Server date functions to manipulate the Date.

Use this Date Functions link to learn Sql Server data functions, which includes getting data, formatting date and time etc.

Logical Functions

  1. IIF Function
  2. Choose Function

Learn SQL Analytic Function

  • Cume_Dist
  • First_Value
  • Last_Value
  • Lag
  • Lead
  • Percentile_Cont
  • Percentile_Disc
  • Percent_Rank

SQL Conversion Functions

Use this Sql Server Tutorial section to learn about the conversion functions.

  • Cast
  • Try_Cast
  • Convert
  • Try_Convert
  • Parse
  • Try_Parse

Learn SQL Configuration Functions

This section of Sql Server tutorial covers the available list of Configuration functions.

  1. @@Language
  2. @@LangId
  3. @@Max_Connections
  4. @@Max_Precision
  5. @@ServerName
  6. @@ServiceName
  7. @@SpId
  8. @@Version

SQL System Functions

This section of Sql Server tutorial covers the list of available system functions.

  1. @@Identity
  2. @@pack_Received
  3. IsNull
  4. IsNumeric
  5. Error_Line
  6. Error_Number
  7. Error_Message
  8. Error_Severity
  9. Error_State
  10. Host_Id
  11. Host_Name

Sql Server Tutorial on System Statistical

  • @@Connections
  • @@CPU_Busy
  • @@Idle
  • @@IO_Busy
  • @@Pack_Sent
  • @@Packet_Errors
  • @@TimeTicks
  • @@Total_Read
  • @@Total_Write
  • @@Total Errors

SET Statements

  1. DateFirst
  2. DateFormat
  3. Language
  4. NoCount On
  5. RowCount

XML Functions

  1. For XML Raw
  2. For XML Auto
  3. XML Path

SQL Interview Questions and FAQ’s

This Sql Server tutorial section covers some of the faqs. The following are the list of both Frequently Asked Questions and the SQL Interview Questions.

Basic Connections and Configurations

  1. Create ODBC Connection
  2. Create ODBC Connection- Using Native Client
  3. Connecting to R programming
  4. Configure Database Mail
  5. Create Native Client 11.0 Connection

SQL Tables and Columns

  1. Get Column Names from Table
  2. How to Swap Column Values
  3. How to check if a Table Exists
  4. Identity Value Jumps after restarting
  5. Find all Dependencies on Table
  6. Find all Tables that Contain Specific Column Name
  7. Rename Table Name, and Column Name

SQL Date and Time

  1. Formatting DATE
  2. Return Date Part Only from a DateTime datatype

Differences

  1. Difference between DATEPART and DATENAME
  2. Difference between UNION and UNION ALL
  3. Differentiate between CTE, Temp Tables, Derived tables, Table Variables

SQL Joins Tutorial

  1. Cross Join Vs. Inner Join
  2. List of Outer Joins

Learn SQL Groups

  1. Count Records in a Group
  2. Retrieve the Last Record in each Group
  3. Select Top N Records for each Category
  4. How to Select First Row in each group

SQL Select, Insert, Update, and Delete Tutorial

  1. Delete Duplicate Rows
  2. Insert values into Identity Column using IDENTITY INSERT
  3. Insert Stored Procedure result into Temporary Table
  4. Insert Images into Table
  5. Select Rows with Maximum Value on a Column
  6. Select All If Parameter is Empty or NULL
  7. UPDATE Table Columns from SELECT Statement

Learn Sql Server Strings

  1. Concatenate Rows into String
  2. Replace String in a Table Column
  3. Reverse String Words
  4. Select Domain From Email

Learn SQL Misc

  1. Calculate Running Total
  2. Convert Rows into Columns without applying PIVOT
  3. Convert Column Names into Rows without using UNPIVOT
  4. Export Data to CSV
  5. Nth Highest Salary
  6. Automatically Backup Database

  • SQL DML, DDL, DCL & TCL Cmds
  • SQL NOT EXISTS Operator
  • SQL UPDATE from SELECT
  • SQL AFTER UPDATE Triggers
  • SQL Get Column Names in Table
  • SQL IF ELSE
  • SQL ACID Properties
  • SQL FOR XML PATH
  • Java Two Dimensional Array
  • Java Perfect Number Program
  • Java Count Digits in a Number
  • C Compare Two Strings Program
  • C Print Prime Numbers 1 to 100
  • C program to Reverse a String
  • C Palindrome Number Program
  • C Program for Palindrome String
  • C Remove Duplicate String Chars
  • C Square of a Number Program
  • C Sum and Average of N Number
  • Python Fibonacci Series program
  • Python Area Of Circle Program
  • Python Prime Numbers 1 to 100
  • Python Program for Leap Year
  • Tableau Rank Calculation
  • Tableau Google Maps usage
  • Power BI Format Dates
  • Power BI Top 10 Filters
  • Power BI – Create Hierarchy
  • Power BI DAX Math Functions
  • Learn SSIS in 28 Days
  • SSIS Transformations
  • SSIS Incremental Load
  • SSRS Drill Through Reports
  • SSRS Drill Down Reports
  • R Programming Tutorial

Copyright © 2021· All Rights Reserved by Suresh.
About | Contact | Privacy Policy