Database (Linux)

Source: Internet
Author: User
Tags glob

Hierarchical database

Tree-shaped. 1:n

Mesh Database

The mesh. Can be converted into hierarchical database by mathematical method

relational database

Convert relational database relationships into simple two-time patterns

Dbaseiii;foxbase; Access orcle mysql Lotus sql orcle MySQL sqlite3

LAMP linux apache MySQL php tomcat JAVA

Create or select a database

Sqlite3 study.db

View Database

. databases

Exit database

. Quit

Create a table

CREATE TABLE Department (

Int

CHAR

TEXT

REAL

)

View Table

. Table

View table Structure

. Schema Comany

Check all table Structures

. Schema

Delete a table

drop TABLE Department;

Insert content into a table

    1. INSERT into company values (.......) The values (...) are not the same as those of the ". ...."
    2. INSERT into company values (.............);.);

Format Control

. Head On

. Mode column

Find table Contents

Select *from Company

WHERE clause

    1. SELECT * FROM company where id= 7;
    2. Operators:> < >= <= and or not like Glob exists
    3. SELECT * FROM company where age= in (25,27);
    4. The age of 25 or 27 years
    5. SELECT * from Companny where age between and 27;
    6. Age 22--27
    7. SELECT * FROM company where age is not null;
    8. Age cannot be empty
    9. SELECT * FROM company where exists (select Age company wherer salary >65000);

Like child statement and Glob child statement

    1. SELECT * from company where name like ' p% '; case insensitive
    2. SELECT * FROM company where Glob ' p* ';

Limit statement

Limit the amount of return that matches a condition

    1. SELECT * FROM company where age <30 limit 2;
    2. SELECT * from company limit 2;
    3. Select *from compay limit 2 offset 2;

ORDER BY clause

ASC Ascending DeSc Descending

Database (Linux)

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.