Relational databases: storage format can directly reflect the relationship between the entities . Relational databases and common form is quite similar to relational database tables between the table and there is a lot of complex relationships. Common relational databases have Mysql, SqlServer and so on.
Non-relational databases: refers to the distributed, non-relational, not ensure compliance data storage systems ACID principles, such as MongoDB, Redis, Memcache . (ACID: atomicity, consistency, independence and persistence)
Second, the operation in the terminal database
Log database
mysql -uroot -p123456
(Sql statement requires a semicolon at the end) all database queries the database server
showdatabases;
Select one database operations
use 数据库名;
drop out
exit
Third, create a database table data
Create a database
createdatabase test;
View data in the database table
showtables;
Creating a data table
CREATETABLE pet (
name VARCHAR(20),
owner VARCHAR(20),
species VARCHAR(20),
sex CHAR(1),
birth DATE,
death DATE);
View data table structure
describe pet;
Fourth, the common data types
1. Value Type
2. Date / Time Types
3. string type
V. CRUD
By INSERT
INSERTINTO pet VALUES('Puffball','Diane','hamster','f','1999-03-30',NULL);INSERTINTO pet VALUES('狗蛋','刘景','狗','公','1989-03-30',NULL);