[go: up one dir, main page]

0% found this document useful (0 votes)
15 views43 pages

DB (PS)

This document is a laboratory certificate for Pavan N Shetty, confirming the completion of practical work in the DBMS and Web Technologies Laboratory as part of the MCA program at Srinivas Institute of Technology. It includes a detailed index of experiments and queries related to database management and web technologies, along with SQL commands for creating and manipulating database tables. The document outlines various tasks such as creating tables, executing queries, and developing XHTML pages with JavaScript functionalities.

Uploaded by

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

DB (PS)

This document is a laboratory certificate for Pavan N Shetty, confirming the completion of practical work in the DBMS and Web Technologies Laboratory as part of the MCA program at Srinivas Institute of Technology. It includes a detailed index of experiments and queries related to database management and web technologies, along with SQL commands for creating and manipulating database tables. The document outlines various tasks such as creating tables, executing queries, and developing XHTML pages with JavaScript functionalities.

Uploaded by

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

SRINIVAS INSTITUTE OF TECHNOLOGY

(NAAC Accredited)
Valachil, Mangaluru-574 143

Master of Computer Applications


(Affiliated to VTU)

Name : Pavan N Shetty

USN : 4SN24MC018

Subject : DBMS and Web Technologies Laboratory

Subject Code : MMCL106

Course : MCA

Semester : 1st
SRINIVAS INSTITUTE OF TECHNOLOGY
(NAAC Accredited)
VALACHIL, MANGALURU-574 143

DEPARTMENT OF MASTER OF COMPUTER


APPLICATIONS

LABORATORY CERTIFICATE
This is to Certify that, Mr.Pavan N Shetty bearing USN
4SN24MC018 has satisfactorily completed the practical work in
DBMS and Web Technologies Laboratory prescribed by the
Visvesvaraya Technological University, Belgaum for the 1st Semester
MCA course during the year 2024-2025.

Lecturer In-charge Head of the Department

(Ms. Nikshitha R S) (Dr. Shashidhar Kini K)

Date:

Examiners: Signature

1.

2.
INDEX
Sl.No Experiments Page.No
1. Create the following tables with properly specifying Primary
keys, Foreign keys and solve the following queries.
BRANCH (Branchid, Branchname, HOD)
STUDENT (USN, Name, Address, Branchid, sem)
BOOK (Bookid, Bookname, Authorid, Publisher, Branchid)
AUTHOR (Authorid, Authorname, Country, age)
BORROW (USN, Bookid, Borrowed_Date)
Execute the following Queries:
i. List the details of Students who are all studying in 2nd sem
MCA.
ii. List the students who are not borrowed any books.
iii. Display the USN, Student name, Branch_name, Book_name,
01-07
Author_name, Books_Borrowed_Date of 2nd sem MCA
Students who borrowed books.
iv. Display the number of books written by each Author.
v. Display the student details who borrowed more than two
books.
vi. Display the student details who borrowed books of more than
one Author.
vii. Display the Book names in descending order of their names.
viii.List the details of students who borrowed the books which
are all published by the same publisher.
2. Consider the following schema:
STUDENT (USN, name, date_of_birth, branch, mark1, mark2,
mark3, total, GPA) Execute the following queries:
i. Update the column total by adding the columns mark1, mark2,
mark3.
ii. Find the GPA score of all the students.
iii. Find the students who born on a particular year of birth from
the date_of_birth column.
08-11
iv. List the students who are studying in a particular branch of
study. v. Find the maximum GPA score of the student branch-
wise.
vi. Find the students whose name starts with the alphabet.
vii. Find the students whose name ends with the alphabets.
viii. Delete the student details whose USN is given as 1001.
3. Design an ER-diagram for the following scenario, Convert the
same into a relational model and then solve the following
queries.Consider a Cricket Tournament “ABC CUP” organized
by an organization.In the tournament there are many teams are
contesting each having a Teamid,Team_Name, City, a coach.
12-17
Each team is uniquely identified by using Teamid. A team can
have many Players and a captain. Each player is uniquely
identified by Playerid, having a Name, and multiple phone
numbers,age. A player represents only one team. There are
many Stadiums to conduct matches. Each stadium is identified
using Stadiumid, having a stadium_name,Address ( involves
city,area_name,pincode). A team can play many matches. Each
match played between the two teams in the scheduled date and
time in the predefined Stadium. Each match is identified
uniquely by using Matchid. Each match won by any of the one
team that also wants to record in the database. For each match
man_of_the match award given to a player.
Execute the following Queries:
i. Display the youngest player (in terms of age) Name, Team
name, age in which he belongs of the tournament.
ii. List the details of the stadium where the maximum number of
matches were played.
iii. List the details of the player who is not a captain but got the
man_of _match award at least in two matches.
iv. Display the Team details who won the maximum matches.
v. Display the team name where all its won matches played in
the same stadium.
4. Design an ER-diagram for the following scenario, Convert the
same into a relational model, normalize Relations into a suitable
Normal form and then solve the following queries. A country
can have many Tourist places . Each Tourist place is identified
by using tourist_place_id, having a name, belongs to a state,
Number of kilometers away from the 02.03.2021 updated 52/
104 capital city of that state,history. There are many Tourists
visits tourist places every year. Each tourist is identified
uniquely by using Tourist_id, having a Name, age, Country and
multiple emailids. A tourist visits many Tourist places, it is also
required to record the visted_date in the database. A tourist can
visit a Tourist place many times at different dates. A Tourist
place can be visited by many tourists either in the same date or 18-23
at different dates.
Queries:
i. List the state name which is having maximum number of
tourist places.
ii. List details of Tourist place where maximum number of
tourists visited.
iii. List the details of tourists visited all tourist places of the state
iv. Display the details of the tourists visited at least one tourist
place of the state, but visited all states tourist places.
v. Display the details of the tourist place visited by the tourists
of all country.
5. Program Statement: Design an ER-diagram for the following
scenario, Convert the same into a relational model, normalize
Relations into a suitable Normal form and then solve the
following queries. A country can have many Tourist places .
Each Tourist place is identified by using tourist_place_id,
having a name, belongs to a state, Number of kilometers away
from the 02.03.2021 updated 52/ 104 capital city of that
state,history. There are many Tourists visits tourist places every
year. Each tourist is identified uniquely by using Tourist_id,
having a Name, age, Country and multiple emailids. A tourist
visits many Tourist places, it is also required to record the
visted_date in the database. A tourist can visit a Tourist place
many times at different dates. A Tourist place can be visited by 24-28
many tourists either in the same date or at different dates.
Queries:
i. List the state name which is having maximum number of
tourist places. ii. List details of Tourist place where maximum
number of tourists visited. iii. List the details of tourists visited
all tourist places of the state
iv. Display the details of the tourists visited at least one tourist
place of the state, but visited all states tourist places.
v. Display the details of the tourist place visited by the tourists
of all country.
6. Create an XHTML page that provides information about your
department. Your XHTML page must use the following tags:
a) Text Formatting tags b) Horizontal rule c) Meta element d) Links e) 29-32
Images f) Tables (Use of additional tags encouraged).

