Prepare for the A Level Computer Science OCR Exam with engaging quizzes, detailed explanations, and effective study tips. Maximize your readiness and boost your confidence for exam day!

Practice this question and more.


In SQL, which statement indicates that both conditions must be true?

  1. OR

  2. AND

  3. NOT

  4. IF

The correct answer is: AND

The statement that indicates that both conditions must be true is represented by the logical operator AND in SQL. When using AND between two conditions in a query, it ensures that the result set includes only those records where both specified conditions are met. For instance, if you write a SQL clause such as `WHERE condition1 AND condition2`, the database will return rows only when both condition1 and condition2 evaluate to true. This operator is foundational in SQL for filtering data, as it allows for more precise and specific queries by combining multiple criteria that must all hold true simultaneously. The other options serve different purposes: OR allows either condition to be true for a record to be included, NOT negates a condition rather than combining conditions, and IF is a control flow statement rather than a logical operator for combining conditions in a WHERE clause.