SQLite Basic Operationthe basic operation of SQLite: building a library, building a table, inserting data, modifying data, deleting data, deleting a table, deleting a library. 1. Build the libraryat the command line, enter >sqlite3 test.db//Note what the current user is, if it is the root user, the library is built in the/home directory, and the other user libraries are built under the user's root directory .sqlite>.database displaying the created database2. Build a table>sqlite3 test.dbsqlite>create Table infor (name varchar (ten), age int);3. Inserting DataSqlite>insert into infor values (' Liu ', +);Sqlite>insert into infor values (' Zhang ', +);Sqlite>insert into infor values (' li ', +);View RecordsSqlite>select * from InforLiu |Zhang |Li |4. Delete DataSqlite>delete from infor where name is like ' Li ';Sqlite>select * from Infro;Liu |Zhang |5. Update Datasqlite> Update infor set age=20 where name = ' Zhang ';Sqlite>select * from infor;Liu |Zhang |6. View information for tables and librariesSqlite>.tablesinforSqlite>.database0 main/home/sqlite/test.db1temp7. Delete a tablesqlite>drop table infor;Sqlite>.tablessqlite>8. Delete Library>rm test.db
SQLite Basic Operation