Basic SQLite operations, sqlite operations
SQLite basic operations: database creation, table creation, data insertion, data modification, data deletion, table deletion, and database deletion. 1. Enter sqlite3 test in the command line to create a database. db // note the current user. If it is a root user, the database is established under the/home directory, and other user libraries are established under the user's root directory sqlite>. the database displays the created database. 2. Create a table> sqlite3 test. dbsqlite> create table infor (name varchar (10), age int); 3. insert data sqlite> insert into infor values ('liu', 23 ); sqlite> insert into infor values ('zhang ', 22); sqlite> insert into infor values ('lil', 24 ); view records sqlite> select * from infor liu | 23 zhang | 22li | 244. delete data sqlite> delete from infor where name like 'lil'; sqlite> select * from infro; liu | 23 zhang | 225. update Data sqlite> update infor set age = 20 where name = 'zhang'; sqlite> select * from infor; liu | 23 zhang | 206. view the table and database information sqlite>. tablesinforsqlite>. database0 main/home/sqlite/test. db1temp7: delete a table sqlite> drop table infor; sqlite>. tablessqlite> 8. Delete the database> rm test. db