Database common commands;
View database: show databases;
Creating a database: Create databases database_name;
Delete database: drop databases database_name;
MySQL-supported engine; show engines \g;
Shows the storage engine supported by the database; Show variables like ' have% ';
Using the database: use database_name;
Displays the contents of the database: show CREATE DATABASE database_name \g;
Show the created data table; show tables;
View table detail Structure statement; Show CREATE table Tb_emp \g;
View the structure of the table desc TB_EMP1;
============================= Database Concept ============================
SQL (Structured Query language)
Data Definition Language DDL
Data Manipulation Language DML
Data Control Language DCL
INFORMATION_SCHEMA: Some database object information in the primary storage system, such as user table information, column information, permission information, character set information and partition information, etc.
Performance_schema: Primary Storage database service performance parameters.
MySQL: User rights information for the primary storage system.
Test: Tests the database, which can be used by any user.
The database name consists of letters, numbers, underscores, @, #, and $, where the letters can be a~za~z, or they can be letters and characters in other languages.
The first letter cannot be a number and the $ identifier is not allowed to be a reserved word for MySQL. Spaces and special characters are not allowed. The length is less than 128.
Storage engine;
MyISAM storage engine; Access is faster because the storage engine does not support things and does not support foreign keys. Therefore, there is no requirement for the integrity of things and access-oriented applications are suitable for the storage engine.
InnoDB storage engine; Because the storage engine has an advantage in things, which is to support the installation of things with commit, rollback, and crash resiliency, it consumes more disk space than the MyISAM storage engine.
As a result, frequent updates and deletions are required, as well as a high level of integrity requirements, requiring concurrency control, which is appropriate for the storage engine.
Memory storage engine, the storage engine stores data by using RAM, so the storage engine has a fast data access, but security is not guaranteed.
If the data involved in the application is small and requires quick access, it is appropriate for the storage engine.
MySQL Concepts and common commands