SQL Server Tutorial

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

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

Best Way to Learn SQL Tutorial

SQL Server is a Relational database and this section of tutorial explains about the creating Databases, Tables. Next, inserting, updating, selecting data from tables using filters, sorting, etc.

Learn SQL Database

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

  1. Install Server Software
  2. Install the Adventure Works Database
  3. Data
  4. Attach Database
  5. Detach Database
  6. Restore Database
  7. Create, Rename, and Delete a Database
  8. Rename Database along with Files
  9. 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, learn this section of SQL Server tutorial explains the create new tables, renaming, and altering regular Tables and their columns, derived, and temporary ones.

  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
  9. Table Variable
  10. Derived Tables

SQL Tutorial on Data Types

  1. Data Types
  2. DataLength

Learn SQL Statements

SQL Server tutorial provides various statements for creating a new database, table structures, Select Statement. The SELECT statement, which retrieves and returns data from the db, 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
  5. Select Into
  6. Insert Into Select
  7. Insert Statement
  8. Update Statement
  9. Delete Statement
  10. Truncate
  11. Bulk Insert
  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 Tutorial

The constraints are the rules that will apply to column data. While we are inserting or deleting a record in a tbl, queries checks these constraints and rejects the records that won’t meet the rules.

The unique constraints won’t allow duplicates. This SQL Server tutorial section covers all the Indexes and the constraints or keys syntaxes and examples to learn.

  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

Learn working with Nulls SQL Server Tutorial

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

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

SQL Tutorial on Joins

  1. Introduction to Joins
  2. Cross Join
  3. Full Join
  4. Inner Join
  5. Left Join
  6. Right Join
  7. Self Join
  8. Cross Join Vs. Inner Join
  9. List of Outer Joins

SQL Tutorial on Operators

The following are the list of available basic 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
  8. IIF Function
  9. Choose Function

Advanced Sql Server Tutorial

It is an advanced SQL tutorial section to learn. Here, you learn about create 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 Tbl
    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 SSMS Tutorial

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

SSMS Tasks

  1. Create Login – 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 Tutorial on Built-in Functions

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

  1. Aggregate Functions
  2. Configuration Functions
  3. Mathematical functions
  4. Date Functions
  5. String Functions
  6. System Functions
  7. System Statistical

Sql Server Tutorial on Ranking Functions

The List of available Ranking functions are:

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

Logical

  1. IIF
  2. Choose

Learn SQL Analytic Function

  1. Cume_Dist
  2. First_Value
  3. Last_Value
  4. Lag
  5. Lead
  6. Percentile_Cont
  7. Percentile_Disc
  8. Percent_Rank

Conversion Functions

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

  1. Cast
  2. Try_Cast
  3. Convert
  4. Try_Convert
  5. Parse
  6. Try_Parse

SQL Tutorial on SETs

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

XML Functions

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

Learn 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 in this programming language Interview Questions.

  1. Get Column Names from Table
  2. 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 tbl that Contain Specific Column Name
  7. Rename Table Name, and Column Name

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

Learn SQL Date and Time

  1. Format 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, Derived, Tbl Variables

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

Select, Insert, Update, and Delete

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

Learn Sql Server Strings

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

Misc queries

  1. Calculating 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

Comments are closed.