0% found this document useful (0 votes)
23 views71 pages

Priyanka Final Project

Uploaded by

12dcsbest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views71 pages

Priyanka Final Project

Uploaded by

12dcsbest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 71

JAIN INTERNATIONAL RESIDENTIAL SCHOOL

KANAKAPURA, KARNATAKA

PRACTICAL FILE

For
AISSCE 2025 Examination
[As a part of the Computer Science Course (083)]

SUBMITTED BY
PRIYANKA LATH
JAIN INTERNATIONAL RESIDENTIAL SCHOOL
KANAKAPURA, KARNATAKA

This is to certify that miss PRIYANKA LATH of class XII D has

satisfactorily completed the course of programs in practical

Session 2024-25 in partial fulfilment of CBSE’s AISSCE

Examination 2025.

Name: PRIYANKA LATH


Reg No.: ……………………………

………………………… ……………………………..
Signature of External Examiner Signature of Internal Examiner

Signature of Principal ………………….


Place: JAKKASANDRA
Date: ……………..

CONTENTS
SL.No Date Name Of Program Page Remarks
No.
1 10 – 6 – 22 RANDOM NUMBER 1
GENERATOR

2 20-6-22 PHONE BOOK USING 2-6


DICTIONARY

3 30-6-22 INDEX OF NON ZERO 7


NUMBERS

4 6-7-22 AREA OF SHAPES USING 8-12


MODULES

5 13-7-22 TEXT FILE -I 13

6 20-7-22 TEXT FILE -II 14-15

7 3-8-22 TEXT FILE- III 16-17

8 10-8-22 TEXT FILE- IV 18

9 17-8-22 BINARY FILE - I 19-20

10 24-8-22 BINARY FILE - II 21-23

11 31-8-22 CSV FILE - I 24-26

12 7-9-22 CSV FILE - II 27-29

13 14-9-22 STRING PALINDROME - 30


USING STACK

14 21-9-22 APPLICATION OF STACK – TO 31-32


STORE NOVOWEL WORDS

15 28-9-22 DATA STRUCTURE - STACK 33-36


16 6-10-22 LINEAR SEARCH 37

17 19-10-22 DATABASE CONNECTIVITY-I 38-40

18 26 - 10-22 DATABASE CONNECTIVITY-II 41-43

19 16-11-22 DATABASE CONNECTIVITY-III 44-45

20 23-11-22 DATABASE CONNECTIVITY-IV 46

21 1-12-22 MYSQL SET -I 47-51

22 5-12-22 MYSQL SET -II 52-57

23 8-12-22 MYSQL SET -III 58-62

24 14-12-22 MYSQL SET -IV 63-66

25 15-12-22 MYSQL SET-V 67-70

PYTHON PROGRAMS
>>PROGRAM 1
AIM: Write a program to enter two numbers and print the sum,
difference, product and quotient of the two numbers.

SOURCE CODE:
a=int(input("enter the 1st no"))
b=int(input("enter the 2nd no"))
p=a*b
s=a+b
d=a-b
q=a/b
print("the product:",p,"the sum:",s,"the difference:",d,"the quotient:",q)
OUTPUT:
enter the 1st no20
enter the 2nd no5
the product: 100 the sum: 25 the difference: 15 the quotient: 4.0
>>PROGRAM 2
AIM: Write a program to accept a number and print if the number is an
Armstrong number or not.

SOURCE CODE:
a=int(input("enter the number:"))
s=0
l=len(str(a))
t=a
while t>0:
b=t%10
s+=b**l
t//=10
if a==s:
print("the no is armstrong no”)
else:
print(“the no is not Armstrong no”)
OUTPUT:
enter the number:153
the no is armstrong n0
>>PROGRAM 3
AIM:Write a program to accept a number and print if the number is a
prime number or not.

SOURCE CODE:
a=int(input("enter the number"))
if a==2:
print("the number is prime")
elif a%2==0:
print("the no is prime")
else:
print("the no is prime no")
OUTPUT:
enter the number40
the no is prime

>>PROGRAM 4
AIM:Write a program to create a function factorial to accept a number
and print the factorial of the number.
SOURCE CODE:
def factorial():
p=1
a=int(input("enter the no:"))
for i in range(1,a+1):
p=p*i
print(p)
factorial()
OUTPUT:
enter the no:5
120
factorial()
>>PROGRAM 5
AIM:Write a program to create a function words to accept a string and
print the number of words in the string, function palindrome to
print if the string is palindrome and function count to count the
occurrence of the letter ‘T’ in the string.

SOURCE CODE:
def stringop():
sum=1
x=0
a=input(“enter the string:”)
for i in range(0,len(a)):
if(a[i]==” “):
sum+=1
if(a[i]==”t”):
x+=1
if(a[::-1]==a):
z=”palindrome”
else:
z=”not palindrome”
return(sum,x,z)
a1,b1,c1=stringop()
print(“the number of words=”,a1)
print(“the number of t’s=”,b1)
print(c1)
OUTPUT:
enter the string: prasun the great gamer
the number of words= 5
the number of t’s= 2
not palindrome
>>PROGRAM 6
AIM: 6. A Program to enter a list of elements and pass the list to a
function and display the elements and index of the non-zero
elements.

SOURCE CODE:
def index_list(l):
t=[]
for i in range(0,len(l)):
if l[i]!=0:
t.append(i)
return(t)
d=eval(input(“enter”))
print(index_list(d))
OUTPUT:
enter[10,2,3,22,50]
[0, 1, 2, 3, 4]
>>PROGRAM 7
AIM: A program to find area of different shapes using user defined
functions.

SOURCE CODE:
choice="yes"
def circle():
r=int(input("enter the radius"))
print("area=",r**2)
def rectangle():
l=int(input("enter the length"))
b=int(input("enter the breadth"))
print("area=",l*b)
def square():
s=int(input("enter the side"))
print("area",s**2)
def triangle():
h=int(input("enter the height"))
b=int(input("enter the base"))
print("area=",1/2*b*h)
while(choice=="yes"):
print("1.area of circle")
print("2.area of rectangle")
print("3.area of square")
print("4.area of triangle")
choice1=int(input("enter:"))
if choice1==1:
circle()
if choice1==2:
rectangle()
if choice1==3:
square()
if choice1==4:
triangle()
choice=input("do you want to continue(yes/no)")
OUTPUT:
1.area of circle
2.area of rectangle
3.area of square
4.area of triangle
enter:2
enter the length12
enter the breadth14
area 168
do you want to continue(yes/no)no

>>PROGRAM 8
AIM: A program to read a text file line by line and display each word
separated by a #.
SOURCE CODE:
y=open(r'C:\Users\students\Desktop\nike.txt','r')
x=y.read()
z=x.split()
for i in z :
print(i,end='#')
OUTPUT:
Nike’s#inception#in#the#1950s#was#driven#by#track#coach#Bill#Bowerm
an's#quest#for#superior#running#shoe#designs,#facing#initial#challenges#in#
securing#manufacturing#partners#
>>PROGRAM 9
AIM: Read a text file and display the number of
vowels/consonants/capital and small letters.
SOURCE CODE:
y=open(r'C:\Users\students\Desktop\cs.txt',"r")
x=y.read()
v=0
c=0
l=0
u=0
for i in x :
if i >= 'a' and i<= 'z' :
l=l+1
elif i in ('a','e','i','o','u') :
v=v+1
elif i >= 'A' and i<='Z':
u=u+1
print(l)
print(v)
print(u)
OUTPUT:
168
0
3
>>PROGRAM 10
AIM: A program to remove all the lines that contain the character ‘a’ in a file
and write it to another file.
SOURCE CODE:
k=[]
y=open(r'C:\Users\students\Desktop\nike.txt',"r")
z=open(r"C:\Users\students\Desktop\newfile.txt","w")
x=y.readlines()
for i in x :
if 'a' not in i :
k.append(i)
z.writelines(k)
z.close()
OUTPUT:

>>PROGRAM 11
AIM: A Program to read a text file and count the number of
occurrence of a word in the text file.
SOURCE CODE:
y=open(r'C:\Users\students\Desktop\nike.txt',"r")
a=input("enter the word:")
x=y.read()
c=x.split()
s=0
for i in c:
if i==a:
s=s+1
print("the occurence of the word",a,"is",s)
OUTPUT
enter the word:in
the occurence of the word in is 2
>>PROGRAM 12
AIM: Create a binary file with roll number and name. Input a roll
number and search the student with a specific roll number and
display the details.

SOURCE CODE:
import pickle
l=[]
def writing():
y=open("stu.dat","wb")
for i in range(1,3):
n=int(input("roll no"))
na=input("name")
l.append([n,na])
pickle.dump(l,y)
y.close()
def reading():
y=open("stu.dat","rb+")
n=int(input("roll no"))
p=y.tell()
a=pickle.load(y)
na=input("name")
for i in a:
if(i[0]==n):
print i[0]
print i[1]
y.close()
def display():
y=open("stu.dat","rb+")
a1=pickle.load(y)
print(a1)
writing()
reading()
display()
OUTPUT:
roll no1234
nameprasun
roll no2345
nameshriram
roll no1235
namepratibha
[[1234, 'prasun '], [2345, 'shriram']]
>>PROGRAM 13

AIM: Write a program to create a binary file with roll number,


name and marks. Input a roll number and update the marks.
SOURCE CODE:
import pickle
l=[]
def wr():
y=open("binary13.dat","wb")
for i in range(0,2):
na = input("enter the name:")
roll=int(input("enter the roll no:"))
ma=int(input("enter the marks"))
l.append([na,roll,ma])
pickle.dump(l,y)
y.close()
def read():
y=open("binary13.dat","rb+")
roll=int(input("enter the roll no of the person whose marks is to be
edited:'"))
a=pickle.load(y)
ma=int(input("enter the marks"))
for i in a:
if i[0]==roll:
i[2]=ma
y.close()
def display():
y=open("binary13.dat","rb+")
a1=pickle.load(y)
print(a1)
wr()
read()
display()
OUTPUT:
enter the name:pri
enter the roll no:123
enter the marks55
enter the name:pra
enter the roll no:124
enter the marks60
enter the roll no of the person whose marks is to be edited:'123
enter the marks70
[['pri', 123, 70], ['pra', 124, 60]]
>>PROGRAM 14

AIM: Program to create the csv file which should contains the
employee details and to search the particular employee based on
emp no and display the details.
SOURCE CODE:
import csv
def addrec():
with open('cs.csv','w',newline='') as f:
b=csv.writer(f)
b.writerow(['UserID','Password'])
ans='y'
while ans in 'Yy':
print('Enter Login Details:')
uID=input("Enter the UserID:")
p=input("Enter the Password :")
b.writerow([uID,p])
ans=input("Do you want to add another record(y/n):")
print("record stored")
def searchrec():
with open('cs.csv','r') as f:
b=csv.reader(f)
ans='y'
while ans in 'Yy':
found=False
uID=input('Enter the UserID which you want to search:')
for r in b:
if str(uID)==str(r[0]):
print("User ID:",r[0],'\nPassword :',r[1])
found=True
break
if found==False:
print('Record not found')
ans=input("Do you want to search another record(y/n):")
addrec()
searchrec()
OUTPUT:
Enter Login Details:
Enter the UserID:3333
Enter the Password :1234
Do you want to add another record(y/n):n
record stored
Enter the UserID which you want to search:3333
User ID: 3333
Password : 1234
Do you want to search another record(y/n):n
>>PROGRAM 15
AIM: Program to create the csv file which should contains the employee
details and to search the particular employee based on emp no and display
the details.
SOURCE CODE:
import csv
def addrec():
with open('login.csv','w',newline='') as f:
b=csv.writer(f)
b.writerow(['UserID','Password'])
ans='y'
while ans in 'Yy':
print('Enter Login Details:')
uID=input("Enter the UserID:")
p=input("Enter the Password :")
b.writerow([uID,p])
ans=input("Do you want to add another record(y/n):")
print("record stored")
def searchrec():
with open('login.csv','r') as f:
b=csv.reader(f)
ans='y'
while ans in 'Yy':
found=False
uID=input('Enter the UserID which you want to search:')
for r in b:
if str(uID) in r:
print("User ID:",r[0],'\nPassword :',r[1])
found=True
break
if found==False:
print('Record not found')
ans=input("Do you want to search another record(y/n):")
addrec()
searchrec()
OUTPUT:
Enter employ details:
Enter the emp no:1525
Enter emp name :piriyanka attitude
Enter emp salary:10
Do you want to add another record(y/n):y
Enter employ details:
Enter the emp no:1234
Enter emp name :prasun
Enter emp salary:100000000
Do you want to add another record(y/n):n
record stored
Enter the emp no which you want to search:1525
Emp no: 1525
Emp name : piriyanka attitude
Emp salary: 10
Do you want to search another record(y/n):n

>>PROGRAM 16
AIM: A program to implement the concept of stack.
SOURCE CODE:
l=[]
def push():
n=int(input("enter"))
l.append(n)
print(l)
def pop():
if l==[] or len(l) == 0:
print('stack empty')
else:
l.pop()
def disp():
if l==[]:
print('the stack is empty')
else:
print(l[::-1])
def peak():
if l==[]:
print("stack empty")
else:
print(l[-1])
choice = 'yes'
while choice == 'yes':
print('1.push')
print('2.pop')
print('3.display')
print('4.peak')
choice1 = input('enter the choice')
if choice1 == '1':
push()
elif choice1 == '2':
pop()
elif choice1 == '3':
disp()
elif choice1 == '4':
peak()
choice = input('do you want to continue')
OUTPUT:
1.push
2.pop
3.display
4.peak
enter the choice1
enter11
[11]
do you want to continueno
>>PROGRAM 17
AIM: A Program to create a product table and insert and display
data.
SOURCE CODE:
import mysql.connector as dd
y=
dd.connect(host="localhost",user="root",password="jirs",charset="u
tf8",database="school")
x=y.cursor()
def ins():
for i in range(0,3):
pid=int(input("id of the product "))
pname=input("name of product")
price=input("price")
c="insert into product values(%s,%s,%s);"
t=(pid,pname,price)
x.execute(c,t)
y.commit()
def display():
q="select * from product where pid = 12;"
x.execute(q)
for i in x :
print(i)
ins()
display()
OUTPUT:
id of the product 12
name of productpen
price100
id of the product 11
name of productpencil
price50
id of the product 13
name of productbook
price300
(12, 'pen', 100)
>>PROGRAM 18
AIM: A Program to update and display the data after modifying
table.
SOURCE CODE:
import mysql.connector as dd
y=dd.connect(host="localhost",user="root",password="jirs",charset=
"utf8",database="school")
x=y.cursor()
def update1 ():
pid=int(input('pid:'))
pname=input('pname:')
price=input('price:')
q="update product set price = %s,pname = %s where pid = %s ;"
t=(price,pname,pid)
x.execute(q,t)
y.commit()
def display():
q="select * from product ;"
x.execute(q)
for i in x :
print(i)
update1()
display()
OUTPUT:
pid:12
pname:pens
price:1000
(12, 'pens', 1000)
(11, 'pencil', 50)
(13, 'book', 300)
>>PROGRAM 19
AIM: A Program to display the table then delete a certain row from
the table.

SOURCE CODE:

import mysql.connector as dd
y=
dd.connect(host="localhost",user="root",password="jirs",charset="u
tf8",database="school")
x=y.cursor()
def delete1():
pid=int(input("enter the product id:"))
q="delete from product where pid=%s;"
t=(pid,)
x.execute(q,t)
y.commit()
def display():
q="select * from product;"
x.execute(q)
for i in x :
print(i)
display()
delete1()
display()
OUTPUT:
(12, 'pens', 1000)
(11, 'pencil', 50)
(13, 'book', 300)
enter the product id:11
(12, 'pens', 1000)
(13, 'book', 300)

>>PROGRAM 20
AIM: A Program to display the records of the products if the price is
more than 1000.

SOURCE CODE:

import mysql.connector as dd
y=dd.connect(host="localhost",user="root",password="jirs",charset=
"utf8",database="school")
x=y.cursor()
def disp2():
q="select * from product where price >= 1000;"
x.execute(q)
for i in x :
print(i)
disp2()
OUTPUT:
(12, 'pens', 1000)

MYSQL QUERIES
>>PROGRAM 1:
create database employee;
use employee;
create table workers (accno int,cust_name varchar(25),fd_amount
int,months int,int_rate float,fd_date date);
insert into workers values (1001,'priyanka',300000,36,6.00,2018-07-
01);
insert into workers values (1002,'prasun',200000,48,6.75,'2018-03-
22');
insert into workers values (1003,'shriram',400000,36,5.00,'2018-03-
01');
insert into workers values (1004,'nayo',100000,40,5.55,'2020-01-
01');
select * from workers;

| ACCNO | CUST_NAME | FD_AMOUNT | MONTHS | INT_RATE |


FD_DATE

| 1001 | PRIYANKA | 300000 | 36 | 6 | 2018-07-01 |


| 1002 | PRASUN | 200000 | 48 | 6.75 | 2018-03-22 |
| 1003 | SHRIRAM | 400000 | 36 | 5 | 2018-03-01 |
| 1004 | NAYO | 100000 | 40 | 5.55 | 2020-01-01 |

1 to display the details about all the fixed deposits whose interest
rate is not entered.

select * from workers where int_rate is null;

output
empty set
2. to display the account number and fd amount of all the fixed
deposits that are started before 01-04-2018

select accno,fd_amount from workers where fd_date<'2020-01-01';

output
accno fd_amount
1001 300000
1002 200000
1003 400000
3. To display the customer name and fd amount for all the fixed
deposits which do not have a number of months as 36.

select cust_name,fd_amount from workers where months!=36;


OUTPUT:

| cust_name | fd_amount |
| prasun | 200000 |
| nayo | 100000

4. To display the customer name and fd amount of all the fixed


deposits forwhich the fd amount is less than 500000 and int_rate
is more than 7.

select cust_name,fd_amount from workers where


fd_amount<500000 and int_rate>7;

OUTPUT
empty set

5. to display the details about all the fixed deposits which started
in the year 2018.

select * from workers where year(fd_date)=2018;

OUTPUT

accno cust_name fd_amount months int_rate fd_date


1001 priyanka 300000 36 6 2018-07-01
1002 prasun 200000 48 6.75 2018-03-22
1003 shriram 400000 36 5 2018-03-01
6.To display the details of all the Fixed Deposits whose FD Amount
is in the range 40000-50000
select * from workers where fd_amount>=400000 and
fd_amount<=500000;
OUTPUT
accno cust_name fd_amount months int_rate fd_date
1003 shriram 400000 36 5 2018-03-01

7.To display the Customer name and FD amount for all the loans for
which thenumber of months is 24,36 or 48(using in operator)
select cust_name,fd_amount from workers where months=24 or
months=36 or months=48;
OUTPUT

cust_name fd_amount
priyanka 300000
prasun 200000
shriram 400000

8. To display the Account number, customer name and fd_amount


for all the FDs for which the customer name ends with “anka”;
select accno,cust_name,fd_amount from workers where cust_name
like "%anka";
OUTPUT
accno cust_name fd_amount
1001 priyanka 300000

9. To display the average FD amount. Label the column as “Average


FD Amount”
select avg(fd_amount) "average fd amount"from workers;
OUTPUT
average fd amount
250000.0000
10.To display the total FD amount which started in the year 2018.
select sum(fd_amount) from workers where year(fd_date)=2018;
OUTPUT
sum(fd_amount)
900000

11.To display the details about all the FDs whose rate of interest is
not in the range 6% to 7%
select * from workers where int_rate>=6.00 and int_rate<=7.00;
OUTPUT
accno cust_name fd_amount months int_rate fd_date
1001 priyanka 300000 36 6 2018-07-01
1002 prasun 200000 48 6.75 2018-03-22

12.To display the details about all the FDs whose customer name
doesn’t contain the character “a”.
select * from workers where cust_name not like "%a%";
OUTPUT
Empty set
13.To update the Interest rate of all the bank Customers from 5.55
to 6.80
OUTPUT
update workers set int_rate=6.80 where int_rate=5.55;

>>PROGRAM 2:
create database store;
use store;
create table items(code int,iname varchar(25),price float,qty
int,company varchar(25),tcode int);
insert into items values(1,"coat",600,5,"modi",101);
insert into items values(2,"boat",1000,10,"das",101);
insert into items values(3,"pen",100,50,"orio",103);
insert into items values(4,"book",25,15,"das",104);
select * from items;
| code | iname | price | qty | company | tcode |
| 1 | coat | 600 | 5 | modi | 101 |
| 2 | boat | 1000 | 10 | das | 101 |
| 3 | pen | 100 | 50 | orio | 103 |
| 4 | book | 25 | 15 | das | 104 |

create table traders(tcode int,tname varchar(25),city varchar(25));


insert into traders values(101,"prasun","angul");
insert into traders values(103,"shriram","halo");
insert into traders values(104,"nayo","hyderabad");
select * from traders;
| tcode | tname | city |
| 101 | prasun | angul |
| 103 | shriram | halo |
| 104 | nayo | hyderabad |

1.To display the natural join of the tables items and traders.
select * from items natural join traders;
OUTPUT
| tcode | code | iname | price | qty | company | tname | city
|
| 101 | 1 | coat | 600 | 5 | modi | prasun | angul |
| 101 | 2 | boat | 1000 | 10 | das | prasun | angul |
| 103 | 3 | pen | 100 | 50 | orio | shriram | halo |
| 104 | 4 | book | 25 | 15 | das | nayo | hyderabad |

2) To display the number of items traded by every Trader.


select count(*) from items group by tcode;
OUTPUT
| count(*) |
| 2|
| 1|
| 1|

3) To display the Itemname, company, tradername and city of all


the items
select iname,company,tname,city from items natural join traders;
OUTPUT
| iname | company | tname | city |
| coat | modi | prasun | angul |
| boat | das | prasun | angul |
| pen | orio | shriram | halo |
| book | das | nayo | hyderabad |

4.To display the Item name and Trader name of all the items that
are either from HALO or ANGUL
select iname,tname from items natural join traders where city
in("halo","angul");
OUTPUT
| iname | tname |
| coat | prasun |
| boat | prasun |
| pen | shriram |

5. To display the minimum and maximum price of the item traded


by every trader.
select tcode,max(price),min(price) from items group by tcode;
OUTPUT
| tcode | max(price) | min(price) |
| 101 | 1000 | 600 |
| 103 | 100 | 100 |
| 104 | 25 | 25 |

6 .To display the average price of an item traded by every trader.


select avg(price) from items group by tcode;
OUTPUT
| avg(price) |
| 800 |
| 100 |
| 25
7. To display the Itemname and trader name of all the items in the
alphabetical order of the itemnames.
select iname,tname from items natural join traders order by iname
asc;
OUTPUT
| iname | tname |
| boat | prasun |
| book | nayo |
| coat | prasun |
| pen | shriram |

8. To display the names of the traders whose average price of an


item is not more than 20000.
select tname from traders natural join items group by iname having
avg(price)<=20000;
OUTPUT
| tname |
| prasun |
| nayo |
| prasun |
| shriram |

9.To display the details about all the items whose avg price is in the
range 200 and 1000.
select * from items having avg(price)>=200 and avg(price)<=1000;
OUTPUT
| code | iname | price | qty | company | tcode |

| 1 | coat | 600 | 5 | modi | 101 |

10. To display the total number of quantity and tname of items


available for every trader.
select sum(qty),tname from items natural join traders group by
tcode;
OUTPUT
| sum(qty) | tname |
| 15 | prasun |
| 50 | shriram |
| 15 | nayo |

>>PROGRAM 3:
select * from worker;
| wno | name | doj | dob | gender | dcode |
| 1001 | prasun | 2013-09-02 | 1991-09-01 | male | d01 |
| 1002 | shriram | 2015-07-02 | 1991-09-04 | male | d02 |
| 1003 | priyanka | 2016-08-12 | 1989-10-10 | female | d03 |
| 1005 | nayo | 2014-01-17 | 1984-10-19 | female | d01 |

select * from dept;


| dcode | department | city |
| d01 | media | delhi |
| d02 | marketing | mumbai |
| d03 | finance | kolkata |
1)To display the department name, code and number of workers in
every department.
select department,dcode,count(*) from worker natural join dept
group by dcode;
OUTPUT
| department | dcode | count(*) |
| media | d01 | 2|
| marketing | d02 | 1|
| finance | d03 | 1|

2)To display the names and date of joining of all the workers in
Kolkata.
select name doj from worker natural join dept where city like
"kolkata";
OUTPUT
| doj |
| priyanka |

3)select count(*),gender from worker group by gender;


OUTPUT
| count(*) | gender |
| 2 | female |
| 2 | male |
4) To display Wno,name ,Gender,department in descending order
of Wno
select wno,name,gender,department from worker natural join dept
order by wno desc;
OUTPUT
| wno | name | gender | department |
| 1005 | nayo | female | media |
| 1003 | priyanka | female | finance |
| 1002 | shriram | male | marketing |
| 1001 | prasun | male | media |

5) To display the names of all the departments where more than


one worker are available.
select department,dcode from dept natural join worker group by
dcode having count(*)>1;
OUTPUT
| department | dcode |
| media | d01 |

6) To display the wno,name,department of all the workers who are


