时间:2021-07-01 10:21:17 帮助过:2人阅读
9.列出选中数据库中的所有数据表:show tables;
10.展示数据表的列(column)详情:show columns from Table_Name;或者:describe Table_Name;
11.选中展示数据表:select * from Table_Name;
12.带条件展示数据表:select * from Table_Name where id>=2;
13.创建数据表:create table Table_Name(col_01_Name Type Details,col_02_Name Type Details,...);
14.先判断再创建数据表:create table if not exists Table_Name(...);
15.复制数据表:create table Table_Name_01 select * from Table_Name_02;
16.重命名数据表:alter table Table_Name rename as New_Table_Name;或者:rename table Old_Name to New_Name;
17.删除数据表:drop table Table_Name;
18.向数据表添加纪录:insert into Table_Name set col_01=Value1,col_02=Value2;
19.修改数据表中的记录:update Table_Name set col_Name=New_Value where id=1;
20.删除数据表中的记录:delete from Table_Name;
21.带条件删除数据表中的记录:delete from Table_Name where id=1;
22.#当前时间查看:select now();
23.#当前用户:select user();
24.#当前数据库程序版本:select version();
25.#当前状态:show status;
26.#查看当前连接的用户:show processlist;
Mysql简单操作
标签: