You are on page 1of 8

Student Name: SARTHAK VERMA UID: 20BCS3944

Branch : BIG DATA ANALYTICS SECTION : 20BD2 (A)


rd
Semester: 3 Date of performance: 9/10 /2021

20CSP233 – DBMS
EXPERIMENT 1.3 Lab

1. Aim/Overview of the practical:


Basic DDL and DML commands of SQL based on University
Management System.

2. Task to be done:
1. Explain Data Definition Language.
2. Explain Data Manipulation Language.
3. Differentiate between DDL & DML.
4. Elaborate basic SQL Commands along them.
3. DDL (Data Definition Language) :
DDL stands for Data Definition Language. The DDL
commands help to define the structure of the databases or
schema. When we execute DDL statements, it takes effect
immediately. The changes made in the database using
this command are saved permanently because its
commands are auto-committed.

4. Commands of DDL :

 CREATE: It is used to create a new database and its


objects such as table, views, function, stored procedure,
triggers, etc.
 DROP: It is used to delete the database and its objects,
including structures, from the server permanently.
 ALTER: It's used to update the database structure by
modifying the characteristics of an existing attribute or
adding new attributes.
 TRUNCATE: It is used to completely remove all data
from a table, including their structure and space allocates
on the server.
 RENAME: This command renames the content in the database.
5. Reasons to use DDL commands :

 It allows us to store shared data in a database.


 It improved integrity due to the data independence feature.
 It will enable multiple users to work on the same databases.

6. DML (Data Manipulation Language) :


It stands for Data Manipulation Language. The DML
commands deal with the manipulation of existing records
of a database. It is responsible for all changes that occur
in the database. The changes made in the database
using this command can't save permanently because its
commands are not auto-committed.
Therefore, changes can be rollback.
7. Commands of DML :

 SELECT: This command is used to extract information from a


table.
 INSERT: It is a SQL query that allows us to add data into a
table's row.
 UPDATE: This command is used to alter or modify the
contents of a table.
 DELETE: This command is used to delete records from a
database table, either individually or in groups.

8. Reasons to use DML :

 It helps users to change the data in a database table.


 It helps users to specify what data is needed.
 It facilitates human interaction with the system.
9. Differences b/w DDL & DML commands :

 Data Definition Language (DDL) statements describe the


structure of a database or schema. Data Manipulation
Language (DML) statements, on the other hand, allow
altering data that already exists in the database.
 We use the DDL commands for creating the database or
schema, while DML commands are used to populate and
manipulate the database.
 DDL commands can affect the whole database or table,
whereas DML statements only affect single or multiple rows
based on the condition specified in a query.
 Since DDL commands are auto-committed, modifications
are permanent and cannot be reversed. DML statements,
on the other hand, are not auto-committed, which means
that modifications are not permanent and can be reversed.
 DML is an imperative and procedural method, whereas
DDL is a declarative method.
 The data in DML statements can be filtered with a WHERE
clause, while the records in DDL statements cannot be
filtered with a WHERE clause.
10. Differences :

DDL DML

Data Definition Language Data Manipulation Language

Create Alter Drop Insert Update Delete Select


Truncate Rename
DDL commands are DDL commands are not auto-
auto- committed so committed so changes that happen in
changes that happen in a database are not permanent.
a database are
permanent.
DDL commands have no The DML commands can use WHERE
use of WHERE clause clause while manipulating data in a
because filtration of database.
records is not possible.
The DDL command affects The DML commands will affect single or
the entire database or table. multiple record based on a specified
conditions.
11. Learning Outcomes :

 I have learnt DDL commands.


 I have learnt DML commands.
 I have learnt the differences between DDL and DML
commands.

Evaluation Grid (To be created as per the SOP and


Assessment guidelines by the faculty):

Sr. No. Parameters Marks Obtained Maximum Marks


1.
2.
3.

You might also like