- Computers & Software»
- Computer How-Tos & Tutorials
A Guided Tour of Databases for Beginners
For every work a new program was required but with the introduction of Databases this problem got resolved.Thanks to Database Management System(DBMS).
In Database Management System(DBMS),there is one database which is accessible to all.It requires updation at one place only and the updated database is accessible to all.Example,Mycin,Reservation System. It is multiuser processing system.
Characteristics of Database
1)Self describing nature of databases.
2)Insulation between program and data.
3)Sharing the data by multiuser processing system.
4)Support of multiple view of data.
Database Administrator (DBA) gives permissions to different levels of users.Example,gives permission to manager, clerk to manage some particular bank zone.
3 Tier Architecture of Database
- Internal Level
Internal Level takes care of how data is stored internally in hard disk.It decides the method of access.Example, indexing, bucket hashing-how.Operating System (OS) decides this level. Lowest level of abstraction.
- Conceptual Level
It is decided by programmer.Example, Name alphabetic, Address alphanumeric, Phone numeric. He decides data types of attributes.Higher level of abstraction.It includes entities and their relationships,attributes.
- External Level
How data is being viewed to manager, clerk.Highest Level of abstraction. It decides how data will be viewed by different users.All have different view of same data.
Physical and Logical Data Independence
- Physical Data Independence:
Internally changed but conceptually not changed.Partitioning made in different ways.People having name with A separated,B in other block..so accessing fast.
- Logical Data Independence:
Database is so much updatable that external needs no change.
Components of DBMS
Compiler tells whether character type,numeric type, foreign key,primary key.Sets up,change, remove data structures from tables called Data Definition Language (DDL).
Compiler delete,modify,insert data.Example, student data.Here manipulation of data is done.
- Data Dictionary
Data dictionary tells what type of data,where it is being used.It has to not start from beginning if new person comes.
- File Manager
File Manager arranges files.
- DataBase Manager
Database Manager is logical Entity that manages database.
Advantages of Database
1)Reduction of redundancies.
4)Security and backup
6)Program data Independence.
Entity Relationship Model(ER Model)
ER Model divides data into entities. Example, entities in a business and relationship they hold between themselves.
In ER Diagram, attribute is shown by ellipse.
Key attribute, example, social security number, enrollment number.It is that column in a file that uniquely identifies a record.
Attribute which can contain multiple values i.e. multiple values related to an entity.Example, a person can have many phones. Phone attribute is multivalued.
Student Information System
ER Diagram for Student Information System
The above ER Diagram fulfils all the requirements for a University database that keeps track of student's information.
This ER Diagram contains (a)4 entities (objects relevant to the system being built)namely:
(b)5 Relationships in this ER Diagram are:
1)Marksheet-This relationship exists between student and Teacher.
2)Teach-This relationship exists between Teacher and Courses.
3)Run-This relationship exists between Department and Courses.
4)Enrol_in-This relationship exists between fully participating entity 'Student' and Department.
5)Fees_in-This relationship exists between Student and Department.
All the relationships are binary relationships (of degree 2 i.e. 2 entities participate in the relationship).
Cardinality of relationship
Cardinality of relationship refers to the number of entity instances involved in the relationship.
Cardinality of relationship in ER Diagram for Student Information System of a University are:
1)Marksheet of one Student is prepared by one Teacher
2)Many Teachers teach many Courses=M:N
3)One Department runs many Courses.
4)One Student enrolls in one Department.
5)Many Students pay fees in one Department (Finance)
An attribute is a characteristic of an entity.
Attributes of the entities in the ER Diagram are:
I)For entity 'Student'
II)For entity 'Teacher'
III)For entity 'Courses'
IV)For entity 'Department'
Identifier is a special attribute used to identify a specific instance of an entity.
Typically we look for unique identifiers.
Identifiers for this ER Diagram are:
1)S_no uniquely identifies 'Student'.
2)T_nm uniquely identifies 'Teacher'.
3)C_no uniquely identifies 'Courses'.
4)D_no uniquely identifies 'Department'.