Learning recently really has gone a lot of detours, learning Metasploit Devil training camp, East learning learn from the West learning nothing has learned. or return simple best, back to think about it, there is a window of the development of windows, how to forget it. So I began to study according to this picture.
a bit large = =.
Start text.
0x01: base operation.
First, create database and table, etc.
CREATE database name;
CREATE table table name (domain name data type column options [,...]) [Charset=utf8];
The column options are as follows:
1. Auto_increment define self-increment sequence
2, PRIMARY key primary key
3. Default ' default ' defines column defaults
4, index definition indexes
5, [NOT] NULL allows/disables NULL
6. CHECK defines the range/options for the values you can enter
7. Unique definition Uniqueness
SHOW TABLES; Displays all the tables.
DESC table name; Displays the structure of the table.
Second, data insertion and display.
INSERT into table name (domain name [,...]) Values (value [,...]);
SELECT domain name [,...] from table name;
0X02: Data manipulation and table operations.
First, insert \ Delete \ update the data.
INSERT into table name (domain name [,...]) Values (value [,...]);
DELETE from table name WHERE conditional expression;
UPDATE table Name set column Name 1 = value 1, column Name 2 = value 2, ... WHERE conditional expression;
Two, the connection of more than one table.
Internal connection: SELECT table name 1. Column name [,...] Table Name 2. Column name [,...] From table name 1 INNER JOIN table name 2 on table 1. Foreign key = Table 2. primary key;
Outer joins: SELECT table name 1. Column name [,...] Table Name 2. Column name [,...] From table name 1 left/right OUTER JOIN table name 2 on table 1. Foreign key = Table 2. primary key;
MySQL Learning note one