Difficulty: Easy
Correct Answer: CREATE SYNONYM
Explanation:
Introduction / Context:
In some SQL implementations (notably Oracle and a few others), a synonym provides an alternate name for a table, view, sequence, procedure, or other schema object. This helps when cross-schema access would otherwise require long qualified names, or when you want to insulate applications from future object renames/moves.
Given Data / Assumptions:
Concept / Approach:
The DDL statement is CREATE SYNONYM. After creation, the synonym can be used in SQL statements as if it were the original object, subject to privileges. CREATE SCHEMA defines a namespace and can create objects but does not create aliases. CREATE SAME is not a valid SQL statement. Therefore, the correct choice is CREATE SYNONYM.
Step-by-Step Solution:
Verification / Alternative check:
In practice, CREATE SYNONYM emp FOR hr.employees; allows referring to emp instead of hr.employees in queries (assuming privileges).
Why Other Options Are Wrong:
Common Pitfalls:
Assuming all RDBMS products support synonyms; alternatives include views or search_path adjustments (PostgreSQL) where synonyms are not implemented.
Final Answer:
CREATE SYNONYM
Discussion & Comments