Get the App
SLTechnology News&Howtos  ›  Database  › 

Mysql addition, deletion, modification and search

Shulou Source: shulou.com Published: 2022-06-01 16:56:38 11月16日 Update

Create a datasheet:

Mysql > use simonwang

Database changed

Mysql > show tables

Empty set (0.00 sec)

Mysql > create table T1 (`id` int (4), `name` char (40))

Query OK, 0 rows affected (0.01 sec)

Insert data:

Mysql > insert into studytable values (1)

Query OK, 1 row affected (0.00 sec)

Mysql > select * from studytable

+-+ +

| | id | name |

+-+ +

| | 1 | test |

+-+ +

1 row in set (0.00 sec)

Modify the data:

Mysql > update studytable set name='updatetest' where id='1'

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0

Mysql > select * from studytable

+-+ +

| | id | name |

+-+ +

| | 1 | updatetest |

+-+ +

1 row in set (0.00 sec)

Empty the datasheet:

Mysql > truncate table studytable

Query OK, 0 rows affected (0.00 sec)

Mysql > select * from studytable

Empty set (0.00 sec)

Delete the datasheet:

Mysql > drop table studytable

Query OK, 0 rows affected (0.00 sec)

Delete the database:

Mysql > drop database simonwang

Query OK, 0 rows affected (0.01 sec)

Tags: Data data table database Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Microsoft Shulou Tech Info vpn MySQL