Basically, information can be manipulated in the Database in three different ways:
DML – Data Manipulation Language Statements: INSERT, UPDATE, DELETE, SELECT
DDL – Data Definition Language Statements: CREATE, ALTER, DROP
DCL – Data Control Language Statements: GRANT, DENY, REVOKE
DML – Data Manipulation Language Statements
They are used to insert, update, delete, or select data. Display the following commands: INSERT, SELECT, UPDATE, and DELETE.
Example:
USE MyDB
SELECT categoryid, productname, productid, unitprice
FROM products
GO
DDL – Data Definition Language Statements
With them, the developer can set up tables and associated elements. The main commands are: CREATE, ALTER, and DROP.
Example:
USE MyDB
CREATE TABLE customer
(cust_id int, company varchar(40),
contact varchar(30), phone char(12) )
GO
DCL – Data Control Language Statements
Control data authorization and license use. The main commands are GRANT, DENY, and REVOKE.
Example:
USE MyDB
GRANT SELECT ON products TO public
GO
Related Articles
- Structure Query Language (SQL): Chapter 1 – Manipulating information in the DB.
- Structure Query Language (SQL): Chapter 2 – SQL Server Database’s Files and Logs.
- Structure Query Language (SQL): Chapter 3 – Data Discard and DB Limits.
- Structure Query Language (SQL): Chapter 4 – Backup.
- Structure Query Language (SQL): Chapter 5 – Best practices for setting up Historics and Queries.
- Structure Query Language (SQL): Chapter 6 – SQL Commands.
- Structure Query Language (SQL): Chapter 7 – Views.
- Structure Query Language (SQL): Chapter 8 – Triggers.
- Structure Query Language (SQL): Chapter 9 – Stored Procedures.