You are on page 1of 22

DBMS Questions

1. Create a database, and table, insert values, and queries using SQL codes.
Create a database, and create 3 tables with proper attributes. Insert at least 3 values
in each table. Apply 3 SQL queries.

2. Advantages & Disadvantages of DBMS & MySQL.

Advantages of DBMS –
• Data Independence - Application programs should be as independent as possible
from details of data representation and storage. The DBMS can provide an abstract
view of the data to insulate application code from such details.
• Efficient Data Access - A DBMS utilizes a variety of sophisticated techniques to
store and retrieve data efficiently. This feature is especially important if the data is
stored on external storage devices.
• Data Integrity and Security - If data is always accessed through the DBMS, the
DBMS can enforce integrity constraints on the data. For example, before inserting
salary information for an employee, the DBMS can check that the department
budget is not exceeded. Also, the DBMS can enforce access controls that govern
what data is visible to different classes of users.
• Concurrent Access and Crash Recovery - A database system allows several users
to access the database concurrently. Answering different questions from different
users with the same (base) data is a central aspect of an information system. Such
concurrent use of data increases the economy of a system. An example of
concurrent use is the travel database of a bigger travel agency. The employees of
different branches can access the database concurrently and book journeys for their
clients. Each travel agent sees on his interface if there are still seats available for a
specific journey or if it is already fully booked.
• A DBMS also protects data from failures such as power failures and crashes etc. by
the recovery schemes such as backup mechanisms and log files etc.
• Data Administration - When several users share the data, centralizing the
administration of data can offer significant improvements. Experienced
professionals, who understand the nature of the data being managed, and how
different groups of users use it, can be responsible for organizing the data
representation to minimize redundancy and fine-tuning the storage of the data to
make retrieval efficient.
• Reduced Application Development Time - DBMS supports many important
functions that are common to many applications accessing data stored in the
DBMS. This, in conjunction with the high-level interface to the data, facilitates the
quick development of applications. Such applications are also likely to be more
robust than applications developed from scratch because many important tasks are
handled by the DBMS instead of being implemented by the application.

DISADVANTAGES OF DBMS -
• The danger of Overkill - For small and simple applications for single users a
database system is often not advisable.
• Complexity - A database system creates additional complexity and requirements.
The supply and operation of a database management system with several users and
databases is quite costly and demanding.
• Qualified Personnel - The professional operation of a database system requires
appropriately trained staff. Without a qualified database administrator, nothing will
work for long.
• Costs - Through the use of a database system, new costs are generated for the
system itself but also for additional hardware and the more complex handling of
the system.
• Lower Efficiency - A database system is a multi-use software that is often less
efficient than specialized software which is produced and optimized exactly for
one problem.

Advantages of MYSQL -
• Data Protection - It is one of the most popular database management systems in
terms of security and dependability. It is used in many web applications, including
Twitter, Facebook, Joomla, Drupal, and WordPress. For transactional processing,
data support and security might be beneficial to your organization, particularly if
you work in the e-commerce industry.
• Scalability on Demand - This platform’s incredible scalability can help with the
management of embedded applications. This is true even if there is a big
warehouse with massive amounts of data. In fact, one of the system’s major
characteristics is on-demand adaptability. The benefit of this open-source platform
is that it allows for complete customization, which is very useful if you have an
eCommerce store to manage.
• High Efficiency - My SQL includes a unique storage engine that makes it easier to
administer your system. Furthermore, you may configure the MySQL database
server to achieve peak performance. In other words, even if you have a high-speed
processing system or a website that receives millions of hits every day, you may
benefit from this technology.
• 24/7 Uptime - The MySQL system is unique in that it assures continuous uptime.
Aside from that, it provides a plethora of options, such as slave/master replication
settings and unique cluster servers.
• Outstanding Transactional Support - MySQL is at the top of the list of fast
transactional database solutions available today. It has several features, such as
consistent and automated transaction support. Aside from that, it is one of the
greatest options for complete data integrity.
• Excellent Workflow Control - You don’t need to set aside much time to set up this
program because downloading and installation take less than 30 minutes. You may
make use of the advantages of this fantastic solution regardless of your platform. It
may be used to automate a wide range of processes, including database
management, data design, and space growth.
• Lower Total Ownership Cost - You may save a lot of money if you convert your
existing database programs to this platform. The simplicity of management and
dependability might aid in troubleshooting. As a result, you will not experience
any downtime or performance difficulties.

Disadvantages Of MySQL –
• MySQL does not support a huge database size efficiently.
• It is challenging to debug stored procedures.
• MySQL is not fully SQL compliant. Because of this, developers find it challenging
to cope with the syntax of SQL in MySQL.

3. Create ER diagram (go through the 11 case studies uploaded in mid-sem).


4. Differences between SQL & No-SQL.
Differences between SQL & Mongo DB.

NoSQL
SQL

Non-relational or distributed database


Relational Database Management System system.
(RDBMS)

These databases have fixed or static or They have a dynamic schema


predefined schema

These databases are best suited for


These databases are not suited for hierarchical hierarchical data storage.
data storage.

These databases are not so good for


These databases are best suited for complex complex queries
queries

Horizontally scalable
Vertically Scalable

Follows CAP (consistency, availability,


Follows ACID properties (Atomic, Consistent, partition tolerance)
Isolation, and Durability)

Feature MySQL MongoDB

It stores each individual record It stores unrelated data in


Data
as a table cell with rows and JSON-like documents
Structure
columns

MySQL requires a schema MongoDB doesn’t require any


Schema definition for the tables in the prior schema
database
Supports Structured Query Supports JSON Query
Languages Language to work with data
Language (SQL)

Supports the usage of Foreign Doesn’t support the usage of


Foreign Key Foreign keys
keys

Supports master-slave Supports sharding and


Replication replication and master-master replication
replication

MongoDB database can be


SQL Database can be scaled scaled both vertically and
Scalability
vertically horizontally

Join Doesn’t support Join operation


Supports Join operation
Operation

Optimized for high-performance Optimized for writing


Performance performance
joins across multiple tables

Since there is no schema,


Risks Prone to SQL injection attack lesser risks involved

There are currently (always There are currently (always


increasing) about 222k increasing) about 177k
Community repositories and 923k commits
repositories and 7Million
Support on GitHub for support on
commits on GitHub for support
on MySQL MongoDB
5. Mention 5 disadvantages of the file-oriented approach.

• Data Redundancy and Inconsistency - Since files and application programs are
created by different programmers over a long period of time, the files are likely to
be having different formats and the programs may be written in several
programming languages. Moreover, the same piece of information may be
duplicated in several places. This redundancy leads to higher storage and access
cost. In addition, it may lead to data inconsistency.
• Difficulty in Accessing Data - The conventional file processing environments do
not allow needed data to be retrieved in a convenient and efficient manner. Better
data retrieval system must be developed for general use.
• Data Isolation - Since data is scattered in various files, and files may be in different
formats, it is difficult to write new application programs to retrieve the appropriate
data.
• Concurrent Access Anomalies - In order to improve the overall performance of the
system and obtain a faster response time, many systems allow multiple users to
update the data simultaneously. In such an environment, the interaction of
concurrent updates may result in inconsistent data.
• Security Problems - Not every user of the database system should be able to access
all the data. For example, in the banking system, payroll personnel need only that
part of the database that has information about various bank employees. They do
not need access to information about customer accounts. It is difficult to enforce
such security constraints.
• Integrity Problems - The data values stored in the database must satisfy certain
types of consistency constraints. For example, the balance of a bank account may
never fall below a prescribed amount. These constraints are enforced in the system
by adding appropriate code in the various application programs. When new
constraints are added, it is difficult to change the programs to enforce them. The
problem is compounded when constraints involve several data items for different
files.
• Atomicity Problem - A computer system like any other mechanical or electrical
device is subject to failure. In many applications, it is crucial to ensure that once a
failure has occurred and has been detected, the data are restored to the consistent
state that existed prior to the failure.
6. Explain all the different types of database users.

• Database Administrator (DBA):


o Database Administrator (DBA) is a person/team who is responsible for managing
the overall database management system. i.e., the schema and also controls the 3
levels of the database. The DBA will then create a new account id and password
for the user if he/she needs to access the database. DBA is also responsible for
providing security to the database and he allows only authorized users to
access/modify the database.
o DBA also monitors the recovery and backup and provides technical support.
o The DBA has a DBA account in the DBMS which is called a system or superuser
account.
o DBA repairs damage caused due to hardware and/or software failures.

• Naive / Parametric End Users:


Parametric End Users are the unsophisticated who don’t have any DBMS knowledge but
they frequently use database applications in their daily life to get the desired results. For
example, online library system, ticket booking systems, ATMs, etc. which has existing
application, and users use them to interact with the database to fulfill their requests.

• System Analyst:
System Analyst is a user who analyzes the requirements of parametric end users. They
check whether all the requirements of end users are satisfied.

• Sophisticated Users:
Sophisticated users can be engineers, scientists, and business analysts, who are familiar
with the database. They can develop their own database applications according to their
requirement. They don’t write the program code but they interact with the database by
writing SQL queries directly through the query processor.

• Data Base Designers:


Database Designers are the users who design the structure of the database which includes
tables, indexes, views, constraints, triggers, and stored procedures. He/she controls what
data must be stored and how the data items are related.
• Application Program:
Application Programs are the back-end programmers who write the code for the
application programs. They are computer professionals. These programs could be written
in programming languages such as Visual Basic, Developer, C, FORTRAN, COBOL,
etc.

• Casual Users / Temporary Users:


Casual Users are the users who occasionally use/access the database but each time when
they access the database they require new information, for example, a Middle or higher-
level manager.
7. Explain fragmentation and classify it with suitable examples.
Fragmentation & its applications.

Fragmentation is a process of dividing the whole or full database into various sub-tables
or sub-relations so that data can be stored in different systems. The small pieces of sub-
relations or sub-tables are called fragments. These fragments are called logical data units
and are stored at various sites.
All of these fragments are independent which means these fragments cannot be derived
from others. The users needn’t be logically concerned about fragmentation which means
they should not concern that the data is fragmented and this is called fragmentation
Independence or we can say fragmentation transparency.

Advantages:
• As the data is stored close to the usage site, the efficiency of the database system will
increase.
• Local query optimization methods are sufficient for some queries as the data is available
locally.
• In order to maintain the security and privacy of the database system, fragmentation is
advantageous.
Disadvantages:
• Access speeds may be very high if data from different fragments are needed.
• If we are using recursive fragmentation, then it will be very expensive.

Types –
• Horizontal data fragmentation
Horizontal fragmentation divides a relation(table) horizontally into a group of rows to
create subsets of tables.
Example:
Account (Acc_No, Balance, Branch_Name, Type).
In this example, if values are inserted in table Branch_Name as Pune, Baroda, Delhi.
The query can be written as:
SELECT*FROM ACCOUNT WHERE Branch_Name= “Baroda”.

• Vertical Fragmentation
Vertical fragmentation divides a relation(table) vertically into groups of columns to
create subsets of tables.
Example:
Acc_No Balance Branch_Name
A_101 5000 Pune
A_102 10,000 Baroda
A_103 25,000 Delhi

Fragmentation1:
SELECT * FROM Acc_No

Fragmentation2:
SELECT * FROM Balance

• Hybrid Fragmentation
Hybrid fragmentation can be achieved by performing horizontal and vertical partitions
together.
Mixed fragmentation is a group of rows and columns in relation.

Example: Consider the following table which consists of employee information.

Emp_ID Emp_Name Emp_Address Emp_Age Emp_Salary


101 Surendra Baroda 25 15000
102 Jaya Pune 37 12000
103 Jayesh Pune 47 10000

Fragmentation1:
SELECT * FROM Emp_Name WHERE Emp_Age < 40

Fragmentation2:
SELECT * FROM Emp_ID WHERE Emp_Address= 'Pune' AND Salary < 14000.
8. Explain 3 major problems in DBMS.

• Atomicity - When a bunch of tasks is coming at the same point of time as DBMS is
used by multiple users.
It is essential to database consistency that either both the credit and debit occur, or that
neither occurs. That is, the funds’ transfer must be atomic—it must happen in its
entirety or not at all. It is difficult to ensure atomicity in a conventional file-processing
system.
• Integrity - When tables are distributed with different users, they can change the values
however they want. No one should get the allowance of altering the data. This has
been solved by RDBMS.
As the database is getting updated in real-time, so it is required that data remains
accurate during operations. For that some technical safeguards are necessary. Several
users attempting to update the data create the main threat to data integrity.
• Concurrency - When multiple transactions execute concurrently in an uncontrolled or
unrestricted manner, then it might lead to several problems. These problems are
commonly referred to as concurrency problems in a database environment. The five
concurrency problems that can occur in the database are:
➢ Temporary Update Problem
➢ Incorrect Summary Problem
➢ Lost Update Problem
➢ Unrepeatable Read Problem
➢ Phantom Read Problem.

9. Compare 2 NF & 3 NF with examples.

10. Explain 1 NF with 3 suitable examples.


11. Important keywords –
➢ Data - The raw facts are called data. The word “raw” indicates that they have not
been processed.
➢ Information - The processed data is known as information.

➢ DBMS, Characteristics, Users, Advantages, Disadvantages, Models

➢ Entity – An entity is a piece of data that is stored in the database.

➢ Attributes - An attribute is a piece of data that describes an entity. For example, in


a customer database, the attributes might be name, address, and phone number.

➢ ER Diagram - ER Diagram stands for Entity Relationship Diagram, also known as


ERD is a diagram that displays the relationship of entity sets stored in a database.
In other words, ER diagrams help to explain the logical structure of databases. ER
diagrams are created based on three basic concepts: entities, attributes, and
relationships. ER Diagrams contain different symbols that use rectangles to
represent entities, ovals to define attributes, and diamond shapes to represent
relationships. The purpose of ER Diagram is to represent the entity framework
infrastructure.
Each table cell should contain a single value.
Each record needs to be unique.

➢ Weak entity - A weak entity type is a dependent table that relies on another table
for its existence; it has no meaningful attributes of its own except for the foreign
key from the parent table.

➢ Strong Entity - A strong entity in DBMS is an independent table that doesn't rely
on any other tables for its existence. A primary key uniquely identifies each row in
the table, and foreign keys are used to relate this table to other tables.

➢ Data normalization - 1 NF, 2 NF, 3 NF


➢ Relational Algebra - SELECT & PROJECT with one example each.
Select Operation (σ)
It selects tuples that satisfy the given predicate from a relation.
Notation − σp(r)
Where σ stands for selection predicate and r stands for relation. p is a prepositional
logic formula that may use connectors like and, or, and not. These terms may use
relational operators like − =, ≠, ≥, <, >, ≤.
Eg; σsubject = "database"(Books)
Output − Selects tuples from books where the subject is 'database'.

σsubject = "database" and price = "450"(Books)


Output − Selects tuples from books where the subject is 'database' and 'price' is
450.

σsubject = "database" and price = "450" or year > "2010"(Books)


Output − Selects tuples from books where the subject is 'database' and 'price' is 450
or those books published after 2010.

Project Operation (∏)


It projects column(s) that satisfy a given predicate.
Notation − ∏A1, A2, An (r)
Where A1, A2, and An are attribute names of relation r.

Duplicate rows are automatically eliminated, as a relation is a set.


Eg; ∏subject, author (Books)
Selects and projects columns named as subject and author from the relation Books.
12. Explain different categories of SQL commands with examples.

SQL commands – DDL, DML, DQL, DCL, TCL.


DDL -
• DDL stands for data definition language. DDL Commands deal with the schema, i.e.,
the table in which our data is stored.
• All the structural changes such as creation, deletion, and alteration on the table can be
carried with the DDL commands in SQL.
• Commands covered under DDL are:
➢ CREATE
➢ ALTER
➢ DROP
➢ TRUNCATE
➢ RENAME.

DML –

• DML stands for Data Manipulation Language. Using DML commands in SQL, we
can make changes in the data present in tables.
• Whenever we wish to manipulate the data or fetch the data present in SQL tables,
we can use DML commands in SQL.
• DML commands in SQL will change the data, such as inserting new records, or
deleting or updating existing records from the SQL tables. We can also retrieve all
the data from SQL tables according to our requirements.
• Commands covered under DDL are:
➢ INSERT
➢ SELECT
➢ UPDATE
➢ DELETE

DCL –

• DCL stands for Data Control Language.


• Whenever we want to control the access to the data present in SQL tables, we will
use DCL commands in SQL. Only authorized users can access the data stored in
the tables.
• Every user will have some pre-defined privileges; accordingly, the data can be
accessed by that particular user. Using the DCL commands in SQL, we can give
privileges to the user on the SQL database and tables, or we can also revoke the
given privileges from the user.
• Commands covered under DCL are:
➢ GRANT
➢ REVOKE

TCL –

