0% found this document useful (0 votes)
15 views14 pages

DBMS 1

Uploaded by

poundrikmanisha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views14 pages

DBMS 1

Uploaded by

poundrikmanisha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Question Bank

1/9. What are different data models of DBMS? Explain in detail?


Ans: Data Model is the modelling of the data description, data semantics,
and consistency constraints of the data. It provides the conceptual tools for
describing the design of a database at each level of data abstraction.
Therefore, there are following four data models used for understanding the
structure of the database:
Hierarchical Model
The hierarchical data model is one of the oldest data models, developed in
the 1950s by IBM. In this data model, the data is organized in a hierarchical
tree-like structure. This data model can be easily visualized because
each record in DBMS has one parent and many children (possibly 0).
Network Model
A network model is nothing but a generalization of the hierarchical data
model as this data model allows many to many relationships therefore in
this model a record can also have more than one parent.
The network model in DBMS can be represented as a graph and hence it
replaces the hierarchical tree with a graph in which object types are the
nodes and relationships are the edges.
Entity-Relationship Model (ER Model)
An Entity-Relationship model is a high-level data model that describes
the structure of the database in a pictorial form which is known as ER-
diagram. In simple words, an ER diagram is used to represent logical
structure of the database easily.
ER model develops a conceptual view of the data hence it can be used as
a blueprint to implement the database in the future.
Relational Model
This is the most widely accepted data model. In this model, the database is
represented as a collection of relations in the form of rows and columns of
a two-dimensional table. Each row is known as a tuple (a tuple contains all
the data for an individual record) while each column represents
an attribute.
Object-Oriented Data model
As suggested by its name, the object-oriented data model is a combination
of object-oriented programming and relational data model. In this data
model, the data and their relationship are represented in a single structure
which is known as an object.
Since data is stored as objects we can easily store audio, video, images, etc
in the database which was very difficult and inconvenient to do in the
relational model
Object Relational Data Model
Again as suggested by its name, the object-relational data model is an
integration of the object-oriented model and the relational model. Since it
inherits properties from both of the models it supports objects, classes, etc
like object-oriented models, and tabular structures like the relational model.
2. What is database management system? What are major components of
this system? Explain each component with neat sketch.
Ans: A Database Management System (DBMS) is software that interacts
with end-users, applications, and the database itself to capture, store, and
retrieve data. It provides an interface for users and applications to interact
with databases, ensuring data is organized, stored, and accessed efficiently.
The DBMS also handles tasks like data security, integrity, and concurrency
control.
Major Components of a DBMS
1. Hardware
o Here the hardware means the physical part of the DBMS. Here the
hardware includes output devices like a printer, monitor, etc., and
storage devices like a hard disk.
o In DBMS, information hardware is the most important visible part. The
equipment which is used for the visibility of the data is the printer,
computer, scanner, etc. This equipment is used to capture the data and
present the output to the user.
o With the help of hardware, the DBMS can access and update the
database.
o The server can store a large amount of data, which can be shared with
the help of the user's own system.
2. Software
o Software is the main component of the DBMS.
o Software is defined as the collection of programs that are used to
instruct the computer about its work. The software consists of a set of
procedures, programs, and routines associated with the computer
system's operation and performance. Also, we can say that computer
software is a set of instructions that is used to instruct the computer
hardware for the operation of the computers.
o The software includes so many software like network software and
operating software. The database software is used to access the
database, and the database application performs the task.
o Some examples of DBMS software include MySQL, Oracle, SQL Server,
dBase, FileMaker, Clipper, Foxpro, Microsoft Access, etc.
3. Data
o The term data means the collection of any raw fact stored in the
database. Here the data are any type of raw material from which
meaningful information is generated.
o The database can store any form of data, such as structural data, non-
structural data, and logical data.
o The structured data are highly specific in the database and have a
structured format. But in the case of non-structural data, it is a collection
of different types of data, and these data are stored in their native
format.
o We also call the database the structure of the DBMS. With the help of
the database, we can create and construct the DBMS. After the creation
of the database, we can create, access, and update that database.
o The main reason behind discovering the database is to create and
manage the data within the database.
o For example, when the user stores the data in a database, some data,
such as the size of the data, the name of the data, and some data related
to the user, are stored within the database. These data are called
metadata.
4. Procedures
o The procedure is a type of general instruction or guidelines for the use of
DBMS. This instruction includes how to set up the database, how to
install the database, how to log in and log out of the database, how to
manage the database, how to take a backup of the database, and how to
generate the report of the database.
o In DBMS, with the help of procedure, we can validate the data, control
the access and reduce the traffic between the server and the clients. The
DBMS can offer better performance to extensive or complex business
logic when the user follows all the procedures correctly.
o The main purpose of the procedure is to guide the user during the
management and operation of the database.
5. Database Access Language
o Database Access Language is a simple language that allows users to write
commands to perform the desired operations on the data that is stored
in the database.
o Database Access Language is a language used to write commands to
access, upsert, and delete data stored in a database.
o Users can write commands or query the database using Database Access
Language before submitting them to the database for execution.
1. Data Definition Language(DDL):It is used to construct a database. DDL
implements database schema at the physical, logical, and external levels.
The following commands serve as the base for all DDL commands:
o ALTER ,COMMENT , CREATE , DESCRIBE , DROP , USE
2. Data Manipulation Language(DML): It is used to access a database. The
DML provides the statements to retrieve, modify, insert and delete the data
from the database.
The following commands serve as the base for all DML commands:
o INSERT , UPDATE , DELETE , LOCK , CALL
3. Explain ER model with suitable Example.
Ans : The Entity-Relationship (ER) model is a conceptual framework used to
design databases at a high level of abstraction. It represents data in terms of
entities, attributes, and relationships between entities. This model is
especially useful in the database design phase, providing a blueprint that
can later be implemented in a relational database.
Components of the ER Model
1. Entity
o An entity is an object or thing in the real world that is
distinguishable from other objects.
o Types:
 Strong Entity: Exists independently and can be uniquely
identified.
 Weak Entity: Depends on another entity and cannot be
uniquely identified without it.
o Example: A "Student" in a university system or "Course" offered by
the university.
2. Attributes
o Attributes describe properties or characteristics of an entity.
o Types:
 Simple Attribute: Cannot be divided further (e.g., Student
Name).
 Composite Attribute: Can be divided into sub-parts (e.g.,
Full Name can be divided into First Name and Last Name).
 Derived Attribute: Can be derived from other attributes
(e.g., Age derived from Date of Birth).
 Multi-valued Attribute: Can have more than one value (e.g.,
Phone Numbers).
o Example: A "Student" entity might have attributes like Student ID,
Name, Date of Birth, and Email.
3. Relationships
o A relationship describes how two or more entities are related to
each other.
o Types:
 One-to-One (1:1): Each entity in one set is related to at
most one entity in another set.
 One-to-Many (1:M): An entity in one set can be related to
multiple entities in another set.
 Many-to-Many (M:N): Entities in both sets can be related to
multiple entities in the other set.
o Example: A relationship between "Student" and "Course" entities
might be "Enrolls", meaning students enroll in courses.
4. Entity Set
o A collection of similar entities.
o Example: All students in a university form the "Student" entity set.
5. Relationship Set
o A collection of similar relationships.
o Example: The relationship set "Enrolls" could represent all
enrollments of students in various courses.
6. Keys
o Unique identifiers for entities.
o Primary Key: An attribute (or combination of attributes) that
uniquely identifies an entity in an entity set.
o Example: "Student ID" is the primary key for the "Student" entity
ER Diagram Notation
1. Entities are represented by rectangles.
2. Attributes are represented by ellipses, connected to their entity.
3. Relationships are represented by diamonds, connecting related entities.
4. Primary keys are underlined.
.
4. Explain the concept of Generalization, Specialization and Aggregation
with appropriate examples.
Ans : Generalization
 Definition: Generalization is a process of defining a higher-level entity
(supertype) that includes common attributes of several related entities
(subtypes).
 Example:
o Supertype: Employee
o Subtypes: SalariedEmployee, HourlyEmployee, ContractEmployee
o All employees share common attributes like EmployeeID, Name,
and Department. However, they have different specific attributes
(salary, hourly rate, contract duration) based on their employment
type.
Specialization
 Definition: Specialization is the reverse process of generalization, where
a subtype is defined as a more specific version of a supertype.
 Example:
o Supertype: Vehicle
o Subtypes: Car, Truck, Motorcycle
o All vehicles have common attributes like VehicleID, Make, and
Model. However, they have different specific attributes (number of
doors, cargo capacity, engine type) based on their type.
Aggregation
 Definition: Aggregation is a process of representing a composite entity
as a relationship between two or more entities. It is used when a part-
whole relationship exists between entities.
 Example:
o Entities: Order, OrderItem
o Aggregation: An order is composed of multiple order items.
o The OrderItem entity can be aggregated into the Order entity,
indicating that an order is a collection of order items.

5. What are integrity constraints? Explain various types of integrity


constraints
Ans : Integrity constraints are rules that ensure the accuracy, consistency,
and reliability of data within a database. They help maintain data quality
and prevent errors that could lead to incorrect or misleading information.
Types of Integrity Constraints
1. Entity Integrity:
o Ensures that every attribute in a primary key must have a non-null
value.
o Prevents duplicate records in a table.
2. Referential Integrity:
o Maintains consistency between related tables by ensuring that
foreign key values refer to existing primary key values in another
table.
o Prevents orphaned records (records with foreign key values that
don't match any primary key values).
3. Domain Integrity:
o Restricts the values that can be stored in a column to a specific
data type or range of values.
o Helps prevent invalid data from being entered into the database.
4. Check Constraints:
o Define conditions that must be met for a row to be valid.
o Can be used to enforce complex business rules or constraints that
cannot be expressed using other types of integrity constraints.
5. Unique Constraints:
o Ensure that a specific column or combination of columns has
unique values for each row.
o Prevents duplicate values in the specified columns.
Examples
Entity Integrity:
 A customer table cannot have a row with a null CustomerID value.
Referential Integrity:
 An order table cannot have a row with an OrderCustomerID value that
doesn't match a CustomerID value in the Customer table.
Domain Integrity:
 A ProductPrice column must be a numeric value greater than or equal to
0.
Check Constraint:
 A CustomerAge column must be between 18 and 65.
Unique Constraint:
 A CustomerEmail column must have unique values for each customer.

.
7 .Draw an ER diagram that captures the following information. A
company database needs to store information about employees,
departments and children of employees. Employees work in the
department each department is managed by an employee, a child must be
identified uniquely by name when the parent (who is an employee
assume that only one parent works for the company) is known. We are
not interested in information about the child once the parent leaves the
company.
8.SHORT NOTES ON:
Hashing.
Indexing
Structure
Ans :
Hashing
Hashing is a technique used to map data items to unique identifiers called hash
values. This mapping is typically done using a hash function, which takes an
input value and produces a fixed-size output. Hashing is commonly used for:
 Data storage: Hashing is used to efficiently store and retrieve data in
hash tables, which are data structures that allow for fast lookup of
elements based on their hash values.
 Data integrity: Hashing is used to verify the integrity of data by
comparing the hash of a file or message with a previously computed
hash. If the hashes differ, it indicates that the data has been modified.
 Cryptography: Hashing is used in cryptographic algorithms to create
digital signatures and protect passwords.
Indexing
Indexing is a technique used to improve the efficiency of data retrieval in
databases. It involves creating a data structure that stores information about
the location of specific values within a table. This data structure, called an
index, can be used to quickly locate rows that match a particular search
condition.
There are different types of indexes, including:
 Primary index: A unique index that is automatically created on the
primary key of a table.
 Secondary index: A non-unique index that can be created on any column
or combination of columns in a table.
 Clustered index: An index that stores data rows in the physical order of
the index keys.
 Non-clustered index: An index that stores pointers to data rows, rather
than the data itself.
Indexing can significantly improve query performance, especially for large
datasets or complex queries. However, creating and maintaining indexes can
also add overhead to database operations.
Structure
The structure of a database refers to the organization and arrangement of data
within the database. It is typically defined using a data model, such as the
relational data model or the object-oriented data model.
The structure of a database includes:
 Entities: Objects or concepts that represent the data being stored.
 Attributes: Properties or characteristics of entities.
 Relationships: Associations between entities.
 Constraints: Rules that govern the data stored in the database.
The structure of a database has a significant impact on its performance,
efficiency, and maintainability. A well-designed database structure can make it
easier to manage and query data, while a poorly designed structure can lead to
performance problems and data inconsistencies
10. Explain database architecture in detail
Ans : Database architecture refers to the overall design and structure of a
database system. It defines how data is stored, processed, and accessed, as
well as how various components of the database system interact with each
other. A well-defined database architecture ensures efficient data
management, seamless interaction between different layers, and optimal
performance.
Types of Database Architecture
1. 1-Tier Architecture (Single Tier)
o Concept: In a 1-tier architecture, the database resides directly on
the client system, and the user directly interacts with the
database. All the database management operations (application,
presentation, and database layers) occur on the same system.
o Use Case: Primarily used in small applications, desktop-based
systems, or for development purposes.
o Example: A personal application like Microsoft Access where the
user interacts directly with the database.
Advantages:
o Simple to implement and manage.
o No need for a separate server or network infrastructure.
Disadvantages:
o Not suitable for large, distributed systems.
o Limited scalability and security.
2. 2-Tier Architecture (Client-Server Architecture)
o Concept: In a 2-tier architecture, the system is divided into two
parts: Client and Server. The client is responsible for interacting
with the user and sending requests to the server. The server
handles the database, processes the client’s request, and sends
the required data back to the client.
 Client Tier: The user interface resides at the client side.
 Server Tier: The database is stored at the server side, and
the server processes the client’s queries.
o Use Case: Commonly used in applications that require a direct
connection between a client and the database, like small or
medium-sized web applications.
o Example: A banking system where the application installed on the
client’s machine interacts with the central database located on the
server.
Advantages:
o Better security than 1-tier architecture.
o Separation of client and server improves performance by
distributing the workload.
Disadvantages:
o Scalability can be an issue with growing user demands.
o A direct connection between the client and the database increases
security risks.
3. 3-Tier Architecture (Three-Layer Architecture)
o Concept: The 3-tier architecture adds an additional middle layer
between the client and the server. The layers are:
 Presentation Layer (Client): This is the user interface, where
users interact with the system (e.g., a web browser or
mobile app).
 Application Layer (Middle Tier): Also known as the business
logic layer, it processes user requests, applies business
rules, and communicates with the database.
 Database Layer (Data Tier): The actual database resides
here, and it is managed by a database server. The
application layer sends queries to the database and receives
the requested data.
o Use Case: Widely used in web applications and large enterprise
systems where security, scalability, and maintainability are
essential.
o Example: An e-commerce website where the user interacts with
the frontend (presentation layer), the business logic is handled by
the middle layer (processing user actions), and the database stores
information such as product details and customer orders.
Advantages:
o Improved security: The client does not interact directly with the
database, making the system more secure.
o Scalability: The architecture can handle a larger number of users
and complex operations.
o Easy maintenance: The separation of layers makes it easier to
manage, update, and maintain.
Disadvantages:
o More complex to set up and manage than 1-tier and 2-tier
architectures.
o Slightly slower than 2-tier due to the additional layer of
communication.

You might also like