Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien
logo-home
Summary Module1_Relational Database: Part 3 €3,99   Ajouter au panier

Resume

Summary Module1_Relational Database: Part 3

 70 vues  0 fois vendu

Business Information Management - Data Management subject. Third part of Module 1 Relational Database. This document contains all the slides, notes from 2 students and extra information collected on Internet. I had a 15 out 20 for this subject.

Aperçu 5 sur 8  pages

  • 19 février 2019
  • 8
  • 2018/2019
  • Resume
Tous les documents sur ce sujet (8)
avatar-seller
shafaqsara
Converting Entity-Relationship Diagrams to
Relational Databases
The Rules
- Each entity will convert to a table.
- Each many-to-many relationship or associative entity will convert to a table. (a middle
table) If you have at ERD level one book as many authors and many autor have many
books
- During the conversion, certain rules must be followed to ensure that foreign keys appear
in their proper places in the tables. (it’s about the primary and foreign keys, that’s what
the db understands)
ERD doesn’t have primary keys or foreign keys
Converting a Simple Entity
S a le s p e rs o n S a le s p e rs o n C o m m is s io n
N um ber N am e P e rc e n ta g e Y e a r o f H ire
SA LESPERSO N
The table simply contains the attributes that were specified in
the entity box.
Salesperson Number is underlined to indicate that it is the
unique identifier of the entity and the primary key of the table.
Converting Entities in
Binary Relationships:
One-to-One
There are three options for designing
tables to represent this data.


One-to-One: Option #1
The two entities are combined into one
relational table.


S a le s p e rs o n S a le s p e rs o n C o m m is s io n Y e a r O ffic e
N um ber N am e P e rc e n ta g e of N u m b e r T e le p h o n e S iz e
H ire
S A L E S P E R S O N /O F F IC E
One-to-One: Option #2 He prefers this one
Separate tables for the SALESPERSON and
OFFICE entities, with Office Number as a
foreign key in the SALESPERSON table.




1

,One-to-One: Option #3
Separate tables for the SALESPERSON and
OFFICE entities, with Salesperson Number as a
foreign key in the OFFICE table.




Converting Entities in Binary Relationships: One-to Many

The unique identifier of the entity
on the“one side”of the one-to-
many relationship is placed as a
foreign key in the table
representing the entity on the
“many side.”
So, the Salesperson Number
attribute is placed in the
CUSTOMER table as a foreign key.




Many sales persons selling
many products and may
products are sold by many
sales persons: many to
many relationship
They have no FK but only
PK




Converting Entities in Binary Relationships: Many-to Many


2

, Here is
presented as
entity




- E-R diagram with the many-to-many binary relationship and the equivalent diagram
using an associative entity.

Converting Entities in Binary Relationships: Many-to Many
- An E-R diagram with two entities in a many-to-many relationship converts to three
relational tables.
- Each of the two entities converts to a table with its own attributes but with no foreign
keys (regarding this relationship).
- In addition, there must be a third“many-to-many" table for the many-to-many
relationship.




Converting Entities in Unary Relationships: One-to-
One
• With only one entity type
involved and with a one-to-
one relationship, the
conversion requires only one
table.

3
One to one
S a le s p e rs o n S a le s p e rs o n C o m m is s io n B ackup relationship
N um ber N am e P e rc e n ta g e Y e a r o f H ire N um ber
SA LESPER SO N

, Converting Entities in Unary Relationships: One-to-
Many
• Very similar to the one- One sales person is
to-one unary case. managed by one
manager and one
manager manages
many sales
persons
S a le s p e rs o n S a le s p e rs o n C o m m is s io n
N um ber N am e P e rc e n ta g e Y e a r o f H ire M anager
SA LESPER SO N

Converting Entities in Unary Relationships: Many-to-
Many 7-14




P ro d u c t P ro d u c t
N um ber N am e U n it P ric e
PR O D U CT
P ro d u c t S u b -A s s e m b ly
N um ber N um ber Q u a n tity
C O M PO N EN T

• This relationship requires two tables in the conversion.

• The PRODUCT table has no foreign keys.

7-15




4

, Converting Entities in Unary Relationships: Many-to-
Many
P ro d u c t P ro d u c t
N um ber N am e U n it P ric e
PR O D U C T
P ro d u c t S u b -A s s e m b ly
N um ber N um ber Q u a n tity
CO M PO N EN T

• A second table is created since in the conversion of a
many-to-many relationship of any degree — unary, binary,
or ternary — the number of tables will be equal to the
number of entity types (one, two, or three, respectively)
plus one more table for the many-to-many relationship.

Converting Entities in 7-16

Ternary Relationships
S a le s p e rs o n S a le s p e rs o n C o m m is s io n
N um ber N am e P e rc e n ta g e Y e a r o f H ire
SA LESPER SO N

S a le s p e rs o n C u s to m e r P ro d u c t
N um ber N um ber N u m b e r D a te Q u a n tity
SA LE

P ro d u c t P ro d u c t
N um ber N am e U n it P ric e
PRO D U CT
• The primary key of the SALE
table is the combination of the C u s to m e r C u s to m e r
unique identifiers of the three N um ber N am e H Q C ity
entities involved, plus the Date C U STO M ER
attribute. 7-17




5

Les avantages d'acheter des résumés chez Stuvia:

Qualité garantie par les avis des clients

Qualité garantie par les avis des clients

Les clients de Stuvia ont évalués plus de 700 000 résumés. C'est comme ça que vous savez que vous achetez les meilleurs documents.

L’achat facile et rapide

L’achat facile et rapide

Vous pouvez payer rapidement avec iDeal, carte de crédit ou Stuvia-crédit pour les résumés. Il n'y a pas d'adhésion nécessaire.

Focus sur l’essentiel

Focus sur l’essentiel

Vos camarades écrivent eux-mêmes les notes d’étude, c’est pourquoi les documents sont toujours fiables et à jour. Cela garantit que vous arrivez rapidement au coeur du matériel.

Foire aux questions

Qu'est-ce que j'obtiens en achetant ce document ?

Vous obtenez un PDF, disponible immédiatement après votre achat. Le document acheté est accessible à tout moment, n'importe où et indéfiniment via votre profil.

Garantie de remboursement : comment ça marche ?

Notre garantie de satisfaction garantit que vous trouverez toujours un document d'étude qui vous convient. Vous remplissez un formulaire et notre équipe du service client s'occupe du reste.

Auprès de qui est-ce que j'achète ce résumé ?

Stuvia est une place de marché. Alors, vous n'achetez donc pas ce document chez nous, mais auprès du vendeur shafaqsara. Stuvia facilite les paiements au vendeur.

Est-ce que j'aurai un abonnement?

Non, vous n'achetez ce résumé que pour €3,99. Vous n'êtes lié à rien après votre achat.

Peut-on faire confiance à Stuvia ?

4.6 étoiles sur Google & Trustpilot (+1000 avis)

64438 résumés ont été vendus ces 30 derniers jours

Fondée en 2010, la référence pour acheter des résumés depuis déjà 14 ans

Commencez à vendre!
€3,99
  • (0)
  Ajouter