If you have not installed or used sqlite, you can use SQLite3 for installation and basic operations. 1. Create a database test. dbcd ~ Sqlite3test. db
If you have not installed or used sqlite, you can use SQLite3 for installation and basic operations. 1. Create a database test. db cd ~ /Sqlite3 test. db
If you have not installed or used sqlite, you can use SQLite3 for installation and basic operations.
1. Create a database test. db
Cd ~ /
Sqlite3 test. db
In this way ~ /A database file test. db is generated under the directory.
2. Create a table song
Create table if not exists song (path TEXT, title varchar (20 ));
Create a database table named song, which contains the path and title fields in the Text and varchar types.
3. insert data
Insert into song values ('/mnt/sdcard/Music', 'Only You ');
Insert into song values ('/mnt/sdcard/Music', 'love ');
Insert into song values ('/exte/Music', 'thineking ');
A total of three data records are inserted.
Verify the data in the database table. Query:
Select * from song;
4. query the data of a specified condition
Select * from song where path = '/mnt/sdcard/music'
Or
Select * from song where path = "/mnt/sdcard/music"
Now I have a requirement to find the song information under all/directories?
Fuzzy query!
Select * from song where path LIKE '/% ';
Or
Select * from song where path LIKE "/% ";
Easy to handle!
,