CSC 4402 20090909

CSC 4402 20090909 - Relation schema...

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

View Full Document Right Arrow Icon
CSC 4402 9/9/2009 Page 1 of 2 The Relational Data Model In the relational data model, we have to look at: Relational data structures Relational integrity Relational data manipulation Relational data structures Tables Concepts: Domain Attribute relations o Type – schema o Instance – value of the relation Tuple Properties of relations Keys o Super key o Candidate key o Foreign key o Primary key We have a relation r with attributes a 1 , a 2 ,…,a n . Each attribute a i is based on a domain D i . Thus, a relation is a set of n -tuples ( a 1 , a 2 , …, a n ) where each a i D i . Domain <=> data type – define a collection of data values from which one or more attributes draw their actual values. A relation r is always a subset of the Cartesian product of the domains D 1 ,D 2 ,…,D n . Figure 1 – Sample Cartesian
Background image of page 1

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

View Full DocumentRight Arrow Icon
CSC 4402 9/9/2009 Page 2 of 2 Each tuple t r(a 1 ,a 2 ,…,a n ) , t is in the form (a 1 ,a 2 ,...,a n ) where a 1 is from D 1 , a 2 is from D 2 Attributes must be distinct to ensure the correct domains are used.
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Relation schema &lt;=&gt; Type in programming language Relation &lt;=&gt; Variable in programming language Relation instance &lt;=&gt; Value of the variable Properties of relations The tuples in a relation instance are not ordered. There are no duplicate tuples The attributes in a relation are distinct. There are no duplicate attribute names in a relation schema All attributes are atomic Relation schema &lt;=&gt; a set of attributes Relational data integrity Referential integrity foreign keys ensure that the rows referenced exist (no unmatched values). Entity integrity primary key attributes cannot take NULL values. Relational data manipulation Relational algebra Relational calculus o Domain calculus o Tuple calculus Relational algebra and relational calculus are equally powerful. Anything done with one can be done with the other. Database...
View Full Document

Page1 / 2

CSC 4402 20090909 - Relation schema...

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

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