Updated Final Report
Updated Final Report
INTERNSHIP REPORT
BACHELOR OF ENGINEERING
In
RITESH
4SH21CS112
Prof. Sharanya R B
Kenjar,Mangalore- 574142
CERTIFICATE
This is to certify that RITESH bearing USN: 4SH21CS112, a bonafied student of Shree
Devi Institute of Technology has undergone sixteen weeks of INTERNSHIP at Thaniya
Technology, Mangalore. This internship report is submitted in partial fulfilment for the
award of Bachelor of Engineering in Computer Science and Engineering of the
Visvesvaraya Technological University, Belagavi during the academic year 2024-2025
Examination:
1) ………………………… 1)……………………
2) ………………………… 2)……………………
ACKNOWLEDGEMENT
RITESH
4SH21CS112
TABLE OF CONTENTS
1. Introduction 1-4
2.3 Visions 6
2.4 Mission 6
2.6 Products 8
2.8 Customers 9
5. Conclusion 71
References 72
LIST OF FIGURES
4.1 Calculator 60
CHAPTER 1
INTRODUCTION
HTML (Hypertext Markup Language) is the standard markup language used to structure
content on the web. It provides the fundamental building blocks for web pages through a
system of elements and tags that define different types of content such as headings,
paragraphs, images, and links. HTML5, the latest version, introduced semantic elements like
<header>, <footer>,
<article>, and <section>, which provide more meaningful structure to web documents and
improve accessibility and SEO.
CSS (Cascading Style Sheets) is a style sheet language used to describe the presentation of
HTML documents. It controls the layout, colors, fonts, and overall visual appearance of web
pages. CSS3, the current standard, introduced advanced features such as animations,
transitions, gradients, and flexible box layouts (Flexbox) and grid layouts, which have
revolutionized web design by enabling more sophisticated and responsive layouts without
relying on JavaScript or other scripting languages.
Together, HTML, CSS, and JavaScript form the foundation of front-end web development.
They work in harmony to create the user-facing aspects of websites and web applications.
HTML provides the structure, CSS enhances the visual presentation, and JavaScript adds
interactivity and dynamic behavior. Mastering these three technologies is the first step in
becoming proficient in the MERN stack, as they form the basis for more advanced
frameworks and libraries like React.js.
MongoDB is a NoSQL database that stores data in flexible, JSON-like documents. Unlike
traditional relational databases that use tables and strict schemas, MongoDB's approach
allows for variable data structures and dynamic schema evolution. This flexibility makes it
particularly suitable for applications where data requirements may change over time or where
the data structure is not rigidly defined from the outset.
Express.js is a minimal and flexible Node.js web application framework that provides a
robust set of features for building web and mobile applications. It simplifies the process of
creating server-side applications by providing tools for routing, middleware integration, and
HTTP request/response handling. Express.js follows the middleware pattern, allowing
developers to create a pipeline of functions that process HTTP requests in sequence.
React.js is a JavaScript library developed by Facebook for building user interfaces. It uses a
component-based architecture where UIs are composed of reusable, independent components.
React's virtual DOM implementation efficiently updates the actual DOM by only rendering
components that have changed, resulting in improved performance. This declarative approach
to UI development makes code more predictable and easier to debug.
Node.js is a JavaScript runtime environment that executes JavaScript code outside a web
browser. It uses an event-driven, non-blocking I/O model that makes it lightweight and
efficient for data-intensive applications. Node.js enables server-side JavaScript execution,
allowing developers to use the same programming language on both the client and server
sides, thus streamlining the development process.
The MERN stack offers several advantages for web development. It allows for consistent use
of JavaScript throughout the entire application, reducing the cognitive load of switching
between different programming languages. The modular nature of the stack enables
developers to work on individual components independently, facilitating parallel
development and maintenance. Additionally, all components of the MERN stack are open-
source and have large, active communities, ensuring ongoing support and a wealth of
available resources and libraries.
To progress through the MERN stack technologies sequentially: This objective involves a
structured learning path through each component of the MERN stack. After establishing
front- end fundamentals, the plan is to learn Node.js and Express.js for backend development,
followed by MongoDB for database operations, and finally React.js for building dynamic
user interfaces. Each technology will be studied both independently and in the context of full-
stack integration.
To gain experience with modern development workflows and tools: This goal
encompasses learning essential development tools and practices including version control
with Git, package management with npm, debugging techniques, and testing methodologies.
The objective includes becoming familiar with development environments, code editors,
browser developer tools, and the command line interface to enhance productivity and code
quality.
CHAPTER 2
COMPANY PROFILE
They offer variety of services such as web design, web development, app development,
machine learning, Internet of things, game development and event management. With a team
of qualified professionals that are dedicated to delivering quality services for the success of
client's projects.
2.2.1 PRINCIPLES
Interdependency: Whole is greater than the sum of parts, knowing this has helped us
to develop and cultivate a culture of interdependency. It portrays a power of
connection and strives for the synergy through power of relationships.
Interdependency between different departments, individuals, clients and partners for a
greater good is what we are aiming at Thaniya technologies.
Sharing: No social technology can grow without the benefit of sharing. The word
sharing is thrown around with wild abandon by almost any organization you interact
with, but very few works toward imbibing this concept in their products and services.
At Techno Triumph, we value sharing and in fact have it a core concept in our
internal as well as customer dealings. We also realize that sharing is a two-way street
and the more you share something, the more you will receive from it.
Openness: Openness as a business trait has gained a lot of momentum in recent
times. Gone are the days when organizations were shy about revealing their business
plans. Openness is intrinsic to all our business dealings. Advent of social media has
brought about the change in the organizations and openness has become imperative.
Openness becomes more important when dealing with digital ventures.
2.3 VISION
"To Provide Quality Service and Solution in the field of Information Technology”
2.4 MISSION
Train future task force with Quality internship and training.
Provide IT solution in various domain.
Get Recognized by Government and other Quality Assurance bodies.
2.5 POLICIES
The HR Department will do the initial screening & short listing of resumes for the
position.
HR Department during the short listing will focus on: Education, Experience, Current
role/responsibilities, Salary level, Technical/ Functional/Domain Knowledge, Culture
fit, etc.
The short listed resumes are sent to the concerned Business/Unit/ Functional Heads
for evaluation requesting them to indicate the action to be taken. As far as possible
(depending on the availability), reasonable number of candidates will be provided for
final selection.
Staffing Authority
The CEO/GCXO is the authority for staffing with the prior consent of Director.
As our first priority the management of Thaniya Technologies is committed to delivering quality
software to our customers. We recognize that consistent satisfaction of customer needs is
essential to business survival.
Planning
Project managers shall produce project performance reports at intervals agreed with the project
sponsor.
Documenting requirements
All projects shall prepare a Software Requirements Specification describing the functions,
performance and the interface requirements of the software product.
Architectural design
All projects shall conduct a Design Input Review to establish that design inputs such as Software
Requirements Specifications are unambiguous, complete and correct and possess sufficient
quality to support the development of a design solution.
Coding
Projects shall develop software in compliance with predefined coding standards. Coding
standards shall be updated to reflect any project specific practices.
Testing
All projects shall describe the approach to testing in a Software Test Plan. The STP shall
describe the project's approach to unit, integration and acceptance testing.
Managing quality
All projects shall plan and perform the software quality management activities required to
ensure that the customer's stated and implied needs are met and that the software product is
developed in compliance with recognized best practice.
Managing people
Project managers shall be responsible for ensuring that development team members are aware
of their quality responsibilities and appropriately trained to perform their assigned tasks.
2.6 PRODUCTS
Company develops android apps, web apps, ERP, Gaming etc. based on the customer
requirements. So based on the needs of customer it develops the products.
2.7 SERVICES
App Development
Company develops Custom made Application for Business, if anyone have an idea join with
company, it will build wonderful application for them.
Graphics Design
If anyone looking for Logo, Creative Poster, Visiting Cards, brochure etc. services regarding
these can be provided.
Web Development
Are you Looking for Website, do you have a Business and you want to make it online, we
will build website for you. Design-Host-Maintain.
Aerial Videography
Digital Marketing
It includes Search Engine Optimization, Translation and quality assurance of texts, Research
work and keyword strategies.
Event Management
A-Z services for customer’s event from Stage Decoration to Photography can be provided.
2.8 CUSTOMERS
Thaniya technologies served some companies/organizations such as Bhoomi Hardware,
MCF, Payana, Redhill Softec, Namaste Online etc. by providing software solution in
complete or part.
CHAPTER 3
INTERNSHIP PROGRESS
I learnt about the below-mentioned technologies and tools through my external guide and
online resources. Apart from learning these new technologies and tools, I also learned how to
effectively manage time and complete the given tasks within the deadline. The internship
allowed me to develop my interpersonal skills.
The first week of my internship laid the groundwork for understanding the basics of web
development through an in-depth focus on HTML (HyperText Markup Language) and CSS
(Cascading Style Sheets). These two technologies form the foundation for building and
designing web pages, and mastering them is essential for creating effective and visually
appealing websites.
During this week, I gained hands-on experience with various key HTML elements:
Heading Tags: I learned about the six levels of heading tags (<h1> to <h6>) and their
role in defining the hierarchy and structure of a web page. I also practiced using
appropriate headings to improve both readability and accessibility.
Image Tags (<img>): I explored the <img> tag to embed images in web pages. This
included understanding attributes like src (source) to specify the image path and alt to
provide descriptive text, ensuring accessibility for users and search engines.
Anchor Tags (<a>): I learned to create hyperlinks using the <a> tag. By working
with the href attribute, I could link to other web pages, external resources, and even
specific sections within a page.
Formatting Tags: Practiced using tags such as <b>, <i>, <u>, and <strong> to apply
emphasis and improve content presentation.
Lists: Worked with both ordered (<ol>) and unordered lists (<ul>) to organize
information effectively. I also learned how to nest lists and add custom styles.
Tables: Developed skills in creating tables using the <table> tag, along with
attributes like border, cellspacing, cellpadding, and align, to organize data
systematically.
Forms: Learned to create interactive forms using the <form> tag. This included
inputs for text fields, radio buttons, checkboxes, dropdown menus, and submit
buttons.
Iframes: Discovered how to embed external content like videos or web pages using
<iframe> and its attributes for size and border control.
Semantic Tags: Delved into semantic HTML tags such as <header>, <footer>,
<article>, and <section> to create well-structured, meaningful, and accessible
content for better SEO and user experience.
These elements helped me understand the fundamental building blocks of a web page and how
they interact with each other to create meaningful content.
In parallel, I studied both internal and external CSS to design and style web pages. Key
learnings included:
Internal CSS: Adding styles directly within the <style> tag in an HTML document to
control the page's appearance.
External CSS: Linking an external stylesheet using <link> for a more modular and
reusable approach to styling.
Selectors and Properties: Practiced applying various CSS selectors to target specific
HTML elements and learned properties to modify layout, colors, font styles, and
more.
CSS selectors are patterns used to target specific HTML elements for styling. I learned about the
following types:
1. Simple Selectors
Simple selectors target specific elements based on their tag, class, or ID:
Tagname Selector: Targets elements by their HTML tag (e.g., p, h1, div).
Class Selector: Targets elements with a specific class attribute (e.g., .className).
2. PseudoClass
:focus : Targets an element that is focused (e.g., a form input or a link when navigated to
using the keyboard).
3. Pseudo Elements
::selection: Styles the part of an element that the user highlights or selects.
::marker: Targets the marker box of list items (like bullets or numbering).
4. Attribute Selectors
5. Combination Selectors
Child Selector: Targets direct children of a parent (e.g., div > p).
Responsive Design: Gained a basic understanding of using media queries to ensure web pages
adapt seamlessly to different screen sizes and devices.
In the second week of my internship, I explored more advanced concepts in CSS, focusing on the
box model, transformations, and the display property. These topics were crucial for
understanding how to control and manipulate the layout and appearance of web elements
effectively.
Box Model
The box model is a fundamental concept in CSS that defines the layout and spacing of elements
on a web page. This week, I gained a thorough understanding of its components:
Content: The inner part of the box where text and images are displayed.
Padding: The space between the content and the border, used to provide breathing
room inside the element.
Border: The edge around the padding (if any) that outlines the element.
Margin: The space outside the border, used to create distance between elements.
I practiced adjusting these properties using CSS to control the spacing and alignment of
elements. Additionally, I learned about the box-sizing property, which allows developers to
include or exclude padding and borders in the total width and height of elements.
Transformation
Transformations in CSS are used to rotate, scale, skew, or translate elements, creating dynamic and
visually engaging effects. I explored the following transformation functions:
Display Property
The display property is key to controlling the behavior of elements and their layout on a web
page. I studied the following display values:
Block: Elements take up the full width of their container, starting on a new line
(display: block;).
Inline: Elements appear on the same line as other content and take up only as much
width as needed (display: inline;).
Inline-block: Combines the features of inline and block elements, allowing elements
to sit inline while respecting box model properties like padding and margins (display:
inline-block;).
Text Properties
Includes properties like color, font-size, font-family, line-height, and text-align to control the
appearance and alignment of text.
Marquee
The <marquee> tag creates scrolling text or images; however, it's outdated. Instead, CSS
animations can achieve similar effects.
Positions
CSS provides positions like static (default), relative (offset from normal position),
absolute (positioned relative to the nearest positioned ancestor), and fixed (stays in place
relative to the viewport).
Transition Properties
Used to create smooth changes between property values, such as transition: all 0.5s
ease-in-out; for animations like hover effects.
Animations
Created using @keyframes and animation properties, allowing elements to move, change
colors, or transform dynamically (e.g., animation: slide 2s infinite;).
Background
Linear Gradient
A linear gradient creates a smooth transition between colors along a straight line. The
direction can be specified (e.g., top, left, diagonal).
Radial Gradient
A radial gradient creates a transition between colors radiating outward from a central point,
forming concentric circles.
Navbar Styling
Styling a navigation bar involves flexbox or grid for alignment, background colors, hover
effects, and proper padding/margins for clean and responsive designs.
3.2.2 : JAVASCRIPT
It is both Frontend and Backend programming language which is used to develop web
applications, mobile applications, server.
Keywords in JavaScript:
Keywords are reserved words that have specific meanings and uses in JavaScript:
Examples: var, let, const, if, else, for, while, break, function, return, try, catch,
switch, case, default, class, new, delete, typeof, etc.
Identifiers:
Identifiers are names used to identify variables, functions, or objects. They must begin with a
letter, underscore (_), or dollar sign ($), and cannot include reserved keywords.
Operators in JavaScript:
Types of Operators:
2. Comparison Operators: ==, !=, ===, !==, >, <, >=, <=.
8. Special Operators: delete (removes a property from an object), new (creates a new
object).
Type of operator
The typeof operator in JavaScript is used to determine the data type of a given variable or
value. It returns a string indicating the type of the operand.
"undefined": If the variable is declared but has not been assigned a value.
Example Usage:
"object"
3.3.1.1 : Functions:
Functions are reusable blocks of code designed to perform a specific task. They make
programs more modular, maintainable, and easier to debug. There are different types of
functions in JavaScript.
1. Named Function
A named function has an explicit name that you use to call it. It's useful for reusability and
clarity.
Example:
function greet()
{ console.log("Good
Evening");
greet()
2. Function Expression
Functions can be assigned to a variable, creating a function expression. These functions are
not hoisted.
Example:
{ console.log("hi i am new
javascript")
res()
3. Anonymous Function
An anonymous function is a function without a name. It’s often used as a function expression
or in callbacks.
Example:
res1()
4. Arrow Function
Arrow functions provide a shorter syntax and were introduced in ES6. They do not bind their
own this.
Example:
console.log(add());
5. Callback Function
Example:
function add3(a,b){
console.log(a+b);
}
add3(function test()
{ return 4
},4)
function add4(a,b){
console.log(a()+b);
}
add4(function test()
{ return 4
},4
)
6. Higher-Order Function
Example:
function addition(a,b){
console.log(a()+b);
}
function sub()
{ return 4
}
addition(sub,4)
7. Immediately Invoked Function Expression (IIFE)
Example:
(function mm(){
console.log("Hi i am javascript");
})();
(()=>{
console.log("hi i am keerthana");
})()
An array is a special data structure used to store multiple values in a single variable. It allows
you to work with an ordered collection of items.
Syntax:
Array Methods:
Arrays in JavaScript come with a variety of methods for adding, removing, and manipulating
elements:
1. Adding/Removing Elements:
3. Searching/Filtering:
5. Combining/Extracting Data:
6. Transforming Arrays:
A string is a sequence of characters enclosed within single quotes ‘’, double quotes “ ” or backticks
``.
Example:
doubleQuote = "World";
1. Length:
Example:
// Output: 5
2. Accessing Characters:
Example:
Example:
4. Trimming:
Example:
Example:
Example:
7. Concatenation:
Example:
Example:
9. Replacing:
Example:
Example:
3.4.2 : DESTRUCTURING
Example:
let colors = ["red","green","yellow","white"]
console.log(colors);
let[a,b,c,d]=colors
console.log(a,b,c,d);
3.4.2.2 : OBJECT DESTRUCTURING
Used to unpack values from objects into variables.
Example:
let student = {name:"miller",age:35,dept:"CSE"}
console.log(student);
let[a,b,c,d]=student
console.log(a,b,c,d);
3.4.3 : JSON
JSON stands for JavaScript Object Notation. It is a lightweight data-interchange format that
is easy for humans to read and write, and simple for machines to parse and generate. JSON is
widely used to transmit data between a server and a web application or for storing structured
data.
Features of JSON
1. Simple and Readable: It is text-based and easy to understand.
Json object
Example: {
"name": "Alice",
"age": 25,
"isStudent": false
}
3.5.1 : DOM
The Document Object Model (DOM) is a programming interface for web documents. It
represents the structure of a document as a tree of nodes, allowing developers to manipulate
the content, structure, and style of web pages dynamically using JavaScript.
Each element (e.g., <div>, <p>) is represented as a node within the DOM tree.
With JavaScript, you can add, modify, or delete elements on the webpage using the
DOM.
DOM methods allow developers to interact with the structure and content of a web page.
1. Selecting Elements
getElementById(): Selects an element by its ID.
document.getElementById("myId");
getElementsByClassName(): Selects elements by their class name.
document.getElementsByClassName("myClass");
getElementsByTagName(): Selects elements by their tag name.
document.getElementsByTagName("div");
querySelector(): Selects the first matching element using a CSS selector.
document.querySelector(".myClass");
2. Modifying Elements
innerHTML: Changes the content inside an element.
document.getElementById("myId").style.color = "red";
setAttribute(): Sets an attribute (like src, href, alt) on an element.
document.getElementById("myImage").setAttribute("src", "image.jpg");
3. Adding/Removing Elements
createElement(): Creates a new DOM element.
let newElement = document.createElement("p");
parent.removeChild(child);
4. Event Handling
You can use DOM methods to add or remove event listeners on elements.
Example:
function grandparent()
{ console.log("Hi i am
grandparent");}
function parent()
{ console.log("Hi i am
parent");}
function child()
{ console.log("Hi i am
child");
}
3.5.1.3 : TIME FUNCTIONS IN JAVASCRIPT
JavaScript provides several time-related functions to execute code after a delay or repeatedly
at regular intervals.
1. setTimeout()
Executes a function once after a specified delay (in milliseconds).
Example:
setTimeout(() => {
2. clearTimeout()
Stops a setTimeout() call that hasn't executed yet.
Example:
let timer = setTimeout(() => console.log("This won't run"), 2000);
clearTimeout(timer);
3. setInterval()
Executes a function repeatedly at specified intervals.
Example:
let counter = 0;
let interval = setInterval(() => {
counter++;
console.log(`Counter: ${counter}`);
if (counter === 5) clearInterval(interval);
DEPT OF CSE, SDIT 29
INTERNSHIP REPORT
}, 1000); // Runs every second
4. clearInterval()
Stops a setInterval() call.
Example:
let interval = setInterval(() => console.log("Repeating..."), 1000);
clearInterval(interval); // Stops the interval
Exception handling is the process of detecting and managing errors during program
execution. JavaScript provides powerful tools for gracefully handling unexpected issues to
ensure the program continues to run smoothly.
Example:
try {
let result = 10 / 0;
console.log(result); // Output:
Infinity
} catch (error) {
console.log("Error occurred:", error.message);
Async and Await are modern JavaScript features introduced for working with asynchronous
operations, primarily promises. They simplify writing asynchronous code and make it easier
to read and debug.
1. async Keyword:
}
fetchData().then(data => console.log(data));
2. await Keyword:
Pauses the execution of the async function until the promise is resolved or rejected.
Example:
console.log(data);}
3.6.3 REACTJS
ReactJS is a popular JavaScript library for building user interfaces, particularly for single-
page applications. It allows developers to create reusable UI components and manage the
state of applications efficiently.
React uses ES6 modules for importing and exporting components, functions, or variables.
1. Export:
Named Export:
Default Export:
2. Import:
Named Import:
Default Import:
Named exports allow multiple exports from a file, while default exports are used for single
exports.
3.6.3.2 : PROPS
Props (short for properties) are used to pass data from a parent component to a child
component in React. They are read-only and help make components reusable.
Syntax:
function Welcome(props) {
function App() {
return <Welcome name="React" />;
}
Props can also be objects or variables, enabling dynamic data transfer between components.
A key is a special prop that helps React identify which items in a list have changed, been
added, or removed. Keys improve performance by allowing React to efficiently update the UI.
Example:
<li key={number.toString()}>{number}</li>
);
return <ul>{listItems}</ul>;
Default props allow you to set default values for a component's props in case they are not
provided by the parent component. This ensures that your component behaves as expected
even when some props are missing.
Example:
const UserInfo = ({ name = "N/A", age = "N/A" }) => (
<div>
<p>Name: {name}</p>
<p>Age: {age}</p>
</div>
);
Example:
function MyComponent()
{ return (
<React.Fragment>
<h1>Hello</h1>
<p>This is a paragraph.</p>
</React.Fragment>
);
}
3.7.5 HOOKS
In React, a hook is a special function that allows functional components to use state and other
React features without needing class components. Hooks were introduced in React 16.8 to
simplify component logic and improve reusability.
Rules of Hooks:
The useState hook in React allows functional components to manage state. It provides a way to
store and update values that persist across renders.
};
return (
<div className="container">
<h1>Input Tracker</h1>
<input
type="text"
className="input-field"
placeholder="Type something..."
value={inputValue}
onChange={handleChange} />
<p className="output">You typed: <span>{inputValue || '...'}</span></p>
</div>
)}
export default Inputtracker
<div>
{toggle === true && <h1>Hi welcome to internship</h1>}
<button onClick={showHeading}>Show</button>
<button onClick={hideHeading}>Hide</button>
</div>
);
}
export default Hooks;
Example:
import React, { useRef } from "react";
function NameInput() {
const inputRef = useRef(null);
const focusInput = () => {
if (inputRef.current) {
inputRef.current.focus(); // Focus the input field
}
};
return (
<div>
<input ref={inputRef} type="text" placeholder="Enter your name" />
<button onClick={focusInput}>Focus Input</button>
</div>
);
}
export default NameInput;
Example:
import React, { useRef, useEffect } from "react"; function
NameInput() {
const inputRef = useRef(null);
useEffect(() => {
if (inputRef.current) {
inputRef.current.focus();
}
}, []); // Empty dependency array ensures it runs only once after mount
return (
<div>
</div>
);
}
export default NameInput;
Example:
.catch(console.error);
}, []);
Example:
// Parent component
function App() {
const user = { name: "Alice", age: 25 };
return <Parent user={user} />;
}
If you have many nested components, passing props manually becomes repetitive.
Example:
return (
<UserContext.Provider value={user}>
<Child />
</UserContext.Provider>
);
}
function Child() {
const user = useContext(UserContext);
2. State/Prop Change: When data changes, React updates the Virtual DOM instead of
modifying the real DOM immediately.
3. Diffing Algorithm: React compares the previous Virtual DOM with the updated
one to detect differences.
4. Efficient Updates: React only updates the necessary parts of the actual
DOM, reducing performance overhead.
Example:
if (!value.includes("@") || !value.includes("."))
{ setError("Invalid email format");
} else {
setError("");
}
};
const handleSubmit = (e) => {
e.preventDefault();
if (!email) {
setError("Email is required");
} else if (!error) {
};
return (
<form onSubmit={handleSubmit}>
<input type="text" placeholder="Enter email" value={email}
onChange={validateEmail} />
);
}
3.9.1 MONGODB
MongoDB is a popular NoSQL database that stores data in a flexible, JSON-like format
called BSON (Binary JSON). Unlike traditional relational databases (such as MySQL or
PostgreSQL), MongoDB does not use tables and rows. Instead, it works with documents and
collections, making it highly scalable and efficient for handling large amounts of unstructured
data.
3.9.1.1 : COMMANDS
CRUD operations (Create, Read, Update, Delete) are the basic actions you can perform on a
MongoDB database.
1. Create Method:
insertOne(data): Inserts a single document into a collection.
Example:
db.users.insertOne({ name: "Alice", age: 25 })
insertMany(data): Inserts multiple documents at once.
Example:
db.users.insertMany([{ name: "Bob", age: 30 },
{ name: "Charlie", age: 28 }])
2. Read Method:
findOne(filter,options): Returns only one document that matches the query.
Example:
db.users.findOne({ name: "Alice" })
If multiple documents match, it returns the first one found.
findMany(filter,options): Returns multiple documents that match the
query.Can be used with filters and projections.
Example:
db.users.find({ age: { $gt: 25 } }) # Get users older than 25
3. Update Method:
updateOne(filter,data,options): Updates only one document that matches the
filter. If multiple documents match, only the first one gets updated.
Example:
db.users.updateOne({ name: "Alice" }, { $set: { age: 26 } })
updateMany(filter,data,options): Updates multiple documents that match
the filter.
Example:
db.users.updateMany({ city: "New York" }, { $set: { country: "USA" }
})
replaceOne(filter,data,options): Replaces an entire document, keeping only
the new fields.Unlike updateOne(), existing fields are removed unless
included. Example:
db.users.replaceOne(
{ name: "Bob" },
{ name: "Bob", age: 30, city: "Chicago" }
)
4. Delete Method:
deleteOne(filter): Deletes only one document that matches the
filter Example:
db.users.deleteOne({ name: "Alice" })
deleteMany(filter): Deletes multiple documents matching the filter.
Example:
db.users.deleteMany({ city: "New York" })
1. $eq → Equal to
2. Write a query to display all the employee details who is working in dept HR or Finance.
db.employee.find({"dept": {$in: ["HR", "Finance"]}})
3. Write a query to display all the employee details whose salary is more than 10,000.
db.employee.find({"salary": {$gt: 10000}})
4. Write a query to display where dept is IT.
db.employee.find({"dept": "IT"})
5. Details whose is not working under dept "HR" & IT.
db.employee.find({"dept": {$nin: ["HR", "IT"]}})
6. Write a query to display all the employee details whose is not getting salary less than
15000.
db.employee.find({"salary": {$not: {$lt: 15000}}})
7. Write a query to display all the employee details who is getting salary below 15000.
3.10.1 QUERIES
1. Write a query to display all the employee details who is working in dept HR OR the
emp having age 50.
db.employee.find({$or: [{"dept": "HR"}, {"age": 50}]})
2. Write a query to display all the employee details who is working under IT and getting
salary 20000 or working in dept production and getting salary 22000.
db.employee.find({$or: [{"dept": "IT", "salary": 20000}, {"dept": "production",
"salary": 22000}]})
3. Write a query to display all the employee details who is working in dept sales or
employee department gender male.
db.employee.find({$or: [{"dept": "sales"}, {"gender": "male"}]})
4. Write a query to display all the employee details except dept HR and IT
db.employee.find({$nor: [{"dept": "HR"}, {"dept": "IT"}]})
5. Write a query to display all the employee details who is working as production and
his gender is male.
db.employee.find({$and: [{"dept": "Production"}, {"gender": "male"}]})
6. Write a query to display all the employee details who is getting salary below 15000 or
dept is production.
db.employee.find({$or: [{"salary": {$lt: 15000}}, {"dept": "production"}]})
7. Write a query to display all the employee details who is not getting any salary or who
is not working in any dept.
db.employee.find({$or: [{"salary": null}, {"dept": null}]})
8. Write a query to display all the employee details whose age is greater than 30 and
getting some salary.
db.employee.find({$and: [{"salary": {$ne: null}}, {"age": {$gt: 30}}]})
9. Write a query who is getting salary more than 30,000 and working in dept sales or
dept IT.
db.employee.find({$and: [{"salary": {$gt: 30000}}, {$or: [{"dept": "sales"},
{"dept": "IT"}]}]})
10. Write a query who is not getting salary and who is not working in any department.
db.employee.find({$and: [{"salary": null}, {"dept": null}]})
Selection:
Example:
Projection:
Projection controls which fields should be displayed in the query result. It is defined in
the second parameter of find().
Example:
Example Queries:
In MongoDB, the update method is used to modify documents, and various update operators
help control specific field changes.
In MongoDB, array update operators help modify arrays inside documents. Here are three
important operators:
Example:
2. $pop – Removes the first (-1) or last (1) element from an array
Example:
Example:
A single field index is created on one specific field. It is useful for queries that filter or sort
based on a single field. Example: db.users.createIndex({ age: 1 })
The value '1' signifies ascending order, while '-1' would indicate descending order.
This index is highly effective for queries like:
DEPT OF CSE, SDIT 51
INTERNSHIP REPORT
o db.users.find({ age: 30 })
o db.users.find().sort({ age: 1 })
A compound index includes multiple fields, allowing queries to leverage more than one field
for efficient data retrieval. Example: db.users.createIndex({ age: 1, salary: -1 })
This index will prioritize the 'age' field first, then sort by 'salary' in descending order.
Efficient for queries like:
o db.users.find({ age: { $gt: 25 } }).sort({ salary: -1 })
o db.users.find({ age: 30, salary: 60000 })
Order of fields in the index matters, as MongoDB can only use the prefix subset of
fields in the index for sorting.
Text indexes allow for efficient search within text fields. Only one text index per collection is
permitted, but it can include multiple fields. Example: db.products.createIndex({ description:
"text", name: "text" })
A unique index prevents duplicate values for the indexed field. It is commonly used on fields
like email or username. Example: db.users.createIndex({ email: 1 }, { unique: true })
A sparse index only includes documents that contain the indexed field. It is useful for
collections with missing or optional fields. Example: db.users.createIndex({ phoneNumber: 1 },
{ sparse: true })
A partial index only indexes documents that meet specified criteria, reducing index size and
improving write performance. Example: db.users.createIndex({ age: 1 },
{ partialFilterExpression: { age: { $gte: 30 } } })
Indexes that are no longer useful can be dropped to free up space and improve write
performance. Example: db.users.dropIndex("age_1")
AGGREGATION FRAMEWORK
The Aggregation Framework in MongoDB is a powerful tool for processing and analyzing data
in multiple stages. It enables complex data transformations and computations, similar to SQL
queries involving GROUP BY, SUM, COUNT, etc.
3.13.2: $MATCH
3.13.3: $GROUP
3.13.4: $PROJECT
3.13.5: $SORT
Sorts the input documents by a specified field in ascending (1) or descending (-1) order.
Example: db.sales.aggregate([ { $sort: { totalSales: -1 } } ])
Sorting after $group helps to rank aggregated data.
3.13.7: $UNWIND
Deconstructs an array field from input documents to output a document for each
element. Example: db.users.aggregate([ { $unwind: "$skills" } ])
Useful for breaking down nested arrays and analyzing individual elements.
3.13.8: $LOOKUP
Performs a left outer join to another collection, similar to SQL JOIN. Example:
db.orders.aggregate([ { $lookup: { from: "customers", localField: "customerId",
foreignField: "_id", as: "customerDetails" } } ])
The result is an array field named 'customerDetails' containing matched documents.
The Aggregation Framework in MongoDB includes advanced operators that extend its
capabilities for more complex data transformations. These operators provide powerful data
processing, restructuring, and analysis tools.
3.14.1: $OUT
The $out stage writes the output of an aggregation pipeline to a new collection. It is
useful for creating materialized views or archiving data.
Example: db.sales.aggregate([ { $match: { status: "Completed" } }, { $group: { _id:
"$dept", totalSales: { $sum: "$amount" } } }, { $out: "sales_summary" } ])
If the specified collection already exists, $out will replace it.
Note: This operation is atomic and blocks write operations during execution.
DEPT OF CSE, SDIT 55
INTERNSHIP REPORT
3.14.2: $MERGE
$merge is similar to $out but offers more flexibility in handling existing documents in
the target collection.
Example: db.sales.aggregate([ { $group: { _id: "$dept", totalSales: { $sum: "$amount" }
} }, { $merge: { into: "sales_report", on: "_id", whenMatched: "merge",
whenNotMatched: "insert" } } ])
Options for 'whenMatched': "merge", "replace", "keepExisting", "fail".
Options for 'whenNotMatched': "insert", "discard".
3.14.3: $REDUCE
3.14.4: $ACCUMULATOR
3.14.5: $SET
3.14.6: $MAP
$map iterates over each element in an array and applies a specified expression.
Example: db.users.aggregate([ { $project: { doubledScores: { $map: { input: "$scores",
as: "score", in: { $multiply: ["$$score", 2] } } } } } ])
3.14.7: $FILTER
Polymorphic schemas handle multiple data structures within the same collection using a
discriminator field.
Backing up and restoring data in MongoDB is essential for data integrity, disaster recovery, and
data migration. MongoDB provides several utilities and methods for effective data backup and
restoration.
3.16.2: MONGODUMP
3.16.3: MONGORESTORE
Mongorestore restores data from the backups created using mongodump. It reconstructs
the database from BSON files.
Basic Syntax:
o Restore the entire database:
File system backup involves copying the database files directly from the data directory.
This method requires the database to be in a consistent state or locked.
Example:
o Shut down the MongoDB server:
cp -r /var/lib/mongodb /backup/mongodata/
o Restart MongoDB:
MongoDB Atlas offers automated backups with scheduled snapshots and point-in-time
recovery options.
Key Features:
o Scheduled backups
o Point-in-time restores
o Data encryption
o Multi-region backups
Steps to Enable Backup in Atlas:
o Go to Atlas > Clusters > Backup
o Set up a backup schedule and define retention policies.
CHAPTER 4
TASK COMPLETED
4.1 CALCULATOR USING HTML AND CSS
The task of designing a calculator using HTML and CSS focuses on creating a visually
appealing and structured layout without incorporating functionality. The design includes
essential elements such as a display screen to show inputs and outputs and buttons for digits
(0–9), operators (+, -, *, /), and special keys like "C" (clear) and "=" (equals). HTML is used
to build the structural framework of the calculator, while CSS is applied to enhance its
appearance. Styling involves organizing the buttons and display screen, adding appropriate
spacing, color schemes, fonts, hover effects, and ensuring a clean, responsive layout. The
final result is a static mockup resembling a functional calculator, ideal for presentation or
further development.
The result is an engaging, responsive animation that replicates a heartbeat, showcasing CSS's
ability to create captivating visual designs without requiring JavaScript.
CHAPTER 5
CONCLUSION
The need for internship is more emergent as one need to be oriented with self-learning
capacities required at a very short notice in industry. Got to know the industrial standards, the
skills that are required to help us contribute and grow with the industry, the ability of learning
by our own, logical thinking and many more. The internship program has made me
understand the career opportunities that can be explored. An understanding is grown about
the lifelong learning one need to sustain in the industry and the curious and open-minded
attitude one need to have for the same.
The internship helped in improving the interpersonal skills. In this internship, we learnt how
to design web pages. The trainer also helped us in improving our logical thinking by giving
us small assignments to write our own codes. Some of the technical outcomes of the training
are that we can logically analyse and provide considerable solutions.
REFERENCES
[1] Mozilla Developer Network (MDN). HTML, CSS, and JavaScript Documentation.
Retrieved from https://developer.mozilla.org/
[3] React – A JavaScript Library for Building User Interfaces. Official Documentation.
Retrieved from https://reactjs.org/docs/getting-started.html
[7] Axios – Promise based HTTP client for the browser and Node.js. Retrieved from
https://axios-http.com/docs/intro
[8] FreeCodeCamp. JavaScript, React, and Full Stack Development Tutorials. Retrieved from
https://www.freecodecamp.org/
[9] GeeksforGeeks. Computer Science Concepts and Programming Tutorials. Retrieved from
https://www.geeksforgeeks.org/