PostgreSQL Database Quiz Questions

Course Name:PostgreSQL
Chapter Name:Chapter 7 - DQL (Data Query Language)
Lesson Content Link:'AND' and 'OR' Operators
Current Quiz Count:30
Progress
0%
Q1
True / False

In PostgreSQL, the AND operator is used to combine multiple conditions where all conditions must be true.

Q2
True / False

In PostgreSQL, the OR operator is used to combine multiple conditions where at least one condition must be true.

Q3
True / False

In PostgreSQL, the AND and OR operators can be used together in a single SQL query.

Q4
True / False

In PostgreSQL, the AND operator has higher precedence than the OR operator.

Q5
True / False

In PostgreSQL, column1 = 'value1' OR column2 = 'value2' AND column3 = 'value3' is equivalent to (column1 = 'value1' OR column2 = 'value2') AND column3 = 'value3'.

Q6
True / False

In PostgreSQL, parentheses can be used to override the default precedence of AND and OR operators.

Q7
True / False

In PostgreSQL, the query SELECT * FROM table WHERE (condition1 AND condition2) OR condition3 will return all rows that satisfy either condition3 or both condition1 and condition2.

Q8
True / False

In PostgreSQL, combining multiple AND and OR operators without parentheses may lead to unintended query results.

Q9
True / False

In PostgreSQL, using WHERE (condition1 OR condition2) AND (condition3 OR condition4) ensures that either condition1 or condition2 must be true, and either condition3 or condition4 must be true.

Q10
True / False

In PostgreSQL, WHERE condition1 AND NOT (condition2 OR condition3) is a valid way to exclude rows where either condition2 or condition3 is true.

Q11
Single Choice

In PostgreSQL, which of the following queries will return rows where age is greater than 25 and city is 'New York'?

Q12
Single Choice

What will the following PostgreSQL query return? SELECT * FROM students WHERE grade = 'A' AND grade = 'B';

Q13
Single Choice

: Which of the following queries uses the OR operator correctly in PostgreSQL?

Q14
Single Choice

In PostgreSQL, which of the following queries will return rows where either status is 'Active' or city is 'Boston'?

Q15
Single Choice

Given the PostgreSQL query SELECT * FROM sales WHERE amount > 5000 AND (region = 'North' OR region = 'South');, what will it return?

Q16
Single Choice

In PostgreSQL, what will the following query return? SELECT * FROM inventory WHERE quantity < 10 AND (item_type = 'Electronics' OR item_type = 'Furniture');

Q17
Single Choice

What will the following PostgreSQL query return? SELECT * FROM employees WHERE (salary > 60000 AND department = 'HR') OR (salary < 30000 AND department = 'IT');

Q18
Single Choice

In PostgreSQL, which of the following queries will return rows where age is between 20 and 30 and country is either 'USA' or 'Canada'?

Q19
Single Choice

What will the following PostgreSQL query return? SELECT * FROM projects WHERE (start_date = '2024-01-01' AND end_date = '2024-12-31') OR (status = 'Completed' AND priority = 'High');

Q20
Single Choice

Which of the following PostgreSQL queries is most likely to be part of a certification exam and uses AND and OR operators effectively?

Q21
Multiple Choice

Identify the SQL scripts that correctly use the 'AND' and 'OR' operators to filter rows in PostgreSQL.

Q22
Multiple Choice

Select the SQL scripts that correctly use the 'AND' and 'OR' operators with string values in PostgreSQL.

Q23
Multiple Choice

Determine the SQL scripts that correctly use the 'AND' and 'OR' operators with subqueries in PostgreSQL.

Q24
Multiple Choice

Identify the SQL scripts that correctly use the 'AND' and 'OR' operators with JOINs in PostgreSQL.

Q25
Multiple Choice

Select the SQL scripts that correctly use the 'AND' and 'OR' operators with multiple conditions in PostgreSQL.

Q26
Multiple Choice

Determine the SQL scripts that correctly use the 'AND' and 'OR' operators with window functions in PostgreSQL.

Q27
Multiple Choice

Identify the SQL scripts that correctly use the 'AND' and 'OR' operators with EXISTS in PostgreSQL.

Q28
Multiple Choice

Determine the SQL scripts that correctly use the 'AND' and 'OR' operators with UNION in PostgreSQL.

Q29
Multiple Choice

Identify the SQL scripts that correctly use the 'AND' and 'OR' operators with DISTINCT in PostgreSQL.

Q30
Multiple Choice

Determine the SQL scripts that correctly use the 'AND' and 'OR' operators with LIMIT OFFSET in PostgreSQL.