SQL command categories: Decide whether the statement is accurate.\n“Data Manipulation Language (DML) commands are used to define a database, including creating, altering, and dropping tables and establishing constraints.”

Difficulty: Easy

Correct Answer: Incorrect

Explanation:


Introduction / Context:
SQL groups statements into categories with different purposes. Confusing these categories can lead to permission errors and incorrect assumptions about transactional behavior. This question examines whether DML is responsible for defining database structures.



Given Data / Assumptions:

  • DML includes SELECT, INSERT, UPDATE, DELETE, and MERGE (data access/modification).
  • DDL (Data Definition Language) includes CREATE, ALTER, DROP, and constraint definitions.
  • We assume SQL-92 or later with typical vendor extensions.


Concept / Approach:
DML manipulates the contents of existing tables and views—reading and changing rows. DDL defines or changes schema objects—creating tables, indexes, views, constraints, and altering or dropping them. Therefore, the statement that DML is used to “define” a database is incorrect: defining is DDL’s job. Some databases allow DDL within transactions (with varying behaviors), but that does not change the category definitions.



Step-by-Step Solution:

Classify CREATE TABLE, ALTER TABLE, DROP TABLE → DDL.Classify SELECT, INSERT, UPDATE, DELETE → DML.Map “establishing constraints” (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK) → DDL.Conclude the claim is false.


Verification / Alternative check:
Check role privileges: DDL usually requires higher privileges than DML; DBAs often separate these responsibilities.



Why Other Options Are Wrong:

  • “Correct” mislabels categories.
  • References to NoSQL, stored procedures, or autocommit do not change SQL taxonomy.


Common Pitfalls:
Assuming GRANT/REVOKE for DDL equals DML privileges; expecting DDL to be fully transactional in engines that auto-commit DDL.



Final Answer:
Incorrect

More Questions from Introduction to SQL

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion