Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

DBMS QB (Solved)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

CSD – 2B

UNIT – 1, 2 SAQs

1. What is data abstraction and write the 3 levels of abstraction.


Data Abstraction Database systems are made-up of complex data structures.
To ease the user interaction with database, the developers hide internal
irrelevant details from users. This process of hiding irrelevant details from
user is called data abstraction.
The three levels of data abstractions:
1. View level
2. Physical level
3. Logical level
2. Define Relational Algebra?
Relational Algebra is a procedural query language. It mainly provides a
theoretical foundation for relational databases and SQL. The main purpose
of using Relational Algebra is to define operators that transform one or more
input relations into an output relation.
3. List out the types of NoSQL Databases?
NoSQL databases can be classified into four types,
1. Key-Value (KV) Stores
2. Document Stores
3. Column Family Data stores or Wide column data stores
4. Graph Databases
4. Write a short note on ER diagram?
ER model stands for an Entity-Relationship model. It is a high-level data
model. This model is used to define the data elements and relationship for a
specified system. It develops a conceptual design for the database. It also
develops a very simple and easy to design view of data. The database
structure is portrayed as a diagram called an entity-relationship diagram.
5. Define Relational calculus?
Relational Calculus is a Declarative (non-procedural) language. It means
what result we have to obtain. Here, order is not specified.
It can be domain-dependent because of domain relational calculus.
It is not nearer to programming language but to natural language

6. Write the difference between SQL & NoSQL with examples. ***

SQL NOSQL
It has relational data model. Data is It has a distributed database
stored in rows and columns in the system. Data is stored in the form of
form of tables. key-value, etc.
It has a rigid schema with It has flexible schema.
predefined structure.

1
CSD – 2B

SQL language is used. Various other languages are used


depending on the database.
Vertically scalable Horizontally scalable.
Best suited for complex queries. Not so good for complex queries.
Follows ACID properties. Follows CAP (Consistency,
Availability, Partition tolerance)
Example: MySQL, oracle, etc. Example: MongoDB, HBase
7. What is an entity? Give an example.
An entity may be any object, class, person or place. In the ER diagram, an
entity can be represented as rectangles. Consider an organization as an
example - manager, product, employee, department etc. can be taken as an
entity.

8. What are composite attributes and derived attributes?


An attribute that composed of many other attributes is known as a composite
attribute. The composite attribute is represented by an ellipse, and those
ellipses are connected with an ellipse.
An attribute that can be derived from other attribute is known as a derived
attribute. It can be represented by a dashed ellipse
9. Define nested query?
Nested queries are a way to perform more complex queries by
embedding one query within another. A nested query is a
query that appears inside another query, and it helps retrieve
data from multiple tables or apply conditions based on the
results of another query.
10. What are joints and views?
A join view is a virtual table that contains columns from related
heterogeneous data sources joined by key columns. Use a join view to run
tests on several related columns across different tables. You can create a
join view instead of multiple SQL views with joins. For example, the
Employee table has employee details, Inventory table has sales details, and
the customer table has customer details
UNIT – 1 LAQs
1. Explain four data models of DBMS?
Data Definition Language (DDL)
 DDL stands for Data Definition Language.
 It is used to define database structure or pattern. It is used to create
schema, tables, indexes, constraints, etc. in the database.

2
CSD – 2B

 Using the DDL statements, you can create the skeleton of the
database. Data definition language is used to store the information of
metadata like the number of tables and schemas, their names,
indexes, columns in each table, constraints, etc.
 Here are some tasks that come under DDL:
1. Create: It is used to create objects in the database.
2. Alter: It is used to alter the structure of the database.
3. Drop: It is used to delete objects from the database.
4. Truncate: It is used to remove all records from a table.
5. Rename: It is used to rename an object.
6. Comment: It is used to comment on the data dictionary

Data Manipulation Language:


 DML stands for Data Manipulation Language.
 It is used for accessing and manipulating data in a database. It handles
user requests.
 The commands are as follows:
1. Select: It is used to retrieve data from a database.
2. Insert: It is used to insert data into a table.
3. Update: It is used to update existing data within a table.
4. Delete: It is used to delete all records from a table.
5. Merge: It performs UPSERT operation, i.e., insert or update
operations.
6. Call: It is used to call a structured query language or a Java
subprogram.

Data Control Language (DCL)


 DCL stands for Data Control Language. It is used to retrieve the stored
or saved data.
 The DCL execution is transactional. It also has rollback parameters.
 Here are some tasks that come under DCL:
1. Grant: It is used to give user access privileges to a database.
2. Revoke: It is used to take back permissions from the user.
3. There are the following operations which have the authorization
of Revoke: CONNECT, INSERT, USAGE, EXECUTE, DELETE,
UPDATE and SELECT.

Transaction Control Language (TCL)


 TCL is used to run the changes made by the DML statement. TCL can
be grouped into a logical transaction.

3
CSD – 2B

 Here are some tasks that come under TCL:


1. Commit: It is used to save the transaction on the database.
2. Rollback: It is used to restore the database to original since the
last Commit
2. Explain the database users.
A huge database with a few hundred users is designed, used, and
maintained by numerous people.
1. Database Administrator: The database administrator is in charge of
managing the primary (database) and secondary (DBMS and related
software). He is in-charge of granting access to the database,
organizing and overseeing its use, and procuring necessary hardware
and software resources.
 Roles of a Database Administrator are Installing the DBMS
Servers, Designing and Implementation, Performance Tuning,
Backup and Recovery, Documentation, Security.

2. Database designers: They often work with each conceivable group of


users and interact with them to create a representation of the database
that satisfies their needs for processing and data.
 Logical Database Designers: The entities and properties of the
data, as well as their relationships and storage limitations, are all
things that the logical database designer is concerned with. The
organization's data, as well as any restrictions on it, must be fully
understood by the logical database designer.
 Physical Database Designers: The physical database designer
makes the practical implementation of the logical database
design decisions.

3. End Users: End users are those individuals whose occupations need
them to have access to the database for the purposes of querying,
updating, and producing reports.
Categories of End Users are:
 Casual End User: They may occasionally visit the database, but
each time they might require a different set of data. They are often
supervisors at the medium or high levels or other infrequent
browsers.
 Naive End User: Their primary duty is to continuously update and
query the database using tried-and-true, precisely coded and tested
queries and updates. Naive end users include people working as
bank tellers, hotel and airline reservation clerks, etc.
 Sophisticated End User: Engineers, scientists, business analysts,
