0% found this document useful (0 votes)
5K views37 pages

Hsslive Model Computer App Practical Record Book

The document contains a summary of a student's practical work in computer applications. It includes an index listing programs completed in languages like C++, HTML, JavaScript and SQL. Examples of programs listed are checking if a number is positive, negative or zero in C++; designing a webpage for Kerala Tourism in HTML; and a SQL program on students. The document serves to document and certify the practical work done by the student for their course.
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)
5K views37 pages

Hsslive Model Computer App Practical Record Book

The document contains a summary of a student's practical work in computer applications. It includes an index listing programs completed in languages like C++, HTML, JavaScript and SQL. Examples of programs listed are checking if a number is positive, negative or zero in C++; designing a webpage for Kerala Tourism in HTML; and a SQL program on students. The document serves to document and certify the practical work done by the student for their course.
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/ 37

AKM HSS KOTTOOR


INDIANOOR PO, KOTTAKKAL VIA ,MALAPPURAM DT – 676503

COMPUTER APPLICATION
Practical Record Book
N ame : ………………………………………………….
Exam Reg No : ………………………………………………….




CERTIFICATE

This is to certify that this is a bonafide Record of Practical work done by
Mr/Miss/Mrs: _______________________________________, Reg No:________
______________for the Higher secondary Course in Commerce in the year ______
- _______.

Teacher in Charge

Exam Date:

External Examiner:






INDEX
SL N o N ame Date Remarks
C++
1 Check Number Positive ,Negative or Zero
2 Simple Interest
3 Area of Circle ,Rectangle, Triangle
4 Sum of Digits of Number
5 Multiplication Table of a Number
6 Sum of Squares of a Number
7 Length of String
8 Find Largest from three
9 Display digit name using switch
10 Factorial Using function
or Define a function to swap three variables
HTML & JAVASCRIPT
11 Kerala Tourism
12 Definition List of Nobel Prize Winners
13 Hyper Link
14 Table Class
15 Table Speed Limit
16 Frameset Sample
17 Login Form
18 Uppercase and Lowercase
19 Sum of Numbers
20 Capital of states
or Kerala Tourism List
SQL
21 SQL Student
22 SQL Employee
23 SQL Stock
24 SQL Bank
25 SQL Book


1.Aim: Program to check the given number is positive ,negative or zero

Procedure: (Coding)
#include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter a number";
cin>>n;
if(n>0)
cout<<"The number is positive";
else if(n<0)
cout<<"The number is negative";
else
cout<<"The number is Zero";
return 0;
}

Output

2.Aim: Input the principal amount, type of account (C for current a/c or S for SB a/c) and
number of years, and display the amount of interest. Rate of interest for current a/c is
8.5% and that of SB a/c is 6.5%.

Procedure:( Coding)
#include<iostream>
using namespace std;
int main( )
{
int p,n;
float i;
char type;
cout<<"Enter the Principle amount";
cin>>p;
cout<<"Enter the number of years";
cin>>n;
cout<<"Enter the type of account c for current or s for Savings Bank "<<"\n";
cin>>type;

if(type=='c')
i=p*n*8.5/100;
if(type=='s')
i=p*n*6.5/100;
cout<<"interest="<<i;

}
Output

3. Aim: Find the area of a rectangle, a circle and a triangle. Use switch statement for
selecting an Option from a menu.

Procedure:
#include<iostream>
using namespace std;

int main()
{
int ch,l,w,r,b,h;
float area;
cout<<"1.Area of Rectangle"<<"\n";
cout<<"2.Area of Circle"<<"\n";
cout<<"3.Area of Triangle"<<"\n";
cout<<"Enter your choice";
cin>>ch;
switch(ch)
{
case 1:
cout<<"Enter the Length and W idth";
cin>>l>>w;
area=l*w;
cout<<"Area of Rectangle="<<area;
break;
case 2:
cout<<"Enter the radius";
cin>>r;
area=3.14*r*r;
cout<<"Area of Circle="<<area;
break;
case 3:
cout<<"Enter the base and height";
cin>>b>>h;
area=0.5*b*h;
cout<<"Area of Triangle="<<area;
break;
default :
cout<<"Invalid Input";
}
}

Output

4. Aim: Program to Find the sum of the digits of an integer number.

Procedure:Coding
#include<iostream>
using namespace std;
int main()
{
int n,rem,s=0;
cout<<"Enter a digit";
cin>>n;
while(n>0)
{
rem=n%10;
s=s+rem;
n=n/10;
}
cout<<"Sum="<<s;
}

Output

5.Aim: Display the multiplication table of a number having 12 rows.

Procedure:Coding
#include<iostream>
using namespace std;
int main()
{
int n,i;
cout<<"Enter a number";
cin>>n;
for(i=1;i<=12;i++)
{
cout<<i<<"*"<<n<<"="<<n*i;
cout<<"\n";
}
}

Output

6. Aim: Find the sum of the squares of the first N natural numbers without using
any formula

Procedure:Coding
#include<iostream>
using namespace std;
int main()
{
int n,sum=0,i;
cout<<"Enter a digit";
cin>>n;
for(i=0;i<=n;i++)
{
sum=sum+i*i;
}
cout<<"Sum of the squares ="<<sum;
}

Output

7.Aim: Find the length of a string without using strlen() function

Procedure:Coding:
#include<iostream>
#include<cstdio>
using namespace std;
int main( )
{
char name[1000];
int count=0;
cout<<"Enter the String\n";
gets(name);
while(name[count]!='\0')
{
count ++;
}
cout<<"The length of the string is"<<count;

Output

8.Aim: Input three numbers and find the largest.

Procedure:Coding:

#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"Input three numbers and find largest\n";
cin>>a>>b>>c;
if (a>b && a>c)
{
cout<<a<<" is largest";
}
else if(b>a && b>c)
{
cout<<b<<" is largest";
}
else
{
cout<<c<<" is largest";
}
}

Output
Input three numbers and find largest
54
86
67

86 is largest

9.Aim: Input a digit and display the corresponding word using switch

Procedure:Coding:
#include <iostream>
using namespace std;
int main()
{
int d;
cout<<"Input a digit and display word using switch\n";
cin>>d;
switch (d)
{
case 0:
cout<<"Zero"; break;
case 1:
cout<<"One"; break;
case 2:
cout<<"Two"; break;
case 3:
cout<<"Three"; break;
case 4:
cout<<"Four"; break;
case 5:
cout<<"Five"; break;
case 6:
cout<<"Six"; break;
case 7:
cout<<"Seven"; break;
case 8:
cout<<"Eight"; break;
case 9:
cout<<"Nine"; break;
default:
cout<<"Not a digit";
}
}

Output
Input a digit and display the corresponding word using switch
5
Five

10.Aim: Find the factorial of a number with the help of a user-defined function.

Procedure:Coding:
#include <iostream>
using namespace std;
double fact(int n)
{
int i,f=1;

for(i=1;i<=n;i++)
{
f=f*i;
}
return f;
}

int main()
{
int n;
cout<<"Input a number\n";
cin>>n;
cout<<" factorial of "<<n<<" = "<< fact(n);

Output
Input a number
7
factorial of 7 = 5040

Or .Aim: Define a function to swap the contents of three variables

Procedure:Coding:
#include<iostream>
using namespace std;
void swap(int x,int y,int z)
{
int t;
t=x;
x=y;
y=z;
z=t;
cout<<"\n The values of x,y and z are :";
cout<<x<<"\t"<<y<<"\t"<<z;
}

int main( )
{
int a,b,c;
cout<<"Enter the values of a,b,c";
cin>>a>>b>>c;
cout<<"The values of a,b,c are :";
cout<<a<<"\t"<<b<<"\t"<<c;
swap(a,b,c);

Output

Aim : Design a simple and attractive webpage for Kerala Tourism.It should contain
features like background/image,heading,text formatting and font tags,images,etc.

Procedure:
<HTML>
<HEAD>
<TITLE>KeralaTourism</TITLE>
</HEAD>
<CENTER>
<BODY background="kerala.jpg">
</CENTER>
<font face=arial>
<B>Kerala at a Glance</B>
<I>Kerala, India's most advanced society: <BR>With hundred percent literacy.<BR>
World-class health care systems. <BR>India's lowest infant mortality and
Highest life expectancy rates.<BR> The highest physical quality of life in India. Peaceful
And pristine,Kerala is India's cleanest state.
</I>
<BR><BR>
<IMG Src="logo.jpg">
<BR><BR><BR>
<U>
Tourist Destinations
</U>
<BR>
<BR>
<IMG Src="boat.jpg">
<IMG Src="houseboat.jpg">
<IMG Src="kathakali.jpg">
<IMG Src="wild.jpg">
<BR>
</BODY>
</HTML>

Output

2.AIM: Design a web page as shown below using appropriate list tags

<HTML>
<HEAD>
<TITLE>List of Nobel Laureates from India</TITLE>
</HEAD>
<BODY >
<CENTER><B>
List of Nobel Laureates fromIndia
</B>
</CENTER>

<BR>
<DT><B>Rabindra Nath Tagore</B></DT>
<D D >
He was the first to get Nobel Prize from India. He received
prizeinliterature in 1921. He got Nobel Prize for his collection
ofpoems“Gitanjali”.
</DD>
<BR><BR>
<DT><B>C V Raman</B></DT>
<D D >
He got Nobel for Physics in 1930. He received Nobel Prize

forhiscontribution called RamanEffect.
<BR><BR>
</DD>
<DT><B>Mother Teresa</B></DT>
<D D >
Mother Teresa who founded Missionaries of Charity which isactive
in more than 100 countries received Nobel Prize in1979.
</DD>
<BR><BR>
<DT><B>Amartya Sen</B></DT>
<D D >
Amartya Sen was awarded Nobel Prize in 1998 in Economics. Hehas
made contributions to welfare economics, social choice theoryetc.
</DD>
<BR><BR>
<DT><B>Kailash Satyarthi</B></DT>
<D D >
He is a child right activist who founded “Bachpan BachaoAndolan”
in 1980. He shared Nobel prize for peace in2014.
</DD>
</BODY>
</HTML>

3. AIM: Design a simple webpage about your school.Create another webpage named
address.html containing the school address.Give link from school page to address.htm.

Procedure

School.html
<HTML>
<HEAD>
<TITLE>MY SCHOOL</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>AKM HSS KOTTOOR</H1><BR><BR>
<B>My SCHOOL is AKM Higher Secondary School,Panikkar Kundu,Indianoor PO,My School Contains about 4500
students studying from 5th to Plus Two</B><BR>
<H 2 >
<A Href="ADDRESS.HTM">About</A> </H2>
<BR>
<IMG Src="SCHOOL.JPG">
<BR><BR>

</CENTER>
</BODY>
</HTML

Address.html
<HTML>
<HEAD>
<TITLE>ADDRESS</TITLE>
</HEAD>
<BODY bgcolor=yellow>
<CENTER>
<B>ABOUT</B>
<BR>
<H 2 >
AKM HSS KOTTOOR<BR>
INDIANOOR PO<BR>
KOTTOOR<BR>
MAL APPURAM DT<BR>
KERAL A 676503<BR>
</H2>
</CENTER>
</BODY>
</HTML>


4. AIM: . Design the following table using HTML

<HTML>
<HEAD>
<TITLE>SCHOOL</TITLE>
</HEAD>
<BODY>
<TABLE BORDER="1">
<TR>
<TH ROWSPAN="2">Class</TH>
<TH colspan="3">Strength</TH>
</TR>
<TR>
<TH>Science</TH>
<TH>Commerce</TH>
<TH>Humanities</TH>
</TR>
<TR>
<TH>PlusOne</TH>
<TD>49</TD>
<TD>50</TD>
<TD>48</TD>
</TR>
<TR>
<TH>PlusTwo</TH>
<TD>50</TD>
<TD>50</TD>
<TD>49</TD>
</TR>
</TABLE>
</BODY>
</HTML>

5.AIM: Design a web page containing a table as shown below

<HTML>
<HEAD>
<TITLE>Speed_Limit</TITLE>
</HEAD>
<BODY>
<TABLE BORDER="1">
<CAPTION><B>Speed Limits in Kerala</B></CAPTION>
<TR>
<TH> Vehicles </TH>
<TH > Near School<BR> (In Km/hour) </TH>
<TH> Within Corporation/<BR> Municipality<BR> (In Km/hour) </TH>
<TH > In other<BR> roads<BR> (In Km/hour) </TH>
</TR>

<TR>
<TH >Motor Cycle</TH>
<TH>25</TH>
<TH>40</TH>
<TH>50</TH>
</TR>
<TR>
<TH >Motor Car</TH>
<TH>25</TH>
<TH>40</TH>
<TH>70</TH>
</TR>
<TR>
<TH >Light motor vehicles</TH>
<TH>25</TH>
<TH>40</TH>
<TH>60</TH>
</TR>
<TR>
<TH >Heavy motor vehicles</TH>
<TH>15</TH>
<TH>35</TH>
<TH>60</TH>
</TR>
</TABLE>
</BODY>
</HTML>

6.AIM: Design a webpage containing frames that divide the screen vertically in the
ratio 50:50.Design two web pages –one containing the list of indian cricket team
members and the second containing a list of Indian football team members.

frame.html

<HTML>
<HEAD>
<TITLE>Team_List</TITLE>
</HEAD>
<FRAMESET Cols=50%,50%>
<FRAME SRC="Cricket.html">
<FRAME SRC="Football.html">
</FRAMESET>
</HTML>

Cricket.html

<HTML>
<HEAD>
<TITLE>Cricket Team</TITLE>
</HEAD>
<body>
<h2><u>Cricket Team</u><br>
Sachin Tendulkar<br>
Rahul Dravid<br>
Dhoni<br>
Sreeshanth<br>
Ganguly<br>
</HTML>

Football.html

<HTML>
<HEAD>
<TITLE>Football Team</TITLE>
</HEAD><body>
<h2><u>Football Team</u><br>
Lionel Messi<br>
Naimer<br>
Ronaldo<br>
Ronaldinho<br>
Maradonna<br>
</HTML>




7.Aim : Design a simple webpage as shown below:

<HTML>
<HEAD>
<TITLE>LOGIN</TITLE>
</HEAD>
<BODY>

<FORM>
<FIELDSET>

Client Login
<B R >
Enter User Name : <INPUT Type="Text"> <br>
<B R >
Enter Your Password <INPUT Type="Password">
<B R >
<INPUT Type="Submit" value="SUBMIT">
<INPUT Type="Reset" value="CLEAR">
</FIELDSET>
</FORM>
</BODY>
</HTML>

8.AIM: A webpage should contain one text box for entering a text.There should be two buttons
labelled “To Upper Case “ and “To Lower Case” .On clicking each button,the content in
the text box should be converted to upper case or lower case accordingly .Write the
required JavaScript for these operations

PROCEDURE
<HTML>
<HEAD>
<TITLE>String Convertion</TITLE>
<SCRIPT Language="JavaScript">
function upper()
{
var a,b;
a=document.frmconvert.text1.value;
b=a.toUpperCase();
document.frmconvert.text1.value=b;
}

function lower()
{
var a,b;
a=document.frmconvert.text1.value;
b=a.toLowerCase();
document.frmconvert.text1.value=b;
}
</SCRIPT>
</HEAD>

<BODY>
<FORM Name="frmconvert">
<CENTER>
Enter theString: <INPUT Type="text" Name="text1">

<BR><BR>
<INPUT Type="button" value="To Upper Case" onClick="upper()">
<INPUT Type="button" value="To Lower Case" onClick="lower()">
</CENTER>
</FORM>
</BODY>
</HTML>

9.Develop a webpage with two text boxes and a button labelled “Show”.The user can enter
a number in the first text box.On clicking the button,the second text box should display the
sum of all numbers up to the given number.Write the required JavaScript

<HTML>
<HEAD>
<TITLE>Sum</TITLE>
<SCRIPT Language="JavaScript">
function sum()
{
var sum=0,i,limit;
limit=Number(document.frmsum.txtlimit.value);

for(i=1;i<=limit;i++)
{
sum=sum+i;
}
document.frmsum.txtsum.value=sum;
}
</SCRIPT>

</HEAD>
<BODY>
<FORM Name="frmsum">
<CENTER>
Enter thelimit: <INPUT Type="text" Name="txtlimit"> <BR><BR>
Sum of numbers : <INPUT Type="text" name="txtsum">
< B R >< B R >
<INPUT Type="button" value="Sum" onClick="sum()">
</CENTER>
</FORM>
</BODY>
</HTML>

10. AIM : Develop a webpage to find the capital of Indian States.The page should contain a
dropdown list from which the user can select a state.On clicking the show button,the web
page should display the capital of the state in another text box.Write the required
JavaScript.

PROCEDURE
<HTML>
<HEAD>
<TITLE>Capital OfStates</TITLE>
<SCRIPT Language="JavaScript">
function Capital()
{
var n,answer;
n=document.frmCapital.cboState.selectedIndex;

switch(n)
{
case 0:
answer="Thiruvananthapuram";break;
case 1:
answer="Bengaluru";break;
case 2:
answer="Chennai";break;
case 3:
answer="Mumbai";break;
}
document.frmCapital.txtCapital.value=answer;
}
</SCRIPT>
</HEAD>
<FORM Name="frmCapital">
<CENTER>State:
<SELECT Name="cboState">
<OPTION>Kerala</OPTION>
<OPTION>Karnataka</OPTION>
<OPTION>Tamilnadu</OPTION>
<OPTION>Maharashtra</OPTION>
</SELECT>
< B R >< B R >
Capital:
<INPUT Type="Text" Name="txtCapital">
< B R >< B R >
<INPUT Type="Button" value="Show" onClick="Capital()">
</CENTER>
</FORM>
</BODY>
</HTML>

Or Qn: AIM: Design the following webpage about kerala tourism using List tags

PROCDURE

<HTML>
<HEAD> <TITLE> Kerala Tourism</TITLE> </HEAD>
<BODY>
<CENTER>
<H1> Department of Tourism </H1>
<H2> Kerala State </H2>
</CENTER>
<I><B> Tourist attractions in Kerela </I> </B><BR>
<OL>
<LI> Beaches
<OL Type="a">
<LI>Kovalam Beach
<LI>Muzhuppilngad
<LI>Kappad
</OL>
<LI> Hill Station
<OL type="i">
<LI>Munnar
<LI>Wayanad
<LI>Gavi
</OL>
<LI> Wild Life
<OL type="a">
<LI>Iravikulam
<LI>Muthanga
<LI>Kadalundi
</OL>
</UL>
</BODY></HTML>


1. Create a table Student with the following fields and insert at least 5
records into the table except for the column Total.

Roll_Number Integer Primary key


Name Varchar (25)
Batch Varchar (15)
Mark1 Integer
Mark2 Integer
Mark3 Integer
Total Integer

a. Update the column Total with the sum of Mark1, Mark2 and
Mark3.
b. List the details of students in Commerce batch.
c. Display the name and total marks of students who are failed (Total< 90).
d. Display the name and batch of those students who scored 90 or more in Mark1 and
Mark2.
e. Delete the student who scored below 30 in Mark3

PROCEDURE

create table student(r oll_number integer primary key, name v a r char(25),


batch varchar(25),mark1 integer, mark2 integer, mark3 integer, total integer);

insert into student values (1,'abi', ‘science’,60, 70, 25,null);


insert into student values (2,'benny ', ‘science’,70, 60, 55,null );
insert into student values (3,'aneesh', ‘commerce’, 70, 60, 40,null);
insert into student values (4,'anson', ‘commerce’,40, 80, 50,null);
insert into student values (5,'sulthan', ‘science’, 90, 94, 35,null);

update student set total=mark1+mark2+mark3;

select * from student where batch=’commerce’;

select name,total from student where total<90;

select name,batch from student where mark1>90 and mark2>90;

delete from student where mark3<30



2. Create a table Employee with the following fields and insert at least 5 records into the table
except the column Gross_pay and DA.

Emp_code Integer Primary key


Emp_name Varchar (20)
Designation Varchar (25)
Department Varchar (25)
Basic Decimal (10,2)
DA Decimal (10,2)
Gross_pay Decimal (10,2)

a) Update DA with 75% of Basic.


b) Display the details of employees in Purchase, Sales and HR
departments.
c) Update the Gross_pay with the sum of Basic and DA.
d) Display the details of employee with gross pay below 10000.
e) Delete all the clerks from the table.

PROCEDURE

create table employee(Emp_code Int Primary key,Emp_name Varchar(20),Designation Varchar(25)
,Department Varchar(25),Basic Dec(10,2),DA Dec(10,2),Gross_pay Dec(10,2));

insert into employee values(1001,'ARUN','CLERK','SALES',12000.00,NULL,NULL)


insert i nt o employee values(1002,'BIJU','Clerk','ACCOUNTS',16000.00,NULL,NULL)
insert i nt o employee values(1005,'SUNU','Peon','PURCHASE',16000.00,NULL,NULL)
insert into employee values(1042,'BINU','Accountant','ACCOUNTS',16000.00,NULL,NULL)
insert into employee values(1702,'ANU','Manager',' HR ',16000.00,NULL,NULL)

update employee set DA=Basic*75/100;

select * from employee where Department in('Purchase', 'Sales','HR');

update employee set Gross_pay=Basic+DA;

select * from employee where Gross_pay<10000;

delete from employee where Designation='Clerk';



3. Create a table Stock, which stores daily sales of items in a shop, with
the following fields and insert at least 10 records into the table.

Item_code Integer Primary key


Item_name Varchar (20)
Manufacturer_Code Varchar (5)
Qty Integer
Unit_Price Decimal (10,2)
Exp_Date Date

