DBMS SOLVED QB
DBMS SOLVED QB
Entities can be tangible objects, such as a customer, product, or employee, or intangible concepts, such as an
order, transaction, or reservation. Each entity is uniquely identifiable and can be represented by a set of
attributes that describe its characteristics.
14)Discuss term E-R Model.
The Entity-Relationship (E-R) model is a conceptual data model used to represent the structure of a database. It
provides a graphical representation of entities, their attributes, and the relationships between them
The E-R model consists of three main components:
Entities
Relationships
Attributes
15)Differentiate between Strong Entity and Weak Entity.
Strong Entity:
A strong entity is an entity that can exist independently and has its own unique identifier or primary key. It has
sufficient attributes to be uniquely identified within the entity set. Strong entities are represented by regular
rectangles in the E-R diagram.
Weak Entity:
A weak entity, on the other hand, is an entity that depends on another entity for its existence and cannot be
uniquely identified by its own attributes alone. It requires a relationship with a strong entity, known as the
identifying or owner entity, to give it meaning and uniqueness.
16)Explain Different types of attributes of an entity with the help of example.
Simple Attribute:
A simple attribute is an attribute that cannot be divided into smaller components. It represents a single value
associated with an entity. For example, consider a "Person" entity with attributes like "Name," "Age," and
"Gender." Each of these attributes represents a single value and can be classified as simple attributes.
Composite Attribute:
A composite attribute is an attribute that can be divided into multiple sub-attributes or components. It
represents a collection of related values. For instance, consider a "Address" attribute for a "Customer" entity,
which consists of sub-attributes like "Street," "City," "State," and "Zip Code." The composite attribute "Address"
is composed of several sub-attributes, each representing a distinct value.
Derived Attribute:
A derived attribute is an attribute that can be calculated or derived from other attributes or entities. It does not
have a direct value stored in the database but can be derived using formulas, expressions, or algorithms. For
example, consider a "Total Price" attribute for an "Order" entity. The total price can be derived by multiplying
the quantity of items with their individual prices.
Multi-valued Attribute:
A multi-valued attribute is an attribute that can have multiple values for a single entity occurrence. It
represents a set of values instead of a single value. For instance, consider a "Skills" attribute for an "Employee"
entity. An employee can possess multiple skills, such as programming, leadership, and communication. The
"Skills" attribute can hold multiple values for each employee.
Null Attribute:
A null attribute is an attribute that does not have a value assigned to it. It represents missing or unknown
information for an entity. For example, in a "Product" entity, the "Manufacturing Date" attribute may be null for
a product if the manufacturing date is not known or not applicable.
Key Attribute:
A key attribute is an attribute that uniquely identifies each entity occurrence within an entity set. It helps in
uniquely identifying and distinguishing one entity from another. For example, in a "Student" entity, the
"Student ID" attribute can serve as the key attribute, ensuring that each student has a unique identifier
17)Define Relationship Set. Give various constraints of relationship.
In the Entity-Relationship (E-R) model, a relationship set represents the collection or group of relationships
between entities.
Many-to-Many (M:N): In a many-to-many relationship, each instance of one entity can be associated with
multiple instances of another entity, and vice versa. For example, a "Student" entity may have a many-to-many
relationship with a "Course" entity, where each student can enroll in multiple courses, and each course can
have multiple enrolled students. To represent a many-to-many relationship, an intermediate entity called an
associative entity or junction table is often introduced.
18)Draw E-R Diagram for University database consisting 4 entities. 1) Student 2) Department 3) Class 4) Faculty
+-----------+ +------------+
| Department| | Faculty |
+-----------+ +------------+
| | | |
| | | |
| | +--------------+
| +---------| Class |
| +--------------+
|
|
+-------+
|Student|
+-------+
The "Student" entity represents the students enrolled in the university. It may have attributes like student ID,
name, address, and date of birth.
The "Department" entity represents the different academic departments within the university. It may have
attributes like department ID, name, and location.
The "Class" entity represents the classes or courses offered by the university. It may have attributes like class ID,
title, and schedule.
The "Faculty" entity represents the faculty members working in the university. It may have attributes like
faculty ID, name, specialization, and contact information
19)Construct an E-R diagram for a car-insurance company whose customers own one or more cars each. Each
car has associated with it zero to any number of recorded accidents.
+-----------+ +------------+
| Customer | | Car |
+-----------+ +------------+
| | | |
| | | |
| | +--------------+
| +-------- | Accident |
| +--------------+
|
|
+-------+
|Insurance|
+-------+
In this diagram:
The "Customer" entity represents the customers of the car-insurance company. It may have attributes like
customer ID, name, address, and contact information.
The "Car" entity represents the cars owned by the customers. It may have attributes like car ID, make, model,
year, and other relevant information about the car.
The "Accident" entity represents the recorded accidents associated with each car. It may have attributes like
accident ID, date, location, and details of the accident.
20)List and Explain E-R Diagram Components.
In an Entity-Relationship (E-R) diagram, various components are used to represent and define the structure of a
database. These components help visualize the entities, relationships, attributes, and constraints within the
database. Here are the key components of an E-R diagram:
Entity:
An entity represents a distinct object, concept, or thing in the real world that is relevant to the database. It is
represented by a rectangle in the diagram and is labeled with the entity name
Relationship:
A relationship depicts the association or connection between entities. It represents the meaningful interactions
or dependencies between entities in the database.
Attributes:
Attributes represent the characteristics or properties of an entity. They provide detailed information about the
entities within the database
Primary Key:
The primary key is an attribute or a combination of attributes that uniquely identify each instance or
occurrence of an entity
Cardinality:
Cardinality describes the number of instances or occurrences of one entity that can be associated with another
entity through a relationship
Participation Constraint:
Participation constraint defines whether an entity's participation in a relationship is mandatory or optional.
Weak Entity:
A weak entity is an entity that depends on another entity for its existence and cannot be uniquely identified by
its own attributes alone.
UNIT-2
1.Define term Relational Model.
The relational model is a conceptual framework used in database management systems (DBMS) to organize and
structure data.
2.List types of Keys in DBMS.
Primary Key
Foreign Key
Candidate Key
Composite Key
Alternate Key
3.Define concepts of views along with its operations.
A view is a virtual table that is derived from the data stored in one or more underlying tables. It does not physically
store data but presents a tailored representation of the data to users or applications.
4.Explain advantages of Views.
Data Security: Views provide an additional layer of security by allowing you to restrict access to sensitive data.
Simplified Data Access: Views simplify data access by presenting a tailored and simplified view of the data.
Data Abstraction: Views provide a level of data abstraction by hiding the underlying complexity of the database
structure.
5.Explain the concept of Functional Dependencies.
functional dependencies are a concept used to describe the relationship between attributes or sets of attributes
within a relation (table).
State and explain Codd’s norms for DBMS.
The logical data in a database must be independent of its user's view (application). Any change in logical data must
not affect the applications using it. For example, if two tables are merged or one is split into two different tables,
there should be no impact or change on the user application.
6.Explain all types of Integrity with the help of example.
Entity Integrity:
Entity integrity ensures that each row or record in a table has a unique identifier, typically defined by a
primary key
Referential Integrity:
Referential integrity ensures that relationships between tables are maintained correctly.
Domain Integrity:
Domain integrity ensures that data entered into a column adheres to the defined domain or data type constraints.
7.Explain the term “Referential Integrity” and its relation with foreign key.
Referential integrity ensures that the values stored in a foreign key column of one table (the referencing table)
correspond to the values of the primary key column in another table
8.Write short note on Integrity constraints.
Integrity constraints are rules defined in a database management system (DBMS) that enforce the accuracy,
consistency, and validity of data stored in a database. These constraints help maintain data integrity by preventing the
entry of incorrect or inconsistent data.
9.Write short note on:
-Domain Integrity
Domain integrity is an important aspect of data integrity in a database management system (DBMS). It ensures
that data stored in a database adheres to the defined rules and constraints for each attribute or column, including
data types, formats, and allowable values.
-Referential Integrity and its relation with Foreign Key.
Referential integrity is a concept in database management systems (DBMS) that ensures the consistency and
correctness of relationships between tables. It is closely related to the use of foreign keys.
10.Define term Data Integrity.
Data integrity refers to the accuracy, consistency, and reliability of data stored in a database. It ensures that the
data is complete, valid, and reliable throughout its lifecycle, from creation to storage and retrieval.
11.Write short note on following:
Super Key
In a relational database, a superkey is a set of one or more attributes (columns) that can uniquely identify a tuple
(row) within a table. A superkey contains enough information to uniquely identify each record in a table.
Primary Key
A primary key is a unique identifier for each record (tuple) in a relational database table. It is a column or set of
columns that uniquely identifies each row within a table.
Candidate Key
a candidate key is a set of one or more attributes (columns) that can uniquely identify a tuple (row) within a
table. Similar to a primary key, a candidate key is used to ensure the uniqueness of records. However, unlike a
primary key, a candidate key is not selected as the main identifier for the table.
12.Explain concept of functional Dependency.
Functional dependency is a fundamental concept in database management systems (DBMS) that describes the
relationship between attributes or columns in a table. It represents a dependency or association between the values
of one or more attributes and the values of another attribute in the same table.
13.State and Explain Armstrong’s Axioms and its properties.
Armstrong's axioms, also known as Armstrong's rules or inference rules, are a set of logical rules used in the field of
relational database theory to infer functional dependencies. They were introduced by William W. Armstrong and are
widely used for reasoning about dependencies in a relational schema.
14.Define term Decomposition.
Decomposition, in the context of database management systems, refers to the process of breaking down a single
relation (table) into multiple smaller relations. It involves dividing the attributes of a relation and distributing them
among the resulting decomposed relations.
15.List the properties of Decomposition. Explain loss less join with the help of Example.
Lossless Join: A decomposition is said to have the lossless join property if the original relation can be reconstructed by
joining the decomposed relations. In other words, no information is lost during the decomposition process. The
lossless join property ensures that the decomposed relations contain all the information needed to reconstruct the
original relation.
16.Discuss the term Lossless-Join decomposition.
Lossless-join decomposition is a property that ensures the preservation of all functional dependencies and the ability
to reconstruct the original relation by joining the decomposed relations without any loss of information
17.Define term Normalization. State and explain 2NF and 3NF.
Normalization is a process in database design that organizes a database schema into a set of normal forms to
eliminate data redundancy, update anomalies, and ensure data integrity.
Second Normal Form (2NF):
2NF is achieved when a relation is in 1NF (First Normal Form) and there are no partial dependencies.
Third Normal Form (3NF):
3NF is achieved when a relation is in 2NF and there are no transitive dependencies.
18.State the need of Normalization in DBMS.
Normalization helps maintain data integrity by eliminating data redundancy and inconsistencies. Redundant data can
lead to anomalies and inconsistencies, such as update anomalies (where updating data in one place leads to
inconsistencies in other places).
19.Explain 1NF.
First Normal Form (1NF) is the basic level of normalization in database design. It sets the foundation for organizing
data in a structured and consistent manner.
20.Explain 2NF.
Second Normal Form (2NF) is a higher level of normalization in database design that builds upon the concepts of First
Normal Form (1NF). It addresses the issue of partial dependencies that can occur when a relation has a composite
primary key. To achieve 2NF
21.State and Explain 3 NF.
Third Normal Form (3NF) is a further level of normalization in database design that builds upon the concepts of
First Normal Form (1NF) and Second Normal Form (2NF). It addresses the issue of transitive dependencies that
can exist within a relation.
22.Explain BCNF (Boyce Codd Normal Form).
BCNF (Boyce-Codd Normal Form) is a higher level of normalization in database design that addresses the issue of
functional dependencies and eliminates all types of anomalies. It is an extension of the Third Normal Form (3NF) and
ensures that a relation is free from all non-trivial functional dependencies.
23.Explain 4NF.
Fourth Normal Form (4NF) is a further level of normalization in database design that builds upon the concepts of First
Normal Form (1NF), Second Normal Form (2NF), and Third Normal Form (3NF). It aims to address the issue of multi-
valued dependencies within a relation.
24.Explain 5NF and Join Dependency.
Fifth Normal Form (5NF), also known as Project-Join Normal Form (PJNF), is a higher level of normalization in database
design that aims to address the issue of join dependencies. 5NF builds upon the concepts of First Normal Form (1NF),
Second Normal Form (2NF), Third Normal Form (3NF), and Fourth Normal Form (4NF).
UNIT-3
1.Define term query.
In the context of databases, a query refers to a request or instruction to retrieve specific information or perform
operations on a database. It is a means of communication between a user or an application and the database
management system (DBMS). A query allows users to interact with the database by retrieving, modifying, or
manipulating data based on specified criteria.
2.Explain role of SQL with the help of example.
SQL (Structured Query Language) plays a critical role in interacting with databases and managing data. It is a
standard language used to communicate with relational database management systems (RDBMS) such as MySQL,
PostgreSQL, Oracle, and SQL Server. SQL provides a set of commands and syntax for performing various operations
on databases, including data retrieval, modification, and administration.
3.Discuss various MySQL data types.
Numeric Types:
INT: Used to store whole numbers. It can have a specified length.
DECIMAL: Used to store fixed-point decimal numbers. It requires a precision and scale value to define the total
number of digits and the number of decimal places.
FLOAT, DOUBLE: Used to store floating-point numbers with single or double precision.
4.Explain DDL commands.
DDL stands for Data Definition Language, and it consists of a set of SQL commands used to define and manage the
structure of a database and its objects. DDL commands are responsible for creating, altering, and dropping
database objects such as tables, indexes, views, and constraints.
5.Write short note on DML Commands.
DML stands for Data Manipulation Language, and it consists of a set of SQL commands used to manipulate and
query data within a database. DML commands are responsible for inserting, updating, deleting, and retrieving data
from tables. Here are some commonly used DML commands in SQL:
SELECT
INSERT
UPDATE
DELETE
6.Differentiate between Data Definition Language and Data Manipulation Language.
UNIT-4
Define term stored Procedures.
A stored procedure is a named set of SQL statements that are stored in a database. It is a pre-compiled
collection of SQL queries, control statements, and procedural logic, which can be executed repeatedly by
invoking its name. Stored procedures are typically used to encapsulate frequently used or complex SQL
operations and provide a convenient way to execute them.
UNIT-5
Define term Concurrency Control. Explain the stamp based Concurrency control.
Concurrency control is a fundamental aspect of database management systems (DBMS) that ensures the
correct and consistent execution of concurrent transactions. It manages the simultaneous access to shared
data by multiple transactions, preventing conflicts and maintaining data integrity. Concurrency control
techniques aim to provide efficient and coordinated access to the database while ensuring isolation and
correctness of transactions.
Define term Deadlock. Explain how Deadlock detection and prevention is done.
Deadlock is a situation in concurrent systems where two or more processes or transactions are unable to
proceed because each is waiting for the other to release resources that it holds, resulting in a circular
dependency. In other words, it is a state where multiple processes are stuck and unable to continue
execution, leading to a system deadlock.
Define term Database Backup. Why Database backup is needed? Explain types of database backup?
Database backup refers to the process of creating a copy or snapshot of a database's data and storing it in a
separate location or storage medium. It is an essential practice in database management to safeguard
against data loss, system failures, disasters, or human errors. The database backup ensures that a recent and
consistent copy of the data is available for recovery purposes.
Define term Recovery. Explain types of Recovery (forward and Backward Recovery).
Recovery in the context of database management refers to the process of restoring a database to a
consistent and correct state after a failure or error. It involves recovering lost or damaged data and ensuring
the integrity and availability of the database.
Types of Recovery:
Forward Recovery:
Backward Recovery
Write short note on Mobile Database. Also state the functionality required for Mobile Database.
A mobile database refers to a database system specifically designed to run on mobile devices such as
smartphones, tablets, and other portable devices. It enables users to store, retrieve, and manage data locally
on their mobile devices.