Correct option is B
The IN operator in SQL is used to check whether a value matches any value present in a specified list. It simplifies queries that would otherwise require multiple OR conditions.
For example:
SELECT * FROM Students
WHERE Course_ID IN (101, 102, 103);
This query returns rows where Course_ID is either 101, 102, or 103.
Therefore, the correct answer is IN.
Important Key Points:
- The IN operator is used to match values from a specified list.
- It reduces the need for multiple OR conditions in SQL queries.
- The operator can be used with both numeric and string values.
- IN is commonly used in the WHERE clause for filtering records.
Knowledge Booster:
- (a) BETWEEN: Incorrect because BETWEEN is used to filter values within a specified range.
- (c) LIKE: Incorrect because LIKE is used for pattern matching with wildcard characters.
- (d) EXISTS: Incorrect because EXISTS checks whether a subquery returns any rows.
- (e) DISTINCT: Incorrect because DISTINCT is used to remove duplicate rows from query results.