and other sophisticated end users are examples of sophisticated
end users who extensively educate themselves with the DBMS's

4
CSD – 2B

features in order to construct their applications to suit their


complicated requirements.
3. Explain in detail about the database language?
Database languages are a type of programming languages that allow
developers to create, modify, and manipulate databases. Databases are
structured sets of data that can be stored, retrieved, and updated
electronically. Database languages can be used for various purposes, such
as: - Defining the schema or structure of the database, such as the tables,
columns, indexes, constraints, etc.
The languages are as follows:
Data Definition Language (DDL):
 DDL stands for Data Definition Language.
 It is used to define database structure or pattern. • It is used to create
schema, tables, indexes, constraints, etc. in the database.
 Using the DDL statements, you can create the skeleton of the
database. Data definition language is used to store the information of
metadata like the number of tables and schemas, their names,
indexes, columns in each table, constraints, etc.
 Here are some tasks that come under DDL: •
Create: It is used to create objects in the database.
Alter: It is used to alter the structure of the database.
Drop: It is used to delete objects from the database.
Truncate: It is used to remove all records from a table.
Rename: It is used to rename an object.
Comment: It is used to comment on the data dictionary

Data Manipulation Language:


 DML stands for Data Manipulation Language.
 It is used for accessing and manipulating data in a database. It handles
user requests.
 The commands are as follows:
Select: It is used to retrieve data from a database.
Insert: It is used to insert data into a table.
Update: It is used to update existing data within a table.
Delete: It is used to delete all records from a table.
Merge: It performs UPSERT operation, i.e., insert or update
operations.
Call: It is used to call a structured query language or a Java
subprogram.

Data Control Language (DCL)


 DCL stands for Data Control Language. It is used to retrieve the stored
or saved data.

5
CSD – 2B

 The DCL execution is transactional. It also has rollback parameters.


 Here are some tasks that come under DCL:
Grant: It is used to give user access privileges to a database.
Revoke: It is used to take back permissions from the user.
There are the following operations which have the authorization
of Revoke: CONNECT, INSERT, USAGE, EXECUTE, DELETE,
UPDATE and SELECT.

Transaction Control Language (TCL)


 TCL is used to run the changes made by the DML statement. TCL can
be grouped into a logical transaction.
 Here are some tasks that come under TCL:
Commit: It is used to save the transaction on the database.
Rollback: It is used to restore the database to original since the
last Commit.

4. Elaborate the different data model of DBMS?


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.
1. Relational Data Model:
 This type of model designs the data in the form of rows and
columns within a table. Thus, a relational model uses tables for
representing data and in-between relationships. Tables are also
called relations.
 The relational data model is the widely used model which is
primarily used by commercial data processing applications.
2. Entity-Relationship Data Model:
 An ER model is the logical representation of data as objects and
relationships among them. These objects are known as entities,
and relationship is an association among these entities. It was
widely used in database designing.
 A set of attributes describe the entities. For example,
student_name, student_id describes the 'student' entity. A set of
the same type of entities is known as an 'Entity set', and the set
of the same type of relationships is known as 'relationship set’.
3. Object-based Data Model:
 An extension of the ER model with notions of functions,
encapsulation, and object identity, as well.
 This model supports a rich type system that includes structured
and collection types. Thus, in 1980s, various database systems
following the object-oriented approach were developed.
 Here, the objects are nothing but the data carrying its properties.
6
CSD – 2B

4. Semi Structured Data Model:


 This type of data model is different from the other three data
models (explained above).
 The semi structured data model allows the data specifications at
places where the individual data items of the same type may
have different attributes sets.
 The Extensible Markup Language, also known as XML, is widely
used for representing the semi structured data. Although XML
was initially designed for including the markup information to the
text document, it gains importance because of its application in
the exchange of data.
5. Draw and explain the architecture of database? ***
Data Abstraction Database systems are made-up of complex data structures.
To ease the user interaction with database, the developers hide internal
irrelevant details from users. This process of hiding irrelevant details from
user is called data abstraction.
1. Physical level:
 This is the lowest level of data abstraction.
 It describes how data is actually stored in database.
 You can get the complex data structure details at this level.
 At physical level these records can be described as blocks of
storage (bytes, gigabytes, terabytes etc.) in memory. • These
details are often hidden from the programmers.
2. Logical level:
 This is the middle level of 3-level data abstraction architecture. •
It describes what data is stored in database.
 At the logical level these records can be described as fields and
attributes along with their data types, their relationship among
each other can be logically implemented.
 The programmers generally work at this level because they are
aware of such things about database systems.
3. View level:
 Highest level of data abstraction.
 This level describes the user interaction with database system.
 At view level, user just interact with system with the help of GUI
and enter the details at the screen, they are not aware of how the
data is stored and what data is stored; such details are hidden
from them.

7
CSD – 2B

6. List the operations of DDL,DCL,DML,TCL? ***


1. DDL is Data Definition Language statements. Some examples:
 CREATE - to create objects in the database.
 ALTER - alters the structure of the database.
 DROP - delete objects from the database.
 TRUNCATE - remove all records from a table, including all spaces
allocated for the records.
2. DCL is Data control language
 GRANT - gives user's access privileges to database
 REVOKE - withdraw access privileges given with the GRANT
command
3. DML is Data Manipulation Language statements. Some examples:
 SELECT - retrieve data from the a database.
 INSERT - insert data into a table.
 UPDATE - updates existing data within a table.
 DELETE - deletes all records from a table, the space for the
records remain
4. TCL is Transaction Control Language statements. Some examples:
 COMMIT - save the changes permanently.
 SAVEPOINT - identify a point in a transaction to which you can
later roll back
 ROLLBACK - restore database to original since the last
 COMMIT SET TRANSACTION - Change transaction options like
what rollback segment to use.

7. Demonstrate the different DDL commands with syntax?


1. CREATE Command: CREATE is a DDL command used to create
databases, tables, triggers and other database objects.
 CREATE TABLE: This command defines all characteristics of a
table, including integrity and check constraints, column names
and data types, storage option, and soon. Data in relational
8
CSD – 2B

model is stored in tables. So the first step is creating a table


using SQL command CREATE TABLE. Before a table is created
the following factors are to be finalized: The name of the table,
The number of columns in the table, the name, data type and
size of each column of the table, the column and table
constraints.
 Syntax to Create a Database:
CREATE Database Database_Name;
2. DROP Command: DROP is a DDL command used to delete/remove
the database objects from the SQL database. We can easily remove
the entire table, view, or index from the database using this DDL
command.
 Examples of DROP Command in SQL Example 1: This example
describes how to remove a database from the SQL database.
Syntax to remove a database: DROP DATABASE
Database_Name;
3. ALTER Command: ALTER is a DDL command which changes or
modifies the existing structure of the database, and it also changes the
schema of database objects. We can also add and drop constraints of
the table using the ALTER command.
Examples of ALTER Command in SQL Example 1: This example
shows how to add a new field to the existing table.
 Syntax to add a new field in the table:
ALTER TABLE name_of_table ADD column_name
column_definition;

4. TRUNCATE Command: TRUNCATE is another DDL command which


deletes or removes all the records from the table. This command also
removes the space allocated for storing the table records.

 Syntax of TRUNCATE command is


TRUNCATE TABLE Table_Name;
5. RENAME Command: RENAME is a DDL command which is used to
change the name of the database table.
 Syntax of RENAME command:
RENAME TABLE Old_Table_Name TO New_Table_Name;

9
CSD – 2B

UNIT – 2 LAQs
1. Define the various set operational of relational algebra?
Relational Algebra is a Procedural language. It means how to obtain the
result. In Relational Algebra, the order is specified in which the operations
have to be performed It is independent of the domain and is nearer to a
programming language.
The set operation is mainly categorized into the following:
1. Union operation:
 The union operation combines the rows of two relations into a
single relation, removing duplicate rows.
 It is denoted by the symbol ∪.
2. Intersection operation:
 The intersection operation selects only the rows that appear in
both relations.
 It is denoted by the symbol ∩
3. Minus operation:
 The difference operation selects the rows from one relation that
do not appear in another relation.
 It is denoted by the symbol -
4. Cartesian Product:
 The Cartesian product operation combines every row of one
relation with every row of another relation, resulting in a new
relation with all possible combinations of rows.
 It is denoted by the symbol ×.

2. Differentiate between relational algebra and relational calculus?


1. Relational Algebra:
 Relational Algebra is a procedural query language.
 It mainly provides a theoretical foundation for relational databases and
SQL.
 The main purpose of using Relational Algebra is to define operators
that transform one or more input relations into an output relation
2. Relational Calculus:
 Relational Calculus is a Declarative (non-procedural) language.
 Relational Calculus means what result we have to obtain.
 The order is not specified.
 It can be domain-dependent because of domain relational calculus.
 Relational Calculus is not nearer to programming language but to
natural language.
 SQL is based to a greater extent on the tuple relational calculus.

10
CSD – 2B

 For a database language to be relationally complete, the query written


in it must be expressible in relational calculus.
 The order of operations does not matter in relational calculus for the
evaluation of queries.
For accessing the database, relational calculus provides a solution in terms
as simple as what is required and lets the system find the solution for that.
3. Write about relational query language and its types (procedural and
non-procedural).
Relational Query Language (RQL) is a language used to query and
manipulate data stored in a relational database management system
(RDBMS). RQL provides a standardized syntax and set of commands for
performing various operations such as retrieving, updating, inserting, and
deleting data from relational databases. There are two main types of RQL:
procedural and non-procedural.
1. Procedural Relational Query Language: Procedural RQL involves
specifying the step-by-step procedure or algorithm to retrieve data from
the database. It requires the user to explicitly describe how the query
should be executed, including specifying the sequence of operations
and control flow. Examples of procedural RQL include:
 Structured Query Language (SQL): SQL is a widely used
procedural RQL that provides a comprehensive set of commands
for interacting with relational databases. SQL statements such as
SELECT, INSERT, UPDATE, and DELETE are used to perform
various database operations. SQL queries specify what data to
retrieve and how to retrieve it, including conditions, joins, and
ordering.
2. Non-Procedural Relational Query Language: Non-procedural RQL,
also known as declarative RQL, focuses on specifying what data to
retrieve rather than how to retrieve it. It allows users to express their
queries in a more abstract and intuitive manner, without having to
specify the exact sequence of operations. The database management
system then automatically determines the most efficient way to execute
the query. Examples of non-procedural RQL include:.
 Relational Algebra: Relational algebra is a theoretical
framework for expressing queries on relational databases in a
non-procedural manner. It defines a set of algebraic operations
such as selection, projection, join, and union, which can be used
to manipulate and retrieve data from relational databases.
Relational algebra serves as the foundation for query
optimization and execution in RDBMSs.
Both procedural and non-procedural RQLs have their advantages and use
cases. Procedural RQL, such as SQL, provides flexibility and fine-grained
control over query execution, allowing users to optimize performance and
customize query logic. Non-procedural RQL, such as QBE and relational
11
CSD – 2B

algebra, offers simplicity and ease of use, enabling users to express queries
in a more intuitive and abstract manner without worrying about the underlying
implementation details.

4. Write about various relational/set operations. ***


Relational/set operations are fundamental concepts in relational algebra, a
formal framework for manipulating data in relational databases. Here are the
various operations:
1. Selection (σ):
 Retrieves rows from a relation that satisfy a specified condition.
2. Projection (π):
 Selects specific columns from a relation.
3. Union (∪):
 Combines rows from two relations, removing duplicates.
4. Intersection (∩):
 Selects rows common to two relations.
5. Difference (-):
 Selects rows from one relation not present in another.
6. Cartesian Product (×):
 Combines every row of one relation with every row of another.
7. Join (⋈):
 Combines rows from two relations based on a related attribute.
These operations are used to query and manipulate data in relational
databases, allowing for complex data retrieval and manipulation.

5. What is relational algebra? What are the various relational algebra


operations?
Relational algebra is a formal system used to manipulate relations (tables) in
a relational database management system (RDBMS). It provides a set of
operations for querying and manipulating data stored in relational databases.
These operations are based on mathematical set theory and logic, providing
a theoretical foundation for database query languages like SQL.
The various relational algebra operations include:
1. Selection (σ):
 Retrieves rows from a relation that satisfy a specified condition.
2. Projection (π):
 Selects specific columns from a relation.
3. Union (∪):
 Combines rows from two relations, removing duplicates.
4. Intersection (∩):
 Selects rows common to two relations.
5. Difference (-):
 Selects rows from one relation not present in another.
6. Cartesian Product (×):
12
CSD – 2B

 Combines every row of one relation with every row of another.


7. Join (⋈):
 Combines rows from two relations based on a related attribute.
Relational algebra operations are used to perform various tasks such as
querying data, filtering rows, selecting columns, combining relations, and
more. These operations serve as the foundation for designing and executing
queries in relational databases, providing a structured and mathematical
approach to data manipulation.

6. Write about specialization, generalization, aggregation, composition


with example. ***
Specialization:
 Specialization is the process of defining subclasses (or child entities)
based on a superclass (or parent entity) in an entity-relationship model.
 It allows for the creation of more specific entity types with unique
attributes or relationships.
Generalisation:
 Generalization is the reverse process of specialization, where common
attributes or relationships among entities are abstracted to form a
superclass.
 It simplifies the data model by grouping similar entities under a
common superclass.
Aggregation:
 Aggregation is a type of association between entities where one entity
represents a whole and another entity represents a part of that whole.
 It allows for modelling relationships where one entity comprises or is
composed of other entities.
Composition:
 Composition is a stronger form of aggregation where the lifetimes of
the part entities are dependent on the lifetime of the whole entity.
 It represents a "part-of" relationship where the part entities cannot exist
without the whole entity.

UNIT – 3 SAQs
1. What are DDL and DML commands with syntax and examples?
DDL (Data Definition Language) commands define, modify, or remove
Ans: database structure. The commands of DDL with syntaxes are as follows:
 Create table: Create table table_name (column1 datatype, column2
datatype);
 Alter: Alter table table_name add column column_name datatype;
 Drop: Drop table table_name;
13
CSD – 2B

 Truncate: Truncate table table_name;


 Rename: Rename old_name to new_name;

 DML (Data Manipulation Language) commands interact with data in a
database. The commands of DML with syntaxes are as follows:
 Select: Select * from table_name;
 Insert: Insert into table_name values(value1, value2);
 Update: Update table_name set condition where condition;
 Delete: Delete from table_name where condition;

2. Write about DCL and TCL commands with syntax and examples
DCL (Data Control Language) is used to retrieve saved data. The commands
of DCL with syntaxes are as follows:
 Grant: Grant select, insert on table_name to user1.
 Revoke: Revoke insert on table_name from user1;
TCL (Transactional Control Language) is used to run changes made by DML
commands.The commands of TCL with syntaxes are as follows:
 Commit: Commit;
 Rollback: Rollback;

3. Write about various set operations with examples.


1. Union ( ∪ ): The union of two sets is denoted as A ∪ B. It is the set of
all elements that are in either A or B, or both.
Example: Let A = {1, 2, 3} and B = {3, 4, 5} then A ∪ B = {1, 2, 3, 4, 5}.
2. Intersection ( ∩ ): It is denoted as A ∩ B. It is the set of all elements
that are in both A and B.
Example: Let A = {1, 2, 3} and B = {3, 4, 5} then A ∩ B = {3}.
3. Difference ( \ ): The difference of two sets A and B is denoted as A \ B.
It is the set of all elements that are in A but not in B.
Example: Let A = {1, 2, 3} and B = {3, 4, 5} then A \ B = {1, 2}.

4. What is null value?


A null value in a database signifies the absence of data in a field,
representing missing, unknown, or undefined values.
5. Write about various group or aggregate functions?
Group or aggregate functions are used in databases to perform calculations
on groups of rows and return a single result. Here are some common group
or aggregate functions:
1. COUNT: Counts the number of rows in a group.
2. SUM: Calculates the sum of values in a group.
3. MIN: Finds the minimum value in a group.
4. MAX: Finds the maximum value in a group.
5. AVG: Finds the average value in a group.
14
CSD – 2B

6. Write about nested queries with examples?


Nested queries are queries inside other queries. They help retrieve specific
data by using results from another query.
Example: SELECT name FROM students
Where name in (Select total from marks);
7. Write about where, order by, group by, having clause.
 WHERE clause: It is used in SQL to filter records based on a specified
condition. It allows you to extract only those records that fulfill the
condition specified. For example: SELECT * FROM employees
WHERE department = 'Sales';
 ORDER BY clause: It is used to sort the result set in ascending or
descending order based on one or more columns.
Example: SELECT * FROM products ORDER BY price DESC;
 GROUP BY clause: It is used to group rows that have the same values
into summary rows.
Example: SELECT department, COUNT (*) FROM employees GROUP
BY department;
 HAVING clause: It is used to filter the groups based on a specified
condition. It operates on groups rather than individual rows.
Example: SELECT department, AVG (salary) FROM employees
GROUP BY department HAVING AVG (salary) > 50000;
8. What is join? What are Different types of joins?
Joins in databases are used to combine rows from two or more tables based
on a related column between them. It allows us to retrieve data from multiple
tables simultaneously.
The different types of joins are - Inner Join, Left Join, Right Join and Full
Join.
9. What is view? How do you create, update, and delete a view?
A view in a database is a virtual table that presents data from one or more
tables in the database. Views provide a way to simplify complex queries.
To create, use "CREATE VIEW", update with "CREATE OR REPLACE
VIEW", delete with "DROP VIEW".

15
CSD – 2B

UNIT – 3 LAQs

1. Elaborate the four types of NoSQL Databases.


NoSQL databases are designed to handle large volumes of unstructured or
semi-structured data efficiently. The four main types of NoSQL databases
are:
1. Document-Based Database:
 The document-based database is a nonrelational database.
Instead of storing the data in rows and columns (tables), it uses
the documents to store the data in the database.
 A document database stores data in JSON, BSON, or XML
documents.
 Documents can be stored and retrieved in a form that is much
closer to the data objects used in applications which means less
translation is required to use these data in the applications.
 In the Document database, the particular elements can be
accessed by using the index value that is assigned for faster
querying

2. Key-Value Stores:
 A key-value store is a nonrelational database.
 The simplest form of a NoSQL database is a key-value store.
 Every data element in the database is stored in key-value pairs.
 The data can be retrieved by using a unique key allotted to each
element in the database.
 The values can be simple data types like strings and numbers or
complex objects.
 Key features of the key-value are Simplicity, Scalability, Speed.

3. Column Oriented Databases:


 A column-oriented database is a non-relational database that
stores the data in columns instead of rows. That means when we
want to run analytics on a small number of columns, you can
read those columns directly without consuming memory with the
unwanted data.
 Columnar databases are designed to read data more efficiently