• TCL stands for Transaction Control Language. TCL commands are generally used
in transactions.
• Using TCL commands in SQL, we can save our transactions to the database and
roll them back to a specific point in our transaction. We can also save a particular
portion of our transaction using the SAVEPOINT command.
• Commands covered under TCL are:
➢ COMMIT
➢ ROLLBACK
➢ SAVEPOINT

DQL –

• DQL is used to fetch the data from the database.


• It uses only one command: SELECT.
13. Advantages & disadvantages of DDBMS & Replication.

Distributed Database Management System –


A distributed database is a set of interconnected databases that are distributed over the
computer network or internet and is a collection of multiple interconnected databases,
which are spread physically across various locations that communicate via a computer
network.

Advantages of Distributed Databases -

• Modular Development − If the system needs to be expanded to new locations or new


units, in centralized database systems, the action requires substantial efforts and
disruption in the existing functioning. However, in distributed databases, the work simply
requires adding new computers and local data to the new site and finally connecting them
to the distributed system, with no interruption in current functions.

• More Reliable − In case of database failures, the total system of centralized databases
comes to a halt. However, in distributed systems, when a component fails, the
functioning of the system continues may be at a reduced performance. Hence DDBMS is
more reliable.

• Better Response − If data is distributed in an efficient manner, then user requests can be
met from local data itself, thus providing a faster response. On the other hand, in
centralized systems, all queries have to pass through the central computer for processing,
which increases the response time.

• Lower Communication Cost − In distributed database systems, if data is located locally


where it is mostly used, then the communication costs for data manipulation can be
minimized. This is not feasible in centralized systems.

Disadvantages of DDBMS -

• Complex nature:
Distributed Databases are a network of many computers present at different locations and
they provide an outstanding level of performance, availability, and of course reliability.
Therefore, the nature of Distributed DBMS is comparatively more complex than a
centralized DBMS. Complex software is required for Distributed DBMS. Also, it ensures
no data replication, which adds even more complexity to its nature.
• Overall Cost:
Various costs such as maintenance cost, procurement cost, hardware cost,
network/communication costs, labor costs, etc., add up to the overall cost and make it
costlier than normal DBMS.

• Security issues:
In a Distributed Database, along with maintaining no data redundancy, the security of
data, as well as a network, is a prime concern. A network can be easily attacked for data
theft and misuse.

• Integrity Control:
In a vast Distributed database system, maintaining data consistency is important. All
changes made to data at one site must be reflected on all the sites. The communication
and processing cost is high in Distributed DBMS in order to enforce the integrity of data.

• Lacking Standards:
Although it provides effective communication and data sharing, still there are no standard
rules and protocols to convert a centralized DBMS to a large Distributed DBMS. Lack of
standards decreases the potential of Distributed DBMS.

• Lack of Professional Support:


Due to a lack of adequate communication standards, it is not possible to link different
equipment produced by different vendors into a smoothly functioning network. Thu
several good resources may not be available to the users of the network.

• Data design complex:


Designing a distributed database is more complex compared to a centralized database.

Data Replication -

Data replication is the process of storing separate copies of the database at two or more
sites. It is a popular fault tolerance technique of distributed databases.
Advantages of Data Replication -

• Reliability − In case of failure of any site, the database system continues to work since a
copy is available at another site(s).

• Reduction in Network Load − Since local copies of data are available, query processing
can be done with reduced network usage, particularly during prime hours. Data updating
can be done during non-prime hours.

• Quicker Response − Availability of local copies of data ensures quick query processing
and consequently quick response time.

• Simpler Transactions − Transactions require a smaller number of joins of tables located


at different sites and minimal coordination across the network. Thus, they become
simpler in nature.

Disadvantages of Data Replication -

• Increased Storage Requirements − Maintaining multiple copies of data is associated


with increased storage costs. The storage space required is in multiples of the storage
required for a centralized system.

• Increased Cost and Complexity of Data Updating − Each time a data item is updated,
the update needs to be reflected in all the copies of the data at the different sites. This
requires complex synchronization techniques and protocols.

• Undesirable Application – Database coupling − If complex update mechanisms are not


used, removing data inconsistency requires complex coordination at the application level.
This results in undesirable application–database coupling.

Some commonly used replication techniques are -

➢ Snapshot replication

➢ Near-real-time replication

➢ Pull replication.
14.How data replication helps to protect against the loss of data?

