CSC 4402 20090909

# CSC 4402 20090909 - Relation schema<=> Type in...

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

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

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

View Full Document
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.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Relation schema <=> Type in programming language Relation <=> Variable in programming language Relation instance <=> 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 <=> 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

## This note was uploaded on 01/25/2010 for the course CSC 4402 taught by Professor Staff during the Fall '08 term at LSU.

### Page1 / 2

CSC 4402 20090909 - Relation schema<=> Type in...

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

View Full Document
Ask a homework question - tutors are online