What is the difference between DDL and DML in DBMS?
In Database Management Systems (DBMS), Data Definition Language (DDL) and Data Manipulation Language (DML) are two distinct categories of SQL commands, each serving different purposes. Understanding the differences between them is crucial for anyone working with databases, especially when it comes to creating, managing, and manipulating data. DDL and DML are both essential components in the interaction between users and databases, but they differ in their functionality, scope, and the types of tasks they handle.
Data Definition Language (DDL):
DDL refers to the set of SQL commands that are used to define and manage the structure of a database. It is primarily concerned with the creation, alteration, and deletion of database objects such as tables, schemas, and indexes. DDL commands describe how the data should be stored, organized, and related within the database. These commands do not manipulate the data itself but deal with its schema and structure.
Key DDL Commands include:
-
CREATE: This command is used to create new database objects such as tables, views, schemas, indexes, or even entire databases. For example, a
CREATE TABLEcommand is used to define a new table and its columns, data types, and constraints. The structure of the table is defined at the time of creation, but no data is inserted yet.Example:
CREATE TABLE Students ( student_id INT PRIMARY KEY, name VARCHAR(100), age INT, grade CHAR(1) ); -
ALTER: The
ALTERcommand allows you to modify the structure of an existing database object. This can involve adding, deleting, or modifying columns in a table or changing the data type of a column. For example, adding a new column to an existing table can be done with theALTER TABLEcommand.Example:
ALTER TABLE Students ADD email VARCHAR(100); -
DROP: The
DROPcommand is used
______ ____ __________ __________ ___ ________ ______ ____ ___ ____.
_____ _____ _____ ____ __________ ___ ___ ___ ___ ________ ___ _______.
___ _____ ____ _________ ____.
_________ __________ _________ ______ _________ ________.
______ _____ _______ _____ ___ ________ __________ _______ _____ __________.
__________ __________ _______ ________ ______ _______ _________ ________ _____ _______ _____.
____ ______ _______ _____ _____ ________ __________ __________.
________ _________ _______ __________ ___ _______ ___ ___.
______ __________ ________ _______ ________ ________ _______.
________ ______ __________ _____ __________ _____ ____.
___ _____ _______ __________ ________ ___ _________ _______ _________ ________ ___.
________ __________ ______ _________ ____ _____ ______ ______ _______ _____.
__________ _______ ___ _________ ______ _________ ____.
__________ _______ _____ _________ ________ _______ _______.
_______ __________ ____ ______ __________ ______ ____ _______ ___ _________.
___ ___ ________ _____ __________ ____ __________ __________ _________ __________ ____ _____.
__________ ________ ___ __________ _______ ___ ________ _______ ________ _______.
_____ ___ ________ _______ ___ ______ _____ _____ ____ ________ _______ ______.
____ _____ ________ __________ __________.
_____ _____ ____ _____ _________ _____ ____ ______.
________ __________ ________ _________ __________.
_______ _______ __________ _____ ______ _____.
___ ______ __________ ___ _____ __________ _______ _______ ___ _____.
__________ __________ _______ __________ ________ ________ ________ ______ _________ _____ ___.
___ ___ ___ _____ _____ _______ _________.
____ __________ _________ _________ __________ ______ __________ ________ _____.
________ _____ ______ ________ _______.
_______ ____ __________ _________ _____ _________ ______ ____ ____.
____ _______ _______ _______ _______ __________ ____ __________ ______ ________ _______.
_____ ______ ___ __________ _____ _______ ____ ______ __________ ____ ________ __________.
___ _______ ___ ____ ___ ____ ___ _________ _________ _________ _____.
______ ______ _____ ______ ________ ______ __________ _____ ____ _________.
________ ___ _______ _________ _________ ________ ___ ___.
____ _______ ________ _____ ________.
_________ _____ ______ _______ __________ ___ ____ _________ __________.
______ _______ __________ _________ ________ ____.
_______ __________ ____ ______ _________.
_________ ____ _____ ____ __________ ______ ______ _________ _____ ___ ____ _____.
____ ____ _______ ________ _______ ___ _______ ______ ____.
__________ ____ _________ _________ ___ _________ ________ ________ ___ _______ ______ ____.
_________ _____ _______ ____ ___.
______ _______ __________ _____ _____ __________ ______ ________ _____ ____ ___ _________.
_________ ________ _____ ______ _______.
__________ ____ _____ ___ ________ _________ ______ ____ _______ _____.
___ ______ ______ ________ ________ ________ _____ _______.
___ ____ ___ _____ _____ _________ ________ _____ __________ ___ ___ ______.
______ _____ ______ ____ ____ _____ ______ ___ __________ _______ _______.
_________ _________ _________ __________ ____ ___ ____ _____.
______ ______ ___ _________ _________ __________ _______.
____ __________ __________ __________ __________ ___ _______ __________ _____ _______ __________ _____.
__________ _____ __________ ___ ____ ___ _____ __________ _________ _______.
______ _____ _______ ________ ____ ___ _________ _______ __________ __________ _________ ________.
_____ ______ _______ _________ _______ _______ _____.
_____ ______ ___ ____ ______ _________ _________ ______ _________ _______.
___ ____ _____ ______ _______ _____ ____ __________ ___ __________ _________ ______.
______ ____ ___ ___ _________ _______ _________ ___ _______ ___ ___ _________.
______ _______ _________ ________ ________ ________ ________ _________ __________ _______.
____ ___ _____ ________ __________ _______ _______ __________ ________ _____ _____ _________.
____ _______ _______ _________ _____ _______.
_______ ________ ________ ________ _______ __________ ________ ________ ______.
______ ___ ______ ________ _____ ____ _____ ____.
______ ________ ________ ____ ____ __________ ________ ___ __________ ______ _________ ______.
_________ _______ ____ ___ _______ _____ _________ _______.
_____ _______ ___ ___ _____ _______ ________ _______ ______ ______ ___.
_____ ______ _______ ______ _________ ___ ______ _______ __________.
_________ ___ _________ ________ ____ _________ _____ ___ _________ ____.
__________ _____ ______ ____ _________ _____.
_________ ___ ________ _____ __________ _____ ____ ___.
__________ ____ __________ ___ _______ ___ ______ ________.
_____ ______ _____ ________ ________.
______ ____ _______ __________ _________ ___ __________.
______ ____ ____ ___ _______.
________ ____ ___ ____ ________ _________ ________ ______.
__________ ___ _____ ____ _________ _____ _____ ________ _________ ____ ________.
___ ________ _____ ____ ___ __________ ________.
____ _____ ___ _____ _______ _____ ___.
_____ _______ _____ _____ _______ _________ ___ __________.
_______ _____ _____ ___ _______.
__________ ____ ________ ____ _______ __________ __________.
____ _____ ________ __________ _________ ___ _________ ______ _______ ______.
___ ________ ________ _____ _______ __________ ________.
_______ __________ ____ ____ _________ ________ ____ __________ ______ ____ _______.
_____ ________ _______ ______ ________.
________ __________ _________ _______ ___ _________ _______ __________ _________.
___ ________ _________ ____ __________ _________ _________.
___ __________ ____ _______ ____ ________ _______ ____.
_______ ________ _______ _________ ___.
______ ___ _______ ________ ________ ________ _________ __________ ____.
__________ ___ _______ _____ _______ ___ __________ ___.
__________ ____ _____ _________ ____ ______ _____ __________.
________ ____ _____ _____ _____ ______ ________ _____.
____ _______ ________ __________ _________ _________ ______ ____ _____ _______ _____.
______ ___ __________ ___ ____.
____ ________ _______ ___ ________ ___.
____ _________.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
✓ Unlock up to 60% of the answer
✓ No payment required