Prepare for the A Level Computer Science OCR Exam with engaging quiz questions and interactive flashcards. Get ready to excel in your exam with comprehensive study materials designed to bolster your knowledge and confidence.

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

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.