For given relation:Employee(eid, ename, address,deptname ,salary)Project(eid, pid, pname, location)(1) Display name and salary of employee who is taking maximum salary.(2) Display highest salary department wise and name of employee who is taking thatsalary.(3) Find details of employee who works on a pid equal to 10
Question
For given relation:Employee(eid, ename, address,deptname ,salary)Project(eid, pid, pname, location)(1) Display name and salary of employee who is taking maximum salary.(2) Display highest salary department wise and name of employee who is taking thatsalary.(3) Find details of employee who works on a pid equal to 10
Solution
These questions seem to be related to SQL queries. Here are the queries for each question:
(1) To display the name and salary of the employee who is taking the maximum salary, you can use the following SQL query:
SELECT ename, salary
FROM Employee
WHERE salary = (SELECT MAX(salary) FROM Employee);
(2) To display the highest salary department wise and the name of the employee who is taking that salary, you can use the following SQL query:
SELECT deptname, ename, MAX(salary)
FROM Employee
GROUP BY deptname;
Please note that this query will return the highest salary for each department and the name of one employee who earns that salary. If there are multiple employees in the same department earning the highest salary, only one will be returned.
(3) To find details of the employee who works on a pid equal to 10, you can use the following SQL query:
SELECT Employee.*
FROM Employee
JOIN Project ON Employee.eid = Project.eid
WHERE Project.pid = 10;
This query will return all columns from the Employee table for the employee(s) who work on the project with pid equal to 10.
Similar Questions
we have following relations:employees(employee_id,first_name,last_name,email,salary,department_id)departments(department_id,department_name,location_id)(1) Find the employees who have the highest salary.(2) Display all the employee name along with department name who are working neitherin ‘HR’ Department nor earns more than 50000.2
we have following relationsEMP(empno, ename, jobtitle, manager, hiredate, salary, deptno)DEPT(deptno, dname,location)Answer the following queries .1) Find the Employees who get salary more than Chris salary.2) Display department number along with the number of employees which belongs to thatdepartment number
We have following relationEMP(empo,ename,jobtitle,manager_no,hiredate,salary,deptno)DEPT (deptno, dname,location)1) Find employees whose name start with letter A or letter a.2) Find the employees who are working in smith's department.3) Display employees who are getting maximum salary in each department
we have following relations:employees(emp_id, name, dept_id, city, DOJ)salaries (emp_id, salary)1) Find out the names of employees who belong to the same department as John.2) Find out names of employees whose salaries are greater than average salary.3) Retrieve the names of employees who have corresponding entries of the salary.
Consider the following EmployeeDetails table.You want to display the details of employees whose salary is more than the lowest salary of department having ID 10.To perform this task, which of the following query you can use the
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.