Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data...

23
Database Concepts

Transcript of Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data...

Page 1: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Database Concepts

Page 2: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Data:Collection of facts in raw form.Information : Organized and Processed data is information.

Database : A Collection of data files in which logically related information is stored.Data Base Management System : A Collection of programs for storing and retrieving information from the database is called DBMS.

Page 3: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

1.Data Redundancy ( Duplication of Data ) is removed.2.Data Inconsistency can be controlled.3.Sharing of Data.4.Security of Data. It means data can be protected from an unauthorized user.5.Integrity Rules can be applied.

Advantages of DBMS

Page 4: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Levels of Database Implementation

Internal Level ( Physical Level ) Conceptual Level External Level ( View Level )

Page 5: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Internal Level ( Physical Level )

The lowest level of database which is closest to the physical storage. It describes how the data is actually stored on the storage medium.

Page 6: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Conceptual Level

The level of database which describes what data is actually stored in the database.At this level the relationship between the data elements is described.

Page 7: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

View Level ( External Level )

The level of database which is

closest to the user. It is only concerned with the way how the data is viewed to the users .The System is able to create more than one views for the end user on the basis of the data stored.

Page 8: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Levels of Data Abstraction

Physical Level

Conceptual Level

View 3View 2View 1

Page 9: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Data Independence

The ability to modify a scheme definition at one level without affecting scheme definition of next higher level.

It is of two types:( 1 ) Physical Data Independence ( 2 ) Logical Data Independence

Page 10: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

( 1 ) Physical Data Independence:The ability to modify physical level without affecting the conceptual level. In this the application programs remains the same.

( 2 ) Logical Data Independence:The ability to modify conceptual level without affecting the view level.

Page 11: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Relational Data ModelA Data Model where data is organized in the form of tables. These tables are called relations. A relation or table is collection of horizontal rows and vertical columns. This model was proposed by E.F.Codd of IBM . The data stored in these relations is logically related.

Advantages :( 1 ) Easy to understand.( 2 ) In this model the relationship between databases is established by data values.

Page 12: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

S.No. Name Age

Page 13: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Basic Terminology1. Relation : A relation is a table which a

collection of rows and columns.2.Domain : It is a pool of values from

which the actual values are taken.3.Tuple : The horizontal rows of a relation

are called tuples.4.Attribute : The vertical columns of a

relation are called attributes.5.Degree of a relation : The total

number of attributes of a relation are termed as degree of a relation.

Page 14: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

6.Cardinality of a relation:The total number of rows in a relation are known as cardinality of a relation.

7.View:A view is a virtual table whose contents are taken from a existing table(base table) depending upon a condition. A vies does not have data of its own.

8.Primary Key:A key or a set of keys which can be used to uniquely identify the tuples of a relation.

9.Candidate Key:A key or a set of keys which can be used as a primary key to identify the tuples of a relation.

Page 15: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

10.Alternate Key: A key or a set of keys which can not be

used to identify the tuples of a relation.

11.Foreign Key: A key in a relation which can be used to

make a relationship with some other relation and it appears as a primary key in that relation .

Page 16: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Relational AlgebraOperators in Relational Algebra

1. Select Operation :

2. Project Operation :

3. Cartesian Product Operation :

4. Union Operation :

5. Set Difference Operation :

6. Set Intersection Operation :

Page 17: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

1. Select Operation :It is a unary operator which selects the tuples ( horizontal subset ) from a relation that satisfy a given predict or condition. The selection is denoted by the symbol sigma ( σ ) .

2. Project Operation :It is a unary operator which selects the specified attributes ( vertical subset ) from a relation that satisfy a given predict or condition. The projection is denoted by the symbol pi ( π ) .

Page 18: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

3. Cartesian Product Operation :

It is a binary operator which yields a new relation which has a degree ( number of attributes ) equal to the sum of the degrees of the two relations operated upon and number of tuples ( Cardinality ) equal to the product of the number of tuples of two relations. The Cartesian Product of two relations A and B is denoted by A X B .

Page 19: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

4. Union Operation :It is a binary operator which operates on two relations and yields a new relation that contain tuples from both the relations. The condition to apply this operator are :

( a ) The two relations A and B must have same degree.

( b ) The domain of ith attribute of relation A and the domain of ith attribute of relation B must be same.

All the duplicate tuples are automatically removed using this operated. The Union Operation of two relations A and B is denoted by A U B .

Page 20: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

5. Set Difference Operation :

It is a binary operator which operates on two relations and yields a new relation that contain tuples which are present in first relation but not in the second table . The condition to apply this operator is that the two relations A and B must have same degree. The new relation will contain the tuples which are present in A but not in B . The Set difference Operation of two relations A and B is denoted by A – B.

Page 21: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

6. Set Intersection Operation :

It is a binary operator which operates on two relations and yields a new relation that contain tuples which are present both the relations. The condition to apply this operator is that the two relations A and B must have same degree. The new relation will contain the common tuples of A and B . The Set Intersection operation of two relations A and B is denoted by A B .

Page 22: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Disadvantages of Database System

1.Extra hardware may be required.

2.System is likely to be very complex.

Page 23: Database Concepts. Data :Collection of facts in raw form. Information : Organized and Processed data is information. Database : A Collection of data files.

Thanks