chapter2 - intro to rdbms

Upload: abdulgani11

Post on 03-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Chapter2 - Intro to Rdbms

    1/11

    INTRODUCTION TO RDBMS

  • 7/28/2019 Chapter2 - Intro to Rdbms

    2/11

    Objectives

    After completing this chapter, you will be able to:

    Define a Relational Database Management System

    (RDBMS)

    Define a relation

    List the features of an RDBMS

    List Important terms related to RDBMS

    Describe the different types ofkeys and their use

    Explain referential integrity

  • 7/28/2019 Chapter2 - Intro to Rdbms

    3/11

    Basic Definitions

    RELATIONAL DATABASE

    A relational database is a database system in which

    the database is organized and accessed according

    to the relationships between data items without

    the need for any consideration of physical

    orientation and relationship.

    Relationships between data items are expressed by

    means oftables.

    It is a tool which can help you store, manage and disseminateinformation of various kinds. It is a collection of objects, tables,

  • 7/28/2019 Chapter2 - Intro to Rdbms

    4/11

    RELATIONAL DATABASE MANAGEMENT SYSTEM

    It is a system which allows us to perceive data as tables

    (and nothing but tables) and operatorsnecessary to

    manipulate that data are at the users disposal.

    The operators used are:

    SELECT

    PROJECT

    JOIN

    Definitions continued...

  • 7/28/2019 Chapter2 - Intro to Rdbms

    5/11

    Features of RDBMS

    The ability to create multiple relations (tables) and

    enter data into them.

    An interactive query language.Retrieval of information stored in more than one

    table.

    Provides aCatalogor Dictionary, which itselfconsists of tables ( called system tables )

  • 7/28/2019 Chapter2 - Intro to Rdbms

    6/11

    Important Terms

    Relation : a tableTuple : a row in a table

    Attribute : a column in a table

    Degree : number of attributesCardinality : number of tuples

    Primary Key : a unique identifier for the

    tableDomain : a pool of values from which

    specific attributes of specific relations draw

    their values

  • 7/28/2019 Chapter2 - Intro to Rdbms

    7/11

    Properties of a Relation (Table)

    There are no duplicate rows (tuples).

    Tuples are unordered, top to bottom.

    Attributes are unordered, left to right.

    All attribute values are atomic (or scalar).

    Relational databases do not allow repeating

    groups.

    A database relation is a predefined row/column

    format for storing information in a relational

  • 7/28/2019 Chapter2 - Intro to Rdbms

    8/11

    Keys

    Key

    An attribute or set of attributes whose values uniquely

    identify each entity in an entity set is called a key for

    that entity set.

    Super Key

    If we add additional attributes to a key, the resulting

    combination would still uniquely identify an instance

    of the entity set. Such augmented keys are called super

  • 7/28/2019 Chapter2 - Intro to Rdbms

    9/11

    Referential Integrity

    It is an integrity constraint which specifies that the value(or existence) of an attribute in one relation depends on

    the value (or existence) of an attribute in the same or

    another relation.

    Referential integrity in a relational database is consistency

    between coupled tables.

    It is usually enforced by the combination of a primary key

    and a foreign key.For referential integrity to hold, any field in a table that is

    declared a foreign key can contain only values from a

    parent table's primary key field.

  • 7/28/2019 Chapter2 - Intro to Rdbms

    10/11

    sid cid grade53666 carnatic101 C

    53688 reggae203 B

    53650 topology112 A

    53666 history105 B

    sid name age

    53666 Jones 18

    53688 Smith 18

    53650 Smith 19

    gpa

    3.4

    3.2

    3.8

    login

    Jones@cs

    Smith@eecs

    Smith@math

    Enrolled Student

    Primary keyForeign key referring tosid of STUDENT relation

    Keys and Referential Integrity

  • 7/28/2019 Chapter2 - Intro to Rdbms

    11/11

    Summary

    You now should be able to:

    1.Define a Relational Database Management System

    (RDBMS)

    2.Define a relation

    3.List the features of an RDBMS

    4.List Important terms related to RDBMS

    5.Describe the different types ofkeys and their use

    6.Explain referential integrity