0% found this document useful (0 votes)
5 views

Dbms & HTML Practical 2023

The document outlines SQL assignments for a PGDCA 2nd semester course at Govt. Kachna Dhurwa College, focusing on database management systems. It includes tasks such as creating tables, inserting data, and writing queries to retrieve information about staff and students. The assignments cover various aspects of SQL, including data manipulation and retrieval based on specified criteria.

Uploaded by

sahusuhani412
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)
5 views

Dbms & HTML Practical 2023

The document outlines SQL assignments for a PGDCA 2nd semester course at Govt. Kachna Dhurwa College, focusing on database management systems. It includes tasks such as creating tables, inserting data, and writing queries to retrieve information about staff and students. The assignments cover various aspects of SQL, including data manipulation and retrieval based on specified criteria.

Uploaded by

sahusuhani412
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/ 70

NARENDRA PGDCA - 2nd SEM.

SESSION : 2022-23

D.B.M.S.

GOVT. KACHNA DHURWA COLLEGE, CHHURA


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

INDEX

S. PROGRAMS P.
NO. NO.
1 Using the following database: 1-9
College(cname, city, address, phone, afdate)
Staff (sid, sname, saddress, contacts)
StaffJoin(sid,cname,dept,DOJ,post,salary)
Teaching(sid, class, papered, fsession, tsession)
Subjects (paperid, subject, paperno, papername)
Write SQL statements for the following:
A. Create the above tables with the given specifications and constraints.
B. Insertabout10rowsasareappropriatetosolvethefollowingqueries.
C. List the name of the teachers teaching computers subject.
D. List the names and cities of all staff working in your college.
E. List the names and cities of all staff working in your college who earn more than 15,000

2 Using the following database: 10-


College(cname, city, address, phone, afdate) 11
Staff (sid, sname, saddress, contacts)
StaffJoin(sid,cname,dept,DOJ,post,salary)
Teaching(sid, class, papered, fsession, tsession)
Subjects (paperid, subject, paperno, papername)
Write SQL statements for the following:
A. Find the staffs whose names start with ‘M’ or ‘R’ and ends with ‘A’ and/or 7characterslong.
B. Findthestaffswhosedateofjoiningis2005.
C. Modify the database so that staff N1 teaches in this session or all sessions.
D. List the name of subject, which T1 Teaches in this session or all sessions.
E. Find the classes that T1 do not teach at present session.

3 Using the following database: 12-


College(cname, city, address, phone, afdate) 13
Staff (sid, sname, saddress, contacts)
StaffJoin(sid,cname,dept,DOJ,post,salary)
Teaching(sid, class, papered, fsession, tsession)
Subjects (paperid, subject, paperno, papername)
Write SQL statements for the following:
A. Find the colleges who have most number of staffs.
B. Find the staffs that earn a higher salary who earn greater than average salary of their
college.
C. Find the college that has the smallest payroll.

GOVT. KACHNA DHURWA COLLEGE, CHHURA


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

4 Using the following database: 14-


College(cname, city, address, phone, afdate) 15
Staff (sid, sname, saddress, contacts)
StaffJoin(sid,cname,dept,DOJ,post,salary)
Teaching(sid, class, papered, fsession, tsession)
Subjects (paperid, subject, paperno, papername)
Write SQL statement from the following:
A. List maximum, average, minimum salary of each college
B. Acquire details of staffs by name in a college or each college.
C. FindthenamesofstaffthatearnmorethaneachstaffofC2College.

5 Using the following database: 16-


College(cname, city, address, phone, afdate) 17
Staff (sid, sname, saddress, contacts)
StaffJoin(sid,cname,dept,DOJ,post,salary)
Teaching(sid, class, papered, fsession, tsession)
Subjects (paperid, subject, paperno, papername)
Write SQL statement from the following:
A. Find all staff that do not work in same cities as the college they work.
B. List names of employees in ascending order according to salary who are working in
your college or all colleges.

6 Using the following database. 18-


Enrollment (enrollno , name, gender, DOB, address, phone ) 25
Admission (admno, enrollno, course, yearsem, date, cname )
Colleges (cname, city, address, phone, afdate)
FeeStructure (course, yearsem, fee)
Payment (billno, admno, amount, pdate, purpse)
Write SQL statement for the following:
A. Create the above tables with the given specifications and constraints.
B. Insert about 10 rows as are appropriate to solve the following queries.
C. Get full detail of all students who took admission this year class wise.
D. Get detail of student who took admission in SKM college
E. Calculate the total amount of Fees College in this session.
1) By your college 2) By each college 3) By all college.

7 Using The Following Database, 26-


Enrollment (enrollno , name, gender, DOB, address, phone ) 28
Admission (admno, enrollno, course, yearsem, date, cname )
Colleges (cname, city, address, phone, afdate)
Feestructure (course, yearsem, fee)
Payment (billno, admno, amount, pdate, purpse)
Write SQL statement for the following:
A. List the student name who have not payed full fee
1) in your college 2) in all college.
B. List the number of admission in your class in every year.
C. List the student in the session who are not in the colleges in the Same city as they live
in.
D. List the student in college in your city and also live in your city.

GOVT. KACHNA DHURWA COLLEGE, CHHURA


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

E. Delete all the records of student who live in city Raipur

8 Using The Following Database. 29-


34
Subjects ( paperid, subject, paperno, papername )
Test ( papered, adate, time, max, min )
Scores (rollno,paperid, marks, attendance )
Students( admno, rollno, class, yearsem )
Write SQL statements for the following -
A. Create the above tables with the given specification and constraints.
B. Insert about 10 rows as are appropriate to solve following queries.
C. List the students who were present in a paper of a subject.
D. List all roll number who have passed in first division.
E. List all student in BCA who have scores higher than average

GOVT. KACHNA DHURWA COLLEGE, CHHURA


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

ASSIGNMENT -01
Object :- Using the following database:
College (cname, city, address, phone, afdate)

Staff (sid, sname, saddress, contacts)

StaffJoin(sid,cname,dept,DOJ,post,salary)

Teaching(sid, class, papered, fsession, tsession)

Subjects (paperid, subject, paperno, papername)

Write SQL statements for the following:

A. Create the above tables with the given specifications and constraints.
B. Insert about 10 rows as are appropriate to solve the following queries.
C. List the name of the teachers teaching computers subject.
D. List the names and cities of all staff working in your college.
E. List the names and cities of all staff working in your college who earn more than 15,000

A. Create the above tables with the given specifications and constraints.

1) Query to create Table College:

Create Table College

Create Table College(Cname Varchar(30)Primary Key, City Varchar(20), Address Varchar(25),


Phone Number(15), Afdate Date);

Query to show table college structure

desc college;

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 1


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

2) Query to create table staffs:

create table staff(id int, name varchar(20), address varchar(25), contact number);

Query to show table staffs structure

desc staff;

Results:-

3) Query to create table staff joins:

create table staffjoins(ID int, NAME varchar(20), DEPT varchar(25), DOJ date, POST varchar(30),
SALARY number);

Query to show table staffjoins structure

desc staffjoins;

Results:-

4) Query to create table teachings:

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 2


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

Create table teachings

(sid int, class varchar(20), paperid int, fsession date, tsession date);

Query to show table teachings structure

desc teachings;

Results:-

5) Query to create table subjects:

Create table subjects

(paperid int primary key, subject varchar(20), paperno int, papername varchar(20));

Query to show table subjects structure

desc subjects;

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 3


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

B) Insert about 10 rows as are appropriate to solve the following queries.


B1 ) Query to insert data college:
insert into college values('kd college','raipur','chhura','1234567890','12-june-2010');
insert into college values('durga colllege','raipur','raipur','3457869320','24-may-2015');
insert into college values('raipur institute of technology','raipur','raipur','3789478583','12-october-
2003');
insert into college values('rungta college','raipur','raipur','1526374895','14-march-2004');
insert into college values('dk college','baloda','baloda','3784905789','12-january-2006');
insert into college values('pragati college','raipur','raipur','367284637','27-may-2010');
insert into college values('phoolchand college','nawapara','raipur','3765487689','12-september-2010');
insert into college values('agrasen college','raipur','raipur','3628190987','28-december-2010');
insert into college values('vipra college','raipur','raipur','3787645798','19-july-2019');
insert into college values('rajeevlochan college','rajim','raipur','1789098734','22-august-2012');
select * from college

Results:-

b2)
B2 ) Query to insert data staffs:

insert into staff values('101','SHIVA','UJJAIN','1908990908');

insert into staff values('102','RAM','AYODHYA','1237890876');

insert into staff values('103','GANESH','HIMALAYA','2892893048');

insert into staff values('104','LAXMAN','AYODHYA','2893894783');

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 4


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

insert into staff values('105','SHREE HARI','VAIKUNTH','3839878938');

insert into staff values('106','BRAMHA','JAIPUR','3784907657');

insert into staff values('107','KARTIKEYA','KERALA','3893897348');

insert into staff values('108','MAHESH','RAIPUR','3893783679');

insert into staff values('109','KRISHNA','GOKUL','8765489098');

insert into staff values('110','BHARAT','AYODHYA','8769090890');

select * from staff

Results:-

B3 ) Query to insert data staffjoins:

insert into staffjoins values(101,'Science college', ' Science','9-oct-2019', 'Professor', 50000);

insert into staffjoins values(102,'SKM college', ' Commerce','9-feb-2005', 'Ass. Professor', 25000);

insert into staffjoins values(103,'Rajiv lochan college', ' computer Science','15-jan-2020', 'Professor',
45000);

insert into staffjoins values(104,'phulchand college', ' computer Science','18-dec-2021', 'Professor',


37000);

insert into staffjoins values(105,'Royal college', ' Science','12-oct-2017', 'Ass. Professor', 17000);

insert into staffjoins values(106,'SKM college', ' computer Science','15-jun-2015', 'Professor', 22000);

insert into staffjoins values(107,'Royal college', 'Science','15-july-2020', ' Ass. Professor', 10000);

insert into staffjoins values(108,'Rajiv lochan college', ' computer Science','15-nov-2012', 'Lab Ass.',
12500);

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 5


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

insert into staffjoins values(109,'Science college', 'Commerce','20-sep-2005', ' Lab Technician',


34000);

insert into staffjoins values(110,'SKM college', 'Science','25-aug-2017', ' Professor', 23450);

select * from staffjoins;

Results:-

B4) Query to insert data Teachings:

insert into teachings values(101,'BSC', 1001,'20-jun-2021','17-jun-2022');

insert into teachings values(102,'B.COM', 1212,'15-FEB-2019','5-APR-2020');

insert into teachings values(103,'PGDCA', 1512,'19-MAR-2020','7-FEB-2021');

insert into teachings values(104,'DCA', 1204,'16-JUN-2020','30-JULY-2021');

insert into teachings values(105,'M.SC', 1055,'17-MAR-2018','30-MAY-2020');

insert into teachings values(106,'BCA-I', 1706,'20-MAR-2019','15-JAN-2020');

insert into teachings values(107,'BSC-II', 1407,'17-JAN-2020','22-APR-2021');

insert into teachings values(108,'BCA', 1308,'14-FEB-2019','20-MAY-2021');

insert into teachings values(109,'M.COM', 1019,'20-JAN-2018','15-APR-2020');

insert into teachings values(110,'M.SC', 1410,'19-MAY-2019','20-FEB-2021');

select * from teachings;

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 6


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

B5) Query to insert data Subjects:

insert into subjects values(1001,'Botany',301,'Botny-I');

insert into subjects values(1212,'Accounts',402,'Accounts-I');

insert into subjects values(1513,'C++',503,'C++');

insert into subjects values(1204,'CSS',504,'CSS');

insert into subjects values(1055,'Chemisty',605,'Chemisty');

insert into subjects values(1706,'HTML',706,'HTML');

insert into subjects values(1407,'Maths',707,'Maths');

insert into subjects values(1308,'VB.net',608,'VB.net');

insert into subjects values(1019,'Account',909,'Account');

insert into subjects values(1410,'Zoology',910,'Zoology');

select * from subjects;

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 7


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

C) List the name of the teacher’s teachings computer subject.

select Sname from staffs,teachings, subjects

where staffs.sid = teachings.sid

and subjects.paperid = teachings.paperid

and (subjects.subject = 'HTML'

or subjects.subject = 'CSS'or subjects.subject = 'CSS'

or subjects.subject = 'VB.net' );

Results:-

D) List the names and cities of all staff working in your college.

select sname,saddress from college,staffs,staffjoins

where college.cname = staffjoins.cname

and staffs.sid = staffjoins.sid

and college.cname = 'SKM college' ;

Results:-

E) List the name and cities of all staff working in your college who earn more than 15000.

select sname,saddress,salary from college,staffs,staffjoins

where college.cname = staffjoins.cname

and staffs.sid = staffjoins.sid

and college.cname = 'SKM college'

and staffjoins.salary > 15000;

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 8


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 9


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

ASSIGNMENT -02

Object :-Using the following database:


College(cname, city, address, phone, afdate)

Staff (sid, sname, saddress, contacts)

StaffJoin(sid,cname,dept,DOJ,post,salary)

Teaching(sid, class, papered, fsession, tsession)

Subjects (paperid, subject, paperno, papername)

Write SQL statements for the following:


F. Find the staffs whose names start with ‘M’ or ‘R’ and ends with ‘A’ and/or 7characterslong.
G. Findthestaffswhosedateofjoiningis2005.
H. Modify the database so that staff N1 teaches in this session or all sessions.
I. List the name of subject, which T1 Teaches in this session or all sessions.
J. Find the classes that T1 do not teach at present session.

A) Find The Staffs Whose Names Start With ‘M’ Or ‘R’ And Ends With ‘A’ And /Or 7
Characters Long.

select snamefrom staffs

where (sname like 'M%a' or sname like 'R%a') ;

Results:-

B) Find the staffs whose date of joining is 2005.

select sname from staffs, staffjoins

where staffs.sid = staffjoins.sid

and staffjoins.doj between '1-jan-2005' and '31-dec-2005';

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 10


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

C) Modify the database so the staff N1 now works in C2 College.

update staffjoins set cname = 'SKM college' where sid = 101;

Results:-

D) List the names of subjects, which t1 teachers in this session or all sessions.

select subject from subjects, staffs, teachings

where subjects.paperid = teachings.paperid

and staffs.sid = teachings.sid

and staffs.sname = 'Ayush';

Results:-

E) Find the classes that t1 do not teach at present session.

select class from teachings where sid <> 107;

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 11


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

ASSIGNMENT -03

Object :- Using the following database:


