Scope of SQL capabilities Which statement best describes what SQL can do across data definition and data manipulation tasks?
-
ACreate database structures only.
-
BQuery database data only.
-
CModify database data only.
-
DAll of the above can be done by SQL.
-
EAdminister operating-system users only.
Answer
Correct Answer: All of the above can be done by SQL.
Explanation
Introduction / Context:SQL is a full declarative language for relational databases with multiple sublanguages. It is not limited to querying; it includes defining schemas, manipulating data, and controlling permissions. Understanding this breadth is essential for both developers and DBAs.
Given Data / Assumptions:
- We consider ANSI-standard SQL capabilities.
- Vendors may add extensions, but core functions are common.
- Tasks include DDL, DML, and DCL/TCL.
Concept / Approach:
SQL includes: DDL (CREATE, ALTER, DROP) to manage structures; DML (SELECT, INSERT, UPDATE, DELETE, MERGE) to read and change data; DCL (GRANT, REVOKE) for privileges; TCL (COMMIT, ROLLBACK, SAVEPOINT) for transactions. Therefore, SQL can create structures, query data, and modify data.
Step-by-Step Solution:
Map each capability to SQL verbs: CREATE for structures, SELECT for queries, INSERT/UPDATE/DELETE for modifications.Recognize that a single language covers these roles.Conclude that “All of the above” is accurate.Verification / Alternative check:
All major DBMS manuals document these categories explicitly under SQL reference sections.
Why Other Options Are Wrong:
- Each of A, B, and C is too narrow; SQL is not restricted to just one category.
- E: Operating-system user administration is outside SQL's scope, though DB roles map to OS identities in some systems.
Common Pitfalls:
- Thinking SQL equals SELECT only; forgetting DDL/DCL/TCL.
- Relying solely on application logic for permissions rather than GRANT/REVOKE.
Final Answer:
All of the above can be done by SQL.