1 / 8

CSC 1035 Supplement for Chapter 2 Functional Dependencies

CSC 1035 Supplement for Chapter 2 Functional Dependencies. Definition and Notation. Suppose X and Y are sets of attributes (column names) Check whether this statement is true or not: “For every set of values in the X columns, there can be at most one set of values in the Y columns”

emmly
Download Presentation

CSC 1035 Supplement for Chapter 2 Functional Dependencies

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 1035 Supplement for Chapter 2 Functional Dependencies

  2. Definition and Notation • Suppose X and Y are sets of attributes (column names) • Check whether this statement is true or not: “For every set of values in the X columns, there can be at most one set of values in the Y columns” • If that’s true, then say X determines Y • And write X -> Y

  3. An example of some FD’s • Suppose the attribute names are: • stuId, firstName, lastName, major, credits, classNumber, grade, schedule, room, facId, name, rank, department • And suppose the semantics are the same as in University.mdb • On the next pages, let’s analyze those attributes for FD’s.

  4. Examples from University.mdb • This statement is true: “For every set of values of stuId, classNumber, there can be at most one grade.” • So is this one: “For every value of stuId, there can be at most one value of firstName and lastName. • This one isn’t true: “For every value of classNumber, there can be at most one value of stuId.”

  5. Examples, continued • Phrasing the examples from the previous slide in technical database language: • stuId, classNumber -> grade • stuID -> firstName, lastName • classNumber does NOT determine stuId

  6. Here’s a complete list of FD’s • stuId -> firstName, lastName, major, credits • stuId, classNumber -> grade • classNumber -> room, schedule, facId • facId -> name, rank, department

  7. Setting up the tables in the database • Each of the FD’s in the last slide should lead to its own table. • Within each table, the left-hand part of the FD becomes the primary key. • So rather than a single table with all 13 attributes, we get four tables, each with fewer attributes. • The big table would have had redundancies.

  8. Normalization • The process of decomposing a big table into smaller ones, in order to avoid redundancies and anomalies, is called normalization. • An indication of a table that’s not normalized would be if you can spot a FD X->Y where X isn’t a key for that table.

More Related