Mysql Learning Note 2: Basic operations for a database (create a delete view) _mysql

Source: Internet
Author: User
Tags create database
We installed the MySQL plainly is a database management tool, the real value is that the data relational database data is in the form of tables, n tables are summarized together into a database now look at the basic operation of the database
Nothing more than three: Create a delete view

Creating a database
Copy Code code as follows:

Mysql> CREATE DATABASE School;
Query OK, 1 row Affected (0.00 sec)

The CREATE DATABASE statement is used for creating databases
The school in the back is the name of the database, the semicolon ends
Successful execution will show query OK and execution time
When you have a database, you will normally see the current database

View Database
Copy Code code as follows:

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Performance_schema |
| School |
| Test |
+--------------------+
Rows in Set (0.00 sec)

This shows the database you created, where school was just created
The remaining few defaults exist, don't move
Test is for you to do testing use, you can delete

Delete Database
Copy Code code as follows:

mysql> drop Database School;
Query OK, 0 rows Affected (0.00 sec)

Delete is also very simple, drop database command can
And then you can use show databases to see the effect. Note that after the statement, do not forget the semicolon in practice, we operate more than a database, but a table in the database so the content here seems very simple
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.