DBMS Question Bank
DBMS Question Bank
DBMS Question Bank
MCQ QUESTIONS
Answer: d
Answer: c
Answer: d
Answer: d
Answer: c
Answer: b
Answer: d
Answer: d
Answer: d
10. Which of the following is known as a set of entities of the same type that share
same properties, or attributes?
a) Relation set
b) Tuples
c) Entity set
d) Entity Relation model
Answer: c
Answer: c
12. Which of the following is a set of one or more attributes taken collectively to
uniquely identify a record?
a) Primary Key
b) Foreign key
c) Super key
d) Candidate key
Answer: c
13. The ability to query data, as well as insert, delete, and alter tuples, is offered by
____________
a) TCL (Transaction Control Language)
b) DCL (Data Control Language)
c) DDL (Data Definition Langauge)
d) DML (Data Manipulation Langauge)
Answer: d
Answer: a
Answer: b
16. Which one of the following given statements possibly contains the error?
Answer: d
17. What do you mean by one to many relationships?
Answer: b
18. Which of the following refers to the level of data abstraction that describes exactly
how the data actually stored?
a) Conceptual Level
b) Physical Level
c) File Level
d) Logical Level
Answer: b
b) Database Administrator
c) Data Administrator
Answer: b
b) Fields
c) Database
d) Records
Answer: d
Descriptive Questions
2. Management complexity
Database systems interface with many different technologies and have a significant
impact on a company’s resources and culture. The changes introduced by the adoption
of a database system must be properly managed to ensure that they help advance the
company’s objectives. Given the fact that database systems hold crucial company data
that are accessed from multiple sources, security issues must be assessed constantly.
3. Maintaining currency
To maximize the efficiency of the database system, you must keep your system
current. Therefore, you must perform frequent updates and apply the latest patches
and security measures to all components.
Because database technology advances rapidly, personnel training costs tend to be
significant. Vendor dependence. Given the heavy investment in technology and
personnel training, companies might be reluctant to change database vendors.
As a consequence, vendors are less likely to offer pricing point advantages to existing
customers, and those customers might be limited in their choice of database system
components.
5. Data Administration: The DBMS provides tools for managing the database,
including tasks like backup and recovery, security management, user access
control, and performance optimization.
6. Database Schema: The database schema defines the structure of the database,
including tables, their columns, data types, relationships, and constraints. It acts as
a blueprint for the organization of data within the database.
7. Data Integrity: DBMS ensures data integrity by enforcing constraints and rules
on the data to maintain its accuracy and consistency. Common integrity
constraints include primary keys, foreign keys, unique constraints, and check
constraints.
8. Query Optimizer: The query optimizer is a crucial component responsible for
analyzing SQL queries and determining the most efficient execution plan. It aims
to minimize query execution time by choosing the optimal approach for accessing
data.
9. Transaction Management: DBMS supports transactions, which are sequences of
database operations that are executed as a single unit. Transactions ensure data
consistency and integrity, allowing for a rollback in case of failures or errors.
10. Concurrency Control: Concurrency control is responsible for managing multiple
user requests to access and modify data simultaneously. It prevents conflicts and
ensures that the data remains consistent even in multi-user environments.
11. Indexing: Indexes are data structures that enhance the speed of data retrieval
operations by providing quick access paths to specific data based on certain
columns. They optimize the performance of queries that involve search
conditions.
Relational Databases:
Relational databases are the most common type of databases used in various
applications. They use a tabular structure to store data, where data is organized into
rows and columns. Each table represents an entity, and the relationships between
entities are established using primary keys and foreign keys. Examples of relational
databases include MySQL, PostgreSQL, Oracle, and Microsoft SQL Server.
NoSQL Databases:
NoSQL (Not Only SQL) databases are designed to handle large-scale, unstructured,
or semi-structured data. They provide flexible schemas, allowing data to be stored in
various formats like key-value pairs, document-oriented, column-family, or graph-
based. NoSQL databases are well-suited for handling big data and real-time
applications. Popular NoSQL databases include MongoDB, Cassandra, Couchbase,
and Redis.
Object-Oriented Databases:
Object-oriented databases (OODBs) are designed to store and manage object-oriented
data models directly. They bridge the gap between programming languages and
databases, enabling objects to be stored, retrieved, and manipulated as they are,
without the need for mapping to a relational structure. OODBs are useful for object-
oriented applications where the data model aligns closely with the programming
model.
Graph Databases:
Graph databases are specialized databases that store and manage data in the form of
nodes, edges, and properties. They are used for handling highly interconnected data
and are especially effective for applications involving social networks,
recommendation systems, and knowledge graphs. Graph databases offer powerful
querying capabilities for traversing relationships between nodes. Examples include
Neo4j and Amazon Neptune.
Time-Series Databases:
Time-series databases are optimized for handling time-stamped data, such as IoT
sensor data, financial data, and monitoring data. They efficiently store and retrieve
data based on timestamps, allowing for fast and flexible time-based queries. Popular
time-series databases include InfluxDB, Prometheus, and OpenTSDB.
Spatial Databases:
Spatial databases are designed to store and manage spatial data, such as geographic
information system (GIS) data, maps, and location-based data. They support spatial
indexing and offer specialized spatial query functions to efficiently handle spatial
data. Examples include PostGIS (an extension for PostgreSQL) and Oracle Spatial.
XML Databases:
XML databases are specialized databases that store and manage XML (eXtensible
Markup Language) data. They are suitable for applications that handle XML-based
documents and need to query and manipulate XML data efficiently. Examples include
BaseX and eXist-db.
Columnar Databases:
Columnar databases store data in columns rather than rows, making them highly
efficient for analytical queries and data warehousing. They are optimized for handling
large volumes of data and aggregations. Examples include Google Bigtable and
Apache HBase.
Data Integration: The database approach promotes data integration by allowing data
from different sources and applications to be stored in a centralized database. This
enables efficient data sharing and eliminates data redundancy, leading to a single,
consistent view of the data across the organization.
Data Abstraction: The database approach employs data abstraction, which means
that users interact with the database using high-level, simplified views of the data.
This abstraction hides the complexities of data storage and retrieval, making it easier
for users to work with the data.
Data Integrity and Security: A robust DBMS enforces data integrity constraints,
ensuring that data remains accurate and consistent. It also provides mechanisms for
access control and user authentication, safeguarding the data from unauthorized
access and maintaining data security.
Backup and Recovery: DBMS provides mechanisms for data backup and recovery,
allowing organizations to create copies of the database at different points in time and
restore it to a previous state in case of data loss or system failure.
Data Independence: In the database approach, data is separated from the applications
that use it. This means that the structure and storage of data are independent of the
programs accessing it. It provides both logical data independence (ability to modify
the database schema without affecting the applications) and physical data
independence (ability to change the physical storage of data without impacting
applications).
Data Security: A database approach allows for centralized control of data security
and access permissions. Users can be granted specific privileges to perform certain
operations on the data, ensuring that sensitive information is protected.
Data Scalability: Modern DBMSs are designed to handle large volumes of data and
can scale to meet the growing demands of data storage and processing. This makes it
suitable for applications that deal with vast amounts of data, such as big data analytics
and real-time processing.
Data Backup and Recovery: DBMS provides mechanisms for data backup and
recovery, allowing organizations to create copies of the database at different points in
time and restore it to a previous state in case of data loss or system failure.
Database models play a crucial role in the design, implementation, and management of
databases. They provide a structured and systematic way to represent the data and its
relationships within the database, making it easier for users and developers to understand
and work with the data.
Network Model: Similar to the hierarchical model, the network model also represents
data with interconnected records. Records can have multiple parents and children,
forming a more complex graph-like structure.
Relational Model: The relational model is the most widely used database model
today. Data in the relational model is represented in tabular form, with rows as
records and columns as attributes. Relationships between entities are defined through
primary and foreign keys. Relational databases use SQL for data manipulation.
Columnar Model: The columnar model stores data in columns rather than rows,
making it highly efficient for analytical queries and data warehousing. It is optimized
for handling large volumes of data and aggregations.
Select: It shows the record of the specific table. Also, it can be used with a WHERE
clause to get the particular record.
Delete: It is used to delete records from the database tables. Also, it can be used with
a WHERE clause to delete a particular row from the table.
Revoke: It is used to revoke the access from the user that is being granted by the
grant command.
Interface
An interface is a program that allows users to input queries into a database without
writing the code in the query language. An interface can be used to manipulate the
database for adding, deleting, updating, or viewing the data.
Example
Student entering his roll. no, branch in the form to get the grade card.
Example
In a shopping website, categories are selected from the menu, brands are selected
from the menu of brands, and budget ranges are applied from the menu of budget
range.
Example
You liked a video on Instagram by tapping with your finger, and the color changes to
red. The visual graphic gets changed due to user action.
Natural Language Interface
A natural language interface contains its unique schema more like the high−level
conceptual schema. It also has a directory of important words. It generates a query
based on the interpretation of important words in the input by the user and if the
interpretation is successful, then it displays the result to the user.
Example
A user googled the fastest car in India, and now the natural language interface will
look for the important words i. e. fastest, car, India, and show the result accordingly.
Example
System designers and implementers: Design and implement DBMS packages in the
form of modules and interfaces and test and debug them. The DBMS must interface
with applications, language compilers, operating system components, etc.
Tool developers: Design and implement software systems called tools for modeling
and designing databases, performance monitoring, prototyping, test data generation,
user interface creation, simulation etc. that facilitate building of applications and
allow using database effectively.
Operators and maintenance personnel: They manage the actual running and
maintenance of the database system hardware and software environment.
Components of ER Diagram
Entity
An Entity may be an object with a physical existence – a particular person, car, house,
or employee – or it may be an object with a conceptual existence – a company, a job,
or a university course.
Entity Set: An Entity is an object of Entity Type and a set of all entities is called an
entity set. For Example, E1 is an entity having Entity Type Student and the set of all
students is called Entity Set. In ER diagram, Entity Type is represented as:
Entity Set
1. Strong Entity
A Strong Entity is a type of entity that has a key Attribute. Strong Entity does not
depend on other Entity in the Schema. It has a primary key, that helps in identifying it
uniquely, and it is represented by a rectangle. These are called Strong Entity Types.
2. Weak Entity
An Entity type has a key attribute that uniquely identifies each entity in the entity set.
But some entity type exists for which key attributes can’t be defined. These are
called Weak Entity types.
For Example, A company may store the information of dependents (Parents, Children,
Spouse) of an Employee. But the dependents don’t have existed without the employee.
So Dependent will be a Weak Entity Type and Employee will be Identifying Entity
type for Dependent, which means it is Strong Entity Type.
A weak entity type is represented by a Double Rectangle. The participation of weak
entity types is always total. The relationship between the weak entity type and its
identifying strong entity type is called identifying relationship and it is represented by
a double diamond.
Attribute
1. Key Attribute
The attribute which uniquely identifies each entity in the entity set is called the key
attribute. For example, Roll_No will be unique for each student. In ER diagram, the
key attribute is represented by an oval with underlying lines.
Key Attribute
2. Composite Attribute
An attribute composed of many other attributes is called a composite attribute. For
example, the Address attribute of the student Entity type consists of Street, City, State,
and Country. In ER diagram, the composite attribute is represented by an oval
comprising of ovals.
Composite Attribute
3. Multivalued Attribute
An attribute consisting of more than one value for a given entity. For example,
Phone_No (can be more than one for a given student). In ER diagram, a multivalued
attribute is represented by a double oval.
Multivalued Attribute
4. Derived Attribute
An attribute that can be derived from other attributes of the entity type is known as a
derived attribute. e.g.; Age (can be derived from DOB). In ER diagram, the derived
attribute is represented by a dashed oval.
Derived Attribute
The Complete Entity Type Student with its Attributes can be represented as:
Entity and Attributes
Relationship Type and Relationship Set
A Relationship Type represents the association between entity types. For example,
‘Enrolled in’ is a relationship type that exists between entity type Student and Course.
In ER diagram, the relationship type is represented by a diamond and connecting the
entities with lines.
Entity-Relationship Set
A set of relationships of the same type is known as a relationship set. The following
relationship set depicts S1 as enrolled in C2, S2 as enrolled in C1, and S3 as registered
in C3.
Relationship Set
Degree of a Relationship Set
The number of different entity sets participating in a relationship set is called
the degree of a relationship set.
1. Unary Relationship: When there is only ONE entity set participating in a relation,
the relationship is called a unary relationship. For example, one person is married to
only one person.
Unary Relationship
2. Binary Relationship: When there are TWO entities set participating in a
relationship, the relationship is called a binary relationship. For example, a Student is
enrolled in a Course.
Binary Relationship
3. n-ary Relationship: When there are n entities set participating in a relation, the
relationship is called an n-ary relationship.
Cardinality
The number of times an entity of an entity set participates in a relationship set is
known as cardinality. Cardinality can be of different types:
1. One-to-One: When each entity in each entity set can take part only once in the
relationship, the cardinality is one-to-one. Let us assume that a male can marry one
female and a female can marry one male. So the relationship will be one-to-one.
the total number of tables that can be used in this is 2.
One-to-One Cardinality
Using Sets, it can be represented as:
One to Many
Using sets, one-to-many cardinality can be represented as:
Set Representation of One-to-Many
3. Many-to-One: When entities in one entity set can take part only once in the
relationship set and entities in other entity sets can take part more than once in the
relationship set, cardinality is many to one. Let us assume that a student can take only
one course but one course can be taken by many students. So the cardinality will be n
to 1. It means that for one course there can be n students but for one student, there will
be only one course.
The total number of tables that can be used in this is 3.
Many-to-One Relationship
Using Sets, it can be represented as:
17. Draw and Explain the ER design for the company database