4.0k views
2 votes
Find the PIDs of parts that are red or are supplied by a supplier who is in the city of Newark: a. Search for red parts only b. Identify parts supplied by Newark suppliers c. Find PIDs for both red parts and Newark supplier parts d. Determine the total number of parts in Newark

User Mudits
by
7.6k points

1 Answer

7 votes

Final answer:

To find the PIDs of red parts or parts supplied by a Newark supplier, perform different search queries based on the criteria. Then, intersect the results to find the PIDs that satisfy both conditions. Count the number of PIDs retrieved from the supplier query to determine the total number of parts in Newark.

Step-by-step explanation:

To find the PIDs of parts that are red or supplied by a supplier in the city of Newark, you need to perform various search queries using the provided criteria:

  1. For red parts only: Search the database for parts that have the 'color' attribute set to 'red'. Retrieve the corresponding PIDs for these parts.
  2. For parts supplied by Newark suppliers: Search the database for suppliers located in the city of Newark. Retrieve the PIDs for parts supplied by these suppliers.
  3. For both red parts and Newark supplier parts: Combine the results from the previous queries by finding the intersection of the PIDs.
  4. To determine the total number of parts in Newark: Count the number of PIDs retrieved from the second query.
User Markreyes
by
8.2k points