ALTER : - change defini on of a table
Adding column
The new columns are appended at the end of today by default
Ques :- Add a new column called email to the persons table
Ans : ALTER TABLE persons
ADD email VARCHAR(50) NOT NULL
SELECT * FROM persons
Ques:- Remove the column phone from the persons table
ALTER TABLE persons
DROP COLUMN Phone
SELECT * FROM persons
DROP :- Remove TABLE, COLUMN from the Database
DELETE FROM table_name
WHERE condi on;
Example :- DELETE FROM customers
WHERE id IN (8, 9);
-- Delete the table persons from the database
DROP TABLE persons
Data Manipulate
DML in SQL stands for Data Manipula on Language. It is a subset of SQL commands used to manage and
manipulate data within database tables or views. DML commands are primarily focused on the records
stored in the database, allowing users to interact with and modify the actual data.
The main DML commands in SQL include:
Insert : Used to retrieve data from one or more
tables in a database.
Notes:-
1. Column not included in INSERT become NULL (unless a default or constraint exists)