Q1
True / FalseIn PostgreSQL, the ORDER BY clause is used to sort the result set.
The ORDER BY clause sorts the result set based on one or more columns.
Q2
True / FalseIn PostgreSQL, the ORDER BY clause sorts the result set in ascending order by default.
By default, ORDER BY sorts the result set in ascending order.
Q3
True / FalseIn PostgreSQL, the ORDER BY clause must always be used with the LIMIT clause.
The ORDER BY clause can be used independently to sort the result set and does not require the LIMIT clause.
Q4
True / FalseIn PostgreSQL, the ORDER BY clause can sort the result set by multiple columns.
The ORDER BY clause can sort the result set by multiple columns, specifying the sort order for each column.
Q5
True / FalseIn PostgreSQL, the ORDER BY clause can use column aliases defined in the SELECT statement.
Column aliases defined in the SELECT statement can be used in the ORDER BY clause to sort the result set.
Q6
True / FalseIn PostgreSQL, you cannot use ORDER BY with expressions or functions.
The ORDER BY clause can use expressions or functions to determine the sort order of the result set.
Q7
True / FalseIn PostgreSQL, using ORDER BY with a large dataset can impact query performance.
Sorting a large dataset using ORDER BY can be resource-intensive and impact query performance, especially if indexes are not used.
Q8
True / FalseIn PostgreSQL, the ORDER BY clause can sort null values first or last by using NULLS FIRST or NULLS LAST.
The NULLS FIRST and NULLS LAST options can be used with ORDER BY to specify the placement of null values in the sorted result set.
Q9
True / FalseIn PostgreSQL, the ORDER BY clause can be used in subqueries and window functions.
The ORDER BY clause can be used within subqueries and window functions to control the order of rows processed or returned.
Q10
True / FalseIn PostgreSQL, using the ORDER BY clause with DISTINCT in a query requires the columns in ORDER BY to be included in the DISTINCT clause.
When using ORDER BY with DISTINCT, the columns specified in ORDER BY must also be included in the DISTINCT clause to ensure a valid query syntax and consistent results.