In this article we will understand T SQL Advanced Tutorial means Transaction In SQL and Common Concurrency Problem and SQL server transaction Isolation level by Sagar Jaybhay What is the Transaction? A transaction is a group of commands that changed the data stored in a database. A transaction is treated as a single unit. The transaction ensures that either all commands will succeed or none of them. Means anyone fails then all commands are rolled back and data that might change is reverted back to the original state. A transaction…Read More
In this article Sagar Jaybhay explain how to write Subqueries and Correlated Subqueries in SQL Server and What to choose for Performance Subquery or Join? Subqueries In SQL Server: Subqueries are enclosed in parenthesis. Subquery also called an inner query and the query which enclosed that inner query is called an outer query. Many times subqueries can be replaced with joins. Another example The above query is an example of use subquery in the select list. The above result can be achieved using join also see below query According to…Read More
In this article we will understand What Is Indexed View In SQL Server By Sagar Jaybhay. Indexed View A normal view or non-indexed view is a saved SQL query or a virtual table. When you try to get data from the table the data is coming from an underlying table. So it means the view is a virtual table and doesn’t store any data. But when you create an index on view it gets materialized which means you can store data in view so in the SQL server we called…Read More
In this article Sagar Jaybhay explain what is View. What is the use of View. what is the advantages of views in SQL server. View The view is saved SQL query or we can call it a virtual table. We have these 2 tables and by joining these 2 tables we want to output. By joining these 2 tables we get the above result. Now we want to create a view, like other create statement like create a table, create procedure we have to create view statement Below is a…Read More
In this article you will understand what is Index In SQL Server. How To Create Index and Different Types of Indexes In SQL By Sagar Jaybhay. Also You will leran Unique and Non Unique Index what is the difference between them. Index In SQL Server Index is used to find data from the table quickly. An index is created on views and tables. It is similar to the book index. If you apply index it will improve the query performance drastically. If there is no index then the query engine…Read More
In this article, you will able to understand Temporary table in detail in SQL, with how many different types of Temporary table present in SQL server. What is the difference between these Temporary tables. Temporary Tables In Detail Temporary tables are similar to permanent tables. When you create a permanent table they will create the database you specify and remain in that database permanently until you delete it. Temporary tables get created in tempdb automatically and deleted automatically when no longer used them. There are 2 different types of temporary…Read More
In this article we will understand case and convert function in sql server in detail and what is the difference between case and convert function in sql server. Previous SQL Articles :- https://sagarjaybhay.com/category/sql-server/ When we want to convert from one data-type to another data-type we have Case and Convert function In SQL server. Cast function in SQL Server This Cast function can convert an expression to the provided datatype. In short, it is used to convert one data type to another data-type. General syntax: In the above function, we will…Read More
Union and Union all are used to combine the result from two tables. It means when you want data from 2 different tables or 2 different queries and wants to combine the result you can use Union and Union All.
In SQL the Union and Union all operators are used to combine the results set into a single result set. But both operators have some key differences.