a. Display the details of items which expire after 31/3/2016 in the


order of expiry date.
b. Find the number of items manufactured by the company "SATA".
c. Remove the items which expire between 31/12/2015 and 01/06/
2016.
d. Add a new column named Reorder in the table to store the reorder
level of items.

e. Update the column Reorder with value obtained by deducting


10% of the current stock.

PROCEDURE
create table stock(Item_code Integer Primary key,Item_name archar(20),Manufacturer_Code
Varchar(5),Qty Int,Unit_Price Decimal(10,2),Exp_Date Date);

insert into stock values(110,'Washing Machine','LG',124,9300,'2018/01/01');


insert i nt o stock values(120,'Mobile Phone','LG',14,12300,'2016/01/01');
insert into stock values(143,'Projector','SATA',84,22300,'2018/06/01');
insert into stock values(243,'TV','Samsung',34,12300,'2016/01/06');
insert into stock values(123,'DVD','Onida',34,2900,'2016/06/01');

select * from stock where Exp_Date<'2016/3/31' order by Exp_Date;

select count(Item_name) from stock where Manufacturer_Code='SATA'


.
delete from stock where Exp_Date between '2015/12/31' and '2016/06/01';

alter table stock add Reorder int;

update stock set reorder=Qty-Qty*10/100;


