SQL language Overview
The full name of the SQL (Structured query Language) language is the Structured Query language. The database management system manages the data in the database through the SQL language.
The SQL language is divided into three parts: the data definition language (Language, which is referred to as DDL), the Data manipulation language (manipulation Language, referred to as DML), and the Data Control language Language, referred to as DCL).
DDL statements: CREATE, ALTER, DROP
DML statements: UPDATE, INSERT, delete, select
DCL statement: Is the database control function. Statements that are used to set or change permissions for a database user or role, including (Grant,deny,revoke, etc.) statements
MySQL installation and start-up
Yum Installation
Http://jingyan.baidu.com/article/c74d600079be530f6a595dc3.html
RPM Installation
Http://www.cnblogs.com/xiaoit/p/3877913.html
• Source Installation
http://blog.csdn.net/wendi_0506/article/details/39478369
Basic Database Operations
1 SHOW DATABASES; Show all databases 2 CREATE database name ; CREATE DATABASE 3 DROP database name ; Deleting a database
database table Basic Operations
Increase
CREATE Table Table name (property name data type [ integrity constraint], property name data type [integrity constraint], attribute name data table [integrity constraint]);
By deleting
1 drop table table name; 2 Delete table table name, remove content, do not free space, do not delete definition 3 TRUNCATE table name; delete content, free space, but do not delete definition
Change
1 Modify table name alter tables old table name renmae new table name;2 modify field ALTER TABLE name change Old property name new property name new data type 3 add field ALTER Table Table name Add property name 1 data type [integrity constraint] [first | After property name 2]4 Delete field ALTER table Name drop property name
Check
1 View BASIC table Structure DESCRIBE (DESC) table name;2 SHOW CREATE table table name;
MySQL base preparation and DDL statements