SoFunction
Updated on 2025-04-14

Quick search of common statements in MYSQL (latest compilation)

OK, according to your requirements, the adjusted form is as follows:

OK, I have added a new operation to view a specific table in the table-level operation. The following is the updated table:

level Operation Type SQL statements Example
Library level increase CREATE DATABASE CREATE DATABASE mydb;
Library level check SHOW DATABASES SHOW DATABASES;
Library level delete DROP DATABASE DROP DATABASE mydb;
Library level change ALTER DATABASE ALTER DATABASE mydb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Table level increase CREATE TABLE CREATE TABLE users (id INT AUTO_INCREMENT, name VARCHAR(100), age INT, PRIMARY KEY(id));
Table level check SHOW TABLES SHOW TABLES;
Table level check DESCRIBE table_name DESCRIBE users;
Table level delete DROP TABLE DROP TABLE users;
Table level change ALTER TABLE ALTER TABLE users ADD COLUMN email VARCHAR(100);
Field level increase ALTER TABLE ADD COLUMN ALTER TABLE users ADD COLUMN email VARCHAR(100);
Field level check DESCRIBE DESCRIBE users;
Field level delete ALTER TABLE DROP COLUMN ALTER TABLE users DROP COLUMN email;
Field level change ALTER TABLE MODIFY COLUMN ALTER TABLE users MODIFY COLUMN age INT NOT NULL;
Data level increase INSERT INTO INSERT INTO users (name, age) VALUES ('Alice', 30);
Data level check SELECT SELECT * FROM users;
Data level check SELECT ... WHERE SELECT * FROM users WHERE age > 25;
Data level change UPDATE UPDATE users SET age = 31 WHERE name = 'Alice';
Data level delete DELETE FROM DELETE FROM users WHERE name = 'Alice';

Detailed description:

Library-level operations:

  • CREATE DATABASE: Create a new database.
  • SHOW DATABASES: View all databases on the current MySQL server.
  • DROP DATABASE: Delete the specified database.
  • ALTER DATABASE: Modify the properties of the database (such as character sets, sorting rules, etc.).

Table-level operations:

  • CREATE TABLE: Create a new table.
  • SHOW TABLES: View all tables in the current database.
  • DROP TABLE: Delete the specified table.
  • ALTER TABLE: Modify the structure of the table (such as adding columns, deleting columns, modifying column types, etc.).
  • DESCRIBE table_name: Check the structure of a specific table, including column name, data type, default value, and whether it is allowedNULLwait.

Field-level operations:

  • ALTER TABLE ADD COLUMN: Add a new field to the table.
  • DESCRIBE: View the structure of the table, including column information, data type, default value, etc.
  • ALTER TABLE DROP COLUMN: Delete a column in the table.
  • ALTER TABLE MODIFY COLUMN: Modify the type, size, or other properties of a column in the table.

Data-level operations:

  • INSERT INTO: Insert a new record into the table.
  • SELECT: Query the data in the table, supporting different filtering and sorting conditions.
  • SELECT ... WHERE: Query specific records based on conditions.
  • UPDATE: Update existing records in the table.
  • DELETE FROM: Delete records in the table.

After this modification, each operation level (store level, table level, field level, data level) in the table already meets your requirements.

This is the end of this article about quick search of common sentences in MYSQL. For more related contents of quick search of common sentences in mysql, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!