未来教育MySQL题库,15套试卷,sql题答案。

一、

1.insert into tb_dept values('D4','公关部','Liming','010-82953306');2.alter table tb_employee alter column salary set default 3500;3.select count(*) as '总人数' from tb_employee where
depton=(select depton from tb_dept where dname='销售部');4.create view v_emp as select eno,ename,age,salary from tb_employee
where depton=(select depton from tb_dept where dname='采购部');
5.create user 'Yaoming'@'localhost' identified by 'abc123';

二、

1.select sum(price) as total from tb_commodity where origin='北京'
and cname='电视机';2.alter table tb_commodity drop column desc1;3.insert into tb_commodity(cname,ctype,origin,birth,price)values('钢笔','文具','上海','2012-12-25',25);4.create view v_bjcommodity as select * from tb_commodity
where origin='北京';
5.create use 'client'@'localhost';
grant select(cno,cname) on tb_commodity to 'client'@'localhost' with grant option;

三、

1.alter table tb_student add column ssex char(1) default 'M';2.update tb_student set smajor='计算机' where sno=100;3.create view v_avg(cname,caverage) as select cname,avg(price)
from tb_score group by cname;4.alter table tb_student add unique index idx_stu(sno);
5.create user 'newuser'@'localhost';
grant select on tb_student to 'newuser'@'localhost' with grant option;

四、

