To return the number of rooms in the class "TwoSeater":
SELECT COUNT(RollNumber) FROM myTable WHERE RoomType='TwoSeater'
Personally, I would not store the room class as a description, but store an Integer number of "Seats" instead. That way, you can do math to achieve your result, by returning the top result where type is available, and seats >= number-of-seats-required, ordered by "Seats" in ascending order.