Tag Archives: SQL Basic Concepts

How to rename a Table in Sql Server

To rename a column in a SQL Table following command can be reused: SP_RENAME  ‘old table name’, ‘New table name’ For example, if we want to rename the table from employee to employeemaster, following command can be used. SP_RENAME  ’employee’, ’employeemaster’ This … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged , | 32 Comments

How to change the database collation

To change the collation of an database following commands can be used: ALTER DATABASE [database name] SET SINGLE_USER WITH ROLLBACK IMMEDIATE ALTER DATABASE  [database name]  COLLATE Newcollation ALTER DATABASE  [database name]  SET MULTI_USER For example , suppose if the name of your database is learningdb and you want to change the collation to the collation SQL_Latin1_General_CP1257_CI_AS, … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged | 31 Comments

ACID Rules in Sql Server

ACID Rules This article will tell about the ACID Rules in SQL Server. It is a concept for evaluation of databases and their architecture. A:- (Atomicity) – Atomicity  states the principle of  All or none. This means that either all the SQL Statements within … Continue reading

Posted in SQL ACID Rule, SQL Server | Tagged | Leave a comment

DML, DDL, DCL, TCL in SQL Server

Different Types of Sql Statements:-   DML DML is abbreviation of Data Manipulation Language. It is used to retrieve, store, modify, delete, insert and update data in database. Examples: SELECT, UPDATE, INSERT statements Select :- This Sql Statement is used … Continue reading

Posted in SQL DDL, DML, DCL, TCL, SQL Server | Tagged | 32 Comments

Renaming a column in Sql Server

 We often need to change the name of a column of a table to a new name. We  can do this with the help of the Exec Sp_rename command.  The Syntax of the Sp_rename is given below:-  Exec sp_rename ‘TableName.[OldColumnName]’, ‘[NewColumnName]’, … Continue reading

Posted in SQL Basic Concepts, SQL Server | Tagged , | 13 Comments

Group by…..Having Clause

Group By:- Group By clauses is used to groups rows based on the distinct values of the specified columns. The syntax of the Group by clause is:-   Select column1, column2, column3, aggregate_function(expression )            From … Continue reading

Posted in SQL Basic, SQL Server | Tagged | 71 Comments

Second Normal Form (2NF)

Second Normal Form (2NF) :-A table is said to be in its Second Normal Form if it satisfied the following conditions:- 1) It satisfies the condition for the First Normal Form (1NF), 2) It do not includes any partial dependencies where a … Continue reading

Posted in SQL Normalization, SQL Server | Tagged , , | 36 Comments

Third Normal Form (3NF)

Third Normal Form (3NF) :- A table is said to be in the Third Normal form (3NF) if it satisfy the following conditions:- 1) It should be in the 2NF 2) It should not contain any transitive dependency which means … Continue reading

Posted in SQL Normalization, SQL Server | Tagged , | 46 Comments

First Normal form (INF)

First Normal Form (INF) A table is said to be in a First Normal Form (1NF) if it satisfy the following conditions:- 1)If the columns of the table only contain atomic values (Single, indivisible). 2)Primary key is defined for the … Continue reading

Posted in SQL Normalization, SQL Server | Tagged , | 13 Comments

Database Normalization

Database Normalization Normalization Database Normalization can be defined as the process of organization the data to reduce the redundant table data to the minimum. This process is carried out by dividing the database into two or more than two tables … Continue reading

Posted in SQL Normalization, SQL Server | Tagged , | 24 Comments