A data model includes a products table and a sales table. A relationship is created between them. Which cardinality should be set to achieve an optimal model?

Prepare for the Fabric Analytics Engineer Associate Test with comprehensive materials. Explore flashcards, multiple choice questions, and detailed explanations. Get ready for your success!

Multiple Choice

A data model includes a products table and a sales table. A relationship is created between them. Which cardinality should be set to achieve an optimal model?

Explanation:
Understanding how cardinality works in a relational model helps you design a clean link between products and sales. A product is a unique item that can appear in many separate sales records, while each individual sale typically references a single product. This means the natural relationship is one product to many sales: one product can be found in many sales rows, but each sales row relates to only one product. A one-to-one relationship would imply each product is sold in only a single transaction, which doesn’t reflect real-world behavior. A many-to-many relationship would be used if a single sale could involve multiple products and each product could appear in many different sales, which is common in practice but is usually modeled with a separate line-item or junction table to connect sales to products. Given a straightforward link where every sale references one product, the one-to-many setup is the appropriate choice.

Understanding how cardinality works in a relational model helps you design a clean link between products and sales. A product is a unique item that can appear in many separate sales records, while each individual sale typically references a single product. This means the natural relationship is one product to many sales: one product can be found in many sales rows, but each sales row relates to only one product.

A one-to-one relationship would imply each product is sold in only a single transaction, which doesn’t reflect real-world behavior. A many-to-many relationship would be used if a single sale could involve multiple products and each product could appear in many different sales, which is common in practice but is usually modeled with a separate line-item or junction table to connect sales to products. Given a straightforward link where every sale references one product, the one-to-many setup is the appropriate choice.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy