1 用Navicat创建表,初步接触数据库的增删查改;
实例
/* Navicat MySQL Data Transfer Source Server : wuyazai Source Server Version : 50553 Source Host : 127.0.0.1:3306 Source Database : 123 Target Server Type : MYSQL Target Server Version : 50553 File Encoding : 65001 Date: 2019-03-22 18:24:15 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '序号', `user_id` int(11) unsigned NOT NULL, `name` varchar(50) NOT NULL, `age` tinyint(3) NOT NULL, `sex` varchar(1) NOT NULL, `py` varchar(50) NOT NULL, `log_time` datetime NOT NULL, `on_time` datetime NOT NULL, `honor` varchar(50) DEFAULT NULL, `password` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of user -- ---------------------------- INSERT INTO `user` VALUES ('1', '1', '风行', '12', '男', 'fengxing', '2019-03-21 18:21:29', '2019-03-20 18:21:35', '1', '123456'); INSERT INTO `user` VALUES ('2', '2', '火星', '12', '女', 'huoxing', '2019-03-06 18:22:51', '2019-03-20 18:23:02', '0', '123456'); INSERT INTO `user` VALUES ('3', '3', '水星', '14', '男', 'shuixing', '2019-03-21 18:22:55', '2019-03-20 18:23:05', '0', '123456'); INSERT INTO `user` VALUES ('4', '5', '木星', '16', '女', 'muxing', '2019-03-22 18:23:00', '2019-03-20 18:23:09', '2', '123456');
运行实例 »
点击 "运行实例" 按钮查看在线实例
2笔记
心得体会:
a sql两边是字符不是字节汉子、数字、字母一视同仁;
b sql里边不是单引号(1旁边的斜点儿),初学者容易搞错;