MySQL study note 2: basic operation of database of create delete view

  • 2020-05-14 05:11:56
  • OfStack

The MySQL we installed is basically a database management tool. The real valuable thing is that the data in the data relational database exists in the form of tables. The N tables have been aggregated into a database since 1. Now let's look at the basic operation of the database
Nothing more than 3 points: create delete view

Create a database
 
mysql> create database school; 
Query OK, 1 row affected (0.00 sec) 

The create database statement is used to create the database
school is the name of the database, ending with a semicolon
Successful execution will show Query OK and the execution time
Once you have the database, 1 will normally view the current database

View database
 
mysql> show databases; 
+--------------------+ 
| Database | 
+--------------------+ 
| information_schema | 
| mysql | 
| performance_schema | 
| school | 
| test | 
+--------------------+ 
rows in set (0.00 sec) 

This displays the database that was created, where school was just created
The rest exist by default, so don't mess around
test is for your test and can be deleted

Delete database
 
mysql> drop database school; 
Query OK, 0 rows affected (0.00 sec) 

Delete is also very simple, drop database command can be
And then you can use show, databases to see what it looks like and just be careful that you don't forget the semicolon at the end of the statement and in practice, we're not dealing with the database, we're dealing with the tables in the database so this is pretty straightforward

Related articles: