HANA Certificated Development Practice Test

Question: 1 / 400

When defining a core data services (CDS) view using UNION, what must the column list contain?

Columns of identical types

All key fields

The same number of columns

When defining a core data services (CDS) view using the UNION operation, it is essential that the column list contains the same number of columns. This requirement stems from how SQL UNION processes results from multiple queries. Each SELECT statement involved in a UNION must return the same number of columns, and these columns need to be in the same order for the UNION to work correctly.

For a successful UNION, the database engine aligns the columns based on their position, rather than their names. Therefore, if one SELECT statement returns three columns and another returns four, the SQL engine would be unable to combine them meaningfully, leading to errors in query execution.

While it's also true that the types of the returned columns must be compatible, the primary criterion that must be met for a UNION operation is having an identical number of columns in each SELECT statement. Thus, ensuring the same number of columns is the critical requirement when using the UNION in a CDS view definition.

Get further explanation with Examzify DeepDiveBeta

Columns of compatible types

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy