You are on page 1of 13

Database Management System (Question and Solutions)

Qsn: What do you understand by the term data integrity? Why it is an important thing to be
considered while designing a database.
Qsn: Explain the data integrity with example.
Ans: Data integrity is the overall accuracy, completeness, and consistency of data. Data integrity also
refers to the safety of data in regard to regulatory compliance such as security. It is maintained by a
collection of processes, rules, and standards implemented during the design phase. When the
integrity of data is secure, the information stored in a database will remain complete, accurate, and
reliable no matter how long it’s stored or how often it’s accessed.

Data is now more important than ever and most companies have set specific goals for their data. But
without integrity, data is not of much use. Moreover, data loss, corrupted or compromised data can
considerably damage your business. Ensuring data security has become a number one concern of
many organizations.

Data integrity can be compromised in many different ways. Data is mostly digital and is transferred
online in a number of places,. This results in an increasing amount and varied types of data being
collected.

Qsn: State and describe different types of data integrity.


Ans: Types of data integrity are as follows:-
1. Physical Integrity
Protecting data against external factors, such as natural calamities, power outages, or hackers
falls under the domain of physical integrity. Moreover, human faults, storage attrition, and several
other problems can make it unmanageable for data operators to obtain information from a
database.
2. Logical Integrity
It concerns the rationality of data present within the relational database. Logical integrity
constraints can be categorized into four types:
a. Entity Integrity
It depends on the making of primary keys or exclusive values that classify data items. The
purpose is to ensure that data is not recorded multiple times (i.e., each data item is unique),
and the table has no null fields.
Entity integrity is a critical feature of a relational database that stores data in a tabular
format, which can be interconnected and used in various ways.
b. Referential Integrity
It denotes a series of procedures that ensure proper and consistent storage and usage of
data. Referential integrity ensures that only the required alterations, additions, or removals
happen via rules implanted into the database’s structure about how foreign keys are used.
These rules might include conditions that remove duplicate data records, warrant that data
is precise, and/or prohibit recording data that is unsuitable.
c. Domain Integrity
It’s an assortment of procedures that ensures the precision of every data item is maintained
in a domain. Here, a domain is defined as a set of suitable values that a column is
permitted to enclose.

1
Database Management System (Question and Solutions)

Domain integrity encompasses rules and other processes that restrict the format, type, and
volume of data recorded in a database. It ensures that every column in a relational
database is in a defined domain.
d. User-Defined Integrity
It comprises the rules defined by the operator to fulfill their specific requirements. At times
entity, referential, and domain integrity are not enough to refine and secure data. Time in
time again, particular business rules must be considered and integrated into data integrity
processes to meet enterprise standards.

Qsn: What is data security ? How it can be implemented?


Qsn: What is data security? Explain.
Ans: Data security is the practice of protecting digital information from unauthorized access,
corruption, or theft throughout its entire lifecycle. It’s a concept that encompasses every aspect of
information security from the physical security of hardware and storage devices to administrative and
access controls, as well as the logical security of software applications. It also includes organizational
policies and procedures.
Data security is a set of standards and technologies that protect data from intentional or accidental
destruction, modification or disclosure. Data security can be applied using a range of techniques and
technologies, including administrative controls, physical security, logical controls, organizational
standards, and other safeguarding techniques that limit access to unauthorized or malicious users or
processes.
Data security can be implemented by using various tools and techniques like Access Controls,
Authentication, Backups & Recovery, Encryption.

Qsn: Describe the normalization in database.


Ans: Normalization is the process of organizing the data in the database. 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 Anomalies. Normalization divides the larger table
into the smaller table and links them using relationship. The normal form is used to reduce
redundancy from the database table.
Database normalization is a process used to organize a database into tables and columns. There are
three main forms: first normal form , second normal form, and third normal form.

Qns: What are 1NF and 2NF normalization principle in database? Explain.
Qsn: What is normalization? Explain first and second normal form with example.
Ans: First Normal Form (1NF)

o A relation will be 1NF if it contains an atomic value.

o It states that an attribute of a table cannot hold multiple values. It must hold only single-valued
attribute.

2
Database Management System (Question and Solutions)

o First normal form disallows the multi-valued attribute, composite attribute, and their
combinations.

Example: Relation EMPLOYEE is not in 1NF because of multi-valued attribute EMP_PHONE.

EMPLOYEE table:

EMP_ID EMP_NAME EMP_PHONE


14 John 7272826385,
9064738238
20 Harry 8574783832
12 Sam 7390372389,
8589830302

The decomposition of the EMPLOYEE table into 1NF has been shown below:

EMP_ID EMP_NAME EMP_PHONE


14 John 7272826385
14 John 9064738238
20 Harry 8574783832
12 Sam 7390372389
12 Sam 8589830302

Second Normal Form (2NF)

o In the 2NF, relational must be in 1NF.

o In the second normal form, all non-key attributes are fully functional dependent on the primary
key

Example: Let's assume, a school can store the data of teachers and the subjects they teach. In a
school, a teacher can teach more than one subject.

TEACHER table

TEACHER_ID SUBJECT TEACHER_AGE


47 English 35
83 Math 38
83 Computer 38

In the given table, non-prime attribute TEACHER_AGE is dependent on TEACHER_ID which is a


proper subset of a candidate key. That's why it violates the rule for 2NF.

To convert the given table into 2NF, we decompose it into two tables:

3
Database Management System (Question and Solutions)

TEACHER_DETAIL table:

TEACHER_ID TEACHER_AGE
47 35
83 38

TEACHER_SUBJECT table:

TEACHER_ID SUBJECT
47 English
83 Math
83 Computer

Qsn: Define DML and DDL with example.


Ans: DDL
DDL is Data Definition Language and is used to define the structures like schema, database, tables,
constraints etc. Examples of DDL are create and alter statements.
Example:
CREATE TABLE Persons(
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255)
);
DML
DML is Data Manipulation Language and is used to manipulate data. Examples of DML are insert,
update and delete statements.
Following are the important differences between DDL and DML.
Example:
INSERT INTO Persons VALUES (1, 'Ram', 'Chaudhary', 'Dang');
Below is the table for difference between DDL and DML:-
DDL DML
Data Definition Language (DDL) helps you to Data Manipulation Language (DML command) allows
define the database structure or schema. you to manage the data stored in the database.
DDL command is used to create the database DML command is used to populate and manipulate
schema. database

4
Database Management System (Question and Solutions)

CREATE, ALTER, DROP, TRUNCATE AND INSERT, UPDATE, DELETE, MERGE, CALL, etc.
COMMENT and RENAME, etc.
It defines the column of the table. It adds or updates the row of the table
DDL statements affect the whole table. DML effects one or more rows.
SQL Statement can’t be rollback SQL Statement can be a rollback

Qsn: What is Hierarchical database model? List out the advantages and disadvantages of
Hierarchical database model.
Qsn: Describe any two database model with diagram.
Ans: Below are two database model with example:
example:-
Hierarchical Model
This database model organises data into a treetree-like-structure,
structure, with a single root, to which all the other
data is linked. The heirarchy starts from the Root data, ta, and expands like a tree, adding child nodes to
the parent nodes.
In this model, a child node will only have a single parent node.
This model efficiently describes many real
real-world
world relationships like index of a book, recipes etc.
In hierarchical model, data
ata is organised into tree
tree-like structure with one one-to-many
many relationship
between two different types of data, for example, one department can have many courses, many
professors and of-course
course many students.

Relational Model
In this model, data is organised in twotwo-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.

5
Database Management System (Question and Solutions)

Hence, tables are also known as relations in relational model.

Qsn: Describe centralized and distributed database with advantages and dis-advantages.

Ans:1. Centralized Database :

A centralized database is basically a type of database that is stored, located as well as maintained
at a single location only. This type of database is modified and managed from that location itself.
This location is thus mainly any database system or a centralized computer system. The
centralized location is accessed via an internet connection (LAN, WAN, etc). This centralized
database is mainly used by institutions or organizations.

6
Database Management System (Question and Solutions)

Advantages –
 Since all data is stored at a single location only thus it is easier to access and coordinate data.
 The centralized database has very minimal data redundancy since all data is stored in a single
place.
 It is cheaper in comparison to all other databases available.
Disadvantages –
 The data traffic in the case of centralized database is more.
 If any kind of system failure occurs at the centralized system then the entire data will be
destroyed.

2. Distributed Database :

A distributed database is basically a type of database which consists of multiple databases that are
connected with each other and are spread across different physical locations. The data that is
stored on various physical locations can thus be managed independently of other physical
locations. The communication between databases at different physical locations is thus done by a
computer network.

Advantages –
 This database can be easily expanded as data is already spread across different physical
locations.
 The distributed database can easily be accessed from different networks.
 This database is more secure in comparison to centralized database.
Disadvantages –
 This database is very costly and it is difficult to maintain because of its complexity.
 In this database, it is difficult to provide a uniform view to user since it is spread across
different physical locations.

Qsn: What is DBMS? Differentiate between centralized and distributed database.


Ans: A database management system (DBMS) is a software package designed to define, manipulate,
7
Database Management System (Question and Solutions)

retrieve and manage data in a database. A DBMS generally manipulates the data itself, the data
format, field names, record structure and file structure. It also defines rules to validate and manipulate
this data.

Difference between centralized and distributed database are as follows:-

Qsn: List out the objectives of DBMS.


Ans: The objectives of DBMS can be narrated as follows:
1. Eliminate redundant data.
2. Make access to the data easy for the user.
3. Provide for mass storage of relevant data.
4. Protect the data from physical harm and un-authorised systems.
5. Allow for growth in the data base system.
6. Make the latest modifications to the data base available immediately.
7. Allow for multiple users to be active at one time.
8. Provide prompt response to user requests for data.

8
Database Management System (Question and Solutions)

Qsn: What are the advantages of RDBMS.


Qsn: What is Relational database model? List the advantages and disadvantages of Relational
database model
Ans: A Relational database is a kind of management system in which tables are used to store data.
It is the most preferred way for software developers to store complex data. Once the data is stored
inside the table, it can be retrieved anytime.

Relational data model is the primary data model, which is used widely around the world for data
storage and processing. This model is simple and it has all the properties and capabilities required to
process data with storage efficiency.

Advantages and Disadvantages of Relational database model are as follows:-


Advantages:-

 Simplicity: A Relational data model in DBMS is simpler than the hierarchical and network
model.
 Structural Independence: The relational database is only concerned with data and not with a
structure. This can improve the performance of the model.
 Easy to use: The Relational model in DBMS is easy as tables consisting of rows and columns
are quite natural and simple to understand
 Query capability: It makes possible for a high-level query language like SQL to avoid complex
database navigation.
 Data independence: The Structure of Relational database can be changed without having to
change any application.
 Scalable: Regarding a number of records, or rows, and the number of fields, a database
should be enlarged to enhance its usability.

Disadvantages:-

 Few relational databases have limits on field lengths which can’t be exceeded.
 Relational databases can sometimes become complex as the amount of data grows, and the
relations between pieces of data become more complicated.
 Complex relational database systems may lead to isolated databases where the information
cannot be shared from one system to another.

Qsn: Describe the terms 'SQL'. Why SQL is so popular


Ans: SQL is Structured Query Language, which is a computer language for storing, manipulating and
retrieving data stored in a relational database.

9
Database Management System (Question and Solutions)

SQL is the standard language for Relational Database System. All the Relational Database
Management Systems (RDMS) like MySQL, MS Access, Oracle e.t.c. use SQL as their standard
database language.
SQL is widely popular because it offers the following advantages −
 Allows users to access data in the relational database management systems.
 Allows users to describe the data.
 Allows users to define the data in a database and manipulate that data.
 Allows users to create and drop databases and tables.
 Allows users to create view, stored procedure, functions in a database.
 Allows users to set permissions on tables, procedures and views

Qsn: What is normalization? Write the advantages of normalization.


Ans: Normalization is the process of organizing the data in the database. 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 Anomalies. Normalization divides the larger table
into the smaller table and links them using relationship. The normal form is used to reduce
redundancy from the database table.
Database normalization is a process used to organize a database into tables and columns. There are
three main forms: first normal form , second normal form, and third normal form.
The advantages of normalization are as follows:-
Advantages:-
1) A smaller database can be maintained as normalization eliminates the duplicate data. Overall size
of the database is reduced as a result.
2) Better performance is ensured which can be linked to the above point. As databases become
lesser in size, the passes through the data becomes faster and shorter thereby improving response
time and speed.
3) Narrower tables are possible as normalized tables will be fine-tuned and will have lesser columns
which allows for more data records per page.
4) Fewer indexes per table ensures faster maintenance tasks (index rebuilds).
5) Also realizes the option of joining only the tables that are needed.

Qsn: Who is database administrator (DBA)? List the roles of database administrator.
Ans: A Database Administrator (DBA) is a person or a group of person who are responsible for
managing all the activities related to database system. This job requires a high level of expertise by a
person or group of person. There are very rare chances that only a single person can manage all the
database system activities so companies always have a group of people who take care of database
system.

10
Database Management System (Question and Solutions)

Roles of database administrator are as follows:-

 Creates and maintains all databases required for development, testing, education and
production usage.
 Performs ongoing tuning of the database instances.
 Install new versions of the RDBMS and its tools and any other tools that access the database.
 Plans and implements backup and recovery of the database.
 Controls migrations of programs, database changes, reference data changes and menu
