MySQL表操作

1.介绍

  表就相当于文件,表中的一条记录就相当与文件的一行内容,不同的是,表中的一条记录有对应的标题,成为表的字段。

2.创建表

2.1语法

create table 表名(
字段名1 类型[(宽度) 约束条件],
字段名2 类型[(宽度) 约束条件],
字段名3 类型[(宽度) 约束条件],
); 注意:
1. 必须进入数据库中才能创建表
2. 标点符号均为英文标点符号
3. 在同一张表中,字段名是不能相同的
4. 宽度和约束条件为可选项
5. 字段名和类型是必须的

2.2范例

1-使用默认格式创建表

mysql> use python25;
Database changed
mysql> show tables;
Empty set (0.00 sec) mysql> create table test1(id int,
-> name char(11),
-> sex enum('male', 'female'),
-> hobby set('swiming', 'running', 'basketball'));
Query OK, 0 rows affected (0.02 sec) mysql> desc test1;
+-------+---------------------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| hobby | set('swiming','running','basketball') | YES | | NULL | |
+-------+---------------------------------------+------+-----+---------+-------+
4 rows in set (0.00 sec)

2-自定义格式创建表

# 指定字符编码
mysql> create table test3 (
-> id int,
-> name char(10),
-> age int,
-> sex enum('male', 'female'),
-> phone char(11),
-> job char(10)
-> ) charset=utf8;
Query OK, 0 rows affected (0.03 sec) #指定存储引擎
mysql> create table test4 (
-> id int,
-> name char(10),
-> age int,
-> sex enum('male', 'female'),
-> phone char(11),
-> job char(10)
-> ) ENGINE=MyISAM;
Query OK, 0 rows affected (0.01 sec)

3-查看表结构、创建表的语句

