Android Interview Collection record database

Source: Internet
Author: User

1.SQLite database How to query the table table1 20th to 30 records?
    • SELECT * FROM table1 limit 19,11 ==> starting from 19, 11 data

2. How can I copy the table structure and data of the Table1 table to table table2?
    • CREATE TABLE Table2 as SELECT * FROM table1;

3. How do I get the number of record rows affected by the most recent Execute SQL statement?
    • INSERT INTO table1 values (1, ' Bill ');
    • Select changes (); ==> returns the number of record rows affected by the INSERT statement

4. Use the LIKE clause and the LIKE function to query the Table1 Name field, respectively?
    • Like function: SELECT * FROM table1 where like ('%bill% ', name);
    • LIKE clause: SELECT * FROM table1 where name like '%bill% '; \

5. If the current date is 2012-11-01, how does it become 2011-12-01?
    • Select Date (' 2012-11-01 ', '-1 years ', ' +1 months ')

How does 6.Android support centralizing open or create SQLite databases?
    • Sqliteopenhelper class
    • Context.openorcreatedatabase method
    • Sqlitedatabase.openorcreatedatabase method

7. Please explain what is the DB4O database?
    • DB40 is the database for objects, an embedded open-source object-oriented
    • Db4o is an object-based database
    • While the other object persistence framework requires a mapping file to associate a relational database with an object

Android Interview Collection record database

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.