7. Develop and demonstrate a XHTML file that includes Javascript


script for the following problems:
a) Input : A number n obtained using prompt
Output : The first n Fibonacci numbers 33-35
b) Input : A number n obtained using prompt
Output : A table of numbers from 1 to n and their squares
using alert
8. Develop and demonstrate, using JavaScript script, a XHTML
document that contains three short paragraphs of text, stacked on
top of each other, with only enough of each showing so that the
mouse cursor can be placed over some part of them. When the
cursor is placed over the exposed part of any paragraph, it 36-38
should rise to the top to become completely visible. Modify the
above document so that when a text is moved from the top
stacking position, it returns to its original position rather than to
the bottom
DBMS and Web Technologies Laboratory (MMCL106)

Name: Pavan N Shetty Date: 23-01-2025


Program No: 1 USN: 4SN24MC018
Program Statement: Create the following tables with properly specifying
Primary keys, Foreign keys and solve the following queries.
BRANCH (Branchid, Branchname, HOD)
STUDENT (USN, Name, Address, Branchid, sem)
BOOK (Bookid, Bookname, Authorid, Publisher, Branchid)
AUTHOR (Authorid, Authorname, Country, age)
BORROW (USN, Bookid, Borrowed_Date)
Execute the following Queries:
i. List the details of Students who are all studying in 2nd sem MCA.
ii. List the students who are not borrowed any books.
iii. Display the USN, Student name, Branch_name, Book_name,
Author_name, Books_Borrowed_Date of 2nd sem MCA Students who
borrowed books.
iv. Display the number of books written by each Author.
v. Display the student details who borrowed more than two books. vi.Display
the student details who borrowed books of more than one Author.
vii. Display the Book names in descending order of their names.
viii. List the details of students who borrowed the books which are all
published by the same publisher.
Relational Model:

SIT, Mangalore PageNo|1


DBMS and Web Technologies Laboratory (MMCL106)

Source Code:
mysql> create database library;
mysql> use library;
Database changed

Table Branch
mysql> create table branch(branch_id int(10) primary key,branch_name varchar(20),hod
varchar(20));

Insert
mysql> insert into branch values(101,'MCA','Shashidhar Kini');
mysql> insert into branch values(102,'MBA','Harish');
mysql> insert into branch values(103,'BE','AshaLatha');
mysql> insert into branch values(104,'Mtech','Seema');
mysql> insert into branch values(105,'Btech','Malavika');
mysql> select * from branch;
+ + + +
| branch_id | branch_name | hod |
+ + + +
| 101 | MCA | Shashidhar Kini |
| 102 | MBA | Harish |
| 103 | BE | AshaLatha |
| 104 | Mtech | Seema |
| 105 | Btech | Malavika |
+ + + +
5 rows in set

Table Student
mysql> create table student( usn varchar(10) primary key, s_name varchar(20),branch_id
int(10) references branch(branch_id),sem varchar(20),address varchar(20));

Insert
mysql> insert into student values('S21','Nireeksha',101,2,'Adyar');
mysql> insert into student values('S22','Akhrith',102,2,'Kasargod');
mysql> insert into student values('S23','Mehika',103,2,'Vamadapadav');
mysql> insert into student values('S24','Chiranya',104,2,'Kodakal');
mysql> insert into student values('S25','Thanvi',105,1,'Uppala');
mysql> insert into student values('S26','Shraddha',101,1,'Udupi');
mysql> insert into student values('S27','Adya',102,1,'Udupi');
mysql> insert into student values('S28','Rithisha',101,2,'Mumbai');
Query OK, 1 row affected (0.01 sec)

SIT, Mangalore PageNo|2


DBMS and Web Technologies Laboratory (MMCL106)

mysql> select * from student;


+ + + + + +
| usn | s_name | branch_id | sem | address |
+ + + + + +
| S21 | Nireeksha | 101 | 2 | Adyar |
| S22 | Akhrith | 102 | 2 | Kasargod |
| S23 | Mehika | 103 | 2 |Vamadapadav |
| S24 | Chiranya | 104 | 2 | Kodakal |
| S25 | Thanvi | 105 | 1 | Uppala |
| S26 | Shraddha | 101 | 1 | Udupi |
| S27 | Adya | 102 | 1 | Udupi |
| S28 | Rithisha | 101 | 2 | Mumbai |
+ + + + + +
8 rows in set

Table Author
mysql> create table author(author_id int(10) primary key,author_name varchar(20),country
varchar(20),age int(20));

Insert
mysql> insert into author values(1,'Sudha','India',30);
mysql> insert into author values(2,'Kuvempu','India',70);
mysql> insert into author values(3,'Kavin','America',50);
mysql> insert into author values(4,'Lee Min ho','Korea',70);
mysql> insert into author values(5,'Xukai','China',25);

mysql> select * from author;


+ + + + +
| author_id | author_name | country | age |
+ + + + +
| 1 | Sudha | India | 30 |
| 2 | Kuvempu | India | 70 |
| 3 | Kavin | America | 50 |
| 4 | Lee Min ho | Korea | 70 |
| 5 | Xukai | China | 25 |
+ + + + +
5 rows in set

Table Book
mysql> create table book (book_id int(10) primary key,book_name varchar(20), author_id
int(10) references author(author_id), publisher varchar(20),branch_id int(10) references
student(branch_id));

SIT, Mangalore PageNo|3


DBMS and Web Technologies Laboratory (MMCL106)

Insert
mysql> insert into book values(201,'Earth',1,'Mangala',101);
mysql> insert into book values(202,'Happy',2,'Mangala',102);
mysql> insert into book values(203,'Gold',3,'Swapna',103);
mysql> insert into book values(204,'Myname',3,'Education',104);
mysql> insert into book values(206,'The Horror',5,'Education',101);

mysql> select * from book;


+ =+ + + + +
| book_id | book_name | author_id | publisher | branch_id |
+ + + + + +
| 201 | Earth | 1 | Mangala | 101 |
| 202 | Happy | 2 | Mangala | 102 |
| 203 | Gold | 3 | Swapna | 103 |
| 204 | Myname | 3 | Education | 104 |
| 206 | The Horror | 5 | Education | 101 |
+ + + + + +
5 rows in set

Table Borrow
create table borrow(usn varchar(10) references student(usn),book_id int(10) references
book(book_id), borrowed_date date);

Insert
mysql> insert into borrow values('S21',201,'2023-05-03');
mysql> insert into borrow values('S21',206,'2023-12-17');
mysql> insert into borrow values('S22',203,'2023-10-21');
mysql> insert into borrow values('S23',205,'2023-05-23');
mysql> insert into borrow values('S24',202,'2023-01-15');
mysql> insert into borrow values('S26',202,'2023-05-29');

mysql> select * from borrow;


+ + + +
| usn | book_id | borrowed_date |
+ + + +
| S21 | 201 | 2023-05-03 |
| S21 | 206 | 2023-12-17 |
| S22 | 203 | 2023-10-21 |
| S23 | 205 | 2023-05-23 |
| S24 | 202 | 2023-01-15 |
| S26 | 202 | 2023-05-29 |
+ + + +
6 rows in set

SIT, Mangalore PageNo|4


DBMS and Web Technologies Laboratory (MMCL106)

Query 1:
mysql> select s.* from student s join branch b on s.branch_id=b.branch_id where s.sem=2
and b.branch_name ='MCA';
+ + + + + +
| usn | s_name | branch_id | sem | address |
+ + + + + +
| S21 | Nireeksha | 101 | 2 | Adyar |
| S28 | Rithisha | 101 | 2 | Mumbai |
+ + + + + +
2 rows in set

Query 2:
mysql> select s.* from student s left join borrow b on s.usn = b.usn where b.usn is null;
+ + + + + +
| usn | s_name |branch_id | sem | address |
+ + + + + +
| S25 | Thanvi | 105 | 1 | Uppala |
| S27 | Adya | 102 | 1 | Udupi |
| S28 | Rithisha | 101 | 2 | Mumbai|
+ + + + + +
3 rows in set

Query 3:
mysql> select s.usn,s.s_name as studentname,br.branch_name,
bo.book_name,a.author_name,b.borrowed_date from student s join branch br on s.branch_id
= br.branch_id join borrow b on s.usn = b.usn join book bo on b.book_id =bo.book_id join
author a on bo.author_id = a.author_id where s.sem = 2 and br.branch_name ='MCA';
+ + + + + + +
| usn | studentname | branch_name | book_name | author_name | borrowed_date |
+ + + + + + +
| S21 | Nireeksha | MCA | Earth | Sudha | 2023-05-03 |
| S21 | Nireeksha | MCA | The Horror | Xukai | 2023-12-17 |
+ + + + + + +
2 rows in set

Query 4:
mysql> select a.author_id,a.author_name,count(bo.book_id)as number_of_books from author
a left join book bo on a.author_id = bo.author_id group by a.author_id,a.author_name;
+ + + +
| author_id | author_name | number_of_books |
+ + + +
| 1 | Sudha | 1|
| 2 | Kuvempu | 1|

SIT, Mangalore PageNo|5


DBMS and Web Technologies Laboratory (MMCL106)

| 3 | Kavin | 2|
| 4 | Lee Min ho | 0|
| 5 | Xukai | 1|
+ + + +
5 rows in set (0.00 sec)

Query 5:
mysql> select s.* from student s join borrow b on s.usn =b.usn join book bo on b.book_id
=bo.book_id group by s.usn,s.s_name,s.address,s.branch_id,s.sem having count(distinct
bo.author_id)>1;
+ + + + + +
| usn | s_name | branch_id | sem | address |
+ + + + + +
| S21 | Nireeksha | 101 | 2 | Adyar |
+ + + + + +
1 row in set

Query 6:
mysql> select s.* from student s join borrow b on s.usn = b.usn group by
s.usn,s.s_name,s.address,s.branch_id,s.sem having count(b.book_id)>=2;
+ + + + + +
| usn | s_name | branch_id | sem | address |
+ + + + + +
| S21 | Nireeksha | 101 | 2 | Adyar |
+ + + + + +
1 row in set (0.00 sec)

Query 7:
mysql> select book_name from book order by book_name desc;
+ +
| book_name |
+ +
| The Horror |
| Myname |
| Happy |
| Gold |
| Earth |
+ +
5 rows in set
Query 8:
mysql> select distinct s.* from student s join borrow b on s.usn = b.usn join book bo on
b.book_id =bo.book_id where bo.publisher in(select publisher from book group by publisher
having count(distinct book_id)>1);

SIT, Mangalore PageNo|6


DBMS and Web Technologies Laboratory (MMCL106)
+ + + + + +
| usn | s_name | branch_id | sem | address |
+ + + + + +
| S21 | Nireeksha | 101 | 2 | Adyar |
| S24 | Chiranya | 104 | 2 | Kodakal |
| S26 | Shraddha | 101 | 1 | Udupi |
+ + + + + +
3 rows in set

SIT, Mangalore PageNo|7


DBMS and Web Technologies Laboratory (MMCL106)

Name: Pavan N Shetty Date: 20-02-2025


Program No: 2 USN: 4SN24MC018
Program Statement: Consider the following schema:
STUDENT (USN, name, date_of_birth, branch, mark1, mark2, mark3,
total, GPA)
Execute the following queries:
i. Update the column total by adding the columns mark1, mark2, mark3.
ii. Find the GPA score of all the students.
iii. Find the students who born on a particular year of birth from the
date_of_birth column.
iv. List the students who are studying in a particular branch of study.
v. Find the maximum GPA score of the student branch-wise.
vi. Find the students whose name starts with the alphabet.
vii. Find the students whose name ends with the alphabets.
viii. Delete the student details whose USN is given as 1001.

Source Code:
mysql> create database Student1;
mysql> use Student1;
Database changed

Table Student
mysql> create table Student(USN varchar(10) primary key,Name varchar(30),DOB
date,Branch varchar(10),mark1 int(4),mark2 int(4),mark3 int(4),Total int(4),GPA integer(5));

Insert
mysql> insert into Student values('SS001','Likhitha','2003-04-04','MCA',70,80,95,0,NULL);
mysql> insert into Student values('SS002','Raksha','2003-04-12','MCA',50,60,85,0,NULL);
mysql> insert into Student values('SS003','Ameesha','2003-12-05','MCA',80,85,90,0,NULL);
mysql> insert into Student values('SS004','Suraj','1999-10-05','MBA',50,55,70,0,NULL);
mysql> insert into Student values('SS005','Sagar','2000-08-20','MA',70,55,60,0,NULL);
mysql> insert into Student values('SS006','Manohar','1993-03-28','MSC',10,60,90,0,NULL);
mysql> insert into Student values('SS007','Priyanka','2002-04-12','MCA',85,90,100,0,NULL);
mysql> insert into Student values('SS008','Agasthya','2001-07-06','MBA',95,90,90,0,NULL);

mysql> select * from Student;


+ + + + + + + + + +
| USN | Name | DOB | Branch | mark1 | mark2 | mark3 | Total | GPA |
+ + + + + + + + + +
| SS001 | Likhitha |2003-04-04| MCA | 70 | 80 | 95 | 0 | NULL |
| SS002 | Raksha |2003-04-12| MCA | 50 | 60 | 85 | 0 | NULL |
| SS003 | Ameesha|2003-12-05| MCA | 80 | 85 | 90 | 0 | NULL |
| SS004 | Suraj |1999-10-05| MBA | 50 | 55 | 70 | 0 | NULL |

SIT, Mangalore PageNo|8


DBMS and Web Technologies Laboratory (MMCL106)

| SS005 | Sagar |2000-08-20| MA | 70 | 55 | 60 | 0 | NULL |


| SS006 | Manohar |1993-03-28| MSC | 10 | 60 | 90 | 0 | NULL |
| SS007 | Priyanka | 2002-04-12 | MCA | 85 | 90 | 100 | 0 | NULL |
| SS008 | Agasthya | 2001-07-06| MBA | 95 | 90 | 90 | 0 | NULL |
+ + + + + + + + + +
8 rows in set

