Q1
True / FalseIn PostgreSQL, the DISTINCT keyword is used to remove duplicate rows from the result set.
The DISTINCT keyword eliminates duplicate rows in the result set, returning only unique rows.
Q2
True / FalseIn PostgreSQL, using DISTINCT in a SELECT statement will still return duplicate rows if used incorrectly.
When used correctly, DISTINCT ensures that all returned rows are unique, with no duplicates.
Q3
True / FalseIn PostgreSQL, the DISTINCT keyword can be used with a single column or multiple columns in a query.
DISTINCT can be applied to one or more columns, removing duplicate rows based on the combination of specified columns.
Q4
True / FalseIn PostgreSQL, the DISTINCT keyword can be used with aggregate functions like COUNT.
DISTINCT can be used with aggregate functions, such as COUNT(DISTINCT column_name), to count unique values in a column.
Q5
True / FalseIn PostgreSQL, using DISTINCT always guarantees faster query performance.
While DISTINCT removes duplicates, it may increase query processing time due to the additional work needed to identify and eliminate duplicates.
Q6
True / FalseIn PostgreSQL, DISTINCT can be used within a subquery to ensure unique results before combining them with the outer query.
DISTINCT can be applied in subqueries to ensure unique rows are returned before combining the results with the outer query.
Q7
True / FalseIn PostgreSQL, using DISTINCT ON (column_name) allows you to specify which duplicates to keep based on ordering.
DISTINCT ON (column_name) retains only the first row for each unique value of the specified column(s), based on the order defined by the ORDER BY clause.
Q8
True / FalseIn PostgreSQL, the DISTINCT keyword can be combined with the GROUP BY clause without any issues.
DISTINCT and GROUP BY can be used together, but they serve different purposes: DISTINCT removes duplicates, while GROUP BY groups rows based on column
Q9
True / FalseIn PostgreSQL, DISTINCT can be used in window functions.
DISTINCT is not typically used in window functions. Window functions operate on a set of rows and return a value for each row in the query result, while DISTINCT modifies the result set to remove duplicates.
Q10
True / FalseIn PostgreSQL, using DISTINCT in a SELECT statement without specifying any columns will result in a syntax error.
DISTINCT must be followed by one or more column names in a SELECT statement. Without specifying columns, the query is incomplete and will result in a syntax error.