MySQL:数据操作

数据操作

一、输入数据

格式:

mysql>INSERT INTO 数据表名 VALUES(输入数据);

mysql> INSERT INTO shujuleixing_xiaoshu VALUES(5.12,5.15,5.123);

二、显示数据

格式:

mysql> SELECT*FROM 数据表名;

实例:

mysql> SELECT*FROM shujuleixing_xiaoshu;

三、报错

格式:

mysql> SHOW WARNINGS;

例:

mysql> INSERT INTO shujuleixing_xiaoshu VALUES(5.12,5.15,5.123);
Query OK, 1 row affected, 3 warnings (1.73 sec)当出现这个才能报错
mysql> SHOW WARNINGS;
+---------+------+--------------------------------------------+
| Level   | Code | Message                                    |
+---------+------+--------------------------------------------+
| Warning | 1264 | Out of range value for column 'x' at row 1 |
| Warning | 1264 | Out of range value for column 'y' at row 1 |
| Warning | 1264 | Out of range value for column 'z' at row 1 |
+---------+------+--------------------------------------------+

四、运算加、减、乘、除

语法:select 字段名 运算符 from 表名

posted on 2018-12-15 21:01  迷途行者  阅读(151)  评论(0编辑  收藏  举报

导航