4. Create a table Bank with the following fields and insert at least 5
records into the table.

Acc_No Integer Primary key


Acc_Name Varchar (20)
Branch_Name Varchar (25)
Acc_ Type Varchar (10)
Amount Decimal (10,2)

a. Display the branch-wise details of account holders in the


ascending order of the amount.
b. Insert a new column named Minimum_Amount into the table with default value
1000.
c. Update the Minimum_Amount column with the value 1000 for
the customers in branches other than Alappuzha and Malappuram.
d. Find the number of customers who do not have the minimum
amount 1000.
e. Remove the details of SB accounts from Thiruvananthapuram
branch who have zero (0) balance in their account.

PROCEDURE

create table Bank(Acc_No int primary key,Acc_Name varchar(20),Branch_Name


varchar(25),Acc_Type varchar(10),Amount dec(10,2));

insert i nt o Bank values(1234,'Joy','Thirur','SB',25430);


insert i nt o Bank values(134,'John','Malappuram','CB',29930);
insert i nt o Bank values(1214,'Abi','Alappuzha','SB',99430);
insert into Bank values(224,'Jobi','Malappuram','SB',23430);
insert into Bank values(1334,'Abilash','Calicut','CB',45470);
insert into Bank values(1654,'Rahma','Thrissur','SB',66440);

select * from bank order by branch_name,amount asc;

alter table bank add Minimum_Amount int default 1000;

update bank set Minimum_amount=1000 where Branch_Name not in ('Alappuzha','Malappuram');

select count(Acc_Name) from bank where Amount<1000;


Delete from bank where Acc_Type='SB' and Branch_Name='Thiruvananthapuram' and Amount=0;

5. Create a table Book with the following fields and insert at least 5
records into the table.

Book_ID Integer Primary key


Book_Name Varchar (20)
Author_Name Varchar (25)
Pub_Name Varchar (25)
Price Decimal (10,2)

Create a view containing the details of books published by SCERT


Display the average price of books published by each publisher
Display the details of book with the highest price.
Display the publisher and number of books of each publisher in
the descending order of the count.
Display the title, current price and the price after a discount of
10% in the alphabetical order of book title.

PROCEDURES

create table book(bookid int primary key,bookname varchar(20),Authorname


varchar(25),pub_name varchar(25),price dec(10,2));

insert into book(145,'Aadu jeevitham','benyamin','manorama',315);


insert into book(165,'Plus 2 BS','DIRECTOR','SCERT',195);
insert i nt o book(135,'AgniChirakukal,'Abdul Kalam','DC Books',157);
insert i nt o book(145,'Accountancy XII','DIRECTOR','SCERT',295);
insert into book(155,’English XII,'DIRECTOR','SCERT',105);
insert into book(185,’AATHMAKATHA’,’Aravindan’,’DC Books’,202);

create view sbooks as select * from book where pub_name='SCERT';

select avg(price) from book group by pub_name;

select pub_name,count(*) from book group by pub_name order by count(*) desc;

update book set price=price-(price*10/100);


select bookname,price from book order by bookname;

Or
select bookname,price*10/100 from book order by bookname;

TCA GAFOOR
HSST Computer Application

9847995577

You might also like