0% found this document useful (0 votes)
63 views27 pages

No SQL Practical File

This document provides instructions and summaries for 4 practical labs involving NoSQL databases: 1. The first lab involves creating relations and constraints in MongoDB. 2. The second lab covers MongoDB installation and basic commands. 3. The third lab explains Neo4j installation, basic commands, and provides screenshots of query examples. 4. The fourth lab outlines the installation process for Cassandra, including selecting installation options and location.

Uploaded by

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

No SQL Practical File

This document provides instructions and summaries for 4 practical labs involving NoSQL databases: 1. The first lab involves creating relations and constraints in MongoDB. 2. The second lab covers MongoDB installation and basic commands. 3. The third lab explains Neo4j installation, basic commands, and provides screenshots of query examples. 4. The fourth lab outlines the installation process for Cassandra, including selecting installation options and location.

Uploaded by

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

PRACTICAL FILE

NO SQL

M.TECH CST 1ST SEMESTER

SUBMITTED TO:- ANUPRIYA MAM


SUBMITTED BY:-DISHITA CHUGH
INDEX
1. Practical lab :-1

2. Practical lab :-2

3 Practical lab :- 3

4 Practical lab :- 4
PRACTICAL:-1

1. Create the following relations along with the constraints specified:

a) Client(clno char(3), clname varchar(30), cladd varchar(40))


 Primary key-clno
 Clname can not be left blank
2.Project(pno char(3), pname varchar(30), pst date,clno char(3))
 PRIMARY KEY-pno
 FOREIGN KEY-clno refers to client relation
 Pname can not be left blank
3.Department (dno char(3), dname varchar(20), dloc varchar(20), dhead char(3))
 PRIMARY KEY-dno
 FOREIGN KEY- dhead refers to eno of employee relation
 Dname can not be left blank
 Default dloc is delhi
4. Employee (eno char(3), ename varchar(20), eadd varchar(30), ephone
char(10), esal int, grade char(1), edoj date, dno char(3))
 PRIMARY KEY-eno
 FOREIGN KEY- dno refers to department relation
5. Project allocation(eno char(3), pno char(3), hrs int)
 PRIMARY KEY-eno,pno
 FOREIGN KEY-eno refers to employee relation
 FOREIGN KEY-pno refers to project relation
6. Dependent (eno char(3), dpname varchar(20), dpdob datetime, dprelation
varchar(20))
 PRIMARY KEY- eno dpname
 FOREIGN KEY- eno refers to employee relation
PRACTICAL:-2

WORKING WITH MONGODB

 Lab1: Mongo Db installation


 You can download Mongo Db from: www.mongodb.com
 Documents:
 https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-
on-windows/?_ga=2.85071568.891595253.1499353286-
450514396.1499353286
 1:- Install Mongo Db a)Run the installation file as administrator. The default
installation path is : C:\ program files \Mongo DB\Server\3.4 The binaries
that are installed are:
 Server mongod.exe Router mongos.exe Client mongo.exe Monitoring tools
mongostat.exe, mongotop.exe ImportExport Tools mongodump.exe,
mongorestore.exe, mongoexport.exe, mongoimport.exe Miscellaneous
tools bsondump.exe, mongofiles.exe, mongoplog.exe, mongoperf.exe
 b) Create a directory: mkdir in C:\ Program files \Mongo Db\data
 c)Create a subdirectory in data as Db where it will store the database
objects. (By default it is located in the root of c:, change the path with the
-dbpath parameter in the boot)
 Create a subdirectory: mkdir in C:\Program Files \ MongoDb\ data\ log
which will be your blog
 2.- Start Mongo Db a) Locate the corresponding binary in C:\ Program files \
Mongo Db\ Server\ 3.4 \Bin b) It is recommended to create a shortcut for
mongod.exe
Commands of Mongo Db
1)

2)
3)
PRACTICAL :- 3
WORKING WITH NEO4J
NEO4J INSTALLATION
1) Download the latest release from Neo4j Download Center.
Select the appropriate ZIP distribution.
2) Check that the SHA hash of the downloaded file is correct:
a. To find the correct SHA hash, go to Neo4j Downloaded center and click
on SHA-256 which will be located below your downloaded file.
b. Using the appropriate commands for your platform, display the SHA-256
Hash for the file that you downloaded.
c. Ensure that the two are identical.
3) Right-click the downloaded file, click extract all.
4) Change the directory to the top level extracted directory.
Run bin\neo4j console
5) Stop the server by typing Ctrl-c in the console.
WINDOWS SERVICE
Neo4j can also be run as a windows service. Install the service with bin\neo4j
install-service, and start it with bin\neo4j start.
The available commands for bin\neo4j are: help, start, stop, restart, status, install-
service, uninstall-service, and update-service.
NEO4J COMMANDS AND SCREENSHOTS
1) Write a query to return all the movies that were released after the year
2000 limiting the result to 5 items.

2) Write a Query to retrieve all the movies released after the year 2005.
3) Write a query to return the count of movies released after the year 2005.

4) Write a query to return all person nodes who directed a movie that was
released after 2010.
5) Write a query to get all the people who acted in a movie that was released
after 2010.

6) Write a query to return only person nodes(limiting to 20 items).


7) Write a query to return all kinds of nodes.

8) Write a query to return movie nodes but with only the little and released
properties.
9) Write a query to get name and born properties of the person node.

10) Create a new person node with property name having value John
doe.
11) Write a query to find the movie with title “cloud atlas.

12) Write a query to get all the movies that were released between 2010
and 2015.
13) Write a query using merge to create a movie node with tittle
“Greyhound”. If the node does not exist then set its released property to
2020 and lastupdatedat property to the current time stamp. If the node
already exists, then only set lastupdatedat to the current time stamp.
Return the movie node.
PRACTICAL:- 4
4) INSTALLATION OF CASSSANDRA.
Step 1) Run the datastax community edition setup. After running the setup,
following page will be delayed. Here in the screenshot 64 bit version is being
installed. You can download 32 bit version as well according to your
requirements. But I recommended 64 bit version to use.
This page gives you information about the Cassandra version you are going to
install. Press the ‘next’ button.
Step 2) After pressing the ‘next’ button, following page will be displayed.
This page is about the license agreement. Mark the checkbox and press the next
button.
Step 3) After pressing the ‘next’ button, the following page will be displayed.
This page asks about the installation location.
1) Default location is C:\Program Files. You can change installation location if
you want to change. It is recommended not to change installation location.
2) After setting installation location, press the ‘next’ button
Step 4) After pressing ‘next’ button in above step, the following page will be
displayed. This page asks about whether you want to automatically start
Cassandra and OpsCenter.

1. Mark the checkboxes if you to want to automatically start Cassandra and


OpsCenter.

2. After providing this information, Press the ‘next’ button.


Step 5) After pressing the next button, following page will be displayed.
Setup has collected all the necessary information and now the setup is ready to
install. Press install button.
Step 6) After pressing ‘install’ button, following page will be displayed.

Datastax community edition is being installed. After installation is completed, click


on next button. When setup is installed successfully, press the ‘finish’ button.
Go to the windows start programs, search Cassandra CQL shell and run the
Cassandra shell. After running Cassandra shell, you will see the following
command line.

You might also like