Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2. Write a program to find grade of any average marks based upon given 7
information.
3. Write a program to input any number and to check whether the given number 8
is divisible by 3 or not. If the number is divisible by 3 print its cube otherwise
print its square.
7. Write a program to input any number and to print sum of all even numbers 12
using do while loop.
V Html Code 20
VI MySql Code 26
JAVA
CODE
1. Write a program to check whether the user is eligible to vote or not.
2. Write a program to find grade of any average marks based upon given information.
Average Grade
>=90 A
<90&&>=80 B
<80&&>=65 C
<65 D
3. Write a program to input any number and to check whether the given number is divisible by
3 or not. If the number is divisible by 3 print its cube otherwise print its square.
4. Write a program to print all even number up to given number.
5. Find the sum of all multiples of 3 up to 100.
6. Write a program to find the sum of following series.
3/7+6/14+9/21+……n terms
7. Write a program to input any number and to print sum of all even numbers using do while
loop.
8. Write a program to check whether the given number is prime or not.
9. Write a program to print the following format.
5 5 5 5 5
4 4 4 4
3 3 3
2 2
1
10. Write a program to implement the following application.
11. Write a program to implement the following application.
12. Write a program to implement the following:
HTML
CODE
<html>
<head><title>SCHEDULE</title></head>
<body>
<table border=4>
<caption> VOLUNTEER SCHEDULE</caption>
<tr bgcolor="Red">
<th>9a.m.</th>
<th>12p.m.</th>
<th>2p.m.</th>
</tr>
<tr>
<td>Anuj</td>
<td>Vijay</td>
<td>Sarfraj</td>
</tr>
<tr>
<td>Deepika</td>
<td>Vanshika</td>
<td>Pooja</td>
</tr>
<tr>
<td>Gul</td>
<td>Reyana</td>
<td>Swayam</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title> Lists</title>
</head>
<body>
<ol start=1 type =a>
<li>Mango<
<li>Grapes
<li>Watermelon
</ol>
<ul type=square>
<li>India
<li>Bangladesh
<li>Pakistan
</ul>
</body></html>
<html>
<head><title>Elements</title></head>
<h1>The Following is a list of a few chemicals:</h1>
<ul type=disc>
<li>Sodium
<li>Sulphur
<li>Magnesium</ul>
</body>
</html>
<html>
<head>
<title> My web page</title>
</head>
<body>
<font face="Monotype Corsiva" size=6>
Sachdeva Global School
</font>
<hr size=4 width=50%>
<h1> MYSQL </h1>
<h2>DDL&DML</h2>
<h3>Create,Drop are DDL Commands</h3>
<h3>Insert,Delete are DML Commands</h3>
</body></html>
<html>
<head>
<title> My web page</title>
</head>
<body>
<table bgcolor=red border=4>
<tr>
<th>Rollno</th>
<th>Name</th>
<th>Marks</th>
</tr>
<tr>
<td>1</td>
<td>Anuj</td>
<td>20</td>
</tr>
</table></body></html>
MYSQL
CODE
Aggregate Function
+-----------+---------------+------+-----+---------+-------+
+-----------+---------------+------+-----+---------+-------+
+-----------+---------------+------+-----+---------+-------+
itemnamevarchar(25),
cost numeric(10,2),
noofitems numeric(3));
+------+----------+----------+-----------+
+------+----------+----------+-----------+
| 11 | COMPUTER | 25000.00 | 5|
| 25 | PRINTER | 30000.00 | 6|
| 27 | SCANNER | 15000.00 | 3|
| 30 | KEYBOARD | 200.00 | 25 |
+------+----------+----------+-----------+
mysql> insert into item
values(11,'COMPUTER',25000,5)
values(25,'PRINTER',30000,6);
values(27,'SCANNER',15000,3);
values(30,'KEYBOARD',200,25);
+------+----------+----------+-----------+
+------+----------+----------+-----------+
| 11 | COMPUTER | 25000.00 | 5|
| 25 | PRINTER | 30000.00 | 6|
| 27 | SCANNER | 15000.00 | 3|
| 30 | KEYBOARD | 200.00 | 25 |
+------+----------+----------+-----------+
+------+----------+----------+-----------+----------------+
| item | itemname | cost | noofitems | noofitems*cost |
+------+----------+----------+-----------+----------------+
+------+----------+----------+-----------+----------------+
+-----------+
| max(cost) |
+-----------+
| 30000.00 |
+-----------+
+-----------+
| sum(cost) |
+-----------+
| 70200.00 |
+-----------+
+--------------+
| avg(cost) |
+--------------+
| 17550.000000 |
+-----------+
| min(cost) |
+-----------+
| 200.00 |
+-----------+
+----------+
| count(*) |
+----------+
| 4|
+----------+
);
);
(3) Insert the following information to empl table.
+-------+-----------+-----------+------+------------+---------+---------+-------
-+
|
+-------+-----------+-----------+------+------------+---------+---------+---
----
-+
|
| 8839 | AMIR | PRESIDENT | NULL | 1991-11-18 |
5000.00 | NULL | 10
+-------+-----------+-----------+------+------------+---------+---------+---
----
-+
14 rows in set (0.01 sec)
+--------+------------+-----------+
| deptno | dname | loc |
+--------+------------+-----------+
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
+--------+------------+-----------+
->fromempl
->group by deptno;
+----------+--------+
| count(*) | deptno |
+----------+--------+
| 3| 10 |
| 5| 20 |
| 6| 30 |
+----------+--------+
->group by job;
+----------+-----------+
| sum(sal) | job |
+----------+-----------+
| 6000.00 | ANALYST |
| 4150.00 | CLERK |
| 8285.00 | MANAGER |
| 5000.00 | PRESIDENT |
| 5600.00 | SALESMAN |
+----------+-----------+
->fromempl
->group by job;
+-------------+-----------+
| avg(sal) | job |
+-------------+-----------+
| 3000.000000 | ANALYST |
| 1037.500000 | CLERK |
| 2761.666667 | MANAGER |
| 5000.000000 | PRESIDENT |
| 1400.000000 | SALESMAN |
+-------------+-----------+
->fromempl
->group by deptno
+----------+--------+
| count(*) | deptno |
+----------+--------+
| 5| 20 |
| 6| 30 |
+----------+--------+
->fromempl
->group by job;
+----------+----------+-----------+
+----------+----------+-----------+
Join
(1) To display employee name ,location from empl and dept.
->fromdept,empl
->whereempl.deptno=dept.deptno;
+-----------+-----------+
| ename | loc |
+-----------+-----------+
| SMITH | CHENNAI |
| ANYA | KOLKATA |
| SETH | KOLKATA |
| MAHADEVAN | CHENNAI |
| MOMIN | KOLKATA |
| BINA | KOLKATA |
| SCOTT | CHENNAI |
| ANOOP | CHENNAI |
| JATIN | KOLKATA |
| FAKIR | CHENNAI |
+-----------+-----------+
mysql> select *
->fromempl,dept;
+-------+-----------+-----------+------+------------+---------+-------
--+-------
-+--------+------------+-----------+
+-------+-----------+-----------+------+------------+---------+-------
--+-------
-+--------+------------+-----------+
| 20 | RESEARCH | CHENNAI |
| 8369 | SMITH | CLERK | 8902 | 1990-12-18 |
800.00 | NULL | 20
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 8521 | SETH | SALESMAN | 8698 | 1991-02-22 |
1250.00 | 500.00 | 30
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 8698 | BINA | MANAGER | 8839 | 1991-05-01 |
2850.00 | NULL | 30
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 8844 | KULDEEP | SALESMAN | 8698 | 1991-09-08 |
1500.00 | 0.00 | 30
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 8900 | JATIN | CLERK | 8698 | 1991-12-03 |
950.00 | NULL | 30
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
| 20 | RESEARCH | CHENNAI |
| 30 | SALES | KOLKATA |
| 40 | OPERATIONS | MUMBAI |
+-------+-----------+-----------+------+------------+---------+-------
--+-------
-+--------+------------+-----------+
mysql> select *
+--------+-------+-----------+-----------+------+------------+---------+---
-----
-+------------+-----------+
| dname | loc |
+--------+-------+-----------+-----------+------+------------+---------+---
-----
-+------------+-----------+
| RESEARCH | CHENNAI |
| SALES | KOLKATA |
| 30 | 8521 | SETH | SALESMAN | 8698 | 1991-02-22
| 1250.00 | 500.00
| SALES | KOLKATA |
| RESEARCH | CHENNAI |
| SALES | KOLKATA |
| SALES | KOLKATA |
| RESEARCH | CHENNAI |
| SALES | KOLKATA |
| RESEARCH | CHENNAI |
| RESEARCH | CHENNAI |
+--------+-------+-----------+-----------+------+------------+---------+---
-----
-+------------+-----------+