It sounds like you are supplying an sqlite3 database file as one of the Support Files in the question. If that's the case, then indeed all files supplied by the question author are write protected. This is essential for security - you don't want students writing code that modifies files used in testing their code!
The solution is simple, however. You just need to modify the template so that it makes a copy of the database file before each test is run, and use the copy for sqlite3, not the original. For an example of how it's done, create a new SQL question, click "Customise" and inspect the template.