问答题 数据库db_emp中有职工表tb_employee和部门表tb_dept,tb_employee包含的字段有eno(职工号)、ename(姓名)、age(年龄)、title(职务)、salary(工资)和deptno(部门号),tb_dept包含的字段有deptno(部门号)、dname(部门名称)、manager(部门负责人)、telephone(电话)。
问答题 用SQL语句完成以下操作:给企业新增加一个"公关部",部门号为"D4",电话为"010-82953306",并任命"Liming"担任部门负责人。
【正确答案】
【答案解析】INSERT INTO tb_dept VALUES ("D4", "公关部", "Liming", "010-82953306");
问答题 用SQL语句将tb_employee表中salary字段的默认值修改为3500。
【正确答案】
【答案解析】Alter table tb_employee alter column salary drop default;
Alter table tb_employee alter column salary set default 3500;
问答题 用SQL语句查询"销售部"的员工总人数,要求查询结果显示为"总人数"。
【正确答案】
【答案解析】select count(*) 总人数 from tb_employee where deptno=(select deptno from tb_dept where dname="销售部");