SlideShare a Scribd company logo
1 of 29
Download to read offline
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 1
CENTRAL BOARD OF SECONDARY EDUCATION
School Name
Address
A TERM 2 PRACTICAL RECORD FILE IS SUBMITTED TO DEPARTMENT OF COMPUTER SCIENCE FOR
THE PARTIAL FULLFILLMENT OF AISSCE EXAMINATION SESSION - ________
SUBMITTED BY: [NAME OF STUDENT]
HOD(COMPUTER):[NAME OF SUBJECT TEACHER]
CLASS: [CLASS]
ROLL NO: [XXXXXXX]
School &
CBSE
Logo
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 2
ACKNOWLEDGEMENT
I wish to express my deep sense of
gratitude and indebtedness to our learned teacher
TEACHER’S NAME , PGT COMPUTER SCIENCE,
[SCHOOL NAME] for his invaluable help, advice and
guidance in the preparation of this project.
I am also greatly indebted to our principal
[Name of principal] and school authorities for
providing me with the facilities and requisite
laboratory conditions for making this practical file.
I also extend my thanks to a number of
teachers ,my classmates and friends who helped me to
complete this practical file successfully.
[Name of Student]
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 3
CERTIFICATE
This is to certify that [Name of Student]
, student of Class XII, [NAME OF SCHOOL] has
completed the Term I - PRACTICAL FILE during the
academic year [SESSION] towards partial fulfillment
of credit for the Computer Science practical
evaluation of CBSE and submitted satisfactory report,
as compiled in the following pages, under my
supervision.
Total number of practical certified are : 10.
Internal Examiner Head of the Department
Signature Signature
External Examiner Principal
Signature Seal and Signature
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 4
No. Practical Date Signature
1
Write a menu-driven python program to implement stack
operation.
2 Write a program to implement a stack for the employee details
(empno, name).
3 Write a python program to check whether a string is a
palindrome or not using stack.
4 Queries Set 1 (Database Fetching records)
5 Queries Set 2 (Based on Functions)
6 Queries Set 3 (DDL Commands)
7 Queries set 4 (Based on Two Tables)
8 Queries Set 5 (Group by , Order By)
9 Write a MySQL connectivity program in Python to
• Create a database school
• Create a table students with the specifications -
ROLLNO integer, STNAME character(10) in MySQL
and perform the following operations:
o Insert two records in it
o Display the contents of the table
10 Perform all the operations with reference to table ‘students’
through MySQL-Python connectivity.
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 5
Part A Data Structure
1. Write a menu-driven python program to implement stack operation.
Code:
def check_stack_isEmpty(stk):
if stk==[]:
return True
else:
return False
# An empty list to store stack elements, initially empty
s=[]
top = None # This is top pointer for push and pop
def main_menu():
while True:
print("Stack Implementation")
print("1 - Push")
print("2 - Pop")
print("3 - Peek")
print("4 - Display")
print("5 - Exit")
ch = int(input("Enter the your choice:"))
if ch==1:
el = int(input("Enter the value to push an
element:"))
push(s,el)
elif ch==2:
e=pop_stack(s)
if e=="UnderFlow":
print("Stack is underflow!")
else:
print("Element popped:",e)
elif ch==3:
e=pop_stack(s)
if e=="UnderFlow":
print("Stack is underflow!")
else:
print("The element on top is:",e)
elif ch==4:
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 6
display(s)
elif ch==5:
break
else:
print("Sorry, You have entered invalid option")
def push(stk,e):
stk.append(e)
top = len(stk)-1
def display(stk):
if check_stack_isEmpty(stk):
print("Stack is Empty")
else:
top = len(stk)-1
print(stk[top],"-Top")
for i in range(top-1,-1,-1):
print(stk[i])
def pop_stack(stk):
if check_stack_isEmpty(stk):
return "UnderFlow"
else:
e = stk.pop()
if len(stk)==0:
top = None
else:
top = len(stk)-1
return e
def peek(stk):
if check_stack_isEmpty(stk):
return "UnderFlow"
else:
top = len(stk)-1
return stk[top]
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 7
Output:
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 8
2. Write a program to implement a stack for the employee details (empno, name).
Code:
stk=[]
top=-1
def line():
print('~'*100)
def isEmpty():
global stk
if stk==[]:
print("Stack is empty!!!")
else:
None
def push():
global stk
global top
empno=int(input("Enter the employee number to push:"))
ename=input("Enter the employee name to push:")
stk.append([empno,ename])
top=len(stk)-1
def display():
global stk
global top
if top==-1:
isEmpty()
else:
top=len(stk)-1
print(stk[top],"<-top")
for i in range(top-1,-1,-1):
print(stk[i])
def pop_ele():
global stk
global top
if top==-1:
isEmpty()
else:
stk.pop()
top=top-1
def main():
while True:
line()
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 9
print("1. Push")
print("2. Pop")
print("3. Display")
print("4. Exit")
ch=int(input("Enter your choice:"))
if ch==1:nm
push()
print("Element Pushed")
elif ch==2:
pop_ele()
elif ch==3:
display()
elif ch==4:
break
else:
print("Invalid Choice")
Output:
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 10
3. Write a python program to check whether a string is a palindrome or not using
stack.
Code:
stack = []
top = -1
# push function
def push(ele):
global top
top += 1
stack[top] = ele
# pop function
def pop():
global top
ele = stack[top]
top -= 1
return ele
# Function that returns 1 if string is a palindrome
def isPalindrome(string):
global stack
length = len(string)
# Allocating the memory for the stack
stack = ['0'] * (length + 1)
# Finding the mid
mid = length // 2
i = 0
while i < mid:
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 11
push(string[i])
i += 1
# Checking if the length of the string is odd then
neglect the middle character
if length % 2 != 0:
i += 1
# While not the end of the string
while i < length:
ele = pop()
# If the characters differ then the given string
is not a palindrome
if ele != string[i]:
return False
i += 1
return True
string = input("Enter string to check:")
if isPalindrome(string):
print("Yes, the string is a palindrome")
else:
print("No, the string is not a palindrome")
Output:
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 12
Part B sql queries
1. Consider the following MOVIE table and write the SQL queries based on it.
Movie_ID MovieName Type ReleaseDate ProductionCost BusinessCost
M001 The Kashmir Files Action 2022/01/26 1245000 1300000
M002 Attack Action 2022/01/28 1120000 1250000
M003 Looop Lapeta Thriller 2022/02/01 250000 300000
M004 Badhai Do Drama 2022/02/04 720000 68000
M005 Shabaash Mithu Biography 2022/02/04 1000000 800000
M006 Gehraiyaan Romance 2022/02/11 150000 120000
a) Display all information from movie.
b) Display the type of movies.
c) Display movieid, moviename, total_eraning by showing the business done by the
movies. Claculate the business done by movie using the sum of productioncost and
businesscost.
d) Display movieid, moviename and productioncost for all movies with
productioncost greater thatn 150000 and less than 1000000.
e) Display the movie of type action and romance.
f) Display the list of movies which are going to release in February, 2022.
Answers:
a)select * from movie;
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 13
b) select distinct from a movie;
c) select movieid, moviename, productioncost + businesscost
"total earning" from movie;
d)select movie_id,moviename, productioncost from movie
where producst is >150000 and <1000000;
e) select moviename from movie where type ='action' or
type='romance';
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 14
f) select moviename from moview where month(releasedate)=2;
2. Write following queries:
a) Write a query to display cube of 5.
b) Write a query to display the number 563.854741 rounding off to the next hnudred.
c) Write a query to display "put" from the word "Computer".
d) Write a query to display today's date into DD.MM.YYYY format.
e) Write a query to display 'DIA' from the word "MEDIA".
f) Write a query to display moviename - type from the table movie.
g) Write a query to display first four digits of productioncost.
h) Write a query to display last four digits of businesscost.
i) Write a query to display weekday of release dates.
j) Write a query to display dayname on which movies are going to be released.
Answers:
a)select pow(5,3);
b)select round(563.854741,-2);
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 15
c)select mid("Computer",4,3);
d)select concat(day(now()), concat('.',month(now()),
concat('.',year(now())))) "Date";
e)select right("Media",3);
f)select concat(moviename,concat(' - ',type)) from movie;
g)select left(productioncost,4) from movie;
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 16
h)select right(businesscost,4) from movie;
i)select weekday(releasedate) from movie;
j)select dayname(releasedate) from movie;
3. Suppose your school management has decided to conduct cricket matches between
students of Class XI and Class XII. Students of each class are asked to join any one
of the four teams – Team Titan, Team Rockers, Team Magnet and Team
Hurricane. During summer vacations, various matches will be conducted between
these teams. Help your sports teacher to do the following:
a) Create a database “Sports”.
b) Create a table “TEAM” with following considerations:
a. It should have a column TeamID for storing an integer value between 1 to 9,
which refers to unique identification of a team.
b. Each TeamID should have its associated name (TeamName), which should be a
string of length not less than 10 characters.
c. Using table level constraint, make TeamID as the primary key.
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 17
c) Show the structure of the table TEAM using a SQL statement.
d) As per the preferences of the students four teams were formed as given below. Insert
these four rows in TEAM table:
a. Row 1: (1, Tehlka)
b. Row 2: (2, Toofan)
c. Row 3: (3, Aandhi)
d. Row 3: (4, Shailab)
e) Show the contents of the table TEAM using a DML statement.
f) Now create another table MATCH_DETAILS and insert data as shown below. Choose
appropriate data types and constraints for each attribute.
MatchID MatchDate FirstTeamID SecondTeamID FirstTeamScore SecondTeamScore
M1 2021/12/20 1 2 107 93
M2 2021/12/21 3 4 156 158
M3 2021/12/22 1 3 86 81
M4 2021/12/23 2 4 65 67
M5 2021/12/24 1 4 52 88
M6 2021/12/25 2 3 97 68
Answers:
a) create database sports;
b) Creating table with the given specification
create table team -> (teamid int(1), -> teamname
varchar(10), primary key(teamid));
c) desc team;
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 18
• Inserting data:
mqsql> insert into team -> values(1,'Tehlka');
•Show the content of table - team:
select * from team;
• Creating another table:
create table match_details
-> (matchid varchar(2) primary key,
-> matchdate date,
-> firstteamid int(1) references team(teamid),
-> secondteamid int(1) references team(teamid),
-> firstteamscore int(3),
-> secondteamscore int(3));
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 19
4. Write following queries:
a) Display the matchid, teamid, teamscore whoscored more than 70 in first ining
along with team name.
b) Display matchid, teamname and secondteamscore between 100 to 160.
c) Display matchid, teamnames along with matchdates.
d) Display unique team names
e) Display matchid and matchdate played by Anadhi and Shailab.
Answers:
a)select match_details.matchid, match_details.firstteamid,
team.teamname,match_details.firstteamscore from
match_details, team where match_details.firstteamid =
team.teamid and match_details.first
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 20
b)select match_details.matchid, match_details.firstteamid,
team.teamname,match_details.firstteamscore from
match_details, team where match_details.firstteamid =
team.teamid and match_details.firstteamscore>70;
c)select matchid, teamname, firstteamid, secondteamid,
matchdate from match_details, team where
match_details.firstteamid = team.teamid;
d)select distinct(teamname) from match_details, team where
match_details.firstteamid = team.teamid;
e)select matchid,matchdate from match_details, team where
match_details.firstteamid = team.teamid and
team.teamname in ('Aandhi','Shailab');
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 21
5. Consider the following table and write the queries:
itemno item dcode qty unitprice stockdate
S005 Ballpen 102 100 10 2018/04/22
S003 Gel Pen 101 150 15 2018/03/18
S002 Pencil 102 125 5 2018/02/25
S006 Eraser 101 200 3 2018/01/12
S001 Sharpner 103 210 5 2018/06/11
S004 Compass 102 60 35 2018/05/10
S009 A4 Papers 102 160 5 2018/07/17
a) Display all the items in the ascending order of stockdate.
b) Display maximum price of items for each dealer individually as per dcode from stock.
c) Display all the items in descending orders of itemnames.
d) Display average price of items for each dealer individually as per doce from stock
which avergae price is more than 5.
e) Diisplay the sum of quantity for each dcode.
Answers:
a) select * from stock order by stockdate;
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 22
b) select dcode,max(unitprice) from stock group by code;
c) select * from stock order by item desc;
d)select dcode,avg(unitprice) from stock group by dcode
having avg(unitprice)>5;
e) select dcode,sum(qty) from stock group by dcode;
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 23
Part C Python Database connectivity
1. Write a MySQL connectivity program in Python to
• Create a database school
• Create a table students with the specifications - ROLLNO integer, STNAME
character(10) in MySQL and perform the following operations:
o Insert two records in it
o Display the contents of the table
2. Perform all the operations with reference to table ‘students’ through MySQL-Python
connectivity.
Answers:
1.Using pymysql - Code:
import pymysql as ms
#Function to create Database as per users choice
def c_database():
try:
dn=input("Enter Database Name=")
c.execute("create database {}".format(dn))
c.execute("use {}".format(dn))
print("Database created successfully")
except Exception as a:
print("Database Error",a)
#Function to Drop Database as per users choice
def d_database():
try:
dn=input("Enter Database Name to be dropped=")
c.execute("drop database {}".format(dn))
print("Database deleted sucessfully")
except Exception as a:
print("Database Drop Error",a)
#Function to create Table
def c_table():
try:
c.execute('''create table students
(
rollno int(3),
stname varchar(20)
);
''')
print("Table created successfully")
except Exception as a:
print("Create Table Error",a)
#Function to Insert Data
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 24
def e_data():
try:
while True:
rno=int(input("Enter student rollno="))
name=input("Enter student name=")
c.execute("use {}".format('school'))
c.execute("insert into students
values({},'{}');".format(rno,name))
db.commit()
choice=input("Do you want to add more record<y/n>=")
if choice in "Nn":
break
except Exception as a:
print("Insert Record Error",a)
#Function to Display Data
def d_data():
try:
c.execute("select * from students")
data=c.fetchall()
for i in data:
print(i)
except Exception as a:
print("Display Record Error",a)
db=ms.connect(host="localhost",user="root",password="root")
c=db.cursor()
while True:
print("MENUn1. Create Databasen2. Drop Database n3.
Create Tablen4. Insert Record n5. Display Entire Datan6.
Exit")
choice=int(input("Enter your choice<1-6>="))
if choice==1:
c_database()
elif choice==2:
d_database()
elif choice==3:
c_table()
elif choice==4:
e_data()
elif choice==5:
d_data()
elif choice==6:
break
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 25
else:
print("Wrong option selected")
Output:
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 26
2.using mysqlconnector
import mysql.connector as ms
db=ms.connect(host="localhost",user="root",passwd="root",datab
ase='school')
cn=db.cursor()
def insert_rec():
try:
while True:
rn=int(input("Enter roll number:"))
sname=input("Enter name:")
marks=float(input("Enter marks:"))
gr=input("Enter grade:")
cn.execute("insert into students
values({},'{}',{},'{}')".format(rn,sname,marks,gr))
db.commit()
ch=input("Want more records? Press (N/n) to stop
entry:")
if ch in 'Nn':
break
except Exception as e:
print("Error", e)
def update_rec():
try:
rn=int(input("Enter rollno to update:"))
marks=float(input("Enter new marks:"))
gr=input("Enter Grade:")
cn.execute("update students set marks={},grade='{}'
where rno={}".format(marks,gr,rn))
db.commit()
except Exception as e:
print("Error",e)
def delete_rec():
try:
rn=int(input("Enter rollno to delete:"))
cn.execute("delete from students where
rno={}".format(rn))
db.commit()
except Exception as e:
print("Error",e)
def view_rec():
try:
cn.execute("select * from students")
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 27
except Exception as e:
print("Error",e)
while True:
print("MENUn1. Insert Recordn2. Update Record n3. Delete
Recordn4. Display Record n5. Exit")
ch=int(input("Enter your choice<1-4>="))
if ch==1:
insert_rec()
elif ch==2:
update_rec()
elif ch==3:
delete_rec()
elif ch==4:
view_rec()
elif ch==5:
break
else:
print("Wrong option selected")
Output:
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 28
CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 29

More Related Content

What's hot

Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdfHarshitSachdeva17
 
Computer project final for class 12 Students
Computer project final for class 12 StudentsComputer project final for class 12 Students
Computer project final for class 12 StudentsShahban Ali
 
Chemistry project for Class 12
Chemistry project for Class 12Chemistry project for Class 12
Chemistry project for Class 12Shahban Ali
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Self-employed
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)lokesh meena
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12OmRanjan2
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THSHAJUS5
 
Chemistry Investigatory Project of class 12th CBSE
Chemistry Investigatory Project  of class 12th CBSEChemistry Investigatory Project  of class 12th CBSE
Chemistry Investigatory Project of class 12th CBSENagesh Agrawal
 
Chemistry investigatory project
Chemistry investigatory projectChemistry investigatory project
Chemistry investigatory projectAbhinav Kumar
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILEAnushka Rai
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XIIYugenJarwal
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12thNitesh Kushwaha
 
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)Anushka Rai
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingHarsh Kumar
 
Physics investigatory project for class 12
Physics investigatory project for class 12Physics investigatory project for class 12
Physics investigatory project for class 12Kavita Kulkarni
 
cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project NIKHIL DWIVEDI
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...ArkaSarkar23
 
Study of quantity of caesin present in different samples of milk
Study of quantity of caesin present in different samples of milkStudy of quantity of caesin present in different samples of milk
Study of quantity of caesin present in different samples of milkNeelanjyan Dutta
 
Physics Investigatory Project Class XII
Physics Investigatory Project Class XIIPhysics Investigatory Project Class XII
Physics Investigatory Project Class XIIAjit Singh
 
Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)PiyushKashyap54
 

What's hot (20)

Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
 
Computer project final for class 12 Students
Computer project final for class 12 StudentsComputer project final for class 12 Students
Computer project final for class 12 Students
 
Chemistry project for Class 12
Chemistry project for Class 12Chemistry project for Class 12
Chemistry project for Class 12
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)
 
Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12Computer science project on Online Banking System class 12
Computer science project on Online Banking System class 12
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
 
Chemistry Investigatory Project of class 12th CBSE
Chemistry Investigatory Project  of class 12th CBSEChemistry Investigatory Project  of class 12th CBSE
Chemistry Investigatory Project of class 12th CBSE
 
Chemistry investigatory project
Chemistry investigatory projectChemistry investigatory project
Chemistry investigatory project
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
 
Computer Science Practical File class XII
Computer Science Practical File class XIIComputer Science Practical File class XII
Computer Science Practical File class XII
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12th
 
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
PHYSICAL EDUCATION PRACTICAL FILE ( Class 12th)
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
Physics investigatory project for class 12
Physics investigatory project for class 12Physics investigatory project for class 12
Physics investigatory project for class 12
 
cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project cbse 12th chemistry investigatory project
cbse 12th chemistry investigatory project
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
 
Study of quantity of caesin present in different samples of milk
Study of quantity of caesin present in different samples of milkStudy of quantity of caesin present in different samples of milk
Study of quantity of caesin present in different samples of milk
 
Physics Investigatory Project Class XII
Physics Investigatory Project Class XIIPhysics Investigatory Project Class XII
Physics Investigatory Project Class XII
 
Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)Employee Management (CS Project for 12th CBSE)
Employee Management (CS Project for 12th CBSE)
 

Similar to Term 2 CS Practical File 2021-22.pdf

Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docxrafbolet0
 
Tactical data engineering
Tactical data engineeringTactical data engineering
Tactical data engineeringJulian Hyde
 
0_ML lab programs updated123 (3).1687933796093.doc
0_ML lab programs updated123 (3).1687933796093.doc0_ML lab programs updated123 (3).1687933796093.doc
0_ML lab programs updated123 (3).1687933796093.docRohanS38
 
Question 1Using Powerpoint, Word, Visio or any other graphical e.docx
Question 1Using Powerpoint, Word, Visio or any other graphical e.docxQuestion 1Using Powerpoint, Word, Visio or any other graphical e.docx
Question 1Using Powerpoint, Word, Visio or any other graphical e.docxIRESH3
 
Southwest Airlines Strategy and ProcessFor this discussion, add.docx
Southwest Airlines Strategy and ProcessFor this discussion, add.docxSouthwest Airlines Strategy and ProcessFor this discussion, add.docx
Southwest Airlines Strategy and ProcessFor this discussion, add.docxwilliame8
 
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...
Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...FarhanAhmade
 
PPT on Data Science Using Python
PPT on Data Science Using PythonPPT on Data Science Using Python
PPT on Data Science Using PythonNishantKumar1179
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answersdebarghyamukherjee60
 
Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000Deepak Singh
 
CBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperCBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperMalathi Senthil
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917lakshmi r
 
Assignment Java Programming 2
Assignment Java Programming 2Assignment Java Programming 2
Assignment Java Programming 2Kaela Johnson
 
Running Intelligent Applications inside a Database: Deep Learning with Python...
Running Intelligent Applications inside a Database: Deep Learning with Python...Running Intelligent Applications inside a Database: Deep Learning with Python...
Running Intelligent Applications inside a Database: Deep Learning with Python...Miguel González-Fierro
 
Data Exploration with Apache Drill: Day 1
Data Exploration with Apache Drill:  Day 1Data Exploration with Apache Drill:  Day 1
Data Exploration with Apache Drill: Day 1Charles Givre
 
Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Pritam Samanta
 
Yufeng Guo | Coding the 7 steps of machine learning | Codemotion Madrid 2018
Yufeng Guo |  Coding the 7 steps of machine learning | Codemotion Madrid 2018 Yufeng Guo |  Coding the 7 steps of machine learning | Codemotion Madrid 2018
Yufeng Guo | Coding the 7 steps of machine learning | Codemotion Madrid 2018 Codemotion
 
Computer Science Sample Paper 2
Computer Science Sample Paper 2Computer Science Sample Paper 2
Computer Science Sample Paper 2kvs
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsnoahjamessss
 

Similar to Term 2 CS Practical File 2021-22.pdf (20)

Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docxSpring 2014 CSCI 111 Final exam   of 1 61. (2 points) Fl.docx
Spring 2014 CSCI 111 Final exam of 1 61. (2 points) Fl.docx
 
Tactical data engineering
Tactical data engineeringTactical data engineering
Tactical data engineering
 
0_ML lab programs updated123 (3).1687933796093.doc
0_ML lab programs updated123 (3).1687933796093.doc0_ML lab programs updated123 (3).1687933796093.doc
0_ML lab programs updated123 (3).1687933796093.doc
 
Question 1Using Powerpoint, Word, Visio or any other graphical e.docx
Question 1Using Powerpoint, Word, Visio or any other graphical e.docxQuestion 1Using Powerpoint, Word, Visio or any other graphical e.docx
Question 1Using Powerpoint, Word, Visio or any other graphical e.docx
 
Southwest Airlines Strategy and ProcessFor this discussion, add.docx
Southwest Airlines Strategy and ProcessFor this discussion, add.docxSouthwest Airlines Strategy and ProcessFor this discussion, add.docx
Southwest Airlines Strategy and ProcessFor this discussion, add.docx
 
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...
Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...Informatics Practices (new) solution CBSE  2021, Compartment,  improvement ex...
Informatics Practices (new) solution CBSE 2021, Compartment, improvement ex...
 
1. basics of python
1. basics of python1. basics of python
1. basics of python
 
PPT on Data Science Using Python
PPT on Data Science Using PythonPPT on Data Science Using Python
PPT on Data Science Using Python
 
Class 12 computer sample paper with answers
Class 12 computer sample paper with answersClass 12 computer sample paper with answers
Class 12 computer sample paper with answers
 
Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000Cbse question paper class_xii_paper_2000
Cbse question paper class_xii_paper_2000
 
CBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question PaperCBSE Grade12, Computer Science, Sample Question Paper
CBSE Grade12, Computer Science, Sample Question Paper
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917
 
Assignment Java Programming 2
Assignment Java Programming 2Assignment Java Programming 2
Assignment Java Programming 2
 
Running Intelligent Applications inside a Database: Deep Learning with Python...
Running Intelligent Applications inside a Database: Deep Learning with Python...Running Intelligent Applications inside a Database: Deep Learning with Python...
Running Intelligent Applications inside a Database: Deep Learning with Python...
 
Data Exploration with Apache Drill: Day 1
Data Exploration with Apache Drill:  Day 1Data Exploration with Apache Drill:  Day 1
Data Exploration with Apache Drill: Day 1
 
Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game
 
Unit4_2.pdf
Unit4_2.pdfUnit4_2.pdf
Unit4_2.pdf
 
Yufeng Guo | Coding the 7 steps of machine learning | Codemotion Madrid 2018
Yufeng Guo |  Coding the 7 steps of machine learning | Codemotion Madrid 2018 Yufeng Guo |  Coding the 7 steps of machine learning | Codemotion Madrid 2018
Yufeng Guo | Coding the 7 steps of machine learning | Codemotion Madrid 2018
 
Computer Science Sample Paper 2
Computer Science Sample Paper 2Computer Science Sample Paper 2
Computer Science Sample Paper 2
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 

Recently uploaded

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 

Recently uploaded (20)

Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 

Term 2 CS Practical File 2021-22.pdf

  • 1. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 1 CENTRAL BOARD OF SECONDARY EDUCATION School Name Address A TERM 2 PRACTICAL RECORD FILE IS SUBMITTED TO DEPARTMENT OF COMPUTER SCIENCE FOR THE PARTIAL FULLFILLMENT OF AISSCE EXAMINATION SESSION - ________ SUBMITTED BY: [NAME OF STUDENT] HOD(COMPUTER):[NAME OF SUBJECT TEACHER] CLASS: [CLASS] ROLL NO: [XXXXXXX] School & CBSE Logo
  • 2. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 2 ACKNOWLEDGEMENT I wish to express my deep sense of gratitude and indebtedness to our learned teacher TEACHER’S NAME , PGT COMPUTER SCIENCE, [SCHOOL NAME] for his invaluable help, advice and guidance in the preparation of this project. I am also greatly indebted to our principal [Name of principal] and school authorities for providing me with the facilities and requisite laboratory conditions for making this practical file. I also extend my thanks to a number of teachers ,my classmates and friends who helped me to complete this practical file successfully. [Name of Student]
  • 3. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 3 CERTIFICATE This is to certify that [Name of Student] , student of Class XII, [NAME OF SCHOOL] has completed the Term I - PRACTICAL FILE during the academic year [SESSION] towards partial fulfillment of credit for the Computer Science practical evaluation of CBSE and submitted satisfactory report, as compiled in the following pages, under my supervision. Total number of practical certified are : 10. Internal Examiner Head of the Department Signature Signature External Examiner Principal Signature Seal and Signature
  • 4. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 4 No. Practical Date Signature 1 Write a menu-driven python program to implement stack operation. 2 Write a program to implement a stack for the employee details (empno, name). 3 Write a python program to check whether a string is a palindrome or not using stack. 4 Queries Set 1 (Database Fetching records) 5 Queries Set 2 (Based on Functions) 6 Queries Set 3 (DDL Commands) 7 Queries set 4 (Based on Two Tables) 8 Queries Set 5 (Group by , Order By) 9 Write a MySQL connectivity program in Python to • Create a database school • Create a table students with the specifications - ROLLNO integer, STNAME character(10) in MySQL and perform the following operations: o Insert two records in it o Display the contents of the table 10 Perform all the operations with reference to table ‘students’ through MySQL-Python connectivity.
  • 5. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 5 Part A Data Structure 1. Write a menu-driven python program to implement stack operation. Code: def check_stack_isEmpty(stk): if stk==[]: return True else: return False # An empty list to store stack elements, initially empty s=[] top = None # This is top pointer for push and pop def main_menu(): while True: print("Stack Implementation") print("1 - Push") print("2 - Pop") print("3 - Peek") print("4 - Display") print("5 - Exit") ch = int(input("Enter the your choice:")) if ch==1: el = int(input("Enter the value to push an element:")) push(s,el) elif ch==2: e=pop_stack(s) if e=="UnderFlow": print("Stack is underflow!") else: print("Element popped:",e) elif ch==3: e=pop_stack(s) if e=="UnderFlow": print("Stack is underflow!") else: print("The element on top is:",e) elif ch==4:
  • 6. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 6 display(s) elif ch==5: break else: print("Sorry, You have entered invalid option") def push(stk,e): stk.append(e) top = len(stk)-1 def display(stk): if check_stack_isEmpty(stk): print("Stack is Empty") else: top = len(stk)-1 print(stk[top],"-Top") for i in range(top-1,-1,-1): print(stk[i]) def pop_stack(stk): if check_stack_isEmpty(stk): return "UnderFlow" else: e = stk.pop() if len(stk)==0: top = None else: top = len(stk)-1 return e def peek(stk): if check_stack_isEmpty(stk): return "UnderFlow" else: top = len(stk)-1 return stk[top]
  • 7. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 7 Output:
  • 8. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 8 2. Write a program to implement a stack for the employee details (empno, name). Code: stk=[] top=-1 def line(): print('~'*100) def isEmpty(): global stk if stk==[]: print("Stack is empty!!!") else: None def push(): global stk global top empno=int(input("Enter the employee number to push:")) ename=input("Enter the employee name to push:") stk.append([empno,ename]) top=len(stk)-1 def display(): global stk global top if top==-1: isEmpty() else: top=len(stk)-1 print(stk[top],"<-top") for i in range(top-1,-1,-1): print(stk[i]) def pop_ele(): global stk global top if top==-1: isEmpty() else: stk.pop() top=top-1 def main(): while True: line()
  • 9. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 9 print("1. Push") print("2. Pop") print("3. Display") print("4. Exit") ch=int(input("Enter your choice:")) if ch==1:nm push() print("Element Pushed") elif ch==2: pop_ele() elif ch==3: display() elif ch==4: break else: print("Invalid Choice") Output:
  • 10. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 10 3. Write a python program to check whether a string is a palindrome or not using stack. Code: stack = [] top = -1 # push function def push(ele): global top top += 1 stack[top] = ele # pop function def pop(): global top ele = stack[top] top -= 1 return ele # Function that returns 1 if string is a palindrome def isPalindrome(string): global stack length = len(string) # Allocating the memory for the stack stack = ['0'] * (length + 1) # Finding the mid mid = length // 2 i = 0 while i < mid:
  • 11. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 11 push(string[i]) i += 1 # Checking if the length of the string is odd then neglect the middle character if length % 2 != 0: i += 1 # While not the end of the string while i < length: ele = pop() # If the characters differ then the given string is not a palindrome if ele != string[i]: return False i += 1 return True string = input("Enter string to check:") if isPalindrome(string): print("Yes, the string is a palindrome") else: print("No, the string is not a palindrome") Output:
  • 12. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 12 Part B sql queries 1. Consider the following MOVIE table and write the SQL queries based on it. Movie_ID MovieName Type ReleaseDate ProductionCost BusinessCost M001 The Kashmir Files Action 2022/01/26 1245000 1300000 M002 Attack Action 2022/01/28 1120000 1250000 M003 Looop Lapeta Thriller 2022/02/01 250000 300000 M004 Badhai Do Drama 2022/02/04 720000 68000 M005 Shabaash Mithu Biography 2022/02/04 1000000 800000 M006 Gehraiyaan Romance 2022/02/11 150000 120000 a) Display all information from movie. b) Display the type of movies. c) Display movieid, moviename, total_eraning by showing the business done by the movies. Claculate the business done by movie using the sum of productioncost and businesscost. d) Display movieid, moviename and productioncost for all movies with productioncost greater thatn 150000 and less than 1000000. e) Display the movie of type action and romance. f) Display the list of movies which are going to release in February, 2022. Answers: a)select * from movie;
  • 13. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 13 b) select distinct from a movie; c) select movieid, moviename, productioncost + businesscost "total earning" from movie; d)select movie_id,moviename, productioncost from movie where producst is >150000 and <1000000; e) select moviename from movie where type ='action' or type='romance';
  • 14. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 14 f) select moviename from moview where month(releasedate)=2; 2. Write following queries: a) Write a query to display cube of 5. b) Write a query to display the number 563.854741 rounding off to the next hnudred. c) Write a query to display "put" from the word "Computer". d) Write a query to display today's date into DD.MM.YYYY format. e) Write a query to display 'DIA' from the word "MEDIA". f) Write a query to display moviename - type from the table movie. g) Write a query to display first four digits of productioncost. h) Write a query to display last four digits of businesscost. i) Write a query to display weekday of release dates. j) Write a query to display dayname on which movies are going to be released. Answers: a)select pow(5,3); b)select round(563.854741,-2);
  • 15. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 15 c)select mid("Computer",4,3); d)select concat(day(now()), concat('.',month(now()), concat('.',year(now())))) "Date"; e)select right("Media",3); f)select concat(moviename,concat(' - ',type)) from movie; g)select left(productioncost,4) from movie;
  • 16. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 16 h)select right(businesscost,4) from movie; i)select weekday(releasedate) from movie; j)select dayname(releasedate) from movie; 3. Suppose your school management has decided to conduct cricket matches between students of Class XI and Class XII. Students of each class are asked to join any one of the four teams – Team Titan, Team Rockers, Team Magnet and Team Hurricane. During summer vacations, various matches will be conducted between these teams. Help your sports teacher to do the following: a) Create a database “Sports”. b) Create a table “TEAM” with following considerations: a. It should have a column TeamID for storing an integer value between 1 to 9, which refers to unique identification of a team. b. Each TeamID should have its associated name (TeamName), which should be a string of length not less than 10 characters. c. Using table level constraint, make TeamID as the primary key.
  • 17. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 17 c) Show the structure of the table TEAM using a SQL statement. d) As per the preferences of the students four teams were formed as given below. Insert these four rows in TEAM table: a. Row 1: (1, Tehlka) b. Row 2: (2, Toofan) c. Row 3: (3, Aandhi) d. Row 3: (4, Shailab) e) Show the contents of the table TEAM using a DML statement. f) Now create another table MATCH_DETAILS and insert data as shown below. Choose appropriate data types and constraints for each attribute. MatchID MatchDate FirstTeamID SecondTeamID FirstTeamScore SecondTeamScore M1 2021/12/20 1 2 107 93 M2 2021/12/21 3 4 156 158 M3 2021/12/22 1 3 86 81 M4 2021/12/23 2 4 65 67 M5 2021/12/24 1 4 52 88 M6 2021/12/25 2 3 97 68 Answers: a) create database sports; b) Creating table with the given specification create table team -> (teamid int(1), -> teamname varchar(10), primary key(teamid)); c) desc team;
  • 18. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 18 • Inserting data: mqsql> insert into team -> values(1,'Tehlka'); •Show the content of table - team: select * from team; • Creating another table: create table match_details -> (matchid varchar(2) primary key, -> matchdate date, -> firstteamid int(1) references team(teamid), -> secondteamid int(1) references team(teamid), -> firstteamscore int(3), -> secondteamscore int(3));
  • 19. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 19 4. Write following queries: a) Display the matchid, teamid, teamscore whoscored more than 70 in first ining along with team name. b) Display matchid, teamname and secondteamscore between 100 to 160. c) Display matchid, teamnames along with matchdates. d) Display unique team names e) Display matchid and matchdate played by Anadhi and Shailab. Answers: a)select match_details.matchid, match_details.firstteamid, team.teamname,match_details.firstteamscore from match_details, team where match_details.firstteamid = team.teamid and match_details.first
  • 20. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 20 b)select match_details.matchid, match_details.firstteamid, team.teamname,match_details.firstteamscore from match_details, team where match_details.firstteamid = team.teamid and match_details.firstteamscore>70; c)select matchid, teamname, firstteamid, secondteamid, matchdate from match_details, team where match_details.firstteamid = team.teamid; d)select distinct(teamname) from match_details, team where match_details.firstteamid = team.teamid; e)select matchid,matchdate from match_details, team where match_details.firstteamid = team.teamid and team.teamname in ('Aandhi','Shailab');
  • 21. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 21 5. Consider the following table and write the queries: itemno item dcode qty unitprice stockdate S005 Ballpen 102 100 10 2018/04/22 S003 Gel Pen 101 150 15 2018/03/18 S002 Pencil 102 125 5 2018/02/25 S006 Eraser 101 200 3 2018/01/12 S001 Sharpner 103 210 5 2018/06/11 S004 Compass 102 60 35 2018/05/10 S009 A4 Papers 102 160 5 2018/07/17 a) Display all the items in the ascending order of stockdate. b) Display maximum price of items for each dealer individually as per dcode from stock. c) Display all the items in descending orders of itemnames. d) Display average price of items for each dealer individually as per doce from stock which avergae price is more than 5. e) Diisplay the sum of quantity for each dcode. Answers: a) select * from stock order by stockdate;
  • 22. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 22 b) select dcode,max(unitprice) from stock group by code; c) select * from stock order by item desc; d)select dcode,avg(unitprice) from stock group by dcode having avg(unitprice)>5; e) select dcode,sum(qty) from stock group by dcode;
  • 23. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 23 Part C Python Database connectivity 1. Write a MySQL connectivity program in Python to • Create a database school • Create a table students with the specifications - ROLLNO integer, STNAME character(10) in MySQL and perform the following operations: o Insert two records in it o Display the contents of the table 2. Perform all the operations with reference to table ‘students’ through MySQL-Python connectivity. Answers: 1.Using pymysql - Code: import pymysql as ms #Function to create Database as per users choice def c_database(): try: dn=input("Enter Database Name=") c.execute("create database {}".format(dn)) c.execute("use {}".format(dn)) print("Database created successfully") except Exception as a: print("Database Error",a) #Function to Drop Database as per users choice def d_database(): try: dn=input("Enter Database Name to be dropped=") c.execute("drop database {}".format(dn)) print("Database deleted sucessfully") except Exception as a: print("Database Drop Error",a) #Function to create Table def c_table(): try: c.execute('''create table students ( rollno int(3), stname varchar(20) ); ''') print("Table created successfully") except Exception as a: print("Create Table Error",a) #Function to Insert Data
  • 24. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 24 def e_data(): try: while True: rno=int(input("Enter student rollno=")) name=input("Enter student name=") c.execute("use {}".format('school')) c.execute("insert into students values({},'{}');".format(rno,name)) db.commit() choice=input("Do you want to add more record<y/n>=") if choice in "Nn": break except Exception as a: print("Insert Record Error",a) #Function to Display Data def d_data(): try: c.execute("select * from students") data=c.fetchall() for i in data: print(i) except Exception as a: print("Display Record Error",a) db=ms.connect(host="localhost",user="root",password="root") c=db.cursor() while True: print("MENUn1. Create Databasen2. Drop Database n3. Create Tablen4. Insert Record n5. Display Entire Datan6. Exit") choice=int(input("Enter your choice<1-6>=")) if choice==1: c_database() elif choice==2: d_database() elif choice==3: c_table() elif choice==4: e_data() elif choice==5: d_data() elif choice==6: break
  • 25. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 25 else: print("Wrong option selected") Output:
  • 26. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 26 2.using mysqlconnector import mysql.connector as ms db=ms.connect(host="localhost",user="root",passwd="root",datab ase='school') cn=db.cursor() def insert_rec(): try: while True: rn=int(input("Enter roll number:")) sname=input("Enter name:") marks=float(input("Enter marks:")) gr=input("Enter grade:") cn.execute("insert into students values({},'{}',{},'{}')".format(rn,sname,marks,gr)) db.commit() ch=input("Want more records? Press (N/n) to stop entry:") if ch in 'Nn': break except Exception as e: print("Error", e) def update_rec(): try: rn=int(input("Enter rollno to update:")) marks=float(input("Enter new marks:")) gr=input("Enter Grade:") cn.execute("update students set marks={},grade='{}' where rno={}".format(marks,gr,rn)) db.commit() except Exception as e: print("Error",e) def delete_rec(): try: rn=int(input("Enter rollno to delete:")) cn.execute("delete from students where rno={}".format(rn)) db.commit() except Exception as e: print("Error",e) def view_rec(): try: cn.execute("select * from students")
  • 27. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 27 except Exception as e: print("Error",e) while True: print("MENUn1. Insert Recordn2. Update Record n3. Delete Recordn4. Display Record n5. Exit") ch=int(input("Enter your choice<1-4>=")) if ch==1: insert_rec() elif ch==2: update_rec() elif ch==3: delete_rec() elif ch==4: view_rec() elif ch==5: break else: print("Wrong option selected") Output:
  • 28. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 28
  • 29. CS PRACTICAL RECORD FILE | Downloaded from www.tutorialaicsip.com | Page 29