changes through the development life cycle.
 Implements and enforces security for all of the Databases.
 Provides technical support to application development teams. This is usually in the form of a
help desk. The DBA is usually the point of contact for Corporation.
 Enforces and maintains database contraints to ensure integrity of the database.
 Assists with impact analysis of any changes made to the database objects.
 Troubleshoots with problems regarding the databases, applications and development tools.
 Create new database users as required.
 Manage sharing of resources amongst applications.
 The DBA has ultimate responsibility for the physical database design.

Qsn: What are the skills required by DBA


Ans:Skills required by DBA are as follows:-
1. A good knowledge of the operating system(s)
2. A good knowledge of physical database design
3. Excellent knowledge of backup and recovery scenarios.
4. Good skills in all database management tools.
5. A good knowledge of database security management.
6. A good knowledge of how database acquires and manages resources.
7. Experience and knowledge in migrating code, database changes, data and menus through the
various stages of the development life cycle.

Qsn: What is database? List out the advantages of Database Management System.
Ans: A database is an organized collection of structured information, or data, typically stored
electronically in a computer system. A database is usually controlled by a database management
system (DBMS). Together, the data and the DBMS, along with the applications that are associated
with them, are referred to as a database system, often shortened to just database.
Data within the most common types of databases in operation today is typically modeled in rows and
columns in a series of tables to make processing and data querying efficient. The data can then be
easily accessed, managed, modified, updated, controlled, and organized. Most databases use
structured query language (SQL) for writing and querying data.

Advantages of Database Management System are as follows:-

 It represents complex relationships among different data item.


 Keep a tight control on data redundancy.
11
Database Management System (Question and Solutions)

 Maintains data dictionary for the storage of information.


 Ensures that data can be shared across all applications
 It has an automatic intelligent backup and recovery procedure of data.
 It has different interfaces, through which users can manipulate data.

Qsn: What is RDBMS? List out the function of RDBMS.


Ans: A Relational database is a kind of management system in which tables are used to store data. It
is the most preferred way for software developers to store complex data. Once the data is stored
inside the table, it can be retrieved anytime.

Relational data model is the primary data model, which is used widely around the world for data
storage and processing. This model is simple and it has all the properties and capabilities required to
process data with storage efficiency.

Functions of RDBMS are as follows:-


1. Easier access of data
2. Better security for the protection of data.
3. Representation of all types of relationships.
4. Data redundancy is reduced.
5. Faster and efficient searching of required data.
6. Concurrent access of Data.
7. Providing user interface to access data.
8. Maintaining integrity by enforcing standards.

Qsn: What is DBMS? List out the functions of DBMS.


Ans: DBMS software primarily functions as an interface between the end user and the database,
simultaneously managing the data, the database engine, and the database schema in order to
facilitate the organization and manipulation of data.
Functions of DBMS are as follows:-
1. Data Dictionary Management
2. Data Storage Management
3. Data Transformation and Presentation
4. Security Management
5. Multi user Access Control
6. Backup and Recovery Management
7. Data Integrity Management
8. Database Access Languages andApplication Programming Interfaces and
9. Database Communication interfaces.

12
Database Management System (Question and Solutions)

Qsn: Differentiate between DBMS and RDBMS with examples.


Ans: Difference between DBMS and RDBMS are as follows:-

1. Database Management System (DBMS) is a software that is used to define, create and
maintain a database and provides controlled access to the data. Relational Database
Management System (RDBMS) is an advanced version of a DBMS.
2. DBMS stores data as a file whereas in RDBMS, data is stored in the form of tables.
3. DBMS supports single users, while RDBMS supports multiple users.
4. DBMS does not support client-server architecture but RDBMS supports client-server
architecture.
5. DBMS has low software and hardware requirements whereas RDBMS has higher hardware
and software requirements.
6. In DBMS, data redundancy is common while in RDBMS, keys and indexes do not allow
data redundancy.

Qsn: What is database? List the major uses of database application software
Ans: A database is an organized collection of structured information, or data, typically stored
electronically in a computer system. A database is usually controlled by a database management
system (DBMS). Together, the data and the DBMS, along with the applications that are associated
with them, are referred to as a database system, often shortened to just database.
Major uses of database application software are as follows:-
1. Effective and efficient management of data
2. Query processing and management
3. Easy to understand and user friendly
4. Security and integrity of data
5. Better Decision making
6. Data sharing and storage
7. Better access to accurate data
8. Ensures error free information

13

You might also like