1、创建数据库
create database myCinema default character set u8;
2、定义一级栏目表
use myCinema;
create table rstChannel
(
id int primary key auto_increment,
fName varchar(20) not null
);
insert into rstChannel values(null,'电影');
insert into rstChannel values(null,'电视剧');
insert into rstChannel values(null,'动漫');
insert into rstChannel values(null,'综艺');
insert into rstChannel values(null,'VIP 电影');
insert into rstChannel values(null,'娱乐');
insert into rstChannel values(null,'游戏秀场');
insert into rstChannel values(null,'奔跑吧兄弟 4');
insert into rstChannel values(null,'后台维护入口>>');
select * from rstChannel;
3、定义二级栏目表
create table secondChannel
(
id int primary key auto_increment,
sName varchar(20) not null,
d int,
foreign key(d) references rstChannel(id)
);
insert into secondChannel values(null,'电影大全',1);
insert into secondChannel values(null,'最新电影',1);
insert into secondChannel values(null,'经典电影',1);
insert into secondChannel values(null,'搞笑电影',1);
insert into secondChannel values(null,'电影排行榜',1);
insert into secondChannel values(null,'热门明星',1);
insert into secondChannel values(null,'电视剧大全',2);
insert into secondChannel values(null,'最新电视剧',2);
insert into secondChannel values(null,'内地',2);
insert into secondChannel values(null,'港台',2);
insert into secondChannel values(null,'韩剧',2);