Note3-RelationalModel0

Note3-RelationalModel0 - CSc 134 Database Management and...

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

View Full Document Right Arrow Icon
1 CSc 134 Database Management and File  Organization 3. Relational Data Model and  Relational Database Constraints Ying Jin Computer Science Department California state University, Sacramento
Background image of page 1

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

View Full Document Right Arrow Icon
2 Relational Model Concepts Relational Model presents a database as a  collection of relations. Table :- Relation Row :- Tuple Column header :- attribute Name SSN Home Phone Joe Smith 307-88-2907 602-7765543 Barbara Miller 590-38-6654 422-1076031 Student Attribute Tuple
Background image of page 2
3 Relational Model Domain Domain: A domain D in the relational model is a set  of atomic values. Atomic: Each value in the domain is indivisible as far as the  relational model is concerned. Domain:name, data type, format e.g.  USA_Phone_numbers: A character string of the  form (ddd)ddd-dddd, where each d is a numeric  (decimal) digit and the first three digits form a valid  telephone area code.  e.g. employee_age: Possible ages of employee of a  company; each must be an integer value between 15  and 80.
Background image of page 3

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

View Full Document Right Arrow Icon
4 Relational Model - Relation Schema A relation Schema R(A1,A2,…An) is  made up of a relation name R and a list  of attributes A1,A2,…,An E.g. STUDENT(Name,ssn,phoneNumber) Domain of Ai is denoted by dom(Ai) Degree of a relation: number of  attributes n of its relation schema name of the relation
Background image of page 4
5 Relational Model relation state A relation (or relation state) of the  relation schema R(A1,A2,…An) is  denoted by r(R) The relation is a set of of n-tuples  r={t1,t2,. .tm} , where each n-tuple t is an  ordered list of values: t=<v1,v2,. .vn> each value vi, 1=<i<=n, is an element of  dom(Ai) or is a special  null  value. unknown or may not apply to a tuple
Background image of page 5

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

View Full Document Right Arrow Icon
6
Background image of page 6
Relational Model relation state (Cont.) r(R)   (dom(A1) X dom (A2) X … X dom(An)) Tuples are unordered in a relation A relation cannot have duplicate tuples Denote cardinality (number of values) of  domain D by |D|. Maximum number of tuples in r(R) is
Background image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 34

Note3-RelationalModel0 - CSc 134 Database Management and...

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

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