Enrollment no:236370307127
Practical 2
Aim: Introduction and Installation of MongoDB
Step 1: Open the MongoDB website, select MongoDB Community Server,
choose Windows x64 (.msi) and click Download.
Step 2: Run the downloaded MongoDB setup file and click Next to start the
installation wizard.
Enrollment no:236370307127
Step 3: Accept the License Agreement and click Next.
Step 4: Select the Complete setup type and click Next.
Enrollment no:236370307127
Step 5: In Service Configuration, keep default settings (Install MongoDB as
a Service) and click Next.
Step 6: Check Install MongoDB Compass option and click Next.
Enrollment no:236370307127
Step 7: Click Install to start installing MongoDB.
Step 8: After installation completes, click Finish to exit the setup wizard.
Enrollment no:236370307127
Step 9: Open MongoDB Compass and click Start on the welcome screen.
Step 10: In MongoDB Compass, click Add New Connection to connect to
the database server.
Enrollment no:236370307127
Step 11: Run the MongoDB Shell (mongosh) setup file and click Next.
Step 12: Choose the Destination Folder for MongoDB Shell and click Next.
Enrollment no:236370307127
Step 13: Click Install to install MongoDB Shell.
Step 14: After installation, click Finish to close the MongoDB Shell setup
wizard.
Enrollment no:236370307127
Step 15: Open Command Prompt, run mongosh, and use show dbs to
display available databases
ENROLLMENT NO.236370307031
PRACTICAL 3
AIM: Basic CRUD Operations with MongoDB
Create a database named 'OnlineStore and a collection named 'Products' with at least 4 fields.
CREAT :
READ:
ENROLLMENT NO.236370307031
UPDATE:
DELETE:
Enrollment no:236370307127
Practical 4
Aim :- Introduction and Setup of Cassandra.
Step 1: Run the Eclipse Temurin JDK setup file and click Next to start the
installation wizard.
Step 2: Accept the license agreement and click Next.
Enrollment no:236370307127
Step3:Select the destination folder for JDK installation and click Next.
Step 4: Choose the setup features for JDK and proceed by clicking Next.
Enrollment no:236370307127
Step 5: Click Install to begin installing the JDK on the system.
Step 6: Wait for the JDK installation process to complete.
Enrollment no:236370307127
Step 7: Click Finish to complete the JDK installation.
Step 8: Run the Python 2.7.11 (64-bit) setup file and click Next.
Enrollment no:236370307127
Step 9: Select Install for all users or just for the current user and click
Next.
Step 10: Choose the destination directory (e.g., C:\Python27) for Python
installation and click Next.
Enrollment no:236370307127
Step 11: Customize Python features such as pip, documentation, and
libraries if required.
Step 12: Click Next to start the Python installation process.
Enrollment no:236370307127
Step 13: Wait while the Python installer copies and installs files.
Step 14: Click Finish to complete the Python installation.
Enrollment no:236370307127
Step 15: Download and extract the Apache Cassandra package on the
system.
Step 16: Set the CASSANDRA_HOME and JAVA_HOME environment
variables.
Enrollment no:236370307127
Step 17: Open Command Prompt and run Cassandra using the command
cassandra to start the server.
[Link]
Practical 5
AIM: Data Modeling and Simple Queries with Cassandra
Create Keyspace AVN:
USE Keyspace:
Create Table:
Insert Table and Fetch table:
Create Index:
[Link]
Update Table:
Alter Table:
Drop Column:
Delete Record:
Enrollment no:236370307031
Practical 6
Aim :- Introduction to Neo4j Graph Databases.
What is Neo4j ?
Neo4j is a NoSQL database. It is highly scalable and schema-free. It's world most popular
graph database management system. Neo4j was developed by Neo technology and called an
ACID-compliant transactional database with native graph storage and processing.
Neo4j is implemented in Java language and it can be accessed by other language using
Cypher Query Language (CQL) through a transactional HTTP endpoint.
Features of Neo4j
Following is a list of prominent features of Neo4j:
Flexible Schema: Neo4j follows a data model called graph model. The graph contains nodes
and the nodes are connected to each other. Nodes and relationships store data in key-value pairs
known as properties.
ACID Property: Neo4j supports full ACID properties (Atomicity, Consistency, Isolation and
Durability).
Scalability: Neo4j facilitates you to scale the database by increasing the number of
reads/writes, and the volume without affecting the data integrity and the speed of query
processing.
Reliability: Neo4j provides replication for data safety and reliability.
Cypher Query Language: Neo4j provides a powerful declarative query language called
Cypher Query language. It is used to create and retrieve relations between data without using
the complex queries like Joins.
Built-in Web applications: Neo4j also provides a built-in Neo4j browser web application
which can be used to create and retrieve your graph data.
GraphDB: Neo4j follows Property Graph Data Model.
General Features:
o It supports UNIQUE constraints.
o It uses Native graph storage with Native GPE(Graph Processing Engine).
o It supports exporting of query data to JSON and XLS format.
Enrollment no:236370307031
o It provides REST API to be accessed by any Programming Language like Java, Spring,
Scala etc.
o It provides Java Script to be accessed by any UI MVC Framework like Node JS.
o It supports two kinds of Java API: Cypher API and Native Java API to develop Java
applications.
Advantages of Neo4j :
Following is a list of most important features of Neo4j:
Highly scalable: Neo4j is highly scalable. It provides a simple, powerful and
flexible data model which can be changed according to applications and uses. It
provides:
o Higher vertical scaling.
o Improved operational characteristics at scale.
o Higher concurrency.
o Simplified tuning.
What is Neo4j CQL ?
CQL stands for Cypher Query Language. It is a query language for Neo4j just
like SQL is a query language for Oracle or MySQL.
Neo4j CQL Features :
o CQL is a query language for Neo4j Graph Database.
o Is a declarative pattern-matching language.
o The syntax of CQL is same like SQL syntax.
o Syntax of CQL is very simple and in human readable format.
Neo4j CQL Functions :
A list of Neo4jCQL Function:
Enrollment no:236370307031
Neo4j CQL Data Types :
The Neo4j CQL data types are similar to Java language data types. They are used to define
properties of a node or a relationship.
A list of Neo4j CQL data types:
What is Graph ?
A graph is a pictorial representation of objects which are connected by some pair of links. A
graph contains two elements: Nodes (vertices) and relationships (edges).
What is Graph database ?
A graph database is a database which is used to model the data in the form of graph. It store
any kind of data using:
o Nodes
o Relationships
o Properties
Enrollment no:236370307031
Code:
CREATE (n:NGPP {name:"NGPP"});
CREATE (y1:Year {year:1});
CREATE (y2:Year {year:2});
CREATE (y3:Year {year:3});
CREATE (s1:Student {name:"Rohit"});
CREATE (s2:Student {name:"Kartik"});
CREATE (s3:Student {name:"Bhavani"});
CREATE (s4:Student {name:"Sujal"});
CREATE (s1)-[:STUDIES_AT]->(n);
CREATE (s2)-[:STUDIES_AT]->(n);
CREATE (s3)-[:STUDIES_AT]->(n);
CREATE (s4)-[:STUDIES_AT]->(n);
CREATE (s1)-[:STUDYING_IN]->(y2);
CREATE (s2)-[:STUDYING_IN]->(y3);
CREATE (s3)-[:STUDYING_IN]->(y1);
CREATE (s4)-[:STUDYING_IN]->(y3);
Enrollment no:236370307031
OUTPUT:
Rohit Bhavani
Kartik Sujal
Practical-7
AIM:- Basic Graph Queries and Implementations with Neo4j.
[Link] (n:collage {name: "Ngpp"})
[Link] (n:collage {name: "rngpit"})
[Link] (c:collage {name: "rngpit"})
CREATE(:Student {name: "Rohit"})-[:STUDIES_IN]->(c),
(:Student {name: "Bhavani"})-[:STUDIES_IN]->(c),
(:Student {name: "Kartik"})-[:STUDIES_IN]->(c),
(:Student {name: "Dhrutik"})-[:STUDIES_IN]->(c);
[Link] (a:Student {name: "Rohit"}),
(b:Student {name: "Bhavani"})
CREATE (a)-[:FRIENDS_WITH]->(b);
[Link] (c:collage {name: "rngpit"})
CREATE(:Student {name: "Rohit"})-[:STUDIES_IN]->(c),
(:Student {name: "Bhavani"})-[:STUDIES_IN]->(c),
(:Student {name: "Kartik"})-[:STUDIES_IN]->(c),
(:Student {name: "Dhrutik"})-[:STUDIES_IN]->(c);
[Link] (a:Student {name: "Rohit"}),
(b:Student {name: "Bhavani"})
CREATE (a)-[:FRIENDS_WITH]->(b),
(b)-[:FRIENDS_WITH]->(a);
[Link] (s:Student {name: "Bhavani"})
DETACH DELETE s;
[Link] (s:Student {name: "Bhavani"})
MATCH (c:College {name: "rngpit"})
MERGE (s)-[:STUDIES_AT]->(c);