born between “1987-01-01” and “1991-12-01”
select wno,name,department from worker natural join dept where
doj between "2013-01-01" and "2016-12-01";
OUTPUT
| wno | name | department |
| 1001 | prasun | media |
| 1002 | shriram | marketing |
| 1003 | priyanka | finance |
| 1005 | nayo | media |

7)To display the details about all the workers whose Wno is either
1003 , 1005 or 1007
select * from worker where wno in (1003,1005,1007);
OUTPUT
| wno | name | doj | dob | gender | dcode |
| 1003 | priyanka | 2016-08-12 | 1989-10-10 | female | d03 |
| 1005 | nayo | 2014-01-17 | 1984-10-19 | female | d01 |

8) To display wno,name ,department city of all the workers whose


name contains the letter “ p” and who are not in Mumbai and
kolkata
select wno,name,department,city from worker natural join dept
where name like "%p%" and city!="mumbai" and city!="kolkata";
OUTPUT
| wno | name | department | city |
| 1001 | prasun | media | delhi |

9) To count and display the number of male workers who have


joined after “1986-01-01”
select count(*) from worker where gender="male" and doj>"1981-
01-01" group by gender;
OUTPUT
| count(*) |
| 2|
10) To display the details of all the male workers in the finance
department.
select * from worker natural join dept where gender="female" and
department="finance";

