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
- INSERT into company values (.......) The values (...) are not the same as those of the ". ...."
- INSERT into company values (.............);.);
Format Control
. Head On
. Mode column
Find table Contents
Select *from Company
WHERE clause
- SELECT * FROM company where id= 7;
- Operators:> < >= <= and or not like Glob exists
- SELECT * FROM company where age= in (25,27);
- The age of 25 or 27 years
- SELECT * from Companny where age between and 27;
- Age 22--27
- SELECT * FROM company where age is not null;
- Age cannot be empty
- SELECT * FROM company where exists (select Age company wherer salary >65000);
Like child statement and Glob child statement
- SELECT * from company where name like ' p% '; case insensitive
- SELECT * FROM company where Glob ' p* ';
Limit statement
Limit the amount of return that matches a condition
- SELECT * FROM company where age <30 limit 2;
- SELECT * from company limit 2;
- Select *from compay limit 2 offset 2;
ORDER BY clause
ASC Ascending DeSc Descending
Database (Linux)