Q1
True / FalseIn PostgreSQL, the EXISTS operator is used to check if a subquery returns any rows.
he EXISTS operator returns TRUE if the subquery returns one or more rows.
Q2
True / FalseIn PostgreSQL, the ANY operator is used to compare a value against any value in a list or subquery.
The ANY operator checks if the comparison is TRUE for at least one value in the list or subquery result.
Q3
True / FalseIn PostgreSQL, the ALL operator is used to compare a value against all values in a list or subquery.
The ALL operator checks if the comparison is TRUE for all values in the list or subquery result.
Q4
True / FalseIn PostgreSQL, EXISTS can be used in the WHERE clause to filter rows based on the result of a subquery.
The EXISTS operator is often used in the WHERE clause to filter rows based on whether a subquery returns any rows.
Q5
True / FalseIn PostgreSQL, the query SELECT * FROM table WHERE column = ANY (subquery) checks if column is equal to any value returned by the subquery.
The ANY operator is used to check if the column value matches any of the values returned by the subquery.
Q6
True / FalseIn PostgreSQL, the query SELECT * FROM table WHERE column <> ALL (subquery) checks if column is different from all values returned by the subquery.
The ALL operator ensures that the column value is different from every value in the subquery result.
Q7
True / FalseIn PostgreSQL, using EXISTS in a correlated subquery can provide better performance than using IN in some cases.
EXISTS can be more efficient than IN with subqueries, especially with large datasets, because it can stop searching as soon as it finds a matching row.
Q8
True / FalseIn PostgreSQL, the query SELECT * FROM table WHERE 100 > ALL (SELECT column FROM other_table) will return all rows from table if 100 is greater than the maximum value returned by the subquery.
The ALL operator checks if the comparison is true for all values returned by the subquery, so the query returns rows where 100 is greater than every value in the subquery result.
Q9
True / FalseIn PostgreSQL, the ANY operator can be used with different comparison operators (e.g., =, <, >) to compare values against the result of a subquery.
The ANY operator can be combined with various comparison operators to compare a value against each value returned by the subquery.
Q10
True / FalseIn PostgreSQL, using SELECT * FROM table WHERE NOT EXISTS (subquery) will return rows from table where the subquery does not return any rows.
The NOT EXISTS operator returns TRUE if the subquery returns no rows, filtering the main query results accordingly.