Query 1:
mysql> Update Student set total = mark1+mark2+mark3;
Rows matched: 8 Changed: 8

mysql> select * from Student;


+ + + + + + + + + +
| USN | Name | DOB | Branch | mark1 | mark2 | mark3 | Total | GPA |
+ + + + + + + + + +
| SS001 | Likhitha | 2003-04-04 | MCA | 70 | 80 | 95 | 245 | NULL |
| SS002 | Raksha | 2003-04-12 | MCA | 50 | 60 | 85 | 195 | NULL |
| SS003 | Ameesha| 2003-12-05 | MCA | 80 | 85 | 90 | 255 | NULL |
| SS004 | Suraj | 1999-10-05 | MBA | 50 | 55 | 70 | 175 | NULL |
| SS005 | Sagar | 2000-08-20 | MA | 70 | 55 | 60 | 185 | NULL |
| SS006 | Manohar| 1993-03-28 | MSC | 10 | 60 | 90 | 160 | NULL |
| SS007 | Priyanka| 2002-04-12 | MCA | 85 | 90 | 100 | 275 | NULL |
| SS008 | Agasthya| 2001-07-06 | MBA | 95 | 90 | 90 | 275 | NULL |
+ + + + + + + + + +
8 rows in set

Query 2:
mysql> Update Student Set GPA =(Total/300)*10;
Rows matched: 8 Changed: 8

mysql> select * from Student;


+ + + + + + + + + +
| USN | Name | DOB | Branch | mark1 | mark2 | mark3 | Total | GPA |
+ + + + + + + + + +
| SS001 | Likhitha |2003-04-04| MCA | 70 | 80 | 95 | 245 | 8|
| SS002 | Raksha |2003-04-12| MCA | 50 | 60 | 85 | 195 | 7|
| SS003 | Ameesha|2003-12-05| MCA | 80 | 85 | 90 | 255 | 9|
| SS004 | Suraj |1999-10-05| MBA | 50 | 55 | 70 | 175 | 6|
| SS005 | Sagar |2000-08-20| MA | 70 | 55 | 60 | 185 | 6|
| SS006 | Manohar |1993-03-28| MSC | 10 | 60 | 90 | 160 | 5|
| SS007 | Priyanka |2002-04-12| MCA | 85 | 90 | 100 | 275 | 9|
| SS008 | Agasthya |2001-07-06| MBA | 95 | 90 | 90 | 275 | 9|
+ + + + + + + + + +
8 rows in set

Query 3:
mysql> select name from Student where Branch="MCA";
+ +
| name |

SIT, Mangalore PageNo|9


DBMS and Web Technologies Laboratory (MMCL106)

+ +
| Raksha |
| Ameesha |
| Priyanka |
+ +
3 rows in set

Query 4:
mysql> select * from Student where year(DOB)=2000;
+ + + + + + + + + +
| USN | Name | DOB | Branch | mark1 | mark2 | mark3 | Total | GPA|
+ + + + + + + + + +
| SS005 | Sagar | 2000-08-20 | MA | 70 | 55 | 60 | 185 | 6 |
+ + + + + + + + + +
1 row in set

Query 5:
mysql> Select Branch ,max(GPA) from Student group by Branch;
+ + +
| Branch | max(GPA) |
+ + +
| MCA | 9 |
| MBA | 9 |
| MA | 6 |
| MSC | 5 |
+ + +
4 rows in set

Query 6:
mysql> select * from Student where name like 'S%';
+ + + + + + + + + +
| USN | Name | DOB | Branch | mark1 | mark2 | mark3 | Total | GPA |
+ + + + + + + + + +
| SS004 | Suraj |1999-10-05| MBA | 50 | 55 | 70 | 175 | 6 |
| SS005 | Sagar |2000-08-20| MA | 70 | 55 | 60 | 185 | 6 |
+ + + + + + + + + +
2 rows in set

Query 7:
mysql> select * from Student where name like '%AR';
+ + + + + + + + + +
| USN | Name | DOB | Branch | mark1 | mark2| mark3 | Total | GPA |
+ + + + + + + + + +
| SS005 | Sagar |2000-08-20 | MA | 70 | 55 | 60 | 185 | 6 |
| SS006 | Manohar | 1993-03-28 | MSC| 10 | 60 | 90 | 160 | 5 |
+ + + + + + + + + +
2 rows in set

Query 8:

SIT, Mangalore PageNo|10


DBMS and Web Technologies Laboratory (MMCL106)

mysql> Delete from Student where USN ='SS001';


mysql> select * from Student;
+ + + + + + + + + +
| USN | Name | DOB | Branch | mark1 | mark2 | mark3 | Total | GPA |
+ + + + + + + + + +
| SS002 | Raksha | 2003-04-12 | MCA | 50 | 60 | 85 | 195 | 7 |
| SS003 | Ameesha| 2003-12-05 | MCA | 80 | 85 | 90 | 255 | 9 |
| SS004 | Suraj | 1999-10-05 | MBA | 50 | 55 | 70 | 175 | 6 |
| SS005 | Sagar | 2000-08-20 | MA | 70 | 55 | 60 | 185 | 6 |
| SS006 | Manohar| 1993-03-28 | MSC | 10 | 60 | 90 | 160 | 5 |
| SS007 | Priyanka| 2002-04-12 | MCA | 85 | 90 | 100 | 275 | 9 |
| SS008 | Agasthya| 2001-07-06 | MBA | 95 | 90 | 90 | 275 | 9 |
+ + + + + + + + + +
7 rows in set

SIT, Mangalore PageNo|11


DBMS and Web Technologies Laboratory (MMCL106)

Name: Pavan N Shetty Date: 06-03-2025


Program No: 3 USN: 4SN24MC018
Program Statement: Design an ER-diagram for the following scenario,
Convert the same into a relational model and then solve the following
queries.Consider a Cricket Tournament “ABC CUP” organized by an
organization.In the tournament there are many teams are contesting each
having a Teamid,Team_Name, City, a coach. Each team is uniquely
identified by using Teamid. A team can have many Players and a captain.
Each player is uniquely identified by Playerid, having a Name, and
multiple phone numbers,age. A player represents only one team. There are
many Stadiums to conduct matches. Each stadium is identified using
Stadiumid, having a stadium_name,Address ( involves
city,area_name,pincode). A team can play many matches. Each match
played between the two teams in the scheduled date and time in the
predefined Stadium. Each match is identified uniquely by using Matchid.
Each match won by any of the one team that also wants to record in the
database. For each match man_of_the match award given to a player.
Execute the following Queries:
i. Display the youngest player (in terms of age) Name, Team name, age in
which he belongs of the tournament.
ii. List the details of the stadium where the maximum number of matches
were played.
iii. List the details of the player who is not a captain but got the man_of
_match award at least in two matches.
iv. Display the Team details who won the maximum matches.
v. Display the team name where all its won matches played in the same
stadium.

SIT, Mangalore PageNo|12


DBMS and Web Technologies Laboratory (MMCL106)

Relational Model:

E-R Diagram:

SIT, Mangalore PageNo|13


DBMS and Web Technologies Laboratory (MMCL106)

Source Code:
mysql> use cricket;
Database changed

Table Team
mysql> create table team(tid int primary key,tname varchar(20),coach
varchar(20),captain_pid int, city varchar(20));

Insert
mysql> insert into team values(101,'RCB','Sunil',1,'Bangalore');
mysql> insert into team values(102,'CSK','Laxman',3,'Chennai');
mysql> insert into team values(104,'Royals','Singh',7,'Rajasthan');
mysql> insert into team values(105,'KKR','Sehwag',5,'Kolkata');

mysql> select * from team;


+ + + + + +
| tid | tname |coach | captain_pid | city |
+ + + + + +
| 101 | RCB | Sunil | 1 | Bangalore |
| 102 | CSK | Laxman| 3 | Chennai |
| 104 | Royals | Singh | 7 | Rajasthan |
| 105 | KKR | Sehwag | 5 | Kolkata |
+ + + + + +
4 rows in set

Table Player
mysql> create table player(pid int primary key,pname varchar(20),age int ,tid int references
team(tid));

Insert
mysql> insert into player values(1,'Sachin',33,101);
mysql> insert into player values(2,'Virat',35,101);
mysql> insert into player values(3,'Dhoni',40,102);
mysql> insert into player values(4,'Ruturaj',33,102);
mysql> insert into player values(5,'Manish',26,103);
mysql> insert into player values(6,'Ajinkya',26,105);
mysql> insert into player values(7,'Shubham',32,104);
mysql> insert into player values(8,'Sanju',30,104);

mysql> Select * from player;


+ + + + +
| pid | pname | age | tid |
+ + + + +
| 1 | Sachin | 33 | 101 |
| 2 | Virat | 35 | 101 |
| 3 | Dhoni | 40 | 102 |
| 4 | Ruturaj | 33 | 102 |
| 5 | Manish | 26 | 103 |
| 6 | Ajinkya | 26 | 105 |

SIT, Mangalore PageNo|14


DBMS and Web Technologies Laboratory (MMCL106)

| 7 | Shubham| 32 | 104 |
| 8 | Sanju | 30 | 104 |
+ + + + +
8 rows in set

Table Stadium
mysql> create table stadium(sid int primary key,sname varchar(20),pincode int,city
varchar(20),area varchar(20));

Insert
mysql> insert into stadium values(111,'Chinnaswamy',56001,'Bangalore','MG Road');
mysql> insert into stadium values(222,'Kotla',46009,'Delhi','Highway');
mysql> insert into stadium values(333,'Eden',76004,'Kolkata','Maidan');
mysql> insert into stadium values(444,'Chidambaram',600002,'Chennai','Chepauk');
mysql> insert into stadium values(555,'CSCA',567772,'Cochin','Beach Road');

mysql> select * from stadium;


+ + + + + +
| sid | sname | pincode | city | area |
+ + + + + +
| 111 | Chinnaswamy | 56001 | Bangalore | MG Road |
| 222 | Kotla | 46009 | Delhi | Highway |
| 333 | Eden | 76004 | Kolkata | Maidan |
| 444 | Chidambaram| 600002 | Chennai | Chepauk |
| 555 | CSCA | 567772 | Cochin | Beach Road |
+ + + + + +
5 rows in set

Table Matches
mysql> create table matches(mid varchar(4)primary key,mdate date, time varchar(10),sid int
references stadium(sid),team_id1 int references team(tid),team_id2 int references
team(tid),winning_team_id int references team(tid),man_of_match int references
player(pid));

Insert
mysql> insert into matches values(001,'2017-01-10','10am',111,101,102,101,2);
mysql> insert into matches values(002,'2017-01-10','1pm',222,102,105,105,5);
mysql> insert into matches values(003,'2017-01-11','10am',333,104,101,101,2);
mysql> insert into matches values(004,'2017-01-11','2pm',111,104,105,104,7);
mysql> insert into matches values(005,'2017-01-12','11am',444,104,101,104,7);

mysql> select * from matches;


+ + + + + + + + +
| mid | mdate | time | sid | team_id1 | team_id2 | winning_team_id | man_of_match |
+ + + + + + + + +
|1 | 2017-01-10 | 10am| 111 | 101 | 102 | 101 | 2|
|2 | 2017-01-10 | 1pm | 222 | 102 | 105 | 105 | 5|
|3 | 2017-01-11 | 10am| 333 | 104 | 101 | 101 | 2|
|4 | 2017-01-11 | 2pm | 111 | 104 | 105 | 104 | 7|

SIT, Mangalore PageNo|15


DBMS and Web Technologies Laboratory (MMCL106)

| 5 | 2017-01-12 | 11am| 444 | 104 | 101 | 104 | 7|


+ + + + + + + + +
5 rows in set

Table Player_phone
mysql> create table player_phone(pid int references player(pid),phone varchar(15),primary
key(pid,phone));

Insert
mysql> insert into player_phone values(1,'9562132051');
mysql> insert into player_phone values(2,'8265678241');
mysql> insert into player_phone values(2,'9485523168');
mysql> insert into player_phone values(7,'6265723421');
mysql> insert into player_phone values(5,'6263435671');
Query OK, 1 row affected (0.01 sec)

mysql> select * from player_phone;


+ + +
| pid | phone |
+ + +
| 1 | 9562132051 |
| 2 | 8265678241 |
| 2 | 9485523168 |
| 5 | 6263435671 |
| 7 | 6265723421 |
+ + +
5 rows in set

Query 1:
mysql> select pname,tname,age from player p ,team t where p.tid=t.tid and age =(select
min(age)from player);
+ + + +
| pname | tname | age |
+ + + +
| Ajinkya | KKR | 26 |
+ + + +
1 row in set

Query 2:
select * from stadium where sid in (select sid from matches group by sid having count(*) =
(select max(x.total) from (select sid, count(*) as total from matches group by sid) x));
+ + + + + +
| sid | sname | pincode | city | area |
+ + + + + +
| 111 | Chinnaswamy | 56001 | Bangalore | MG Road |
+ + + + + +
1 row in set

Query 3:

SIT, Mangalore PageNo|16


DBMS and Web Technologies Laboratory (MMCL106)

mysql> select * from player where pid not in (select captain_pid from team) and pid in (select
man_of_match from matches group by man_of_match having count(man_of_match) >= 2);
+ + + + +
| pid | pname | age | tid |
+ + + + +
| 2 | Virat | 35 | 101 |
+ + + + +
1 row in set

Query 4:
mysql> select * from team where tid in (select winning_team_id from matches group by
winning_team_id having count(*) = (select max(x.total) from (select winning_team_id,
count(*) as total from matches group by winning_team_id) x));
+ + + + + +
| tid | tname | coach | captain_pid | city |
+ + + + + +
| 101 | RCB | Sunil | 1 | Bangalore |
| 104 | Royals | Singh | 7 | Rajasthan |
+ + + + + +
2 rows in set

