unit 1 DMS-1
unit 1 DMS-1
Database
Management System
Total marks: 8 marks
Short question: 5 marks
MCQ : 1 marks
1.1 Introduction to data, Information, database, Database
system, DBMS
Data
Data are the raw facts and figures that can be obtained after some
experiments or observations. Each piece of data is a little fact that
doesn’t mean much on its own.
Raw data is of no use until and unless we process it to find some useful
information from it.
It is the unprocessed data, that contains numbers, statements and
characters before it is refined by the researcher
Information:
The processed data which gives some or complete meaning is called
information.
Information is organized or classified data, which has some meaningful
values for the receiver.
Data processing cycle:
Data processing is the re-structuring or re-ordering of data by people or
machine to increase their usefulness and add values for a particular
purpose.
A Database
A database is a collection of interrelated information that is organized so
that it can be easily accessed, managed and updated.
Database is actually a place where related piece of information is stored
and various operations can be performed on it. Data gets updated,
expanded and deleted as new information is added.
For example, university database for maintaining information about
students, courses and grades in university.
Database Management System
Management of data involves a way to store data and also provides a
mechanism for manipulation of that data. Database management
systems are basically designed to manage large volume of information
It also helps to control access to the database.
A database system is basically just a computerized record-keeping
system.
The primary goal of DBMS is to store and retrieve data in both
convenient (easy method) and efficient (capable of performing well)
manner.
Some of the examples of DBMS are Oracle, SQL-Server, MySQL, MS
Access etc.
A database management system (DBMS) consists of several components. Each
component plays very important role in the database management system environment. The
major components of database management system are:
Software
Hardware
Data
Procedures
User
1.2 Field, Record, Objects, Primary Key, Alternate key, Candidate key
Field(attributes)
A table consists of several records(row); each record can be broken into
several smaller entities known as Fields.
The below Employee table consist of four fields, ID, Name, Age and Salary.
Record(tuples)
A single entry in a table is called a Record or Row.
A Record in a table represents set of related data.
Object
A database object is any defined object in a database that is used to store or reference
data. Anything which we make from create command is known as Database Object. It
can be used to hold and manipulate the data. Some of the examples of database objects
are : view, sequence, indexes, etc.
• Basic command present in DDL are • BASIC command present in DML are
CREATE, DROP, RENAME, ALTER etc. UPDATE, INSERT, MERGE etc.
• DDL does not use WHERE clause in its • While DML uses WHERE clause in its
statement. statement.
Procedural DML: it requires a user to specify what data are needed and how to get
those data.
Non-Procedural DML: it requires a user to specify what data are needed without
specifying how to get those data.
1.5 Database Model: Network Model, Hierarchical
Model, Relational database model
A database model defines the logical design and structure of
a database and defines how data will be stored , accessed
and updated in a DBMS.
Network Database Model
A network database model is a database model that allows multiple
records to be linked to the same owner file.
The model can be seen as an upside down tree where the branches
are the member information linked to the owner, which is the
bottom of the tree.
The multiple linkages which this information allows the network
database model to be very flexible. In addition, the relationship that
the information has in the network database model is defined as
many-to-many relationship because one owner file can be linked to
Network Database Model
Advantage:
1. more flexible than hierarchicial database model because it accept
many to many relationship.
2. searching is faster of multidirectional pointers.
3. promotes database integrity
4. data independences
Disadvantage:
5. less secure than hierarchical as it is open to all
6. need long program to handle relationship
7. pointer is used in this database and that increased the overhead
storage
8. lack of structural independences.
Hierarchical Database Model
A hierarchical model represents the data in a tree-like structure in which there is
a single parent for each record. To maintain order there is a sort field which keeps
sibling nodes into a recorded manner. These types of models are designed
basically for the early mainframe database management systems, like the
Information Management System (IMS) by IBM.
This model structure allows the one-to-one and a one-to-many relationship
between two/ various types of data. This structure is very helpful in describing
many relationships in the real world; table of contents, any nested and sorted
information.
Hierarchical Database Model
Advantages:
1. it is the easiest model of database
2. it is secure model as nobody can modify the child without consulting to
its parent.
3. searching is fast and easy as parent is known
4. very efficient in handlimg one to many relationship
Disadvantages:
5. it is old fashion , outdated database model.
6. modification and addition of child without consulting its parent is
imposible.
7. cannot handle many to many relationships.
8. increase redundancy
9. it doesnot support flexible data access , because data can be accessed
only by following the path down the tree structure.
Relational Database Model
In this model, data is organized in two-dimensional tables and the relationship is maintained by storing
a common field.
This model was introduced by E.F Codd in 1970, and since then it has been the most widely used
database model, infact, we can say the only database model used around the world.
The basic structure of data in the relational model is tables. All the information related to a particular
type is stored in rows of that table. Hence, tables are also known as relations in relational model.
Relational Database Model
Advantage:
1. very less redundancy of data in this model
2. normalization of database is possible in this model.
3. quick database processing is possible.
4. since one table will link with another with common key field , the rule is
implemented in one table can easily be implemented in another.
Disadvantage:
5. this model uses the complex data structure to store the so it is more
complex than other models.
6. too many rules makes database non-user friendly.
1.6 Concept of Normalization: 1NF, 2NF, 3NF
Normalization
Normalization is the process of breaking down a table into larger number of small
tables to preserve the loss of data and removes unnecessary data.
Normalization is used to minimize the redundancy from a relation or set of
relations. It is also used to eliminate the undesirable characteristics like Insertion,
Update and Deletion
Normalization divides the larger table into the smaller table and links them using
relationship.
Here, we rearrange the table and created a new table to form a 1NF.
Course Subject
111 Maths
111 Physics
222 Biology
333 Chemistry
Second Normal Form
To be in second normal form, a relation must be in first normal form and relation
must not contain any partial dependency.
A relation is in 2NF if it has No Partial Dependency, i.e., no non-prime attribute
(attributes which are not part of any candidate key) is dependent on any proper
subset of any candidate key of the table.
Rule 1- Be in 1NF
Rule 2- It should not have any partial dependencies. i.e. every non key attribute
should be fully functionally dependent on the primary key.
2NF (Second Normal Form) Rules
Rule 1- Be in 1NF
Rule 2- It should not have any partial dependencies. i.e. every non key attribute
should be fully functionally dependent on the primary key.
IDStu IDProf Stu_name Prof_name
S1 P1 Bijay Oli
S2 P2 Rajiv Prachanda
S3 P3 Kamal Baburam