and retrieve the data with greater speed.
 A columnar database is used to store a large amount of data.

16
CSD – 2B

 Key features of columnar oriented database are Scalability,


Compression and Very responsive.

4. Graph-Based databases:
 Graph-based databases focus on the relationship between the
elements.
 It stores the data in the form of nodes in the database.
 The connections between the nodes are called links or
relationships.
 It is easy to identify the relationship between the data by using
the links.
 The Query’s output is real-time results.
 The speed depends upon the number of relationships among the
database elements.
 Updating data is also easy, as adding a new node or edge to a
graph database is a straightforward task that does not require
significant schema changes.

2. Write the difference between SQL & NoSQL with examples. ***

SQL NOSQL
It has relational data model. Data is It has a distributed database
stored in rows and columns in the system. Data is stored in the form of
form of tables. key-value, etc.
It has a rigid schema with It has flexible schema.
predefined structure.
SQL language is used. Various other languages are used
depending on the database.
Vertically scalable Horizontally scalable.
Best suited for complex queries. Not so good for complex queries.
Follows ACID properties. Follows CAP (Consistency,
Availability, Partition tolerance)
Example: MySQL, oracle, etc. Example: MongoDB, HBase

17
CSD – 2B

3. Write an overview on the history of NoSQL Database.


The term NoSQL originally referred to “non-SQL” or “non-relational”
databases, but the term has since evolved to mean “not only SQL,” as
NoSQL databases have expanded to include a wide range of different
database architectures and data models.
The early 2010s witnessed a surge in the popularity of NoSQL databases as
organizations sought scalable, high-performance solutions for handling big
data and building modern web applications.
NoSQL databases offered flexibility, scalability, and performance advantages
over traditional relational databases in certain use cases. Today, the NoSQL
landscape is diverse, with various types of NoSQL databases catering to
different use cases, including document-based, key-value, column-family,
and graph databases.

18
CSD – 2B

NoSQL databases continue to evolve, offering improved scalability,


performance, and features to meet the demands of modern data-driven
applications.
4. What is Normalization in Database? ***
Normalization in database design is the process of organizing data in a
database to reduce redundancy and dependency. It ensures data integrity
and efficiency of storage and retrieval. It involves breaking down a large
table into smaller, more manageable tables and establishing relationships
between them. The primary goals of normalization are to eliminate data
inconsistencies, improve data consistency, and minimize redundancy.
The types of normalisations are as follows:
1. First Normal Form (1NF):
 Ensures that each column in a table contains atomic (indivisible)
values.
 Eliminates repeating groups and ensures that each row
represents a single, unique record.
2. Second Normal Form (2NF):
 Builds upon 1NF and eliminates partial dependencies.
 Ensures that all non-key attributes are fully dependent on the
entire primary key.
3. Third Normal Form (3NF):
 Builds upon 2NF and ensures that non-key columns are not
dependent on other non-key columns.
4. Boyce-Codd Normal Form (BCNF):
 It ensures that in a table, if one attribute (or group of attributes)
can determine the value of another attribute, then the
determining attribute must be a candidate key (a unique
identifier) of that table.
5. Fourth Normal Form (4NF):
 It addresses a specific type of redundancy known as "multi-
valued dependency" and makes sure it does not exist.
6. Fifth Normal Form (5NF):
 Highest form of normalisation.
 Breaks down the table into smaller parts to avoid data
redundancy and integrity.

5. What is functional dependency? What are the types of functional


dependencies? **
Functional dependency describes the relationship between attributes in such
a way that the value of one attribute uniquely determines the value of
another attribute in the same relation. There are three types of functional
dependencies:

19
CSD – 2B

 Full Functional Dependency: A functional dependency A → B is


considered to be fully functional if B is functionally dependent on A, and
removing any attribute from A will result in the dependency not holding
true anymore.
 Partial Functional Dependency: It occurs when an attribute is
functionally dependent on only a part of a candidate key, rather than
the whole candidate key.
 Multivalued Dependency: Here, entities of the dependent set are not
dependent on each other. If a → {b, c} and there exists no functional
dependency between b and c.
 Transitive Functional Dependency: This type of dependency occurs
when there are three attributes A, B, and C in a relation, where A → B
and B → C, implying A → C indirectly. In other words, the value of A
determines the value of C through the intermediate attribute B.
 Trivial Functional Dependency: Here, a dependent is always a subset
of the determinant. i.e. If X → Y and Y is the subset of X, then it is
called trivial functional dependency
 Non-trivial Functional Dependency: In Non-trivial functional
dependency, the dependent is strictly not a subset of the determinant.
i.e. If X → Y and Y is not a subset of X, then it is called Non-trivial
functional dependency.
6. What is Normalization? Write about 1NF, 2NF, 3NF, BCNF ***
Normalization in database design is the process of organizing data in a
database to reduce redundancy and dependency. It ensures data integrity
and efficiency of storage and retrieval. It involves breaking down a large
table into smaller, more manageable tables and establishing relationships
between them. The primary goals of normalization are to eliminate data
inconsistencies, improve data consistency, and minimize redundancy.
The types of normalisations are as follows:
First Normal Form (1NF):
 Ensures that each column in a table contains atomic (indivisible)
values.
 Eliminates repeating groups and ensures that each row represents a
single, unique record.
Second Normal Form (2NF):
 Builds upon 1NF and eliminates partial dependencies.
 Ensures that all non-key attributes are fully dependent on the entire
primary key.
Third Normal Form (3NF):
 Builds upon 2NF and ensures that non-key columns are not dependent
on other non-key columns.

20
CSD – 2B

Boyce-Codd Normal Form (BCNF):


 It ensures that in a table, if one attribute (or group of attributes) can
determine the value of another attribute, then the determining attribute
must be a candidate key (a unique identifier) of that table.
Fourth Normal Form (4NF):
 It addresses a specific type of redundancy known as "multi-valued
dependency" and makes sure it does not exist.
Fifth Normal Form (5NF):
 Highest form of normalisation.
 Breaks down the table into smaller parts to avoid data redundancy and
integrity.

R 7. Write about decomposition using multivalve dependencies? *