OUTPUT
Dcode wno name doj dob gender department city
d03 1003 priyanka 2016-08-12 1989-10-10 female finance kolkata

>>PROGRAM 4:
select * from hospital;
| pno | name | age | dept | doa | charges | sex |
| 1 | prasun | 65 | surgery | 2018-02-23 | 600 | m |
| 2 | shriram | 24 | ent | 2019-01-01 | 400 | f |
| 3 | nayo | 45 | cardiology | 2018-12-19 | 400 | f |
| 4 | ali | 14 | ortho | 2018-10-01 | 600 | m |

1.To show all the information about the patients of the cardiology
department.
select * from hospital where dept="cardiology";
OUTPUT
| pno | name | age | dept | doa | charges | sex |
| 3 | nayo | 45 | cardiology | 2018-12-19 | 400 | f |

2.To list the names of female patients who are either in the
orthopaedic or surgery department.
select name from hospital where sex="f" and (dept="ortho" or
dept="surgery");
OUTPUT
Empty set
3.To display various departments in the hospital.
select distinct dept from hospital;
OUTPUT
| dept |

| surgery |
| ent |

| cardiology |

| ortho |

4.To display the number of patients in each department.


select count(*) from hospital group by dept;
OUTPUT
| count(*) |
| 1|
| 1|
| 1|
| 1|

