Skip to content

yella0215/Answers.md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

  1. the relationship between the "Product" and "Product_Category" entities is one-to-many.

2.There are two ways to ensure that each product in the "Product" table has a valid category assigned to it:

Add a foreign key constraint: A foreign key constraint is a database rule that ensures the data integrity between two tables. In this case, you could add a foreign key constraint to the "category_id" column in the "Product" table. This foreign key would reference the primary key ("id") of the "Product_Category" table. This would prevent products from being created with invalid category IDs.

Make the "category_id" column in the "Product" table NOT NULL: Setting the "category_id" column to NOT NULL would prevent products from being created without a category assigned to them. However, this approach would allow products to be assigned invalid category IDs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published