MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
When would you use an alias in SQL?
A
When you didn’t want the user to see the developer’s name
B
When you want a more readable column name in the output of your query
C
When you want to change a field name.
D
When you want to change the name of a table.
Explanation: 

Detailed explanation-1: -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).

Detailed explanation-2: -SQL aliases are used to give a table, or a column in a table, a temporary name. Aliases are often used to make column names more readable. An alias only exists for the duration of that query. An alias is created with the AS keyword.

Detailed explanation-3: -Alias is used to give a temporary name(only for the duration of the query) to the column or table in order to make the column name or table name more readable. It does not change the name of the column permanently.

Detailed explanation-4: -A programmer can use an alias to temporarily assign another name to a table or column for the duration of a SELECT query. Assigning an alias does not actually rename the column or table. This is often useful when either tables or their columns have very long or complex names.

Detailed explanation-5: -SQL AS keyword is used to give an alias to table or column names in the queries.

There is 1 question to complete.