College(cname, city, address, phone, afdate)

Staff (sid, sname, saddress, contacts)

StaffJoin(sid,cname,dept,DOJ,post,salary)

Teaching(sid, class, papered, fsession, tsession)

Subjects (paperid, subject, paperno, papername)

Write SQL statements for the following:

A. Find the colleges who have most number of staffs.


B. Findthestaffthatearnahighersalarywhoearngreaterthanaveragesalaryoftheircollege.
a. Find the college that has the smallest payroll.

A) Find the college name who have most number of staffs.

select cname from staffjoins

group by cname having count(cname )=(select max(count(cname ))

from staffjoins group by cname );

Results:-
CN AM E
SKM college

B) Fined the staffs that earn a higher salary who earn greater than average salary of
their college.

select sname, salary from staffs, staffjoins

where staffs.sid = staffjoins.sid

and staffjoins.cname = 'SKM college'

and staffjoins.salary >

(select avg (salary) from staffjoins

where staffjoins.cname = 'SKM college');

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 12


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

C) Find the college that has the smallest payroll.

select cname , salary from staffjoins

where salary = ( select min(salary) from staffjoins);

Results:-

CNAME SALARY
Royal college 10000

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 13


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

ASSIGNMENT -04

Object :- Using the following database:


College(cname, city, address, phone, afdate)

Staff (sid, sname, saddress, contacts)

StaffJoin(sid,cname,dept,DOJ,post,salary)

Teaching(sid, class, papered, fsession, tsession)

Subjects (paperid, subject, paperno, papername)

Write SQL statement from the following:


A. List maximum, average, minimum salary of each college
B. Acquire details of staffs by name in a college or each college.
C. FindthenamesofstaffthatearnmorethaneachstaffofC2College.

A) List maximum, average, minimum salary of each college.

select cname, min(salary), max(salary), avg(salary) from staffjoins group by cname;

Results:-

CNAME MIN(SALARY) MAX(SALARY) AVG(SALARY)


Rajiv lochan college 12500 45000 28750
SKM college 22000 50000 30112.5
Royal college 10000 17000 13500
Science college 34000 34000 34000
phulchand college 37000 37000 37000

B) List the name of the teacher’s departments teachings in more than one department.

select sname, dept from staffs, staffjoins

where staffs.sid = (select staffjoins.sid from staffjoins group by sid having count(sid)> 1)

Results:-

S NAM E
Ayush

c) Find the names of staff that earn more than each staff of C2 College.

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 14


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

select staffs.sname,staffs.sid, staffs.saddress ,staffs.contact, staffjoins.cname, staffjoins.sid,


staffjoins.dept, staffjoins.DOJ, staffjoins.post, staffjoins.salary from staffs, staffjoins where staffs.sid
= staffjoins.sid;

Results:-

S NAM E SID S AD D RE S S CO N T AC T CN AM E SID DEP T DOJ P OST SAL A RY


09-
Ayush 101 Khisora 7502950812 SKM college 101 Science OCT- Professor 50000
19
09-
A
Ishwari 102 Hasda 8903127500 SKM college 102 Commerce FEB- 25000
professor
05

15-
Rajiv lochan Computer
Vikash 103 Bhendri 7500710650 103 JAN- professor 45000
college science
20
18-
phulchand computer
Manisha 104 Nawapara 600004251 104 DEC- Professor 37000
college Science
21

12-
A
Vijay 105 Koma 8095120315 Royal college 105 Science OCT- 17000
Professor
17

15-
computer
Sanju 106 Belar 7000185503 SKM college 106 JUN- Professor 22000
Science
15

15- A
Kavita 107 Kutena 7748051577 Royal college 107 Science 10000
JUL-20 Professor

15-
Rajiv lochan computer A
Kumesh 108 Mega 8450567084 108 NOV- 12500
college Science Professor
12

Science 20-
Ramkrishan 109 Rajim 7545857847 109 Commerce Professor 34000
college SEP-05

25-
Raja 110 Nawapara 2542536451 SKM college 110 Science AUG- Professor 23450
17

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 15


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

ASSIGNMENT -05

Object :- Using the following database:


College(cname, city, address, phone, afdate)

Staff (sid, sname, saddress, contacts)

StaffJoin(sid,cname,dept,DOJ,post,salary)

Teaching(sid, class, papered, fsession, tsession)

Subjects (paperid, subject, paperno, papername)

Write SQL statement from the following:


C. Find all staff that do not work in same cities as the college they work.
D. List names of employees in ascending order according to salary who are working in your
college or all colleges.

A) Find all staff that do not work in same cities as the college they work.

select sname from staffs, staffjoins, college

where staffs.sid = staffjoins.sid

and college.cname = staffjoins.cname

and staffs.saddress <> college.address;

Results:-

SNAME
Ayush
Ishwari
Vikash
Manisha
Vijay
Sanju
Kavita
Kumesh
Ramkrishan
Raja

B) List names of employees in ascending order according to salary who are


working in your college or all colleges.

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 16


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

select sname, salary from staffs natural join staffjoins order by salary asc;

Results:-

S NAM E SAL A RY
Kavita 10000

Kumesh 12500
Vijay 17000
Sanju 22000
Raja 23450

Ishwari 25000

Ramkrishan 34000

Manisha 37000
Vikash 45000

Ayush 50000

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 17


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

ASSIGNMENT -06
Object :- Using the following database.
Enrollment (enrollno , name, gender, DOB, address, phone )

Admission (admno, enrollno, course, yearsem, date, cname )


Colleges (cname, city, address, phone, afdate)
Feestructure (course, yearsem, fee)
Payment (billno, admno, amount, pdate, purpse)

Write SQL statement for the following:


F. Create the above tables with the given specifications and constraints.
G. Insert about 10 rows as are appropriate to solve the following queries.
H. Get full detail of all students who took admission this year class wise.
I. Get detail of student who took admission in SKM college
J. Calculate the total amount of Fees College in this session.
1) By your college 2) By each college 3) By all college.

A.1) Query to create table Enrollment:

Create table Enrollment(enrollno int primary key, name varchar2(20), gender varchar2(20), DOB
date, address varchar2(20), phone number );

desc Enrollment;

Results:-

Data Lengt P recisi Scal P rimar y N ulla b Defa u Co mme


Tab le Colu mn T ype h on e Key le lt nt
ENROLLME ENROLL
Number - - 0 1 - - -
NT NO

NAME Varchar2 20 - - - - -

GENDER Varchar2 20 - - - - -

DOB Date 7 - - - - -

ADDRES
Varchar2 20 - - - - -
S

PHONE Number - - - - - -

A.2) Query to create table admission:

Create table admission(admno number(10) primary key, enrollno varchar2(20), course varchar2(20),
yearsem varchar2(20), adate date, cname varchar2(20));

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 18


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

Data Lengt P recisi Scal P rimar y N ulla b Defa u Co mme


Tab le Colu mn T ype h on e Key le lt nt
ADMISSI
ADMNO Number - 10 0 1 - - -
ON
ENROLL
Varchar2 20 - - - - -
NO

COURSE Varchar2 20 - - - - -

YEARSE
Varchar2 20 - - - - -
M

ADATE Date 7 - - - - -

CNAME Varchar2 20 - - - - -

A.3) Query to create table college:

Create table college

(cname varchar(40) primary key, city varchar(20), address varchar(30),phone number(13), afdate
date);

query to show table college structure

desc college;

Results:-

Colu m Data Lengt P recisio Scal P rimar y N ulla b Defa u Co mme


Tab le n T ype h n e Key le lt nt
COLLEG
CNAME Varchar2 40 - - 1 - - -
E

CITY Varchar2 20 - - - - -

ADDRE
Varchar2 30 - - - - -
SS

PHONE Number - 13 0 - - -

AFDATE Date 7 - - - - -

A.4) Query to create table feestructure:

create table feestructure(course varchar2(20) primary key, yearsem varchar2(20), fee int);

desc feestructure;

Results:-

Colu m Data Leng P recisi Scal P rimar y N ulla b Defa u Co mme


Tab le n T ype th on e Key le lt nt
FEESTRUCT COURS
Varchar2 20 - - 1 - - -
URE E
YEARSE
Varchar2 20 - - - - -
M

FEE Number - - 0 - - -

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 19


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

A.5) Query to create table payment:

create table payment

(billno varchar2(20), admno int, amount int, pdate date, purpose varchar2(20));

desc payment;

Results:-

Colum Data Lengt Precisi Scal Primary Nullab Defau Comme


Table n Type h on e Key le lt nt
PAYME BILLN
Varchar2 20 - - - - -
NT O
ADMN
Number - - 0 - - -
O
AMOU
Number - - 0 - - -
NT
PDATE Date 7 - - - - -
PURPO
Varchar2 20 - - - - -
SE

B) Insert About 10 rows as are appropriate to solve the following queries.

Query to insert rows in the enrollment table:

insert into enrollment values(101,'dev tandan', 'm', '1-jun-2000','belar',8889978593);

insert into enrollment values(102,'ajay tandan', 'm', '5-mar-2001','belar',8889978593);

insert into enrollment values(103,'trilok sahu', 'm', '8-feb-1998','fingeshwar',8569241253);

insert into enrollment values(104,'anshul rajpal', 'm', '5-jan-2000','durg',4563278956);

insert into enrollment values(105,'vikash rajak', 'm', '1-dec-1999','dhamtari',8569723651);

insert into enrollment values(106,'navin sahu', 'm', '5-sep-2001','raipur',7589532562);

insert into enrollment values(107,'venu sahu', 'f', '1-july-1998','bhilai',8889957488);

insert into enrollment values(108,'shubham sahu', 'm', '1-jun-1997','gariyaband',965875695);

insert into enrollment values(109,'manisha ', 'f', '18-jan-2000','rajim',7589658965);

insert into enrollment values(110,'chandni sahu ', 'f', '20-may-1996','nawapara',9142578956);

Query to show table:

select * from enrollment;

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 20


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

ENROLLNO NAME GENDER DOB ADDRESS PHONE


101 dev tandan m 01-JUN-00 belar 8889978593
102 ajay tandan m 05-MAR-01 belar 8889978593
103 trilok sahu m 08-FEB-98 fingeshwar 8569241253
104 anshul rajpal m 05-JAN-00 durg 4563278956
105 vikash rajak m 01-DEC-99 dhamtari 8569723651
106 navin sahu m 05-SEP-01 raipur 7589532562
107 venu sahu f 01-JUL-98 bhilai 8889957488
108 shubham sahu m 01-JUN-97 gariyaband 965875695
109 manisha f 18-JAN-00 rajim 7589658965
110 chandni sahu f 20-MAY-96 nawapara 9142578956

Query to insert rows in the enrollment table:

insert into admission values('11','101', 'BCA', '1','2-mar-2018','science college');

insert into admission values('12','102', 'Bsc', '3','5-mar-2019','SKM college');

insert into admission values('13','103', 'BCA', '2','18-mar-2018','science college');

insert into admission values('14','104', 'Bsc', '4','9-mar-2019','SKM college');

insert into admission values('15','105', 'Ba', '3','2-mar-2019','rajiv lochan college');

insert into admission values('16','106', 'Bcom', '3','2-mar-2018','Phulchan college');

insert into admission values('17','107', 'Ba', '3','1-mar-2019','royal college');

insert into admission values('18','108', 'BCA', '1','2-mar-2017','SKM college');

insert into admission values('19','109', 'Ba', '3','10-mar-2018','rajiv lochan college');

insert into admission values('20','110', 'BCA', '1','25-apr-2019','science college');

Query to show table:

select * from enrollment;

Results:-

ADMNO ENROLLNO COURSE YEARSEM ADATE CNAME


11 101 BCA 1 02-MAR-18 science college

12 102 Bsc 3 05-MAR-19 SKM college

13 103 BCA 2 18-MAR-18 science college

14 104 Bsc 4 09-MAR-19 SKM college

15 105 Ba 3 02-MAR-19 rajiv lochan college

16 106 Bcom 3 02-MAR-18 Phulchan college

17 107 Ba 3 01-MAR-19 royal college

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 21


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

18 108 BCA 1 02-MAR-17 SKM college

19 109 Ba 3 10-MAR-18 rajiv lochan college

20 110 BCA 1 25-APR-19 science college

Query to insert rows in the enrollment table:

insert into college values('science college','raipur','raipur',7945607503,'28-jan-2015');

insert into college values('skm college','raipur','nawapara',8095031200,'05-july-2014');

insert into college values('Rajiv lochan college','gariyaband','rajim',6503850312,'10-feb-2017');

insert into college values('Phulchand college','raipur','nawapara',8075060019,'20-apr-2016');

insert into college values('royal college','raipur','raipur',4556218974,'27-jan-2020');

Query to show table:

select * from college;

Results:-

CN AM E CITY AD D R ESS P HO N E AF D A TE
Science college raipur raipur 7945607503 28-JAN-15

SKM college raipur nawapara 8095031200 05-JUL-14

Rajiv lochan college gariyaband rajim 6503850312 10-FEB-17


phulchand college raipur nawapara 8075060019 20-APR-16

Royal college raipur raipur 4556218974 27-JAN-20

Query to insert rows in the feestructure table:

insert into feestructure values('BCA','3', '5000');

insert into feestructure values('Ba','3', '2000');

insert into feestructure values('Bsc','3', '3000');

insert into feestructure values('Bcom','3', '1500');

Query to show table:

select * from feestructure;

Results:-

CO U R SE Y EA R SEM F EE

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 22


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

BCA 3 5000
Ba 3 2000
Bsc 3 3000

Bcom 3 1500

Query to insert rows in the feestructure table:

insert into payment values('1','11', '5000', '1-apr-2019','annual fee');

insert into payment values('2','12', '3000', '5-apr-2019','half fee');

insert into payment values('3','13', '5000', '2-apr-2019','annual fee');

insert into payment values('4','14', '3000', '1-apr-2019','half fee');

insert into payment values('5','15', '2000', '4-apr-2019','annual fee');

insert into payment values('6','16', '1500', '1-apr-2019','annual fee');

insert into payment values('7','17', '2000', '8-apr-2019','annual fee');

insert into payment values('8','18', '5000', '10-apr-2019','annual fee');

insert into payment values('9','19', '2000', '4-apr-2019','annual fee');

insert into payment values('10','20', '5000', '1-apr-2019','annual fee');

Query to show table:

select * from payment;

Results:-

B ILL N O ADM NO AM O UN T P DA T E P URP OSE


1 11 5000 01-APR-19 annual fee

2 12 3000 05-APR-19 half fee

