0% found this document useful (0 votes)
107 views13 pages

Model Ans Paper Btaic402

The document discusses a database management systems exam containing questions about key database concepts. 1) The exam contains questions about data, database, schema, metadata, DBMS vs RDBMS, normalization forms, data modeling, and CAP theorem. 2) Answers to sample questions define terms like data, database, schema, and metadata. They also explain the three-tier architecture, differences between DBMS and RDBMS, and conditions for normalization forms. 3) The exam tests understanding of database languages, data modeling, and consistency, availability, and partition tolerance in distributed databases.

Uploaded by

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

Model Ans Paper Btaic402

The document discusses a database management systems exam containing questions about key database concepts. 1) The exam contains questions about data, database, schema, metadata, DBMS vs RDBMS, normalization forms, data modeling, and CAP theorem. 2) Answers to sample questions define terms like data, database, schema, and metadata. They also explain the three-tier architecture, differences between DBMS and RDBMS, and conditions for normalization forms. 3) The exam tests understanding of database languages, data modeling, and consistency, availability, and partition tolerance in distributed databases.

Uploaded by

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

DR.

BABASAHEB AMBEDKAR TECHNOLOGICAL UNIVERSITY, LONERE


Regular/ Supplementary Summer Examination – 2023
Course: B. Tech. Branch : CSE(AI&DS)/AI&DS Semester : IV
Subject Code & Name:BTAIC402 / Database Management System
Max Marks: 60 Date: 15-07-23 Duration: 3 Hr.
Instructions to the Students:
1. All the questions are compulsory.
2. The level of question/expected answer as per OBE or the Course Outcome (CO)
on which the question is based is mentioned in ( ) in front of the question.
3. Use of non-programmable scientific calculators is allowed.
4. Assume suitable data wherever necessary and mention it clearly.
(Level/CO) Marks
Q. 1 Solve Any Two of the following. 12
A) Define Data, Information,database, Metadata, instance and schema. CO1 6
Data – Data is a collection of raw facts.
Information – The processed data is called as information.
Database - A database is an organized collection of structured
information, or data, typically stored electronically in a computer system.
Metadata - A database is an organized collection of structured
information, or data, typically stored electronically in a computer system.
Schema - The overall design of the database is called database schema.
Instance - Instance or extension or database state is a collection of
information that stored in a database at a particular moment is called an
instance of the database.
B) Difference between DBMS & RDBMS. CO1 6
C) Explain with diagram the three tier architecture CO1 6

Tier-3 Architecture
The 3-tier architecture contains one more layer between the client and the
server.
 In this architecture, there is no direct communication between client
and server.
 Mainly, the 3-tier is used for large applications on the web.
 The features of 3-tier architecture are data backup, recovery,
security, and concurrency control.

Layers
The 3-tier architecture consists of the three layers as follows −
 Presentation layer − This layer is also called the client layer. The
front-end layer consists of a user interface. The main purpose is to
communicate with the application layer.
 Application layer − This layer is also called the business logic layer.
It acts as a middle layer between the client and the database server
which are used to exchange partially processed data.
 Database layer − In this layer the data or information is stored. This
layer performs operations like insert, update and delete to connect
with the database.
Diagram :

Q.2 Solve Any Two of the following. 12


A) Explain Database languages with syntax and example. CO2 6
Students should explain about DDL DML DCL TCL with syntax and
example.
B) What is the need of Normalization? Write necessary conditions for CO2 6
1NF,2NF,3NF and BCNF
Normalization is the process of organizing data in a database to reduce
redundancy and dependency. The main objective of normalization is to
eliminate data redundancy and ensure data integrity by dividing larger tables
into smaller, more manageable tables. This helps to ensure that data is
consistent, reliable, and easy to maintain.
The following are the necessary conditions for the normalization forms:
1. First Normal Form (1NF):
• Elimination of duplicate data
• Single valued attributes
• Each attribute must have a unique name
• Data should be presented in a tabular format with rows and columns
2. Second Normal Form (2NF):
• Must satisfy all the conditions of 1NF
• All non-key attributes must be dependent on the primary key
• Should not have partial dependencies
3. Third Normal Form (3NF):
• Must satisfy all the conditions of 2NF
• All non-key attributes should be independent of each other
• Should not have transitive dependencies
4. Boyce-Codd Normal Form (BCNF):
• Must satisfy all the conditions of 3NF
• Every determinant must be a candidate key
In summary, normalization is important in database design to ensure data
consistency, reliability, and efficiency. By dividing tables into smaller, more
manageable tables, it helps to eliminate data redundancy and ensure that
data is properly organized and structured. The normalization process results
in a database that is easier to maintain, update, and query.
C) Explain in detail the Data Model and its types. CO2 6
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. This model was initially described by Edgar F. Codd, in 1969. 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. This model was designed by Peter Chen and published in 1976
papers. 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.
4) Semistructured Data Model: This type of data model is different from
the other three data models (explained above). The semistructured 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
semistructured 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.

