pl-300 Practice Question 1930

Exam: pl-300
Domain: Model the data
Topic: Design and develop a data model
Difficulty: medium
When designing a star schema for an online marketplace, you need to model the relationship between products and categories. Each product can belong to multiple categories, and each category can contain multiple products. How should you represent this many-to-many relationship in the star schema, and what additional table is required?

Answer Options

A
One-to-many relationship from Products to Categories
B
Many-to-many relationship with a junction table (ProductCategories)
C
One-to-one relationship from Products to Categories
D
No relationship between Products and Categories

Correct Answer

B: Many-to-many relationship with a junction table (ProductCategories)

Explanation

The correct answer is B. In a star schema, a many-to-many relationship requires an additional junction table (e.g., `ProductCategories`) that links the `Products` table to the `Categories` table. This junction table contains foreign keys to both the `Products` and `Categories` tables. Option A is incorrect because it suggests a one-to-many relationship, which does not fit the scenario where a product can belong to multiple categories. Option C is incorrect because it suggests a one-to-one relationship, which does not fit the scenario where a category can contain multiple products. Option D is incorrect because it suggests no relationship, which contradicts the given scenario.

Related Practice Questions