Загрузка...

Session6 - SQL SERVER - DML and DQL Statements

In SQL Server, DML (Data Manipulation Language) and DQL (Data Query Language) are two categories of SQL statements used to perform different operations on the database.

DML (Data Manipulation Language):
DML statements are used to manipulate or modify data stored in the database. They include the following statements:
INSERT: Used to insert new records into a table.
UPDATE: Used to modify existing records in a table.
DELETE: Used to remove records from a table.
MERGE: Used to perform insert, update, or delete operations based on a condition.

Example of DML statements:
-- Insert a new record
INSERT INTO Employees (EmployeeID, FirstName, LastName)
VALUES (1, 'John', 'Doe');

-- Update existing records
UPDATE Employees
SET Salary = 50000
WHERE Department = 'IT';

-- Delete records
DELETE FROM Customers
WHERE CustomerID = 1001;
DQL (Data Query Language):
DQL statements are used to retrieve data from the database. They are primarily used for querying and selecting data. The most common DQL statement is the SELECT statement, which is used to fetch data from one or more tables based on specified conditions.
Example of DQL statement:

SELECT * FROM Employees WHERE Department = 'Sales';
In this example, the SELECT statement retrieves all columns (*) from the "Employees" table where the "Department" is equal to 'Sales'.

DQL statements can also include additional clauses such as WHERE, ORDER BY, GROUP BY, JOIN, and more, to filter, sort, group, and combine data as needed.

It's important to note that DML and DQL statements are part of a larger category called SQL (Structured Query Language), which is a standard language used for interacting with relational databases like SQL Server.

Видео Session6 - SQL SERVER - DML and DQL Statements канала Suman Kumar
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять