Oracle Database Sql Certified Associate · Free Practice Question Easy

Question 33

View and examine the following available responses.

Identify the false selection about Oracle ALIASES.

  • A

    An alias is mandatory in schema bound views.

  • B

    Oracle ALIASES can be used to create a temporary name for columns or tables.

  • C

    If the alias name contains spaces, you must enclose the alias name in quotes.

  • D

    It is acceptable to use spaces when you are aliasing a column name.

  • E

    Oracle ALIASES negatively impact system performance.

Reveal correct answer

Correct answer: E

Explanation

In this question we are looking for the False Statement:

"Oracle ALIASES negatively impact system performance."

  • False.
    Aliases are just syntactic labels used at query runtime.
    They do not affect how Oracle executes the query or its performance.
    They exist only in the context of the SQL query output or query parsing.


The following are True Statements, not what the question is asking for:

"Oracle ALIASES can be used to create a temporary name for columns or tables."

  • True.
    Aliases temporarily rename columns or tables in a query, usually for readability or clarity.

"If the alias name contains spaces, you must enclose the alias name in quotes."

  • True.
    For example:

"It is acceptable to use spaces when you are aliasing a column name."

  • True, if enclosed in double quotes.
    Spaces are not allowed in unquoted identifiers.

"An alias is mandatory in schema bound views."

  • True.
    In schema-bound views, every derived column must have a name (alias). This is a requirement.

Oracle ALIASES can be used to create a temporary name for columns or tables.

COLUMN ALIASES are used to make column headings in your result set easier to read.

TABLE ALIASES are used to shorten your SQL to make it easier to read or when you are performing a self join (ie: listing the same table more than once in the FROM clause).

Syntax

The syntax to ALIAS A COLUMN in Oracle/PLSQL is:


OR

The syntax to ALIAS A TABLE in Oracle/PLSQL is:


Parameters or Arguments

column_name - The original name of the column that you wish to alias.

table_name - The original name of the table that you wish to alias. alias_name The temporary name to assign.

Note

If the alias_name contains spaces, you must enclose the alias_name in quotes.

It is acceptable to use spaces when you are aliasing a column name. However, it is not generally good practice to use spaces when you are aliasing a table name.

The alias_name is only valid within the scope of the SQL statement.


The alias doesn't affect performance in any practical or measurable way at all. That is, it would add a barely (if it all) measurable delay to query compilation. Once compiled (and re-used), it has no effect.

An alias removes ambiguity when you have more than one table because you know which table it comes from. It also prevents future table changes from breaking a query. Say, you add an audit column to one table where it already exists in another table. Queries without aliases using both tables will break.

An alias is also mandatory in some cases e.g. schema bound views.

The SQL parsing engine (that reads all queries before executing them, and uses the information to cache the compiled queries in the future for faster execution) is the only thing that looks at the aliases, and uses it to help remove ambiguities in symbol lookups. The system would already produce symbols, just like any other compilable statement in any other language, when it's being parsed prior to execution-storage.

✗  Oracle ALIASES negatively impact system performance.

A.

An alias is not mandatory in all views. While aliases can be used in views to simplify queries, improve readability, and provide temporary names, they are a requirement for schema bound views.

B. Oracle ALIASES can indeed be used to create a temporary name for columns or tables. This can be particularly useful when dealing with complex queries or when renaming columns for better understanding.

C. If the alias name contains spaces, you must enclose the alias name in quotes. This is necessary to differentiate the alias from the actual column or table name and ensure that the query is executed correctly.

D. It is acceptable to use spaces when you are aliasing a column name. This can help make the query more readable and understandable, especially when dealing with multiple columns or complex joins.

E. Oracle ALIASES do not negatively impact system performance. In fact, they can improve readability and simplify queries by providing temporary names for columns or tables.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need