2nd-Puc-Lab-Manual-Section B and C-1
2nd-Puc-Lab-Manual-Section B and C-1
STRUCTURED QUERY
LANGUAGE (SQL)
Structured query Language II PUC
PROGRAM 1:
Solution:
First we have to create the table EBILL using CREATE TABLE command.
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
PROGRAM 2:
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.
4. Compute the RESULT as “PASS” or “FAIL” by checking if the student has scored more
than 35 marks in each subject.
12. List the students who have percentage greater than 60.
ADVANCED HTML
Advanced HTML II PUC
PROGRAM 1:
<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>
<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
<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