Adt Lab11
Adt Lab11
TIRUCHIRAPPALLI- 620024
Name : …………………………….
Semester : …………………………….
TIRUCHIRAPPALLI- 620024
BONAFIDE CERTIFICATE
INSTALLATION PROCEDURE:
STEP 2: After the Login process the MongoDb Atlas Ask some question
STEP 4: Give the Cluster (or) Database name and proceed to Deployment the Server
STEP 5: A Window Pop up for Creating Username and password, then click the “Create
Username”
STEP 6: After that MongoDb database were created and Click the “Connect” button
STEP 7: After that the window will popped out, then click the “Shell menu”
STEP 8: The Last step to access the MongoDb via Command prompt
STEP 9; After installation the Mongosh, copy the command string in system command prompt
and Enter the password then the Database were Connected.
SAMPLE DATA:
QUERIES:
//CREATE
>use MCA_Placement
//INSERT
>db.user.insertMany([{Student_id:"1",Student_name:"Nandhu",Company:"Zoho",Salary:'70000'}
,{Student_id:"2",Student_name:"Vijay",Company:"TCS",Salary:'75000'},{Student_id:"3",Student
_name:"Loganathan",Company:"IBM",Salary:'80000'},{Student_id:"4",Student_name:"Sobiya",C
ompany:"Accenture",Salary:'75000'},{Student_id:"5",Student_name:"Jerish",Company:"Amazon
",Salary:'85000'}, {Student_id:"6",Student_name:"Saranya",Company:"HCL",Salary:'85000'},
{Student_id:"7",Student_name:"Jayachandran",Company:"Google",Salary:'100000'},
{Student_id:"8",Student_name:"Harshavardhan",Company:"Wipro",Salary:'800
00'}])
// DISPLAY
>db.user.find()
//UPDATE
>db.user.updateOne({Student_name:"Nandhu"}, {$set: {Salary:'80000'}})
>db.user.find()
//DELETE
>db.user.deleteOne({Student_name:"Nandhu"})
>db.user.find()
//INDEXING
>db.user.createIndex({id:1})
>db.user.getIndexes()
//DROP INDEX
>db.user.dropIndex({id:1})
>db.user.getIndexes()
OUTPUT:
STEP 2: To install java 8 ,sign in to oracle by using username or mail with password.
STEP 3: Go to files -> Copy the file path of java ->Edit the system environment variables-
>System properties->New path->ok.
STEP 5: Go to Environment variables -> Copy path -> Edit Environment variables -> New path -
> Ok.
Next open the command prompt type python.
STEP 7: After installing Cassandra, Go to System properties -> Environment variables -> New ->
copy path -> Edit environment variables ->paste path ->Ok.
SAMPLE DATA:
book_id book_name book_author book_price book_rating
1 The power of Joseph Murphy 149 4.5
your
subconscious
mind
2 Ikigai Francesc 348 4.6
Miralles
3 The Psychology Morgan Housel 274 4.6
of Money
4 Word Power Norman Lewis 97 4.4
Made Easy
5 Moral Story Maple Press 220 4.5
Books for Kids
QUERIES:
cqlsh: create keyspace amaazon with replication
{‘class’:’Networktopologystrategy’,’datacenter1’:1};
cqlsh: use amaazon;
//CREATE
cqlsh: amaazon >create table booksellers(book_id int PRIMARYKEY, book_name text,
book_author text, book_rating float, book_price varint);
//INSERT
Cqlsh: amaazon >insert into booksellers (book_id, book_name, book_author, book_rating,
book_price) values (1,’The Power of Your Subconscious Mind’,’Joseph Murphy’,4.5,149);
insert into booksellers (book_id, book_name, book_author, book_rating, book_price) values (2,
‘Ikigai’, ’Francsec Miralles’, ,4.6,348);
insert into booksellers (book_id, book_name, book_author, book_rating, book_price) values
(3,’ThePhsychology of Money’, ‘Morgan Housel’,4.6,274);
insert into booksellers (book_id, book_name, book_author, book_rating, book_price) values (4,
‘Word power Made Essay’, ‘Norman Lewis’,4.4,97);
insert into booksellers (book_id, book_name, book_author, book_rating, book_price) values (5,
‘Moral Story Books for Kids’, ‘Maple Press’,4.5,220)
//DISPLAY
cqlsh:amaazon>select* from booksellers;
//UPDATE
cqlsh:amaazon> update booksellers set book_price=100 where book_id=4;
//DELETE
cqlsh:amaazon>delete from booksellers where book_id=5;
OUTPUT:
STEP 4: In orientdb folder, open bin folder and run the server and enter password and user
name in server.
STEP 6: In readme file, copy this link http://localhost:2480 and paste it in chrome.
SAMPLE DATA:
Create new database> enter new database name and enter root password
Connect vertexes using edge name> Query: Create edge from vertex @rid to vertex @rid
OUTPUT:
SAMPLE DATA:
USER_ID USER_NAME USER_AGE USER_GENDER
QUERIES:
create database LinkedIn;
use LinkedIn;
//CREATE
create table profile(user_id varchar(30), user_name varchar(20),user_age int);
//INSERT
insert into profile values("@acer198","san_jay",21);
insert into profile values("@carrier11","sree_ram",21);
insert into profile values("@hittachi090","giri_dharan",21);
insert into profile values("@today00","revi",21);
insert into profile values("@adobe07","jay_chandran",21);
select * from profile;
//ALTER
alter table profile add user_gender varchar(10);
//UPDATE
update profile set user_gender="male";
select * from profile;
//DELETE
delete from profile where user_id="@today00";
//DROP
drop table profile;
mysql> drop database LinkedIn;
OUTPUT:
//INSERT
//DELETE:
//DROP:
MYSQL REPLICATION
INSTALLATION PROCEDURE:
STEP 1: Make Sure Tick the Hidden items and The “ProgramData” was Shown in Folder
STEP 2: Create the Server in Mysql Workbench
• Click the Plus Button near the Mysql Connections to Create the Server
• Create the First Server named as Server A and Do the Same process for Server B.
• Click the Test Connection for both the Server and Click Ok.
• After the Creating the Server the Pop shows like this
SERVER A:
server-id=1
log-bin="mysql-bin"
binlog-ignore-db=information_schema
replicate-ignore-db=information_schema
relay-log="mysql-relay-log"
auto-increment-increment = 2
SERVER B:
server-id=2
log-bin="mysql-bin"
binlog-ignore-db=information_schema
replicate-ignore-db=information_schema
relay-log="mysql-relay-log"
auto-increment-increment = 2
QUERIES:
1. Create the replicator user in either Server A and Server B. You can do that using MySql shell
using the following commands:
3. To Connect Server B to Server A as a Slave to Master Host, type the following sql
command in Mysql Workbench:
4. Now Connect to Server B via Mysql Workbench and type the following sql command:
STOP SLAVE;
CHANGE MASTER TO MASTER_HOST = 'Server A IP Address', MASTER_USER =
'replicator', MASTER_PASSWORD = '[replicator_password]', MASTER_LOG_FILE =
'mysql-bin.000001', MASTER_LOG_POS = 10
START SLAVE;
5. Lastly go to Server A and type sql command to show the slaves which were connected to
Master Host
INSTALLATION PROCEDURE:
STEP 1: Firstly, choose the MySQL version and operating system. Then, we download the desired
MSI installer on your system by clicking the 'Download' button shown in the image below. This
installer is suitable for both 32-bit and 64-bit systems
STEP 2: Then, we will be redirected to another file download page. Here, ignore the prompts asking
to log in or sign up and directly start downloading by clicking on the link as shown in the image.
STEP 3: Once the installer is downloaded, run it to start the MySQL installation.
STEP 4: Now, we can see the installer community window, asking to choose a Setup type for our
MySQL products. Choose Custom and click Next to decide what products we want to actually
install.
STEP 5: In the next step, select MySQL Server, MySQL Workbench, MySQL Shell (all latest
versions) to be installed. We can also choose more products available as per necessity. Click Next
STEP 6: The installation process will now begin. However, path conflicts might arise if there exists
a path directory with the same name. After the installation is done, click Next.
STEP 7: In this step, we will be asked to set Type and Networking of MySQL. Unless there is any
particular change we want to make, it is recommended to keep the settings as they are, and
click Next.
STEP 8: Then, we need to set the Authentication method to access MySQL root user. So, choose
the strong password encryption method (as it is recommended) and click Next.
STEP 9: Set a password for the root account. This password must always be used to log into the
root account in every session. After setting password, click Next.
STEP 10: In this step, MySQL Server Instance will be configured as a Windows Service. The
default name will be set as "MySQL80", which can be changed if needed. Click Next.
STEP 11: Now, set the file permissions as required and click Next.
STEP 12: As shown in the image below, the specified configuration steps will be applied on
clicking Execute.
Once it is completed, click Finish. The next window will display the products on which the
configuration is applied. Click Next to finish the installation.
STEP 13: The installation is now complete. Uncheck the options asking to start MySQL
Workbench and Shell after setup, so that they will not run after setup. Click Finish.
The MySQL Server is now installed in the Windows Operating System. We can now access it via
the Command Prompt or the UI products we installed with it (Shell and Workbench)
SAMPLE DATA:
Name Location
Restaurant 1 -26.66115 40.95858
Restaurant 2 -26.68685 40.93992
Restaurant 3 -31.11924 42.39557
QUERIES:
//CREATE
mysql> CREATE TABLE restaurants (name VARCHAR (100), location GEOMETRY NOT
NULL, SPATIAL INDEX (location));
//INSERT
//ALTER
// DELETE
//DROP
OUTPUT
QUERIES:
create database Toll;
use Toll;
//CREATE
create table vehicle(vehicle_number varchar(20),vehicle_model varchar(20), entry_time
datetime);
//INSERT
insert into vehicle values("TN_55_0001","BMW_M5",now());
insert into vehicle values("TN_55_6969","ALTO 800",now());
select * from vehicle;
//ALTER
ALTER TABLE vehicle ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY;
OUTPUT:
STEP 1: Firstly, choose the MySQL version and operating system. Then, we download the desired
MSI installer on your system by clicking the 'Download' button shown in the image below. This
installer is suitable for both 32-bit and 64-bit systems
STEP 2: Then, we will be redirected to another file download page. Here, ignore the prompts asking
to log in or sign up and directly start downloading by clicking on the link as shown in the image.
STEP 3: Once the installer is downloaded, run it to start the MySQL installation.
STEP 4: Now, we can see the installer community window, asking to choose a Setup type for our
MySQL products. Choose Custom and click Next to decide what products we want to actually
install.
STEP 5: In the next step, select MySQL Server, MySQL Workbench, MySQL Shell (all latest
versions) to be installed. We can also choose more products available as per necessity. Click Next.
STEP 6: The installation process will now begin. However, path conflicts might arise if there exists
a path directory with the same name. After the installation is done, click Next.
STEP 7: In this step, we will be asked to set Type and Networking of MySQL. Unless there is any
particular change we want to make, it is recommended to keep the settings as they are, and
click Next.
STEP 8: Then, we need to set the Authentication method to access MySQL root user. So, choose
the strong password encryption method (as it is recommended) and click Next.
STEP 9: Set a password for the root account. This password must always be used to log into the
root account in every session. After setting password, click Next.
STEP 10: In this step, MySQL Server Instance will be configured as a Windows Service. The
default name will be set as "MySQL80", which can be changed if needed. Click Next.
STEP 11: Now, set the file permissions as required and click Next.
STEP 12: As shown in the image below, the specified configuration steps will be applied on
clicking Execute.
Once it is completed, click Finish. The next window will display the products on which the
configuration is applied. Click Next to finish the installation.
STEP 13: The installation is now complete. Uncheck the options asking to start MySQL
Workbench and Shell after setup, so that they will not run after setup. Click Finish.
The MySQL Server is now installed in the Windows Operating System. We can now access it via
the Command Prompt or the UI products we installed with it (Shell and Workbench).
SAMPLE DATA:
User id followers
local_logu 220
astro_vj 120
lovely_nandhu 340
QUERIES:
//CREATE
mysql> create table user_followers_list (user_id varchar (30), followers int);
//INSERT
mysql> insert into user_followers_list values("local_logu",220);
mysql> insert into user_followers_list values("astro_vj",120);
mysql> insert into user_followers_list values("lovely_nandhu",340);
mysql> select*from user_followers_list;
//CREATE TRIGGER
mysql> create trigger ins_sum before insert on user_followers_list for each row set
@sum=@sum+ new.followers;
mysql>set@sum=220+120+340;
mysql>select@sum as total;
OUTPUT:
OUTPUT:
TABLE CREATION:
Biodata.xml
<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "stu_detail.xsl"?>
<biodata>
<student>
<Reg_no>01</Reg_no>
<Student_Name>sara</Student_Name>
<DOB>09-01-2002</DOB>
<Gender>female</Gender>
<Department>MCA</Department>
</student>
<student>
<Reg_no>20</Reg_no>
<Student_Name>Deepak</Student_Name>
<DOB>21-09-2000</DOB>
<Gender>male</Gender>
<Department>MBA</Department>
</student>
<student>
<Reg_no>43</Reg_no>
<Student_Name>samyuktha</Student_Name>
<DOB>07-12-2002</DOB>
<Gender>female</Gender>
<Department>physics</Department>
</student>
</biodata>
stu_detail.xsl:
<?xml version="1.0" encoding = "UTF-8"?>
<xsl:stylesheet version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">
<xsl:template match = "/">
<html>
<body>
<h2>STUDENTS BIODATA</h2>
<table border="2">
<tr bgcolor="yellow">
<th>Reg_no</th>
<th>Student_Name</th>
<th>DOB</th>
<th>Gender</th>
<th>Department</th>
</tr>
<xsl:for-each select="biodata/student">
<tr bgcolor="cyan">
<td>
<xsl:value-of select="Reg_no"/>
</td>
<td>
<xsl:value-of select="Student_Name"/>
</td>
<td>
<xsl:value-of select="DOB"/>
</td>
<td>
<xsl:value-of select="Gender"/>
</td>
<td>
<xsl:value-of select="Department"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
OUTPUT:
STEP 1: Visit the Microsoft SQL Server website to download the Developer Edition: SQL Server
Downloads
Run the downloaded installer.
1. Go to the Microsoft SQL Server Management Studio download page: SSMS Download
STEP 3: Connect Microsoft SQL Server Management Studio with SQL Server
SAMPLE DATA:
DECLARE @x xml
SET @x='
<social_media>
<instagram>
<user>
<id>astro_vj</id>
<name>Vijay</name>
<age>22</age>
<city>Thoothukudi</city>
</user>
<user>
<id>local_logu</id>
<name>Loganathan</name>
<age>22</age>
<city>Devakottai</city>
</user>
<user>
<id>lovely_nandhu</id>
<name>Shree Nandhan</name>
<age>22</age>
<city>Trichy</city>
</user>
</instagram>
</social_media>'
;
SELECT @x.query('
for $b in social_media/instagram/user
let $a := $b/id
let $p := $b/name
where $a="lovely_nandhu"
order by ($p)[1]
return $b
')
OUTPUT:
MOBILE DATABASE
INSTALLATION PROCEDURE:
STEP 3: Give the Cluster (or) Database name and proceed to Deployment the Server
STEP 4: A Window Pop up for Creating Username and password ,then click the “Create
Username”
STEP 5: After that MongoDb database were created and Click the “Connect” button
STEP 6: After that the window will popped out, then click the “Compass menu”
STEP 8: After installation the Mongo Compass, copy the command string in system command
prompt and Enter the password then the Database were Connected.
STEP 10: Create a Database name and Collection name. Finally import the values in JSON Format.
SAMPLE DATA:
QUERIES:
[
{
"id": "1",
"Name": "Nandhu",
"Present_Days": "50",
"Absent_Days": "10",
"OnDuty_Days": "15"
},
{
"id": "2",
"Name": "Loganathan",
"Present_Days": "55",
"Absent_Days": "7",
"OnDuty_Days": "13"
},
{
"id": "3",
"Name": "Vijay",
"Present_Days": "65",
"Absent_Days": "8",
"OnDuty_Days": "2"
},
{
"id": "4",
"Name": "Sobiya",
"Present_Days": "68",
"Absent_Days": "7",
"OnDuty_Days": "0"
},
{
"id": "5",
"Name": "Jerish",
"Present_Days": "65",
"Absent_Days": "9",
"OnDuty_Days": "1"
},
{
"id": "6",
"Name": "Saranya",
"Present_Days": "68",
"Absent_Days": "7",
"OnDuty_Days": "0"
},
{
"id": "7",
"Name": "Jayachandran",
"Present_Days": "60",
"Absent_Days": "15",
"OnDuty_Days": "0"
},
{
"id": "8",
"Name": "Harshavardhan",
"Present_Days": "62",
"Absent_Days": "14",
"OnDuty_Days": "0"
}
]
OUTPUT: