Interview Question

What is BETWEEN operator?

BETWEEN includes both range boundaries.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

BETWEEN tests whether a value is inside an inclusive range. • x BETWEEN a AND b is equivalent to x >= a AND x <= b. • The lower and upper bounds are both included. • Date-time ranges need careful boundaries when time values are present.

💡 SQL Example

SELECT name FROM products WHERE price BETWEEN 10 AND 20;

Result

Products priced from 10 through 20

⚡ Quick Revision

BETWEEN includes both range boundaries.