Multivalued Dependency (MVD) is a form of data dependency where two or
more attributes, other than the key attribute, are functionally dependent on
each other, but not on the key itself (or) When one attribute in a database
depends on another attribute and has many independent values, it is said to
have multivalued dependency.
Decomposition using multivalued dependencies is a technique in database
normalization that involves breaking down a table into smaller relations to
remove errors and improve data integrity.
Decomposition using MVDs helps in achieving higher normal forms, which
reduces data redundancy and errors. It ensures data integrity by removing
complex relationships between attributes.
It improves database structure and consistency and is essential for data
integrity and database normalization.
Data errors and redundancies may result from Multivalued Dependency. We
can normalize the database to 4NF in order to get rid of multi valued
Dependency.

R 8. Write about database design methodology for relation databases?


Database design methodology for relational databases involves a systematic
approach to designing and creating a database schema that efficiently
organizes and manages data while ensuring data integrity, security, and
performance.
The Conceptual phase lets you know the entities and the relation between
them. It describes the conceptual schema. The entities & relations are
defined here.
Logical data model provides details about the data to the physical phase.
The physical database design allows the designer to decide on how the
database will be implemented. It gives ER Diagram, data dictionary, schema,
etc.

21
CSD – 2B

UNIT – 4 SAQs
1. What is transaction?
A database transaction is a set of related database operations such as
insertions, updates, or deletions that are treated as a single unit. It ensures
that all operations are either completed successfully or reverted entirely in
case of failure.
OR
Transactions are a set of operations used to program a logical set of work.
2. What are the various states of transactions?
The common states include: Active state, Partially committed state,
Committed state, Failed state, Aborted state and Inactive state.

3. What is Concurrency control and need for Concurrency control?


Concurrency control is a mechanism used in database management systems
to manage multiple simultaneous transactions accessing the same data at
the same time while ensuring data consistency and integrity.
It is needed as it enables efficient resource utilization while avoiding
deadlock situations. It enhances system throughput and performance while
preserving data integrity.

4. What is dead lock?


A deadlock in databases occurs when two or more transactions are waiting
indefinitely for each other to give up locks. Deadlocks need to be detected
and resolved to keep the database running smoothly.
5. What is database recovery?
Database recovery refers to the process of restoring a database to a
consistent state after a failure or crash. It involves replaying committed
transactions from logs and undoing incomplete transactions to maintain data
integrity.
6. What is the need of database recovery?
Database recovery is crucial for preserving data accuracy and system
stability during unexpected failures. It allows organizations to swiftly restore
databases to a reliable state, ensuring continuous business operations,
regulatory compliance, and safeguarding against errors or data loss.
7. What is lock?
A lock is a protective mechanism that controls access to data. It ensures that
only one person or process can work with a piece of information at a time,
preventing conflicts and maintaining data accuracy.
8. What are the Types of locks?
The types include – shared lock and exclusive lock.
Shared lock allows multiple transactions to read data simultaneously but
prevents any transaction from modifying the data.
22
CSD – 2B

Exclusive lock allows only one transaction to modify data while preventing
other transactions from reading or modifying it concurrently.

UNIT – 4 LAQs
1. What is database recovery? What are the various recovery techniques?
***
Recoverability refers to the ability of a system to restore its state to a point
where the integrity of its data is not compromised, especially after a failure or
an error. It involves techniques to bring the database back to a state where
transactions are either fully committed or completely undone, ensuring data
integrity and consistency.
1. Rollback (Undo): In this technique, any uncommitted changes made by
transactions are undone by rolling back their actions. This ensures that
the database is restored to its state before the transaction began.
2. Rollforward (Redo): This technique involves re-applying committed
transactions from transaction logs to recover changes made to the
database since the last backup. It ensures that all committed changes
are reapplied to the database, bringing it up to date.
3. Database Replication: Replication involves maintaining multiple copies
of the database on different servers. In the event of a failure, one of the
replica databases can be promoted to the primary database, ensuring
continuity of service.

These recovery techniques ensure that databases can recover from various
types of failures, such as system crashes, power outages, or disk failures

2. Briefly explain the various ACID properties? ***


The ACID properties are a set of four essential characteristics that guarantee
the reliability and integrity of transactions in database systems:
 Atomicity: Atomicity ensures that transactions are treated as a single
unit of work that either executes entirely or not at all. This means that if
any part of a transaction fails, the entire transaction is rolled back,
leaving the database in its original state. If a transaction aborts, then all
the changes made are not visible whereas if a transaction commits, all
the changes made are visible.

 Consistency: Consistency ensures that transactions bring the database


from one consistent state to another consistent state. In other words,
transactions must preserve the integrity constraints.

23
CSD – 2B

 Isolation: Isolation ensures that the data which is used at the time of
execution of a transaction cannot be used by another transaction until
the first one is executed.

 Durability: Durability ensures that once a transaction is committed, its


changes are permanently saved to the database and cannot be lost.
Durability is typically achieved through various techniques and is used
to indicate the performance of the consistent state.

Together, these ACID properties ensure that database transactions are


reliable, consistent, and maintain the integrity of the database, even in the
presence of failures or concurrent execution.
3. What is database security? Write about various computer-based
controls.
Database security refers to the protection of databases, their contents, and
associated database management systems (DBMS) from unauthorized
access, malicious attacks, and accidental damage. It involves implementing
various measures to ensure confidentiality, integrity, and availability of data
stored within a database. Various computer-based controls used to enhance
database security are:
 Authentication: These mechanisms verify the identity of users
attempting to access the database. This includes methods such as
username/password authentication, multi-factor authentication (e.g.,
using biometrics)
 Authorization: It controls determine what actions users are allowed to
perform within the database. This involves assigning privileges and
permissions to users.
 Encryption: These techniques are used to protect sensitive data stored
in the database by converting it into ciphertext that can only be
decrypted with the appropriate decryption key.
 Backup and Recovery: Regularly backing up the database to ensure
data availability and integrity in case of data loss or a security breach.

Implementing these controls helps organizations strengthen the security of


their databases and reduce the risk of unauthorized access, data breaches,
and other security threats

4. What is concurrency control? What are the problems associated with


Concurrency control? **
Concurrency control is a mechanism used in database management systems
to manage multiple simultaneous transactions accessing the same data at
the same time while ensuring data consistency and integrity. The problems
associated include:

24
CSD – 2B

1. Concurrency Overhead: Introducing concurrency control mechanisms


such as locks, timestamps, or multi version concurrency control
(MVCC) can incur overhead in terms of increased resource utilization
(e.g., memory, CPU) and potential performance degradation.
2. Deadlocks: Occur when two or more transactions are waiting
indefinitely for each other to release locks on resources, preventing
progress and leading to a system deadlock.
3. Concurrency Control Mechanism Complexity: Implementing
effective concurrency control mechanisms can be complex, especially
in distributed or high-concurrency environments. Different concurrency
control techniques have different trade-offs in terms of performance,
scalability, and complexity.

