CRUD operation and use of the database
- C (Create): Creating
1. Create a database: create database database name;
2. Create a database to determine whether there is another: create database if not exists Database name;
3. Create a database and specify the character set: create database database name of the character set the character set;
4. Integrated: Create database S3, determines whether there is, and specifies the character set to GBK
Create character database iF Not eXISTS S3 sET GBK;
- R (Retriev): inquiry
1. All queries the database name: Show Databases;
2. query a database character set (see Creating a database statement): show create database database name;
- U (Update): Modify
1. Modify the character set of the database: alter database database name of the character set the character set names;
- D (Delete): Delete (very dangerous not recommended.)
1. Delete the database: drop database database name;
2. determine the database exists, there is then deleted: drop database if exists database name;
- Using a database (the database can be seen as a folder inside the structure seen in Table folder contents in storage)
1. query the database currently in use: the SELECT Database ();
2. Use Database (equivalent access to the database (into the folder)): use database name;