0% found this document useful (0 votes)
17 views7 pages

VU22CSEN0100031 DBMS Assignment2

Uploaded by

Sai madhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views7 pages

VU22CSEN0100031 DBMS Assignment2

Uploaded by

Sai madhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

P Sai Madhav

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.

List of DDL Commands


1. CREATE
2. DROP
3. ALTER
4. TRUNCATE
5. COMMENT
6. RENAME

1.CREATE
Descrip on

Create database or its objects (table, index, func on, views, store procedure, and triggers)

Syntax

CREATE TABLE table_name (column1 data_type, column2 data_type, ...);

Example
2.DROP
Descrip on

Delete objects from the database

Syntax

DROP TABLE table_name;

Example

3.ALTER
Descrip on

Alter the structure of the database

Syntax

ALTER TABLE table_name ADD COLUMN column_name data_type;

Example
4.TRUNCATE
Descrip on

Remove all records from a table, including all spaces allocated for the records are removed

Syntax

TRUNCATE TABLE table_name;

Example
5.RENAME
Descrip on

Rename an object exis ng in the database

Syntax

RENAME TABLE old_table_name TO new_table_name;

Example

DML(Data Manipula on Language)


Data Manipula on Language (DML) commands in SQL are used to manipulate the data within the
database. These commands include the most commonly used SQL statements for tasks like adding,
upda ng, and dele ng data.

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.

List of DML Commands


1. SELECT
2. INSERT
3. UPDATE
4. DELETE
1.SELECT
Descrip on

Retrieve data from one or more tables

Syntax

SELECT column1, column2, ...

FROM table_name

WHERE condi on;

Example

2.INSERT
Descrip on

Insert data into a table

Syntax

INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);

Example
3.UPDATE
Descrip on

Update exis ng data within a table

Syntax

UPDATE table_name SET column1 = value1, column2 = value2 WHERE condi on;

Example
4.DELETE
Descrip on

Delete records from a database table

Syntax

DELETE FROM table_name WHERE condi on;

Example

You might also like