Table of Contents
Data Base Management System
Introduction to Basic Terminology:
-
Data and information:
Data is defined as the raw facts and figures. It could be any numbers, alphabets or any combination of it.
When data are processed using a database program or software, they are converted to the meaningful result, called information.
-
Database:
It is a collection of related information about a subject organized in a useful manner that provides a base or foundation for procedure, such as retrieving information, drawing conclusions, and making decisions.
-
Data Base Management System:
A DBMS is a set of programs that manages the database files. It allows accessing the files, updating the records, and retrieving data as requested. The technique for designing a database using top-down methods is to write a main database parts that names all the major storage and retrievals it will need. Later, the programming team looks at the requirements of each of those database components and the process is repeated.
-
Field and record:
A column in a table is called a field and it contains specific pieces of information within a record.
A row in a table is called a record and it contains information about a person, event, etc. Another name for a record is tuple.
-
Data dictionary:
A data dictionary is a file that contains meta-data, which is data about data. It is also called an information system catalogue. It keeps all the data information about the database system such as location, size of the database, tables, records, fields, user information, recovery system, etc.
Advantages of Database Management System
- Sharing data
- Reduced data redundancy
- Data backup and recovery
- Inconsistency avoided
- Data integrity
- Data security
- Data independence
- Multiple user interfaces
- Process complex queries
Disadvantages of Database Management System:
- It is expensive. Everyone cannot afford it.
- It is a fast-changing technology.
- It is complex to understand and implement.
- It needs explicit backup.
DDL and DML (Important Question)
DDL
DDL is used by database designers and programmers to specify the content and structure of the table. It is used to define the physical characteristics of the record. It includes commands that manipulate the structure, such as object views, tables, and indexes, etc. Examples of these commands are: create, alter, drop, rename, etc.
DML
DML is related to manipulation activities such as retrieval, sorting, displaying, and deletion of records or data. It helps users to use queries and display reports of the table. So, it provides techniques for processing the database. It includes commands to manipulate the information stored in the database. Examples of these commands are in short: delete, select, and update, etc.
Different Database Models:
-
Hierarchical database model:
In this model, data is represented in the form of records. Each record has multiple fields. All records are arranged in the database as a tree-like structure. The relationship between the records is called parent-child relationship in which any child record relates to only a single parent-type record.
-
Network database model:
It replaced the hierarchical network database model due to some limitations on the model. Suppose, if an employee relates to two departments, then the hierarchical database model cannot arrange records in the proper place. So, the network database model emerged to arrange non-hierarchical databases. The structure of the database is more like a graph rather than a tree structure.
-
Relational database model (Important Question):
In this model, the data is organized into tables which contain multiple rows and columns. These tables are called relations. A row in a table represents a relationship among a set of values. Since a table is a collection of such relationships, it is generally referred to as the mathematical term relation, from which the relational database model derives its name.
Concept of Normalization (Important Question)
Normalization is your database design process in which a complex database table is broken down into simple separate tables. It makes the data model more flexible and easier to maintain. This process minimizes and controls the duplication of data in the database and also provides rapid data search capabilities. Additionally, it reduces the complexity of the database.
The two major goals of the normalization process are eliminating redundant data and ensuring data dependencies.
Types of Normalization
-
First Normal Form
First normal form sets the very basic rule of an organized database:
- The data field should be atomic.
- It eliminates duplicate rows and columns from the same table.
- It minimizes data redundancy in the database model.
If we consider a 1NF table like this:
Name Class Roll no. Section Subjects Marks Ram 12 2 A Maths 90 Shyam 11 1 B English 90 Hari 12 1 A Computer 90 Ram 12 2 A English 78 -
Second Normal Form
The table is in the second normal form if every non-key column depends on the entire key. To achieve this, you split the table and pull out the columns that depend on parts of the key. Remember to include that part of the key in the new table. The new table must have a key or ID that is present in both tables. Each attribute in the table must depend on the whole key. To construct 2NF, you need to build a 1NF table.
Table 1: Students Name Roll No. Class Section Ram 2 12 A Shyam 1 11 B Hari 1 12 A Table 2: Subjects Class Subjects 12 Maths 11 English 12 Computer Table 3: Marks Name Subjects Marks Ram English 90 Shyam English 90 Hari Computer 90 Ram Maths 78 -
Third Normal Form
The logical analysis and elements of designing for the third normal form are similar to those used in deriving 2NF. In particular, you still concentrate on the issue of dependence. To be in 3NF, a table must be in 2NF, and every non-key column must depend on nothing but the key.
Table 1: Class Table 2: Subjects Table 3: Students Table 4: Marks classid classname subjectid Subject stid Name Roll No. Class Section stid subjectid marks 1 11 1 English 1 Ram 2 12 A 1 1 78 2 12 2 Computer 2 Shyam 1 11 B 1 3 90 3 Maths 3 Hari 1 12 A 2 1 90 3 2 90
Advantages of Normalization
- Redundancy is reduced.
- Improves the performance of the database system.
- Avoids loss of information.
- Makes the database flexible and easier to maintain.
Difference between Centralized and Distributed Database System
Centralized Database System | Distributed Database System |
---|---|
Simple type | Complex type |
Located on a particular location | Located in many geographical locations |
Consists of only one server | Contains servers in several locations |
Suitable for small organizations | Suitable for large organizations |
Less chance of data loss | More chances of data hacking and loss |
Maintenance is easy and security is high | Maintenance is not easy and security is low |
Failure of the system makes the whole system down | Failure of one server does not make the whole system down |
There is no feature of load balancing | There is a feature of load balancing |
Data traffic rate is high | Data traffic rate is low |
Cost of centralized database system is low | Cost of distributed database system is high |
DBA and Responsibilities of DBA
DBA is the most responsible person in an organization with sound knowledge of DBMS. He/she is the overall administrator of the system and has the maximum amount of privileges (permission to access the database) for accessing the database, setting up the system, and defining the roles of the employees who use the system.
Responsibilities of DBA:
- DBA defines data security, schemas, forms, reports, relationships, and user privileges.
- DBA has the responsibility to install, monitor, and upgrade the database server.
- DBA provides different facilities for data retrieval and report generation as required.
- DBA is responsible for maintaining database security, backup-recovery strategy, and documentation of data recovery.
- DBA supervises all the activities in the system, including addition, modification, and deletion of data from the database.
State and Different Types of Data Integrity
Mainly, there are 3 types of data integrity constraints used in the database system:
- Domain Integrity Constraints: It defines a set range of data values for a given specific data field. It also determines whether null values are allowed or not in the data field.
- Entity Integrity Constraints: It specifies that all rows in a table have a unique identifier, known as the primary key value, and it must never be null.
- Referential Integrity Constraints: It exists in a relationship between two tables in a database. It ensures that the relationship between the primary keys in the master table and foreign keys in the child table is always maintained.