4_RelationalDataModelAndRelationalMapping.pdf

4_RelationalDataModelAndRelationalMapping.pdf - Relational...

This preview shows page 1 - 15 out of 84 pages.

Relational Data Model and ER/EER-to-Relational Mapping Chapter 4
Image of page 1

Subscribe to view the full document.

Contents 2 1 Relational Data Model 2 Main Phases of Database Design 3 ER-/EER-to-Relational Mapping
Image of page 2
Contents 3 1 Relational Data Model 2 Main Phases of Database Design 3 ER-/EER-to-Relational Mapping
Image of page 3

Subscribe to view the full document.

Relational Data Model 4 Basic Concepts: relational data model, relation schema, domain, tuple, cardinality & degree, database schema, etc. Relational Integrity Constraints key, primary key & foreign key entity integrity constraint referential integrity Update Operations on Relations
Image of page 4
Basic Concepts The relational model of data is based on the concept of a relation A relation is a mathematical concept based on the ideas of sets The model was first proposed by Dr. E.F. Codd of IBM in 1970 in the following paper: "A Relational Model for Large Shared Data Banks," Communications of the ACM, June 1970 5
Image of page 5

Subscribe to view the full document.

Basic Concepts Relational data model: represents a database in the form of relations - 2-dimensional table with rows and columns of data. A database may contain one or more such tables. A relation schema is used to describe a relation Relation schema: R(A1, A2,…, An) is made up of a relation name R and a list of attributes A1, A2, . . ., An. Each attribute Ai is the name of a role played by some domain D in the relation schema R. R is called the name of this relation 6
Image of page 6
Basic Concepts The degree of a relation is the number of attributes n of its relation schema. Domain D : D is called the domain of Ai and is denoted by dom(Ai). It is a set of atomic values and a set of integrity constraints STUDENT(Name, SSN, HomePhone, Address, OfficePhone, Age, GPA) Degree = ?? dom(GPA) = ?? 7
Image of page 7

Subscribe to view the full document.

Basic Concepts Tuple : row/record in table Cardinality : number of tuples in a table Database schema S = {R1, R2,…, Rm} 8
Image of page 8
Basic Concepts A relation r (or relation state, relation instance ) of the relation schema R(A1, A2, . . ., An), also denoted by r(R), is a set of n-tuples r = {t1, t2, . . ., tm}. Each n-tuple t is an ordered list of n values t = <v1, v2, . . ., vn>, where each value vi, i=1..n, is an element of dom(Ai) or is a special null value. The i th value in tuple t, which corresponds to the attribute Ai, is referred to as t[Ai] 9
Image of page 9

Subscribe to view the full document.

Basic Concepts Relational data model Database schema Relation schema Relation Tuple Attribute 10
Image of page 10
Basic Concepts A relation can be conveniently represented by a table, as the example shows The columns of the tabular relation represent attributes Each attribute has a distinct name, and is always referenced by that name, never by its position Each row of the table represents a tuple. The ordering of the tuples is immaterial and all tuples must be distinct 11
Image of page 11

Subscribe to view the full document.

Basic Concepts 12
Image of page 12
Alternative Terminology for Relational Model 13 Formal Terms Informal Terms Relation Table Attribute Column Header Domain All possible Column Values Tuple Row Schema of a Relation Table Definition State of the Relation Populated Table
Image of page 13

Subscribe to view the full document.

Relational Integrity Constraints Constraints are conditions that must hold on all valid relation instances. There are three main types of
Image of page 14
Image of page 15
  • Spring '17
  • Relational model, relation, DBS4

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

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