Thursday 25 February 2016

INTRODUCTION TO DATABASES


DATA

Datum is any fact that can be recorded.
And set of datum is data.

eg: {12, apple, 3.14} is data, or set of datum.

DATABASE

Database is a collection of data, which is related. But what do we exactly mean by the term 'related'?

As we stated earlier, data is a set. Now suppose we have two sets NAME and PET_NAME as follows:

NAME={RAM, HARRY, JEFF, SUPRIYA}
PET_NAME={SCOOBY, BRUT, TAMAYA, FOO, DOZO}

Now, if elements from set NAME are having pets having names PET_NAME, and we have following relations given:
  • RAM has a dog named SCOOBY
  • HARRY has a cat names TAMAYA and a mouse named FOO
  • JEFF has a dog named BRUT
  • SUPRIYA has a dog named DOZO
Then to represent this data, we may want to uset sets as we did earlier right?
But how to represent these mappings??
ANSWER: We use ordered pair. It is a pair representing a pair of related objects from different sets.

To represent above set:

{(RAM,SCOOBY),(HARRY,TAMAYA),(HARRY,FOO),(JEFF,BRUT),(SUPRIYA,DOZO)}


This set of ordered pairs is called a RELATION. 

And sets NAME and PET_NAME are said to be related.:)



Hope that clears the definition of database. Lets move firther now!!

No comments:

Post a Comment