MySQL base preparation and DDL statements

Source: Internet
Author: User

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

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.