I don't know of any database that can limit the number of rows in a database as a feature.
I guess you could create a key or something..
But that's much more complex than just running
a query like :
SELECT count(*) FROM table;
and seeing if that says 1000.
Before you can delete you need to know what to delete.
If you want to delete "everything but the last 1000 records" you'll need to be able to find the records that are not part of the final 1000.
You could create a comma-seperated string of the ID's of all the 1000 records you want to keep, and then
DELETE FROM table WHERE ID not in ($string);
$string would be (1,3,4,5,6,7,6 etc untill 1000)