1. Write an SQL query to display the Department number and the count of employees in the department who have either a daughter or a son as dependents in the system. Rename the count value as “Employee Count”. Do not use table joining. Use Sub Queries.

Principles of Information Systems (MindTap Course List)
13th Edition
ISBN:9781305971776
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter11: Strategic Planning And Project Management
Section: Chapter Questions
Problem 9RQ
icon
Related questions
icon
Concept explainers
Question

1. Write an SQL query to display the Department number and the count of employees in the department who have either a daughter or a son as dependents in the system. Rename the count value as “Employee Count”. Do not use table joining. Use Sub Queries.

2. Write an SQL query to list the name of all Departments that have 2 more more words in the Department name and whose employees have the designation of a ‘staff’ and are from Houston. 

 

 

Employee (empNo, firstName, lastName, address, DOB, sex, position, deptNo)
Department (deptNo, deptName, mgrEmpNo)
Project (projNo, projName, deptNo)
WorksOn (empNo, projNo, hoursWorked)
Dependent (empNo, Dependent name, Sex, Bdate, Relationship)
Transcribed Image Text:Employee (empNo, firstName, lastName, address, DOB, sex, position, deptNo) Department (deptNo, deptName, mgrEmpNo) Project (projNo, projName, deptNo) WorksOn (empNo, projNo, hoursWorked) Dependent (empNo, Dependent name, Sex, Bdate, Relationship)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Principles of Information Systems (MindTap Course…
Principles of Information Systems (MindTap Course…
Computer Science
ISBN:
9781305971776
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning