Basic SQLite operations, sqlite operations

Source: Internet
Author: User

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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.