Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Activity Description Given following two tables (EMPLOYEE, DEPARTMENT). Note, Dno in table EMPLOYEE and Dnumber in table DEPARTMENT all refer to the same thing (department
Activity Description
Given following two tables (EMPLOYEE, DEPARTMENT). Note, Dno in table
EMPLOYEE and Dnumber in table DEPARTMENT all refer to the same thing (department number).
CREATE TABLE EMPLOYEE
( Fname VARCHAR(15)
Minit CHAR,
Lname VARCHAR(15),
Ssn CHAR(9),
Bdate DATE,
Address VARCHAR(30),
Sex CHAR,
Salary DECIMAL(10,2),
Super_ssn CHAR(9),
Dno INT,
PRIMARY KEY (Ssn));
CREATE TABLE DEPARTMENT
( Dname VARCHAR(15),
Dnumber INT,
Mgr_ssn CHAR(9),
Mgr_start_date DATE,
PRIMARY KEY (Dnumber));
- Write a single SQL statement to find the sum of the salaries of all employees of the Engineering department, as well as the maximum salary, the minimum salary, and the average salary in this department.
- Based on Employee table, write a single SQL statement for each department, retrieve the department number, the number of employees in the department, and their average salary.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started