Delete Query
• Syntax:
– DELETE FROM table_name
WHERE some_column=some_value;
• Example :
– DELETE FROM Customers
WHERE CustomerName=‘baabtra' AND
ContactName='Maria';
Truncate Query
• MDF stands for Main Database File and contains all the information in a database. LDF records all the transactions and
changes to the database.
Master Data file: MDF contains database record data
Log data file: Records information related to changes
made in the server as well as all the actions performed.
( stores changes related to CRUD Insert, Delete, and
Update.)
Truncate :delete all data in table (it can be DDL & DML)
DML - Examples
DML - Examples
DML - Examples
SQL Server – Creating Backups
•Backup is a copy of data/database, etc. Backing up
MS SQL Server database is essential for protecting
data.
SQL Server – Restoring Databases
Restoring is the process of copying data from a
backup and applying logged transactions to the data.
Restore is what you do with backups. Take the backup
file and turn it back into a database.