Kiran,
as you write, you can use multiple rules to do what you intend to do.
To write all events to the database except those two, you need to create two rules above the write to database rule - and these three should be the last ones in the rule set.
What you do is use the discard action. If you execute the discard action, the message will be - as it says - discarded, that it nothing else will be executed.
So you can create a rule one that says discard if priority is info.
The next one is to discard if pri is debug.
These two rules will discard those message that you do not like to write to the database.
Then, the next rule says "write to database". It will write ALL messges to the database, but ALL means only those that have not previously been discarded.
Please note that ones discard, you can not re-create a message. This is why you should place this logic to the bottom of your rule set.
I know this whole procedure is clumpsy ... this is why we totally replaced it in the 5.x versions. There you have powerful boolean expressions where you can simply say "priority less then 6" - that's it. But not in 4.x...
I hope this helps,
Rainer