0% found this document useful (0 votes)
2K views13 pages

2nd-Puc-Lab-Manual-Section B and C-1

Uploaded by

Manuswamy M R
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)
2K views13 pages

2nd-Puc-Lab-Manual-Section B and C-1

Uploaded by

Manuswamy M R
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/ 13

SECTION – B

STRUCTURED QUERY
LANGUAGE (SQL)
Structured query Language II PUC

PROGRAM 1:

Generate the electricity bill for one customer.


Create a table for house hold Electricity bill with the following fields.
Field Name Type
RR_NO VARCHAR2(10)
CUS_NAME VARCHAR2(15)
BILLING_DATE DATE
UNITS NUMBER(4)
Insert 10 records into the table.
1. Check the structure of table and note your observation.
2. Add two fields to the table.
a. BILL_AMT NUMBER(6,2)
b. DUE_DATE DATE
3. Compute the bill amount for each customer as per the following rules.
a. MIN_AMT Rs. 50
b. First 100 units Rs 4.50/Unit
c. >100 units Rs. 5.50/Unit
4. Compute due date as BILLING_DATE + 15 Days
5. List all the bills generated.

Solution:
First we have to create the table EBILL using CREATE TABLE command.

Insert 10 records into the table using INSERT commands


SQL> INSERT INTO EBILL VALUES ('EH 1003', 'ARUN KUMAR' ,'12-MAR-16',98);
SQL> INSERT INTO EBILL VALUES ('EH 2005', 'NAVEEN' ,'14-MAR-16',108);
SQL> INSERT INTO EBILL VALUES ('EH 2007','VARUN' ,'18-FEB-16',157);
SQL> INSERT INTO EBILL VALUES ('EH 3009', 'DAVID' ,'11-APR-16',77);
SQL> INSERT INTO EBILL VALUES ('EH 3010', 'JHON' ,'01-MAR-16',89);
SQL> INSERT INTO EBILL VALUES ('EH 3013', 'AKSHAY' ,'02-FEB-16',68);
SQL> INSERT INTO EBILL VALUES ('EH 1010', 'CHANDRU' ,'12-MAR-16',108);
SQL> INSERT INTO EBILL VALUES ('EH 1008', 'GHANAVI' ,'12-MAR-16',132);
Structured query Language II PUC
SQL> INSERT INTO EBILL VALUES ('EH 2105', 'DRUVA' ,'12-MAR-16',87);
SQL> INSERT INTO EBILL VALUES ('EH 3041', 'SHREYA' ,'12-MAR-16',127);

1. Check the structure of table and note your observation.

2. Add two fields to the table.


a. BILL_AMT NUMBER(6,2)
b. DUE_DATE DATE

3. Compute the bill amount for each customer as per the following rules.
a. MIN_AMT Rs. 50
b. First 100 units Rs 4.50/Unit
c. >100 units Rs. 5.50/Unit
COMMAND 1:

COMMAND 2:
Structured query Language II PUC
4. Compute due date as BILLING_DATE + 15 Days

5. List all the bills generated.


Structured query Language II PUC

PROGRAM 2:

Create a student database and compute the results.

Create a table for class of students with the following fields.

Field Name Type


ID_NO NUMBER(4)
S_NAME VARCHAR2(15)
SUB1 NUMBER(3)
SUB2 NUMBER(3)
SUB3 NUMBER(3)
SUB4 NUMBER(3)
SUB5 NUMBER(3)
SUB6 NUMBER(3)

1. Add records into the table for 10 students for Student ID, Student Name and marks in 6 subjects
using INSERT command.
2. Display the description of the fields in the table using DESC command.
3. Alter the table and calculate TOTAL and PERC_MARKS.
4. Compute the RESULT as “PASSP or “FAIL” by checking if the student has scored more than
35 marks in each subject.
5. List the contents of the table.
6. Retrieve all the records of the table.
7. Retrieve only ID_NO and S_NAME of all the students.
8. List the students who have result as “PASS”.
9. List the students who have result as “FAIL”.
10. Count the number of students who have passed.
11. Count the number of students who have failed.
12. List the students who have percentage greater than 60.
13. Sort the table according to the order of ID_NO.

Solution:
First we have to create the table CLASS using CREATE TABLE command.

1. Add records into the table for 10 students for Student ID, Student Name and marks in 6
subjects using INSERT command.
Structured query Language II PUC
SQL> INSERT INTO CLASS VALUES (1401, 'PAWAN', 56, 36, 56, 78, 44, 67);
SQL>INSERT INTO CLASS VALUES (1411, 'RAJESH', 100,100,96,100,100,100);
SQL>INSERT INTO CLASS VALUES (1412, 'KARAN', 60,30,45,45,36,49);
SQL>INSERT INTO CLASS VALUES (1403, 'SACHIN', 56,60,72,57,78,67);
SQL>INSERT INTO CLASS VALUES (1410, 'PRAKASH', 96,99,97,90,78,100);
SQL>INSERT INTO CLASS VALUES (1402, 'POOJA', 30,45,39,20,33,56);
SQL>INSERT INTO CLASS VALUES (1405, 'ASHWINI', 79,65,79,70,89,88);
SQL>INSERT INTO CLASS VALUES (1406, 'PRAJWAL', 100,90,100,89,90,100);
SQL>INSERT INTO CLASS VALUES (1404, 'BALU', 35,30,78,23,44,70);
SQL>INSERT INTO CLASS VALUES (1407, 'ESHWAR', 100,100,100,98,99,100);

2. Display the description of the fields in the table using DESC command.

3. Alter the table and calculate TOTAL and PERC_MARKS.

4. Compute the RESULT as “PASS” or “FAIL” by checking if the student has scored more
than 35 marks in each subject.

5. List the contents of the table.


Structured query Language II PUC
6. Retrieve all the records of the table.

7. Retrieve only ID_NO and S_NAME of all the students.

8. List the students who have result as “PASS”.

9. List the students who have result as “FAIL”.

10. Count the number of students who have passed.


Structured query Language II PUC
11. Count the number of students who have failed.

12. List the students who have percentage greater than 60.

13. Sort the table according to the order of ID_NO.


SECTION – C

ADVANCED HTML
Advanced HTML II PUC

PROGRAM 1:

Write a HTML program to create a CLASS Time Table.


<HTML>
<HEAD>
<TITLE> CLASS TIME TABLE </TITLE>
</HEAD>
<BODY >
<CENTER><H4> TIME TABLE 2022-23</H4>
<TABLE BORDER=10 CELLSPACING=2 CELLPADDING=15 bgcolor=lightblue>
<CAPTION> <B> II PUC PCMC/CEBA </B> </CAPTION>

<TR>
<TH> DAY </TH>
<TH> 9.20 - 10.20 </TH>
<TH> 10.20 - 11.20 </TH>
<TH> 11.20 - 11.30 </TH>
<TH> 11.30 - 12.30 </TH>
<TH> 12.30 - 1.30 </TH>
</TR>

<TR>
<TD> MONDAY </TD>
<TD> MATHS </TD>
<TD> PHYSICS </TD>
<TD ROWSPAN=3 ALIGN=”CENTER”>SHORT BREAK</TD>
<TD> CHEMISTRY </TD>
<TD> COMP SCI </TD>
</TR>

<TR>
<TD>TUESDAY</TD>
<TD> PHYSICS </TD>
<TD> MATHS </TD>
<TD> CHEMISTRY </TD>
<TD> ENGLISH </TD>
</TR>

<TR>
<TD> WEDNESDAY </TD>
<TD> COMP SCI </TD>
<TD> PHYSICS </TD>
<TD> MATHS </TD>
<TD> KANNADA </TD>
</TR>

</TABLE>
</CENTER>
</BODY>
</HTML>
Advanced HTML II PUC

PROGRAM 2:

HTML Program 2: Table and form

<HTML>
<HEAD>
<TITLE> ONLINE APPLICATION </TITLE>
</HEAD>
<BODY>
<CENTER>
<FORM NAME=”APPFORMPUC” METHOD=”POST”>
<H3> FIRST PUC APPLICATION FORM </H3>
<TABLE BORDER=5 BGCOLOR=LIGHTBLUE CELLSPACING=35>

<TR>
<TD ALIGN=LEFT>STUDENT NAME: </TD>
<TD><INPUT TYPE=”TEXT” NAME=”STUNAME”></TD>
</TR>

<TR>
<TD>UPLOAD PHOTO: </TD>
<TD><INPUT TYPE=FILE NAME=”PHOTO”></TD>
</TR>

<TR>
<TD>GENDER: </TD>
Advanced HTML II PUC

<TD><INPUT TYPE=RADIO NAME=GEN VALUE=”M”>MALE


<INPUT TYPE=RADIO NAME=GEN VALUE=”F”>FEMALE</TD>
</TR>
<TR>
<TD>BOARD PASSED:</TD>
<TD>
<SELECT>
<OPTION>SSLC</OPTION>
<OPTION>CBSE</OPTION>
<OPTION>ICSE</OPTION>
<OPTION>OTHER STATE</OPTION>
</SELECT>
</TD>
</TR>

<TR>
<TD>ADDRESS:</TD>
<TD><TEXTAREA></TEXTAREA></TD>
</TR>

<TR>
<TD>SUBJECT CHOOSEN: </TD>
<TD>
<INPUT TYPE=CHECKBOX>KANNADA
<INPUT TYPE=CHECKBOX>ENGLISH
<INPUT TYPE=CHECKBOX>PHYSICS
<INPUT TYPE=CHECKBOX>CHEMISTRY
</TD>
</TR>
<TR>
<TD></TD>
<TD><INPUT TYPE="SUBMIT" VALUE="SUBMIT">
<INPUT TYPE="RESET" VALUE="RESET"></TD>
</TR>

</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>
Advanced HTML II PUC

You might also like