Query 5:
mysql> select t.tname from team t, matches m where t.tid = m.winning_team_id group by
m.winning_team_id having count(distinct m.sid) >= 1;
+ +
| tname |
+ +
| RCB |
| Royals |
| KKR |
+ +
3 rows in set

SIT, Mangalore PageNo|17


DBMS and Web Technologies Laboratory (MMCL106)

Name: Pavan N Shetty Date: 11-03-2025


Program No: 4 USN: 4SN24MC018
Program Statement: A country wants to conduct an election for the
parliament. A country having many constituencies. Each constituency is
identified uniquely by Constituency_id, having the Name, belongs to a
state, Number_of_voters. A constituency can have many voters. Each voter
is uniquely identified by using Voter_id, having the Name, age, address
(involves Houseno,city,state,pincode). Each voter belongs to only one
constituency. There are many candidates contesting in the election. Each
candidates are uniquely identified by using candidate_id, having Name,
phone_no, age, state. A candidate belongs to only one party. There are
many parties. Each party is uniquely identified by using Party_id, having
Party_Name,Party_symbol. A candidate can contest from many
constituencies under a same party. A party can have many candidates
contesting from different constituencies. No constituency having the
candidates from the same party. A constituency can have many contesting
candidates belongs to different parties. Each voter votes only one candidate
of his/her constituencty.
Queries:
i. List the details of the candidates who are contesting from more than one
constituencies which are belongs to different states.
ii. Display the state name having maximum number of constituencies.
iii. Create a stored procedure to insert the tuple into the voter table by
checking the voter age.If voter’s age is atleast 18 years old, then insert the
tuple into the voter else display the “Not an eligible voter msg”.
iv. Create a stored procedure to display the number_of_voters in the
specified constituency. Where the constituency name is passed as an
argument to the stored procedure.
v. Create a TRIGGER to UPDATE the count of “Number_of_voters”of the
respective constituency in “CONSTITUENCY table , AFTER inserting a
tuple into the table.

SIT, Mangalore PageNo|18


DBMS and Web Technologies Laboratory (MMCL106)

Relational Model:

E-R Diagram

SIT, Mangalore PageNo|19


DBMS and Web Technologies Laboratory (MMCL106)

Source Code:
Table Constituency
create table constituency(cons_id number(20)primary key, csname varchar(20), csstate
varchar(20), no_of_voters number(10));

select * from constituency;


+ + + + +
|CONS_ID| CSNAME |CSSTATE | NO_OF_VOTERS |
+ + + + +
|111 | rajajinagar | karnataka | 4 |
|222 | ramnagar | kerala | 1 |
+ + + +

Table Party
create table party(pid number(20) primary key, pname varchar(20), psymbol varchar(10));

select * from party;


+ + + +
|PID PNAME PSYMBOL |
+ + + +
|876 | bjp | lotus |
|877 | congress | hand |
+ + + +

Table Candidates
create table candidates (cand_id number(12)primary key, phone_no number(10), age
number(2), state varchar(20), name varchar(20), pid int references party(pid));

select * from candidates;


+ + + + + + +
| CAND_ID | PHONE_NO | AGE | STATE |NAME |PID |
+ + + + + + +
121 | 9538904626 | 23 |kerala |raksha |876 |
122 | 9740777502 |24 | karnataka |veena |877 |
+ + + + + + +

