ow affected (0.03 sec)
2.4.2 查看表中的数据(可以确定数据是否已经成功插入) mysql> select * from emp;
成功插入后的数据显示如下:
+--------+----------+---------+---------+------------+---------+ | emp_id | emp_name | emp_age | emp_sal | emp_bir | emp_sex | +--------+----------+---------+---------+------------+---------+ | 100005 | 啸天 | 27 | 3000 | 1979-07-10 | male | +--------+----------+---------+---------+------------+---------+ 1 row in set (0.00 sec)
一次性插入多行的格式:INSERT INTO table_name(数据表名) VALUES(值1,值2,值3...),(值1,值2,值3...);
mysql> insert into emp values -> (''100001'',''红枫'',29,8000,''1977-01-01'',''male''), -> (''100002'',''丽鹃'',27,7000,''1979-12-31'',''fmale'');
可以查看插入后的数据结果:
+--------+----------+---------+---------+------------+---------+ | emp_id | emp_name | emp_age | emp_sal | emp_bir | emp_sex | +--------+----------+---------+---------+------------+---------+ | 100005 | 啸天 | 27 | 3000 | 1979-07-10 | male | | 100004 | 红枫 | 29 | 8000 | 1977-01-01 | male | | 100002 | 丽鹃 | 27 | 7000 | 1979-12-31 | fmale | +--------+----------+---------+---------+------------+---------+ 3 rows in set (0.00 sec)
----------------------我------------割--------------------------
2.5 修改数据
2.5.1 使用UPDATE语句来更新表中的数据 mysql> update |