SQLite Basic Operation

Source: Internet
Author: User
Tags sqlite

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

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.