本文介绍了解决我的问题我是Sql的初学者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三张桌子

员工(TB1)员工姓名(TB2)经理(TB3)部门(TB4)

ID Ecode Dept ID Ename Mcode ID deptName

1 10 1 1 raja NULL 1管理员

2 20 2 2 siva 10 2 prodn

3 30 3 3 kamal 60 3账户

4 40 5 4 ramu 100





1)作为管理人员的员工名单

2)非管理人员员工名单

3)员工总数在每个部门都有部门名称

4)各部门经理总数,部门名称

5)名字未定义的员工

6)部门ID无效的员工

I have three tables
Employee(TB1)Employee Name(TB2) Manager(TB3) Department(TB4)
ID Ecode Dept IDEname Mcode IDdeptName
110 11raja NULL 1Admin
220 22siva 10 2prodn
330 33kamal 60 3Accounts
440 54ramu 100


1)List of employees who are managers
2)List of employees who are not managers
3)Total number of employees in each department with department name
4)Total number of manager in each department with department name
5)Employee whose name is not defined
6)Employee whose department id is not valid

推荐答案


这篇关于解决我的问题我是Sql的初学者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 20:20