MySQL实例教程:t_student和t_classes完整示例 - 极悦

MySQL教程

MySQL实例教程:t_student和t_classes完整示例

drop table if exists t_classes;
create table t_classes(
	classes_id	int (3),
	classes_name	varchar(30)	not null,
	constraint	pk_classes_id	primary key(classes_id) 
)

drop table if exists t_student;
create table t_student(
	student_id	int(10),
	student_name 	varchar(50) not null,
	sex		char(2) not null,
	birthday	date not null,
	email		varchar(30) unique,
	classes_id	int (3) not null,
	constraint	pk_student_id	primary key(student_id),
	constraint	fk_classes_id	foreign key(classes_id) references t_classes(classes_id) 
)

 

技术文档推荐

更多>>

视频教程推荐

更多>>