DATABASE-COMMANDS-2
DATABASE-COMMANDS-2
SQL stands for Structured Query Language. It is developed to manage database. SQL enable us to create
database, insert data, and update data as per requirement and retrieve data.
(NOTE: here column_x, column_y and column_z are those columns/fields name
where data/values are required to enter.)
IMPORTANT NOTE: Be careful when updating records. If you omit the WHERE clause, ALL records will be
updated!
UPDATE Customers
SET C_Discount='20' ;
EXAMPLE
(Note: The following SQL statement will update the C_Discount to "20" for all
records in Customers table)
DELETE Customers
EXAMPLE
WHERE C_ID = 2512;
DELETE Multiple Records
It is the WHERE clause that determines how many records will be updated.
DELETE Customers
WHERE C_City='Asansol';
EXAMPLE
(Note: The following SQL statement will delete all records from the Customers
table where C_City is "Asansol")
IMPORTANT NOTE: Be careful when deleting records. If you omit the WHERE clause, ALL records will be
deleted!
DELETE Customers;
EXAMPLE
(Note: The following SQL statement will delete all records from the Customers
table)