Simple Application of SQLite database under Ubuntu12.04

Source: Internet
Author: User
SQLite is a lightweight database that implements the majority of SQL-92 standards, including transactions, which represent atomicity, consistency, isolation and durability (ACID ), trigger and most complex queries. SQLite database is a required database product for software development on the Android platform! A simple example of SQLite development in Ubuntu12.04 is as follows: 1. Install SQLite3 & n

SQLite is a lightweight database that implements the majority of SQL-92 standards, including transactions, which represent atomicity, consistency, isolation and durability (ACID ), trigger and most complex queries. SQLite database is a required database product for software development on the Android platform!

Simple examples of SQLite development in Ubuntu 12.04 are as follows:

1. Install SQLite3
Www.linuxidc.com @ linuxidc ~ $ Sudo apt-get install sqlite sqlite3
2. view the version number
Www.linuxidc.com @ linuxidc ~ $ Sqlite3-version
3. Create a test Database
Www.linuxidc.com @ linuxidc ~ $ Sqlite3 test. db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ". help" for instructions
Enter SQL statements terminated with ";"
Sqlite>
4. view the database
Sqlite>. database
Seq name file
----------------------------------------------------------------------------
0 main/home/hadron/test. db
5. Create a data table
Sqlite> create table user (id, username, password );
6. insert data
Sqlite> insert into user (id, username, password) values (1, 'abc', '123 ');
7. query data
Sqlite> select * from user;
1 | abc| 123
8. log out of the database
Sqlite>. exit
9. Access the database again
Www.linuxidc.com @ linuxidc ~ $ Sqlite3
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ". help" for instructions
Enter SQL statements terminated with ";"
Sqlite>
10. Install the visualization tool:
Www.linuxidc.com @ linuxidc ~ $ Sudo apt-get install

 

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.