计算机二级mysql操作题答案(15套全)

包含15套完整的MySQL数据库操作题目,适合备考计算机二级的考生进行实战练习。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

第1套

insert into tb_dept(deptno,dname,manager,telephone) values('D4','公关部','Liming','010-82953306');

alter table tb_employee alter column salary set default '3500';

select count(*) as '总人数' from tb_employee where deptno=(select deptno from tb_dept where dname='销售部');

create view v_emp as select eno,ename,age,salary from tb_employee where deptno=(select deptno from tb_dept where dname='采购部');

create user 'Yaoming'@'localhost' identified by'abc123';

第2套 

select sum(price) as total from tb_commodity where cname='电视机' and origin='北京';

alter table tb_commodity drop column desc1;

insert into tb_commodity(cname,ctype,origin,birth,price) values('钢笔','文具','上海','2012-12-25',25);

create view v_bjcommodity as select * from tb_commodity where origin='北京';

create user 'client'@'localhost';

grant select(cno,cname) on tb_commodity to 'client'@'localhost' with grant option;

 第3套

alter table tb_student add column ssex char(1) default 'M';

update tb_student set smajor='计算机' where sno='100';

create view v_avg(cname,caverage) as select cname,avg(grade) from tb_score group by cname;

alter table tb_student add unique index idx_stu(sno);

create user 'newuser'@'localhost';

grant select on tb_student to 'newuser'@'localhost' with grant option;
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值