Price Band Lookup (Non-Equi Join)
Medium
Join Types Deep Dive
Attach the band label to each product by joining on the price range. Order by product id.
Table schema
Products(id INT PRIMARY KEY, price INT)
Bands(label VARCHAR(10), min_price INT, max_price INT)Sample data
Products
id | price
1 | 15
2 | 55
3 | 120
Bands
label | min_price | max_price
Low | 0 | 49
Mid | 50 | 99
High | 100 | 999
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.