Use SQLite in Android (perform operations in cmd)

Source: Internet
Author: User

 Operate SQLite in cmd

First, let's talk about the relationship between the SQLite database and the application. Many people are not very clear about it. In fact, unlike Java Web, an SQLite database only corresponds to one application, for example, the database name is test_mars_db.db.
The Application name is Mars. sqlite3, then the database file is directly placed in the data/data application of the simulator Mars. under databases in qlite3 (you can use the LS and LS-l commands to view the directory, in the CD
Use the LS command in the data/data directory to display information about all processes ). If the test_mars_db database is not available, sqlite3 test_mars_db will create a new database. You can use the following statement:Createtable user (ID int, name varchar (20), create a new table, insert data using insert, and perform other queries, updates, and deletes.

As follows:

 


Using SQLite in Android

The advantage of SQLite is its efficiency. The Android runtime environment contains the complete SQLite.

The biggest difference between SQLite and other databases is its support for data types. When creating a table, you can specify the Data Type of a column in the createtable statement, however, you can put any data type into any column. When a value is inserted into the database, SQLite checks its type. If this type does not match the associated column, SQLite will try to convert the value to the column type. If the conversion fails, the value is stored as its own type. For example, you can put a string in the integer column. SQLite calls this "weak type" (manifesttyping .).

In addition, SQLite does not support some standard SQL functions, especially the foreign key constraint (foreign ).
Key constrains), nested transcaction and right Outer Join and full
Outer Join, and some alter table functions.


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.