0% found this document useful (0 votes)
114 views18 pages

Cet341 Advanced Database Technologies PDF

Uploaded by

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

Cet341 Advanced Database Technologies PDF

Uploaded by

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

Link to sql scrip: https://drive.google.

com/file/d/1w8BDeGMS9S3TiM9IjZ-
xz_r2KCIA3W1c/view?usp=sharing
Link to mongo dB scrip:
https://drive.google.com/file/d/1CYLbAWhgOTM7D4a5JU_6eIqw4f2cSxqh/view?usp=sharing
Portfolio:
https://canvas.sunderland.ac.uk/eportfolios/5696?verifier=CGk05spOlPoOnIABZ6excLYCfIN
R2AgjSW8SlWon

CASE-STUDY
CLASS DIAGRAM
THE CREATION OF THE DATABASE TABLES IN THE RELATED INSERT STATEMENTS

In development of a database it is a best practice to make sure that you execute the drop table
statements to make sure that there are not any existing tables within the database you trying
to create your tables in. The following screenshots will show the drop and creation of the tables
within the database using livesql oracle.com.
SQL
Drop table statements
The below screen shows the dropping of tables and its returned results.

Drop types created


Type creation statements
An object type varies from local SQL datatypes in that it is client characterized, and it
indicates both the fundamental persistent data and the connected practices.

Table creation and insertion statements


BRANCH TABLE

STAFF TABLE
RESULTS

Property_owner table

Property table
Tenant table

Lease agreement table

Views table
Advertisement media

Advertisement table
SQL QURIES AND OUTPUT

--QUERY A: JOIN THREE OR MORE TABLES—


The INNER JOIN chooses all rows from 3 tables if there is a match between the
column property number in all the tables it will join based on that.

QUERY A: MAKE USE OF SUB-QUIRIES


The following sub-query will display staff with the highest salary in each branch
QUERY A: MAKE USE OF TEMPORAL FEATURES
This query will display an agreement that was made and entered in the last 35-day equivalent
to 5weeks.

--QUERY A: MAKE USE OF OLAP FEATURES--

--ROLLUP—
The roll up query aggregates the grand totals and groups them using the staff number and
branch number.

CUBE
The cube group by differs from the roll up since the cub will generate the subtotals of all
combinations of the specified columns
MONGODB

Creating MongoDB database that will be used to store the related collections and its
documents. The following shows how all that was implemented with the use screenshots.

Database Creation

Creating collections that correspond to the sql tables in mongoDB


Inserting documents into the collections

Branch collection

Property collection
Advertisement collection

Performing the related quires

Outer joins
The join that is performed here looks up the property number form advertisement and
property collection for similarity of property number and it let joins the property number to the
Branch collection
Temporal features
This temporal query projects the year and month of advertisements that were there.

ROLLUP
This roll up query sums up the salary of staff members who belong to a certain branch and
groups them by the branch number.
Comparison between Oracle MongoDB

Shetty & KC, (2019) explains that oracle is a relational administration framework (RDBMS). It is
the essential framework processing that has the premier flexible and effective to managing data
and application. It runs on several operating systems like Windows, Unix, Linux, and macOS It is
a relational database where data is accessed by user through application or source language
referred to as SQL, Palanisamy & SuvithaVani(2020) further explained MongoDB as a cross-
platform document-oriented and a non-relational (i.e., NoSQL) database. It is an open-source
document database that stores the data inside. It is written in C++, Go, JavaScript, Python dialects.
MongoDB offers fast, high comfort, and high quantifiability. Once MongoDB is installed, you can
utilize the Mongo. Mongo shell gives a JavaScript interface through that the clients will act and
perform CRUD tasks. Since the oracle database is a relational data model that implies that the
data is already predefined before it is stored in the tables. When performing quires like joins,
they differ in terms of the implementation since oracle and MongoDB have different
Implementation. Below is an example of how they differ.
Join query statements

Figure 1 Mongo outer join implementation

Figure 2 sql inner join implementation


Insertion statements

Figure 3 sql insertion statements

Figure 4 mongo insertion statements

The challenges faced during the implementation of quires such as the temporal quires and
OLAP in MongoDB is that the implementation of the quires is much harder to execute, since it
brings methods like aggregation and $lookup when trying to implement the quires so that
proved to be challenging since it differs from sql implementation. On the other hand, thou it
proved to be challenging to implement the quires, the query processing was much more
efficient and faster as compared to sql because MongoDB uses the database wide locking to
allow only one write query per database at a time ( Palanisamy & SuvithaVani, 2020). Below is
to show how different the implementation of the quires differs.
Figure 5 sql implementation of temporal and OLAP quires

Figure 6 MongoDB implementation of temporal and OLAP

Palanisamy & SuvithaVani (2020,) defines The other distinction between the two-database
platform's is MongoDB recognizes greater data. The foremost extraordinary worth estimate in
MongoDB is 16 MB in examination with Oracle Database which most
prominent worth measure is 4 KB. The keenness show utilized by Oracle Database
is Acid, whereas MongoDB utilizes BASE. MongoDB offers consistency, quality,
and prohibitive atomicity. Oracle Database offers keenness that MongoDB does not offer
like isolation, transactions, referential judgment, and amendment control.
Boicea, et al., (2020) states that in Oracle and MongoDB, Indexes are accountable for dashing
up/speeding up the search query by giving quick access. Indexes within the on-line database
management system or non-relational management system are not forever relevant. Indexes are
great at reducing the time it needs to look and procure data using the SELECT statements.
Sometimes index will extremely decrease the query performance to UPDATE, INSERT, or DELETE.
In Oracle, the index is often created to induce the primary or primary set of rows quickly once
the table contains an excessive amount of data within the table. This can be responsible for the
general performance
References
Palanisamy, S. & SuvithaVani, M., 2020. A survey on RDBMS and NoSQL Databases. International
Conference on Computer Communication and Informatics, 5(4), pp. 1-7.

Shetty, S. B. & KC, A., 2019. Performance Analysis of Queries in RDBMS vs NoSQL. International
Conference on Intelligent Computing, Instrumentation and Control Technologies, 5(3), pp. 1-4.

Boicea, A., Radulescu, F. & Agapin, L. I., 2020. MongoDB vs Oracle - database comparison. Third
International Conference on Emerging Intelligent Data and Web Technologies, 3(2), pp. 1-6.

You might also like