0% found this document useful (0 votes)
7 views

Lesson 6

The document discusses how to delete unnecessary or unwanted data from a database to save space. It covers using the DELETE statement with a WHERE condition to selectively remove rows. Examples are provided on deleting rows by primary key, truncating a table to remove all rows but keep the structure, and deleting an entire database. Care is advised to avoid accidentally removing all data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lesson 6

The document discusses how to delete unnecessary or unwanted data from a database to save space. It covers using the DELETE statement with a WHERE condition to selectively remove rows. Examples are provided on deleting rows by primary key, truncating a table to remove all rows but keep the structure, and deleting an entire database. Care is advised to avoid accidentally removing all data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Lesson 6

ESSENTIAL DELETE

OVERVIEW
In this lesson, you will learn how to make remove unnecessary or
unwanted data or information from your database to save space in the
memory of the computer.

LEARNING OUTCOMES

 Demonstrate the Delete statement syntax


 Determine the importance of Delete keyword
 Utilize the Where condition in Delete Keyword
 Apply the basic commands to remove the data in the database.
Just download this file SQL DATABASE FILE http://www.mediafire.com/file/8gfcgki...
Output:
Where:

Delete keyword is used to remove unwanted data in a database

Table_name indicates the name of your table to be specified

Safe mode is used to prevent more deletion of data in your database.

We need to use primary key to avoid deletion of two data in your table.

Press control T or tab to try the command for you to compare the
previous table to the current table if you deleted the data.
Put Select * from dbGrocery.tblProducts; at the bottom of your Delete
command to update your table.

Example: DELETE FROM TBLPRODUCTS WHERE PID >=6


It is used to delete more than one row in a query.

This will display the fabric softener only, all data will be deleted.
Be careful in truncating the table because all data will be deleted in your
table.

Note: It will just delete all the data and not the table, that’s is why
fieldnames remained.
It will remove all the data together with the table.

It means table has been deleted already.

It will remove or delete the entire database as well as tables stored on it.

The
Database dbgrocery has been deleted immediately from the Schemas.
Just try to do all examples available in this lesson.

You might also like