Difficulty: Easy
Correct Answer: to create a table, defining its columns, integrity constrains, and storage allocation
Explanation:
Introduction / Context:
SQL Data Definition Language (DDL) includes statements to create and modify database objects. Understanding the distinct roles of CREATE and ALTER operations prevents accidental structural changes or errors during deployment scripts.
Given Data / Assumptions:
Concept / Approach:
CREATE TABLE defines a new table: column names, data types, nullability, defaults, constraints (primary/foreign keys, checks), and, depending on the DBMS, storage parameters (tablespace, partitioning). ALTER TABLE is used later to add/drop columns, change constraints, or modify some storage characteristics. Therefore only option (a) correctly states the primary purpose of CREATE TABLE.
Step-by-Step Solution:
Identify CREATE vs. ALTER responsibilities in SQL.Map options (b), (c), (d) to ALTER TABLE operations.Select (a) as the accurate description of CREATE TABLE.
Verification / Alternative check:
Consult any SQL reference: CREATE TABLE syntax block lists column definitions and constraints; subsequent adjustments use ALTER TABLE ADD/MODIFY/DROP clauses.
Why Other Options Are Wrong:
Common Pitfalls:
Attempting to re-run CREATE TABLE on an existing name (causes errors) or using CREATE to “change” structures instead of ALTER.
Final Answer:
to create a table, defining its columns, integrity constrains, and storage allocation
Discussion & Comments