Database Management System (Question and Solutions)
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.
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.
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 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.
EMPLOYEE table:
The decomposition of the EMPLOYEE table into 1NF has been shown below:
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
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
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)
Qsn: Describe centralized and distributed database with advantages and dis-advantages.
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.
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.
8
Database Management System (Question and Solutions)
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.
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.
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: 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)
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 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.
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.
12
Database Management System (Question and Solutions)
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