Computer Science, asked by prasanthsuresh05, 8 hours ago

Create the following tables with given attributes having appropriate data type and specify the necessary

primary and foreign key constraints:

Employee (EmpId, Empname, Sal, Deptno)

Dept (Deptno, Dname, Loc,DeptmanagerId)

a) List the count of Employees and average salary of each department.

b) List the employee name, department name and the salary of all the employees.​

Answers

Answered by pranavsolanke0205200
11

Dept (Deptno, Dname, Loc,DeptmanagerId)

a) List the count of Employees and average salary of each department.

Answered by Jasleen0599
1

a) List the count of Employees and average salary of each department.

SELECT count(*)

avg(sal),

EmpId,EmpName

FROM Employee

Group BY DeptmanagerId,

Dname;

b)List the employee name, department name and the salary of all the employees.​

SELECT s.salary, e.empname from employee JOIN salary on employee.empid=department.DeptmanagerId;

#SPJ2

Similar questions