5.To display details of all the patients whose name’s second


character is “a”.
select * from hospital where name like "_a%";
OUTPUT
| pno | name | age | dept | doa | charges | sex |
| 3 | nayo | 45 | cardiology | 2018-12-19 | 400 | f |

6.To display the details of all the patients who was admitted in the
year 2019.
select * from hospital where year(doa)=2019;
OUTPUT
| pno | name | age | dept | doa | charges | sex |
| 2 | shriram | 24 | ent | 2019-01-01 | 400 | f |

7.To display the details about all the patients in the reverse
alphabetical order of their names.
select * from hospital order by name desc;
OUTPUT
| pno | name | age | dept | doa | charges | sex |
| 2 | shriram | 24 | ent | 2019-01-01 | 400 | f |
| 1 | prasun | 65 | surgery | 2018-02-23 | 600 | m |
| 3 | nayo | 45 | cardiology | 2018-12-19 | 400 | f |
| 4 | ali | 14 | ortho | 2018-10-01 | 600 | m |

8.To display the average charges collected in every department.


select avg(charges) from hospital group by dept;
OUTPUT
| avg(charges) |
| 400.0000 |
| 400.0000 |
| 600.0000 |
| 600.0000 |

9.To display the patient detail whose age is missing.


select * from hospital where age is null;
OUTPUT
Empty set

10.To display the names of the patients who are charged in the
range 300 and 400
select name from hospital where charges between 300 and 400;
OUTPUT
| name |
| shriram |
| nayo |
11.To display the number of patients who are aged above 30.
select count(*) from hospital where age>30;
OUTPUT
| count(*) |
| 2|

12.To display the names of the department and the number of


patients in the department that have more than or equal to one
patient.
select dept,count(*) from hospital group by dept having count(*)>=1;
OUTPUT
| dept | count(*) |
| cardiology | 1|
| ent | 1|
| ortho | 1|
| surgery | 1|

13.To delete the record of the patient “prasun”.


delete from hospital where name like"prasun";
OUTPUT
Query OK
select * from hospital;
| pno | name | age | dept | doa | charges | sex |
| 2 | shriram | 24 | ent | 2019-01-01 | 400 | f |
| 3 | nayo | 45 | cardiology | 2018-12-19 | 400 | f |
| 4 | ali | 14 | ortho | 2018-10-01 | 600 | m |

14.To add another column DOCNAME of datatype varchar(20) into


the table hospital.
alter table hospital add(docname varchar(20));
OUTPUT
Query OK
select * from hospital;
OUTPUT
| pno | name | age | dept | doa | charges | sex |
docname |
| 2 | shriram | 24 | ent | 2019-01-01 | 400 | f | NULL
|
| 3 | nayo | 45 | cardiology | 2018-12-19 | 400 | f | NULL
|
| 4 | ali | 14 | ortho | 2018-10-01 | 600 | m | NULL |

15.To decrease the charges by 5% of all the patients admitted to


the ENT department.
update hospital set charges=charges-(charges*0.05) where
dept="ent";
OUTPUT
Query OK
select * from hospital;
OUTPUT
| pno | name | age | dept | doa | charges | sex |
docname |
| 2 | shriram | 24 | ent | 2019-01-01 | 380 | f | NULL
| 3 | nayo | 45 | cardiology | 2018-12-19 | 400 | f | NULL
| 4 | ali | 14 | ortho | 2018-10-01 | 600 | m | NULL |

>>PROGRAM 5:
select * from club;
| coach_id | name | age | sports | doa | pay | sex |
| 1 | prasun | 35 | golf | 1996-03-27 | 1000 | m |
| 2 | nayo | 34 | karate | 1998-01-20 | 1200 | f |
| 3 | shriram | 34 | squash | 1999-02-19 | 2000 | m |
| 4 | priyanka | 30 | football | 1998-01-01 | 1500 | f |
| 5 | pratibha | 35 | golf | 1998-01-12 | 3000 | f |

1.To show all information about the golf coaches in the Club.
select * from club where sports="golf";
OUTPUT
| coach_id | name | age | sports | doa | pay | sex
| 1 | prasun | 35 | golf | 1996-03-27 | 1000 | m |
| 5 | pratibha | 35 | golf | 1998-01-12 | 3000 | f |

2.To list the names of all coaches with their date of appointment in
descending order.
select name from club order by doa desc;
OUTPUT
| name |
| shriram |
| nayo |
| pratibha |
| priyanka |
| prasun |

3.select sports ,min(pay),max(pay),avg(pay) from club group by


sports;
OUTPUT
| sports | min(pay) | max(pay) | avg(pay) |
| football | 1500 | 1500 | 1500.0000 |
| golf | 1000 | 3000 | 2000.0000 |
| karate | 1200 | 1200 | 1200.0000 |
| squash | 2000 | 2000 | 2000.0000 |

4.To display details and bonus(5% of pay).


update club set pay=pay+(pay*0.05);
OUTPUT
Query OK
select * from club;
OUTPUT
| coach_id | name | age | sports | doa | pay | sex |
| 1 | prasun | 35 | golf | 1996-03-27 | 1050 | m |
| 2 | nayo | 34 | karate | 1998-01-20 | 1260 | f |
| 3 | shriram | 34 | squash | 1999-02-19 | 2100 | m |
| 4 | priyanka | 30 | football | 1998-01-01 | 1575 | f |
| 5 | pratibha | 35 | golf | 1998-01-12 | 3150 | f |

5.To display the distinct sports from the club.


select distinct sports from club;
OUTPUT
| sports |
| golf |
| karate |
| squash |
| football |

6.To display the details about the female coaches in the club.
select * from club where sex="f";
OUTPUT
| coach_id | name | age | sports | doa | pay | sex |
| 2 | nayo | 34 | karate | 1998-01-20 | 1260 | f |
| 4 | priyanka | 30 | football | 1998-01-01 | 1575 | f |
| 5 | pratibha | 35 | golf | 1998-01-12 | 3150 | f |
7. To display the coachnames, sports , pay and date of_app of all
the coaches whose name ends with “a”.
select name,sports,pay,doa from club where name like "%a";
OUTPUT
| name | sports | pay | doa |
| priyanka | football | 1575 | 1998-01-01 |
| pratibha | golf | 3150 | 1998-01-12 |

8.To display the coachname, sports ,age and pay of all the coaches
whose pay is in the range 2000-2500
select name,sports,age,pay from club where pay>=1000 and
pay<=2000;
OUTPUT
| name | sports | age | pay |

| prasun | golf | 35 | 1050 |

| nayo | karate | 34 | 1260 |

| priyanka | football | 30 | 1575 |

9.To display the details about all the coaches who are above 30 in
age and coach a sport starting with the letter “g”.
select * from club where age>30 and sports like "g%";
OUTPUT
| coach_id | name | age | sports | doa | pay | sex |
| 1 | prasun | 35 | golf | 1996-03-27 | 1050 | m |
| 5 | pratibha | 35 | golf | 1998-01-12 | 3150 | f |

10.To display the number of coaches available for every sports.


select count(*) from club group by sports;
OUTPUT
| count(*) |
| 1|
| 2|
| 1|
| 1|

11. To display the average Pay given for a coach for every sports
activity.
select avg(pay) from club group by sports;
OUTPUT
| avg(pay) |

| 1575.0000 |

| 2100.0000 |

| 1260.0000 |

| 2100.0000 |

12. To display the details about all the male coaches who joined
after 15th February 1998.
select * from club where sex="m" and doa>"1998-02-15";
OUTPUT
| coach_id | name | age | sports | doa | pay | sex |
| 3 | shriram | 34 | squash | 1999-02-19 | 2100 | m |

13. To display the coach id , names and age of all the coaches who
coach neither Swimming nor golf
select coach_id,name,age from club where sports!="swimming" and
sports!="golf";
OUTPUT
| coach_id | name | age |
| 2 | nayo | 34 |
| 3 | shriram | 34 |
| 4 | priyanka | 30 |

14.To display the names of all the sports in the club which have
more than 2 coaches.
select sports from club group by sports having count(*)>1;
OUTPUT
| sports |
| golf |
15.To display the total salary given for male and female coaches in
the club.
select sum(pay) from club group by sex;
OUTPUT
| sum(pay) |
| 5985 |
| 3150 |

JAIN INTERNATIONAL RESIDENTIAL SCHOOL


KANAKAPURA, KARNATAKA

PROJECT FILE

For
AISSCE 2025 Examination
[As a part of the Computer Science Course (083)]

SUBMITTED BY
PRIYANKA LATH

JAIN INTERNATIONAL RESIDENTIAL SCHOOL


KANAKAPURA, KARNATAKA

This is to certify that Miss PRIYANKA LATH of class XII D has

satisfactorily completed the project work on the topic

in partial fulfilment of CBSE’s AISSCE Examination 2025.


Name: PRIYANKA LATH
Reg No.: ……………………………

………………………… ……………………………..
Signature of External Examiner Signature of Internal Examiner

Signature of Principal ………………….


Place: JAKKASANDRA
Date: ……………..

CONTENT
1. Introduction
2. Gratitude
3. System description
4. Java coding
5. Output frames
6. Conclusion
Bibliography

INTRODUCTION

The project titled ’STORE MANAGEMENT’is online


shopping store developed to automate the functions of
an Online Shoe Store. The purpose of the software
project is to develop the system to automate the record
keeping of customer entry, order entry and item entry
with a view to enhance the decision making of the
function.
The project mainly consists of a computerized
database, a collection of inter-related table for a
particular subject or purpose, capable to produce
different reports relevant to the user.
This project is designed and coded in NetBeansIDE 8.2
& database handled by MySQL Server 5.1.
This project mainly focuses on basic operations in an
online shopping site such as shopping for you desired
item and placing an order.
This software is easy to use for any type of users, be it
a beginner or an advanced user. It features a familiar
and well thought-out, and attractive user interface,
combined with strong searching and reporting
capabilities.

GRATITUDE
I have taken effort in this project. However, it would not
have been possible without the kind support of many
individuals.
I would like to extend my gratitude total of them.
I thank the Almighty for providing me with everything
that I required in completing this project. I am highly
indebted to the teacher in charge Mrs.Deepa Sreehari
for her guidance and constant supervision as well as for
providing necessary information regarding this project
and also for her support in completing this project.
I would like to express my gratitude towards my
parents for their kind cooperation and encouragement
which helped me in the completion of this project.
My thanks and appreciation also go to all those who
have helped me to develop this project and to those
who have willingly helped with whatever they can.

SYSTEM
DESCRIPTION
USER

ITEMS
PURCHASE

PYTHON CODE
print("***************************")
import mysql.connector
import random
con=
mysql.connector.connect(host="localhost",user="root",password="jirs",charset="utf8",data
base="shop")
cur=con.cursor()

def addproduct():
ch="yes"
while ch=="yes":
icode=random.randint(100,999)
iname=input("ENTER THE PRODUCT NAME:")
price=int(input("ENTER THE PRICE OF THE PRODUCT:"))
qty=int(input("ENTER THE QUANTITY OF THE PRODUCT:"))
q="insert into items values(%s,%s,%s,%s);"
t=(icode,iname,price,qty)
cur.execute(q,t)
con.commit()
print("YOUR PRODUCT CODE IS:",icode)
print("YOUR PRODUCT IS ADDED SUCCESFULLY")
ch=input("Enter your choice(yes/no)")

def deleteproduct( ):
ch="yes"
while ch=="yes":
icode=int(input("ENTER THE CODE OF THE PRODUCT:"))
d="delete from items where icode=%s;"
t=(icode,)
cur.execute(d,t)
con.commit()
ch=input("Enter your choice(yes/no)")

def viewproducts():
icode=int(input("ENTER THE CODE OF THE PRODUCT:"))
v="select * from items where icode=%s;"
t=(icode,)
cur.execute(v,t)
for i in cur:
print(i)
def update1():
icode=int(input("ENTER THE CODE OF THE PRODUCT:"))
iname=input("ENTER THE PRODUCT NAME:")
dsc=input("ENTER THE PRODUCT TYPE:")
price=int(input("ENTER THE PRICE OF THE PRODUCT:"))
qty=int(input("ENTER THE QUANTITY OF THE PRODUCT:"))
d="update items set iname = %s,dsc=%s,price=%s,qty=%s where icode=%s;"
t=( iname,dsc,price,qty,icode)
cur.execute(d,t)
con.commit()

def first_option():
choice='yes'
while choice=="yes":
print("""
1. ADD PRODUCT

2. VIEW PRODUCT

3. UPDATE PRODUCT

4. DELETE PRODUCT

5. EXIT""")
option=int(input("Enter your option "))
if option==1:
addproduct()
elif option==2:
viewproducts()
elif option==3:
update1()
elif option==4:
deleteproduct( )
elif option==5:
print("------EXIT------")
else:
print("Wrong input ")
choice=input('do you want to continue:yes/no')

def viewpurchase():
v="select * from purchase;"
cur.execute(v)
for i in cur:
print(i)

def updatepurchase():
ch=input("enter the product name that you want to update")
qt=int(input("ENTER THE QUANTITY that you want to update"))
d="update purchase set qt=%s where pdname=%s ;"
t=(qt,ch)
cur.execute(d,t)
con.commit()

def purchase():
print("""
1.pen(rs10 per pc)
2.pencil(rs12 per pc)
3.eraser(rs15 per pc)
4.ruler(rs16 per pc)
5.sharpener(rs20 per pc)
"""
)
ch=input("enter the product name that you want to buy:")
qt=int(input("ENTER THE QUANTITY:"))
if ch== "pen":
icode=198
s="insert into purchase values (%s,%s,%s);"
t=(qt,ch,icode)
cur.execute(s,t)
con.commit()
print("---------------------YOUR ITEM IS ADDED TO CART----------------------")
elif ch== "pencil":
icode=457
s="insert into purchase values (%s,%s,%s);"
t=(qt,ch,icode)
cur.execute(s,t)
con.commit()
print("---------------------YOUR ITEM IS ADDED TO CART----------------------")
elif ch== "eraser":
icode=909
s="insert into purchase values (%s,%s,%s);"
t=(qt,ch,icode)
cur.execute(s,t)
con.commit()
print("---------------------YOUR ITEM IS ADDED TO CART----------------------")
elif ch== "ruler":
icode=111
s="insert into purchase values (%s,%s,%s);"
t=(qt,ch,icode)
cur.execute(s,t)
con.commit()
print("---------------------YOUR ITEM IS ADDED TO CART----------------------")
elif ch== "sharpener":
icode=636
s="insert into purchase values (%s,%s,%s);"
t=(qt,ch,icode)
cur.execute(s,t)
con.commit()
print("---------------------YOUR ITEM IS ADDED TO CART----------------------")

def bill():
a=0
b=0
s="select * from purchase natural join items;"
cur.execute(s)
for i in cur:
c=list(i)
w=c[1]
z=c[5]
a+=w
b+=z
f=a*b
print("total price",a,"total qty",b,"total amt",f)
while True:
print("---Welcome--- ")
print("Paymemt methods are (cash,net banking,card)")
name= input('Enter the name of customer: ')
payment= input('Enter the mode of payment: ')
GST= (18/100)*f
if payment=="card":
discount= (5/100)*f
elif payment=="netbanking":
discount= (10/100)*f
elif payment=="cash":
discount= (7/100)*f
total_price=f+GST -discount
print("---------------------------------------------------------------
Invoice-------------------------------------------------------------------")
print("Name of the customer is:",name)
print("Mode of payment is:",payment)
if payment=="card":
print("You got",5, "% discount")
elif payment=="netbanking":
print("You got",10, "% discount")
elif payment=="cash":
print("You got",7, "% discount")
print("Discount is ₹", discount)
print("Total without GST is ₹:",f)
print("GST is ₹:",GST)
print("Total price is ₹",total_price)
print("########THANK YOU FOR PURCHASING FROM OUR SHOP HAVE A NICE DAY
AHEAD AND COME AGAIN########")
break

def second_option():
choice='yes'
while choice=="yes":
print("""
1. PURCHASE

2. VIEW PURCHASE

3. UPDATE PURCHASE

4. BILL

5 . EXIT""")
option=int(input("Enter your option "))
if option==1:
purchase()
elif option==2:
viewpurchase()
elif option==3:
updatepurchase()
elif option==4:
bill()
elif option==5:
print("------EXIT------")
else:
print("Wrong input ")
choice=input('do you want to continue:yes/no')
if choice == "no":
bill()

def logiin():
username = input("Enter your username: ")
password = input("Enter your password: ")
cur.execute("SELECT * FROM users WHERE username = %s AND password = %s",
(username, password))
user = cur.fetchone()
if user:
print(f"Login successful! Welcome {username}.")
second_option()
else:
print("Invalid username or password please try again")
def signin():
username = input("ENTER THE USERNAME: ")
password = input("ENTER THE PASSWORD: ")
t=(username, password)
q="INSERT INTO users VALUES (%s, %s);"
cur.execute(q,t)
con.commit()
print("User created successfully!")
logiin()

print("""--------- WELCOME TO STORE MANAGEMENT---------


1.ADMIN
2.USER""")
y=int(input("ENTER YOUR CHOICE"))
if(y==1):
login =int(input("Enter password to unlock: "))
if login==123:
print("Logging in, please wait...")
first_option()
else:
print("Incorrect password. Try again.")
elif(y==2):
print("1.SIGNIN")
print("2.LOGIN")
cho=int(input("enter your choice"))
if(cho==1):
signin()
elif(cho==2):
logiin()

OUTPUT FRAMES
***************************
--------- WELCOME TO STORE MANAGEMENT---------
1.ADMIN
2.USER
ENTER YOUR CHOICE2
1.SIGNIN
2.LOGIN
enter your choice1
ENTER THE USERNAME: prasun
ENTER THE PASSWORD: prasun
User created successfully!
Enter your username: prasun
Enter your password: prasun
Login successful! Welcome prasun.
1. PURCHASE

2. VIEW PURCHASE

3. UPDATE PURCHASE

4. BILL

5 . EXIT
Enter your option 1
1.pen(rs10 per pc)
2.pencil(rs12 per pc)
3.eraser(rs15 per pc)
4.ruler(rs16 per pc)
5.sharpener(rs20 per pc)

enter the product name that you want to buy:pen


ENTER THE QUANTITY:2
---------------------YOUR ITEM IS ADDED TO CART----------------------
do you want to continue:yes/nono
total price 36 total qty 60 total amt 2160
---Welcome---
Paymemt methods are (cash,net banking,card)
Enter the name of customer: prasun
Enter the mode of payment: cash
---------------------------------------------------------------
Invoice-------------------------------------------------------------------
Name of the customer is: prasun
Mode of payment is: cash
You got 7 % discount
Discount is ₹ 151.20000000000002
Total without GST is ₹: 2160
GST is ₹: 388.8
Total price is ₹ 2397.6000000000004
########THANK YOU FOR PURCHASING FROM OUR SHOP
HAVE A NICE DAY AHEAD AND COME AGAIN########

CONCLUSION
python has significant advantages not only as a
commercial language but also as a teaching language.
It allows students to learn object-oriented programming
without exposing them to the complexity of C++.
It provides the kind of rigorous compile-time error
checking typically associated with Pascal. This was an
effort to develop a simple online shopping program
which can be useful for those people who wish to
purchase the shoe the find in an online shopping site
easily, efficiently with just a few steps in a matter of
few minutes.
BIBLIOGRAPHY
1. Computer science textbook for
class XII and XI
2. Computer science teacher
Mrs.Deepa Sreehari
3. https://
pythontrends.wordpress.com/wp-
content/uploads/2019/05/holiday-
homework-class-xii-cs-2019-20.pdf

You might also like