L18 - ER to Tables + UML

L18 - ER to Tables + UML - Last time we had started talking...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Last time we had started talking about Last time we had started talking about Reduction to Relation Schemas: Reduction to Relation Schemas: ± We observed that a strong entity set reduces to a schema with the same attributes. ± A weak entity set becomes a table that includes a column for the primary key of the identifying strong entity set payment = ( loan_number , payment_number , payment_date, payment_amount ) ± A many-to-many relationship set is represented as a schema with attributes for the primary keys of the two participating entity sets, and any descriptive attributes of the relationship set. Example: schema for relationship set borrower borrower = ( customer_id, loan_number )
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Representing Representing many many - - one one and and one one - - many many Relationship Sets Relationship Sets ± Many-to-one and one-to-many relationship sets that are total on the many-side can be represented by adding an extra attribute to the “many” side, containing the primary key of the “one” side ² Example: Instead of creating a schema for relationship set account_branch , add an attribute branch_name to the schema arising from entity set account
Background image of page 2
Representing Representing one one - - one one Relationship Sets Relationship Sets ± For one-to-one relationship sets, either side can be chosen to act as the “many” side ² T hat is, an extra attribute can be added to either of the tables corresponding to the two entity sets ± Warning: If participation is partial on the “many” side, replacing a schema by an extra attribute in the schema corresponding to the “many” side could result in null values ± The schema corresponding to a relationship set linking a weak entity set to its identifying strong entity set is redundant. ² Example: The payment schema we saw earlier already contains the attributes that would appear in the loan_payment schema (i.e., loan_number and payment_number ). ©Silberschatz, Korth and Sudarshan
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What do we do about What do we do about Composite Composite and and Multivalued Multivalued Attributes Attributes ± Composite attributes are flattened out by creating a separate attribute for each component attribute ² Example: given entity set custome r with composite attribute name with component attributes first_name and l ast_name the schema corresponding to the entity set has two attributes name.first_name and name.last_name ± A multivalued attribute M of an entity E is represented by a separate schema EM ² Schema EM has attributes corresponding to the primary key of E and an attribute corresponding to multivalued attribute M ² Example: Multivalued attribute dependent_names of employee is represented by a schema: employee_dependent_names = ( employee_id , dname ) ² Each value of the multivalued attribute maps to a separate tuple of the relation on schema EM ± For example, an employee entity with primary key 123-45-6789 and dependents Jack and Jane maps to two tuples: (123-45-6789 , Jack) and (123-45-6789 , Jane)
Background image of page 4
Representing Specialization using Schemas Representing Specialization using Schemas ±
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 29

L18 - ER to Tables + UML - Last time we had started talking...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online