Use of SQL statements

Source: Internet
Author: User
Tags sqlite database

In mobile development, we often encounter SQLite database and summarize the commonly used list.

If there is a data table in the database company, as follows:

ID          NAME        age         ADDRESS     SALARY----------  ----------  ----------  ----------  -------- --1           Paul          California  20000.02           Allen          Texas       15000.03           Teddy          Norway      20000.04           Mark          rich-mond   65000.05           David          Texas       85000.06           Kim          south-hall  45000.07           James          Houston     10000.0

Requirement 1: find age greater than or equal to 25 and wages greater than or equal to 65000.00

sql:   select * from company WHERE age >= 25 and SALARY >= 65000

 query result 
ID NAME age ADDRESS salary---------- ---------- ---------- ---------- ----------4mark 25 rich -mond 65000.05 david 27 texas 85000.0

Requirement 2: Find all the ' ki start ' content.

*' ki% '

ID NAME age ADDRESS SALARY
  ---------- ---------- ---------- ------ ---- ----------6 kim 22 south -hall 45000.0 

requirements 3:  Specify a range, such as find age 25, 27.
sql:selecte *from
company WHERE Age in (25,27)

or age is not 25,27
sql:selecte *from   company  WHERE age isn't in (25,27)
Requirement 4: Find records between 25 and 27 for age
sql:selecte *from   company   betwen  


Use of SQL statements

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.