目录
备份与还原:
题目要求:
索引和视图
题目要求:
备份与还原:
在数据库booksDB中创建表books、authorbook、authorbook:
题目要求:
1、mysqldump -uroot -pRyh201314% booksDB > /backup/db/booksDB_allTB.sql
2、mysqldump -uroot -pRyh201314% booksDB books > /backup/db/booksDB_books.sql3、mysqldump -uroot -pRyh201314% booksDB,test > /backup/db/two_db.sql
4、mysqldump -uroot -pRyh201314% --all-databases > /backup/db/all_db.sql
5、mysql -u root -pRyh201314% booksDB < /backup/db/booksDB_books.sql
6、mysql> use booksDB;
mysql> source /backup/db/booksDB_books.sql;
索引和视图
题目要求:
1、create table Student(
Sno char(1) primary key comment '学号' ,
Sname varchar(10) not null unique comment '姓名',
Ssex char(2) comment '性别' check (Ssex='男' or Ssex='女') ,
Sage int(3) comment '年龄',
Sdept varchar(20) default '计算机' comment '所在系');2、alter table Student modify Sage smallint(3);
3、create index SC_INDEX on SC (sno,cno);
4、create view stu_info as select s.Sname,s.Ssex,c.Cname,sc.Score from Course c join SC sc join Student s on c.Cno=sc.Cno and s.Sno=sc.Sno;