Docsity

Logical Design | Study Lecture - Database Systems | EEL 4852C, Study notes of Deductive Database Systems

Toggle sidebar
bg1
Logical Design
Guidelines
1. Map each entity set to a relation & each relationship set to a relation.
• Don’t mix these two
• Only use foreign keys to refer to other entities as opposed to
duplicating columns in other tables
2. Minimize Data Redundancy
• Redundant information uses more storage space, like merging the
department & employee tables. If there are certain columns with
duplicates, you can probably break off into a new table.
• Anomalies in database modifications, using the employee &
department database tables that have been used in class
i. Updates causing the updating of too many rows
ii. Inserting a new department: If you had dept and employee
tables merged together as one table, if you just wanted to
insert a new department into the table there would be no
employee data to match it so NULL values will have to take
the place of the employee columns.
iii. Deleting departments will delete their employees.
3. Try to minimize the occurrence of NULL values in your design.
4. Tables should follow lossless decomposition: in other words joining
smaller tables should not result in incorrect information, as in, if you break
a table down using say, first names to link them together, then the relation
between the two tables will be lost because the first names are likely to
not be unique.
Normalization
• Formal descriptions of guidelines concerns start from large tables.
Decompose them until each sub table follows a “good” form. These
are described by normalization. There are different levels of
normalization
• 1
st
Normal Form – all attributes in a relation should be atomic,
meaning no attribute should have composite values.
pf2

Partial preview of the text

Download Logical Design | Study Lecture - Database Systems | EEL 4852C and more Study notes Deductive Database Systems in PDF only on Docsity!

Logical Design

Guidelines

  1. Map each entity set to a relation & each relationship set to a relation.
    • Don’t mix these two
    • Only use foreign keys to refer to other entities as opposed to duplicating columns in other tables
  2. Minimize Data Redundancy
    • Redundant information uses more storage space, like merging the department & employee tables. If there are certain columns with duplicates, you can probably break off into a new table.
    • Anomalies in database modifications, using the employee & department database tables that have been used in class

i. Updates causing the updating of too many rows

ii. Inserting a new department: If you had dept and employee tables merged together as one table, if you just wanted to insert a new department into the table there would be no employee data to match it so NULL values will have to take the place of the employee columns.

iii. Deleting departments will delete their employees.

  1. Try to minimize the occurrence of NULL values in your design.
  2. Tables should follow lossless decomposition: in other words joining smaller tables should not result in incorrect information, as in, if you break a table down using say, first names to link them together, then the relation between the two tables will be lost because the first names are likely to not be unique.

Normalization

  • Formal descriptions of guidelines concerns start from large tables. Decompose them until each sub table follows a “good” form. These are described by normalization. There are different levels of normalization
  • 1 st^ Normal Form – all attributes in a relation should be atomic, meaning no attribute should have composite values.

i. Example: an attribute shouldn’t contain a set of values such as a department location field being {Tampa, NYC, Boston}.

ii. A solution to this kind of scenario is to split the composite values into individual rows, like the following example, based on the above example. So if a department with id of 33 has three locations, there should be three rows with all three having the same department_id.

iii. A more reasonable solution would to be put department_location into its own table. The above example has duplicate data (department_id) but realistically just about all the department data would be polluting each row in duplicates. In the above example you also can’t delete a department id because then you either delete the entire row or put in NULL values in its place.

Department_id Department_location 32 Los Angeles 33 Tampa 33 Boston 33 Phoenix