MySQL-库和表的管理-案例讲解

案例1

image

#创建表
use books

create table dept1(
   id int(7),
   name varchar(25)
);

select * from `dept1`

image

2.将表departments中的数据插入新表dept2中

#2.将表departments中的数据插入新表dept2中
use `books`;

create table dept2
select `department_id`,`department_name`
from `myemployees`.`departments`;

image

案例3

image

案例4-6

image

案例7-9

image

posted @ 2022-05-26 09:00  司砚章  阅读(36)  评论(0)    收藏  举报