Structure Query Language (SQL): Chapter 1 – Manipulating information in the DB.

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

Este artigo foi útil? Was this post helpful?
Yes0
No1

Leave a Reply

Your email address will not be published.Required fields are marked *