Q. 3 Solve Any Two of the following. 12


A) Explain CAP theorem with diagram. CO3 6
Consistency –
Consistency means that the nodes will have the same copies of a replicated
data item visible for various transactions. A guarantee that every node in a
distributed cluster returns the same, most recent and a successful write.
Consistency refers to every client having the same view of the data. There
are various types of consistency models. Consistency in CAP refers to
sequential consistency, a very strong form of consistency.
 Availability –
Availability means that each read or write request for a data item will
either be processed successfully or will receive a message that the
operation cannot be completed. Every non-failing node returns a
response for all the read and write requests in a reasonable amount of
time. The key word here is “every”. In simple terms, every node (on
either side of a network partition) must be able to respond in a
reasonable amount of time.

 Partition Tolerance –
Partition tolerance means that the system can continue operating
even if the network connecting the nodes has a fault that results in
two or more partitions, where the nodes in each partition can only
communicate among each other. That means, the system continues to
function and upholds its consistency guarantees in spite of network
partitions. Network partitions are a fact of life. Distributed systems
guaranteeing partition tolerance can gracefully recover from
partitions once the partition heals.
CA(Consistency and Availability)-
The system prioritizes availability over consistency and can respond with
possibly stale data.
Example databases: Cassandra, CouchDB, Riak, Voldemort.
 AP(Availability and Partition Tolerance)-
The system prioritizes availability over consistency and can respond with
possibly stale data.
The system can be distributed across multiple nodes and is designed to
operate reliably even in the face of network partitions.
Example databases: Amazon DynamoDB, Google Cloud Spanner.
 CP(Consistency and Partition Tolerance)-
The system prioritizes consistency over availability and responds with the
latest updated data.
The system can be distributed across multiple nodes and is designed to
operate reliably even in the face of network partitions.
Example databases: Apache HBase, MongoDB, Redis.

B) Explain NOSQL along with the types of NOSQL database. CO3 6

Over time, four major types of NoSQL databases emerged: document


databases, key-value databases, wide-column stores, and graph databases.
 Document databases store data in documents similar to JSON
(JavaScript Object Notation) objects. Each document contains pairs
of fields and values. The values can typically be a variety of types
including things like strings, numbers, booleans, arrays, or objects.
 Key-value databases are a simpler type of database where each item
contains keys and values.
 Wide-column stores store data in tables, rows, and dynamic
columns.
 Graph databases store data in nodes and edges. Nodes typically
store information about people, places, and things, while edges store
information about the relationships between the nodes.
C) Write the differences between RDBMS and NOSQL CO3 6
Q.4 Solve Any Two of the following. 12
A) Describe the properties of Key-Value Store CO4 6
Key-Value Store (KVS) is a type of NoSQL database that stores data as a
collection of key-value pairs. In a KVS, each key is unique, and it
corresponds to a specific value. KVS databases have the following
properties:
1. Schemaless: Key-Value stores are schemaless databases, meaning that
they do not enforce any fixed data structure or schema. This allows for
flexibility in data modeling and reduces the overhead of schema
design.
2. High Scalability: KVS databases are designed to be highly scalable and
can handle large amounts of data and high traffic loads. They achieve this by
distributing data across multiple servers and using horizontal scaling to add
more nodes to the system as needed.
3. High Performance: KVS databases are optimized for high performance
and low latency. They achieve this by using in-memory caching and
efficient data retrieval techniques, such as hash-based indexing.
4. Fault Tolerance: KVS databases are designed to be fault-tolerant and
resilient to hardware failures. They achieve this by replicating data across
multiple servers and using techniques such as sharding and load
balancing to ensure that data is always available.
5. Simple API: KVS databases have a simple API that is easy to use and
requires minimal programming effort. They provide basic operations such as
get, put, and delete for manipulating data.
6. Limited Querying Capabilities: KVS databases are not well-suited for
complex queries or ad-hoc analysis. They are optimized for simple key-
value lookups, and therefore, querying capabilities are limited.
B) Describe distributed database system with suitable diagram CO4 6
A distributed database system is a collection of multiple interconnected
databases that are spread across different geographic locations and
communicate with each other over a network. The purpose of a distributed
database system is to improve data availability, performance, and fault
tolerance.
Here's a diagram that illustrates the architecture of a distributed database
system:

In the diagram, there are four different sites, each with its own
DBMS (Database Management System). The sites are connected to each
other over a network, such as the internet, and communicate with each other
to share data and maintain consistency.
Each site has its own local database, which is managed by its local DBMS.
The local databases can be of different types, such as relational, document-
oriented, graph-based, or key-value stores, depending on the requirements
of the application.
The distributed database system uses a middleware layer that provides a
common interface to access and manage the distributed data. The
middleware layer handles the distribution of data, replication,
synchronization, and query processing across multiple databases. It also
provides mechanisms for transaction management, concurrency control, and
data security.
In a distributed database system, data is stored across multiple nodes, and
each node may have a copy of the data. This redundancy provides fault
tolerance and high availability. If one node fails or becomes unavailable, the
data can be accessed from another node.
Overall, a distributed database system allows organizations to distribute data
across multiple locations, making it available to users and applications
worldwide. It provides high performance, scalability, fault tolerance, and
data consistency, making it a popular choice for large-scale applications
C) Draw Cassandra Architecture with various components. Explain each CO4 6
component in brief
Here's a diagram that illustrates the architecture of Apache Cassandra, a
popular distributed NoSQ L database system:

Here's a brief description of each component:


1. Client: The client is any application that accesses the Cassandra database
through the Cassandra Query Language (CQL). Clients can connect to any
node in the cluster and issue CQL statements to query or modify data.
2. Coordinator: The coordinator node is responsible for receiving and
processing client requests. When a client sends a request, the coordinator
node determines which nodes in the cluster need to be contacted
to satisfy the request.
3. Replica: A replica is a copy of the data that is stored on multiple nodes in
the cluster. Cassandra uses a replication strategy to determine how many
replicas are created and where they are stored. Replicas provide fault
tolerance and high availability in case of node failures.
4. Commit Log: The commit log is a file that is used to record all changes to
the data. When a write operation is performed, the data is first written to the
commit log before being stored in memory or on disk.
5. Memtable: The memtable is an in-memory data structure that holds
recently updated data. When data is written to Cassandra, it is first stored in
the memtable before being flushed to disk as an SSTable.
6. SSTable: The SSTable is an immutable on-disk data structure that stores
data in sorted order. Cassandra uses SSTables to store data that has been
flushed from the memtable. SSTables are periodically merged to reduce the
number of files on disk and improve query performance.

Q. 5 Solve Any Two of the following. 12