Table Contest
create table contest(cons_id number(20) references constituency(cons_id), cand_id
number(12) references candidates(cand_id) primary key(cons_id,cand_id);

select * from contest;

+ + +

SIT, Mangalore PageNo|20


DBMS and Web Technologies Laboratory (MMCL106)

| CONS_ID |CAND_ID |
+ + +
| 111 | 122 |
| 222 | 121 |
| 222 | 122 |
+ + +

Table Voter
create table voter(vid number(20) primary key, vname varchar(20), vage number(5), vaddr
varchar(20), cons_id number(20) references constituency(cons_id), cand_id number(12)
references candidates(cand_id));

select * from voter;

+ + + + + + +
| VID |VNAME| VAGE |VADDR |CONS_ID| CAND_ID |
+ + + + + + +
| 345 |prashanth | 21 |kanakpura |222 |122 |
|346 |prakash | 23 |ramnagar |111 |121 |
|348 |nagesh | 30 |mandya |111 |121 |
|349 |nagesh | 30 |mandya |111 |121 |
+ + + + + + +

Query 1:
select * from candidates where cand_id in (select cand_id from contest join constituency on
contest.cons_id=constituency.cons_id group by cand_id having count(distinct(csstate))>1);
+ + + + + + +
CAND_ID |PHONE_NO |AGE |STATE |NAME |PID |
+ + + + + + +
|122 |9740777502 | 24 | karnataka | veena | 877 |
+ + + + + + +

Query 2:
select csstate from constituency group by csstate having count(csstate) in (select
max(count(csstate)) from constituency group by csstate);
+ +
| CSSTATE |
+ +
| Karnataka |
+ +

Query 3:

SIT, Mangalore PageNo|21


DBMS and Web Technologies Laboratory (MMCL106)

create or replace procedure agechecking ( id in number, age in number)as BEGIN if age>18


then insert into voter(vid, vage) values(id, age); else dbms_output.put_line('age should be
high'); end if; end agechecking;
/
Procedure created.

SQL> set serveroutput on;


SQL> exec agechecking (25,21);
PL/SQL procedure successfully completed. // row inserted
SQL> exec agechecking (20,15);
age should be high //Message displayed as age islessthan or equal to 18
PL/SQL procedure successfully completed.

Query 4:
create orreplace procedure display_count (const_id number)as vid constituency.cons_id %
type; begin select no_of_voters into vid from constituency where cons_id = const_id and
rownum = 1; dbms_output.put_line ( 'total voters are: ' || vid); end;
/
Procedure created.

SQL> select * from constituency; CONS_ID


+ + +
CSNAME | CSSTATE |
+ + +
| 111 |rajajinagar |
| 222 |ramnagar |
+ + +
SQL> exec display_count(111);
total voters are: 2

Query 5:
create or replace trigger count after insert on voter for each row begin update constituency set
no_of_voters = no_of_voters + 1 where cons_id=:new.cons_id; end count;
/
Trigger created.
SQL> setserveroutput on;

SQL> select * from constituency;


+ + + + +
|CONS_ID | CSNAME | CSSTATE | NO_OF_VOTERS |
+ + + + +
|111 | rajajinagar | karnataka | 2 |
|222 | ramnagar | kerala | 1 |

SIT, Mangalore PageNo|22


DBMS and Web Technologies Laboratory (MMCL106)

+ + + + +
SQL> insert into voter values(348,'nagesh',30,'mandya',111,121);
1 row created.

After insertion into voter table , the constituency table is automatically updated.

SIT, Mangalore PageNo|23


DBMS and Web Technologies Laboratory (MMCL106)

Name: Pavan N Shetty Date: 11-03-2025


Program No: 5 USN: 4SN24MC018
Program Statement: Design an ER-diagram for the following scenario,
Convert the same into a relational model, normalize Relations into a suitable
Normal form and then solve the following queries. A country can have many
Tourist places . Each Tourist place is identified by using tourist_place_id,
having a name, belongs to a state, Number of kilometers away from the
02.03.2021 updated 52/ 104 capital city of that state,history. There are many
Tourists visits tourist places every year. Each tourist is identified uniquely
by using Tourist_id, having a Name, age, Country and multiple emailids. A
tourist visits many Tourist places, it is also required to record the visted_date
in the database. A tourist can visit a Tourist place many times at different
dates. A Tourist place can be visited by many tourists either in the same date
or at different dates.
Queries:
i. List the state name which is having maximum number of tourist places.
ii. List details of Tourist place where maximum number of tourists visited.
iii. List the details of tourists visited all tourist places of the state
iv. Display the details of the tourists visited at least one tourist place of the
state, but visited all states tourist places.
v. Display the details of the tourist place visited by the tourists of all
country.
Relational Model:

SIT, Mangalore PageNo|24


DBMS and Web Technologies Laboratory (MMCL106)

E-R Diagram:

Source code:
mysql> create database Tour;
Query OK, 1 row affected (0.01 sec)

mysql> use Tour;


Database changed.
Table Tourist_place
mysql> create table Tourist_place01(Tpid int primary key,TpName varchar(20),State
varchar(20),Kilometer int(3),History varchar(20));
Insert
mysql> insert into TOURIST_place01 values('11','tajmhal','delhi','100','monument');
mysql> insert into TOURIST_place01 values('12','munnar','kerala','200','hillstationb');
mysql> insert into TOURIST_place01 values('13','modren','goa','50','beach');
mysql>insert intoTOURIST_place01values('15','Chikmangaluru','Karnataka','80','hillstation');
mysql> insert into TOURIST_place01 values('16','Mangaluru','Karnataka','100','beach');

mysql> select * from tourist_place01;


+ + + + + +
| Tpid | TpName | State | Kilometer | History |
+ + + + + +

SIT, Mangalore PageNo|25


DBMS and Web Technologies Laboratory (MMCL106)

| 11 | tajmhal | delhi | 100 | monument |


| 12 | munnar | kerala | 200 | hillstationb |
| 13 | modren | goa | 50 | beach |
| 15 | Chikmangaluru | Karnataka | 80 | hillstation |
| 16 | Mangaluru | Karnataka | 100 | beach |
+ + + + + +
5 rows in set

Table Tourist
mysql> create table Tourist01(Tid int primary key,Name varchar(20),Age int(3),Country
varchar(20));
Insert
mysql> insert into Tourist01 values(22,'PRAKESH','40','DUBAI');
mysql> insert into Tourist01 values(23,'ABDHUL','35','INDIA');
mysql> insert into Tourist01 values(24,'ARNOLD','45','AMERICA');
mysql> select * from Tourist01;
+ + + + +
| Tid | Name | Age | Country |
+ + + + +
| 22 | PRAKESH | 40 | DUBAI |
| 23 | ABDHUL | 35 | INDIA |
| 24 | ARNOLD | 45 | AMERICA |
+ + + + +
3 rows in set

Table Visits
mysql> create table visits01 (tpid int references tourist_place01(tpid), tid int references
tourist01(tid), v_date date, primary key (tpid, tid));

Insert
mysql> insert into Visits01 values(11, 22, '2016-10-30');
mysql> insert into Visits01 values(11, 23, '2011-08-13');
mysql> insert into Visits01 values(11, 24, '2015-10-13');
mysql> insert into Visits01 values(12, 24, '2016-04-13');
mysql> insert into Visits01 values(16, 24, '2016-04-13');
mysql> insert into Visits01 values(13, 24, '2018-09-19');
mysql> insert into Visits01 values(15, 22, '2018-09-19');
mysql> insert into Visits01 values(16, 22, '2018-08-09');
mysql> select * from Visits01;
+ + + +
| tpid | tid | v_date |
+ + + +
| 11 | 22 | 2016-10-30 |

SIT, Mangalore PageNo|26


DBMS and Web Technologies Laboratory (MMCL106)

| 11 | 23 | 2011-08-13 |
| 11 | 24 | 2015-10-13 |
| 12 | 24 | 2016-04-13 |
| 13 | 24 | 2018-09-19 |
| 15 | 22 | 2018-09-19 |
| 16 | 22 | 2018-08-09 |
| 16 | 24 | 2016-04-13 |
+ + + +
8 rows in set

Table Email
mysql> create table email01(Tid int References Tourist01(Tid),email varchar(30),primary
key (tid,email));

Insert
mysql> insert into email01 values(23,'bhanu@gmal.com');
mysql> insert into email01 values(22,'manu@gmal.com');
mysql> insert into email01 values(25,'thanu@gmal.com');
mysql> select * from email01;
+ + +
| Tid | email |
+ + +
| 22 | manu@gmal.com |
| 23 | bhanu@gmal.com |
| 25 | thanu@gmal.com |
+ + +
3 rows in set

Query 1:
mysql> select State from tourist_place01 group by State having count(*) = (select
max(p.tp_count) from (select State, count(*) as tp_count from tourist_place01 group by state)
p);
+ +
| State |
+ +
| Karnataka |
+ +
1 row in set (0.00 sec)

Query 2:
mysql> select tp.tpid, tp.tpname, tp.state, count(tv.tid) from tourist_place01 tp, visits01 tv
where tv.tpid = tp.tpid group by tv.tpid order by count(tv.tpid) desc limit 2;

SIT, Mangalore PageNo|27


DBMS and Web Technologies Laboratory (MMCL106)

+ + + + +
| tpid | tpname | state | count(tv.tid) |
+ + + + +
| 11 | tajmhal | delhi | 3|
| 16 | Mangaluru| Karnataka | 2|
+ + + + +
2 rows in set

Query 3:
mysql> select * from tourist01 t where t.tid in (select tid from visits01 join tourist_place01 on
visits01.tpid = tourist_place01.tpid where state = 'Karnataka' group by tid having count(state)
in (select count(state) from tourist_place01 where state = 'Karnataka'));
+ + + + +
| Tid | Name | Age | Country |
+ + + + +
| 22 | PRAKESH | 40 | DUBAI |
+ + + + +
1 row in set

Query 4:
mysql> select * from tourist01 t where t.tid in (select tid from visits01 join tourist_place01 on
visits01.tpid = tourist_place01.tpid group by tid having count(distinct state) in (select
count(distinct state) from tourist_place01));
+ + + + +
| Tid | Name | Age | Country |
+ + + + +
| 24 | ARNOLD | 45 | AMERICA |
+ + + + +
1 row in set

Query 5:
mysql> select * from tourist_place01 where tpid in (select tpid from visits01 join tourist01 on
visits01.tid = tourist01.tid group by tpid having count(distinct country) = (select
count(distinct country) from tourist01));
+ + + + + +
| Tpid | TpName | State | Kilometer | History |
+ + + + + +
| 11 | tajmhal | delhi | 100 | monument |
+ + + + + +
1 row in set

SIT, Mangalore PageNo|28


DBMS and Web Technologies Laboratory (MMCL106)

Name: Pavan N Shetty Date: 02-01-2025


Program No: 6 USN: 4SN24MC018
Program Statement: Create an XHTML page that provides information
about your department. Your XHTML page must use the following tags:
a) Text Formatting tags b) Horizontal rule
c) Meta element d) Links
e) Images f) Tables

