MySQL Basics note (ii)-SQL basic operations

Source: Internet
Author: User
Tags set set

SQL Basic Operations

Basic operations: CRUD, additions and deletions

The basic operations of SQL are categorized according to the object of operation:

1. Library operation

2. Table operation

3. Data manipulation

Library Operations:

To change the database and delete the search

 New database:

  Basic syntax:

1 Create  database name [ library option ];

Library options: Used to constrain the database, divided into two options: 1, Character set: Charset/character set specific character set (data storage encoding format, Chinese common character set GBK and UTF8.). 2, Proofing Set set: Collate specific proofing Set (data comparison rules).

For example:

  

Where: The database name cannot be used for keywords (characters that have already been used) or reserved words.

If you do not want to use keywords or reserved words, you must use the anti-quote. (Enter ' in the English state below ESC).

What happens after the SQL statement that created the database was executed?

1, in the database system, increased the corresponding database information

2. In the folder where the data is saved: A folder that corresponds to the database name is created.

  View Database

 1. View all databases

1 show databases;

2. View the specified part of the database: Fuzzy query

1 Database  like ' pattern ';  

--pattern refers to the matching pattern:% (Percent semicolon): Indicates that multiple characters are matched. _ (Underscore): Represents a single character match.

3. View the database creation statement

1 Create  database name;

Update Database

  The database name is not modifiable.

Database modification is limited to library options: Character set and proofing set (small heap dependent character set).

Is

1 Alter  database name [ library option ] Chaerset XXX;

 Deleting a database

1  database name;

previous section: MySQL Basic notes (i)

next section: MySQL basic Note (iii)-table operation Basics

MySQL Basics note (ii)-SQL basic operations

Related Article

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.