A) Explain various graph representation techniques (data structures) with CO5 6
suitable examples
Graphs are mathematical structures that consist of vertices (or nodes) and
edges. Graphs are used to model
complex systems and relationships between entities. There ar e different
ways to represent a graph in a data
structure. Here are some of the most common techniques:
1. Adjacency Matrix: An adjacency matrix is a 2D array where the rows and
columns represent the vertices in
the graph. The value in each cell represents whether there is an edge
between the two vertices. If there is
an edge, the value is 1, otherwise, it is 0. Here's an example:
0123
+------------
0|0110
1|1011
2|1101
3|0110
In this example, there are four vertices and six edges. The value in cell (0,1)
is 1, indicating that there is an edge
between vertices 0 and 1.
2. Adjacency List: An adjacency list is a collection of linked lists, where
each linked list represents the edges
connected to a vertex. Here's an example:
0 -> 1 -> 2
1 -> 0 -> 2 -> 3
2 -> 0 -> 1 -> 3
3 -> 1 -> 2
In this example, vertex 0 is connected to vertices 1 and 2, and so on. Each
vertex is represented as a node in the
linked list, and each node contains a pointer to the next node in the list.
3. Edge List: An edge list is a list of tuples, where each tuple represents an
edge in the graph. Here's an
example:
[(0,1), (0,2), (1,0), (1,2), (1,3), (2,0), (2,1), (2,3), (3,1), (3,2)]
In this example, there are four vertices and six edges. Each tuple represents a
pair of vertices that are connected
by an edge.
4. Incidence Matrix: An incidence matrix is a 2D array where the rows
represent the vertices and the
columns represent the edges. The value in each cell represents whether the
vertex is connected to the
edge. If the vertex is the source of the edge, the value is 1, if it is the
destination, the value is -1, and if it
is not connected to the edge, the value is 0. Here's an example:
012345
+-------------------
0|110000
1 |-1 0 1 1 0 0
2 | 0 -1 -1 0 1 1
3 | 0 0 0 -1 -1 -1
In this example, there are four vertices and six edges. The value in cell (0,0)
is 1, indicating that vertex 0 is the
source of edge 0, and the value in cell (2,4) is 1, indicating that vertex 2 is
the destination of edge 4.
Each representation technique has its advantages and disadvantages
depending on the use case. For example,
adjacency matrices are efficient for dense graphs, while adjacency lists are
efficient for sparse graphs. Edge lists
are useful for storing edge attributes, and incidence
B) Explain properties of graph database model. CO5 6
The graph database model is a database model that uses graph structures for
semantic queries with nodes, edges, and properties to represent and store
data. Here are some of the properties of the graph database model:
1. Nodes: Nodes represent entities or objects in the graph database. Each
node can have a set of properties that describe it, such as a name, age, or
location. Nodes can also have labels that group them into categories or
types.
2. Edges: Edges represent relationships between nodes in the graph
database. Each edge has a type that describes the relationship between the
nodes, such as "friend", "follows", or "likes". Edges can also have properties
that describe the relationship, such as a weight or timestamp.
3. Properties: Properties are attributes of nodes and edges that provide
additional information about them. Properties can be simple values like
strings, numbers, or dates, or more complex data structures like arrays,
maps, or nested objects.
4. Traversals: Graph databases support graph traversals, which allow users
to traverse the graph from one node to another using a set of rules or
conditions. Traversals can be used to find nodes that match certain criteria
or to explore the graph structure.
5. Indexing: Graph databases use indexing to speed up graph traversals and
queries. Indexes can be created on nodes, edges, and properties to improve
query performance.
6. Cypher Query Language: Graph databases typically use a query language
called Cypher, which is designed specifically for querying graph data.
Cypher allows users to express graph patterns and relationships using a
syntax that is similar to natural language.
7. Scalability: Graph databases are designed to be highly scalable and can
handle large amounts of data and complex queries. Many graph databases
are also designed to be distributed, allowing them to be scaled out across
multiple machines.
C) List and explain various CRUD operations of MongoDB with syntax CO4 6
and example.

Create Operations –
The create or insert operations are used to insert or add new documents in
the collection. If a collection does not exist, then it will create a new
collection in the database. You can perform, create operations using the
following methods provided by the MongoDB:

db.collection.insertOne() It is used to insert a single document in the


collection
db.collection.insertMany() It is used to insert multiple documents in the
collection.
db.createCollection()It is used to create an empty collection.

Read Operations –
The Read operations are used to retrieve documents from the collection, or
in other words, read operations are used to query a collection for a
document. You can perform read operation using the following method
provided by the MongoDB
db.collection.find()It is used to retrieve documents from the collection.

Update Operations –
The update operations are used to update or modify the existing document in
the collection. You can perform update operations using the following
methods provided by the MongoDB:
db.collection.updateOne() It is used to update a single document in the
collection that satisfy the given criteria.
db.collection.updateMany()It is used to update multiple documents in the
collection that satisfy the given criteria.
db.collection.replaceOne()It is used to replace single document in the
collection that satisfy the given criteria.

Delete Operations –
The delete operation are used to delete or remove the documents from a
collection. You can perform delete operations using the following methods
provided by the MongoDB:
db.collection.deleteOne() It is used to delete a single document from the
collection that satisfy the given criteria.
db.collection.deleteMany()It is used to delete multiple documents from the
collection that satisfy the given criteria.
*** End ***
The grid and the borders of the table will be hidden before final printing.

You might also like