标签:技术 rem rac author default 代码 character art 结果
文章表
,作者表
CREATE TABLE `article` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`article_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ‘文章‘,
`author_id` int(255) DEFAULT NULL COMMENT ‘外键‘,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT=‘文章表‘;
CREATE TABLE `author` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`author_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ‘作者‘,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT=‘作者表‘;
查询文章的id与文章的名称和作者
CREATE TABLE `author` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`author_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT ‘作者‘,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT=‘作者表‘;
标签:技术 rem rac author default 代码 character art 结果
原文地址:https://www.cnblogs.com/yaoliuyang/p/12821597.html