Posts

minification

What is minification Minification is a = process of removing unnecessary comments, spaces from JavaScript / css file. Main intention of minification is to decrease the size of javascript / css files so that load time will get decreased. Functionality of javacript / css file remains same in minification. How my page works without Minification Without minification your page downloads each script / css file as it is shown below ( without comments removed and with spaces).

Bundling mvc

What is Bundling Bundling is a process of grouping the css / javascript files. This group of multiple file is combined into a single file. This single file can be cached. Intention of bundling is to improve performance / optimization. How my page works without Bundling

View vs Partial View MVC

The primary difference is that a Partial View is designed to be rendered within other full Views and as a result it will not contain all of the markup that a full View might ( since it is designed to work within other Views ). For example, a normal View might look like this and contain all of the elements present in a traditional HTML page :  <!DOCTYPE html> <html> <head> <meta charset = utf-8 /> <title> Example </title> </head> <body> <!-- Your Content Here --> </body> </html> where as a Partial View might only contain a small section that it needs to render and since it should be displayed within an existing View, it won't require the necessary tags like <head>, <html>, etc. because it is implied that these should already be present when a Partial View is rendered. An example partial View might look like this :  <div> <!-- Example --> <ul> ...

Transactions

Image
What are Transactions? Transactions group a set of tasks into a single execution unit. Each transaction begins with a specific task and ends when all the tasks in the group successfully complete. If any of the tasks fail, the transaction fails. Therefore, a transaction has only two results:  success  or  failure . Incomplete steps result in the failure of the transaction. A database transaction, by definition, must be atomic, consistent, isolated and durable. These are popularly known as ACID  properties. How to implement Transactions using SQL? Following commands are used to control transactions.It is imortant to note that these statements cannot be used while creating tables and are only used with the DML Commands such as – INSERT, UPDATE and DELETE. SET TRANSACTION:  Places a name on a transaction. Syntax: SET TRANSACTION [ READ WRITE | READ ONLY ]; COMMIT:  If everything is in order with all statements within a single transaction, all ch...

Index

What is Index? Indexes are database objects designed to improve query performance. By applying indexes to one or more columns in table or views, we could see faster data retrieval from these tables. Explain the structure of Index in SQL server? An index is structured by the SQL Server Index Manager as a balanced tree (or Btree). A B-tree is similar to an upside-down tree, means with the root of the tree at the top, the leaf levels at the bottom, and intermediate levels in between. Each object in the tree structure is a group of sorted index keys called an index page. All search requests begin at the root of a B-tree and then move through the tree to the appropriate leaf level. What are the different types of indexes in SQL Server? There are two types of indexes • Clustered index • Non Clustered index Both types of indexes are indexes are structured as B-Trees. Explain the difference between clustered index and non clustered index? Clustered index: A clustered index ...

Cursor

Image
Cursor is a database object to retrieve data from a result set one row at a time, instead of the T-SQL commands that operate on all the rows in the result set at one time. We use a cursor when we need to update records in a database table in singleton fashion means row by row. Life Cycle of Cursor Declare Cursor A cursor is declared by defining the SQL statement that returns a result set. Open A Cursor is opened and populated by executing the SQL statement defined by the cursor. Fetch When the cursor is opened, rows can be fetched from the cursor one by one or in a block to do data manipulation. Close After data manipulation, we should close the cursor explicitly. Deallocate Finally, we need to delete the cursor definition and released all the system resources associated with the cursor. Syntax to Declare Cursor Declare Cursor SQL Command is used to define the cursor with many options that impact the scalability and loading behavior of the cursor. The...

Trigger

The first and most important things in everyone's mind is, “What are triggers and why we do we use them?” So a trigger is nothing but a special kind of Stored Procedure.   "A trigger is a special kind of Stored Procedure or stored program that is automatically fired or executed when some event (insert, delete and update) occurs."   If you write a trigger for an insert operation on a table, after firing the trigger, it creates a table named “INSERTED” in memory. Then it does the insert operation and then the statements inside the trigger executes. We can query the “INSERTED” table to manipulate or use the inserted row(s) from the trigger.   Similarly, if you write a trigger for a delete operation on a table, it creates a table in memory named “DELETED” and then deletes the row.   Why and when to use a trigger   We use a trigger when we want some event to happen automatically on certain desirable scenarios.   Let's see an example ...