Get the App
SLTechnology News&Howtos  ›  Database  › 

Simple steps to manipulate MySQL-2 data

Shulou Source: shulou.com Published: 2022-06-01 19:41:57 10月02日 Update

This article mainly tells you about the simple steps to manipulate MySQL-2 data. You can look up the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here, so let's go straight to the topic. I hope this article on simple steps to manipulate MySQL-2 data can bring you some practical help.

# query

Select from table name

Example:

Select from students

# increase

Insert all columns: insert into table name values (...)

Example:

Insert into students values (0, "Huang Rong", "1990-01-01", 0meme0)

Default insert: insert into table name (column 1. Values (worth 1pm...)

Example:

Insert into students ("name", "gender") values ("Guo Jing" 1)

Insert multiple pieces of data at the same time: insert into table name values (...), (...).

Example:

Insert into students values (0, "Little Dragon Girl", "1992-02-03", 0meme0), (0, "Yang Guo", "1991-01-01", 1mem0)

Or the name of the insert into table (column 1.) Values (worth 1pm), (worth 1pm...)

Example:

Insert into students ("name", "gender") values ("Diao", 1), ("Guo Xiang", 0)

# Mysql can insert multiple pieces of data at the same time, which is unique to Mysql.

# modify

Update table name set column 1 = value 1 Personnal... Where condition

If no where condition is added, all columns are modified

Example:

Update students set birthday= 1980-02-01 "where name=" Guo Jing

# modify multiple values:

Update students set name= "Ronger" birthday= "1988-01-01" where name= "Huang Rong"

# Delete

# physical deletion

Delete from table name where condition

Example: delete from students where id=5

# logical deletion

Update students isdelete=1 where.; / / add an isDelete column with a default value of 0, and delete it to change the value to 1

Example:

Update students isDelete=1 where id=6

When querying, only query the data of isDelete=0 to achieve the deletion effect.

Select * from students where isDelete=0

The simple steps of operating MySQL-2 data will stop here. If you want to know about other related issues, you can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.

Tags: Data steps conditions queries specialties simultaneous multiple industry expertise topics books content functions multiple practical dragons effects news terminology plates Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Microsoft MariaDB Docker OPPO Reno