4) SQL Commands
4) SQL Commands
27-02-2025
===============
DDL Commands:
===========
-> Four DDL commands:
1) create
2) alter
3) drop
4) truncate
create:
-------
-> when we want to create any database object like table,
we can use "create" command
-> when we want to create the new user also we can use
"create" command"
-> when we want to create new database also we can use
"create" command.
Syntax:
create database-object object-name(
);
alter:
------
-> to change anything on the defined structure of the
database object, we can use "alter" command.
Like:
1) table name
2) column name
3) add new element
4) we can change the type of the column.
Syntax:
alter database-object object-name;
truncate:
----------
-> truncate is same as drop,
truncate can delete the values of the table but it can
maintain the table structure as empty.
Ex:
truncate table EcommerceTable;