Assignment 1
Assignment 1
SUBMITTED FROM:
AFIFA MARYUM
REGISTRATION NO.:
FA17-BCE-038
SUBMITTED TO:
Sir Bicktash Ali Jahangir
SUBJECT:
Data Structures
DATE:
5th October, 2019.
QUESTION # 1:
List types of Database Management Systems and briefly
explain each:
1. Hierarchical Databases:
In a hierarchical database management systems (hierarchical DBMSs) model, data is stored
in a parent-children relationship nodes. In a hierarchical database, besides actual data, records
also contain information about their groups of parent/child relationships.
In a hierarchical database model, data is organized into a tree like structure. The data is
stored in form of collection of fields where each field contains only one value. The records are
linked to each other via links into a parent-children relationship. In a hierarchical database
model, each child record has only one parent. A parent can have multiple children.
To retrieve a field’s data, we need to traverse through each tree until the record is found.
2. Network Databases:
Network database management systems (Network DBMSs) use a network structure to create
relationship between entities. Network databases are mainly used on a large digital computers.
Network databases are hierarchical databases but unlike hierarchical databases where one
node can have one parent only, a network node can have relationship with multiple entities. A
network database looks more like a cobweb or interconnected network of records.
In network databases, children are called “members” and parents are called “occupier”. The
difference between each child and member can have more than one parent.
The approval of the network data model is similar to a hierarchical data model. Data in a
network database is “organized in many-to-many relationships”.
3. Relational Databases:
In relational database management systems (RDBMS), the relationship between data is
relational and data is stored in tabular form of columns and rows. Each column if a table
represents an attribute and each row in a table represents a record. Each field in a table represents
a data value.
o Used to:
Structured Query Language (SQL) is a language used to query a RDBMS including
inserting, updating, deleting, and searching records.
o Works on:
Relational databases work on each table has a key field that uniquely indicates each row,
and that these key fields can be used to connect one table of data to another.
5. Graph Databases:
Graph Databases are “NoSQL databases”.
o Used to:
Use a graph structure for “sematic queries’.
o Stored in:
The data is stored in form of nodes, edges, and properties.
In a graph database:
A Node represent an “entity or instance” such as customer, person, or a car. A node
is equivalent to a record in a relational database system.
An Edge in a graph database represents a “relationship” that connects nodes.
Properties are additional information added to the nodes.
6. ER Model Databases :
An ER model is typically implemented as a database. In a simple relational database
implementation
Each row of a table represents one instance of an entity type
Each field in a table represents an attribute type.
In a relational database a relationship between entities is implemented by storing the primary
key of one entity as a “pointer or foreign key" in the table of another entity.
7. Document Databases:
Document databases (Document DB) are also “NoSQL database” that store data in form of
documents.
Each document represents the data, its relationship between other data elements, and
attributes of data. Document database store data in a key value form.
Document DB has become popular recently due to their document storage and NoSQL
properties. NoSQL data storage provide faster mechanism to store and search documents.
8. NoSQL Databases:
NoSQL databases are the databases that do not use SQL as their primary data access
language.
NoSQL database do not have predefined schemas, which makes NoSQL databases a perfect
candidate of rapid changing development environments. NoSQL allows developers to make
changes on the fly without affecting applications.
o Characterized in :
NoSQL databases can be categorized in the following five major categories:
Column, Document, Graph, Key-value and Object databases.
o Ten NoSQL Databases:
Here is a list of 10 popular NoSQL databases:
Cosmos DB
ArangoDB
Couchbase Server
CouchDB
Amazon DocumentDB
MongoDB, CouchBase
Elasticsearch
Informix
SAP HANA
Neo4j
Question # 2:
List types of databases and briefly explain each:
Database :
“A database is an electronic system that allows data to be easily accessed, manipulated
and updated.”
There are following types of databases available in the market:
1. Centralized database.
2. Distributed database.
3. Personal database.
4. End-user database.
5. Commercial database.
6. NoSQL database.
7. Operational database.
8. Relational database.
9. Cloud database.
10. Object-oriented database.
11. Graph database.
1. Centralized Database:
The information (data) is stored at a centralized location and the users from different
locations can access this data. This type of database contains application procedures that help the
users to access the data even from a remote location.
Various kinds of authentication procedures are applied for the verification and validation of
end users, likewise, a registration number is provided by the application procedures which keeps
a track and record of data usage. The local area office handles this thing.
2. Distributed Database:
The distributed database has contributions from the common database as well as the
information captured by local computers also. The data is not at one place and is distributed at
various sites of an organization. These sites are connected to each other with the help of
communication links which helps them to access the distributed data easily.
a distributed database as a one in which various portions of a database are stored in multiple
different locations(physical) along with the application procedures which are replicated and
distributed among various points in a network.
o Types of Distributed database:
There are two kinds of distributed database:
Homogenous distributed database
Heterogeneous distributed database
The databases which have same underlying hardware and run over same operating systems
and application procedures are known as “Homogeneous DDB”.
The operating systems, underlying hardware as well as application procedures can be
different at various sites of a DDB which is known as “Heterogeneous DDB”.
3. Personal Database:
Data is collected and stored on personal computers which is small and easily manageable.
The data is generally used by the same department of an organization and is accessed by a small
group of people
4. End User Database:
The end user is usually not concerned about the transaction or operations done at various
levels and is only aware of the product which may be a software or an application. Therefore,
this is a shared database which is specifically designed for the end user, just like different levels’
managers. Summary of whole information is collected in this database.
5. Commercial Database:
These are the paid versions of the huge databases designed uniquely for the users who want
to access the information for help. These databases are “subject specific”, and one cannot afford
to maintain such a huge information. Access to such databases is provided through commercial
links.
6. NoSQL Database:
These are used for large sets of distributed data. There are some big data performance issues
which are effectively handled by relational databases, such kind of issues are easily managed by
NoSQL databases. There are very efficient in analyzing large size unstructured data that may be
stored at multiple virtual servers of the cloud.
7. Operational Database:
Information related to operations of an enterprise is stored inside this database. Functional
lines like marketing, employee relations, customer service etc. require such kind of databases.
8. Relational Databases:
These databases are categorized by a set of tables where data gets fit into a pre-defined
category. The table consists of rows and columns.
Column has an entry for data for a specific category
Rows contains instance for that data defined according to the category.
The Structured Query Language (SQL) is the standard user and application program interface
for a relational database.
9. Cloud Databases:
A cloud database is a database that has been optimized or built for such a virtualized
environment.
o Advantages:
There are various advantages of a cloud database:
The ability to pay for storage capacity and bandwidth on a per-user basis, and
they provide scalability on demand, along with high availability.
A cloud database also gives enterprises the opportunity to support business
applications in a software-as-a-service deployment.
10. Object-Oriented Databases:
An object-oriented database is a collection of object-oriented programming and relational
database. There are various items which are created using object-oriented programming
languages like C++, Java which can be stored in relational databases, but object-oriented
databases are well-suited for those items.
An object-oriented database is organized around objects rather than actions, and data rather
than logic.
Database Models:
A database model shows the logical structure of a database, including the relationships and
constraints that determine how data can be stored and accessed.
o Types of database models:
There are many kinds of data models. Some of the most common ones include:
2. Hierarchical model:
The hierarchical model organizes data into a tree-like structure.
Where each record has a single parent or root. Sibling records are sorted in a particular
order. That order is used as the physical order for storing the database. This model is good for
describing many real-world relationships.
3. Network model:
The network model builds on the hierarchical model by allowing “many-to-many
relationships” between linked records, implying multiple parent records. Based on mathematical
set theory, the model is constructed with sets of related records.
Each set consists of one owner or parent record and one or more member or child
records. A record can be a member or child in multiple sets, allowing this model to “convey
complex relationships”.
5. Object-relational model:
This hybrid database model combines the simplicity of the relational model with some of
the advanced functionality of the object-oriented database model. In essence, it allows designers
to incorporate objects into the familiar table structure.
6. Entity-relationship model:
This model captures the relationships between real-world entities much like the network
model, but it isn’t as directly tied to the physical structure of the database. Instead, it’s often used
for designing a database conceptually.
A common form of the ER diagram is the “star schema”, in which a central fact table
connects to multiple dimensional tables.
7. Document model:
The document model, which is designed for storing and managing documents or semi
structured data, rather than atomic data.
Question # 4:
SQL statements are divided into how many categories? Explain
each briefly:
E.F rules can be applied on any database system that manages stored data using only its
relational capabilities. This is a foundation rule, which acts as a base for all the other rules.