← RGPV CS-502 DBMS December 2020 solved question paper
CS-502 (CBGS) | December 2020 | Q7(b) | 7 marks
Question (restated): Compare DDL, DML and DCL commands.
Answer
SQL statements can be grouped by their purpose. Data definition language (DDL) defines or changes database objects. CREATE creates a table, ALTER modifies its structure and DROP removes it. DDL establishes schemas and constraints. Data manipulation language (DML) operates on stored rows through INSERT, UPDATE and DELETE. SELECT is often classified as DQL separately, although some textbooks include retrieval under DML. Data control language (DCL) manages authorization through GRANT and REVOKE.
For example, a college database administrator creates Student using DDL, an authorized clerk inserts student records using DML, and the administrator grants read access to a reporting role using DCL. These categories serve different responsibilities but work together.
Transaction behavior depends on the database system. Oracle generally performs implicit commits around DDL, whereas some systems support transactional DDL. DML can usually be rolled back before commit when executed in a transaction. DCL transaction behavior also varies. COMMIT and ROLLBACK are commonly classified as transaction control language (TCL).
| Feature | DDL | DML | DCL |
|---|---|---|---|
| Purpose | Schema | Rows | Privileges |
| Examples | CREATE, ALTER, DROP | INSERT, UPDATE, DELETE | GRANT, REVOKE |
CREATE TABLE Student (ID INT PRIMARY KEY, Name VARCHAR(50)); INSERT INTO Student VALUES (101, 'Amit'); GRANT SELECT ON Student TO reporting_role;
The example assumes reporting_role already exists and the executing user has the required privileges.
Further reading: Silberschatz, Korth and Sudarshan, Database System Concepts.
Discussion
Ask a question, share your thoughts or report an error.
Sign in to participate in the discussion.
Join the discussion