VU22CSEN0100031 DBMS Assignment2
VU22CSEN0100031 DBMS Assignment2
VU22CSEN0100031
DBMS Assignment-2
DDL (Data Defini on Language)
Data Defini on Language (DDL) is a set of SQL commands that help define the structure of a
database. Think of it as the blueprint for how data is stored and organized. DDL commands are used
to create, modify, and delete the structure of database objects like tables, indexes, and views. These
commands shape the database's architecture but don't deal with the actual data within. Typically,
general users don't use DDL commands directly; they interact with the database through an
applica on that handles these technical details for them.
1.CREATE
Descrip on
Create database or its objects (table, index, func on, views, store procedure, and triggers)
Syntax
Example
2.DROP
Descrip on
Syntax
Example
3.ALTER
Descrip on
Syntax
Example
4.TRUNCATE
Descrip on
Remove all records from a table, including all spaces allocated for the records are removed
Syntax
Example
5.RENAME
Descrip on
Syntax
Example
On the other hand, Data Control Language (DCL) commands manage access to the data and the
database itself. Although DCL commands are o en discussed alongside DML commands, they serve a
dis nct purpose: they control who can do what with the data.
In simpler terms, while DML commands are like the tools you use to work with the data in your
database, DCL commands are like the security se ngs that ensure only the right people have access
to those tools.
Syntax
FROM table_name
Example
2.INSERT
Descrip on
Syntax
INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);
Example
3.UPDATE
Descrip on
Syntax
UPDATE table_name SET column1 = value1, column2 = value2 WHERE condi on;
Example
4.DELETE
Descrip on
Syntax
Example