Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Bahria University

Lahore Campus
Department of Computer Sciences

Assignment # 1

Course Name:
DATABASE MANAGEMENT SYSTEMS
Course Code:
CSC 220
Section:
BS (CS) 4-A
Submitted to:
Dr. Gulam Mustafa
Date
31 March 2021

Submitted by

Mohammad Abdul Rafeh 03-134192-019


You are required to write SQL queries for the given statement along with the report asked in
deliverable A.

Deliverable:

1. A detailed report (approx. 700 words) to differentiate between the DDL and DML.
(10 marks)

Sr. Key DDL DML


No
1) Abbreviation DDL abbreviates Data DML abbreviates Data
Definition Language. Manipulation Language.

2) Usage Database, tables, schema Data can be inserted,


and constraints can be updated and deleted using
created using DDL. DML.
3) Creation Column of the table are Rows of the table are added
defined by DDL. or updated using DML.

4) Classification It has no further It is further classified into


classification. two classifications.
1) Procedural DML
2) Non-Procedural
DML
5) Basic Create, Drop, Rename and Insert, Update, Delete and
Commands Alter etc. Select etc.

6) Commands 1) Create 1) Insert


Explanation This command is used to This command is used to
make a new table in insert new records in a
database. table.
Syntax: Syntax:
CREATE TABLE INSERT INTO
TABLE_NAME TABLE_NAME
(COLUMN_NAME VALUES (value 1,
DATATYPES [....]); value 2, value 3, value
2) Drop N);
This command is used to
drop an already present 2) Update
table in a data base. This command is used
Syntax: for the modification of
DROP TABLE ; existing records in a
3) Rename table.
This commands renames Syntax:
an existing object in a UPDATE table name
database. SET [column_name1=
Syntax: value1,...column name N
RENAME TABLE = value N] [WHERE
`current table name` TO CONDITION]
`new table name`; 3) Delete
This command is used
4) Alter for the deletion of
This command is used to existing records in a
alter structure of an table.
existing table. Syntax:
Syntax: DELETE FROM table
ALTER TABLE name [WHERE
MODIFY (COLUMN condition];
DEFINITION....);
4)Select
This command is used
for data retrieval from
zero or more rows from
one or more tables.
Syntax:
SELECT expression
FROM table Name
[WHERE condition];

7) WHERE Where command is not used Where command is used in


Command in DDL statements. DML statements.

8) Roll Back Changes made through DDL Changes made through DML
statements can’t be rolled statements can be rolled
back. For example if you back. For example if you
drop a table then it will be delete a record it will not be
permanently deleted. permanently deleted.
9) Working It works on a table in It works on one or more
database. records.

10) Effects Whole table is effected by One or more rows are


DDL commands. effected by DML
commands.
11) Data This language is used to This language is used to
Handling change structure of manage the data in the
database. database.
12) Data DDL uses TRUNCAT DML uses DELETE
Deletion command for this purpose. commands for this purpose.
All the rows from a table are All or some rows can be
removed by Truncate removed from the table
command. It changes using this command. It
structure of table and it can’t doesn’t change the structure
be rolled back. This of table and it can be rolled
command is faster. back. This command is
slower.
13) Methodology It is a declarative method. It is an imperative method.

You might also like