ch3-2 - Chapter 3: Relational Model Structure of Relational...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
©Silberschatz, Korth and Sudarshan 3.1 Database System Concepts Chapter 3: Relational Model Chapter 3: Relational Model ± Structure of Relational Databases ± Relational Algebra ± Tuple Relational Calculus ± Domain Relational Calculus ± Extended Relational-Algebra-Operations ± Modification of the Database ± Views ©Silberschatz, Korth and Sudarshan 3.2 Database System Concepts Example of a Relation Example of a Relation
Background image of page 1

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

View Full DocumentRight Arrow Icon
©Silberschatz, Korth and Sudarshan 3.3 Database System Concepts Basic Structure 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 ©Silberschatz, Korth and Sudarshan 3.4 Database System Concepts Attribute Types 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
Background image of page 2
©Silberschatz, Korth and Sudarshan 3.5 Database System Concepts Relation Schema 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) ©Silberschatz, Korth and Sudarshan 3.6 Database System Concepts Relation Instance 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)
Background image of page 3

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

View Full DocumentRight Arrow Icon
©Silberschatz, Korth and Sudarshan 3.7 Database System Concepts Relations are Unordered Relations are Unordered ± Order of tuples is irrelevant (tuples may be stored in an arbitrary order) ± E.g. account relation with unordered tuples ©Silberschatz, Korth and Sudarshan 3.8 Database System Concepts Database 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 (
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 01/10/2011.

Page1 / 60

ch3-2 - Chapter 3: Relational Model Structure of Relational...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online