DATA-MANAGEMENT-FOUNDATIONS practice question 3 of 15
Which expression can be used to create a temporary name for a table?
Full set: 60 questionsDomain Data Querying
In SQL, an ALIAS is a temporary name assigned to a table or a column for the duration of a particular query. This is done using the AS keyword (or sometimes without it, depending on the SQL dialect). Aliases are primarily used to make column names more readable, to shorten long table names, or to distinguish between tables when performing a self-join (joining a table to itself). For example, SELECT C.CustomerName FROM Customers AS C; uses C as an alias for the Customers table.
A. HAVING: This clause is used with GROUP BY to filter groups based on the results of aggregate functions, not to rename tables.
B. NEW: This is not a standard SQL keyword for creating a temporary name for a table.
D. UNION: This is an operator used to combine the result sets of two or more SELECT statements into a single result set.
1. PostgreSQL 16 Documentation, Chapter 7. Queries, Section 7.2.1.2. Table and Column Aliases. The documentation states, "A temporary name can be given to tables and columns... This temporary name is called an alias."
2. Oracle Database SQL Language Reference, 23c, SELECT Statement, tablereference clause. The documentation explains that an alias can be specified for a table or view, noting it "can be used to refer to the item and is particularly useful in joins."
3. Stanford University, CS 145 Introduction to Databases, Lecture Notes on SQL. The notes describe aliasing: "The AS keyword can be used to rename attributes or relations in the SELECT or FROM clause... This is called aliasing."
Keep practicing
Take the free DATA-MANAGEMENT-FOUNDATIONS practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DATA-MANAGEMENT-FOUNDATIONS practice questions
- Question 1Which clause is used to specify the join columns when performing a join in MySQL?
- Question 2What is the first step of the analysis phase for designing a database?
- Question 4Which object relates an entity to itself in an entity-relationship model?
- Question 5Which action does the % operator accomplish in MySQL?
- Question 6Which description defines a data type?
- Question 7What is the second step in the implement relationships stage of database design?
