forked from jackfrued/Python-100-Days
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmooc_create_and_init.sql
39 lines (33 loc) · 1.6 KB
/
mooc_create_and_init.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
drop database if exists mooc1706;
create database mooc1706 default charset utf8;
use mooc1706;
create table tb_course_catalog
(
catid integer not null auto_increment,
catname varchar(20) not null,
catparent integer,
primary key (catid)
);
alter table tb_course_catalog add constraint fk_catalog_parent
foreign key (catparent) references tb_course_catalog(catid)
on delete cascade
on update cascade;
insert into tb_course_catalog values (default, '前端开发', null);
insert into tb_course_catalog values (default, '后端开发', null);
insert into tb_course_catalog values (default, '移动开发', null);
insert into tb_course_catalog values (default, '数据库', null);
insert into tb_course_catalog values (default, '云计算&大数据', null);
insert into tb_course_catalog values (default, '运维&测试', null);
insert into tb_course_catalog values (default, 'UI设计', null);
insert into tb_course_catalog values (default, 'HTML/CSS', 1);
insert into tb_course_catalog values (default, 'JavaScript', 1);
insert into tb_course_catalog values (default, 'jQuery', 1);
insert into tb_course_catalog values (default, 'HTML5', 1);
insert into tb_course_catalog values (default, 'CSS3', 1);
insert into tb_course_catalog values (default, 'Node.js', 1);
insert into tb_course_catalog values (default, 'AngularJS', 1);
insert into tb_course_catalog values (default, 'Bootstrap', 1);
insert into tb_course_catalog values (default, 'React', 1);
insert into tb_course_catalog values (default, 'Sass/Less', 1);
insert into tb_course_catalog values (default, 'Vue.js', 1);
insert into tb_course_catalog values (default, 'WebApp', 1);