Relational Model.pdf

Info icon This preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
RELATIONAL MODEL Structure of Relational Databases Relational Algebra Tuple Relational Calculus Domain Relational Calculus Extended Relational-Algebra- Operations Modification of the Database Views Copyright @ www.bcanotes.com
Image of page 1

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

View Full Document Right Arrow Icon
EXAMPLE OF A RELATION Copyright @ www.bcanotes.com
Image of page 2
BASIC STRUCTURE Formally, given sets D 1 , D 2 , …. D n a relation r is a subset of D 1 x D 2 x … x D n Thus a relation is a set of n-tuples ( a 1 , a 2 , …, a n ) where each a i D i Example: if customer-name = {Jones, Smith, Curry, Lindsay} customer-street = {Main, North, Park} customer-city = {Harrison, Rye, Pittsfield} Then r = { (Jones, Main, Harrison), (Smith, North, Rye), (Curry, North, Rye), (Lindsay, Park, Pittsfield)} is a relation over customer-name x customer-street x customer-city Copyright @ www.bcanotes.com
Image of page 3

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

View Full Document Right Arrow Icon
ATTRIBUTE TYPES Each attribute of a relation has a name The set of allowed values for each attribute is called the domain of the attribute Attribute values are (normally) required to be atomic , that is, indivisible E.g. multivalued attribute values are not atomic E.g. composite attribute values are not atomic The special value null is a member of every domain The null value causes complications in the definition of many operations we shall ignore the effect of null values in our main presentation and consider their effect later Copyright @ www.bcanotes.com
Image of page 4
RELATION SCHEMA A 1 , A 2 , …, A n are attributes R = ( A 1 , A 2 , …, A n ) is a relation schema E.g. Customer-schema = ( customer-name, customer-street, customer-city ) r ( R ) is a relation on the relation schema R E.g. customer (Customer-schema) Copyright @ www.bcanotes.com
Image of page 5

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

View Full Document Right Arrow Icon
RELATION INSTANCE The current values ( relation instance ) of a relation are specified by a table An element t of r is a tuple , represented by a row in a table Jones Smith Curry Lindsay customer-name Main North North Park customer-street Harrison Rye Rye Pittsfield customer-city customer attributes (or columns) tuples (or rows) Copyright @ www.bcanotes.com
Image of page 6
RELATIONS ARE UNORDERED Order of tuples is irrelevant (tuples may be stored in an arbitrary order) E.g. account relation with unordered tuples Copyright @ www.bcanotes.com
Image of page 7

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

View Full Document Right Arrow Icon
DATABASE A database consists of multiple relations Information about an enterprise is broken up into parts, with each relation storing one part of the information E.g.: account : stores information about accounts depositor : stores information about which customer owns which account customer : stores information about customers Storing all information as a single relation such as bank ( account-number, balance, customer-name , ..) results in repetition of information (e.g. two customers own an account) the need for null values (e.g. represent a customer without an account) Normalization theory deals with how to design relational schemas Copyright @ www.bcanotes.com
Image of page 8
THE CUSTOMER RELATION Copyright @ www.bcanotes.com
Image of page 9

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

View Full Document Right Arrow Icon
THE DEPOSITOR RELATION Copyright @ www.bcanotes.com
Image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ 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