100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
Summary Module1_Relational Database: Part 3 €3,99   In winkelwagen

Samenvatting

Summary Module1_Relational Database: Part 3

 70 keer bekeken  0 keer verkocht

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.

Voorbeeld 5 van de 8  pagina's

  • 19 februari 2019
  • 8
  • 2018/2019
  • Samenvatting
Alle documenten voor dit vak (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

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

√  	Verzekerd van kwaliteit door reviews

√ Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, Bancontact of creditcard voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper shafaqsara. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €3,99. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 66579 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€3,99
  • (0)
  Kopen