0% found this document useful (0 votes)
114 views9 pages

E-R Diagram For A University Enterprise: Amity School of Engineering & Technology

The document describes how to convert an E-R diagram for a university into relational database schemas. It discusses how entity sets, relationship sets, and attribute types like composite and multivalued attributes map to tables and columns. Strong entity sets become tables with their attributes as columns, while weak entity sets include a column for their identifying entity's primary key. Relationship sets are modeled in different ways depending on their cardinality. Composite attributes become separate columns, and multivalued attributes each get their own table linked to the entity's primary key.

Uploaded by

Karamjeet Kalra
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views9 pages

E-R Diagram For A University Enterprise: Amity School of Engineering & Technology

The document describes how to convert an E-R diagram for a university into relational database schemas. It discusses how entity sets, relationship sets, and attribute types like composite and multivalued attributes map to tables and columns. Strong entity sets become tables with their attributes as columns, while weak entity sets include a column for their identifying entity's primary key. Relationship sets are modeled in different ways depending on their cardinality. Composite attributes become separate columns, and multivalued attributes each get their own table linked to the entity's primary key.

Uploaded by

Karamjeet Kalra
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

E-R Diagram for a University Amity School of Engineering & Technology Enterprise

Amity School of Engineering & Technology

Reduction to Relational Schemas

Representing Entity Sets With Simple Attributes

Amity School of Engineering & Technology

A strong entity set reduces to a schema with the same attributes student(ID, name, tot_cred) A weak entity set becomes a table that includes a column for the primary key of the identifying strong entity set section ( course_id, sec_id, sem, year )

Representing Relationship Sets Amity School of Engineering & Technology


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 advisor advisor = (s_id, i_id)

Redundancy of AmitySchemas School of Engineering & Technology


Many-to-one and one-to-many relationship 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 inst_dept, add an attribute dept_name to the schema arising from entity set instructor

Redundancy of Schemas (Cont.) Amity School of Engineering & Technology


For one-to-one relationship sets, either side can be chosen to act as the many side That is, extra attribute can be added to either of the tables corresponding to the two entity sets 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 section schema already contains the attributes that would appear in the sec_course schema

Composite and Multivalued Amity School of Engineering & Technology Attributes Composite attributes are flattened out by creating a
separate attribute for each component attribute Example: given entity set instructor with composite attribute name with component attributes first_name and last_name the schema corresponding to the entity set has two attributes name_first_name and name_last_name Prefix omitted if there is no ambiguity Ignoring multivalued attributes, extended instructor schema is instructor(ID, first_name, middle_initial, last_name, street_number, street_name, apt_number, city, state, zip_code, date_of_birth)

Composite and Multivalued Amity School of Engineering & Technology Attributes 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 phone_number of instructor is represented by a schema: inst_phone= ( ID, phone_number) Each value of the multivalued attribute maps to a separate tuple of the relation on schema EM For example, an instructor entity with primary key 22222 and phone numbers 456-7890 and 123-4567 maps to two tuples: (22222, 456-7890) and (22222, 123-4567)

Multivalued Attributes (Cont.) Amity School of Engineering & Technology


Special case:entity time_slot has only one attribute other than the primarykey attribute, and that attribute is multivalued Optimization: Dont create the relation corresponding to the entity, just create the one corresponding to the multivalued attribute time_slot(time_slot_id, day, start_time, end_time)

You might also like