What does it mean that a one-to-many relationship is unique?

i writes a line between two tables in the Linq Object (O / R):

 Order                  Customer
--------------           ---------------
| OrderID    |           | CustomerID  |
| CustomerID |♦---------˃| ...         |
|            |           |             |
--------------           ---------------

Note: Or maybe it was

 Order                    Customer
--------------           ---------------
| OrderID    |           | CustomerID  |
| CustomerID |˂---------♦| ...         |
| ...        |           |             |
--------------           ---------------

I'm not sure; it allows me to move in both directions.

  • The first question is what is an arrow and which diamond?

Assuming a second diagram, power Associationwas created as OneToMany. This makes sense because:

  • one client
  • has a lot of orders

Association.Unique (Boolean). false. , OneToMany. Order.CustomerID , OneToMany, OneToOne.

OneToMany Unique true. , , Unique ness Order.CustomerID, Customer.CustomerID. , Customer.CustomerID . , , .

Unique . , , Unique ness .

  • , Unique?

    , -

  • : ?

, , :

Customers.CustomerID------------> Orders.CustomerID

Customers . , , . - , .

, Orders Customer.

     Parent(diamond)                     Child(arrowhead)
====================                     =================
Customers.CustomerID (PK) ♦------------> Orders.CustomerID (FK)

, :

  • Name: Orders

  • Name: Customer

"" , Orders. . - . Customer. . .

, , parent child - , :

      Child(diamond)                     Parent(arrowhead)
====================                     =================
Customers.CustomerID (PK) ♦------------> Orders.CustomerID (FK)

; 35 Stackoverflow; , .

.

+1
1

2 - Unique, , , OneToOne.

sql OneToOne. , . . , , - . , .

3: , () Customer, . "", ​​ .

0

All Articles