Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are given two tables, department and employee, with the following structure

ID: 3860530 • Letter: Y

Question

You are given two tables, department and employee, with the following structure create table department ( dept id integer not null, dept name varchar (30) not null, dept location varchar (30) not null, unique (dept_id) create table employee ( emp id integer not null, emp-name varchar (50) not null, dept_id integer not null, salary integer not null, unique (emp_id) Each record in the table department represents a department which might hire some employees. Each record in the table employee represents an employee who works for one of the departments from the table department. The salary of each employee is known. (However, the locations of the departments are not relevant here.) Write an SQL query that returns a table comprising all the departments (dept id) in the table department that hire at lea 0/10+ Custom test cases

Explanation / Answer

Select dept_id , count(emp_id) count , sum(salary) sum_of_salary from employee group by dept_id

/*Let me know if you don't understand this, or don't find the expected results*/

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote