CRUD Operation in SQL Server

If you are new in Sql Server and you want to be a Expert in Sql than follow my blog step by step.

I will explain the CRUD operation in this tutorial as CRUD operation known for.

Create = INSERT or Create New Table
Read = SELECT
Update = UPDATE
Delete = DELETE

Query for creating a table

"Create table table_Name(column1 datatype,column2 datatype2.......)"

Example1. Create table tbl_Student(StudentId int,StudentName varchar(30))

tbl_Student

StudentId StudentName

Query for insert Data into table

"Insert into (table_name) values(value1,value2,value3......)"
Insert into tbl_Student values(1,'Manish');
Insert into tbl_Student values(2,'Rahul');

tbl_Student

StudentId StudentName
Stack region 5 Digits
Heap region 4 Digits

Query for (Select or Read) Data into table

"select * from table_Name "
select * from tbl_Student

tbl_Student

StudentId StudentName
1 Manish
2 Rahul

Query for Update Data of table

UPDATE table_Name SET column1=value1,column2=value2,... WHERE some_column=some_value;
UPDATE tbl_Student SET StudentName='Gyan' WHERE StudentName='Manish';

tbl_Student

StudentId StudentName
1 Gyan
2 Rahul

Query for Delete Data from table

" Delete from table_Name"
delete from tbl_student where StudentId=1;

tbl_Student

StudentId StudentName
2 Rahul

or

delete from tbl_student

StudentId StudentName