pages

Tuesday, June 30, 2020

Webtech slips Solutions

BCA PRACTICAL Slips

Web Tech Practical Slips Solution


1
Slip
Q1. Write a JavaScript program to calculate the volume of a sphere.

<html>
<head><title>pro4</title>
<script>
function volume()
{
var t_val=document.getElementById("txt").value;
var rad=parseInt(t_val);
var vol=(4.0/3.0)*Math.PI*Math.pow(rad,3);
document.getElementById("answer").value= vol;
}
</script>
</head>
<body>
<label>Input radius value of Sphere: </label><br>
<label> Raduis: </label> <input type="text" id="txt" size="30"/><br>
<button onclick="volume()">Find volume</button><br>
<label> Volume: </label><input type="text" id="answer" size="30"/><br>
</body>
</html>
Q2 Create HTML page to Divide the frames in to different sections as shown below and add appropriate HTML files to each frame.
First Frame : Your Name and address
Second Frame :
Bulleted list of favourite colours
Third Frame :
Numbered List of Cities
Fourth Frame:
Scrolling Message
Fifth Frame:
Blinking Reminders
Sixth Frame:
Name of Countries
First.html
<html>
<body>
<h3 align="Center"> Name: XYZ
<address>
2
PQR
Pimpri Pune-17
</address>
</h3>
</body>
</html>
Second.html
<html>
<body>
<h4> My favourite colours </h4>
<ul type="disc">
<li>Red</li>
<li> Pink</li>
<li>Green</li>
<li>Blue</li>
</ul>
</body>
</html>
Third.html
<html>
<body>
<h4> List of City </h4>
<Ol type="A">
<li>Pune</li>
<li> Pimpri</li>
<li>Mombay</li>
<li>Nasik</li>
</Ol>
</body>
</html>
Fourth.html
<html>
<body>
<h3 align="Center">
<pre>
hhhhhhhhhhhhhhhhh
jjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjj
ffffffffffffff
sdddddddddddwer
sdfrgergergv
rtgrrrrrrrrr
rtrtrtrtrtrtrtrtrtrtrtrtrt
erat5r
3
etyteyty
</pre>
</h3>
</body>
</html>
Fifth.html
<html>
<head>
<title>Title of the document</title>
<style>
.blink
{
animation: blinker 0.6s linear infinite;
color: pink;
font-size: 30px;
font-weight: bold;
}
@keyframes blinker
{
50% { opacity: 0;
}
</style>
</head>
<body>
<p class="blink">Blinking text</p>
</body>
</html>
Sixth.html
<html>
<body>
<h4> List of Country </h4>
<Ol type="1">
<li>India</li>
<li> US</li>
<li>UK</li>
</Ol>
</body>
</html>
Frame.html
<html>
<frameset rows="*,*,*">
<frame src="first.html"></frame>
<frameset cols="*,*">
<frame src="second.html"></frame>
<frame src="third.html"></frame>
</frameset>
4
<frameset cols="*,*,*">
<frame src="fourth.html"></frame>
<frame src="blink.html"></frame>
<frame src="sixth.html"></frame>
</frameset>
</frameset>
</html>

Friday, June 26, 2020

DBMS Practical Slips Solution

DBMS Practical Slips

Slip1
Consider the following Entities and Relationships
 Customer (cust_no, cust_name, address, city)
Loan (loan_no, loan_amt)
Relation between Customer and Loan is Many to Many
Constraint: Primary key, loan_amt should be > 0.
Create a Database in 3NF & write queries for following.

•Find details of all customers whose loan is greater than 10 lakhs.
SQL>select Customers.cust_name,Customers.address from Customers,Loan,Customer_Loan    where  Customers.cust_no=Customer_Loan.cust_no and  Loan.loan_no= Customer_Loan. loan_no  and Loan.loan_amt>=10000;

•List all customers whose name starts with 'ba'.
SQL>Select * from Customers  Where  cust_name like 'ba%';

•List names of all customers in descending order who has taken a loan in Nasik city.
SQL>select Customers.cust_name,Customers.address from Customers,Loan,Customer_Loan    where   Customers.cust_no=Customer_Loan.cust_no and  Loan.loan_no= Customer_Loan. loan_no  and Customers.city='nashik'  order by  Customers.cust_name desc  ;

•Display customer details having maximum loan amount.
SQL>select Customers.cust_name,Customers.address from Customers,Loan,Customer_Loan    where Customers.cust_no=Customer_Loan.cust_no and  Loan.loan_no= Customer_Loan. loan_no  and   Loan.loan_amt =(select max(Loan.loan_amt) from Loan ) ;

•Calculate total of all loan amount.
SQL>select sum(Loan.loan_amt) from Loan;


Slip2
Consider the following Entities and Relationships
 Department (dept_no, dept_name, location)
Employee (emp_no, emp_name, address, salary, designation)
Relation between Department and Employee is One to Many
Constraint: Primary key, salary should be > 0.
Create a Database in 3NF & write queries for following.

•Find total salary of all computer department employees.

SQL>select sum(Employee.salary),dept_name from Department,Employee where Department. dept_no=Employee.dept_no and dept_name='Computer' group by dept_name;

•Find the name of department whose salary is above 10000.
SQL>select  dept_name,salary from Department, Employee where Department. dept_no  = Employee. dept_no  and salary >10000;

•Count the number of employees in each department.
SQL>select count(emp_no ), dept_name  from Department, Employee where Department. dept_no  = Employee. dept_no  group by dept_name  ;

•Display the maximum salary of each department.
SQL>select max(salary),dept_name from Department, Employee  where Department. dept_no  = Employee. dept_no  group by dept_name  ;

•Displaydepartment wise employee list.
SQL>select emp_name, dept_name  from Department, Employee where Department. dept_no  = Employee. dept_no;

Slip3
Consider the following Entities and Relationships
 Project (pno, pname, start_date, budget, status)
Department (dno, dname, HOD)
Relation between Project and Department is Many to One
Constraint: Primary key.
Project Status Constraints: C – completed,Progressive, I-Incomplete

Create a Database in 3NF & write queries for following.
•List the project name and department details worked in projects that are ‘Complete’.
SQL>Select  p1name, ddname, hodd, locationd from department1, project1 where   department1. dno1= project1.dno1 and  project1.status='C';

•Display total budget of each department.
SQL>Select sum(budget), ddname from  department1, project1 where department1. dno1= project1.dno1  group by ddname;

•Display incomplete project of each department
SQL>select p1name,status ,count(department1. dno1) from department1, project1 where   department1. dno1= project1.dno1 and project1.status='I'  group by status,p1name    ;

•Find the names of departments that have budget greater than 50000   .
SQL>select ddname from  department1, project1 where  department1. dno1= project1.dno1 and budget >=50000  ;

•Displayall project working under 'Mr.Desai'.
SQL>Select  p1name  from department1, project1 where   department1. dno1= project1.dno1 and hodd= 'Mr.Desai';  


Slip4
Consider the following Entities and Relationships
 Room (roomno, desc, rate)
Guest (gno, gname, no_of_days)
Relation between Room and Guest is One to One.
Constraint: Primary key, no of days should be > 0.
Create a Database in 3NF & write queries for following.

•Display room details according to its rates  in ascending order.
SQL>Select desc,rate from room  order by desc ASC;

•Find the names of guest who has allocated room for more than 3 days.
SQL>Select  gname  from guest,room where guest.gno=room.rno where   no_of_days>3;

•Find no. of AC rooms.
SQL>select count(rno) from room where desc=’AC’;

•Display total amount for NON-AC rooms.
SQL>Select Sum(rate) from room where desc=’Non-AC’;

•Find names of guest with maximum room charges.
SQL>select gname from room,guest where guest.gno=room.rno  and rate = (select max(rate) from room);
Slip5
Consider the following Entities and Relationships
 Book (Book_no, title, author, price, year_published)
Customer (cid, cname, addr)
Relation between Book and Customer is Many to Many with quantity as
descriptive attribute.
Constraint: Primary key, price should be >0.
Create a Database in 3NF & write queries for following.

•Display customer details from 'Mumbai'.
SQL>Select * from Customerb where addr='mumbai';

•Display author wise details of book.
SQL>Select author ,title from BOOK order by author;

•Display all customers who have purchased the books published in the year 2013.
SQL>Select * from Customerb,BOOK, Customerb_BOOK where  Customerb.cid=Customerb_BOOK.cid and BOOK.BNO= Customerb_BOOK.BNO and year_published='2013';

•Display customer name that has purchased more than 3 books.
SQL>select count(BOOK.BNO),cname from Customerb,BOOK, Customerb_BOOK where  Customerb.cid=Customerb_BOOK.cid and BOOK.BNO=Customerb_BOOK.BNO and BOOK.BNO>3 group by cname;

•Displaybook names having price between 100 and 200 and published in the year 2013.
SQL>Select BOOK.title from Customerb,BOOK, Customerb_BOOK  where  price>=100 and   price<=200 and Customerb.cid=Customerb_BOOK.cid and BOOK.BNO= Customerb_BOOK.BNO;