# 查看表结构
mysql> show columns from test1;
+-------+---------------------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| hobby | set('swiming','running','basketball') | YES | | NULL | |
+-------+---------------------------------------+------+-----+---------+-------+
4 rows in set (0.00 sec) mysql> desc test1;
+-------+---------------------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| hobby | set('swiming','running','basketball') | YES | | NULL | |
+-------+---------------------------------------+------+-----+---------+-------+
4 rows in set (0.00 sec) # 查看创建表的语句
mysql> show create table test1 \G;
*************************** 1. row ***************************
Table: test1
Create Table: CREATE TABLE `test1` (
`id` int(11) DEFAULT NULL,
`name` char(11) DEFAULT NULL,
`sex` enum('male','female') DEFAULT NULL,
`hobby` set('swiming','running','basketball') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

2.删除表

语法:

DROP TABLE 表名;

注意:删表要谨慎

mysql> show tables;
+--------------------+
| Tables_in_python25 |
+--------------------+
| test1 |
| test2 |
| test3 |
| test4 |
+--------------------+
4 rows in set (0.00 sec) mysql> drop table test1;
Query OK, 0 rows affected (0.01 sec) mysql> drop table test2;
Query OK, 0 rows affected (0.01 sec) mysql> show tables;
+--------------------+
| Tables_in_python25 |
+--------------------+
| test3 |
| test4 |
+--------------------+
2 rows in set (0.00 sec)

3.修改表

3.1 修改表名

语法

ALTER TABLE 表名 RENAME 新表名;

范例

mysql> show tables;
+--------------------+
| Tables_in_python25 |
+--------------------+
| test3 |
| test4 |
+--------------------+
2 rows in set (0.00 sec) mysql> alter table test3 rename test1;
Query OK, 0 rows affected (0.02 sec) mysql> show tables;
+--------------------+
| Tables_in_python25 |
+--------------------+
| test1 |
| test4 |
+--------------------+
2 rows in set (0.00 sec)

3.2 增加字段

语法

ALTER TABLE 表名 ADD 字段名 数据类型[(宽度) 约束条件], ADD 字段名 数据类型[(宽度) 约束条件];

范例

mysql> desc test1;
+-------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(10) | YES | | NULL | |
+-------+-----------------------+------+-----+---------+-------+
6 rows in set (0.01 sec) # 增加hobby、home两个字段
mysql> alter table test1 add hobby set('football', 'running'), add home char(10);
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0 mysql> desc test1;
+-------+---------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(10) | YES | | NULL | |
| hobby | set('football','running') | YES | | NULL | |
| home | char(10) | YES | | NULL | |
+-------+---------------------------+------+-----+---------+-------+
8 rows in set (0.00 sec)

3.3 删除字段

语法

ALTER TABLE 表名 DROP 字段名;

范例

mysql> desc test1;
+-------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(10) | YES | | NULL | |
+-------+-----------------------+------+-----+---------+-------+
6 rows in set (0.01 sec) # 删除hobby、home字段
mysql> alter table test1 add hobby set('football', 'running'), add home char(10);
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0 mysql> desc test1;
+-------+---------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(10) | YES | | NULL | |
| hobby | set('football','running') | YES | | NULL | |
| home | char(10) | YES | | NULL | |
+-------+---------------------------+------+-----+---------+-------+
8 rows in set (0.00 sec)

3.4 修改字段

语法

ALTER TABLE 表名 MODIFY 字段名 数据类型[(宽度) 约束条件];

ALTER TABLE 表名 CHANGE 旧字段名 新字段名 旧数据类型[(宽度) 约束条件];

ALTER TABLE 表名 CHANGE 旧字段名 新字段名 新数据类型[(宽度) 约束条件];

范例

mysql> desc test1;
+-------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(10) | YES | | NULL | |
+-------+-----------------------+------+-----+---------+-------+
6 rows in set (0.00 sec) # 修改job字段的数据类型
mysql> alter table test1 modify job varchar(11);
Query OK, 0 rows affected (0.06 sec)
Records: 0 Duplicates: 0 Warnings: 0 mysql> desc test1;
+-------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | varchar(11) | YES | | NULL | |
+-------+-----------------------+------+-----+---------+-------+
6 rows in set (0.01 sec) # 修改job字段为hobby字段
mysql> alter table test1 change job hobby varchar(11);
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0 mysql> desc test1;
+-------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| hobby | varchar(11) | YES | | NULL | |
+-------+-----------------------+------+-----+---------+-------+
6 rows in set (0.00 sec) # 修改hobby字段为job字段,且数据类型改为char
mysql> alter table test1 change hobby job char(11);
Query OK, 0 rows affected (0.06 sec)
Records: 0 Duplicates: 0 Warnings: 0 mysql> desc test1;
+-------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(11) | YES | | NULL | |
+-------+-----------------------+------+-----+---------+-------+
6 rows in set (0.01 sec)

3.5 修改字段排列顺序、在增加的时候指定字段位置

语法

ALTER TABLE 表名 ADD 字段名 数据类型 [(宽度) 约束条件] FIRST;

ALTER TABLE 表名 ADD 字段名 数据类型 [(宽度) 约束条件] AFTER 字段名;

ALTER TABLE 表名 CHANGE 字段名 旧字段名 新字段名 新数据类型 [(宽度) 约束条件] FIRST;

ALTER TABLE 表名 MODIFY 字段名 数据类型 [(宽度) 约束条件] AFTER 字段名;

范例

mysql> desc test1;
+-------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(11) | YES | | NULL | |
+-------+-----------------------+------+-----+---------+-------+
6 rows in set (0.01 sec) # 在表的开头添加hobby字段
mysql> alter table test1 add hobby char(10) first;
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0 mysql> desc test1;
+-------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------------+------+-----+---------+-------+
| hobby | char(10) | YES | | NULL | |
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(11) | YES | | NULL | |
+-------+-----------------------+------+-----+---------+-------+
7 rows in set (0.00 sec) # 在job字段后面添加salary字段
mysql> alter table test1 add salary int after job;
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0 mysql> desc test1;
+--------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-----------------------+------+-----+---------+-------+
| hobby | char(10) | YES | | NULL | |
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(11) | YES | | NULL | |
| salary | int(11) | YES | | NULL | |
+--------+-----------------------+------+-----+---------+-------+
8 rows in set (0.00 sec) # 修改hobby字段名为aihao
mysql> alter table test1 change hobby aihao char(10) first;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0 mysql> desc test1;
+--------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-----------------------+------+-----+---------+-------+
| aihao | char(10) | YES | | NULL | |
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(11) | YES | | NULL | |
| salary | int(11) | YES | | NULL | |
+--------+-----------------------+------+-----+---------+-------+
8 rows in set (0.00 sec) # 把aihao字段放到salary字段后面
mysql> alter table test1 modify aihao char(10) after salary;
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0 mysql> desc test1;
+--------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-----------------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| name | char(10) | YES | | NULL | |
| age | int(11) | YES | | NULL | |
| sex | enum('male','female') | YES | | NULL | |
| phone | char(11) | YES | | NULL | |
| job | char(11) | YES | | NULL | |
| salary | int(11) | YES | | NULL | |
| aihao | char(10) | YES | | NULL | |
+--------+-----------------------+------+-----+---------+-------+
8 rows in set (0.00 sec)

4.数据操作

创建表

# 创建语句
create table teacher(
id int primary key,
name char(10) not null,
age int,
hire_date datetime,
sex enum('male', 'female') not null default 'male',
phone char(11) unique,
salary float(8, 2),
hobby set('running', 'football', 'basketball'),
comment varchar(255)
); # 查看表结构
mysql> desc teacher;
+-----------+----------------------------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+----------------------------------------+------+-----+---------+-------+
| id | int(11) | NO | PRI | NULL | |
| name | char(10) | NO | | NULL | |
| age | int(11) | YES | | NULL | |
| hire_date | datetime | YES | | NULL | |
| sex | enum('male','female') | NO | | male | |
| phone | char(11) | YES | UNI | NULL | |
| salary | float(8,2) | YES | | NULL | |
| hobby | set('running','football','basketball') | YES | | NULL | |
| comment | varchar(255) | YES | | NULL | |
+-----------+----------------------------------------+------+-----+---------+-------+
9 rows in set (0.00 sec)

4.1 插入数据

语法

插入单行数据,

INSERT INTO 表名 (字段1, 字段2, 字段3...) value (值1, 值2, 值3);

如果不添加字段名称,插入的数据需要与表里的字段一一对应

INSERT INTO 表名 value (值1, 值2, 值3);

插入多行数据

INSERT INTO 表名 values (值1, 值2, 值3),(值1, 值2, 值3),(值1, 值2, 值3);

范例

#  插入单条数据,注意float类型会进行四舍五入
mysql> insert into teacher (id, name, hobby) value (1, 'zhangsan', 'running');
Query OK, 1 row affected (0.42 sec) mysql> select * from teacher;
+----+----------+------+-----------+------+-------+--------+---------+---------+
| id | name | age | hire_date | sex | phone | salary | hobby | comment |
+----+----------+------+-----------+------+-------+--------+---------+---------+
| 1 | zhangsan | NULL | NULL | male | NULL | NULL | running | NULL |
+----+----------+------+-----------+------+-------+--------+---------+---------+
1 row in set (0.00 sec) mysql> insert into teacher value (2, 'lisi', 30, '2017-10-20', 'male', '13069948980', 2000, 'basketball', 'haha');
Query OK, 1 row affected (0.15 sec) mysql> select * from teacher;
+----+----------+------+---------------------+------+-------------+---------+------------+---------+
| id | name | age | hire_date | sex | phone | salary | hobby | comment |
+----+----------+------+---------------------+------+-------------+---------+------------+---------+
| 1 | zhangsan | NULL | NULL | male | NULL | NULL | running | NULL |
| 2 | lisi | 30 | 2017-10-20 00:00:00 | male | 13069948980 | 2000.00 | basketball | haha |
+----+----------+------+---------------------+------+-------------+---------+------------+---------+
2 rows in set (0.03 sec) # 插入多条数据
mysql> insert into teacher values (3, 'wangwu', 28, '2016-11-20', 'male', '1382333333', 20000, 'football', 'wowo'),
-> (4, 'xiaoli', 28, '2015-11-20', 'female', '13823333333', 20000, 'football', 'wowo');
Query OK, 2 rows affected (0.40 sec)
Records: 2 Duplicates: 0 Warnings: 0 mysql> select * from teacher;
+----+----------+------+---------------------+--------+-------------+----------+------------+---------+
| id | name | age | hire_date | sex | phone | salary | hobby | comment |
+----+----------+------+---------------------+--------+-------------+----------+------------+---------+
| 1 | zhangsan | NULL | NULL | male | NULL | NULL | running | NULL |
| 2 | lisi | 30 | 2017-10-20 00:00:00 | male | 13069948980 | 2000.00 | basketball | haha |
| 3 | wangwu | 28 | 2016-11-20 00:00:00 | male | 1382333333 | 20000.00 | football | wowo |
| 4 | xiaoli | 28 | 2015-11-20 00:00:00 | female | 13823333333 | 20000.00 | football | wowo |
+----+----------+------+---------------------+--------+-------------+----------+------------+---------+
4 rows in set (0.00 sec)

4.2 删除数据

语法

DELETE FROM 表名 WHERE ....;

范例

mysql> select * from teacher;
+----+----------+------+---------------------+--------+-------------+----------+------------+---------+
| id | name | age | hire_date | sex | phone | salary | hobby | comment |
+----+----------+------+---------------------+--------+-------------+----------+------------+---------+
| 1 | zhangsan | NULL | NULL | male | NULL | NULL | running | NULL |
| 2 | lisi | 30 | 2017-10-20 00:00:00 | male | 13069948980 | 2000.00 | basketball | haha |
| 3 | wangwu | 28 | 2016-11-20 00:00:00 | male | 1382333333 | 20000.00 | football | wowo |
| 4 | xiaoli | 28 | 2015-11-20 00:00:00 | female | 13823333333 | 20000.00 | football | wowo |
+----+----------+------+---------------------+--------+-------------+----------+------------+---------+
4 rows in set (0.00 sec) mysql> delete from teacher where id=1;
Query OK, 1 row affected (0.48 sec) mysql> select * from teacher;
+----+--------+------+---------------------+--------+-------------+----------+------------+---------+
| id | name | age | hire_date | sex | phone | salary | hobby | comment |
+----+--------+------+---------------------+--------+-------------+----------+------------+---------+
| 2 | lisi | 30 | 2017-10-20 00:00:00 | male | 13069948980 | 2000.00 | basketball | haha |
| 3 | wangwu | 28 | 2016-11-20 00:00:00 | male | 1382333333 | 20000.00 | football | wowo |
| 4 | xiaoli | 28 | 2015-11-20 00:00:00 | female | 13823333333 | 20000.00 | football | wowo |
+----+--------+------+---------------------+--------+-------------+----------+------------+---------+
3 rows in set (0.00 sec)

4.3 更新数据

语法

UPDATE 表名 SET 字段1=值1, 字段2=值2 WHERE ...;

范例

mysql> select * from teacher;
+----+--------+------+---------------------+--------+-------------+----------+------------+---------+
| id | name | age | hire_date | sex | phone | salary | hobby | comment |
+----+--------+------+---------------------+--------+-------------+----------+------------+---------+
| 2 | lisi | 30 | 2017-10-20 00:00:00 | male | 13069948980 | 2000.00 | basketball | haha |
| 3 | wangwu | 28 | 2016-11-20 00:00:00 | male | 1382333333 | 20000.00 | football | wowo |
| 4 | xiaoli | 28 | 2015-11-20 00:00:00 | female | 13823333333 | 20000.00 | football | wowo |
+----+--------+------+---------------------+--------+-------------+----------+------------+---------+
3 rows in set (0.00 sec) mysql> update teacher set age=40 where id=2;
Query OK, 1 row affected (0.46 sec)
Rows matched: 1 Changed: 1 Warnings: 0 mysql> select * from teacher;
+----+--------+------+---------------------+--------+-------------+----------+------------+---------+
| id | name | age | hire_date | sex | phone | salary | hobby | comment |
+----+--------+------+---------------------+--------+-------------+----------+------------+---------+
| 2 | lisi | 40 | 2017-10-20 00:00:00 | male | 13069948980 | 2000.00 | basketball | haha |
| 3 | wangwu | 28 | 2016-11-20 00:00:00 | male | 1382333333 | 20000.00 | football | wowo |
| 4 | xiaoli | 28 | 2015-11-20 00:00:00 | female | 13823333333 | 20000.00 | football | wowo |
+----+--------+------+---------------------+--------+-------------+----------+------------+---------+
3 rows in set (0.00 sec)

4.4 查询数据

单表查询

多表查询

03-MySQL表操作的更多相关文章

  1. Python 3 mysql 表操作

    Python 3 mysql 表操作 表相当于文件,表中的一条记录就相当于文件的一行内容,不同的是,表中的一条记录有对应的标题,称为表的字段 id,name,qq,age称为字段,其余的,一行内容称为 ...

  2. 8.3 mysql 表操作

    库操作 一 系统数据库 information_schema: 虚拟库,不占用磁盘空间,存储的是数据库启动后的一些参数,如用户表信息.列信息.权限信息.字符信息等    performance_sch ...

  3. 数据库 -- mysql表操作

    一,存储引擎介绍 存储引擎即表类型,mysql根据不同的表类型会有不同的处理机制 详见:https://www.cnblogs.com/peng104/p/9751738.html 二,表介绍 表相当 ...

  4. MySQL表操作及数据操作

    表操作 表相当于一个文件,其形式与现实中的表格相同.表中的每条记录都有相应的字段,字段就类似于表格的表头. 表操作详细: #对表进行操作(文件) #首先要切换到指定库(即文件夹)下:use db1; ...

  5. 细说MySQL表操作

    目录 语法 查看表结构 查看所有的表 删除表 查看创建表的语句 修改表的字符集和校验规则 修改表名 在表中添加新字段 修改表的字段名 修改表中字段的属性 删除表中的某个字段 设置某个字段为主键 把某个 ...

  6. mysql表操作与权限操作

    修改表ALTER TABLE 语法: . 修改表名 ALTER TABLE 表名 RENAME 新表名; . 增加字段 ALTER TABLE 表名 ADD 字段名 数据类型 [完整性约束条件…], ...

  7. mysql数据库从删库到跑路之mysql表操作

    表介绍 表相当于文件,表中的一条记录就相当于文件的一行内容,不同的是,表中的一条记录有对应的标题,称为表的字段 id,name,qq,age称为字段,其余的,一行内容称为一条记录 内容: 1 创建表 ...

  8. MySQL 表操作 (Day40)

    阅读目录 一.表介绍 二.创建表 三.查看表 四.修改表 五.删除表 六.操作表中的记录 一.表介绍 表相当于文件,表中的一条记录就相当于文件的一行内容,不同的是,表中的一条记录有对应的标题,则称为表 ...

  9. Mysql表操作

    查看表结构: 可以使用describe或show create table语句查看表的结构: describe表名; Show create table 表名; 修改表名: Alter table 旧 ...

  10. mysql 表操作

    创建表 简单的方式 CREATE TABLE person ( number INT(11), name VARCHAR(255), birthday DATE ); 或者是 CREATE TABLE ...

随机推荐

  1. 【WebGIS系列】Typescript+WebGL+Webpack开发环境搭建

    目前Web实现矢量渲染的主流技术包括SVG.VML和WebGL.相对而言,VML是一种较古老的技术,虽然未成为W3C标准,但被早期的IE浏览器(IE9以下)和微软Office广泛使用,目前已经远离了浏 ...

  2. AR增强现实开发介绍(续)

    AR增强现实开发介绍(续) ---开发基础篇 开发增强现实技术,无论是商业级应用,还是面向幼儿教育的游戏产品,都需要从了解.获取.下载增强现实插件开始.目前全世界使用量最大公认最好的增强现实插件是高通 ...

  3. 研究windows下SVN备份及还原恢复方案

    windows下SVN备份方案 备份策略 svn备份一般采用三种方式: 1)svnadmin dump  2)svnadmin hotcopy  3)svnsync.  注意,svn备份不宜采用普通的 ...

  4. Vmware虚拟机中CentOS7与Docker安装图文教程

    1.安装VMware 下载一个软件安装: 2.新建一个虚拟机 等待自动安装完成 配置系统语言: 配置系统时间: 配置系统键盘: 语言支持: 默认自动使用安装源: 配置软件环境,需要及时添加的软件,这里 ...

  5. .Net Core的Log方式:Serilog+Kibana

    前言 Serilog,支持对象,把log数据序列化成Json,好用方便,容易拓展.Github: https://github.com/handsomeyao77/serilog-sinks-elas ...

  6. 通过 UI 管理 docker

    Docker 正在被用在越来越多的场景中,对于不太习惯命令行工具的朋友来说,docker cli 用起来可能会比较吃力.本文笔者将介绍一个功能强大的 docker web 客户端:portainer( ...

  7. 玩转Spring Cloud之配置中心(config server &config client)

     本文内容导航: 一.搭建配置服务中心(config server) 1.1.git方式 1.2.svn方式 1.3.本地文件方式 1.4.解决配置中包含中文内容返回乱码问题 二.搭建配置消费客户端( ...

  8. Centos7+LVS-DR+keepalived实验(包含sorry-server、日志、及HTTP-GET的健康检测)

    目录检索 一.简介 1.lvs-dr原理请参考原理篇 2.keepalived原理请参考原理篇 3.基于lvs-dr+keepalived故障切换架构图如下: 二.部署 1.环境 2.准备RS的web ...

  9. Unity MMORPG游戏开发教程(一)——初识Unity

    五邑隐侠,本名关健昌,10年游戏生涯,现隐居五邑.本系列文章以C#为介绍语言,基于Unity2017.4.x. 一.环境搭建 我使用的是Unity+VSCode,用的是mac系统,windows的自己 ...

  10. SAP 没有激活HUM功能照常可以使用Handling Unit

    SAP 没有激活HUM功能照常可以使用Handling Unit 笔者所在的项目上的公司间STO的流程里,发货公司在做PGI之后系统自动触发收货公司的inbound delivery单据,发货公司发出 ...