Chapter05RelationalModel.pptx

However a more general alternative definition of

Info icon This preview shows pages 15–22. Sign up to view the full content.

(However, a more general alternative definition of relation does not require this ordering. It includes both the name and the value for each of the attributes ). Example: t= { <name, “John” >, <SSN, 123456789> } This representation may be called as “self-describing”. Relational Model 15
Image of page 15

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

Characteristics Of Relations Values in a tuple: All values are considered atomic (indivisible). Each value in a tuple must be from the domain of the attribute for that column If tuple t = <v1, v2, …, vn> is a tuple (row) in the relation state r of R(A1, A2, …, An) Then each vi must be a value from dom(Ai) A special null value is used to represent values that are unknown or not available or inapplicable in certain tuples. Relational Model 16
Image of page 16
Characteristics Of Relations Notation: We refer to component values of a tuple t by: t[Ai] or t.Ai This is the value vi of attribute Ai for tuple t Similarly, t[Au, Av, ..., Aw] refers to the subtuple of t containing the values of attributes Au, Av, ..., Aw, respectively in t Relational Model 17
Image of page 17

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

Constraints Constraints determine which values are permissible and which are not in the database. They are of three main types: 1. Inherent or Implicit Constraints : These are based on the data model itself. (E.g., relational model does not allow a list as a value for any attribute) 2. Schema-based or Explicit Constraints : They are expressed in the schema by using the facilities provided by the model. (E.g., max. cardinality ratio constraint in the ER model) 3. Application based or semantic constraints : These are beyond the expressive power of the model and must be specified and enforced by the application programs. Relational Model 18
Image of page 18
Relational Integrity Constraints Constraints are conditions that must hold on all valid relation states. There are three main types of (explicit schema-based) constraints that can be expressed in the relational model: Key constraints Entity integrity constraints Referential integrity constraints Another schema-based constraint is the domain constraint Every value in a tuple must be from the domain of its attribute (or it could be null , if allowed for that attribute) Relational Model 19
Image of page 19

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

Key Constraints Superkey of R: Is a set of attributes SK of R with the following condition: No two tuples in any valid relation state r(R) will have the same value for SK That is, for any distinct tuples t1 and t2 in r(R), t1[SK] t2[SK] This condition must hold in any valid state r(R) Key of R: A "minimal" superkey That is, a key is a superkey K such that removal of any attribute from K results in a set of attributes that is not a superkey (does not possess the superkey uniqueness property) A Key is a Superkey but not vice versa Relational Model 20
Image of page 20
Key Constraints Example: Consider the CAR relation schema: CAR(State, Reg#, SerialNo, Make, Model, Year) CAR has two keys: Key1 = {State, Reg#} Key2 = {SerialNo} Both are also superkeys of CAR {SerialNo, Make} is a superkey but not a key.
Image of page 21

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

Image of page 22
This is the end of the preview. Sign up to access the rest of the document.
  • Fall '09
  • SUNANHAN
  • Relational model

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern