If the need is to be able to determine whether file is a SQLite database, then the SQLite database specification provides the definitive answer:
[quote]1.2.1. Magic Header String
Every valid SQLite database file begins with the following 16 bytes (in hex): 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00. This byte sequence corresponds to the UTF-8 string “SQLite format 3” including the nul terminator character at the end.[/quote]
As soon as the file does not have the header above, it is not an SQLite database. This approach will not however tell what kind of file the “not SQLite” file actually is. Your approach provides much richer information, but it is going to be quite a lot of work to identify everything that is’nt an SQLite database.