1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Akimi4 [234]
2 years ago
7

Retrieve the names of employees who work on exactly one project that is controlled by their department. (It does not matter how

many non-departmental projects they work on.) Also show the department name, and the project name and location. Show results in ascending alpha order (by last name and then first name).
Column Headings: FNAME LNAME DNAME PNAME PLOCATION

I currently have a list of names who work on projects controlled by their departments. But I am unsure on how to trim down the table so that it shows the employees who work on exactly one project controlled by there department. (ie, james borg and jennifer wallace). Values are subject to change, so i can not just do a direct comparison to their last names or something.

SQL Query I produced:

select distinct fname, lname, dname, pname, plocation
from works_on, project, employee, department
where works_on.pno = project.pnumber
and works_on.essn = employee.ssn
and project.dnum = employee.dno
and department.dnumber = employee.dno
order by lname, fname;
Computers and Technology
1 answer:
vodomira [7]2 years ago
7 0

Answer:

select distinct fname, lname, dname, pname, plocation

from works_on, project, employee, department

where works_on.pno = project.pnumber

and works_on.essn = employee.ssn

and project.dnum = employee.dno

and department.dnumber = employee.dno AND employee.ssn IN(

select essn

FROM works_on

GROUP BY essn

HAVING COUNT(essn)=1

)

order by lname, fname;

Explanation:

You might be interested in
Programmers can use sql on systems ranging from pcs to mid-size servers.
zaharov [31]

It is false that Programmers can use SQL on systems ranging from PCs to mid-size servers.

Applications for structured query language can be found in a wide range of sectors, mostly in those that deal with database-related tasks. It might be used, for example, by a data analyst to query data sets and produce precise insights. On the other hand, a data scientist might use this programming language to add data to their models.

Businesses and other organizations use SQL tools to create and modify new tables as well as access and edit information and data in their databases.

A database is a tool for gathering and organizing data. Databases can store data about people, things, orders, and other things. Many databases begin in a spreadsheet or word processor. Many firms find it beneficial to move them to a database made by a database management system as they grow larger.

SQL helps manage the data kept in databases, enabling users to get the precise data they require when they need it.

To learn more about SQL click here:

brainly.com/question/13154090

#SPJ4

4 0
1 year ago
Why are there so many problems with drivers?
podryga [215]

D. hope this helped!!!!!

5 0
3 years ago
You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
pashok25 [27]

Answer:

ECC RAM

Explanation:

ECC RAM is the most popular Random Access Memory out there that is used by most business servers. Dealing with big data for most huge businesses is crucial. The need to prevent loss of data requires that they purchase ECC RAM. ECC RAM automatically protects the systems from potential errors that occur in memory. Any abrupt changes in temporary data stored in ECC RAM are automatically corrected. This is achieved by an additional memory chip that acts as error detection for the other eight RAM chips.

8 0
3 years ago
What is garbage in garbage out?​
Neko [114]

Answer: it means if you give a bad input it will result in a ad output.

Explanation:

It has n acronym GIGO which refers to how the quality of an output is determined by the quality of input.

Garbage is trash info... or input. And grabage out is the trash output.

8 0
2 years ago
What is software?
bogdanovich [222]

Answer:

B

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • An employee is angry with his boss and wants to sabotage the company. To accomplish this he secretly changes some of the values
    7·1 answer
  • Question 16 (2 points) Question 16 Unsaved
    11·1 answer
  • If Chris has a car liability insurance, what damage would he be covered for
    10·1 answer
  • The color pattern in which marine organisms are light on the bottom and dark on the top of their bodies camouflaging them agains
    11·1 answer
  • What technique involves graphical methods and nontechnical language that represent the system at various stages of development a
    14·1 answer
  • A range check that can be used in Microsoft access to calculate the data collected which is date and time
    10·1 answer
  • It's fill the gap homework
    7·1 answer
  • What is LINUX?
    6·2 answers
  • PLEASE HELP <br> Which of the following best describes the existence of undecidable problems?
    7·1 answer
  • Ethan wants to change the font in his document. He should _____.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!