Get the App
SLTechnology News&Howtos  ›  Database  › 

A brief Analysis of several commands in MySQL

Shulou Source: shulou.com Published: 2022-06-01 20:19:33 09月20日 Update

The following content mainly brings you a brief analysis of several MySQL commands, the knowledge mentioned here, which is slightly different from books, is summed up by professional and technical personnel in the process of contact with users, and has a certain value of experience sharing, hoping to bring help to the majority of readers.

1) there are 3 ways to start MySQL service

1. Manual.

2. Cmd-- > services.msc opens the window of the service

3. Use the administrator to open cmd

* net start mysql: start the service of mysql

* net stop mysql: disable the mysql service

MySQL login: mysql-uroot-p password

SQL classification

1) DDL data definition language: create, show, alter, drop

2) DML (Data Manipulation Language) data manipulation language: add, delete and modify

Keywords: insert, delete, update

3) DQL (Data Query Language) data query language: keywords: select, where, etc.

4) DCL (Data Control Language) data control language (understanding)

DDL: define database objects: databases, tables, columns

C=Create create database: create database database name

R=Retrieve queries the names of all databases: show databases

U=Update modifies the character set of the database: alter database database name character set character set name

D=Delete delete database: drop database database name

DML

1. Add data: insert into table name (column name 1, column name 2. Column name n) values (value 1, value 2... Value n)

Replicated table: create table table name like replicated table name

two。 Delete data: delete from table name [where condition]

TRUNCATE TABLE table name;-- it is recommended to delete the table first and then create the same table.

3. Modify data: update table name set column name 1 = value 1, column name 2 = value 2. [where condition]

DQL: record select field in query table from table name where condition list

For a brief analysis of the above commands about MySQL, if you need to know more, you can continue to pay attention to the innovation of our industry. If you need professional answers, you can contact the pre-sales and after-sales on the official website. I hope this article can bring you some knowledge updates.

Tags: Data database name language service condition query command specialty key keyword character character set knowledge difference text book person value content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information Xiaomi OPPO Reno Huawei