All Questions

Tagged with
Filter by
Sorted by
Tagged with
1
vote
1answer
185 views

Which table gets the FK? Is there a clear Parent-Child relationship here?

I have the following tables: Each ProductLine will encompass many Parts. For this reason, it initially seemed to me that the Part table is a child of the ProductLine table. However, a part is not ...
1
vote
1answer
659 views

Clarification on Cardinality and Participation

I'm currently redesigning a schema with 20 or so tables and my first task is to create an ERD from the existing tables/constraints/relationships. This has proven more difficult than I expected because ...
2
votes
2answers
66 views

Enforcing existence of records while avoiding circular references

I'm having issues designing a satisfactory solution for the following problem. There are two main entities: Customer User A customer can have many users associated to it. A user can be associated ...
6
votes
3answers
802 views

How to model Parent -> Child -> Grandchild if the Child can be removed

I'm dealing with a set of relationships where the child can be removed, but I obviously don't want to lose the connection between the grandchild and the parent. I did think about marking the child as "...
2
votes
3answers
716 views

Should I define a FOREIGN KEY column as NULLable?

I've been developing some database structure to cover the following business rules: An invoice has many invoice_items. An invoice may have many refunds A refund has many invoice_items. All items ...
1
vote
1answer
514 views

How to get a surrogate key value in order to put a foreign key in and create relationship?

I am trying to create two relationships between three tables, using foreign keys with values of primary keys, which are surrogate keys. But I don't understand how to enter the right value in the ...
1
vote
1answer
193 views

Implementing a simple ERD in MySQL: is the implementation below 100% compliant with the ERD?

ERD Consider the following ERD: Tables From it, I derived the following tables: Company ------------------ c_id c_name ------------------ CompanyEmail ------------------ c_id e_id --...