what are crud operations code example

Example 1: crud operations meaning

-- (C)reate (R)ead (U)pdate (D)elete
INSERT INTO my_table (my_col) VALUES ('Hello');         -- (C)reate
SELECT my_col FROM my_table WHERE my_id = 33;           -- (R)ead
UPDATE my_table SET my_col = 'Holla' WHERE my_id= 33;   -- (U)pdate
DELETE FROM my_table WHERE my_id = 33;                  -- (D)elete

Example 2: crud operations

Create, Read, Update and Delete are the main operations of CRUD.

Example 3: To give permission to the specific user for the CRUD operation in the database at a time

USE OnlineRestaurant1
GO
EXEC sp_addrolemember N'db_datawriter', N'RAHBARINFOTECH\LOVE'
GO
EXEC sp_addrolemember N'db_datareader', N'RAHBARINFOTECH\LOVE'
GO

Tags:

Misc Example