Find the name of employees who have salary less than the average salary of employees who are in department 4.
Find the name of employees who have salary less than the average salary of employees who are in department 4.
Chapter1: Overview Of Database Concepts
Section: Chapter Questions
Problem 5HOA: Access path A database table is composed of records and fields hold data. Data is stored in records....
Related questions
Question
Write the following queries in SQL on the relational
Find the name of employees who have salary less than the average salary of employees who are in department 4.
![EMPLOYEE
Fname
Minit
Lname
Ssn
Bdate
Address
Sex
Salary
Super_ssn
Dno
AAAA
DEPARTMENT
Dname
Dnumber
Mgr_ssn Mgr_start_date
AAA
DEPT LOCATIONS
Dnumber
Dlocation
PROJECT
Pname
Pnumber
Plocation
Dnum
WORKS_ON
Essn
Pno
Hours
DEPENDENT
Referential integrity constraints displayed
on the COMPANY relational database
Essn
Dependent_name
Sex
Bdate
Relationship
schema.
One possible database state for the COMPANY relational database schema.
EMPLOYEE
Fname
Minit
Lname
Ssn
Bdate
Address
Sex
Salary
Super_ssn
Dno
John
B
Smith
123456789
1965-01-09 731 Fondren, Houston, TX M
30000 333445555
888665555
1955-12-08638 Voss, Houston, TX
1968-01-19 3321 Castle, Spring, TX
1941-06-20291 Berry, Bellaire, TX
Franklin
T
Wong
333445555
M
40000
Alicia
J
Zelaya
999887777
F
25000
987654321
4
Jennifer
Wallace
987654321
F
43000 888665555
4
Ramesh
K
Narayan 666884444 1962-09-15 975 Fire Oak, Humble, TX M
38000 333445555
Joyce
A
English
453453453
1972-07-31
5631 Rice, Houston, TX
F
25000 333445555
5
Ahmad
V
Jabbar
987987987
1969-03-29 980 Dallas, Houston, TX
M
25000 987654321
4
James
Borg
888665555 1937-11-10 | 450 Stone, Houston, TX
M
55000 NULL
1
DEPARTMENT
DEPT_LOCATIONS
Dname
Dnumber
Mgr_ssn
Mgr_start_date
Dnumber
Dlocation
Research
333445555
1988-05-22
1
Houston
Administration
4
987654321
1995-01-01
4
Stafford
Headquarters
888665555
1981-06-19
Bellaire
Sugarland
Houston
WORKS_ON
PROJECT
Essn
Pno
Hours
Pname
Pnumber
Plocation
Dnum
123456789
1
32.5
ProductX
1
Bellaire
123456789
2
7.5
ProductY
Sugarland
5
666884444
3
40.0
ProductZ
3
Houston
5
453453453
1
20.0
Computerization
10
Stafford
4
453453453
2
20.0
Reorganization
20
Houston
1
333445555
10.0
Newbenefits
30
Stafford
4
333445555
3
10.0
333445555
10
10.0
DEPENDENT
333445555
20
10.0
Essn
Dependent_name
Sex
Bdate
Relationship
999887777
30
30.0
333445555
Alice
F
1986-04-05
Daughter
999887777
10
10.0
333445555
Theodore
M
1983-10-25
Son
987987987
10
35.0
1958-05-03
Spouse
333445555
Joy
F
987987987
30
5.0
987654321
Abner
1942-02-28
Spouse
987654321
30
20.0
123456789
Michael
M
1988-01-04
Son
987654321
20
15.0
123456789
Alice
F
1988-12-30
Daughter
888665555
20
NULL
123456789
Elizabeth
F
1967-05-05
Spouse](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F8521e12d-1c50-463a-a3e5-06dbbbf0bb2d%2F7ce418ef-d7a7-48b4-9c8a-665a8eb4359a%2Frmdd1kr_processed.png&w=3840&q=75)
Transcribed Image Text:EMPLOYEE
Fname
Minit
Lname
Ssn
Bdate
Address
Sex
Salary
Super_ssn
Dno
AAAA
DEPARTMENT
Dname
Dnumber
Mgr_ssn Mgr_start_date
AAA
DEPT LOCATIONS
Dnumber
Dlocation
PROJECT
Pname
Pnumber
Plocation
Dnum
WORKS_ON
Essn
Pno
Hours
DEPENDENT
Referential integrity constraints displayed
on the COMPANY relational database
Essn
Dependent_name
Sex
Bdate
Relationship
schema.
One possible database state for the COMPANY relational database schema.
EMPLOYEE
Fname
Minit
Lname
Ssn
Bdate
Address
Sex
Salary
Super_ssn
Dno
John
B
Smith
123456789
1965-01-09 731 Fondren, Houston, TX M
30000 333445555
888665555
1955-12-08638 Voss, Houston, TX
1968-01-19 3321 Castle, Spring, TX
1941-06-20291 Berry, Bellaire, TX
Franklin
T
Wong
333445555
M
40000
Alicia
J
Zelaya
999887777
F
25000
987654321
4
Jennifer
Wallace
987654321
F
43000 888665555
4
Ramesh
K
Narayan 666884444 1962-09-15 975 Fire Oak, Humble, TX M
38000 333445555
Joyce
A
English
453453453
1972-07-31
5631 Rice, Houston, TX
F
25000 333445555
5
Ahmad
V
Jabbar
987987987
1969-03-29 980 Dallas, Houston, TX
M
25000 987654321
4
James
Borg
888665555 1937-11-10 | 450 Stone, Houston, TX
M
55000 NULL
1
DEPARTMENT
DEPT_LOCATIONS
Dname
Dnumber
Mgr_ssn
Mgr_start_date
Dnumber
Dlocation
Research
333445555
1988-05-22
1
Houston
Administration
4
987654321
1995-01-01
4
Stafford
Headquarters
888665555
1981-06-19
Bellaire
Sugarland
Houston
WORKS_ON
PROJECT
Essn
Pno
Hours
Pname
Pnumber
Plocation
Dnum
123456789
1
32.5
ProductX
1
Bellaire
123456789
2
7.5
ProductY
Sugarland
5
666884444
3
40.0
ProductZ
3
Houston
5
453453453
1
20.0
Computerization
10
Stafford
4
453453453
2
20.0
Reorganization
20
Houston
1
333445555
10.0
Newbenefits
30
Stafford
4
333445555
3
10.0
333445555
10
10.0
DEPENDENT
333445555
20
10.0
Essn
Dependent_name
Sex
Bdate
Relationship
999887777
30
30.0
333445555
Alice
F
1986-04-05
Daughter
999887777
10
10.0
333445555
Theodore
M
1983-10-25
Son
987987987
10
35.0
1958-05-03
Spouse
333445555
Joy
F
987987987
30
5.0
987654321
Abner
1942-02-28
Spouse
987654321
30
20.0
123456789
Michael
M
1988-01-04
Son
987654321
20
15.0
123456789
Alice
F
1988-12-30
Daughter
888665555
20
NULL
123456789
Elizabeth
F
1967-05-05
Spouse
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Oracle 12c: SQL](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Principles of Information Systems (MindTap Course…](https://www.bartleby.com/isbn_cover_images/9781305971776/9781305971776_smallCoverImage.gif)
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781305971776
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
![Principles of Information Systems (MindTap Course…](https://www.bartleby.com/isbn_cover_images/9781285867168/9781285867168_smallCoverImage.gif)
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
![Oracle 12c: SQL](https://www.bartleby.com/isbn_cover_images/9781305251038/9781305251038_smallCoverImage.gif)
![Principles of Information Systems (MindTap Course…](https://www.bartleby.com/isbn_cover_images/9781305971776/9781305971776_smallCoverImage.gif)
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781305971776
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
![Principles of Information Systems (MindTap Course…](https://www.bartleby.com/isbn_cover_images/9781285867168/9781285867168_smallCoverImage.gif)
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781285867168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
![Fundamentals of Information Systems](https://www.bartleby.com/isbn_cover_images/9781305082168/9781305082168_smallCoverImage.gif)
Fundamentals of Information Systems
Computer Science
ISBN:
9781305082168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![Fundamentals of Information Systems](https://www.bartleby.com/isbn_cover_images/9781337097536/9781337097536_smallCoverImage.gif)
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning