Age Range With NULLs
Medium
Pattern & Range Filtering
Return contacts aged between 20 and 40 inclusive. Contacts with unknown age must not appear. Order by id.
Table schema
Contacts(id INT PRIMARY KEY, name VARCHAR(20), phone VARCHAR(12), age INT, city VARCHAR(10))Sample data
id | name | phone | age | city
1 | Anita Rao | 98200-11111 | 25 | Pune
2 | Arun Das | 98100-22222 | 31 | Delhi
3 | Bela Shah | 70000-33333 | 45 | Pune
4 | Chirag Rao | 98200-44444 | NULL | Mumbai
5 | Anil Roy | 99999-55555 | 19 | NULL
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.