Adbms 1
Adbms 1
Identifying the limitations of the current manual or outdated systems has led to the
development of this computerized system, which is designed to be user-friendly and more
graphical in its user interface (GUI). The manual system often suffers from data redundancy,
inefficiency, and a higher likelihood of errors. The automated system addresses these issues,
providing several benefits:
1. Cost Efficiency: The EMS significantly reduces the management costs associated with
paperwork and minimizes the number of personnel required for administrative tasks.
2. Centralized Information Sharing: The system provides a unified platform for
administrators to disseminate information and notices regarding policies, events, and
updates through a virtual notice board.
3. Enhanced Transparency: The EMS ensures transparent record-keeping and data
management, which helps in maintaining accurate and up-to-date employee records.
EER diagram:
The relational model represents how data is stored in Relational Databases. A relational
database consists of a collection of tables, each of which is assigned a unique name.
The relational model can represent a table with columns and rows. Each row is known as a
tuple.
Each table of the column has a name or attribute.
Properties of Relation:
1. The name of the relation is distinct from all other relations.
2. Each relation cell contains exactly one atomic (single) value
3. Each attribute contains a distinct name
4. The attribute domain has no significance
5. tuple has no duplicate value
6. The order of tuples can have a different sequence
Department:
Dept_location:
Project:
Works_on:
Dependent:
Relation Model of E-Commerce application:
To delete data:
To delete records:
Inner join:
Left join:
Right join:
View:
DELIMITER ;
CALL GetEmployeeCount();
Creating trigger:
1. Document-Oriented Database:
MongoDB stores data in a format called BSON (Binary JSON), which is a binary
representation of JSON-like documents.Each document can have a different structure,
making MongoDB flexible for accommodating data of varying shapes.
2. Collections: MongoDB organizes data into collections, which are similar to tables in
relational databases. Collections can contain multiple documents, and documents within a
collection do not need to have the same fields.
3. Documents: A document is a single record in MongoDB, represented as a JSON-like
object. Documents can contain nested subdocuments and arrays.
4. Fields: Fields are key-value pairs within a document. Field names are case-sensitive.
5. ObjectId: MongoDB automatically assigns a unique ObjectId to each document as its
primary key. This field is typically named _id.
6. Indexes: MongoDB supports indexing for efficient querying. Indexes can be created
on single fields, compound fields, or arrays to improve query performance.
7. Query Language: MongoDB uses a powerful query language for searching and
filtering documents. Queries can use a wide range of operators, including equality,
comparison, and logical operators.
8. Aggregation Framework: MongoDB provides a flexible aggregation framework for
performing complex data transformations, grouping, and computation operations on data.
9. Replication: MongoDB supports replica sets, which are clusters of MongoDB servers
that maintain the same data for redundancy and high availability. Replica sets provide
automatic failover and data redundancy.
10. Sharding: MongoDB can horizontally scale by using sharding. Sharding divides data
across multiple servers based on a shard key, allowing for distribution of data and queries.
11. Transactions: Starting with MongoDB 4.0, MongoDB supports multi-document
transactions, making it suitable for applications requiring ACID (Atomicity, Consistency,
Isolation, Durability) transactions.
12. Geospatial Data:MongoDB has built-in support for geospatial data and geospatial
indexing, allowing for location-based queries.
13. Security:MongoDB offers various security features, including authentication,
authorization, and encryption.Role-based access control (RBAC) can be used to manage
user permissions.
Installation of MongoDB
To install MongoDB on a Windows operating system, follow these step-by-step instructions:
• After the download is complete, locate the downloaded installer file, typically found in
the computer's "Downloads" folder.
• Double-click on the installer file to execute it and begin the installation process.
• The MongoDB Setup Wizard will appear on the screen. Click the "Next" button to
proceed.
• Select the "Complete" setup type, which includes both the MongoDB server and
associated tools. Click "Next" to continue.
• MongoDB Compass is a graphical user interface (GUI) for MongoDB. Decide whether
to install it or not. If chosen, click "Next."
• Review the installation settings displayed on the screen. If everything looks correct,
click the "Install" button to initiate the installation process.
• The installer will now copy the necessary files and set up MongoDB on the Windows
system. This may take a few minutes to complete.
• Once the installation is finished, a screen labeled "Completing the MongoDB Setup"
will appear. Decide whether to install MongoDB Compass (the GUI) by checking or
unchecking the corresponding option. Then, click "Next" to proceed.
• A screen indicating the successful installation will appear. Ensure that the "Run the
MongoDB shell" option is checked if you want to open the MongoDB shell
immediately. Then, click "Finish" to finalize the installation.
• To verify that MongoDB has been successfully installed, open either the Windows
Command Prompt (CMD) or PowerShell.
• Type "mongo" and press Enter. If MongoDB is installed correctly, this action will open
the MongoDB shell, confirming the successful installation.
Setup command for run the queries
To run queries in MongoDB, one typically utilizes the MongoDB shell, a command-line
interface for interacting with MongoDB. The following are the basic steps to execute queries
using the MongoDB shell:
• Utilize the "mongo" command followed by the hostname and port of the MongoDB
server to establish a connection. MongoDB typically runs on the localhost at port 27017
by default. If MongoDB is hosted on a different server or port, replace the placeholders
accordingly.
• After successfully connecting to the MongoDB server, select a specific database using
the "use" command.
use your_database_name
• Once a database has been selected, MongoDB queries can be executed. Below are some
common query examples:
1. Finding documents in a collection:
• When finished working with the MongoDB shell, exit by typing "exit" or pressing "Ctrl
+ C."