Datavbase
Datavbase
Database:
Database is a repository for collection of data or facts. It contains a collection of related items
or facts arranged in a specific structure.
Or
A file composed of records, each of which contains fields, together with a set of operations for
searching, sorting, recombining, and other functions.
Advantages of DBMS:
1. Database file can be share.
2. In database, the information appears just once so that data redundancy reduced.
Moreover, the same information is available to different users.
3. Reduced redundancy increases the chances of data integrity- the chances that data is
accurate, consistent and up to date- because each updating change is made in only one
place.
4. DBMS allows access to only valid user, hence it increases the security.
5. Programming time is saved
6. it is possible to obtain report for particular requirement
7. information can be obtained from the database
Information:
Information is the output of data or it is the processed form of raw data.
Data consists of facts, which become information when they are seen in context and convey
meaning to people.
Example total age of Students is: 35 year.
Objective of DBMS:
1. provide for mass storage device of relevant data
2. Making access to the data easy for the user.
3. Providing prompt responses to user request for data.
4. Making the latest modification to the database available immediately.
5. Eliminate redundant (duplicate) data.
6. Allow multiple users to be active at one time.
7. Allow the growth of database system
8. Protect the data from physical harm and unauthorized access.
Advantages:
It is the easiest model of database.
A database owner is more secured because nobody else can see and modify a child
without consulting to its parents.
Searching is fast and easy id parent is known.
Very efficient to handling “one to many” relationship.
Disadvantages:
It is old type of database model
Modification and addition of child without consulting the parent is very hard or
impossible. So it non flexible database model.
It can’t handle “many to many” relationships.
In increases redundancy.
Advantages:
More flexible than hierarchical because accepts many-to-many relationship.
Reduces redundancy because data shouldn’t be repeated if same type of data is needed.
Searching is faster because of multidirectional pointers.
Disadvantages:
Very complex type of database model.
Needs long program to handle the relationship.
Pointer needed in the database model increases overhead of storage.
Less secure in comparison to hierarchical model.
Advantages:
Since one table is linked with other with some common fields, rules implemented on
one table can easily be implemented to other.
Some rules, popularly known as referential integrity, can easily be implemented.
Very less redundancy.
Normalization of database is possible
Rapid database processing is possible.
Disadvantages:
2
It is more complex than other.
Too many rules makes database non user friendly.
Fields:
Fields contain one piece of information of entry. Each unique type of information is stored in
its own fields. Example: In address book each entry has fields for first, middle, last name.
Record:
One full set of fields i.e. all the related information about one person or object is called record.
Table:
A complete collection of records is called a table. A table contains rows and columns.
Each row represents records and column of tables represents fields.
Attributes:
They are descriptive properties processed by each member of an entity. They are also called
element, property or fields.
Each attribute are defined in terms of three properties namely data type, domain, and default.
Eg: Student_roll_no, Student_name, and Student_contact_no
Key:
A key is an attribute or set of attributes whose values uniquely identify each entity instances in
an entity is called a key for that entity.
Example is on the above attributes student_ID_no is key because each students are identified
by this unique ID. That’s why no students can have the same student_ID_no like in prime
students ID card.
Primary Key:
A primary key is that candidate key which will most commonly be used uniquely to identify a
single entity instances. For example registration number in the TU can be chosen as primary
key in the entity of students.
Foreign key:
Foreign Key is the key in one able always matches the primary key in another table.
Relationships:
A relationship is a natural business association that exists between one or more entities. The
relationships may represent an event that links the entities or merely a logical affinity
(likeness) that exists between the entities.
3
A relationship implies that instances of one entity are related to instances of another entity.
There are four different types of relationships:
1. One to one Eg. driver and car
2. one to many Eg. Teacher and students
3. many to many Eg. Books and readers
4. many to one Eg. Students and school
What is RDBMS?
It is the DBMS in which relation between different tables can be formed using a common field
(or attribute) in those table to draw a relation in between is called relational database
management system (RDBMS).
What is Normalization?
Normalization is the process of organizing data in a database to reduce the redundancies. The
process of normalization includes both creating tables and establishing relationship between
those tables using rules designed to protect the data and to make the database more flexible. It
eliminates the redundancies. There are different types of normalization are present namely:
1NF, 2NF, 3NF etc (Figure and example will be discussed on class)
Database Languages:
Instances:
Database changes over time. The collection of information stored in the database at a particular
moment is called as instances of the database.
Schema:
Overall design of the database is called scheme or schema. Schema are changed frequently.
Data dictionary: A data dictionary is a file that contains that is data about data.
4
Query is more powerful type of filter that can gather information from multiple table in a
relational database.
Eg:
SELECT name, phno
FROM student_table
WHERE section=”C”
Some database system provide special window or forms for creating queries.
SQL allows user to query a database without much knowing about the underlying database.
SQL is powerful tool, most of the PC based DBMS have the SQL query tool but they can have
some variation of the SQL with some extra feature e.g. ORACLE, SYBASE, MySQL etc.
Centralized Database:
It works on a client /server basis. They are located on a particular location. The controlling
mechanism is also centralized and data are deposited in central location.
Security is not vital part. It is suitable for small organization.
Distributed database:
It is dispersed across many geographical locations. Data communication is harder because they
should communicate through different system to different platforms. Security is very much
vital parts. Files are maintained location independent and maintained on the basis of name.
These types of database are maintained on large organizations.