3 13 5000 02-APR-19 annual fee

4 14 3000 01-APR-19 half fee

5 15 2000 04-APR-19 annual fee

6 16 1500 01-APR-19 annual fee

7 17 2000 08-APR-19 annual fee

8 18 5000 10-APR-19 annual fee

9 19 2000 04-APR-19 annual fee

10 20 5000 01-APR-19 annual fee

c) Get full detail of all students who took admission this year class wise.

select name from admission, enrollment

where admission.enrollno = enrollment.enrollno

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 23


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

and adate between '1-JAN-2018' and '31-DEC-2019'

order by admission.course ;

Results:-

NAM E
dev tandan
chandni sahu
trilok sahu
vikash rajak
manisha
venu sahu
navin sahu
ajay tandan
anshul rajpa

D) Get detail of student who took admission in SKM college

select name, gender, DOB, address, phone from enrollment, admission

where admission.enrollno = enrollment.enrollno

and admission.cname = 'SKM college';

Results:-

NAM E GE N D ER DOB AD D R ESS P HO N E


ajay tandan m 05-MAR-01 belar 8889978593

anshul rajpal m 05-JAN-00 durg 4563278956

shubham sahu m 01-JUN-97 gariyaband 965875695

E) Calculate the total amount of Fees College in this session.

1) By your college

select admission.cname, sum(payment.amount) from admission, payment

where admission.admno = payment.admno

and admission.cname = 'SKM college'

and payment.pdate like '%%-%%%-19'group by admission.cname;

Results:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 24


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

CN AM E SUM (P AY M EN T. AM OU N T)
SKM college 11000

E) Calculate the total amount of Fees College in this session.

2) By each college

select admission.cname, sum(payment.amount) from admission, payment

where admission.admno = payment.admno

and payment.pdate like '%%-%%%-19'group by admission.cname;

Results:-

CN AM E SUM (P AY M EN T. AM OU N T)
science college 15000

rajiv lochan college 4000


SKM college 11000
royal college 2000
Phulchan college 1500

E) Calculate the total amount of Fees College in this session.

3) By all colleges
select sum(payment.amount) from admission, payment

where admission.admno = payment.admno

and payment.pdate like '%%-%%%-19';

Results:-

S UM (P AY M EN T. AM OU N T)
33500

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 25


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

ASSIGNMENT -07
Object :- Using The Following Database,
Enrollment (enrollno , name, gender, DOB, address, phone )

Admission (admno, enrollno, course, yearsem, date, cname )


Colleges (cname, city, address, phone, afdate)
Feestructure (course, yearsem, fee)
Payment (billno, admno, amount, pdate, purpse)

Write SQL statement for the following:


F. List the student name who have not payed full fee
2) In your college 2) in all college.
G. List the number of admission in your class in every year.
H. List the student in the session who are not in the colleges in the Same city as they live in.
I. List the student in college in your city and also live in your city.
J. Delete all the records of student who live in city Raipur

A) List the student name who have not payed full fee

1. In your college
select name from enrollment, admission, payment

where admission.enrollno = enrollment.enrollno

and admission.admno = payment.admno

and admission.cname = 'SKM college'

and payment.purpose = 'half fee';

Results:-

NAME
ajay tandan
anshul rajpal

A) List the student name who have not payed full fee

2. In allcolleges
select name from enrollment, admission, payment

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 26


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

where admission.enrollno = enrollment.enrollno

and admission.admno = payment.admno

and payment.purpose = 'half fee';

Results:-

NAME
ajay tandan

anshul rajpal

B) List the number of admission in your class in every year.


select count(admno) from admission

where course = 'BCA'

and adate between '02-MAR-17' and '25-APR-19';

Results:-

CO U N T(A DM N O)
4

C) List the student in the session who are not in the colleges in the Same city as
they live in.
select sname from enrollment, admission, college

where admission.enrollno = enrollment.enrollno

and admission.cname = college.cname

and college.address <> enrollment.address

Results:-

NAM E
Ajay Tandan
Anshul Rajpal
Vikash Rajak
Navin Sahu
Venu Sahu
Shubham Sahu

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 27


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

D) List the student in college in your city and also live in your city.
Select name from enrollment, admission, college

where admission.enrollno = enrollment.enrollno

and admission.cname = college.cname

and college.address =enrollment.address

Results:-

NAM E
Manisha

E) Delete all the records of student who live in city Raipur


delete from enrollment where address = 'raipur'

Results:-

1 row(s) deleted.

0.00 seconds

select * from enrollment;

Results:-

EN R O LL N O NAM E GE N D ER DOB AD D R ESS P HO N E


101 Dev Tandan m 01-JUN-00 Belar 8889978593
102 Ajay Tandan m 05-MAR-01 Belar 8889978593
103 Trilok Sahu m 08-FEB-98 Fingeshwar 8569241253
104 Anshul Rajpal m 05-JAN-00 Durg 4563278956

105 Vikash Rajak m 01-DEC-99 Dhamtari 8569723651


107 Venu Sahu f 01-JUL-98 Bhilai 8889957488
108 Shubham Sahu m 01-JUN-97 Gariyaband 965875695

109 Manisha f 18-JAN-00 Rajim 7589658965


110 chandni sahu f 20-MAY-96 nawapara 9142578956

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 28


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

ASSIGNMENT -08

Object :-Using The Following Database.


Subjectsss ( paperid, subject, paperno, papername )

Test ( papered, adate, time, max, min )

Scores (rollno,paperid, marks, attendance )

Students( admno, rollno, class, yearsem )

Write SQL statements for the following -


A. Create the above tables with the given specification and constraints.
B. Insert about 10 rows as are appropriate to solve following queries.
C. List the students who were present in a paper of a subject.
D. List all roll number who have passed in first division.
E. List all student in BCA who have scores higher than average

A. Create the above tables with the given specification and constraints.
A1) Query to create table subjects:
Create table subjects

(paperidint primary key, subject varchar(20),paperno number(20),papernamevarchar(20));

desc subjects;

Result:-

A2) Query to create table test:


Create table test
(papereid int,adate date,time date,max number(20),min number (20));
desc test;

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 29


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

Result:-

A3) Query to create table scores:


Create table scores
(rollno number(20)primary key,paperidint,marks number(20),attendance varchar(20));
desc scores;

Result:-

A4) Query to create table students:


Create table students
(admno number(20)primary key,rollno number(20),class varchar(20),yearsemvarchar(20));
desc students;

Result:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 30


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

B) Insert about 10 rows as are appropriate to solve following queries.


1. Query to insert rows in the subjects tables:
insert into subjects values(111,'HTML',001,'html')

insert into subjects values(112,'DBMS',002,'DBMS')

insert into subjects values(113,'MSOFFICE',003,'MSOFFICE')

insert into subjects values(114,'ACCOUNT',004,'account')

insert into subjects values(115,'CHEMISTRY',005,'CHEMISTRY')

insert into subjects values(116,'ECONOMIC',006,'ECONOMIC')

insert into subjects values(117,'GEOGROPHY',007,'GEOGROPHY')

insert into subjects values(118,'ORACLE',008,'ORACLE')

insert into subjects values(119,'ZOOLOGY',009,'ZOOLOGY')

insert into subjects values(120,'POLITICALSCIENCE',010,'POLITICALSCIENCE')

Query to show subjects to table:


select * from subjects;

Result:-

2. Query to insert rows in the test tables:


insert into test values(111,'1-jan-2022','9:10am',100,25);

insert into test values(112,'1-dec-2022','9:10am',100,25);

insert into test values(113,'1-jan-2022','9:10am',100,25);

insert into test values(114,'1-dec-2022','9:10am',100,25);

insert into test values(115,'1-jan-2022','9:10am',100,25);

insert into test values(116,'1-dec-2022','9:10am',100,25);

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 31


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

insert into test values(117,'1-jan-2022','9:10am',100,25);

insert into test values(118,'1-dec-2022','9:10am',100,25);

insert into test values(119,'1-jan-2022','9:10am',100,25);

insert into test values(120,'1-dec-2022','9:10am',100,25);

Query to show test to table:


select * from test;

Result:-

3. Query to insert rows in the scores tables:


insert into scores values(201,111,80,'p')

insert into scores values(202,112,82,'p')

insert into scores values(203,113,83,'p')

insert into scores values(204,114,84,'p')

insert into scores values(205,115,88,'p')

insert into scores values(206,116,70,'A')

insert into scores values(207,117,75,'A')

insert into scores values(208,118,60,'A')

insert into scores values(209,119,50,'p')

insert into scores values(210,120,55,'A')

Query to show scores to table:


select * from scores;

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 32


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

Result:-

4. Query to insert rows in the students tables:


insert into students values(301,201,'bca','2nd SEM')
insert into students values(302,202,'pgdca','2nd SEM')
insert into students values(303,203,'bca-I','1ST SEM')
insert into students values(304,204,'bca','2nd sem')
insert into students values(305,205,'msc','2nd SEM')
insert into students values(306,206,'mcom','1ST SEM')
insert into students values(307,207,'ma','2ST SEM')
insert into students values(308,208,'mca','1ST SEM')
insert into students values(309,209,'bsc','2st year')
insert into students values(310,210,'ba','1ST year')
Query to show students to table:
select * from students;

Result:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 33


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

C) List the students who were present in a paper of a subject.


Query to show to table:
select rollno, attendance from scores where attendance='p'

Result:-

D) List all roll numbers who have passed in first division.


Query to show to table:
select rollno,marks from scores where marks>=60

Result:-

E) list all students in BCA who have scored higher than average
Query to show to table:
select scores.rollno,scores.marks from scores,students
where students.class='bca'
and scores.rollno=students.rollno
and scores.marks>(select avg(scores.marks)from scores) ;

Result:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 34


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

H.T.M.L.

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 35


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

INDEX
Que. Objective of practical Page
No. HTML No.
1. 1.Write an HTML program to create the following table:
Class Subject1 Subject2 Subject3
BCA I Visual Basic PC Software Electronics 39-
BCA II C++ DBMS English 40
BCA III Java Multimedia CSA

2. 2. Write an HTML program to create the following lists:


(I) C
(II) C++
(III) Fortran 41
(IV) COBOL

3. 3. Write an HTML program to create the following lists:


1. Java
2. Visual Basic
3. BASIC 42
4. COBOL

4. 4. Write an HTML program to demonstrate hyper linking between two web


pages. Create a marquee and also insert an image in the page. 43

5. 5. Write an HTML program to create frames in HTML with 3 columns (Width = 30%,
30%, 30%). 44

6. 6. Write an HTML program to create a web page with a blue background and
the following text:
New Delhi
New Delhi, the capital and the third largest city of India is a fusion of the ancient and 45
the modern. The refrains of the Muslim dynasties with its architectural delights, give
the majestic ambience of the bygone era.

7. 7. Write an HTML program to create the following table:

46-
48

8. 8. Write an HTML program to create the following table:-

49-
50

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 36


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

9. 9. Write an HTML program to create the following table:


Students Records
Name Subject Marks 51-
Arun Java 70 52
C 80
Ashish Java 75
C 69
10. 10. Write the HTML coding to display the following table. Also insert an image in the
web page.
subject max min obtain
Java 100 33 75
Multimedia 100 33 70 53-
54
Operating system 100 33 68
C++ 100 33 73

11. 11. Write the HTML coding to display the following table:

55-
56

12. 12.Write an HTML coding to display the following table:

57

13. 13. Write an HTML program to create a web page with an image as background
and the following text:
New Delhi
New Delhi, the capital and the third largest city of India is a fusion of the 58
ancient and the modern. The refrains of the Muslim dynasties with its architectural
delights, give the majestic ambience of the bygone era.
On the other side New Delhi, the imperial city built by British, reflect the fast
paced present. The most fascinating of all is the character of Delhi which varies from
the 13th present century mausoleum of the Lodi kings to ultra modern glass skyscrapers.

14. 14. Create the following HTML form.

59

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 37


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

15. 15.Create the following HTML form:

60

61-
16. 16.Create the following HTML form: 62

17. 17. Write the HTML coding for the following equations:
C2H5OH+PCL5=C2H5CL+POCL3+HCL 63
4H3PO3=3H3PO4+PH3
PCL3+CL2=PCL5
18. 18. Write the HTML code to display the following:
1. Actors
1. Bruce Willis
2. Gerard Butler 64
3. Vin Diesel
4. Brad Pitt
2. Actress
1. Julia Roberts
2. Angelina Jolie
3. Kate Winslet
4. Cameron Diaz

19. 19. Write the HTML code to display the following:


1. Cricket players
1. Batsman
1. Sachin Tendulkar
2. Rahul Dravid 65-
3. Virendra Sehwag 66
2. Bowler
d. Kumble
e. Zaheer Khan
f. Balaji
3. Spinner
d)Harbhajan
e)Kumble
f) Kartik

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 38


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 1
Q.1. Write an HTML program to create the following table:
Class Subject1 Subject2 Subject3
BCA I Visual Basic PC Software Electronics
BCA II C++ DBMS English
BCA III Java Multimedia CSA

ANS:-

PROGRAM CODING:-
<html>

<head>

<style>

table, th, td

border: 1px solid black;

border-collapse:collapse;

</style>

</head>

<table>

<tr>

<th> class</th>

<th>subject1</th>

<th>subject1</th>

<th>subject1</th>

</tr>

<tr>

<td> <b> BCA I </b></td>

<td> Visual Basic</td>

<td> PC Software</td>

<td> Electronics</td>

</tr>

<tr>

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 39


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

<td> <b> BCA II </b></td>

<td> C++ </td>

<td> DBMS</td>

<td> English</td>

</tr>

<tr>

<td> <b> BCA III </b></td>

<td> Java</td>

<td> Multimedia</td>

<td> CSA</td>

</table>

</html>

OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 40


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 2
Q.2. Write an HTML program to create the following lists:
(V) C
(VI) C++
(VII) Fortran
(VIII) COBOL
ANS:-
PROGRAM CODING:-
<html>
<head>
<style>
ol
{
list-style:none;
}

li:before
{
content: "("counter(section,upper-roman)")";
}
li
{
counter-increment:section;
}
</style>
</head>
<body>
<ol>
<li> C</li>
<li>C++</li>
<li> &emsp; Fortran</li>
<li> &emsp; COBOL</li>
</ol>

</body>
</html>

Output:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 41


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 3
Q.3. Write an HTML program to create the following lists:
5. Java

6. Visual Basic

7. BASIC

8. COBOL

ANS:-

PROGRAM CODING:-

<html>

<ol type="1">

<li> Java</li>

<li>Visual</li>

<li> BASIC</li>

<li>COBOL</li>

</ol>

</html>

Output:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 42


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 4
Q.4. Write an HTML program to demonstrate hyper linking between two web pages. Create
a marquee and also insert an image in the page.

ANS:-
PROGRAM CODING

<html>

<body>

<a href="https://www.youtube.com/?gl=IN&tab=r1">

click here youtube

<marquee><h1> youtube channel</h1></marquee>

</body>

<body>

<img src="C:\Users\Public\Pictures\Sample Pictures\\ Hydrangeas.jpg ">

</body>

</html>

Output:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 43


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 5
Q.5. Create an HTML program to create frames in HTML with 3 columns (Width = 30%,30%,30%).
ANS:-

PROGRAM CODING:-

<html>
<head>
<title>frame tag</title>
</head>
<!-- <frameset cols=30%,30%,40%">
<frame src="C:\Users\Public\Pictures\Sample Pictures\Jellyfish.jpg">
<frame src="C:\Users\Public\Pictures\Sample Pictures\Hydrangeas.jpg">
<frame src="C:\Users\Public\Pictures\Sample Pictures\Hydrangeas.jpg">
</frameset>

<!-- <frameset>
<frame src="C:\Users\Public\Pictures\Sample Pictures\Jellyfish.jpg">

</frameset> -->

<frameset cols="30%,30%,40% rows=""20%,20%,20%">


<frame src="C:\Users\Public\Pictures\Sample Pictures\Penguins.jpg">
<frame src="C:\Users\Public\Pictures\Sample Pictures\Lighthouse.jpg">
<frame src="C:\Users\Public\Pictures\Sample Pictures\Koala.jpg">
</frameset>
</html>

Output:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 44


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 6
Q.6. Write an HTML program to create a web page with a blue background and the
following text:
New Delhi

New Delhi, the capital and the third largest city of India is a fusion of the ancient and the modern.
The refrains of the Muslim dynasties with its architectural delights, give the majestic ambience of the
bygone era.

ANS:

PROGRAM CODING:-

<html>

<head> <head>

<body bgcolor="lightblue">

<p><u> <b><center>New Delhi</center></b></u><i> New Delhi, the capital and the third largest
city of India is a fusion of the ancient and the mordern. The refrains of the Muslim dynasities with its
architectural delights, give the majestic ambience of the bygone era.</i></p>

</body>

</html>

Output:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 45


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 7
Q.7. Write an HTML program to create the following table:

ANS:
PROGRAM CODING:-
<html>
<head>
<style>
</style>
</head>
<h3><b><u><center> admission</center></u></b></h3>
<body>
<center>
<table border="1" style="text-align:center; width:30%; border-collapse:collapse;">

<tr>
<th style="text-align:left"> course</th>
<th>OC</th>
<th> BC</th>
<th>MBC</th>
<th>SC/ST</th>
<th>TOTAL</th>
</tr>

<tr>
<th style="text-align:left"> computer science</th>
<td>9</td>
<td>18</td>
<td>5</td>
<td>5</td>
<td>37</td>
</tr>

<tr>
<th style="text-align:left"> commerce</th>
<td>14</td>
<td>25</td>
<td>6</td>
<td>5</td>
<td>50</td>
</tr>

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 46


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

<tr>
<th colspan="5"style="text-align:left"> grand total</th>
<td> 87</td>
</tr>
</table> <html>
<head>
<style>

</style>
</head>
<h3><b><u><center> admission</center></u></b></h3>
<body>
<center>
<table border="1" style="text-align:center; width:30%; border-collapse:collapse;">

<tr>
<th style="text-align:left"> course</th>
<th>OC</th>
<th> BC</th>
<th>MBC</th>
<th>SC/ST</th>
<th>TOTAL</th>
</tr>

<tr style="text-align:left">
<th> computer science</th>
<td>9</td>
<td>18</td>
<td>5</td>
<td>5</td>
<td>37</td>
</tr>

<tr style="text-align:left">
<th> commerce</th>
<td>14</td>
<td>25</td>
<td>6</td>
<td>5</td>
<td>50</td>
</tr>

<tr>
<th colspan="5"style="text-align:left"> grand total</th>
<td> 87</td>
</tr>
</table>
</center>
</body>

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 47


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

</html>
</center>
</body>
</html>

OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 48


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 8
Q.8. Write an HTML program to create the following table:

ANS:
PROGRAM CODING:-
<html>
<head>
<style>
</style>
</head>
<h3><u><center> Car Price List</center></u></h3>
<body>
<center>
<table border="1" style="text-align:center; width:40%; border-collapse:collapse;">
<tr>
<th colspan="2">Maruti</th>
<th colspan="2">Tata</th>
<th colspan="2">Ford</th>

<tr>
<style="text-align:center">
<th>Model</th>
<th>Price</th>
<th>Model</th>
<th>Price</th>
<th>Model</th>
<th>Price</th>
</tr>

<tr style="text-align:left">
<td>Maruti 800</td>
<td>2 Lac</td>
<td>Sumo</td>
<td>2 Lac</td>
<td>Ikon</td>
<td>5 Lac</td>
</tr>
<tr style="text-align:left">
<td>Omni</td>
<td>3 Lac</td>
<td>Scropio</td>

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 49


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

<td>3 Lac</td>
<td>Gen</td>
<td>2 Lac</td>
</tr>

</table>
</center>
</body>
</html>

OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 50


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 9
Q.9. Write an HTML program to create the following table:
Students Records

Name Subject Marks


Arun Java 70
C 80
Ashish Java 75
C 69

ANS:-

PROGRAM CODING:-

<html>
<head>
<style>
table, th, td
{
border: 1px solid black;
border-collapse:collapse;
}
</style>
</head>
<u> <b><center>Students Records</center></b></u>
<center>
<table>
<tr>
<th> <center>Name</center></th>
<th><center>Subject</center></th>
<th> <center>Marks</center></th>
</tr>
<tr>
<td><center> Arun</center></td>
<td> <center>Java</center></td>
<td><center> 70</center></td>
</tr>
<tr>
<td> </td>
<td><center>C</center></td>
<td><center>80</center></td>
</tr>
<tr>
<td><center>Ashish</center> </td>
<td><center>Java</center></td>
<td><center>75</center></td>
</tr>
<tr>
<td> </td>
<td><center>C</center></td>

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 51


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

<td><center>69</center></td>
</tr>
</table > </center>
</html>

Output:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 52


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 10
Q.10. Write the HTML coding to display the following table. Also insert an image in the web page.

subject max min obtain


Java 100 33 75
Multimedia 100 33 70
Operating system 100 33 68
C++ 100 33 73

ANS:-

PROGRAM CODING:-

<html>
<head>
</head>
<body background=
"C:\Users\Public\Pictures\Sample Pictures\
Lighthouse.jpg" hight="30" width="30">
<center>
<table border="1" style="text-align:left; width:30%;
border-collapse:collapse;>

<tr style="text-align:left;>
<th>Subject</th>
<th>Max</th>
<th>Min</th>
<th>obtain</th>
</tr>

<tr style="text-align:left">
<td>Java</td>
<td>100</td>
<td>33</td>
<td>75</td>
</tr>

<tr style="text-align:left">
<td>Multimedia</td>
<td>100</td>
<td>33</td>
<td>70</td>
</tr>

<tr style="text-align:left">
<td>Opreting system</td>
<td>100</td>
<td>33</td>
<td>68</td>

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 53


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

</tr>

<tr style="text-align:left">
<td>C++</td>
<td>100</td>
<td>33</td>
<td>73</td>
</tr>

</table>
</center>
</body>
</html>

OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 54


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAMNO. 11
Q.11. Write the HTML coding to display the following table:

ANS:-
PROGRAM CODING:-
<html>
<head>
<style>
</style>
</head>
<body>
<center>
<table border="1" style="text-align:left; width:30%; border-collapse:collapse;">
<tr>
<th colspan="2">Name</th>
<td colspan="2">Rahul</td>
</tr>
<tr>
<th colspan="2">Roll No.</th>
<td colspan="2">101</td>
</tr>
<tr style="text-align:left">
<th>Subject</th>
<th>Max</th>
<th>Min</th>
<th>obtain</th>
</tr>
<tr style="text-align:left">
<td>Java</td>
<td>100</td>
<td>33</td>
<td>75</td>
</tr>
<tr style="text-align:left">
<td>Multimedia</td>
<td>100</td>
<td>33</td>
<td>70</td>
</tr>
</table> </center>
</body>
</html>

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 55


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 56


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 12
Q.12.Write an HTML coding to display the following table:

ANS:-
PROGRAM CODING:-
<html>
<body>
<form>
<label> Enter Name: &emsp;&emsp;<input type="text" value=""/></label><br>
<label>Enter Roll No.:&emsp; <input type="text"/></label><br>
<label>Enter Age:&emsp;&emsp;&emsp;<input type="text"/></label><br>
<label>Enter DOB: &emsp; &emsp;<input type="text"/></label><br>
</form>
</body>
</html>
OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 57


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 13
Q.13. Write an HTML program to create a web page with an image as background and the
following text:
New Delhi
New Delhi, the capital and the third largest city of India is a fusion of the ancient and the
modern. The refrains of the Muslim dynasties with its architectural delights, give the majestic
ambience of the bygone era.
On the other side New Delhi, the imperial city built by British, reflect the fast paced present.
The most fascinating of all is the character of Delhi which varies from the 13 th present century
mausoleum of the Lodi kings to ultra modern glass skyscrapers.

ANS:-

PROGRAM CODING:-

<html>

<head> <head>

<body background="C:\Users\Public\Pictures\Sample Pictures\\Tulips.jpg ">

<p><u> <b><center>New Delhi</center></b></u> &emsp;New Delhi, the capital and the third
largest city of India is a fusion of the ancient and the mordern. The refrains of the Muslim dynasities
with its architectural delights, give the majestic ambience of the bygone era.</p>

<p>&emsp; On the other side new Delhi, the imprial city built by British, reflect the fast paced
present. The most fascinating of all is the character of Delhi which varies from the 13<super>
th<super> present century mausoleum of the Lodi kings to ultra modern glass skyscrapers.</p>

</body>

</html>

OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 58


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 14
Q.14. Create the following HTML form.

ANS:-

PROGRAM CODING:-

<html>
<head>
<title>paragraph </title>
</head>
<body>
<form>
<table> username:<input type="text" value="xyz"/></table>
<label> password:<input type="password"/></label><br>
<p> When user types characters in a password field, the browser displays asterisks or bullets instead
of characters.<br>
<button type="submit">submit</button>
</form>
</body>
</html>

OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 59


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 15
Q.15.Create the following HTML form:

ANS:-

PROGRAM CODING:-
<html>
<body>
<border="left">
<form>
<label> FIRSTNAME : <input type="text"/></table><br>
<label> LASTNAME : <input type="text"/></label><br>
<p>GENDER:<br>
<label>Male <input type="radio"name="gender"></label>
<label>female <input type="radio"name="gender"></label><br>
<p>SUBJECT:
<select>
<option>multimedia</option>
<option>operating</option>
<option>CSA</option>
</select><br>
<pre>
<button type="submit">Submit Query</button>
</form>
</body>
</html>
OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 60


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 16
Q.16.Create the following HTML form:

ANS:-
PROGRAM CODING:-
<html>
<body>
<form>
<label>Enter your name : <input type="text"/><br>
<label>Enter your rollno : <input type="text"/><br>
<p>Subject :<br>
<label><input type="checkbox">Java</select><br>
<label><input type="checkbox">c</select><br>
<label><input type="checkbox">Visual Basic</select><br>
<label><input type="checkbox">C++</select><br>
<p>Class:
<select>
<option>BCA I</option>
<option>BCA II</option>
<option>BCA III</option>
</select><br>
<pre>
<button type="submit">Submit Query</button>
</form>
</body>
</html>

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 61


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

OUTPUT:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 62


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 17
Q.17. Write the HTML coding for the following equations:
C2H5OH+PCL5=C2H5CL+POCL3+HCL
4H3PO3=3H3PO4+PH3
PCL3+CL2=PCL5

ANS:-

PROGRAM CODING:-

<html>
<body>
<p>
C<sub>2</sub>H<sub>5</sub>OH+PCL<sub>5</sub>=C<sub>2</sub>H<sub>5</sub>CL+POCL
<sub>3</sub>+HCL
<p>4H<sub> 3</sub>PO<sub>3</sub>=3H<sub>3</sub>PO<sub>4</sub>+PH<sub>3</sub></p>
<p>PCL<sub> 3</sub>+CL<sub>2</sub>=PCL<sub>5</sub>
</p>
</body>
</html>

Output:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 63


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 18
Q.18. Write the HTML code to display the following:
1. Actors
5. Bruce Willis
6. Gerard Butler
7. Vin Diesel
8. Brad Pitt
2. Actress
1. Julia Roberts
2. Angelina Jolie
3. Kate Winslet
4. Cameron Diaz
PROGRAM CODING:-
<html>
<body>
<ol type="1">
<li>Actors</li>
<ol type="1">
<li> Bruce Willis</li>
<li> Gerard Butler </li>
<li> Vin Diesel </li>
<li> Brad Pitt </li>
</ol>
<li> Actress </li>
<ol type="1">
<li> Julia Roberts </li>
<li> Angelina Jolie </li>
<li> Kate Winslet </li>
<li> Cameron Diaz </li>
</ol>
</ol>
</body>
</html>

Output:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 64


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

PROGRAM NO. 19
Q.19. Write the HTML code to display the following:

Cricket players

1. Batsman

1. Sachin Tendulkar

2. Rahul Dravid

3. Virendra Sehwag

2. Bowler

d. Kumble

e. Zaheer Khan

f. Balaji

3. Spinner

d) Harbhajan

e) Kumble

f) Kartik

ANS:-

PROGRAM CODING:-

<html>

<body>

<ol type="1">

<li>Bastman</li>

<ol type="1">

<li>Sachin Tendulkar</li>

<li> Rahul Dravid </li>

<li> Virendra Sehwag</li>

</ol>

<li> Bowler</li>

<ol type="a">

<li>Kumble</li>

<li> Zaheer khan</li>

<li> Balaji</li>

</ol>

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 65


NARENDRA PGDCA - 2nd SEM. SESSION : 2022-23

<li> Spinner</li>

<ol type="a">

<li>Harbhajan</li>

<li> Kumble</li>

<li> Kartik</li>

</ol>

</ol>

</body>

</html>

Output:-

GOVT. KACHNA DHURWA COLLEGE, CHHURA Page 66

You might also like