To address these problems, various concurrency control techniques are


employed in DBMS, such as locking, timestamp ordering, optimistic
concurrency control, multi version concurrency control, and snapshot
isolation, each with its own advantages and limitations. The choice of
concurrency control mechanism depends on factors such as the application
requirements, workload characteristics, and scalability considerations.
5. Write about concurrency control with locking methods? *
Concurrency control with locking methods is a technique used in database
management systems to manage concurrent access to shared data by
multiple transactions. Locking mechanisms prevent conflicts and ensure data
consistency by allowing transactions to acquire and release locks on
resources (such as rows, tables, or pages) during their execution. There are
several locking methods used in concurrency control:
1. Exclusive Lock (X - Lock):
 An exclusive lock allows a transaction to read and write data. It
prevents other transactions from reading or modifying it
concurrently.
 Only one transaction can hold an exclusive lock on a resource at
a time.
 It is used when a transaction intends to modify data to maintain
data integrity and prevent lost updates.
2. Shared Lock (S - Lock):
 A shared lock allows transaction to only read the data, preventing
any transaction from modifying it while the shared lock is held.
 Multiple transactions can hold shared locks on the same resource
simultaneously.
 It is used when transactions only need to read data and do not
intend to modify it, ensuring data consistency and preventing dirty
reads.

25
CSD – 2B

Concurrency control with locking methods allows transactions to execute


safely in a multi-user database environment by preventing conflicts and
ensuring data consistency and integrity. However, improper use of locking
mechanisms can lead to issues such as deadlock and reduced system
performance.
6. Write about concurrency control with time stamping methods?
Concurrency control with timestamping methods is a technique used in
database management systems to manage concurrent access to shared
data by assigning a unique timestamp to each transaction. Timestamping
allows the system to determine the relative order of transactions and resolve
conflicts based on their timestamps.
There are two primary timestamp - based concurrency control methods:
1. Timestamp Based Protocol:
 The Timestamp Ordering Protocol is used to order the
transactions based on their Timestamps. The order of transaction
is nothing but the ascending order of the transaction creation.
 Transactions are ordered based on their timestamps, and
conflicting operations are resolved according to this order.
 The priority of the older transaction is higher that's why it
executes first. To determine the timestamp of the transaction, this
protocol uses system time or logical counter.
 Basic Timestamp ordering protocol works as follows:
 Check the following condition whenever a transaction Ti issues
a Read (X) operation:
 If W_TS(X) >TS(Ti) then the operation is rejected.
 If W_TS(X) <= TS(Ti) then the operation is executed.
 Timestamps of all the data items are updated.
 Check the following condition whenever a transaction Ti issues
a Write(X) operation:
 If TS(Ti) < R_TS(X) then the operation is rejected.
 If TS(Ti) < W_TS(X) then the operation is rejected and Ti is rolled
back otherwise the operation is executed.
Concurrency control with timestamping methods provides a systematic
approach to managing concurrent access to data by assigning unique
timestamps to transactions and resolving conflicts based on these
timestamps.

7. How do you avoid, detect, and prevent deadlock situation? ***


A deadlock in databases occurs when two or more transactions are waiting
indefinitely for each other to release resources needed to proceed.
Deadlocks need to be detected and resolved to keep the database running
smoothly. Avoiding, detecting, and preventing deadlock situations is

26
CSD – 2B

essential for maintaining the stability and performance of database systems.


Here are strategies to address each aspect:
1. Avoiding Deadlocks:
 One approach to avoid deadlocks is to design the application in a
way that minimizes the likelihood of conflicts between
transactions.
 This helps prevent transactions from waiting indefinitely and
potentially causing deadlocks.
2. Detecting Deadlocks:
 DBMS often include deadlock detection mechanisms to identify
deadlock situations when they occur. These mechanisms
periodically scan the system for potential deadlock cycles, where
transactions are waiting for resources held by other transactions.
 When a deadlock is detected, the database system can take
action to resolve it, such as aborting one of the involved
transactions to break the deadlock cycle.
3. Preventing Deadlocks:
 One common approach to preventing deadlocks is to use locking
protocols and techniques that minimize the likelihood of deadlock
formation.
 Another approach can be to implement concurrency control
techniques such as multi-version concurrency control (MVCC).
UNIT – 5 SAQs
1. What are the different types of data storages?
The types of data storages are primary, secondary and tertiary.
1. Primary storage - main memory and cache.
2. Secondary memory - flash memory and magnetic disk storage.
3. Tertiary storage – optical and tape storage

2. Write a short note on primary storage.


It is the primary area that offers quick access to the stored data. We also
know the primary storage as volatile storage. It is because this type of
memory does not permanently store the data. As soon as the system leads
to a power cut or a crash, the data also get lost. Main memory and cache are
the types of primary storage.

3. Write about magnetic disk storage.


This type of storage media is also known as online storage media. A
magnetic disk is used for storing the data for a long time. It does not affect
the data due to a system crash or failure, but a disk failure can easily ruin as
well as destroy the stored data.

27
CSD – 2B

4. How are files organized in DBMS?


Files in a Database Management System (DBMS) are organized in a
structured manner to efficiently store and manage data. This is done using
heap, sequential, indexed, hashed, clustered, or B+ file organization
techniques. It defines how the files records are mapped onto the disc blocks.
5. What is B+ tree?
B+ tree is a balanced tree data structure commonly used in databases for
efficient indexing. It stores keys in sorted order within internal nodes,
separates data and index nodes. It provides fast searches and sequential
access.
6. Write full form of ISAM.
The full form of ISAM is "Indexed Sequential Access Method."

7. Define Hashing.
Hashing is a technique used to search data on the disk without utilising an
indexed structure. It's commonly used in databases for efficient storage,
retrieval, and comparison of data.

UNIT – 5 LAQs
1. Explain in short, the various file organizations in DBMS. **
File organization in a Database Management System (DBMS) refers to the
way data is organized and stored on disk. Different file organizations offer
various advantages and disadvantages in terms of efficiency, ease of
access, and maintenance. Here are some common file organizations in
DBMS:
1. Heap (or Unordered) File Organization:
 In a heap file organization, records are stored in an unordered
