Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common SQL statements in Linux-MySQL-

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I don't know if you know any common SQL sentences like Linux-MySQL- before, but I'm here to tell you a little bit about it today. If you are interested, let's take a look at the body. I believe you will gain something after reading the commonly used Linux-MySQL- sentences.

Insert: insert select: find update: modify

Use db1; # Libraries using db1

Select count () from mysql.user; # check how many rows are in the user table of the mysql library

Select from mysql.db; # View all the contents of the mysql library db, you can use select * from mysql.db\ G

Show create table user\ G; # default MyISAM, which automatically counts rows. In this way, the number of engine queries is very fast.

Select db from mysql.db; # queries the db field of the table db in the mysql library.

Select db,user from mysql.db; # queries two fields.

Select * from mysql.db where host like '192.168% query; # like fuzzy query

Insert into db1.t1 values (1, 'abc'); # insert a piece of data, preferably in single quotation marks. The numbers may not be added.

Update db1.t1 set name='aaa' where id=1

Truncate table db1.t1; # empties the contents of the T1 table in the db1 library. The field is not cleared. The table structure is still there.

Drop table db1.t1; # clears all the contents of the db1 table, including fields.

Drop database db1; # removes the db1 library.

What do you think of this article after reading the commonly used SQL sentences in Linux-MySQL-? If you want to know more about it, you can continue to follow our industry information section.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report