mysql 使用示例

JustinYoung 阅读:67 2022-09-20 16:58:18 评论:0

create database springboot;

use springboot;

create table department(

        id int(10) not null auto_increment primary key,     主键设置

        departmentName varchar(200) not null

)ENGINE=INNODB DEFAULT CHARSET=utf8;

create table employee(

        id int(10) not null auto_increment primary key,

        lassName varchar(200) not null,

        email varchar(200),

        gender int(1),

        departmentId int(10),

        foreign key(departmentId) references department(id),       //外键设置

        brith datetime                     datetime 格式为  yyyy-MM-dd HH:mm:ss

)engine=innodb default charset=utf8;


本文参考链接:https://blog.csdn.net/qq_40197728/article/details/119758715
标签:mysql
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

搜索
关注我们

一个IT知识分享的公众号