D2D25COMP007 Database Management System
Practical -2
Aim :-Implement Data Definition Language (DDL) & Data Manipulation Language
(DML) Commands.
Data Definition Language (DDL)
DDL stands for Data Definition Language. It's a set of SQL commands used to define and
manage the structure of a database, including creating, altering, and dropping database objects
like tables, indexes, and schemas. Essentially, DDL commands deal with the blueprint of the
database, not the data within it.
1. Create Database : This Command is used to create a new database.
Syntax
CREATE DATABASE database_name;
O/p
2. Create Table : This Command is used to create a new table in selected database.
Syntax
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
O/p
Insert data Into table : This command used to insert Values into a table
Syntax
INSERT INTO table_name (column1, column2, ...)
VALUES (value1, value2, ...);
SNPITRC/CSE/2025-26/SEM-3/BE03000091 Page 1|6
D2D25COMP007 Database Management System
O/p
Select : The Select statement is used to select data from a database.
Syntax
SELECT column1, column2, ...
FROM table_name;
O/p
3. Aalter Table : The Alter Command is used to Add, Drop, or Modify columns in an
exciting table.
Syntax (Add)
ALTER TABLE table_name
ADD column_name datatype [constraints];
O/p
SNPITRC/CSE/2025-26/SEM-3/BE03000091 Page 2|6
D2D25COMP007 Database Management System
O/p
Syntax (Drop)
ALTER TABLE table_name
DROP COLUMN column_name;
O/p
O/p
Syntax (Modify)
ALTER TABLE table_name
MODIFY column_name new_datatype [new_constraints];
SNPITRC/CSE/2025-26/SEM-3/BE03000091 Page 3|6
D2D25COMP007 Database Management System
O/p
4. Rename : This command is used to rename database tables name .
Syntax
RENAME TABLE old_table_name TO new_table_name;
O/p
5. Truncate : Remove all records from a table including all spaces allocated for the
records are removed in table.
Syntax
TRUNCATE TABLE table_name;
O/p
6. Drop : This command is used to delete tables or database in system.
Syntax
DROP TABLE table_name;
O/p
Data Manipulation Language (DML)
DML stands for Data Manipulation Language, and its commands are used to manage and
manipulate the data within a database. Unlike Data Definition Language (DDL) commands,
which deal with the structure of database objects, DML commands operate directly on the data
stored in tables.
SNPITRC/CSE/2025-26/SEM-3/BE03000091 Page 4|6
D2D25COMP007 Database Management System
1. Insert data Into table : This command used to insert Values into a table.
Syntax
INSERT INTO table_name (column1, column2, ...)
VALUES (value1, value2, ...);
O/p
2. Select : The Select statement is used to select data from a database.
Syntax
SELECT column1, column2, ...
FROM table_name;
O/p
3. Update : This command is used to modify existing records in tables.
Syntax
UPDATE table_name SET column1 = new_value WHERE condition;
O/p
SNPITRC/CSE/2025-26/SEM-3/BE03000091 Page 5|6
D2D25COMP007 Database Management System
O/p
4. Delete : This Command isused to remove the existing records in from table in a
database..
syntax
DELETE FROM table_name WHERE condition;
O/p
O/p
SNPITRC/CSE/2025-26/SEM-3/BE03000091 Page 6|6