constraint charger_id foreign KEY (charger_id)references ClassCharger(id)
-- constraint 外键名称 foreign key (主键列)references 主表名称(主表列名称)
--切记:作为外键一定要和关联主键的数据类型保持一致1.create tbale Dept1(
depton int primary key,
dname varchar(20),
higherdepton int default null,
constraint fk_higher foreign key(depton) references Dept2(depton)
);2.insert into Dept2(depton,dname,higherdep`ton)
values(9,'newdept','higherdepton');3.create view SJAVA as select S.sno,S.sname,SC.grade from
S,SC,C where S.sno=SC.sno and C.cname='JAVA';4.update SC set SC.grade=90 where
SC.sno=(select S.sno from S where S.sname='李红')
and
SC.cno=(select C.cno from C where C.cname='DB');
5.create user 'backupdb'@'localhost' identified by 'backup';

五、

1.alter table tb_dept add unique index idx_dept(deptname desc);2.insert into tb_dept(depton,deptname)values('D4','营销部');3.select name as '姓名',2014-birth as 年龄 from tb_emp;4.create view v_dept(部门负责人姓名,姓名,学历,工资) as
select manager,name,education,salary from
tb_dept,tb_emp where tb_dept.depton=tb_emp.depton
and deptname='市场部';
5.create user 'stud'@'localhost';
grant select on tb_emp to 'stud'@'localhost' with grant option;

六、

1.update tb_book set price=42 where bname='MySQL程序设计';2.create view v_book as select *from tb_book
where publisher='高等教育出版社';3.select bname,publisher,price from tb_book where btype='计算机';4.alter table tb_book drop column desc1;
5.create user 'client'@'locathost';
grant select(bno,bname) on tb_book to 'client'@'locathost' with grant option;

七、

1.alter table tb_student add column ssex char(2) null default '女';
2.delete from tb_gs where tb_gs.sno=
(select sno from tb_student where smajor='计算机');
3.create view v_number(smajor,snumber) as select
smajor,count(distinct tb_gs.sno) from tb_gs,tb_student
where tb_student.sno=tb_gs.sno group by smajor;
4.alter table tb_gs add constraint fk_dept foreign key(sno) references
tb_student(sno);
alter table tb_gs add constraint fk_dept foreign key(sno) references
tb_student(sno);
5.create user 'tmpuser'@'localhost' identified by 'a12345';
grant select,insert on tb_group to 'tmpuser'@'localhost' with grant option;

八、

1.alter table tb_book drop column shopDate;
2.update tb_reader set sex='女' where readerName='王依然';
3.select readerName,bookNo from tb_reader,tb_borrow
where tb_reader.readerNo=tb_borrow.readerNo
and borrowDate>'2014-01-01';
4.create view v_borrow(读者编号,借书总册数) as
select readerNo,count(readerNo) from tb_borrow group by readerNo;
5.load data infile 'backup.txt' into table tb_reader1;

九、

1.create table dept(
depton int primary key auto_increment,
dname varchar(20) not null,
addr varchar(50));
2.select cname as '课程名',max(grade) as '最高分' from score
group by cname;
3.insert into student values('907','张敏','女');
4.update score set grade=90 where stuid='907' and cname='英语';
5.create user 'abc'@'localhost' identified by '123';
grant select on db_exam.score to 'abc'@'loaclhost' with grant option;

十、

1.create table Emp(empid int primary key auto_increment,
empname char(20) character set GB12312 not null,
streetname varchar(50),
cityname varchar(30) not null default 'N/A');
2.select cname as '课程名',max(grade) as '最高分数' from
Score group by cname having Avg(grade)>85;
3.select name,stuid,sum(grade) as total from Student,Score
where Student.stuid=Score.stuid group by stuid order by total asc;4. create view StuView as select name,cname,grade from Student,Scorewhere Student.stuid=Score.stuid;5.grant select,update on newtest.* to 'abc'@'192.168.1.100';

十一、

1.update student set age='20' where stu_id=2;
2.select name from student where sex='M' order by age Asc;
3.select name from student,ordering where student.id=ordering.id
and score<60;
4.create user 'stu_user'@'localhost';
grant select,insert on student to 'stu_user'@'localhost';
5.insert into ordering(id,cid)values(1,5);

十二、

1.create table publisher(pub_id int primary key auto_increment,
pub_name char(30) not null,
pub_address char(30) not null);
2.alter table book add column pub_post int;
alter table book add constraint FK_book_pub_post foreign key(pub_post)
references publisher(pub_id);
3.insert into student(stu_id,stu_name,stu_sex,stu_age)values
(8,'试试','男',10);
insert into book(book_id,book_name,price,author)values
(6,'发',65,'a啊大大');
insert into reading values(8,6,'wen');
4.delete from reading where s_id=3;
5.select b_name from book where b_id=3;

十三、

1.alter table 学生 add column QQ varchar(20);
2.alter table 选课 add constraint FK_XH foreign key(学号)
references 学生(学号);
3.select 学院名称,count(学号) as 总人数 from 学生 group by 学院名称;
4.select 学号,姓名,学院名称 from 学生,选课 where 课程名称='操作系统';
5.create view V_信息学院学生(姓名,学号,出生日期) as
select 姓名,学号,出生日期 from 学生 where 学院名称='信息学院';

十四、

1.create index index_选课学号 on 选课(学号);
2.select 课程学分 from 课程 where 课程名称='操作系统';
3.select 学号 from 选课 where 课程名称='操作系统' and
学号=(select 学号 from 选课 where 课程名称='C语言程序设计');
4.create view V_成绩(课程名称,平均成绩) as
select 课程名称,round(AVG(成绩),2) from 选课 group by 课程
order by AVG(成绩) DESC;
5.create user 'test'@'localhost';
grant all on xsxk.* to 'test'@'localhost';

十五、

1.create table S(
SNO int primary ker auto_increment,
SName char(10),
Sex char(1),
Age int,);
2.create index in_stu on student(depton);
3.select depton as 系别,avg(score) as 平均成绩 from
student group by depton;
4.select sid,sname,score from stdent where
stdent.depton=(select depton from dept where deptname='数学系');
5.create user 'wang'@'192.168.2.12' identified by 'test1234';

二级MySQL,未来教育MySQL题库,15套试卷,sql题答案。相关推荐

  1. c语言二级考试程序设计题难吗,计算机二级考试:题库抽的不是题是“命”!附赠考试通关全攻略!...

    原标题:计算机二级考试:题库抽的不是题是"命"!附赠考试通关全攻略! 四六级的报名刚截止不久, 考研复试如火如荼地进行, 计算机二级考试如约而至. 今天是考试第一天 老新猜你一定有 ...

  2. 计算机二级考试非选择题攻略,计算机二级考试:题库抽的不是题是“命”!附赠考试通关全攻略!...

    原标题:计算机二级考试:题库抽的不是题是"命"!附赠考试通关全攻略! 四六级的报名刚截止不久, 考研复试如火如荼地进行, 计算机二级考试如约而至. 今天是考试第一天 老新猜你一定有 ...

  3. 2023年医院三基题库精选套卷及答案

    1. 真正有效的通气量是() A .肺泡通气量 B .肺活量 C .用力肺活量 D .肺总容量 E .每分通气量 2. X射线的波长为1.00×10^-7cm时,其频率为: (  ) A .3.00× ...

  4. 网课查题php接口,题库API_大学题库API网课查题题库接口API-在线授权

    题库API_大学题库API网课查题题库接口API-在线授权 更多相关问题 阅读理解. Sunny English Club For students16:00 ~ 18:00Every Saturda ...

  5. 考研政治题库,考研政治1000题之每日一题

    骐骥一跃,不能十步:驽马十驾,功在不舍.--出自<荀子·劝学> 考研政治刷题神器,微信搜一搜小程序:考研刷题小博士.考研政治题库,考研政治1000题之每日一题. · 今日习题 ·

  6. H3CSE-WLAN GB0-342题库最新十月高分通过题库VCE GB0342 华三无线中级

    WLAN GB0342题库最新十月高分通过题库VCE加微:lyh511419 全网最低 可谈

  7. 计算机二级考试题未来教育里占多少,计算机二级笔试试题未来教育版.doc

    计算机二级笔试试题未来教育版 安徽省会计从业资格考试试题天顿电算化软件上机题库资料 软件下载地址:/ A. 使用的会计软件达到财政部门<会计核算软件基本功能规范>的要求,并取得合法使用权 ...

  8. 2021远程统考计算机和英语,2021年远程网络教育大学英语B统考题库网考试卷

    全国远程教育.网络教育大学英语B.计算机应用基础统考 2021年远程网络教育大学英语B整套原题库1800题,覆盖95%以上,精心整理归类,全中文翻译,单独列出的重点必抽70分,视频教程讲解,复习完整套 ...

  9. 2022年全国计算机二级考试MS Office题库软件(考试原题)

     全国计算机二级考试模拟软件MS Office软件功能 1.功能全面:知识兔软件具有同步训练.章节测验.模拟考试功能,每一道试题都有详细分析,操作题都有详尽的操作步骤. 2.即时交互:你的训练.测试. ...

最新文章

  1. 虚拟中央处理器新星软机公司即将被收购
  2. python练手经典100例微盘_Python练手项目实例汇总(附源码下载)
  3. 安卓学习笔记10:常用布局 - 相对布局
  4. Java 读取某个目录下所有文件、文件夹
  5. 海龟交易法则14_掌控心魔
  6. 快速解决MariaDB无密码就可以登录的问题
  7. Android OpenGL ES(六)创建实例应用OpenGLDemos程序框架 .
  8. 1.12 Linux查看用户信息
  9. 服务器开启谷歌BBR加速网络
  10. 谷歌浏览器如何下载在线音频视频
  11. 解决win8.1中文版无法添加域的问题
  12. 凡诺CMS一处文件包含漏洞
  13. ArcGIS模型构建器案例学习-批量删除空要素类地理模型
  14. 基本面因子投资的三点思考
  15. Linux: vi 编辑器
  16. Sherman-Morrison-Woodbury,SMW恒等式
  17. 执一不二 跬步千里-王子密码10月份月会心得(四)
  18. CentOS 7.7 配置防火墙
  19. Ubuntu18.04下的PCL安装(摸爬滚打)
  20. 怎样获取上传至腾讯开放平台app的下载链接

热门文章

  1. (转)利用python、tensorflow、opencv实现人脸识别(包会)!
  2. Matlab调用ANSYS的三种方法
  3. hspice2007安装教程(win10)
  4. 在SCDM中使用了共享在fluent mesh中仍然会报错错误的共享
  5. 电商软件性能测试,实战 | 电商业务的性能测试(一): 必备基础知识
  6. 基于STM32的机器人控制仿真
  7. 数字化门店拓客营销引流系统
  8. NLP点滴——文本相似度
  9. nc报销系统用的什么java_财务NC系统是什么?
  10. MySQL数据库习题