---
title: "RA: employee-projects with no part used"
subject: "Database Management System"
chapter: 3
key: "semester_6/database_management_system:ra-emp-project-no-part"
source: https://www.bctengineer.com/q/semester_6/database_management_system/ra-emp-project-no-part
site: BCT Engineering
---

# RA: employee-projects with no part used

Database Management System · Chapter 3: Relational Languages & Relational Model

- Asked in: year not given
- Video: [DBMS - Relational Algebra Questions with Solution - Part 1.](https://www.youtube.com/watch?v=5KlHir314FQ) — Web Tech Paradise
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/database_management_system/ra-emp-project-no-part
- Whole chapter: https://www.bctengineer.com/md/semester_6/database_management_system/chapter-3

## Question

Consider the relational schema:
employee (e_no, name, address)
project (p_no, p_name)
work (e_no, p_no)
part (part_no, part_name, qty, size)
use (e_no, p_no, part_no, number)
List names of employees and projects with which employees are associated with and for which they have used no part so far. (Write a relational algebra expression.)

## Short answer

Find (e_no,p_no) from work minus use, join employee and project, project name and p_name: π name, p_name (employee ⋈ project ⋈ (π e_no,p_no(work) − π e_no,p_no(use))).

## Answer

Relational algebra symbols used: σ select, π project, ⋈ natural join, ∪ union, ∩ intersection, − difference, ρ rename, 𝒢 aggregate.

#### Relational algebra expression
```text
π name, p_name ( employee ⋈ project ⋈
      ( π e_no, p_no (work) − π e_no, p_no (use) ) )
```

#### Explanation
1. π e_no, p_no (work) lists every (employee, project) association.
2. π e_no, p_no (use) lists the pairs for which at least one part was used.
3. The difference leaves the pairs where the employee works on the project but has used no part there.
4. Joining with employee (on e_no) and project (on p_no) brings in the names, and the final projection prints the employee name and the project name.

Both operands of the − have the same attributes (e_no, p_no), so they are union-compatible.

#### Equivalent SQL
```sql
SELECT e.name, p.p_name
FROM work w JOIN employee e ON e.e_no = w.e_no
            JOIN project p ON p.p_no = w.p_no
WHERE NOT EXISTS (SELECT 1 FROM use u
                  WHERE u.e_no = w.e_no AND u.p_no = w.p_no);
```

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What does pi e_no,p_no(work) - pi e_no,p_no(use) give?
   A. Pairs where the employee works on the project but used no part there
   B. Pairs where the employee used parts
   C. All employees with no project
   D. Projects with no employees
   Answer: A. Pairs in work but not in use. (Key point: Pairs difference)

2. Why can the two operands of - be subtracted?
   A. Both are the same relation
   B. Both have the same number of tuples
   C. Both have the same attributes (e_no, p_no)
   D. Difference needs no compatibility
   Answer: C. Set operations require union-compatible relations. (Key point: Union compatibility)

3. Which joins bring in the names?
   A. employee on e_no and project on p_no
   B. part on part_no
   C. employee on p_no
   D. use on e_no
   Answer: A. Names are in employee and project, matched by their keys. (Key point: Final joins)

## Related in Database Management System

- [RA: projects where all used bolts size 6](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Ara-projects-all-used-bolts) — Database Management System, chapter 3
- [RA: employees on no project](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Ara-emp-no-project) — Database Management System, chapter 3
- [RA: employees on project DBMS](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Ara-emp-project-dbms) — Database Management System, chapter 3
- [RA: employees in both DBMS and MIS](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Ara-emp-both-dbms-mis) — Database Management System, chapter 3
- [RA: parts used in DBMS and MIS](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Ara-parts-both-dbms-mis) — Database Management System, chapter 3
- [RA: computer dept employees and supervisors](https://www.bctengineer.com/question.md?key=semester_6%2Fdatabase_management_system%3Ara-computer-emp-supervisor) — Database Management System, chapter 3