manner.
 Records are inserted at the end of the file, and there is no
specific order maintained.
 This approach is simple and requires minimal overhead, but it
can lead to inefficient data retrieval since records may be
scattered throughout the file.
2. Sequential File Organization:
 In a sequential file organization, records are stored based on a
primary key.
 This can be implemented in two ways:
 Pile File method is used to store the records in a sequence which
is one after the other.
 Sorted File method is used to sort the records after inserting each
new record at the end of file.

3. ISAM:
28
CSD – 2B

 In this method, records are stored using the primary key.


 Indexes contain key values and pointers to the corresponding
records, allowing for direct access to records based on the
indexed key.
 This approach provides faster access compared to sequential file
organization but requires additional storage space for maintaining
indexes.
4. Hashed File Organization:
 In a hashed file organization, records are stored in a hash table
based on a hash function applied to a key field.
 The hash function maps keys to bucket addresses, allowing for
direct access to records based on the hashed key.
 Hashing can provide very fast access to individual records, but it
may suffer from collisions (multiple keys mapping to the same
bucket).
5. Clustered File Organization:
 In a clustered file organization, records with similar values for one
or more fields are physically stored together.
 Clustering can improve performance for certain types of queries,
especially those that involve range queries or access to related
records.
 It reduces the cost of searching various records in different files.
6. B+ File Organization:
 It is an advanced way of ISAM.
 It uses a tree like structure to store records in a file.
 It is similar to binary search tree but it can have more than two
children.
Each file organization has its own advantages and limitations, and the choice
of file organization depends on factors such as the nature of the data, access
patterns, performance requirements, and storage constraints.

2. Briefly explain the various data storages in DBMS.


In a Database Management System (DBMS), data storage refers to the
physical representation of data on storage devices such as hard drives,
solid-state drives (SSDs), or other types of storage media. Different data
storage techniques are employed to efficiently manage and access data
within a database. Here are some common data storage techniques in
DBMS:

1. Primary Storage:
 Primary storage offers quick access to the stored data.
 We also know the primary storage as volatile storage.

29
CSD – 2B

 It is because this type of memory does not permanently store the


data. As soon as the system leads to a power cut or a crash, the
data also get lost.
 Main memory and cache are the types of primary storage.
 Main Memory: It is responsible for operating the data that is
available by the storage medium.
 A cache is a tiny storage media which is maintained by the
computer hardware.
2. Secondary Storage:
 It is the storage area that allows the user to save and store data
permanently.
 This type of memory does not lose the data due to any power
failure or system crash. It is also known as non-volatile storage.
 A flash memory stores data in USB keys. These USB keys help
transfer data to a computer system, but it varies in size limits.
 Magnetic Disk Storage is a type of storage media is also known
as online storage media. A magnetic disk is used for storing the
data for a long time. It is capable of storing an entire database.
3. Tertiary Storage:
 It is the storage type that is external from the computer system. It
has the slowest speed. But it is capable of storing a large amount
of data.
 It is also known as Offline storage. Tertiary storage is generally
used for data backup.
 An optical storage can store megabytes or gigabytes of data. It is
an example of tertiary storage.
 Tape Storage is the cheapest storage medium than disks.
Generally, tapes are used for archiving or backing up the data.

3. Differentiate between B & B+ Tree. ***


B-trees and B+ trees are both types of self-balancing search trees commonly
used in database systems and file systems for efficient indexing and retrieval
of data.
B Tree B+ Tree
Contains both internal and leaf Only contains internal nodes, while
nodes. actual data is stored in leaf nodes.
Keys and pointers are stored in all Keys are stored only in leaf nodes.
nodes.
Search path may involve both Search path involves only internal
internal and leaf nodes. nodes.
Leaf nodes may not be completely Leaf nodes are always fully filled.
filled.

30
CSD – 2B

Slower insertion and deletion due to Faster insertion and deletion as only
updates needed in multiple node leaf nodes need updating.
types
Less efficient for range scans More efficient for range scans
Leaf nodes can contain data or Leaf nodes only contain actual data
pointers to data.
4. Write the difference between static & dynamic hashing. ***
Static hashing and dynamic hashing are both techniques used in database
systems for organizing and accessing data efficiently, particularly in hash-
based indexing structures. However, they differ in their approach to handling
hash collisions and dynamically adjusting the hash structure.

Static Hashing Dynamic Hashing


Fixed number of buckets allocated Number of buckets can grow or
initially shrink dynamically
Overflow buckets or chaining may Splitting or merging of buckets
be used dynamically
May lead to uneven distribution of Tends to maintain more balanced
keys bucket utilization
Generally faster due to fixed May incur overhead due to dynamic
structure adjustments
Fixed memory allocation for buckets Memory usage can grow or shrink
dynamically
Not efficient More efficient
Generally simpler due to fixed More complex due to dynamic
structure adjustments
5. Elaborate the concept on indexing in DBMS. *
Indexing in Database Management Systems (DBMS) is a technique used to
improve the efficiency of data retrieval operations, such as searching,
sorting, and joining, by creating data structures that allow for fast access to
specific records or subsets of records.
Indexes are created on one or more columns of a table and provide a way to
quickly locate rows based on the indexed columns' values.
Here's an elaboration on the concept of indexing in DBMS:
1. Purpose of Indexing:
 Indexing aims to speed up data retrieval operations by reducing
the time required to search for specific records in large datasets.
 It enhances query performance by allowing the DBMS to locate
rows quickly without scanning the entire table.
 Indexes are particularly useful for columns frequently used in
search conditions, joins, and sorting operations.

31
CSD – 2B

2. Types of Indexes:
 Primary Index: An index created on the primary key of a table to
enforce the primary key constraint and facilitate fast retrieval of
rows based on their primary key values.
 Secondary Index: An index created on non-primary key columns
to speed up queries that don't use the primary key, improving the
performance of search conditions involving other columns.
 Clustered Index: An index that reorders the physical order of
rows in the table based on the indexed column's values, resulting
in faster retrieval of rows but may require reordering the data
when the indexed column is updated.
 Non-clustered Index: An index that stores the index entries
separately from the actual data rows, allowing for faster retrieval
of index entries but potentially slower retrieval of data rows.
3. Index Maintenance:
 Indexes require maintenance to remain effective as the
underlying data changes.
 Insertions, updates, and deletions to indexed columns may
require updating the corresponding index entries to reflect the
changes.

- 160922750086

32

You might also like