Friday, May 2, 2014

Database Management System

Database Management System:

Database Management System is, as the name suggests a system to proficiently store and retrieve data.

The GATE syllabus of Database Management system is as follows -

ER-Model,Relational Model( Relational Algebra, Tuple calculus),Database design( integrity Constraints,normal forms)Query Language(SQL),FIle Structures( Sequential files,indexing, B and B+ trees), Transaction and Concurrency Control.

Though the syllabus is looking very tiny and simpler, the questions are formidable enough. I will take the topic one by one, lets start with ER Model.

ER Model:

ER model is built on the principle of entities, a set of real world thing with certain properties called attributes and Relationship among such entities. Say we have an entity called student, which has certain attributes like Name, Roll No, class etc. And we also have an entity Teacher, which also have attributes like Name, Subject, employee no etc. So the entities are related with each other by say a relationship teaches. The diagram will look like that -
ER Diagram Example

In the above example rectangular boxes are entities, Diamonds are relationship among entities, ellipses are attributes. There are more than this but we will get to know them in due course.
Symbols and notations of ER Diagram - 

 

Every entity has attribute or a set of attributes which uniquely identify the entity. In student entity that attribute is Roll No., which can uniquely identify a particular student. The main criteria of primary key is that this attribute can not be repeated, must be unique.
The entity for which not any particular attribute or set of attributes can be the primary key is called weak entity. In the above diagram the entity character is weak entity as it has no attributes for which it can be identified uniquely.
Multivalued attributes are those which have more than one value e.g phone number of certain person can be more than two. One of my friend has fifteen phone numbers.
Composite Attributes are attributes which have multiple attributes itself e.g. your address is consist of attributes like your street no, pin code etc.

Entities can be related to each other by a particular relationship in many ways like -
One to One : Exactly one entity is related to strictly one entity of another relation. Consider you are a dropout and a paper set exclusively for you and only you. Arrows at both the relational line to entities.
One to Many: One entity is related to many entities. Like a subject can be assigned to many student entity. The arrow denoting the one entity which connects to multiple.
Many to Many: Many instance of an entity is associated with many instance of other entities. Think a student can have multiple courses and a course can be assigned to multiple student.
Recursive Relationship: An entity can be related to itself. Like a self driven student who also teaches himself.
Ternary Relationship : A relationship with degree three. Degree of relationship is number of different entities involved, in ternary relationship it is three.

See also http://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model for more informations.

No comments:

Post a Comment

Feautured Post

Python Trivia Post: enumerate()

Python has a very useful inbuilt function, which is called enumerate(). This is needed whenever you need the numbering of a certain element...