Data replication involves copying data from one location and creating another exact copy
version in another location. For example, data can be replicated between two onsite
servers, between servers in different locations, across multiple storage mediums on the
same server, and to and from a cloud-based host.
How Data Replicates –
➢ Between two onsite servers.
➢ Between servers in different locations.
➢ Across multiple storage mediums on the same server.
➢ To and from a cloud-based host.

You’ll have the option to copy data instantly, transfer it in large chunks or small
batches, set a schedule for when you want data moved, and replicate data in real time
as the master server’s data is written, changed, or deleted completely.

Additionally, you can use full replication where a full database is copied to each
server location or partial replication where only some of the most frequently used data
is replicated across servers.

Replicating data can occur over a local area network, a storage area network, a local
wide area network, or through the cloud.

Data Replication Process –

➢ Identify your data source and where you want it to be replicated.


➢ Choose the files, folders, and applications you want to be copied from the
source.
➢ Plan out your backup schedule and how frequently you want backups to take
place.
➢ Decide if you’ll use full table, key-based, or log-based replication.
➢ If using key-based replication, identify replication keys (columns that if
changed in the source will copy the records, they’re part of in the process).
➢ Use a replication tool or write customized code to begin the replication process.
➢ Keep an eye on the backup process to ensure everything backs up correctly.
15. Mongo dB, its examples, its advantages & disadvantages. Explain any 5 commands
of mongo dB.
How mongo dB works and mentions at least 5 MongoDB commands.
Structure of mongo dB.
Define MongoDB with reference to NoSQL architecture.

Being a NoSQL tool means that it does not use the usual rows and columns that you so
much associate with relational database management. It is an architecture that is built on
collections and documents. The basic unit of data in this database consists of a set of key-
value pairs. It allows documents to have different fields and structures. This database
uses a document storage format called BSON which is a binary style of JSON
documents.
The data model that MongoDB follows is a highly elastic one that lets you combine and
store data of multivariate types without having to compromise on powerful indexing
options, data access, and validation rules. There is no downtime when you want to
dynamically modify the schemas. What it means is that you can concentrate more on
making your data work harder rather than spending more time preparing the data for the
database.
MongoDB is a NoSQL (Not only SQL) database that stores large volumes of data in the
form of documents. MongoDB removes the concept of rows of conventional and
relational data models by introducing documents. This offers the developers the
flexibility to work with evolving data models.

MongoDB Advantages -
• MongoDB is schema-less. It is a document database in which one collection holds
different documents.
• There may be a difference between the number of fields, content, and size of the
document from one to another.
• Structure of a single object is clear in MongoDB.
• There are no complex joins in MongoDB.
• MongoDB provides the facility of deep query because it supports a powerful
dynamic query on documents.
• It is very easy to scale.
• It uses internal memory for storing working sets and this is the reason for its fast
access.

Disadvantages Of MongoDB -
• Joins not Supported - MongoDB doesn’t support joins like a relational database.
Yet one can use joins functionality by adding by coding it manually. But it may
slow execution and affect performance.
• High Memory Usage - MongoDB stores key names for each value pair. Also, due
to the no functionality of joins, there is data redundancy. This results in increasing
unnecessary usage of memory.
• Limited Data Size - You can have a document size, of not more than 16MB.
• Limited Nesting - You cannot perform the nesting of documents for more than 100
levels.

5 commands of mongo dB -
• show dbs.
• use DATABASE_NAME.
• db.
• db.dropDatabase ()
• db.createCollection(name)
16. Aggregate functions of Mongo dB.

MongoDB contains some aggregate functions.


Aggregate Function - When any command is executed on the whole data taking as a club.
Eg, Max command, Min, Sum, etc.
MongoDB's aggregate function will cluster out the records in the form of a collection
which can be then employed for providing operations like total number(sum), mean,
minimum and maximum, etc. from the aggregated group of data extracted.

For performing such an aggregate function, the aggregate () method is used. The syntax
of this method looks something like this:
db. collection_name. aggregate(aggregate_operation);

Different Expressions of Aggregate Function –


Expression Description

$sum adds up the definite values of every document of a collection.

$avg computes the average values of every document of a collection.

$min finds and returns the minimum of all values from within a
collection.

$max finds and returns the maximum of all values from within a
collection.

$push feeds in the values to an array in the associated document.

$first fetches out the first document.

$last fetches out the last document.

$addToSet feeds in the values to an array without duplication.

You might also like