Source code: lab1.html


<html>
<head>
<title>MCA department Details</title>
<meta name="keyboards": content="1 MCA, 2 MCA, 3 MCA">
</head>
<frameset cols=20%,*''>
<frame src="content.html"/>
<frame src="dept.html" name="display"/>
</frameset>
</html>

Source code: dept.html


<html>
<head>
<title> MCA department Details</title>
</head>
<body>
<center><img src = "/home/batch/Downloads/srinivas" width="200"
height="150"></img></center>
<h1>Department Details</h1>
<p><h2><b><u>the department offers</u></b></h2></p>
<h3>Master in Computer Application(MCA) : 3years duration course , 2years literal entry
course based on the interest of the candidates</h3>
<br size=4>
<h2><u><b>Vision</b></u></h2>
<h3>MCA will be an outstanding department contributing significancy to teaching,research
amd consultancy, throughwell equipped laboratories and well trained staff to meet global
challanges</h3>
</body>
</html>

Source code: content.html


<html>
<head>
<title> MCA department Details </title>
</head>
<body>

SIT, Mangalore PageNo|29


DBMS and Web Technologies Laboratory (MMCL106)

<h3> MCA department</h3>


<ul>
<li><a href="home.html" target="display">home</a></li>
<li><a href="faculties.html" target="display">faculties</a></li>
<li><a href="facilities.html" target="display">facilties</a></html>
</ul>
</body>
</html>

Source code: home.html


<html>
<head>
<title> MCA department Details</title>
</head>
<body>
<ul>
<li>the department of MCA started in the year 2006</li>
<li>the department has a policy of providing training related to industry treats and
requirement in which strong focus is given to students academic performance and overall
personality development</li>
<li>the department are almost are to the software skills in building by conducting various
training programming high end technologies with active assistance from its technician</li>
</ul>
</body>
</html>

Source code: faculties.html


<html>
<head>
<title> MCA department Details</title>
<body>
<h3><ol><li> the department of MCA has 2-3 lab more than 100 high end computers</li>
<li>department has well experienced profersors</li></h3>
</ol>
</body>
</html>

Source code: facilities.html


<html>
<head>
<title>MCA department Details</title>
</head>
<center><h3><table border=1>
<caption>Faculties for 1 mca class</caption>
<tr><th>subjects</th>
</tr>
<tr>
<td>DBMS</td><td>DR.Shashidhar kini k</td>

SIT, Mangalore PageNo|30


DBMS and Web Technologies Laboratory (MMCL106)

</tr>
<tr>
<td>Web</td><td>Ms.Nikshitha R S</td>
</tr>
<tr>
<td>mobile application</td><td>Ms. Sharanya M</td>
</tr>
</center>
</h3>
</body>
</html>

OUTPUT:

SIT, Mangalore PageNo|31


DBMS and Web Technologies Laboratory (MMCL106)

SIT, Mangalore PageNo|32


DBMS and Web Technologies Laboratory (MMCL106)

Name: Pavan N Shetty Date: 06-02-2025


Program No: 7 USN: 4SN24MC018
Program Statement: Develop and demonstrate a XHTML file that includes
Javascript script for the following problems:
a) Input: A number n obtained using prompt
Output: The first n Fibonacci numbers
b) Input: A number n obtained using prompt
Output: A table of numbers from 1 to n and their squares using alert

a) Source Code: fibonacci.html


<html>
<head>
<title> Program 3a: The first n fibonacci number</title>
</head>
<body>
<script type ="text/javascript">
var a = 0;
var b = 1;
var c, i;
var n = prompt("Enter n:"," ");
while(n<=0)
{
alert("Enter positive Value");
n= prompt("Enter n:"," ");
}
document.write("Fibonacci Series ... <br/>");
document.write(a,"<br/>");
document.write(b,"<br/>");
for(i=0; i<n-2; i++)
{
c = a+b;
document.write(c,"<br/>");
a =b;
b=c;
}
</script>
</body>
</html>

OUTPUT:

SIT, Mangalore PageNo|33


DBMS and Web Technologies Laboratory (MMCL106)

b) Source code: squares.html


<html>
<body>
<script type="text/javascript">
var num = prompt("Enter Positive Number:\n ", " ");
msgstr ="Number and its squares are:\n";
for(i=1; i<=num; i++)
{
msgstr = msgstr + i + "-"+i*i + "\n";
}

alert(msgstr);
</script>
</body>
</html>

OUTPUT:

SIT, Mangalore PageNo|34


DBMS and Web Technologies Laboratory (MMCL106)

SIT, Mangalore PageNo|35


DBMS and Web Technologies Laboratory (MMCL106)

Name: Pavan N Shetty Date: 06-03-2025


Program No: 8 USN: 4SN24MC018
Program Statement: Develop and demonstrate, using JavaScript script, a
XHTML document that contains three short paragraphs of text, stacked on
top of each other, with only enough of each showing so that the mouse cursor
can be placed over some part of them. When the cursor is placed over the
exposed part of any paragraph, it should rise to the top to become
completely visible. Modify the above document so that when a text is moved
from the top stacking position, it returns to its original position rather than
to the bottom.

Source code:stack.html
<html>
<head>
<title>Stack Ordering</title>
<style type="text/css">
#layer1
{
border:solid thick black;
background-color:brown;
padding:10px;
width:300px;
height:200px;
position:absolute;
top:100px;
left:200px;
z-index:0;
}
#layer2
{
border:solid thick black;
background-color:gray;
padding:10px;
width:300px;
height:200px;
position:absolute;
top:120px;
left:220px;
z-index:0;
}
#layer3
{
border:solid thick black;
background-color:white;
padding:10px;
width:300px;
height:200px;

SIT, Mangalore PageNo|36


DBMS and Web Technologies Laboratory (MMCL106)

position:absolute;
top:140px;
left:240px;
z-index:0;
}
</style>
</head>
<body>
<script type=text/javascript>
var topLayer="layer3";
//function to place the choosen layer on the top
function mover(toTop)
{
document.getElementById(topLayer).style.zIndex="0";
document.getElementById(toTop).style.zIndex="1";
topLayer=toTop;
}
</script>
<p id=layer1 onMouseOver=mover('layer1');>This is the last layer</p>
<p id=layer2 onMouseOver=mover('layer2');>This is the middle layer</p>
<p id=layer3 onMouseOver=mover('layer3');>This is the first layer</p>
</body>
</html>

OUTPUT:

SIT, Mangalore PageNo|37


DBMS and Web Technologies Laboratory (MMCL106)

SIT, Mangalore PageNo|38

You might also like