@aeric Sorry to disagree but embedded queries are just what SQLite VIEWs are. They are designed to save you from having to write code for a 'database of database queries' as you have described above.
@Sergey_New See the attached project. I have made a couple of modifications to both the code and the database to demonstrate.
Firstly don't use 'key' as a field name in SQLite because it is a reserved word. I have changed it to 'keyx'
Within the code you will see an object called
'MyDatabaseView'. It is not a TABLE but a VIEW object the detail of which you can only see if you load the database into your SQLite Browser. It actually represents the more complicated query:
SELECT keyx, lds FROM tags WHERE lds = 'Y' ORDER BY keyx DESC
Having defined the query in the database you call it with a simple SELECT command. You can define as many VIEW queries as you like but they remain read-only.